gossipcat 0.4.24 → 0.4.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var ng=Object.defineProperty;var lg=(c,u,f)=>u in c?ng(c,u,{enumerable:!0,configurable:!0,writable:!0,value:f}):c[u]=f;var Pe=(c,u,f)=>lg(c,typeof u!="symbol"?u+"":u,f);(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const y of h.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&o(y)}).observe(document,{childList:!0,subtree:!0});function f(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(d){if(d.ep)return;d.ep=!0;const h=f(d);fetch(d.href,h)}})();var Du={exports:{}},Va={};/**
1
+ var ng=Object.defineProperty;var lg=(c,u,f)=>u in c?ng(c,u,{enumerable:!0,configurable:!0,writable:!0,value:f}):c[u]=f;var Pe=(c,u,f)=>lg(c,typeof u!="symbol"?u+"":u,f);(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const v of h.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&o(v)}).observe(document,{childList:!0,subtree:!0});function f(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(d){if(d.ep)return;d.ep=!0;const h=f(d);fetch(d.href,h)}})();var Du={exports:{}},Va={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@ var ng=Object.defineProperty;var lg=(c,u,f)=>u in c?ng(c,u,{enumerable:!0,config
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Ff;function ag(){if(Ff)return Va;Ff=1;var c=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function f(o,d,h){var y=null;if(h!==void 0&&(y=""+h),d.key!==void 0&&(y=""+d.key),"key"in d){h={};for(var v in d)v!=="key"&&(h[v]=d[v])}else h=d;return d=h.ref,{$$typeof:c,type:o,key:y,ref:d!==void 0?d:null,props:h}}return Va.Fragment=u,Va.jsx=f,Va.jsxs=f,Va}var If;function ig(){return If||(If=1,Du.exports=ag()),Du.exports}var a=ig(),Ou={exports:{}},me={};/**
9
+ */var Ff;function ag(){if(Ff)return Va;Ff=1;var c=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function f(o,d,h){var v=null;if(h!==void 0&&(v=""+h),d.key!==void 0&&(v=""+d.key),"key"in d){h={};for(var y in d)y!=="key"&&(h[y]=d[y])}else h=d;return d=h.ref,{$$typeof:c,type:o,key:v,ref:d!==void 0?d:null,props:h}}return Va.Fragment=u,Va.jsx=f,Va.jsxs=f,Va}var If;function ig(){return If||(If=1,Du.exports=ag()),Du.exports}var a=ig(),Ou={exports:{}},me={};/**
10
10
  * @license React
11
11
  * react.production.js
12
12
  *
@@ -14,7 +14,7 @@ var ng=Object.defineProperty;var lg=(c,u,f)=>u in c?ng(c,u,{enumerable:!0,config
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Wf;function sg(){if(Wf)return me;Wf=1;var c=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),y=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),U=Symbol.iterator;function Q(p){return p===null||typeof p!="object"?null:(p=U&&p[U]||p["@@iterator"],typeof p=="function"?p:null)}var F={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I=Object.assign,X={};function de(p,D,Y){this.props=p,this.context=D,this.refs=X,this.updater=Y||F}de.prototype.isReactComponent={},de.prototype.setState=function(p,D){if(typeof p!="object"&&typeof p!="function"&&p!=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,p,D,"setState")},de.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function Z(){}Z.prototype=de.prototype;function $(p,D,Y){this.props=p,this.context=D,this.refs=X,this.updater=Y||F}var V=$.prototype=new Z;V.constructor=$,I(V,de.prototype),V.isPureReactComponent=!0;var O=Array.isArray;function ae(){}var G={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function ue(p,D,Y){var L=Y.ref;return{$$typeof:c,type:p,key:D,ref:L!==void 0?L:null,props:Y}}function oe(p,D){return ue(p.type,D,p.props)}function Se(p){return typeof p=="object"&&p!==null&&p.$$typeof===c}function J(p){var D={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(Y){return D[Y]})}var ie=/\/+/g;function he(p,D){return typeof p=="object"&&p!==null&&p.key!=null?J(""+p.key):D.toString(36)}function A(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(ae,ae):(p.status="pending",p.then(function(D){p.status==="pending"&&(p.status="fulfilled",p.value=D)},function(D){p.status==="pending"&&(p.status="rejected",p.reason=D)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function S(p,D,Y,L,ne){var ce=typeof p;(ce==="undefined"||ce==="boolean")&&(p=null);var pe=!1;if(p===null)pe=!0;else switch(ce){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(p.$$typeof){case c:case u:pe=!0;break;case _:return pe=p._init,S(pe(p._payload),D,Y,L,ne)}}if(pe)return ne=ne(p),pe=L===""?"."+he(p,0):L,O(ne)?(Y="",pe!=null&&(Y=pe.replace(ie,"$&/")+"/"),S(ne,D,Y,"",function(Lt){return Lt})):ne!=null&&(Se(ne)&&(ne=oe(ne,Y+(ne.key==null||p&&p.key===ne.key?"":(""+ne.key).replace(ie,"$&/")+"/")+pe)),D.push(ne)),1;pe=0;var Be=L===""?".":L+":";if(O(p))for(var fe=0;fe<p.length;fe++)L=p[fe],ce=Be+he(L,fe),pe+=S(L,D,Y,ce,ne);else if(fe=Q(p),typeof fe=="function")for(p=fe.call(p),fe=0;!(L=p.next()).done;)L=L.value,ce=Be+he(L,fe++),pe+=S(L,D,Y,ce,ne);else if(ce==="object"){if(typeof p.then=="function")return S(A(p),D,Y,L,ne);throw D=String(p),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return pe}function H(p,D,Y){if(p==null)return p;var L=[],ne=0;return S(p,L,"","",function(ce){return D.call(Y,ce,ne++)}),L}function K(p){if(p._status===-1){var D=p._result;D=D(),D.then(function(Y){(p._status===0||p._status===-1)&&(p._status=1,p._result=Y)},function(Y){(p._status===0||p._status===-1)&&(p._status=2,p._result=Y)}),p._status===-1&&(p._status=0,p._result=D)}if(p._status===1)return p._result.default;throw p._result}var R=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof p=="object"&&p!==null&&typeof p.message=="string"?String(p.message):String(p),error:p});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)},W={map:H,forEach:function(p,D,Y){H(p,function(){D.apply(this,arguments)},Y)},count:function(p){var D=0;return H(p,function(){D++}),D},toArray:function(p){return H(p,function(D){return D})||[]},only:function(p){if(!Se(p))throw Error("React.Children.only expected to receive a single React element child.");return p}};return me.Activity=C,me.Children=W,me.Component=de,me.Fragment=f,me.Profiler=d,me.PureComponent=$,me.StrictMode=o,me.Suspense=g,me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,me.__COMPILER_RUNTIME={__proto__:null,c:function(p){return G.H.useMemoCache(p)}},me.cache=function(p){return function(){return p.apply(null,arguments)}},me.cacheSignal=function(){return null},me.cloneElement=function(p,D,Y){if(p==null)throw Error("The argument must be a React element, but you passed "+p+".");var L=I({},p.props),ne=p.key;if(D!=null)for(ce in D.key!==void 0&&(ne=""+D.key),D)!te.call(D,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&D.ref===void 0||(L[ce]=D[ce]);var ce=arguments.length-2;if(ce===1)L.children=Y;else if(1<ce){for(var pe=Array(ce),Be=0;Be<ce;Be++)pe[Be]=arguments[Be+2];L.children=pe}return ue(p.type,ne,L)},me.createContext=function(p){return p={$$typeof:y,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null},p.Provider=p,p.Consumer={$$typeof:h,_context:p},p},me.createElement=function(p,D,Y){var L,ne={},ce=null;if(D!=null)for(L in D.key!==void 0&&(ce=""+D.key),D)te.call(D,L)&&L!=="key"&&L!=="__self"&&L!=="__source"&&(ne[L]=D[L]);var pe=arguments.length-2;if(pe===1)ne.children=Y;else if(1<pe){for(var Be=Array(pe),fe=0;fe<pe;fe++)Be[fe]=arguments[fe+2];ne.children=Be}if(p&&p.defaultProps)for(L in pe=p.defaultProps,pe)ne[L]===void 0&&(ne[L]=pe[L]);return ue(p,ce,ne)},me.createRef=function(){return{current:null}},me.forwardRef=function(p){return{$$typeof:v,render:p}},me.isValidElement=Se,me.lazy=function(p){return{$$typeof:_,_payload:{_status:-1,_result:p},_init:K}},me.memo=function(p,D){return{$$typeof:x,type:p,compare:D===void 0?null:D}},me.startTransition=function(p){var D=G.T,Y={};G.T=Y;try{var L=p(),ne=G.S;ne!==null&&ne(Y,L),typeof L=="object"&&L!==null&&typeof L.then=="function"&&L.then(ae,R)}catch(ce){R(ce)}finally{D!==null&&Y.types!==null&&(D.types=Y.types),G.T=D}},me.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},me.use=function(p){return G.H.use(p)},me.useActionState=function(p,D,Y){return G.H.useActionState(p,D,Y)},me.useCallback=function(p,D){return G.H.useCallback(p,D)},me.useContext=function(p){return G.H.useContext(p)},me.useDebugValue=function(){},me.useDeferredValue=function(p,D){return G.H.useDeferredValue(p,D)},me.useEffect=function(p,D){return G.H.useEffect(p,D)},me.useEffectEvent=function(p){return G.H.useEffectEvent(p)},me.useId=function(){return G.H.useId()},me.useImperativeHandle=function(p,D,Y){return G.H.useImperativeHandle(p,D,Y)},me.useInsertionEffect=function(p,D){return G.H.useInsertionEffect(p,D)},me.useLayoutEffect=function(p,D){return G.H.useLayoutEffect(p,D)},me.useMemo=function(p,D){return G.H.useMemo(p,D)},me.useOptimistic=function(p,D){return G.H.useOptimistic(p,D)},me.useReducer=function(p,D,Y){return G.H.useReducer(p,D,Y)},me.useRef=function(p){return G.H.useRef(p)},me.useState=function(p){return G.H.useState(p)},me.useSyncExternalStore=function(p,D,Y){return G.H.useSyncExternalStore(p,D,Y)},me.useTransition=function(){return G.H.useTransition()},me.version="19.2.4",me}var Pf;function Zu(){return Pf||(Pf=1,Ou.exports=sg()),Ou.exports}var w=Zu(),Ru={exports:{}},Za={},ku={exports:{}},Uu={};/**
17
+ */var Wf;function sg(){if(Wf)return me;Wf=1;var c=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),v=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),U=Symbol.iterator;function V(p){return p===null||typeof p!="object"?null:(p=U&&p[U]||p["@@iterator"],typeof p=="function"?p:null)}var F={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I=Object.assign,X={};function de(p,O,Y){this.props=p,this.context=O,this.refs=X,this.updater=Y||F}de.prototype.isReactComponent={},de.prototype.setState=function(p,O){if(typeof p!="object"&&typeof p!="function"&&p!=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,p,O,"setState")},de.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function Z(){}Z.prototype=de.prototype;function $(p,O,Y){this.props=p,this.context=O,this.refs=X,this.updater=Y||F}var Q=$.prototype=new Z;Q.constructor=$,I(Q,de.prototype),Q.isPureReactComponent=!0;var D=Array.isArray;function ae(){}var G={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function ue(p,O,Y){var L=Y.ref;return{$$typeof:c,type:p,key:O,ref:L!==void 0?L:null,props:Y}}function oe(p,O){return ue(p.type,O,p.props)}function Se(p){return typeof p=="object"&&p!==null&&p.$$typeof===c}function J(p){var O={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(Y){return O[Y]})}var ie=/\/+/g;function he(p,O){return typeof p=="object"&&p!==null&&p.key!=null?J(""+p.key):O.toString(36)}function A(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(ae,ae):(p.status="pending",p.then(function(O){p.status==="pending"&&(p.status="fulfilled",p.value=O)},function(O){p.status==="pending"&&(p.status="rejected",p.reason=O)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function S(p,O,Y,L,ne){var ce=typeof p;(ce==="undefined"||ce==="boolean")&&(p=null);var pe=!1;if(p===null)pe=!0;else switch(ce){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(p.$$typeof){case c:case u:pe=!0;break;case _:return pe=p._init,S(pe(p._payload),O,Y,L,ne)}}if(pe)return ne=ne(p),pe=L===""?"."+he(p,0):L,D(ne)?(Y="",pe!=null&&(Y=pe.replace(ie,"$&/")+"/"),S(ne,O,Y,"",function(Lt){return Lt})):ne!=null&&(Se(ne)&&(ne=oe(ne,Y+(ne.key==null||p&&p.key===ne.key?"":(""+ne.key).replace(ie,"$&/")+"/")+pe)),O.push(ne)),1;pe=0;var Be=L===""?".":L+":";if(D(p))for(var fe=0;fe<p.length;fe++)L=p[fe],ce=Be+he(L,fe),pe+=S(L,O,Y,ce,ne);else if(fe=V(p),typeof fe=="function")for(p=fe.call(p),fe=0;!(L=p.next()).done;)L=L.value,ce=Be+he(L,fe++),pe+=S(L,O,Y,ce,ne);else if(ce==="object"){if(typeof p.then=="function")return S(A(p),O,Y,L,ne);throw O=String(p),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return pe}function H(p,O,Y){if(p==null)return p;var L=[],ne=0;return S(p,L,"","",function(ce){return O.call(Y,ce,ne++)}),L}function K(p){if(p._status===-1){var O=p._result;O=O(),O.then(function(Y){(p._status===0||p._status===-1)&&(p._status=1,p._result=Y)},function(Y){(p._status===0||p._status===-1)&&(p._status=2,p._result=Y)}),p._status===-1&&(p._status=0,p._result=O)}if(p._status===1)return p._result.default;throw p._result}var R=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof p=="object"&&p!==null&&typeof p.message=="string"?String(p.message):String(p),error:p});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)},W={map:H,forEach:function(p,O,Y){H(p,function(){O.apply(this,arguments)},Y)},count:function(p){var O=0;return H(p,function(){O++}),O},toArray:function(p){return H(p,function(O){return O})||[]},only:function(p){if(!Se(p))throw Error("React.Children.only expected to receive a single React element child.");return p}};return me.Activity=C,me.Children=W,me.Component=de,me.Fragment=f,me.Profiler=d,me.PureComponent=$,me.StrictMode=o,me.Suspense=g,me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,me.__COMPILER_RUNTIME={__proto__:null,c:function(p){return G.H.useMemoCache(p)}},me.cache=function(p){return function(){return p.apply(null,arguments)}},me.cacheSignal=function(){return null},me.cloneElement=function(p,O,Y){if(p==null)throw Error("The argument must be a React element, but you passed "+p+".");var L=I({},p.props),ne=p.key;if(O!=null)for(ce in O.key!==void 0&&(ne=""+O.key),O)!te.call(O,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&O.ref===void 0||(L[ce]=O[ce]);var ce=arguments.length-2;if(ce===1)L.children=Y;else if(1<ce){for(var pe=Array(ce),Be=0;Be<ce;Be++)pe[Be]=arguments[Be+2];L.children=pe}return ue(p.type,ne,L)},me.createContext=function(p){return p={$$typeof:v,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null},p.Provider=p,p.Consumer={$$typeof:h,_context:p},p},me.createElement=function(p,O,Y){var L,ne={},ce=null;if(O!=null)for(L in O.key!==void 0&&(ce=""+O.key),O)te.call(O,L)&&L!=="key"&&L!=="__self"&&L!=="__source"&&(ne[L]=O[L]);var pe=arguments.length-2;if(pe===1)ne.children=Y;else if(1<pe){for(var Be=Array(pe),fe=0;fe<pe;fe++)Be[fe]=arguments[fe+2];ne.children=Be}if(p&&p.defaultProps)for(L in pe=p.defaultProps,pe)ne[L]===void 0&&(ne[L]=pe[L]);return ue(p,ce,ne)},me.createRef=function(){return{current:null}},me.forwardRef=function(p){return{$$typeof:y,render:p}},me.isValidElement=Se,me.lazy=function(p){return{$$typeof:_,_payload:{_status:-1,_result:p},_init:K}},me.memo=function(p,O){return{$$typeof:x,type:p,compare:O===void 0?null:O}},me.startTransition=function(p){var O=G.T,Y={};G.T=Y;try{var L=p(),ne=G.S;ne!==null&&ne(Y,L),typeof L=="object"&&L!==null&&typeof L.then=="function"&&L.then(ae,R)}catch(ce){R(ce)}finally{O!==null&&Y.types!==null&&(O.types=Y.types),G.T=O}},me.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},me.use=function(p){return G.H.use(p)},me.useActionState=function(p,O,Y){return G.H.useActionState(p,O,Y)},me.useCallback=function(p,O){return G.H.useCallback(p,O)},me.useContext=function(p){return G.H.useContext(p)},me.useDebugValue=function(){},me.useDeferredValue=function(p,O){return G.H.useDeferredValue(p,O)},me.useEffect=function(p,O){return G.H.useEffect(p,O)},me.useEffectEvent=function(p){return G.H.useEffectEvent(p)},me.useId=function(){return G.H.useId()},me.useImperativeHandle=function(p,O,Y){return G.H.useImperativeHandle(p,O,Y)},me.useInsertionEffect=function(p,O){return G.H.useInsertionEffect(p,O)},me.useLayoutEffect=function(p,O){return G.H.useLayoutEffect(p,O)},me.useMemo=function(p,O){return G.H.useMemo(p,O)},me.useOptimistic=function(p,O){return G.H.useOptimistic(p,O)},me.useReducer=function(p,O,Y){return G.H.useReducer(p,O,Y)},me.useRef=function(p){return G.H.useRef(p)},me.useState=function(p){return G.H.useState(p)},me.useSyncExternalStore=function(p,O,Y){return G.H.useSyncExternalStore(p,O,Y)},me.useTransition=function(){return G.H.useTransition()},me.version="19.2.4",me}var Pf;function Zu(){return Pf||(Pf=1,Ou.exports=sg()),Ou.exports}var w=Zu(),Ru={exports:{}},Za={},ku={exports:{}},Uu={};/**
18
18
  * @license React
19
19
  * scheduler.production.js
20
20
  *
@@ -22,7 +22,7 @@ var ng=Object.defineProperty;var lg=(c,u,f)=>u in c?ng(c,u,{enumerable:!0,config
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var em;function cg(){return em||(em=1,(function(c){function u(S,H){var K=S.length;S.push(H);e:for(;0<K;){var R=K-1>>>1,W=S[R];if(0<d(W,H))S[R]=H,S[K]=W,K=R;else break e}}function f(S){return S.length===0?null:S[0]}function o(S){if(S.length===0)return null;var H=S[0],K=S.pop();if(K!==H){S[0]=K;e:for(var R=0,W=S.length,p=W>>>1;R<p;){var D=2*(R+1)-1,Y=S[D],L=D+1,ne=S[L];if(0>d(Y,K))L<W&&0>d(ne,Y)?(S[R]=ne,S[L]=K,R=L):(S[R]=Y,S[D]=K,R=D);else if(L<W&&0>d(ne,K))S[R]=ne,S[L]=K,R=L;else break e}}return H}function d(S,H){var K=S.sortIndex-H.sortIndex;return K!==0?K:S.id-H.id}if(c.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;c.unstable_now=function(){return h.now()}}else{var y=Date,v=y.now();c.unstable_now=function(){return y.now()-v}}var g=[],x=[],_=1,C=null,U=3,Q=!1,F=!1,I=!1,X=!1,de=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function V(S){for(var H=f(x);H!==null;){if(H.callback===null)o(x);else if(H.startTime<=S)o(x),H.sortIndex=H.expirationTime,u(g,H);else break;H=f(x)}}function O(S){if(I=!1,V(S),!F)if(f(g)!==null)F=!0,ae||(ae=!0,J());else{var H=f(x);H!==null&&A(O,H.startTime-S)}}var ae=!1,G=-1,te=5,ue=-1;function oe(){return X?!0:!(c.unstable_now()-ue<te)}function Se(){if(X=!1,ae){var S=c.unstable_now();ue=S;var H=!0;try{e:{F=!1,I&&(I=!1,Z(G),G=-1),Q=!0;var K=U;try{t:{for(V(S),C=f(g);C!==null&&!(C.expirationTime>S&&oe());){var R=C.callback;if(typeof R=="function"){C.callback=null,U=C.priorityLevel;var W=R(C.expirationTime<=S);if(S=c.unstable_now(),typeof W=="function"){C.callback=W,V(S),H=!0;break t}C===f(g)&&o(g),V(S)}else o(g);C=f(g)}if(C!==null)H=!0;else{var p=f(x);p!==null&&A(O,p.startTime-S),H=!1}}break e}finally{C=null,U=K,Q=!1}H=void 0}}finally{H?J():ae=!1}}}var J;if(typeof $=="function")J=function(){$(Se)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,he=ie.port2;ie.port1.onmessage=Se,J=function(){he.postMessage(null)}}else J=function(){de(Se,0)};function A(S,H){G=de(function(){S(c.unstable_now())},H)}c.unstable_IdlePriority=5,c.unstable_ImmediatePriority=1,c.unstable_LowPriority=4,c.unstable_NormalPriority=3,c.unstable_Profiling=null,c.unstable_UserBlockingPriority=2,c.unstable_cancelCallback=function(S){S.callback=null},c.unstable_forceFrameRate=function(S){0>S||125<S?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<S?Math.floor(1e3/S):5},c.unstable_getCurrentPriorityLevel=function(){return U},c.unstable_next=function(S){switch(U){case 1:case 2:case 3:var H=3;break;default:H=U}var K=U;U=H;try{return S()}finally{U=K}},c.unstable_requestPaint=function(){X=!0},c.unstable_runWithPriority=function(S,H){switch(S){case 1:case 2:case 3:case 4:case 5:break;default:S=3}var K=U;U=S;try{return H()}finally{U=K}},c.unstable_scheduleCallback=function(S,H,K){var R=c.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?R+K:R):K=R,S){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=K+W,S={id:_++,callback:H,priorityLevel:S,startTime:K,expirationTime:W,sortIndex:-1},K>R?(S.sortIndex=K,u(x,S),f(g)===null&&S===f(x)&&(I?(Z(G),G=-1):I=!0,A(O,K-R))):(S.sortIndex=W,u(g,S),F||Q||(F=!0,ae||(ae=!0,J()))),S},c.unstable_shouldYield=oe,c.unstable_wrapCallback=function(S){var H=U;return function(){var K=U;U=H;try{return S.apply(this,arguments)}finally{U=K}}}})(Uu)),Uu}var tm;function ug(){return tm||(tm=1,ku.exports=cg()),ku.exports}var qu={exports:{}},st={};/**
25
+ */var em;function cg(){return em||(em=1,(function(c){function u(S,H){var K=S.length;S.push(H);e:for(;0<K;){var R=K-1>>>1,W=S[R];if(0<d(W,H))S[R]=H,S[K]=W,K=R;else break e}}function f(S){return S.length===0?null:S[0]}function o(S){if(S.length===0)return null;var H=S[0],K=S.pop();if(K!==H){S[0]=K;e:for(var R=0,W=S.length,p=W>>>1;R<p;){var O=2*(R+1)-1,Y=S[O],L=O+1,ne=S[L];if(0>d(Y,K))L<W&&0>d(ne,Y)?(S[R]=ne,S[L]=K,R=L):(S[R]=Y,S[O]=K,R=O);else if(L<W&&0>d(ne,K))S[R]=ne,S[L]=K,R=L;else break e}}return H}function d(S,H){var K=S.sortIndex-H.sortIndex;return K!==0?K:S.id-H.id}if(c.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;c.unstable_now=function(){return h.now()}}else{var v=Date,y=v.now();c.unstable_now=function(){return v.now()-y}}var g=[],x=[],_=1,C=null,U=3,V=!1,F=!1,I=!1,X=!1,de=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function Q(S){for(var H=f(x);H!==null;){if(H.callback===null)o(x);else if(H.startTime<=S)o(x),H.sortIndex=H.expirationTime,u(g,H);else break;H=f(x)}}function D(S){if(I=!1,Q(S),!F)if(f(g)!==null)F=!0,ae||(ae=!0,J());else{var H=f(x);H!==null&&A(D,H.startTime-S)}}var ae=!1,G=-1,te=5,ue=-1;function oe(){return X?!0:!(c.unstable_now()-ue<te)}function Se(){if(X=!1,ae){var S=c.unstable_now();ue=S;var H=!0;try{e:{F=!1,I&&(I=!1,Z(G),G=-1),V=!0;var K=U;try{t:{for(Q(S),C=f(g);C!==null&&!(C.expirationTime>S&&oe());){var R=C.callback;if(typeof R=="function"){C.callback=null,U=C.priorityLevel;var W=R(C.expirationTime<=S);if(S=c.unstable_now(),typeof W=="function"){C.callback=W,Q(S),H=!0;break t}C===f(g)&&o(g),Q(S)}else o(g);C=f(g)}if(C!==null)H=!0;else{var p=f(x);p!==null&&A(D,p.startTime-S),H=!1}}break e}finally{C=null,U=K,V=!1}H=void 0}}finally{H?J():ae=!1}}}var J;if(typeof $=="function")J=function(){$(Se)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,he=ie.port2;ie.port1.onmessage=Se,J=function(){he.postMessage(null)}}else J=function(){de(Se,0)};function A(S,H){G=de(function(){S(c.unstable_now())},H)}c.unstable_IdlePriority=5,c.unstable_ImmediatePriority=1,c.unstable_LowPriority=4,c.unstable_NormalPriority=3,c.unstable_Profiling=null,c.unstable_UserBlockingPriority=2,c.unstable_cancelCallback=function(S){S.callback=null},c.unstable_forceFrameRate=function(S){0>S||125<S?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<S?Math.floor(1e3/S):5},c.unstable_getCurrentPriorityLevel=function(){return U},c.unstable_next=function(S){switch(U){case 1:case 2:case 3:var H=3;break;default:H=U}var K=U;U=H;try{return S()}finally{U=K}},c.unstable_requestPaint=function(){X=!0},c.unstable_runWithPriority=function(S,H){switch(S){case 1:case 2:case 3:case 4:case 5:break;default:S=3}var K=U;U=S;try{return H()}finally{U=K}},c.unstable_scheduleCallback=function(S,H,K){var R=c.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?R+K:R):K=R,S){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=K+W,S={id:_++,callback:H,priorityLevel:S,startTime:K,expirationTime:W,sortIndex:-1},K>R?(S.sortIndex=K,u(x,S),f(g)===null&&S===f(x)&&(I?(Z(G),G=-1):I=!0,A(D,K-R))):(S.sortIndex=W,u(g,S),F||V||(F=!0,ae||(ae=!0,J()))),S},c.unstable_shouldYield=oe,c.unstable_wrapCallback=function(S){var H=U;return function(){var K=U;U=H;try{return S.apply(this,arguments)}finally{U=K}}}})(Uu)),Uu}var tm;function ug(){return tm||(tm=1,ku.exports=cg()),ku.exports}var qu={exports:{}},st={};/**
26
26
  * @license React
27
27
  * react-dom.production.js
28
28
  *
@@ -30,7 +30,7 @@ var ng=Object.defineProperty;var lg=(c,u,f)=>u in c?ng(c,u,{enumerable:!0,config
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var nm;function rg(){if(nm)return st;nm=1;var c=Zu();function u(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)x+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+g+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(){}var o={d:{f,r:function(){throw Error(u(522))},D:f,C:f,L:f,m:f,X:f,S:f,M:f},p:0,findDOMNode:null},d=Symbol.for("react.portal");function h(g,x,_){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:C==null?null:""+C,children:g,containerInfo:x,implementation:_}}var y=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(g,x){if(g==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return st.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,st.createPortal=function(g,x){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(u(299));return h(g,x,null,_)},st.flushSync=function(g){var x=y.T,_=o.p;try{if(y.T=null,o.p=2,g)return g()}finally{y.T=x,o.p=_,o.d.f()}},st.preconnect=function(g,x){typeof g=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,o.d.C(g,x))},st.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},st.preinit=function(g,x){if(typeof g=="string"&&x&&typeof x.as=="string"){var _=x.as,C=v(_,x.crossOrigin),U=typeof x.integrity=="string"?x.integrity:void 0,Q=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;_==="style"?o.d.S(g,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:C,integrity:U,fetchPriority:Q}):_==="script"&&o.d.X(g,{crossOrigin:C,integrity:U,fetchPriority:Q,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},st.preinitModule=function(g,x){if(typeof g=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var _=v(x.as,x.crossOrigin);o.d.M(g,{crossOrigin:_,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&o.d.M(g)},st.preload=function(g,x){if(typeof g=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var _=x.as,C=v(_,x.crossOrigin);o.d.L(g,_,{crossOrigin:C,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},st.preloadModule=function(g,x){if(typeof g=="string")if(x){var _=v(x.as,x.crossOrigin);o.d.m(g,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:_,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else o.d.m(g)},st.requestFormReset=function(g){o.d.r(g)},st.unstable_batchedUpdates=function(g,x){return g(x)},st.useFormState=function(g,x,_){return y.H.useFormState(g,x,_)},st.useFormStatus=function(){return y.H.useHostTransitionStatus()},st.version="19.2.4",st}var lm;function og(){if(lm)return qu.exports;lm=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(u){console.error(u)}}return c(),qu.exports=rg(),qu.exports}/**
33
+ */var nm;function rg(){if(nm)return st;nm=1;var c=Zu();function u(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)x+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+g+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(){}var o={d:{f,r:function(){throw Error(u(522))},D:f,C:f,L:f,m:f,X:f,S:f,M:f},p:0,findDOMNode:null},d=Symbol.for("react.portal");function h(g,x,_){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:C==null?null:""+C,children:g,containerInfo:x,implementation:_}}var v=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(g,x){if(g==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return st.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,st.createPortal=function(g,x){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(u(299));return h(g,x,null,_)},st.flushSync=function(g){var x=v.T,_=o.p;try{if(v.T=null,o.p=2,g)return g()}finally{v.T=x,o.p=_,o.d.f()}},st.preconnect=function(g,x){typeof g=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,o.d.C(g,x))},st.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},st.preinit=function(g,x){if(typeof g=="string"&&x&&typeof x.as=="string"){var _=x.as,C=y(_,x.crossOrigin),U=typeof x.integrity=="string"?x.integrity:void 0,V=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;_==="style"?o.d.S(g,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:C,integrity:U,fetchPriority:V}):_==="script"&&o.d.X(g,{crossOrigin:C,integrity:U,fetchPriority:V,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},st.preinitModule=function(g,x){if(typeof g=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var _=y(x.as,x.crossOrigin);o.d.M(g,{crossOrigin:_,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&o.d.M(g)},st.preload=function(g,x){if(typeof g=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var _=x.as,C=y(_,x.crossOrigin);o.d.L(g,_,{crossOrigin:C,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},st.preloadModule=function(g,x){if(typeof g=="string")if(x){var _=y(x.as,x.crossOrigin);o.d.m(g,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:_,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else o.d.m(g)},st.requestFormReset=function(g){o.d.r(g)},st.unstable_batchedUpdates=function(g,x){return g(x)},st.useFormState=function(g,x,_){return v.H.useFormState(g,x,_)},st.useFormStatus=function(){return v.H.useHostTransitionStatus()},st.version="19.2.4",st}var lm;function og(){if(lm)return qu.exports;lm=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(u){console.error(u)}}return c(),qu.exports=rg(),qu.exports}/**
34
34
  * @license React
35
35
  * react-dom-client.production.js
36
36
  *
@@ -38,34 +38,34 @@ var ng=Object.defineProperty;var lg=(c,u,f)=>u in c?ng(c,u,{enumerable:!0,config
38
38
  *
39
39
  * This source code is licensed under the MIT license found in the
40
40
  * LICENSE file in the root directory of this source tree.
41
- */var am;function dg(){if(am)return Za;am=1;var c=ug(),u=Zu(),f=og();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 h(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function y(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 v(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 g(e){if(h(e)!==e)throw Error(o(188))}function x(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return g(i),e;if(s===l)return g(i),t;s=s.sibling}throw Error(o(188))}if(n.return!==l.return)n=i,l=s;else{for(var r=!1,m=i.child;m;){if(m===n){r=!0,n=i,l=s;break}if(m===l){r=!0,l=i,n=s;break}m=m.sibling}if(!r){for(m=s.child;m;){if(m===n){r=!0,n=s,l=i;break}if(m===l){r=!0,l=s,n=i;break}m=m.sibling}if(!r)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 _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var C=Object.assign,U=Symbol.for("react.element"),Q=Symbol.for("react.transitional.element"),F=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),$=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),Se=Symbol.iterator;function J(e){return e===null||typeof e!="object"?null:(e=Se&&e[Se]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Symbol.for("react.client.reference");function he(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case I:return"Fragment";case de:return"Profiler";case X:return"StrictMode";case O:return"Suspense";case ae:return"SuspenseList";case ue:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case F:return"Portal";case $:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:he(e.type)||"Memo";case te:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var A=Array.isArray,S=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=f.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},R=[],W=-1;function p(e){return{current:e}}function D(e){0>W||(e.current=R[W],R[W]=null,W--)}function Y(e,t){W++,R[W]=e.current,e.current=t}var L=p(null),ne=p(null),ce=p(null),pe=p(null);function Be(e,t){switch(Y(ce,t),Y(ne,e),Y(L,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vf(t),e=yf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(L),Y(L,e)}function fe(){D(L),D(ne),D(ce)}function Lt(e){e.memoizedState!==null&&Y(pe,e);var t=L.current,n=yf(t,e.type);t!==n&&(Y(ne,e),Y(L,n))}function Zt(e){ne.current===e&&(D(L),D(ne)),pe.current===e&&(D(pe),Ya._currentValue=K)}var Ln,Yn;function $t(e){if(Ln===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ln=t&&t[1]||"",Yn=-1<n.stack.indexOf(`
41
+ */var am;function dg(){if(am)return Za;am=1;var c=ug(),u=Zu(),f=og();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 h(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function 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 y(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 g(e){if(h(e)!==e)throw Error(o(188))}function x(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return g(i),e;if(s===l)return g(i),t;s=s.sibling}throw Error(o(188))}if(n.return!==l.return)n=i,l=s;else{for(var r=!1,m=i.child;m;){if(m===n){r=!0,n=i,l=s;break}if(m===l){r=!0,l=i,n=s;break}m=m.sibling}if(!r){for(m=s.child;m;){if(m===n){r=!0,n=s,l=i;break}if(m===l){r=!0,l=s,n=i;break}m=m.sibling}if(!r)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 _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var C=Object.assign,U=Symbol.for("react.element"),V=Symbol.for("react.transitional.element"),F=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),$=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),Se=Symbol.iterator;function J(e){return e===null||typeof e!="object"?null:(e=Se&&e[Se]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Symbol.for("react.client.reference");function he(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case I:return"Fragment";case de:return"Profiler";case X:return"StrictMode";case D:return"Suspense";case ae:return"SuspenseList";case ue:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case F:return"Portal";case $:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case Q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:he(e.type)||"Memo";case te:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var A=Array.isArray,S=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=f.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},R=[],W=-1;function p(e){return{current:e}}function O(e){0>W||(e.current=R[W],R[W]=null,W--)}function Y(e,t){W++,R[W]=e.current,e.current=t}var L=p(null),ne=p(null),ce=p(null),pe=p(null);function Be(e,t){switch(Y(ce,t),Y(ne,e),Y(L,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vf(t),e=yf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}O(L),Y(L,e)}function fe(){O(L),O(ne),O(ce)}function Lt(e){e.memoizedState!==null&&Y(pe,e);var t=L.current,n=yf(t,e.type);t!==n&&(Y(ne,e),Y(L,n))}function Zt(e){ne.current===e&&(O(L),O(ne)),pe.current===e&&(O(pe),Ya._currentValue=K)}var Yn,Gn;function $t(e){if(Yn===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Yn=t&&t[1]||"",Gn=-1<n.stack.indexOf(`
42
42
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Ln+e+Yn}var Gn=!1;function ml(e,t){if(!e||Gn)return"";Gn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(z){var M=z}Reflect.construct(e,[],B)}else{try{B.call()}catch(z){M=z}e.call(B.prototype)}}else{try{throw Error()}catch(z){M=z}(B=e())&&typeof B.catch=="function"&&B.catch(function(){})}}catch(z){if(z&&M&&typeof z.stack=="string")return[z.stack,M.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=l.DetermineComponentFrameRoot(),r=s[0],m=s[1];if(r&&m){var b=r.split(`
43
+ `+Yn+e+Gn}var Xn=!1;function ml(e,t){if(!e||Xn)return"";Xn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(z){var M=z}Reflect.construct(e,[],B)}else{try{B.call()}catch(z){M=z}e.call(B.prototype)}}else{try{throw Error()}catch(z){M=z}(B=e())&&typeof B.catch=="function"&&B.catch(function(){})}}catch(z){if(z&&M&&typeof z.stack=="string")return[z.stack,M.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=l.DetermineComponentFrameRoot(),r=s[0],m=s[1];if(r&&m){var b=r.split(`
44
44
  `),E=m.split(`
45
45
  `);for(i=l=0;l<b.length&&!b[l].includes("DetermineComponentFrameRoot");)l++;for(;i<E.length&&!E[i].includes("DetermineComponentFrameRoot");)i++;if(l===b.length||i===E.length)for(l=b.length-1,i=E.length-1;1<=l&&0<=i&&b[l]!==E[i];)i--;for(;1<=l&&0<=i;l--,i--)if(b[l]!==E[i]){if(l!==1||i!==1)do if(l--,i--,0>i||b[l]!==E[i]){var k=`
46
- `+b[l].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),k}while(1<=l&&0<=i);break}}}finally{Gn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?$t(n):""}function Xn(e,t){switch(e.tag){case 26:case 27:case 5:return $t(e.type);case 16:return $t("Lazy");case 13:return e.child!==t&&t!==null?$t("Suspense Fallback"):$t("Suspense");case 19:return $t("SuspenseList");case 0:case 15:return ml(e.type,!1);case 11:return ml(e.type.render,!1);case 1:return ml(e.type,!0);case 31:return $t("Activity");default:return""}}function hl(e){try{var t="",n=null;do t+=Xn(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
46
+ `+b[l].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),k}while(1<=l&&0<=i);break}}}finally{Xn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?$t(n):""}function Qn(e,t){switch(e.tag){case 26:case 27:case 5:return $t(e.type);case 16:return $t("Lazy");case 13:return e.child!==t&&t!==null?$t("Suspense Fallback"):$t("Suspense");case 19:return $t("SuspenseList");case 0:case 15:return ml(e.type,!1);case 11:return ml(e.type.render,!1);case 1:return ml(e.type,!0);case 31:return $t("Activity");default:return""}}function hl(e){try{var t="",n=null;do t+=Qn(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
47
47
  Error generating stack: `+l.message+`
48
- `+l.stack}}var P=Object.prototype.hasOwnProperty,ke=c.unstable_scheduleCallback,Fe=c.unstable_cancelCallback,et=c.unstable_shouldYield,Ut=c.unstable_requestPaint,Ue=c.unstable_now,Qn=c.unstable_getCurrentPriorityLevel,Vn=c.unstable_ImmediatePriority,Fu=c.unstable_UserBlockingPriority,Ja=c.unstable_NormalPriority,qm=c.unstable_LowPriority,Iu=c.unstable_IdlePriority,Hm=c.log,Bm=c.unstable_setDisableYieldValue,Pl=null,pt=null;function mn(e){if(typeof Hm=="function"&&Bm(e),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(Pl,e)}catch{}}var bt=Math.clz32?Math.clz32:Gm,Lm=Math.log,Ym=Math.LN2;function Gm(e){return e>>>=0,e===0?32:31-(Lm(e)/Ym|0)|0}var Fa=256,Ia=262144,Wa=4194304;function Zn(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 Pa(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,s=e.suspendedLanes,r=e.pingedLanes;e=e.warmLanes;var m=l&134217727;return m!==0?(l=m&~s,l!==0?i=Zn(l):(r&=m,r!==0?i=Zn(r):n||(n=m&~e,n!==0&&(i=Zn(n))))):(m=l&~s,m!==0?i=Zn(m):r!==0?i=Zn(r):n||(n=l&~e,n!==0&&(i=Zn(n)))),i===0?0:t!==0&&t!==i&&(t&s)===0&&(s=i&-i,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:i}function ea(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xm(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 Wu(){var e=Wa;return Wa<<=1,(Wa&62914560)===0&&(Wa=4194304),e}function ys(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ta(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qm(e,t,n,l,i,s){var r=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 m=e.entanglements,b=e.expirationTimes,E=e.hiddenUpdates;for(n=r&~n;0<n;){var k=31-bt(n),B=1<<k;m[k]=0,b[k]=-1;var M=E[k];if(M!==null)for(E[k]=null,k=0;k<M.length;k++){var z=M[k];z!==null&&(z.lane&=-536870913)}n&=~B}l!==0&&Pu(e,l,0),s!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=s&~(r&~t))}function Pu(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-bt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function er(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-bt(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function tr(e,t){var n=t&-t;return n=(n&42)!==0?1:js(n),(n&(e.suspendedLanes|t))!==0?0:n}function js(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 Ns(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function nr(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Xf(e.type))}function lr(e,t){var n=H.p;try{return H.p=e,t()}finally{H.p=n}}var hn=Math.random().toString(36).slice(2),tt="__reactFiber$"+hn,ot="__reactProps$"+hn,xl="__reactContainer$"+hn,Ss="__reactEvents$"+hn,Vm="__reactListeners$"+hn,Zm="__reactHandles$"+hn,ar="__reactResources$"+hn,na="__reactMarker$"+hn;function _s(e){delete e[tt],delete e[ot],delete e[Ss],delete e[Vm],delete e[Zm]}function gl(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[xl]||n[tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Af(e);e!==null;){if(n=e[tt])return n;e=Af(e)}return t}e=n,n=e.parentNode}return null}function pl(e){if(e=e[tt]||e[xl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function la(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function bl(e){var t=e[ar];return t||(t=e[ar]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ie(e){e[na]=!0}var ir=new Set,sr={};function $n(e,t){vl(e,t),vl(e+"Capture",t)}function vl(e,t){for(sr[e]=t,e=0;e<t.length;e++)ir.add(t[e])}var $m=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]*$"),cr={},ur={};function Km(e){return P.call(ur,e)?!0:P.call(cr,e)?!1:$m.test(e)?ur[e]=!0:(cr[e]=!0,!1)}function ei(e,t,n){if(Km(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 ti(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 Kt(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 Et(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function rr(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jm(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var i=l.get,s=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(r){n=""+r,s.call(this,r)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(r){n=""+r},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ts(e){if(!e._valueTracker){var t=rr(e)?"checked":"value";e._valueTracker=Jm(e,t,""+e[t])}}function or(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=rr(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function ni(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 Fm=/[\n"\\]/g;function At(e){return e.replace(Fm,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Es(e,t,n,l,i,s,r,m){e.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?e.type=r:e.removeAttribute("type"),t!=null?r==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Et(t)):e.value!==""+Et(t)&&(e.value=""+Et(t)):r!=="submit"&&r!=="reset"||e.removeAttribute("value"),t!=null?As(e,r,Et(t)):n!=null?As(e,r,Et(n)):l!=null&&e.removeAttribute("value"),i==null&&s!=null&&(e.defaultChecked=!!s),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+Et(m):e.removeAttribute("name")}function dr(e,t,n,l,i,s,r,m){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){Ts(e);return}n=n!=null?""+Et(n):"",t=t!=null?""+Et(t):n,m||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=m?e.checked:!!l,e.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.name=r),Ts(e)}function As(e,t,n){t==="number"&&ni(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function yl(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Et(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function fr(e,t,n){if(t!=null&&(t=""+Et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Et(n):""}function mr(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if(A(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Et(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Ts(e)}function jl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Im=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 hr(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||Im.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function xr(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&hr(e,i,l)}else for(var s in t)t.hasOwnProperty(s)&&hr(e,s,t[s])}function Ms(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 Wm=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"]]),Pm=/^[\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 li(e){return Pm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Jt(){}var ws=null;function Cs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nl=null,Sl=null;function gr(e){var t=pl(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;e:switch(e=t.stateNode,t.type){case"input":if(Es(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="'+At(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[ot]||null;if(!i)throw Error(o(90));Es(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&or(l)}break e;case"textarea":fr(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&yl(e,!!n.multiple,t,!1)}}}var zs=!1;function pr(e,t,n){if(zs)return e(t,n);zs=!0;try{var l=e(t);return l}finally{if(zs=!1,(Nl!==null||Sl!==null)&&(Qi(),Nl&&(t=Nl,e=Sl,Sl=Nl=null,gr(t),e)))for(t=0;t<e.length;t++)gr(e[t])}}function aa(e,t){var n=e.stateNode;if(n===null)return null;var l=n[ot]||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 Ft=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ds=!1;if(Ft)try{var ia={};Object.defineProperty(ia,"passive",{get:function(){Ds=!0}}),window.addEventListener("test",ia,ia),window.removeEventListener("test",ia,ia)}catch{Ds=!1}var xn=null,Os=null,ai=null;function br(){if(ai)return ai;var e,t=Os,n=t.length,l,i="value"in xn?xn.value:xn.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var r=n-e;for(l=1;l<=r&&t[n-l]===i[s-l];l++);return ai=i.slice(e,1<l?1-l:void 0)}function ii(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 si(){return!0}function vr(){return!1}function dt(e){function t(n,l,i,s,r){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=s,this.target=r,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(n=e[m],this[m]=n?n(s):s[m]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?si:vr,this.isPropagationStopped=vr,this}return C(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=si)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=si)},persist:function(){},isPersistent:si}),t}var Kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ci=dt(Kn),sa=C({},Kn,{view:0,detail:0}),eh=dt(sa),Rs,ks,ca,ui=C({},sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qs,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!==ca&&(ca&&e.type==="mousemove"?(Rs=e.screenX-ca.screenX,ks=e.screenY-ca.screenY):ks=Rs=0,ca=e),Rs)},movementY:function(e){return"movementY"in e?e.movementY:ks}}),yr=dt(ui),th=C({},ui,{dataTransfer:0}),nh=dt(th),lh=C({},sa,{relatedTarget:0}),Us=dt(lh),ah=C({},Kn,{animationName:0,elapsedTime:0,pseudoElement:0}),ih=dt(ah),sh=C({},Kn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ch=dt(sh),uh=C({},Kn,{data:0}),jr=dt(uh),rh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oh={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"},dh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=dh[e])?!!t[e]:!1}function qs(){return fh}var mh=C({},sa,{key:function(e){if(e.key){var t=rh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ii(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?oh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qs,charCode:function(e){return e.type==="keypress"?ii(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ii(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hh=dt(mh),xh=C({},ui,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nr=dt(xh),gh=C({},sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qs}),ph=dt(gh),bh=C({},Kn,{propertyName:0,elapsedTime:0,pseudoElement:0}),vh=dt(bh),yh=C({},ui,{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}),jh=dt(yh),Nh=C({},Kn,{newState:0,oldState:0}),Sh=dt(Nh),_h=[9,13,27,32],Hs=Ft&&"CompositionEvent"in window,ua=null;Ft&&"documentMode"in document&&(ua=document.documentMode);var Th=Ft&&"TextEvent"in window&&!ua,Sr=Ft&&(!Hs||ua&&8<ua&&11>=ua),_r=" ",Tr=!1;function Er(e,t){switch(e){case"keyup":return _h.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ar(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _l=!1;function Eh(e,t){switch(e){case"compositionend":return Ar(t);case"keypress":return t.which!==32?null:(Tr=!0,_r);case"textInput":return e=t.data,e===_r&&Tr?null:e;default:return null}}function Ah(e,t){if(_l)return e==="compositionend"||!Hs&&Er(e,t)?(e=br(),ai=Os=xn=null,_l=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Sr&&t.locale!=="ko"?null:t.data;default:return null}}var Mh={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 Mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mh[e.type]:t==="textarea"}function wr(e,t,n,l){Nl?Sl?Sl.push(l):Sl=[l]:Nl=l,t=Ii(t,"onChange"),0<t.length&&(n=new ci("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var ra=null,oa=null;function wh(e){mf(e,0)}function ri(e){var t=la(e);if(or(t))return e}function Cr(e,t){if(e==="change")return t}var zr=!1;if(Ft){var Bs;if(Ft){var Ls="oninput"in document;if(!Ls){var Dr=document.createElement("div");Dr.setAttribute("oninput","return;"),Ls=typeof Dr.oninput=="function"}Bs=Ls}else Bs=!1;zr=Bs&&(!document.documentMode||9<document.documentMode)}function Or(){ra&&(ra.detachEvent("onpropertychange",Rr),oa=ra=null)}function Rr(e){if(e.propertyName==="value"&&ri(oa)){var t=[];wr(t,oa,e,Cs(e)),pr(wh,t)}}function Ch(e,t,n){e==="focusin"?(Or(),ra=t,oa=n,ra.attachEvent("onpropertychange",Rr)):e==="focusout"&&Or()}function zh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ri(oa)}function Dh(e,t){if(e==="click")return ri(t)}function Oh(e,t){if(e==="input"||e==="change")return ri(t)}function Rh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vt=typeof Object.is=="function"?Object.is:Rh;function da(e,t){if(vt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var i=n[l];if(!P.call(t,i)||!vt(e[i],t[i]))return!1}return!0}function kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ur(e,t){var n=kr(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=kr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ni(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=ni(e.document)}return t}function Ys(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 kh=Ft&&"documentMode"in document&&11>=document.documentMode,Tl=null,Gs=null,fa=null,Xs=!1;function Br(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xs||Tl==null||Tl!==ni(l)||(l=Tl,"selectionStart"in l&&Ys(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}),fa&&da(fa,l)||(fa=l,l=Ii(Gs,"onSelect"),0<l.length&&(t=new ci("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Tl)))}function Jn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var El={animationend:Jn("Animation","AnimationEnd"),animationiteration:Jn("Animation","AnimationIteration"),animationstart:Jn("Animation","AnimationStart"),transitionrun:Jn("Transition","TransitionRun"),transitionstart:Jn("Transition","TransitionStart"),transitioncancel:Jn("Transition","TransitionCancel"),transitionend:Jn("Transition","TransitionEnd")},Qs={},Lr={};Ft&&(Lr=document.createElement("div").style,"AnimationEvent"in window||(delete El.animationend.animation,delete El.animationiteration.animation,delete El.animationstart.animation),"TransitionEvent"in window||delete El.transitionend.transition);function Fn(e){if(Qs[e])return Qs[e];if(!El[e])return e;var t=El[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Qs[e]=t[n];return e}var Yr=Fn("animationend"),Gr=Fn("animationiteration"),Xr=Fn("animationstart"),Uh=Fn("transitionrun"),qh=Fn("transitionstart"),Hh=Fn("transitioncancel"),Qr=Fn("transitionend"),Vr=new Map,Vs="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(" ");Vs.push("scrollEnd");function qt(e,t){Vr.set(e,t),$n(t,[e])}var oi=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)},Mt=[],Al=0,Zs=0;function di(){for(var e=Al,t=Zs=Al=0;t<e;){var n=Mt[t];Mt[t++]=null;var l=Mt[t];Mt[t++]=null;var i=Mt[t];Mt[t++]=null;var s=Mt[t];if(Mt[t++]=null,l!==null&&i!==null){var r=l.pending;r===null?i.next=i:(i.next=r.next,r.next=i),l.pending=i}s!==0&&Zr(n,i,s)}}function fi(e,t,n,l){Mt[Al++]=e,Mt[Al++]=t,Mt[Al++]=n,Mt[Al++]=l,Zs|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function $s(e,t,n,l){return fi(e,t,n,l),mi(e)}function In(e,t){return fi(e,null,null,t),mi(e)}function Zr(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,s=e.return;s!==null;)s.childLanes|=n,l=s.alternate,l!==null&&(l.childLanes|=n),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(i=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,i&&t!==null&&(i=31-bt(n),e=s.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),s):null}function mi(e){if(50<Ra)throw Ra=0,nu=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ml={};function Bh(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 yt(e,t,n,l){return new Bh(e,t,n,l)}function Ks(e){return e=e.prototype,!(!e||!e.isReactComponent)}function It(e,t){var n=e.alternate;return n===null?(n=yt(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 $r(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 hi(e,t,n,l,i,s){var r=0;if(l=e,typeof e=="function")Ks(e)&&(r=1);else if(typeof e=="string")r=Qx(e,n,L.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ue:return e=yt(31,n,t,i),e.elementType=ue,e.lanes=s,e;case I:return Wn(n.children,i,s,t);case X:r=8,i|=24;break;case de:return e=yt(12,n,t,i|2),e.elementType=de,e.lanes=s,e;case O:return e=yt(13,n,t,i),e.elementType=O,e.lanes=s,e;case ae:return e=yt(19,n,t,i),e.elementType=ae,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $:r=10;break e;case Z:r=9;break e;case V:r=11;break e;case G:r=14;break e;case te:r=16,l=null;break e}r=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=yt(r,n,t,i),t.elementType=e,t.type=l,t.lanes=s,t}function Wn(e,t,n,l){return e=yt(7,e,l,t),e.lanes=n,e}function Js(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function Kr(e){var t=yt(18,null,null,0);return t.stateNode=e,t}function Fs(e,t,n){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Jr=new WeakMap;function wt(e,t){if(typeof e=="object"&&e!==null){var n=Jr.get(e);return n!==void 0?n:(t={value:e,source:t,stack:hl(t)},Jr.set(e,t),t)}return{value:e,source:t,stack:hl(t)}}var wl=[],Cl=0,xi=null,ma=0,Ct=[],zt=0,gn=null,Yt=1,Gt="";function Wt(e,t){wl[Cl++]=ma,wl[Cl++]=xi,xi=e,ma=t}function Fr(e,t,n){Ct[zt++]=Yt,Ct[zt++]=Gt,Ct[zt++]=gn,gn=e;var l=Yt;e=Gt;var i=32-bt(l)-1;l&=~(1<<i),n+=1;var s=32-bt(t)+i;if(30<s){var r=i-i%5;s=(l&(1<<r)-1).toString(32),l>>=r,i-=r,Yt=1<<32-bt(t)+i|n<<i|l,Gt=s+e}else Yt=1<<s|n<<i|l,Gt=e}function Is(e){e.return!==null&&(Wt(e,1),Fr(e,1,0))}function Ws(e){for(;e===xi;)xi=wl[--Cl],wl[Cl]=null,ma=wl[--Cl],wl[Cl]=null;for(;e===gn;)gn=Ct[--zt],Ct[zt]=null,Gt=Ct[--zt],Ct[zt]=null,Yt=Ct[--zt],Ct[zt]=null}function Ir(e,t){Ct[zt++]=Yt,Ct[zt++]=Gt,Ct[zt++]=gn,Yt=t.id,Gt=t.overflow,gn=e}var nt=null,Oe=null,Ne=!1,pn=null,Dt=!1,Ps=Error(o(519));function bn(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ha(wt(t,e)),Ps}function Wr(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[tt]=e,t[ot]=l,n){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(n=0;n<Ua.length;n++)ve(Ua[n],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),dr(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),mr(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||pf(t.textContent,n)?(l.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),l.onScroll!=null&&ve("scroll",t),l.onScrollEnd!=null&&ve("scrollend",t),l.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||bn(e,!0)}function Pr(e){for(nt=e.return;nt;)switch(nt.tag){case 5:case 31:case 13:Dt=!1;return;case 27:case 3:Dt=!0;return;default:nt=nt.return}}function zl(e){if(e!==nt)return!1;if(!Ne)return Pr(e),Ne=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||pu(e.type,e.memoizedProps)),n=!n),n&&Oe&&bn(e),Pr(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Oe=Ef(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Oe=Ef(e)}else t===27?(t=Oe,Dn(e.type)?(e=Nu,Nu=null,Oe=e):Oe=t):Oe=nt?Rt(e.stateNode.nextSibling):null;return!0}function Pn(){Oe=nt=null,Ne=!1}function ec(){var e=pn;return e!==null&&(xt===null?xt=e:xt.push.apply(xt,e),pn=null),e}function ha(e){pn===null?pn=[e]:pn.push(e)}var tc=p(null),el=null,Pt=null;function vn(e,t,n){Y(tc,t._currentValue),t._currentValue=n}function en(e){e._currentValue=tc.current,D(tc)}function nc(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 lc(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var s=i.dependencies;if(s!==null){var r=i.child;s=s.firstContext;e:for(;s!==null;){var m=s;s=i;for(var b=0;b<t.length;b++)if(m.context===t[b]){s.lanes|=n,m=s.alternate,m!==null&&(m.lanes|=n),nc(s.return,n,e),l||(r=null);break e}s=m.next}}else if(i.tag===18){if(r=i.return,r===null)throw Error(o(341));r.lanes|=n,s=r.alternate,s!==null&&(s.lanes|=n),nc(r,n,e),r=null}else r=i.child;if(r!==null)r.return=i;else for(r=i;r!==null;){if(r===e){r=null;break}if(i=r.sibling,i!==null){i.return=r.return,r=i;break}r=r.return}i=r}}function Dl(e,t,n,l){e=null;for(var i=t,s=!1;i!==null;){if(!s){if((i.flags&524288)!==0)s=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var r=i.alternate;if(r===null)throw Error(o(387));if(r=r.memoizedProps,r!==null){var m=i.type;vt(i.pendingProps.value,r.value)||(e!==null?e.push(m):e=[m])}}else if(i===pe.current){if(r=i.alternate,r===null)throw Error(o(387));r.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Ya):e=[Ya])}i=i.return}e!==null&&lc(t,e,n,l),t.flags|=262144}function gi(e){for(e=e.firstContext;e!==null;){if(!vt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function tl(e){el=e,Pt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function lt(e){return eo(el,e)}function pi(e,t){return el===null&&tl(e),eo(e,t)}function eo(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Pt===null){if(e===null)throw Error(o(308));Pt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pt=Pt.next=t;return n}var Lh=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()})}},Yh=c.unstable_scheduleCallback,Gh=c.unstable_NormalPriority,Ve={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ac(){return{controller:new Lh,data:new Map,refCount:0}}function xa(e){e.refCount--,e.refCount===0&&Yh(Gh,function(){e.controller.abort()})}var ga=null,ic=0,Ol=0,Rl=null;function Xh(e,t){if(ga===null){var n=ga=[];ic=0,Ol=uu(),Rl={status:"pending",value:void 0,then:function(l){n.push(l)}}}return ic++,t.then(to,to),t}function to(){if(--ic===0&&ga!==null){Rl!==null&&(Rl.status="fulfilled");var e=ga;ga=null,Ol=0,Rl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Qh(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),l}var no=S.S;S.S=function(e,t){Ld=Ue(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Xh(e,t),no!==null&&no(e,t)};var nl=p(null);function sc(){var e=nl.current;return e!==null?e:De.pooledCache}function bi(e,t){t===null?Y(nl,nl.current):Y(nl,t.pool)}function lo(){var e=sc();return e===null?null:{parent:Ve._currentValue,pool:e}}var kl=Error(o(460)),cc=Error(o(474)),vi=Error(o(542)),yi={then:function(){}};function ao(e){return e=e.status,e==="fulfilled"||e==="rejected"}function io(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jt,Jt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,co(e),e;default:if(typeof t.status=="string")t.then(Jt,Jt);else{if(e=De,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,co(e),e}throw al=t,kl}}function ll(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(al=n,kl):n}}var al=null;function so(){if(al===null)throw Error(o(459));var e=al;return al=null,e}function co(e){if(e===kl||e===vi)throw Error(o(483))}var Ul=null,pa=0;function ji(e){var t=pa;return pa+=1,Ul===null&&(Ul=[]),io(Ul,e,t)}function ba(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ni(e,t){throw t.$$typeof===U?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function uo(e){function t(N,j){if(e){var T=N.deletions;T===null?(N.deletions=[j],N.flags|=16):T.push(j)}}function n(N,j){if(!e)return null;for(;j!==null;)t(N,j),j=j.sibling;return null}function l(N){for(var j=new Map;N!==null;)N.key!==null?j.set(N.key,N):j.set(N.index,N),N=N.sibling;return j}function i(N,j){return N=It(N,j),N.index=0,N.sibling=null,N}function s(N,j,T){return N.index=T,e?(T=N.alternate,T!==null?(T=T.index,T<j?(N.flags|=67108866,j):T):(N.flags|=67108866,j)):(N.flags|=1048576,j)}function r(N){return e&&N.alternate===null&&(N.flags|=67108866),N}function m(N,j,T,q){return j===null||j.tag!==6?(j=Js(T,N.mode,q),j.return=N,j):(j=i(j,T),j.return=N,j)}function b(N,j,T,q){var se=T.type;return se===I?k(N,j,T.props.children,q,T.key):j!==null&&(j.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===te&&ll(se)===j.type)?(j=i(j,T.props),ba(j,T),j.return=N,j):(j=hi(T.type,T.key,T.props,null,N.mode,q),ba(j,T),j.return=N,j)}function E(N,j,T,q){return j===null||j.tag!==4||j.stateNode.containerInfo!==T.containerInfo||j.stateNode.implementation!==T.implementation?(j=Fs(T,N.mode,q),j.return=N,j):(j=i(j,T.children||[]),j.return=N,j)}function k(N,j,T,q,se){return j===null||j.tag!==7?(j=Wn(T,N.mode,q,se),j.return=N,j):(j=i(j,T),j.return=N,j)}function B(N,j,T){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=Js(""+j,N.mode,T),j.return=N,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Q:return T=hi(j.type,j.key,j.props,null,N.mode,T),ba(T,j),T.return=N,T;case F:return j=Fs(j,N.mode,T),j.return=N,j;case te:return j=ll(j),B(N,j,T)}if(A(j)||J(j))return j=Wn(j,N.mode,T,null),j.return=N,j;if(typeof j.then=="function")return B(N,ji(j),T);if(j.$$typeof===$)return B(N,pi(N,j),T);Ni(N,j)}return null}function M(N,j,T,q){var se=j!==null?j.key:null;if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return se!==null?null:m(N,j,""+T,q);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case Q:return T.key===se?b(N,j,T,q):null;case F:return T.key===se?E(N,j,T,q):null;case te:return T=ll(T),M(N,j,T,q)}if(A(T)||J(T))return se!==null?null:k(N,j,T,q,null);if(typeof T.then=="function")return M(N,j,ji(T),q);if(T.$$typeof===$)return M(N,j,pi(N,T),q);Ni(N,T)}return null}function z(N,j,T,q,se){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return N=N.get(T)||null,m(j,N,""+q,se);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case Q:return N=N.get(q.key===null?T:q.key)||null,b(j,N,q,se);case F:return N=N.get(q.key===null?T:q.key)||null,E(j,N,q,se);case te:return q=ll(q),z(N,j,T,q,se)}if(A(q)||J(q))return N=N.get(T)||null,k(j,N,q,se,null);if(typeof q.then=="function")return z(N,j,T,ji(q),se);if(q.$$typeof===$)return z(N,j,T,pi(j,q),se);Ni(j,q)}return null}function ee(N,j,T,q){for(var se=null,_e=null,le=j,ge=j=0,je=null;le!==null&&ge<T.length;ge++){le.index>ge?(je=le,le=null):je=le.sibling;var Te=M(N,le,T[ge],q);if(Te===null){le===null&&(le=je);break}e&&le&&Te.alternate===null&&t(N,le),j=s(Te,j,ge),_e===null?se=Te:_e.sibling=Te,_e=Te,le=je}if(ge===T.length)return n(N,le),Ne&&Wt(N,ge),se;if(le===null){for(;ge<T.length;ge++)le=B(N,T[ge],q),le!==null&&(j=s(le,j,ge),_e===null?se=le:_e.sibling=le,_e=le);return Ne&&Wt(N,ge),se}for(le=l(le);ge<T.length;ge++)je=z(le,N,ge,T[ge],q),je!==null&&(e&&je.alternate!==null&&le.delete(je.key===null?ge:je.key),j=s(je,j,ge),_e===null?se=je:_e.sibling=je,_e=je);return e&&le.forEach(function(qn){return t(N,qn)}),Ne&&Wt(N,ge),se}function re(N,j,T,q){if(T==null)throw Error(o(151));for(var se=null,_e=null,le=j,ge=j=0,je=null,Te=T.next();le!==null&&!Te.done;ge++,Te=T.next()){le.index>ge?(je=le,le=null):je=le.sibling;var qn=M(N,le,Te.value,q);if(qn===null){le===null&&(le=je);break}e&&le&&qn.alternate===null&&t(N,le),j=s(qn,j,ge),_e===null?se=qn:_e.sibling=qn,_e=qn,le=je}if(Te.done)return n(N,le),Ne&&Wt(N,ge),se;if(le===null){for(;!Te.done;ge++,Te=T.next())Te=B(N,Te.value,q),Te!==null&&(j=s(Te,j,ge),_e===null?se=Te:_e.sibling=Te,_e=Te);return Ne&&Wt(N,ge),se}for(le=l(le);!Te.done;ge++,Te=T.next())Te=z(le,N,ge,Te.value,q),Te!==null&&(e&&Te.alternate!==null&&le.delete(Te.key===null?ge:Te.key),j=s(Te,j,ge),_e===null?se=Te:_e.sibling=Te,_e=Te);return e&&le.forEach(function(tg){return t(N,tg)}),Ne&&Wt(N,ge),se}function ze(N,j,T,q){if(typeof T=="object"&&T!==null&&T.type===I&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case Q:e:{for(var se=T.key;j!==null;){if(j.key===se){if(se=T.type,se===I){if(j.tag===7){n(N,j.sibling),q=i(j,T.props.children),q.return=N,N=q;break e}}else if(j.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===te&&ll(se)===j.type){n(N,j.sibling),q=i(j,T.props),ba(q,T),q.return=N,N=q;break e}n(N,j);break}else t(N,j);j=j.sibling}T.type===I?(q=Wn(T.props.children,N.mode,q,T.key),q.return=N,N=q):(q=hi(T.type,T.key,T.props,null,N.mode,q),ba(q,T),q.return=N,N=q)}return r(N);case F:e:{for(se=T.key;j!==null;){if(j.key===se)if(j.tag===4&&j.stateNode.containerInfo===T.containerInfo&&j.stateNode.implementation===T.implementation){n(N,j.sibling),q=i(j,T.children||[]),q.return=N,N=q;break e}else{n(N,j);break}else t(N,j);j=j.sibling}q=Fs(T,N.mode,q),q.return=N,N=q}return r(N);case te:return T=ll(T),ze(N,j,T,q)}if(A(T))return ee(N,j,T,q);if(J(T)){if(se=J(T),typeof se!="function")throw Error(o(150));return T=se.call(T),re(N,j,T,q)}if(typeof T.then=="function")return ze(N,j,ji(T),q);if(T.$$typeof===$)return ze(N,j,pi(N,T),q);Ni(N,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,j!==null&&j.tag===6?(n(N,j.sibling),q=i(j,T),q.return=N,N=q):(n(N,j),q=Js(T,N.mode,q),q.return=N,N=q),r(N)):n(N,j)}return function(N,j,T,q){try{pa=0;var se=ze(N,j,T,q);return Ul=null,se}catch(le){if(le===kl||le===vi)throw le;var _e=yt(29,le,null,N.mode);return _e.lanes=q,_e.return=N,_e}finally{}}}var il=uo(!0),ro=uo(!1),yn=!1;function uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rc(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 jn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Nn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ee&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=mi(e),Zr(e,null,n),t}return fi(e,l,t,n),mi(e)}function va(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,er(e,n)}}function oc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?i=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 dc=!1;function ya(){if(dc){var e=Rl;if(e!==null)throw e}}function ja(e,t,n,l){dc=!1;var i=e.updateQueue;yn=!1;var s=i.firstBaseUpdate,r=i.lastBaseUpdate,m=i.shared.pending;if(m!==null){i.shared.pending=null;var b=m,E=b.next;b.next=null,r===null?s=E:r.next=E,r=b;var k=e.alternate;k!==null&&(k=k.updateQueue,m=k.lastBaseUpdate,m!==r&&(m===null?k.firstBaseUpdate=E:m.next=E,k.lastBaseUpdate=b))}if(s!==null){var B=i.baseState;r=0,k=E=b=null,m=s;do{var M=m.lane&-536870913,z=M!==m.lane;if(z?(ye&M)===M:(l&M)===M){M!==0&&M===Ol&&(dc=!0),k!==null&&(k=k.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var ee=e,re=m;M=t;var ze=n;switch(re.tag){case 1:if(ee=re.payload,typeof ee=="function"){B=ee.call(ze,B,M);break e}B=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=re.payload,M=typeof ee=="function"?ee.call(ze,B,M):ee,M==null)break e;B=C({},B,M);break e;case 2:yn=!0}}M=m.callback,M!==null&&(e.flags|=64,z&&(e.flags|=8192),z=i.callbacks,z===null?i.callbacks=[M]:z.push(M))}else z={lane:M,tag:m.tag,payload:m.payload,callback:m.callback,next:null},k===null?(E=k=z,b=B):k=k.next=z,r|=M;if(m=m.next,m===null){if(m=i.shared.pending,m===null)break;z=m,m=z.next,z.next=null,i.lastBaseUpdate=z,i.shared.pending=null}}while(!0);k===null&&(b=B),i.baseState=b,i.firstBaseUpdate=E,i.lastBaseUpdate=k,s===null&&(i.shared.lanes=0),An|=r,e.lanes=r,e.memoizedState=B}}function oo(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function fo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)oo(n[e],t)}var ql=p(null),Si=p(0);function mo(e,t){e=on,Y(Si,e),Y(ql,t),on=e|t.baseLanes}function fc(){Y(Si,on),Y(ql,ql.current)}function mc(){on=Si.current,D(ql),D(Si)}var jt=p(null),Ot=null;function Sn(e){var t=e.alternate;Y(Ge,Ge.current&1),Y(jt,e),Ot===null&&(t===null||ql.current!==null||t.memoizedState!==null)&&(Ot=e)}function hc(e){Y(Ge,Ge.current),Y(jt,e),Ot===null&&(Ot=e)}function ho(e){e.tag===22?(Y(Ge,Ge.current),Y(jt,e),Ot===null&&(Ot=e)):_n()}function _n(){Y(Ge,Ge.current),Y(jt,jt.current)}function Nt(e){D(jt),Ot===e&&(Ot=null),D(Ge)}var Ge=p(0);function _i(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||yu(n)||ju(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 tn=0,xe=null,we=null,Ze=null,Ti=!1,Hl=!1,sl=!1,Ei=0,Na=0,Bl=null,Vh=0;function Le(){throw Error(o(321))}function xc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vt(e[n],t[n]))return!1;return!0}function gc(e,t,n,l,i,s){return tn=s,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,S.H=e===null||e.memoizedState===null?Io:zc,sl=!1,s=n(l,i),sl=!1,Hl&&(s=go(t,n,l,i)),xo(e),s}function xo(e){S.H=Ta;var t=we!==null&&we.next!==null;if(tn=0,Ze=we=xe=null,Ti=!1,Na=0,Bl=null,t)throw Error(o(300));e===null||$e||(e=e.dependencies,e!==null&&gi(e)&&($e=!0))}function go(e,t,n,l){xe=e;var i=0;do{if(Hl&&(Bl=null),Na=0,Hl=!1,25<=i)throw Error(o(301));if(i+=1,Ze=we=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}S.H=Wo,s=t(n,l)}while(Hl);return s}function Zh(){var e=S.H,t=e.useState()[0];return t=typeof t.then=="function"?Sa(t):t,e=e.useState()[0],(we!==null?we.memoizedState:null)!==e&&(xe.flags|=1024),t}function pc(){var e=Ei!==0;return Ei=0,e}function bc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function vc(e){if(Ti){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ti=!1}tn=0,Ze=we=xe=null,Hl=!1,Na=Ei=0,Bl=null}function ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?xe.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Xe(){if(we===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=we.next;var t=Ze===null?xe.memoizedState:Ze.next;if(t!==null)Ze=t,we=e;else{if(e===null)throw xe.alternate===null?Error(o(467)):Error(o(310));we=e,e={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},Ze===null?xe.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function Ai(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sa(e){var t=Na;return Na+=1,Bl===null&&(Bl=[]),e=io(Bl,e,t),t=xe,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,S.H=t===null||t.memoizedState===null?Io:zc),e}function Mi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sa(e);if(e.$$typeof===$)return lt(e)}throw Error(o(438,String(e)))}function yc(e){var t=null,n=xe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=xe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ai(),xe.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]=oe;return t.index++,n}function nn(e,t){return typeof t=="function"?t(e):t}function wi(e){var t=Xe();return jc(t,we,e)}function jc(e,t,n){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=n;var i=e.baseQueue,s=l.pending;if(s!==null){if(i!==null){var r=i.next;i.next=s.next,s.next=r}t.baseQueue=i=s,l.pending=null}if(s=e.baseState,i===null)e.memoizedState=s;else{t=i.next;var m=r=null,b=null,E=t,k=!1;do{var B=E.lane&-536870913;if(B!==E.lane?(ye&B)===B:(tn&B)===B){var M=E.revertLane;if(M===0)b!==null&&(b=b.next={lane:0,revertLane:0,gesture:null,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null}),B===Ol&&(k=!0);else if((tn&M)===M){E=E.next,M===Ol&&(k=!0);continue}else B={lane:0,revertLane:E.revertLane,gesture:null,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null},b===null?(m=b=B,r=s):b=b.next=B,xe.lanes|=M,An|=M;B=E.action,sl&&n(s,B),s=E.hasEagerState?E.eagerState:n(s,B)}else M={lane:B,revertLane:E.revertLane,gesture:E.gesture,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null},b===null?(m=b=M,r=s):b=b.next=M,xe.lanes|=B,An|=B;E=E.next}while(E!==null&&E!==t);if(b===null?r=s:b.next=m,!vt(s,e.memoizedState)&&($e=!0,k&&(n=Rl,n!==null)))throw n;e.memoizedState=s,e.baseState=r,e.baseQueue=b,l.lastRenderedState=s}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Nc(e){var t=Xe(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var r=i=i.next;do s=e(s,r.action),r=r.next;while(r!==i);vt(s,t.memoizedState)||($e=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,l]}function po(e,t,n){var l=xe,i=Xe(),s=Ne;if(s){if(n===void 0)throw Error(o(407));n=n()}else n=t();var r=!vt((we||i).memoizedState,n);if(r&&(i.memoizedState=n,$e=!0),i=i.queue,Tc(yo.bind(null,l,i,e),[e]),i.getSnapshot!==t||r||Ze!==null&&Ze.memoizedState.tag&1){if(l.flags|=2048,Ll(9,{destroy:void 0},vo.bind(null,l,i,n,t),null),De===null)throw Error(o(349));s||(tn&127)!==0||bo(l,t,n)}return n}function bo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xe.updateQueue,t===null?(t=Ai(),xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vo(e,t,n,l){t.value=n,t.getSnapshot=l,jo(t)&&No(e)}function yo(e,t,n){return n(function(){jo(t)&&No(e)})}function jo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vt(e,n)}catch{return!0}}function No(e){var t=In(e,2);t!==null&&gt(t,e,2)}function Sc(e){var t=ct();if(typeof e=="function"){var n=e;if(e=n(),sl){mn(!0);try{n()}finally{mn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nn,lastRenderedState:e},t}function So(e,t,n,l){return e.baseState=n,jc(e,we,typeof l=="function"?l:nn)}function $h(e,t,n,l,i){if(Di(e))throw Error(o(485));if(e=t.action,e!==null){var s={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(r){s.listeners.push(r)}};S.T!==null?n(!0):s.isTransition=!1,l(s),n=t.pending,n===null?(s.next=t.pending=s,_o(t,s)):(s.next=n.next,t.pending=n.next=s)}}function _o(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var s=S.T,r={};S.T=r;try{var m=n(i,l),b=S.S;b!==null&&b(r,m),To(e,t,m)}catch(E){_c(e,t,E)}finally{s!==null&&r.types!==null&&(s.types=r.types),S.T=s}}else try{s=n(i,l),To(e,t,s)}catch(E){_c(e,t,E)}}function To(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Eo(e,t,l)},function(l){return _c(e,t,l)}):Eo(e,t,n)}function Eo(e,t,n){t.status="fulfilled",t.value=n,Ao(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,_o(e,n)))}function _c(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Ao(t),t=t.next;while(t!==l)}e.action=null}function Ao(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Mo(e,t){return t}function wo(e,t){if(Ne){var n=De.formState;if(n!==null){e:{var l=xe;if(Ne){if(Oe){t:{for(var i=Oe,s=Dt;i.nodeType!==8;){if(!s){i=null;break t}if(i=Rt(i.nextSibling),i===null){i=null;break t}}s=i.data,i=s==="F!"||s==="F"?i:null}if(i){Oe=Rt(i.nextSibling),l=i.data==="F!";break e}}bn(l)}l=!1}l&&(t=n[0])}}return n=ct(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:t},n.queue=l,n=Ko.bind(null,xe,l),l.dispatch=n,l=Sc(!1),s=Cc.bind(null,xe,!1,l.queue),l=ct(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=$h.bind(null,xe,i,s,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function Co(e){var t=Xe();return zo(t,we,e)}function zo(e,t,n){if(t=jc(e,t,Mo)[0],e=wi(nn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Sa(t)}catch(r){throw r===kl?vi:r}else l=t;t=Xe();var i=t.queue,s=i.dispatch;return n!==t.memoizedState&&(xe.flags|=2048,Ll(9,{destroy:void 0},Kh.bind(null,i,n),null)),[l,s,e]}function Kh(e,t){e.action=t}function Do(e){var t=Xe(),n=we;if(n!==null)return zo(t,n,e);Xe(),t=t.memoizedState,n=Xe();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Ll(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=xe.updateQueue,t===null&&(t=Ai(),xe.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 Oo(){return Xe().memoizedState}function Ci(e,t,n,l){var i=ct();xe.flags|=e,i.memoizedState=Ll(1|t,{destroy:void 0},n,l===void 0?null:l)}function zi(e,t,n,l){var i=Xe();l=l===void 0?null:l;var s=i.memoizedState.inst;we!==null&&l!==null&&xc(l,we.memoizedState.deps)?i.memoizedState=Ll(t,s,n,l):(xe.flags|=e,i.memoizedState=Ll(1|t,s,n,l))}function Ro(e,t){Ci(8390656,8,e,t)}function Tc(e,t){zi(2048,8,e,t)}function Jh(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=Ai(),xe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ko(e){var t=Xe().memoizedState;return Jh({ref:t,nextImpl:e}),function(){if((Ee&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Uo(e,t){return zi(4,2,e,t)}function qo(e,t){return zi(4,4,e,t)}function Ho(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 Bo(e,t,n){n=n!=null?n.concat([e]):null,zi(4,4,Ho.bind(null,t,e),n)}function Ec(){}function Lo(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&xc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Yo(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&xc(t,l[1]))return l[0];if(l=e(),sl){mn(!0);try{e()}finally{mn(!1)}}return n.memoizedState=[l,t],l}function Ac(e,t,n){return n===void 0||(tn&1073741824)!==0&&(ye&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Gd(),xe.lanes|=e,An|=e,n)}function Go(e,t,n,l){return vt(n,t)?n:ql.current!==null?(e=Ac(e,n,l),vt(e,t)||($e=!0),e):(tn&42)===0||(tn&1073741824)!==0&&(ye&261930)===0?($e=!0,e.memoizedState=n):(e=Gd(),xe.lanes|=e,An|=e,t)}function Xo(e,t,n,l,i){var s=H.p;H.p=s!==0&&8>s?s:8;var r=S.T,m={};S.T=m,Cc(e,!1,t,n);try{var b=i(),E=S.S;if(E!==null&&E(m,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var k=Qh(b,l);_a(e,t,k,Tt(e))}else _a(e,t,l,Tt(e))}catch(B){_a(e,t,{then:function(){},status:"rejected",reason:B},Tt())}finally{H.p=s,r!==null&&m.types!==null&&(r.types=m.types),S.T=r}}function Fh(){}function Mc(e,t,n,l){if(e.tag!==5)throw Error(o(476));var i=Qo(e).queue;Xo(e,i,t,K,n===null?Fh:function(){return Vo(e),n(l)})}function Qo(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nn,lastRenderedState:K},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Vo(e){var t=Qo(e);t.next===null&&(t=e.alternate.memoizedState),_a(e,t.next.queue,{},Tt())}function wc(){return lt(Ya)}function Zo(){return Xe().memoizedState}function $o(){return Xe().memoizedState}function Ih(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tt();e=jn(n);var l=Nn(t,e,n);l!==null&&(gt(l,t,n),va(l,t,n)),t={cache:ac()},e.payload=t;return}t=t.return}}function Wh(e,t,n){var l=Tt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Di(e)?Jo(t,n):(n=$s(e,t,n,l),n!==null&&(gt(n,e,l),Fo(n,t,l)))}function Ko(e,t,n){var l=Tt();_a(e,t,n,l)}function _a(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Di(e))Jo(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var r=t.lastRenderedState,m=s(r,n);if(i.hasEagerState=!0,i.eagerState=m,vt(m,r))return fi(e,t,i,0),De===null&&di(),!1}catch{}finally{}if(n=$s(e,t,i,l),n!==null)return gt(n,e,l),Fo(n,t,l),!0}return!1}function Cc(e,t,n,l){if(l={lane:2,revertLane:uu(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Di(e)){if(t)throw Error(o(479))}else t=$s(e,n,l,2),t!==null&&gt(t,e,2)}function Di(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function Jo(e,t){Hl=Ti=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fo(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,er(e,n)}}var Ta={readContext:lt,use:Mi,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useLayoutEffect:Le,useInsertionEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useSyncExternalStore:Le,useId:Le,useHostTransitionStatus:Le,useFormState:Le,useActionState:Le,useOptimistic:Le,useMemoCache:Le,useCacheRefresh:Le};Ta.useEffectEvent=Le;var Io={readContext:lt,use:Mi,useCallback:function(e,t){return ct().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:Ro,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ci(4194308,4,Ho.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ci(4194308,4,e,t)},useInsertionEffect:function(e,t){Ci(4,2,e,t)},useMemo:function(e,t){var n=ct();t=t===void 0?null:t;var l=e();if(sl){mn(!0);try{e()}finally{mn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=ct();if(n!==void 0){var i=n(t);if(sl){mn(!0);try{n(t)}finally{mn(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=Wh.bind(null,xe,e),[l.memoizedState,e]},useRef:function(e){var t=ct();return e={current:e},t.memoizedState=e},useState:function(e){e=Sc(e);var t=e.queue,n=Ko.bind(null,xe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ec,useDeferredValue:function(e,t){var n=ct();return Ac(n,e,t)},useTransition:function(){var e=Sc(!1);return e=Xo.bind(null,xe,e.queue,!0,!1),ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=xe,i=ct();if(Ne){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),De===null)throw Error(o(349));(ye&127)!==0||bo(l,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Ro(yo.bind(null,l,s,e),[e]),l.flags|=2048,Ll(9,{destroy:void 0},vo.bind(null,l,s,n,t),null),n},useId:function(){var e=ct(),t=De.identifierPrefix;if(Ne){var n=Gt,l=Yt;n=(l&~(1<<32-bt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Ei++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Vh++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:wc,useFormState:wo,useActionState:wo,useOptimistic:function(e){var t=ct();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Cc.bind(null,xe,!0,n),n.dispatch=t,[e,t]},useMemoCache:yc,useCacheRefresh:function(){return ct().memoizedState=Ih.bind(null,xe)},useEffectEvent:function(e){var t=ct(),n={impl:e};return t.memoizedState=n,function(){if((Ee&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},zc={readContext:lt,use:Mi,useCallback:Lo,useContext:lt,useEffect:Tc,useImperativeHandle:Bo,useInsertionEffect:Uo,useLayoutEffect:qo,useMemo:Yo,useReducer:wi,useRef:Oo,useState:function(){return wi(nn)},useDebugValue:Ec,useDeferredValue:function(e,t){var n=Xe();return Go(n,we.memoizedState,e,t)},useTransition:function(){var e=wi(nn)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Sa(e),t]},useSyncExternalStore:po,useId:Zo,useHostTransitionStatus:wc,useFormState:Co,useActionState:Co,useOptimistic:function(e,t){var n=Xe();return So(n,we,e,t)},useMemoCache:yc,useCacheRefresh:$o};zc.useEffectEvent=ko;var Wo={readContext:lt,use:Mi,useCallback:Lo,useContext:lt,useEffect:Tc,useImperativeHandle:Bo,useInsertionEffect:Uo,useLayoutEffect:qo,useMemo:Yo,useReducer:Nc,useRef:Oo,useState:function(){return Nc(nn)},useDebugValue:Ec,useDeferredValue:function(e,t){var n=Xe();return we===null?Ac(n,e,t):Go(n,we.memoizedState,e,t)},useTransition:function(){var e=Nc(nn)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Sa(e),t]},useSyncExternalStore:po,useId:Zo,useHostTransitionStatus:wc,useFormState:Do,useActionState:Do,useOptimistic:function(e,t){var n=Xe();return we!==null?So(n,we,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:yc,useCacheRefresh:$o};Wo.useEffectEvent=ko;function Dc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:C({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Oc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=Tt(),i=jn(l);i.payload=t,n!=null&&(i.callback=n),t=Nn(e,i,l),t!==null&&(gt(t,e,l),va(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=Tt(),i=jn(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Nn(e,i,l),t!==null&&(gt(t,e,l),va(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tt(),l=jn(n);l.tag=2,t!=null&&(l.callback=t),t=Nn(e,l,n),t!==null&&(gt(t,e,n),va(t,e,n))}};function Po(e,t,n,l,i,s,r){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,s,r):t.prototype&&t.prototype.isPureReactComponent?!da(n,l)||!da(i,s):!0}function ed(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&&Oc.enqueueReplaceState(t,t.state,null)}function cl(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=C({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function td(e){oi(e)}function nd(e){console.error(e)}function ld(e){oi(e)}function Oi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function ad(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Rc(e,t,n){return n=jn(n),n.tag=3,n.payload={element:null},n.callback=function(){Oi(e,t)},n}function id(e){return e=jn(e),e.tag=3,e}function sd(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var s=l.value;e.payload=function(){return i(s)},e.callback=function(){ad(t,n,l)}}var r=n.stateNode;r!==null&&typeof r.componentDidCatch=="function"&&(e.callback=function(){ad(t,n,l),typeof i!="function"&&(Mn===null?Mn=new Set([this]):Mn.add(this));var m=l.stack;this.componentDidCatch(l.value,{componentStack:m!==null?m:""})})}function Ph(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Dl(t,n,i,!0),n=jt.current,n!==null){switch(n.tag){case 31:case 13:return Ot===null?Vi():n.alternate===null&&Ye===0&&(Ye=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===yi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),iu(e,l,i)),!1;case 22:return n.flags|=65536,l===yi?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)),iu(e,l,i)),!1}throw Error(o(435,n.tag))}return iu(e,l,i),Vi(),!1}if(Ne)return t=jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==Ps&&(e=Error(o(422),{cause:l}),ha(wt(e,n)))):(l!==Ps&&(t=Error(o(423),{cause:l}),ha(wt(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=wt(l,n),i=Rc(e.stateNode,l,i),oc(e,i),Ye!==4&&(Ye=2)),!1;var s=Error(o(520),{cause:l});if(s=wt(s,n),Oa===null?Oa=[s]:Oa.push(s),Ye!==4&&(Ye=2),t===null)return!0;l=wt(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Rc(n.stateNode,l,e),oc(n,e),!1;case 1:if(t=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Mn===null||!Mn.has(s))))return n.flags|=65536,i&=-i,n.lanes|=i,i=id(i),sd(i,e,n,l),oc(n,i),!1}n=n.return}while(n!==null);return!1}var kc=Error(o(461)),$e=!1;function at(e,t,n,l){t.child=e===null?ro(t,null,n,l):il(t,e.child,n,l)}function cd(e,t,n,l,i){n=n.render;var s=t.ref;if("ref"in l){var r={};for(var m in l)m!=="ref"&&(r[m]=l[m])}else r=l;return tl(t),l=gc(e,t,n,r,s,i),m=pc(),e!==null&&!$e?(bc(e,t,i),ln(e,t,i)):(Ne&&m&&Is(t),t.flags|=1,at(e,t,l,i),t.child)}function ud(e,t,n,l,i){if(e===null){var s=n.type;return typeof s=="function"&&!Ks(s)&&s.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=s,rd(e,t,s,l,i)):(e=hi(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!Xc(e,i)){var r=s.memoizedProps;if(n=n.compare,n=n!==null?n:da,n(r,l)&&e.ref===t.ref)return ln(e,t,i)}return t.flags|=1,e=It(s,l),e.ref=t.ref,e.return=t,t.child=e}function rd(e,t,n,l,i){if(e!==null){var s=e.memoizedProps;if(da(s,l)&&e.ref===t.ref)if($e=!1,t.pendingProps=l=s,Xc(e,i))(e.flags&131072)!==0&&($e=!0);else return t.lanes=e.lanes,ln(e,t,i)}return Uc(e,t,n,l,i)}function od(e,t,n,l){var i=l.children,s=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(s=s!==null?s.baseLanes|n:n,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~s}else l=0,t.child=null;return dd(e,t,s,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bi(t,s!==null?s.cachePool:null),s!==null?mo(t,s):fc(),ho(t);else return l=t.lanes=536870912,dd(e,t,s!==null?s.baseLanes|n:n,n,l)}else s!==null?(bi(t,s.cachePool),mo(t,s),_n(),t.memoizedState=null):(e!==null&&bi(t,null),fc(),_n());return at(e,t,i,n),t.child}function Ea(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dd(e,t,n,l,i){var s=sc();return s=s===null?null:{parent:Ve._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},e!==null&&bi(t,null),fc(),ho(t),e!==null&&Dl(e,t,l,!0),t.childLanes=i,null}function Ri(e,t){return t=Ui({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fd(e,t,n){return il(t,e.child,null,n),e=Ri(t,t.pendingProps),e.flags|=2,Nt(t),t.memoizedState=null,e}function ex(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ne){if(l.mode==="hidden")return e=Ri(t,l),t.lanes=536870912,Ea(null,e);if(hc(t),(e=Oe)?(e=Tf(e,Dt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gn!==null?{id:Yt,overflow:Gt}:null,retryLane:536870912,hydrationErrors:null},n=Kr(e),n.return=t,t.child=n,nt=t,Oe=null)):e=null,e===null)throw bn(t);return t.lanes=536870912,null}return Ri(t,l)}var s=e.memoizedState;if(s!==null){var r=s.dehydrated;if(hc(t),i)if(t.flags&256)t.flags&=-257,t=fd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if($e||Dl(e,t,n,!1),i=(n&e.childLanes)!==0,$e||i){if(l=De,l!==null&&(r=tr(l,n),r!==0&&r!==s.retryLane))throw s.retryLane=r,In(e,r),gt(l,e,r),kc;Vi(),t=fd(e,t,n)}else e=s.treeContext,Oe=Rt(r.nextSibling),nt=t,Ne=!0,pn=null,Dt=!1,e!==null&&Ir(t,e),t=Ri(t,l),t.flags|=4096;return t}return e=It(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ki(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 Uc(e,t,n,l,i){return tl(t),n=gc(e,t,n,l,void 0,i),l=pc(),e!==null&&!$e?(bc(e,t,i),ln(e,t,i)):(Ne&&l&&Is(t),t.flags|=1,at(e,t,n,i),t.child)}function md(e,t,n,l,i,s){return tl(t),t.updateQueue=null,n=go(t,l,n,i),xo(e),l=pc(),e!==null&&!$e?(bc(e,t,s),ln(e,t,s)):(Ne&&l&&Is(t),t.flags|=1,at(e,t,n,s),t.child)}function hd(e,t,n,l,i){if(tl(t),t.stateNode===null){var s=Ml,r=n.contextType;typeof r=="object"&&r!==null&&(s=lt(r)),s=new n(l,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Oc,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=l,s.state=t.memoizedState,s.refs={},uc(t),r=n.contextType,s.context=typeof r=="object"&&r!==null?lt(r):Ml,s.state=t.memoizedState,r=n.getDerivedStateFromProps,typeof r=="function"&&(Dc(t,n,r,l),s.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(r=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),r!==s.state&&Oc.enqueueReplaceState(s,s.state,null),ja(t,l,s,i),ya(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){s=t.stateNode;var m=t.memoizedProps,b=cl(n,m);s.props=b;var E=s.context,k=n.contextType;r=Ml,typeof k=="object"&&k!==null&&(r=lt(k));var B=n.getDerivedStateFromProps;k=typeof B=="function"||typeof s.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,k||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(m||E!==r)&&ed(t,s,l,r),yn=!1;var M=t.memoizedState;s.state=M,ja(t,l,s,i),ya(),E=t.memoizedState,m||M!==E||yn?(typeof B=="function"&&(Dc(t,n,B,l),E=t.memoizedState),(b=yn||Po(t,n,b,l,M,E,r))?(k||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=E),s.props=l,s.state=E,s.context=r,l=b):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{s=t.stateNode,rc(e,t),r=t.memoizedProps,k=cl(n,r),s.props=k,B=t.pendingProps,M=s.context,E=n.contextType,b=Ml,typeof E=="object"&&E!==null&&(b=lt(E)),m=n.getDerivedStateFromProps,(E=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(r!==B||M!==b)&&ed(t,s,l,b),yn=!1,M=t.memoizedState,s.state=M,ja(t,l,s,i),ya();var z=t.memoizedState;r!==B||M!==z||yn||e!==null&&e.dependencies!==null&&gi(e.dependencies)?(typeof m=="function"&&(Dc(t,n,m,l),z=t.memoizedState),(k=yn||Po(t,n,k,l,M,z,b)||e!==null&&e.dependencies!==null&&gi(e.dependencies))?(E||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(l,z,b),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(l,z,b)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||r===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=z),s.props=l,s.state=z,s.context=b,l=k):(typeof s.componentDidUpdate!="function"||r===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),l=!1)}return s=l,ki(e,t),l=(t.flags&128)!==0,s||l?(s=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&l?(t.child=il(t,e.child,null,i),t.child=il(t,null,n,i)):at(e,t,n,i),t.memoizedState=s.state,e=t.child):e=ln(e,t,i),e}function xd(e,t,n,l){return Pn(),t.flags|=256,at(e,t,n,l),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hc(e){return{baseLanes:e,cachePool:lo()}}function Bc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=_t),e}function gd(e,t,n){var l=t.pendingProps,i=!1,s=(t.flags&128)!==0,r;if((r=s)||(r=e!==null&&e.memoizedState===null?!1:(Ge.current&2)!==0),r&&(i=!0,t.flags&=-129),r=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ne){if(i?Sn(t):_n(),(e=Oe)?(e=Tf(e,Dt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gn!==null?{id:Yt,overflow:Gt}:null,retryLane:536870912,hydrationErrors:null},n=Kr(e),n.return=t,t.child=n,nt=t,Oe=null)):e=null,e===null)throw bn(t);return ju(e)?t.lanes=32:t.lanes=536870912,null}var m=l.children;return l=l.fallback,i?(_n(),i=t.mode,m=Ui({mode:"hidden",children:m},i),l=Wn(l,i,n,null),m.return=t,l.return=t,m.sibling=l,t.child=m,l=t.child,l.memoizedState=Hc(n),l.childLanes=Bc(e,r,n),t.memoizedState=qc,Ea(null,l)):(Sn(t),Lc(t,m))}var b=e.memoizedState;if(b!==null&&(m=b.dehydrated,m!==null)){if(s)t.flags&256?(Sn(t),t.flags&=-257,t=Yc(e,t,n)):t.memoizedState!==null?(_n(),t.child=e.child,t.flags|=128,t=null):(_n(),m=l.fallback,i=t.mode,l=Ui({mode:"visible",children:l.children},i),m=Wn(m,i,n,null),m.flags|=2,l.return=t,m.return=t,l.sibling=m,t.child=l,il(t,e.child,null,n),l=t.child,l.memoizedState=Hc(n),l.childLanes=Bc(e,r,n),t.memoizedState=qc,t=Ea(null,l));else if(Sn(t),ju(m)){if(r=m.nextSibling&&m.nextSibling.dataset,r)var E=r.dgst;r=E,l=Error(o(419)),l.stack="",l.digest=r,ha({value:l,source:null,stack:null}),t=Yc(e,t,n)}else if($e||Dl(e,t,n,!1),r=(n&e.childLanes)!==0,$e||r){if(r=De,r!==null&&(l=tr(r,n),l!==0&&l!==b.retryLane))throw b.retryLane=l,In(e,l),gt(r,e,l),kc;yu(m)||Vi(),t=Yc(e,t,n)}else yu(m)?(t.flags|=192,t.child=e.child,t=null):(e=b.treeContext,Oe=Rt(m.nextSibling),nt=t,Ne=!0,pn=null,Dt=!1,e!==null&&Ir(t,e),t=Lc(t,l.children),t.flags|=4096);return t}return i?(_n(),m=l.fallback,i=t.mode,b=e.child,E=b.sibling,l=It(b,{mode:"hidden",children:l.children}),l.subtreeFlags=b.subtreeFlags&65011712,E!==null?m=It(E,m):(m=Wn(m,i,n,null),m.flags|=2),m.return=t,l.return=t,l.sibling=m,t.child=l,Ea(null,l),l=t.child,m=e.child.memoizedState,m===null?m=Hc(n):(i=m.cachePool,i!==null?(b=Ve._currentValue,i=i.parent!==b?{parent:b,pool:b}:i):i=lo(),m={baseLanes:m.baseLanes|n,cachePool:i}),l.memoizedState=m,l.childLanes=Bc(e,r,n),t.memoizedState=qc,Ea(e.child,l)):(Sn(t),n=e.child,e=n.sibling,n=It(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function Lc(e,t){return t=Ui({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ui(e,t){return e=yt(22,e,null,t),e.lanes=0,e}function Yc(e,t,n){return il(t,e.child,null,n),e=Lc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pd(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),nc(e.return,t,n)}function Gc(e,t,n,l,i,s){var r=e.memoizedState;r===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:s}:(r.isBackwards=t,r.rendering=null,r.renderingStartTime=0,r.last=l,r.tail=n,r.tailMode=i,r.treeForkCount=s)}function bd(e,t,n){var l=t.pendingProps,i=l.revealOrder,s=l.tail;l=l.children;var r=Ge.current,m=(r&2)!==0;if(m?(r=r&1|2,t.flags|=128):r&=1,Y(Ge,r),at(e,t,l,n),l=Ne?ma:0,!m&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&pd(e,n,t);else if(e.tag===19)pd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&_i(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Gc(t,!1,i,n,s,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&_i(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Gc(t,!0,n,null,s,l);break;case"together":Gc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),An|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Dl(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=It(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=It(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Xc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&gi(e)))}function tx(e,t,n){switch(t.tag){case 3:Be(t,t.stateNode.containerInfo),vn(t,Ve,e.memoizedState.cache),Pn();break;case 27:case 5:Lt(t);break;case 4:Be(t,t.stateNode.containerInfo);break;case 10:vn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,hc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Sn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?gd(e,t,n):(Sn(t),e=ln(e,t,n),e!==null?e.sibling:null);Sn(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Dl(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return bd(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Y(Ge,Ge.current),l)break;return null;case 22:return t.lanes=0,od(e,t,n,t.pendingProps);case 24:vn(t,Ve,e.memoizedState.cache)}return ln(e,t,n)}function vd(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)$e=!0;else{if(!Xc(e,n)&&(t.flags&128)===0)return $e=!1,tx(e,t,n);$e=(e.flags&131072)!==0}else $e=!1,Ne&&(t.flags&1048576)!==0&&Fr(t,ma,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=ll(t.elementType),t.type=e,typeof e=="function")Ks(e)?(l=cl(e,l),t.tag=1,t=hd(null,t,e,l,n)):(t.tag=0,t=Uc(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===V){t.tag=11,t=cd(null,t,e,l,n);break e}else if(i===G){t.tag=14,t=ud(null,t,e,l,n);break e}}throw t=he(e)||e,Error(o(306,t,""))}}return t;case 0:return Uc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=cl(l,t.pendingProps),hd(e,t,l,i,n);case 3:e:{if(Be(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var s=t.memoizedState;i=s.element,rc(e,t),ja(t,l,null,n);var r=t.memoizedState;if(l=r.cache,vn(t,Ve,l),l!==s.cache&&lc(t,[Ve],n,!0),ya(),l=r.element,s.isDehydrated)if(s={element:l,isDehydrated:!1,cache:r.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=xd(e,t,l,n);break e}else if(l!==i){i=wt(Error(o(424)),t),ha(i),t=xd(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(Oe=Rt(e.firstChild),nt=t,Ne=!0,pn=null,Dt=!0,n=ro(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pn(),l===i){t=ln(e,t,n);break e}at(e,t,l,n)}t=t.child}return t;case 26:return ki(e,t),e===null?(n=zf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ne||(n=t.type,e=t.pendingProps,l=Wi(ce.current).createElement(n),l[tt]=t,l[ot]=e,it(l,n,e),Ie(l),t.stateNode=l):t.memoizedState=zf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Lt(t),e===null&&Ne&&(l=t.stateNode=Mf(t.type,t.pendingProps,ce.current),nt=t,Dt=!0,i=Oe,Dn(t.type)?(Nu=i,Oe=Rt(l.firstChild)):Oe=i),at(e,t,t.pendingProps.children,n),ki(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ne&&((i=l=Oe)&&(l=zx(l,t.type,t.pendingProps,Dt),l!==null?(t.stateNode=l,nt=t,Oe=Rt(l.firstChild),Dt=!1,i=!0):i=!1),i||bn(t)),Lt(t),i=t.type,s=t.pendingProps,r=e!==null?e.memoizedProps:null,l=s.children,pu(i,s)?l=null:r!==null&&pu(i,r)&&(t.flags|=32),t.memoizedState!==null&&(i=gc(e,t,Zh,null,null,n),Ya._currentValue=i),ki(e,t),at(e,t,l,n),t.child;case 6:return e===null&&Ne&&((e=n=Oe)&&(n=Dx(n,t.pendingProps,Dt),n!==null?(t.stateNode=n,nt=t,Oe=null,e=!0):e=!1),e||bn(t)),null;case 13:return gd(e,t,n);case 4:return Be(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=il(t,null,l,n):at(e,t,l,n),t.child;case 11:return cd(e,t,t.type,t.pendingProps,n);case 7:return at(e,t,t.pendingProps,n),t.child;case 8:return at(e,t,t.pendingProps.children,n),t.child;case 12:return at(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,vn(t,t.type,l.value),at(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,tl(t),i=lt(i),l=l(i),t.flags|=1,at(e,t,l,n),t.child;case 14:return ud(e,t,t.type,t.pendingProps,n);case 15:return rd(e,t,t.type,t.pendingProps,n);case 19:return bd(e,t,n);case 31:return ex(e,t,n);case 22:return od(e,t,n,t.pendingProps);case 24:return tl(t),l=lt(Ve),e===null?(i=sc(),i===null&&(i=De,s=ac(),i.pooledCache=s,s.refCount++,s!==null&&(i.pooledCacheLanes|=n),i=s),t.memoizedState={parent:l,cache:i},uc(t),vn(t,Ve,i)):((e.lanes&n)!==0&&(rc(e,t),ja(t,null,null,n),ya()),i=e.memoizedState,s=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),vn(t,Ve,l)):(l=s.cache,vn(t,Ve,l),l!==i.cache&&lc(t,[Ve],n,!0))),at(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function an(e){e.flags|=4}function Qc(e,t,n,l,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Zd())e.flags|=8192;else throw al=yi,cc}else e.flags&=-16777217}function yd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Uf(t))if(Zd())e.flags|=8192;else throw al=yi,cc}function qi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Wu():536870912,e.lanes|=t,Ql|=t)}function Aa(e,t){if(!Ne)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 Re(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags&65011712,l|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function nx(e,t,n){var l=t.pendingProps;switch(Ws(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Re(t),null;case 1:return Re(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),en(Ve),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zl(t)?an(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ec())),Re(t),null;case 26:var i=t.type,s=t.memoizedState;return e===null?(an(t),s!==null?(Re(t),yd(t,s)):(Re(t),Qc(t,i,null,l,n))):s?s!==e.memoizedState?(an(t),Re(t),yd(t,s)):(Re(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&an(t),Re(t),Qc(t,i,e,l,n)),null;case 27:if(Zt(t),n=ce.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&an(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Re(t),null}e=L.current,zl(t)?Wr(t):(e=Mf(i,l,n),t.stateNode=e,an(t))}return Re(t),null;case 5:if(Zt(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&an(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Re(t),null}if(s=L.current,zl(t))Wr(t);else{var r=Wi(ce.current);switch(s){case 1:s=r.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:s=r.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":s=r.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":s=r.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":s=r.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(i,{is:l.is}):r.createElement(i)}}s[tt]=t,s[ot]=l;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=s;e:switch(it(s,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&an(t)}}return Re(t),Qc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&an(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=ce.current,zl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=nt,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||pf(e.nodeValue,n)),e||bn(t,!0)}else e=Wi(e).createTextNode(l),e[tt]=t,t.stateNode=e}return Re(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=zl(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[tt]=t}else Pn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Re(t),e=!1}else n=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Nt(t),t):(Nt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Re(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=zl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(o(317));i[tt]=t}else Pn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Re(t),i=!1}else i=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Nt(t),t):(Nt(t),null)}return Nt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),qi(t,t.updateQueue),Re(t),null);case 4:return fe(),e===null&&fu(t.stateNode.containerInfo),Re(t),null;case 10:return en(t.type),Re(t),null;case 19:if(D(Ge),l=t.memoizedState,l===null)return Re(t),null;if(i=(t.flags&128)!==0,s=l.rendering,s===null)if(i)Aa(l,!1);else{if(Ye!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=_i(e),s!==null){for(t.flags|=128,Aa(l,!1),e=s.updateQueue,t.updateQueue=e,qi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)$r(n,e),n=n.sibling;return Y(Ge,Ge.current&1|2),Ne&&Wt(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ue()>Gi&&(t.flags|=128,i=!0,Aa(l,!1),t.lanes=4194304)}else{if(!i)if(e=_i(s),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,qi(t,e),Aa(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!Ne)return Re(t),null}else 2*Ue()-l.renderingStartTime>Gi&&n!==536870912&&(t.flags|=128,i=!0,Aa(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(e=l.last,e!==null?e.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ue(),e.sibling=null,n=Ge.current,Y(Ge,i?n&1|2:n&1),Ne&&Wt(t,l.treeForkCount),e):(Re(t),null);case 22:case 23:return Nt(t),mc(),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&&(Re(t),t.subtreeFlags&6&&(t.flags|=8192)):Re(t),n=t.updateQueue,n!==null&&qi(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&&D(nl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),en(Ve),Re(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function lx(e,t){switch(Ws(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return en(Ve),fe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Zt(t),null;case 31:if(t.memoizedState!==null){if(Nt(t),t.alternate===null)throw Error(o(340));Pn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Nt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Pn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(Ge),null;case 4:return fe(),null;case 10:return en(t.type),null;case 22:case 23:return Nt(t),mc(),e!==null&&D(nl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return en(Ve),null;case 25:return null;default:return null}}function jd(e,t){switch(Ws(t),t.tag){case 3:en(Ve),fe();break;case 26:case 27:case 5:Zt(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&Nt(t);break;case 13:Nt(t);break;case 19:D(Ge);break;case 10:en(t.type);break;case 22:case 23:Nt(t),mc(),e!==null&&D(nl);break;case 24:en(Ve)}}function Ma(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==i)}}catch(m){Me(t,t.return,m)}}function Tn(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var s=i.next;l=s;do{if((l.tag&e)===e){var r=l.inst,m=r.destroy;if(m!==void 0){r.destroy=void 0,i=t;var b=n,E=m;try{E()}catch(k){Me(i,b,k)}}}l=l.next}while(l!==s)}}catch(k){Me(t,t.return,k)}}function Nd(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{fo(t,n)}catch(l){Me(e,e.return,l)}}}function Sd(e,t,n){n.props=cl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Me(e,t,l)}}function wa(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(i){Me(e,t,i)}}function Xt(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){Me(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Me(e,t,i)}else n.current=null}function _d(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(i){Me(e,e.return,i)}}function Vc(e,t,n){try{var l=e.stateNode;Tx(l,e.type,n,t),l[ot]=t}catch(i){Me(e,e.return,i)}}function Td(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Dn(e.type)||e.tag===4}function Zc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Td(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&&Dn(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 $c(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=Jt));else if(l!==4&&(l===27&&Dn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function Hi(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&&Dn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Hi(e,t,n),e=e.sibling;e!==null;)Hi(e,t,n),e=e.sibling}function Ed(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);it(t,l,n),t[tt]=e,t[ot]=n}catch(s){Me(e,e.return,s)}}var sn=!1,Ke=!1,Kc=!1,Ad=typeof WeakSet=="function"?WeakSet:Set,We=null;function ax(e,t){if(e=e.containerInfo,xu=is,e=Hr(e),Ys(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var i=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var r=0,m=-1,b=-1,E=0,k=0,B=e,M=null;t:for(;;){for(var z;B!==n||i!==0&&B.nodeType!==3||(m=r+i),B!==s||l!==0&&B.nodeType!==3||(b=r+l),B.nodeType===3&&(r+=B.nodeValue.length),(z=B.firstChild)!==null;)M=B,B=z;for(;;){if(B===e)break t;if(M===n&&++E===i&&(m=r),M===s&&++k===l&&(b=r),(z=B.nextSibling)!==null)break;B=M,M=B.parentNode}B=z}n=m===-1||b===-1?null:{start:m,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(gu={focusedElem:e,selectionRange:n},is=!1,We=t;We!==null;)if(t=We,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,We=e;else for(;We!==null;){switch(t=We,s=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&s!==null){e=void 0,n=t,i=s.memoizedProps,s=s.memoizedState,l=n.stateNode;try{var ee=cl(n.type,i);e=l.getSnapshotBeforeUpdate(ee,s),l.__reactInternalSnapshotBeforeUpdate=e}catch(re){Me(n,n.return,re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)vu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":vu(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,We=e;break}We=t.return}}function Md(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:un(e,n),l&4&&Ma(5,n);break;case 1:if(un(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(r){Me(n,n.return,r)}else{var i=cl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(r){Me(n,n.return,r)}}l&64&&Nd(n),l&512&&wa(n,n.return);break;case 3:if(un(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{fo(e,t)}catch(r){Me(n,n.return,r)}}break;case 27:t===null&&l&4&&Ed(n);case 26:case 5:un(e,n),t===null&&l&4&&_d(n),l&512&&wa(n,n.return);break;case 12:un(e,n);break;case 31:un(e,n),l&4&&zd(e,n);break;case 13:un(e,n),l&4&&Dd(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=mx.bind(null,n),Ox(e,n))));break;case 22:if(l=n.memoizedState!==null||sn,!l){t=t!==null&&t.memoizedState!==null||Ke,i=sn;var s=Ke;sn=l,(Ke=t)&&!s?rn(e,n,(n.subtreeFlags&8772)!==0):un(e,n),sn=i,Ke=s}break;case 30:break;default:un(e,n)}}function wd(e){var t=e.alternate;t!==null&&(e.alternate=null,wd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_s(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var qe=null,ft=!1;function cn(e,t,n){for(n=n.child;n!==null;)Cd(e,t,n),n=n.sibling}function Cd(e,t,n){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(Pl,n)}catch{}switch(n.tag){case 26:Ke||Xt(n,t),cn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ke||Xt(n,t);var l=qe,i=ft;Dn(n.type)&&(qe=n.stateNode,ft=!1),cn(e,t,n),Ha(n.stateNode),qe=l,ft=i;break;case 5:Ke||Xt(n,t);case 6:if(l=qe,i=ft,qe=null,cn(e,t,n),qe=l,ft=i,qe!==null)if(ft)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(n.stateNode)}catch(s){Me(n,t,s)}else try{qe.removeChild(n.stateNode)}catch(s){Me(n,t,s)}break;case 18:qe!==null&&(ft?(e=qe,Sf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Wl(e)):Sf(qe,n.stateNode));break;case 4:l=qe,i=ft,qe=n.stateNode.containerInfo,ft=!0,cn(e,t,n),qe=l,ft=i;break;case 0:case 11:case 14:case 15:Tn(2,n,t),Ke||Tn(4,n,t),cn(e,t,n);break;case 1:Ke||(Xt(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Sd(n,t,l)),cn(e,t,n);break;case 21:cn(e,t,n);break;case 22:Ke=(l=Ke)||n.memoizedState!==null,cn(e,t,n),Ke=l;break;default:cn(e,t,n)}}function zd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wl(e)}catch(n){Me(t,t.return,n)}}}function Dd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wl(e)}catch(n){Me(t,t.return,n)}}function ix(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ad),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ad),t;default:throw Error(o(435,e.tag))}}function Bi(e,t){var n=ix(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=hx.bind(null,e,l);l.then(i,i)}})}function mt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],s=e,r=t,m=r;e:for(;m!==null;){switch(m.tag){case 27:if(Dn(m.type)){qe=m.stateNode,ft=!1;break e}break;case 5:qe=m.stateNode,ft=!1;break e;case 3:case 4:qe=m.stateNode.containerInfo,ft=!0;break e}m=m.return}if(qe===null)throw Error(o(160));Cd(s,r,i),qe=null,ft=!1,s=i.alternate,s!==null&&(s.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Od(t,e),t=t.sibling}var Ht=null;function Od(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:mt(t,e),ht(e),l&4&&(Tn(3,e,e.return),Ma(3,e),Tn(5,e,e.return));break;case 1:mt(t,e),ht(e),l&512&&(Ke||n===null||Xt(n,n.return)),l&64&&sn&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var i=Ht;if(mt(t,e),ht(e),l&512&&(Ke||n===null||Xt(n,n.return)),l&4){var s=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(l){case"title":s=i.getElementsByTagName("title")[0],(!s||s[na]||s[tt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=i.createElement(l),i.head.insertBefore(s,i.querySelector("head > title"))),it(s,l,n),s[tt]=e,Ie(s),l=s;break e;case"link":var r=Rf("link","href",i).get(l+(n.href||""));if(r){for(var m=0;m<r.length;m++)if(s=r[m],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){r.splice(m,1);break t}}s=i.createElement(l),it(s,l,n),i.head.appendChild(s);break;case"meta":if(r=Rf("meta","content",i).get(l+(n.content||""))){for(m=0;m<r.length;m++)if(s=r[m],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){r.splice(m,1);break t}}s=i.createElement(l),it(s,l,n),i.head.appendChild(s);break;default:throw Error(o(468,l))}s[tt]=e,Ie(s),l=s}e.stateNode=l}else kf(i,e.type,e.stateNode);else e.stateNode=Of(i,l,e.memoizedProps);else s!==l?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,l===null?kf(i,e.type,e.stateNode):Of(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Vc(e,e.memoizedProps,n.memoizedProps)}break;case 27:mt(t,e),ht(e),l&512&&(Ke||n===null||Xt(n,n.return)),n!==null&&l&4&&Vc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(mt(t,e),ht(e),l&512&&(Ke||n===null||Xt(n,n.return)),e.flags&32){i=e.stateNode;try{jl(i,"")}catch(ee){Me(e,e.return,ee)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,Vc(e,i,n!==null?n.memoizedProps:i)),l&1024&&(Kc=!0);break;case 6:if(mt(t,e),ht(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ee){Me(e,e.return,ee)}}break;case 3:if(ts=null,i=Ht,Ht=Pi(t.containerInfo),mt(t,e),Ht=i,ht(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Wl(t.containerInfo)}catch(ee){Me(e,e.return,ee)}Kc&&(Kc=!1,Rd(e));break;case 4:l=Ht,Ht=Pi(e.stateNode.containerInfo),mt(t,e),ht(e),Ht=l;break;case 12:mt(t,e),ht(e);break;case 31:mt(t,e),ht(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Bi(e,l)));break;case 13:mt(t,e),ht(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Yi=Ue()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Bi(e,l)));break;case 22:i=e.memoizedState!==null;var b=n!==null&&n.memoizedState!==null,E=sn,k=Ke;if(sn=E||i,Ke=k||b,mt(t,e),Ke=k,sn=E,ht(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||b||sn||Ke||ul(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){b=n=t;try{if(s=b.stateNode,i)r=s.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none";else{m=b.stateNode;var B=b.memoizedProps.style,M=B!=null&&B.hasOwnProperty("display")?B.display:null;m.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(ee){Me(b,b.return,ee)}}}else if(t.tag===6){if(n===null){b=t;try{b.stateNode.nodeValue=i?"":b.memoizedProps}catch(ee){Me(b,b.return,ee)}}}else if(t.tag===18){if(n===null){b=t;try{var z=b.stateNode;i?_f(z,!0):_f(b.stateNode,!1)}catch(ee){Me(b,b.return,ee)}}}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,Bi(e,n))));break;case 19:mt(t,e),ht(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Bi(e,l)));break;case 30:break;case 21:break;default:mt(t,e),ht(e)}}function ht(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Td(l)){n=l;break}l=l.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var i=n.stateNode,s=Zc(e);Hi(e,s,i);break;case 5:var r=n.stateNode;n.flags&32&&(jl(r,""),n.flags&=-33);var m=Zc(e);Hi(e,m,r);break;case 3:case 4:var b=n.stateNode.containerInfo,E=Zc(e);$c(e,E,b);break;default:throw Error(o(161))}}catch(k){Me(e,e.return,k)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Rd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function un(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Md(e,t.alternate,t),t=t.sibling}function ul(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Tn(4,t,t.return),ul(t);break;case 1:Xt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Sd(t,t.return,n),ul(t);break;case 27:Ha(t.stateNode);case 26:case 5:Xt(t,t.return),ul(t);break;case 22:t.memoizedState===null&&ul(t);break;case 30:ul(t);break;default:ul(t)}e=e.sibling}}function rn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,s=t,r=s.flags;switch(s.tag){case 0:case 11:case 15:rn(i,s,n),Ma(4,s);break;case 1:if(rn(i,s,n),l=s,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(E){Me(l,l.return,E)}if(l=s,i=l.updateQueue,i!==null){var m=l.stateNode;try{var b=i.shared.hiddenCallbacks;if(b!==null)for(i.shared.hiddenCallbacks=null,i=0;i<b.length;i++)oo(b[i],m)}catch(E){Me(l,l.return,E)}}n&&r&64&&Nd(s),wa(s,s.return);break;case 27:Ed(s);case 26:case 5:rn(i,s,n),n&&l===null&&r&4&&_d(s),wa(s,s.return);break;case 12:rn(i,s,n);break;case 31:rn(i,s,n),n&&r&4&&zd(i,s);break;case 13:rn(i,s,n),n&&r&4&&Dd(i,s);break;case 22:s.memoizedState===null&&rn(i,s,n),wa(s,s.return);break;case 30:break;default:rn(i,s,n)}t=t.sibling}}function Jc(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&&xa(n))}function Fc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xa(e))}function Bt(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kd(e,t,n,l),t=t.sibling}function kd(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Bt(e,t,n,l),i&2048&&Ma(9,t);break;case 1:Bt(e,t,n,l);break;case 3:Bt(e,t,n,l),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xa(e)));break;case 12:if(i&2048){Bt(e,t,n,l),e=t.stateNode;try{var s=t.memoizedProps,r=s.id,m=s.onPostCommit;typeof m=="function"&&m(r,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(b){Me(t,t.return,b)}}else Bt(e,t,n,l);break;case 31:Bt(e,t,n,l);break;case 13:Bt(e,t,n,l);break;case 23:break;case 22:s=t.stateNode,r=t.alternate,t.memoizedState!==null?s._visibility&2?Bt(e,t,n,l):Ca(e,t):s._visibility&2?Bt(e,t,n,l):(s._visibility|=2,Yl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Jc(r,t);break;case 24:Bt(e,t,n,l),i&2048&&Fc(t.alternate,t);break;default:Bt(e,t,n,l)}}function Yl(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,r=t,m=n,b=l,E=r.flags;switch(r.tag){case 0:case 11:case 15:Yl(s,r,m,b,i),Ma(8,r);break;case 23:break;case 22:var k=r.stateNode;r.memoizedState!==null?k._visibility&2?Yl(s,r,m,b,i):Ca(s,r):(k._visibility|=2,Yl(s,r,m,b,i)),i&&E&2048&&Jc(r.alternate,r);break;case 24:Yl(s,r,m,b,i),i&&E&2048&&Fc(r.alternate,r);break;default:Yl(s,r,m,b,i)}t=t.sibling}}function Ca(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,i=l.flags;switch(l.tag){case 22:Ca(n,l),i&2048&&Jc(l.alternate,l);break;case 24:Ca(n,l),i&2048&&Fc(l.alternate,l);break;default:Ca(n,l)}t=t.sibling}}var za=8192;function Gl(e,t,n){if(e.subtreeFlags&za)for(e=e.child;e!==null;)Ud(e,t,n),e=e.sibling}function Ud(e,t,n){switch(e.tag){case 26:Gl(e,t,n),e.flags&za&&e.memoizedState!==null&&Vx(n,Ht,e.memoizedState,e.memoizedProps);break;case 5:Gl(e,t,n);break;case 3:case 4:var l=Ht;Ht=Pi(e.stateNode.containerInfo),Gl(e,t,n),Ht=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=za,za=16777216,Gl(e,t,n),za=l):Gl(e,t,n));break;default:Gl(e,t,n)}}function qd(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 Da(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];We=l,Bd(l,e)}qd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hd(e),e=e.sibling}function Hd(e){switch(e.tag){case 0:case 11:case 15:Da(e),e.flags&2048&&Tn(9,e,e.return);break;case 3:Da(e);break;case 12:Da(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Li(e)):Da(e);break;default:Da(e)}}function Li(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];We=l,Bd(l,e)}qd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tn(8,t,t.return),Li(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Li(t));break;default:Li(t)}e=e.sibling}}function Bd(e,t){for(;We!==null;){var n=We;switch(n.tag){case 0:case 11:case 15:Tn(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:xa(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,We=l;else e:for(n=e;We!==null;){l=We;var i=l.sibling,s=l.return;if(wd(l),l===n){We=null;break e}if(i!==null){i.return=s,We=i;break e}We=s}}}var sx={getCacheForType:function(e){var t=lt(Ve),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return lt(Ve).controller.signal}},cx=typeof WeakMap=="function"?WeakMap:Map,Ee=0,De=null,be=null,ye=0,Ae=0,St=null,En=!1,Xl=!1,Ic=!1,on=0,Ye=0,An=0,rl=0,Wc=0,_t=0,Ql=0,Oa=null,xt=null,Pc=!1,Yi=0,Ld=0,Gi=1/0,Xi=null,Mn=null,Je=0,wn=null,Vl=null,dn=0,eu=0,tu=null,Yd=null,Ra=0,nu=null;function Tt(){return(Ee&2)!==0&&ye!==0?ye&-ye:S.T!==null?uu():nr()}function Gd(){if(_t===0)if((ye&536870912)===0||Ne){var e=Ia;Ia<<=1,(Ia&3932160)===0&&(Ia=262144),_t=e}else _t=536870912;return e=jt.current,e!==null&&(e.flags|=32),_t}function gt(e,t,n){(e===De&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)&&(Zl(e,0),Cn(e,ye,_t,!1)),ta(e,n),((Ee&2)===0||e!==De)&&(e===De&&((Ee&2)===0&&(rl|=n),Ye===4&&Cn(e,ye,_t,!1)),Qt(e))}function Xd(e,t,n){if((Ee&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ea(e,t),i=l?ox(e,t):au(e,t,!0),s=l;do{if(i===0){Xl&&!l&&Cn(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!ux(n)){i=au(e,t,!1),s=!1;continue}if(i===2){if(s=t,e.errorRecoveryDisabledLanes&s)var r=0;else r=e.pendingLanes&-536870913,r=r!==0?r:r&536870912?536870912:0;if(r!==0){t=r;e:{var m=e;i=Oa;var b=m.current.memoizedState.isDehydrated;if(b&&(Zl(m,r).flags|=256),r=au(m,r,!1),r!==2){if(Ic&&!b){m.errorRecoveryDisabledLanes|=s,rl|=s,i=4;break e}s=xt,xt=i,s!==null&&(xt===null?xt=s:xt.push.apply(xt,s))}i=r}if(s=!1,i!==2)continue}}if(i===1){Zl(e,0),Cn(e,t,0,!0);break}e:{switch(l=e,s=i,s){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Cn(l,t,_t,!En);break e;case 2:xt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=Yi+300-Ue(),10<i)){if(Cn(l,t,_t,!En),Pa(l,0,!0)!==0)break e;dn=t,l.timeoutHandle=jf(Qd.bind(null,l,n,xt,Xi,Pc,t,_t,rl,Ql,En,s,"Throttled",-0,0),i);break e}Qd(l,n,xt,Xi,Pc,t,_t,rl,Ql,En,s,null,-0,0)}}break}while(!0);Qt(e)}function Qd(e,t,n,l,i,s,r,m,b,E,k,B,M,z){if(e.timeoutHandle=-1,B=t.subtreeFlags,B&8192||(B&16785408)===16785408){B={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},Ud(t,s,B);var ee=(s&62914560)===s?Yi-Ue():(s&4194048)===s?Ld-Ue():0;if(ee=Zx(B,ee),ee!==null){dn=s,e.cancelPendingCommit=ee(Wd.bind(null,e,t,s,n,l,i,r,m,b,k,B,null,M,z)),Cn(e,s,r,!E);return}}Wd(e,t,s,n,l,i,r,m,b)}function ux(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var i=n[l],s=i.getSnapshot;i=i.value;try{if(!vt(s(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Cn(e,t,n,l){t&=~Wc,t&=~rl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var s=31-bt(i),r=1<<s;l[s]=-1,i&=~r}n!==0&&Pu(e,n,t)}function Qi(){return(Ee&6)===0?(ka(0),!1):!0}function lu(){if(be!==null){if(Ae===0)var e=be.return;else e=be,Pt=el=null,vc(e),Ul=null,pa=0,e=be;for(;e!==null;)jd(e.alternate,e),e=e.return;be=null}}function Zl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Mx(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),dn=0,lu(),De=e,be=n=It(e.current,null),ye=t,Ae=0,St=null,En=!1,Xl=ea(e,t),Ic=!1,Ql=_t=Wc=rl=An=Ye=0,xt=Oa=null,Pc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var i=31-bt(l),s=1<<i;t|=e[i],l&=~s}return on=t,di(),n}function Vd(e,t){xe=null,S.H=Ta,t===kl||t===vi?(t=so(),Ae=3):t===cc?(t=so(),Ae=4):Ae=t===kc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,St=t,be===null&&(Ye=1,Oi(e,wt(t,e.current)))}function Zd(){var e=jt.current;return e===null?!0:(ye&4194048)===ye?Ot===null:(ye&62914560)===ye||(ye&536870912)!==0?e===Ot:!1}function $d(){var e=S.H;return S.H=Ta,e===null?Ta:e}function Kd(){var e=S.A;return S.A=sx,e}function Vi(){Ye=4,En||(ye&4194048)!==ye&&jt.current!==null||(Xl=!0),(An&134217727)===0&&(rl&134217727)===0||De===null||Cn(De,ye,_t,!1)}function au(e,t,n){var l=Ee;Ee|=2;var i=$d(),s=Kd();(De!==e||ye!==t)&&(Xi=null,Zl(e,t)),t=!1;var r=Ye;e:do try{if(Ae!==0&&be!==null){var m=be,b=St;switch(Ae){case 8:lu(),r=6;break e;case 3:case 2:case 9:case 6:jt.current===null&&(t=!0);var E=Ae;if(Ae=0,St=null,$l(e,m,b,E),n&&Xl){r=0;break e}break;default:E=Ae,Ae=0,St=null,$l(e,m,b,E)}}rx(),r=Ye;break}catch(k){Vd(e,k)}while(!0);return t&&e.shellSuspendCounter++,Pt=el=null,Ee=l,S.H=i,S.A=s,be===null&&(De=null,ye=0,di()),r}function rx(){for(;be!==null;)Jd(be)}function ox(e,t){var n=Ee;Ee|=2;var l=$d(),i=Kd();De!==e||ye!==t?(Xi=null,Gi=Ue()+500,Zl(e,t)):Xl=ea(e,t);e:do try{if(Ae!==0&&be!==null){t=be;var s=St;t:switch(Ae){case 1:Ae=0,St=null,$l(e,t,s,1);break;case 2:case 9:if(ao(s)){Ae=0,St=null,Fd(t);break}t=function(){Ae!==2&&Ae!==9||De!==e||(Ae=7),Qt(e)},s.then(t,t);break e;case 3:Ae=7;break e;case 4:Ae=5;break e;case 7:ao(s)?(Ae=0,St=null,Fd(t)):(Ae=0,St=null,$l(e,t,s,7));break;case 5:var r=null;switch(be.tag){case 26:r=be.memoizedState;case 5:case 27:var m=be;if(r?Uf(r):m.stateNode.complete){Ae=0,St=null;var b=m.sibling;if(b!==null)be=b;else{var E=m.return;E!==null?(be=E,Zi(E)):be=null}break t}}Ae=0,St=null,$l(e,t,s,5);break;case 6:Ae=0,St=null,$l(e,t,s,6);break;case 8:lu(),Ye=6;break e;default:throw Error(o(462))}}dx();break}catch(k){Vd(e,k)}while(!0);return Pt=el=null,S.H=l,S.A=i,Ee=n,be!==null?0:(De=null,ye=0,di(),Ye)}function dx(){for(;be!==null&&!et();)Jd(be)}function Jd(e){var t=vd(e.alternate,e,on);e.memoizedProps=e.pendingProps,t===null?Zi(e):be=t}function Fd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=md(n,t,t.pendingProps,t.type,void 0,ye);break;case 11:t=md(n,t,t.pendingProps,t.type.render,t.ref,ye);break;case 5:vc(t);default:jd(n,t),t=be=$r(t,on),t=vd(n,t,on)}e.memoizedProps=e.pendingProps,t===null?Zi(e):be=t}function $l(e,t,n,l){Pt=el=null,vc(t),Ul=null,pa=0;var i=t.return;try{if(Ph(e,i,t,n,ye)){Ye=1,Oi(e,wt(n,e.current)),be=null;return}}catch(s){if(i!==null)throw be=i,s;Ye=1,Oi(e,wt(n,e.current)),be=null;return}t.flags&32768?(Ne||l===1?e=!0:Xl||(ye&536870912)!==0?e=!1:(En=e=!0,(l===2||l===9||l===3||l===6)&&(l=jt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Id(t,e)):Zi(t)}function Zi(e){var t=e;do{if((t.flags&32768)!==0){Id(t,En);return}e=t.return;var n=nx(t.alternate,t,on);if(n!==null){be=n;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Ye===0&&(Ye=5)}function Id(e,t){do{var n=lx(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);Ye=6,be=null}function Wd(e,t,n,l,i,s,r,m,b){e.cancelPendingCommit=null;do $i();while(Je!==0);if((Ee&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(s=t.lanes|t.childLanes,s|=Zs,Qm(e,n,s,r,m,b),e===De&&(be=De=null,ye=0),Vl=t,wn=e,dn=n,eu=s,tu=i,Yd=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,xx(Ja,function(){return lf(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=S.T,S.T=null,i=H.p,H.p=2,r=Ee,Ee|=4;try{ax(e,t,n)}finally{Ee=r,H.p=i,S.T=l}}Je=1,Pd(),ef(),tf()}}function Pd(){if(Je===1){Je=0;var e=wn,t=Vl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=S.T,S.T=null;var l=H.p;H.p=2;var i=Ee;Ee|=4;try{Od(t,e);var s=gu,r=Hr(e.containerInfo),m=s.focusedElem,b=s.selectionRange;if(r!==m&&m&&m.ownerDocument&&qr(m.ownerDocument.documentElement,m)){if(b!==null&&Ys(m)){var E=b.start,k=b.end;if(k===void 0&&(k=E),"selectionStart"in m)m.selectionStart=E,m.selectionEnd=Math.min(k,m.value.length);else{var B=m.ownerDocument||document,M=B&&B.defaultView||window;if(M.getSelection){var z=M.getSelection(),ee=m.textContent.length,re=Math.min(b.start,ee),ze=b.end===void 0?re:Math.min(b.end,ee);!z.extend&&re>ze&&(r=ze,ze=re,re=r);var N=Ur(m,re),j=Ur(m,ze);if(N&&j&&(z.rangeCount!==1||z.anchorNode!==N.node||z.anchorOffset!==N.offset||z.focusNode!==j.node||z.focusOffset!==j.offset)){var T=B.createRange();T.setStart(N.node,N.offset),z.removeAllRanges(),re>ze?(z.addRange(T),z.extend(j.node,j.offset)):(T.setEnd(j.node,j.offset),z.addRange(T))}}}}for(B=[],z=m;z=z.parentNode;)z.nodeType===1&&B.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<B.length;m++){var q=B[m];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}is=!!xu,gu=xu=null}finally{Ee=i,H.p=l,S.T=n}}e.current=t,Je=2}}function ef(){if(Je===2){Je=0;var e=wn,t=Vl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=S.T,S.T=null;var l=H.p;H.p=2;var i=Ee;Ee|=4;try{Md(e,t.alternate,t)}finally{Ee=i,H.p=l,S.T=n}}Je=3}}function tf(){if(Je===4||Je===3){Je=0,Ut();var e=wn,t=Vl,n=dn,l=Yd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Je=5:(Je=0,Vl=wn=null,nf(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Mn=null),Ns(n),t=t.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(Pl,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=S.T,i=H.p,H.p=2,S.T=null;try{for(var s=e.onRecoverableError,r=0;r<l.length;r++){var m=l[r];s(m.value,{componentStack:m.stack})}}finally{S.T=t,H.p=i}}(dn&3)!==0&&$i(),Qt(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===nu?Ra++:(Ra=0,nu=e):Ra=0,ka(0)}}function nf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,xa(t)))}function $i(){return Pd(),ef(),tf(),lf()}function lf(){if(Je!==5)return!1;var e=wn,t=eu;eu=0;var n=Ns(dn),l=S.T,i=H.p;try{H.p=32>n?32:n,S.T=null,n=tu,tu=null;var s=wn,r=dn;if(Je=0,Vl=wn=null,dn=0,(Ee&6)!==0)throw Error(o(331));var m=Ee;if(Ee|=4,Hd(s.current),kd(s,s.current,r,n),Ee=m,ka(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(Pl,s)}catch{}return!0}finally{H.p=i,S.T=l,nf(e,t)}}function af(e,t,n){t=wt(n,t),t=Rc(e.stateNode,t,2),e=Nn(e,t,2),e!==null&&(ta(e,2),Qt(e))}function Me(e,t,n){if(e.tag===3)af(e,e,n);else for(;t!==null;){if(t.tag===3){af(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Mn===null||!Mn.has(l))){e=wt(n,e),n=id(2),l=Nn(t,n,2),l!==null&&(sd(n,l,t,e),ta(l,2),Qt(l));break}}t=t.return}}function iu(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new cx;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(Ic=!0,i.add(n),e=fx.bind(null,e,t,n),t.then(e,e))}function fx(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,De===e&&(ye&n)===n&&(Ye===4||Ye===3&&(ye&62914560)===ye&&300>Ue()-Yi?(Ee&2)===0&&Zl(e,0):Wc|=n,Ql===ye&&(Ql=0)),Qt(e)}function sf(e,t){t===0&&(t=Wu()),e=In(e,t),e!==null&&(ta(e,t),Qt(e))}function mx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sf(e,n)}function hx(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),sf(e,n)}function xx(e,t){return ke(e,t)}var Ki=null,Kl=null,su=!1,Ji=!1,cu=!1,zn=0;function Qt(e){e!==Kl&&e.next===null&&(Kl===null?Ki=Kl=e:Kl=Kl.next=e),Ji=!0,su||(su=!0,px())}function ka(e,t){if(!cu&&Ji){cu=!0;do for(var n=!1,l=Ki;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var s=0;else{var r=l.suspendedLanes,m=l.pingedLanes;s=(1<<31-bt(42|e)+1)-1,s&=i&~(r&~m),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,of(l,s))}else s=ye,s=Pa(l,l===De?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||ea(l,s)||(n=!0,of(l,s));l=l.next}while(n);cu=!1}}function gx(){cf()}function cf(){Ji=su=!1;var e=0;zn!==0&&Ax()&&(e=zn);for(var t=Ue(),n=null,l=Ki;l!==null;){var i=l.next,s=uf(l,t);s===0?(l.next=null,n===null?Ki=i:n.next=i,i===null&&(Kl=n)):(n=l,(e!==0||(s&3)!==0)&&(Ji=!0)),l=i}Je!==0&&Je!==5||ka(e),zn!==0&&(zn=0)}function uf(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var r=31-bt(s),m=1<<r,b=i[r];b===-1?((m&n)===0||(m&l)!==0)&&(i[r]=Xm(m,t)):b<=t&&(e.expiredLanes|=m),s&=~m}if(t=De,n=ye,n=Pa(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Fe(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ea(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Fe(l),Ns(n)){case 2:case 8:n=Fu;break;case 32:n=Ja;break;case 268435456:n=Iu;break;default:n=Ja}return l=rf.bind(null,e),n=ke(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Fe(l),e.callbackPriority=2,e.callbackNode=null,2}function rf(e,t){if(Je!==0&&Je!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if($i()&&e.callbackNode!==n)return null;var l=ye;return l=Pa(e,e===De?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Xd(e,l,t),uf(e,Ue()),e.callbackNode!=null&&e.callbackNode===n?rf.bind(null,e):null)}function of(e,t){if($i())return null;Xd(e,t,!0)}function px(){wx(function(){(Ee&6)!==0?ke(Vn,gx):cf()})}function uu(){if(zn===0){var e=Ol;e===0&&(e=Fa,Fa<<=1,(Fa&261888)===0&&(Fa=256)),zn=e}return zn}function df(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:li(""+e)}function ff(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 bx(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var s=df((i[ot]||null).action),r=l.submitter;r&&(t=(t=r[ot]||null)?df(t.formAction):r.getAttribute("formAction"),t!==null&&(s=t,r=null));var m=new ci("action","action",null,l,i);e.push({event:m,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(zn!==0){var b=r?ff(i,r):new FormData(i);Mc(n,{pending:!0,data:b,method:i.method,action:s},null,b)}}else typeof s=="function"&&(m.preventDefault(),b=r?ff(i,r):new FormData(i),Mc(n,{pending:!0,data:b,method:i.method,action:s},s,b))},currentTarget:i}]})}}for(var ru=0;ru<Vs.length;ru++){var ou=Vs[ru],vx=ou.toLowerCase(),yx=ou[0].toUpperCase()+ou.slice(1);qt(vx,"on"+yx)}qt(Yr,"onAnimationEnd"),qt(Gr,"onAnimationIteration"),qt(Xr,"onAnimationStart"),qt("dblclick","onDoubleClick"),qt("focusin","onFocus"),qt("focusout","onBlur"),qt(Uh,"onTransitionRun"),qt(qh,"onTransitionStart"),qt(Hh,"onTransitionCancel"),qt(Qr,"onTransitionEnd"),vl("onMouseEnter",["mouseout","mouseover"]),vl("onMouseLeave",["mouseout","mouseover"]),vl("onPointerEnter",["pointerout","pointerover"]),vl("onPointerLeave",["pointerout","pointerover"]),$n("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$n("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$n("onBeforeInput",["compositionend","keypress","textInput","paste"]),$n("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$n("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$n("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ua="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(" "),jx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ua));function mf(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],i=l.event;l=l.listeners;e:{var s=void 0;if(t)for(var r=l.length-1;0<=r;r--){var m=l[r],b=m.instance,E=m.currentTarget;if(m=m.listener,b!==s&&i.isPropagationStopped())break e;s=m,i.currentTarget=E;try{s(i)}catch(k){oi(k)}i.currentTarget=null,s=b}else for(r=0;r<l.length;r++){if(m=l[r],b=m.instance,E=m.currentTarget,m=m.listener,b!==s&&i.isPropagationStopped())break e;s=m,i.currentTarget=E;try{s(i)}catch(k){oi(k)}i.currentTarget=null,s=b}}}}function ve(e,t){var n=t[Ss];n===void 0&&(n=t[Ss]=new Set);var l=e+"__bubble";n.has(l)||(hf(t,e,2,!1),n.add(l))}function du(e,t,n){var l=0;t&&(l|=4),hf(n,e,l,t)}var Fi="_reactListening"+Math.random().toString(36).slice(2);function fu(e){if(!e[Fi]){e[Fi]=!0,ir.forEach(function(n){n!=="selectionchange"&&(jx.has(n)||du(n,!1,e),du(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fi]||(t[Fi]=!0,du("selectionchange",!1,t))}}function hf(e,t,n,l){switch(Xf(t)){case 2:var i=Jx;break;case 8:i=Fx;break;default:i=Au}n=i.bind(null,t,n,e),i=void 0,!Ds||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function mu(e,t,n,l,i){var s=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var r=l.tag;if(r===3||r===4){var m=l.stateNode.containerInfo;if(m===i)break;if(r===4)for(r=l.return;r!==null;){var b=r.tag;if((b===3||b===4)&&r.stateNode.containerInfo===i)return;r=r.return}for(;m!==null;){if(r=gl(m),r===null)return;if(b=r.tag,b===5||b===6||b===26||b===27){l=s=r;continue e}m=m.parentNode}}l=l.return}pr(function(){var E=s,k=Cs(n),B=[];e:{var M=Vr.get(e);if(M!==void 0){var z=ci,ee=e;switch(e){case"keypress":if(ii(n)===0)break e;case"keydown":case"keyup":z=hh;break;case"focusin":ee="focus",z=Us;break;case"focusout":ee="blur",z=Us;break;case"beforeblur":case"afterblur":z=Us;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":z=yr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=nh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=ph;break;case Yr:case Gr:case Xr:z=ih;break;case Qr:z=vh;break;case"scroll":case"scrollend":z=eh;break;case"wheel":z=jh;break;case"copy":case"cut":case"paste":z=ch;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=Nr;break;case"toggle":case"beforetoggle":z=Sh}var re=(t&4)!==0,ze=!re&&(e==="scroll"||e==="scrollend"),N=re?M!==null?M+"Capture":null:M;re=[];for(var j=E,T;j!==null;){var q=j;if(T=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||T===null||N===null||(q=aa(j,N),q!=null&&re.push(qa(j,q,T))),ze)break;j=j.return}0<re.length&&(M=new z(M,ee,null,n,k),B.push({event:M,listeners:re}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",z=e==="mouseout"||e==="pointerout",M&&n!==ws&&(ee=n.relatedTarget||n.fromElement)&&(gl(ee)||ee[xl]))break e;if((z||M)&&(M=k.window===k?k:(M=k.ownerDocument)?M.defaultView||M.parentWindow:window,z?(ee=n.relatedTarget||n.toElement,z=E,ee=ee?gl(ee):null,ee!==null&&(ze=h(ee),re=ee.tag,ee!==ze||re!==5&&re!==27&&re!==6)&&(ee=null)):(z=null,ee=E),z!==ee)){if(re=yr,q="onMouseLeave",N="onMouseEnter",j="mouse",(e==="pointerout"||e==="pointerover")&&(re=Nr,q="onPointerLeave",N="onPointerEnter",j="pointer"),ze=z==null?M:la(z),T=ee==null?M:la(ee),M=new re(q,j+"leave",z,n,k),M.target=ze,M.relatedTarget=T,q=null,gl(k)===E&&(re=new re(N,j+"enter",ee,n,k),re.target=T,re.relatedTarget=ze,q=re),ze=q,z&&ee)t:{for(re=Nx,N=z,j=ee,T=0,q=N;q;q=re(q))T++;q=0;for(var se=j;se;se=re(se))q++;for(;0<T-q;)N=re(N),T--;for(;0<q-T;)j=re(j),q--;for(;T--;){if(N===j||j!==null&&N===j.alternate){re=N;break t}N=re(N),j=re(j)}re=null}else re=null;z!==null&&xf(B,M,z,re,!1),ee!==null&&ze!==null&&xf(B,ze,ee,re,!0)}}e:{if(M=E?la(E):window,z=M.nodeName&&M.nodeName.toLowerCase(),z==="select"||z==="input"&&M.type==="file")var _e=Cr;else if(Mr(M))if(zr)_e=Oh;else{_e=zh;var le=Ch}else z=M.nodeName,!z||z.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?E&&Ms(E.elementType)&&(_e=Cr):_e=Dh;if(_e&&(_e=_e(e,E))){wr(B,_e,n,k);break e}le&&le(e,M,E),e==="focusout"&&E&&M.type==="number"&&E.memoizedProps.value!=null&&As(M,"number",M.value)}switch(le=E?la(E):window,e){case"focusin":(Mr(le)||le.contentEditable==="true")&&(Tl=le,Gs=E,fa=null);break;case"focusout":fa=Gs=Tl=null;break;case"mousedown":Xs=!0;break;case"contextmenu":case"mouseup":case"dragend":Xs=!1,Br(B,n,k);break;case"selectionchange":if(kh)break;case"keydown":case"keyup":Br(B,n,k)}var ge;if(Hs)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else _l?Er(e,n)&&(je="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(je="onCompositionStart");je&&(Sr&&n.locale!=="ko"&&(_l||je!=="onCompositionStart"?je==="onCompositionEnd"&&_l&&(ge=br()):(xn=k,Os="value"in xn?xn.value:xn.textContent,_l=!0)),le=Ii(E,je),0<le.length&&(je=new jr(je,e,null,n,k),B.push({event:je,listeners:le}),ge?je.data=ge:(ge=Ar(n),ge!==null&&(je.data=ge)))),(ge=Th?Eh(e,n):Ah(e,n))&&(je=Ii(E,"onBeforeInput"),0<je.length&&(le=new jr("onBeforeInput","beforeinput",null,n,k),B.push({event:le,listeners:je}),le.data=ge)),bx(B,e,E,n,k)}mf(B,t)})}function qa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ii(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,s=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||s===null||(i=aa(e,n),i!=null&&l.unshift(qa(e,i,s)),i=aa(e,t),i!=null&&l.push(qa(e,i,s))),e.tag===3)return l;e=e.return}return[]}function Nx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function xf(e,t,n,l,i){for(var s=t._reactName,r=[];n!==null&&n!==l;){var m=n,b=m.alternate,E=m.stateNode;if(m=m.tag,b!==null&&b===l)break;m!==5&&m!==26&&m!==27||E===null||(b=E,i?(E=aa(n,s),E!=null&&r.unshift(qa(n,E,b))):i||(E=aa(n,s),E!=null&&r.push(qa(n,E,b)))),n=n.return}r.length!==0&&e.push({event:t,listeners:r})}var Sx=/\r\n?/g,_x=/\u0000|\uFFFD/g;function gf(e){return(typeof e=="string"?e:""+e).replace(Sx,`
49
- `).replace(_x,"")}function pf(e,t){return t=gf(t),gf(e)===t}function Ce(e,t,n,l,i,s){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||jl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&jl(e,""+l);break;case"className":ti(e,"class",l);break;case"tabIndex":ti(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ti(e,n,l);break;case"style":xr(e,l,s);break;case"data":if(t!=="object"){ti(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=li(""+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 s=="function"&&(n==="formAction"?(t!=="input"&&Ce(e,t,"name",i.name,i,null),Ce(e,t,"formEncType",i.formEncType,i,null),Ce(e,t,"formMethod",i.formMethod,i,null),Ce(e,t,"formTarget",i.formTarget,i,null)):(Ce(e,t,"encType",i.encType,i,null),Ce(e,t,"method",i.method,i,null),Ce(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=li(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Jt);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=li(""+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":ve("beforetoggle",e),ve("toggle",e),ei(e,"popover",l);break;case"xlinkActuate":Kt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Kt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Kt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Kt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Kt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Kt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ei(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=Wm.get(n)||n,ei(e,n,l))}}function hu(e,t,n,l,i,s){switch(n){case"style":xr(e,l,s);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof l=="string"?jl(e,l):(typeof l=="number"||typeof l=="bigint")&&jl(e,""+l);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Jt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sr.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),s=e[ot]||null,s=s!=null?s[n]:null,typeof s=="function"&&e.removeEventListener(t,s,i),typeof l=="function")){typeof s!="function"&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,i);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):ei(e,n,l)}}}function it(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var l=!1,i=!1,s;for(s in n)if(n.hasOwnProperty(s)){var r=n[s];if(r!=null)switch(s){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ce(e,t,s,r,n,null)}}i&&Ce(e,t,"srcSet",n.srcSet,n,null),l&&Ce(e,t,"src",n.src,n,null);return;case"input":ve("invalid",e);var m=s=r=i=null,b=null,E=null;for(l in n)if(n.hasOwnProperty(l)){var k=n[l];if(k!=null)switch(l){case"name":i=k;break;case"type":r=k;break;case"checked":b=k;break;case"defaultChecked":E=k;break;case"value":s=k;break;case"defaultValue":m=k;break;case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(o(137,t));break;default:Ce(e,t,l,k,n,null)}}dr(e,s,m,b,E,r,i,!1);return;case"select":ve("invalid",e),l=r=s=null;for(i in n)if(n.hasOwnProperty(i)&&(m=n[i],m!=null))switch(i){case"value":s=m;break;case"defaultValue":r=m;break;case"multiple":l=m;default:Ce(e,t,i,m,n,null)}t=s,n=r,e.multiple=!!l,t!=null?yl(e,!!l,t,!1):n!=null&&yl(e,!!l,n,!0);return;case"textarea":ve("invalid",e),s=i=l=null;for(r in n)if(n.hasOwnProperty(r)&&(m=n[r],m!=null))switch(r){case"value":l=m;break;case"defaultValue":i=m;break;case"children":s=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(o(91));break;default:Ce(e,t,r,m,n,null)}mr(e,l,i,s);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:Ce(e,t,b,l,n,null)}return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(l=0;l<Ua.length;l++)ve(Ua[l],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("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(E in n)if(n.hasOwnProperty(E)&&(l=n[E],l!=null))switch(E){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ce(e,t,E,l,n,null)}return;default:if(Ms(t)){for(k in n)n.hasOwnProperty(k)&&(l=n[k],l!==void 0&&hu(e,t,k,l,n,void 0));return}}for(m in n)n.hasOwnProperty(m)&&(l=n[m],l!=null&&Ce(e,t,m,l,n,null))}function Tx(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,r=null,m=null,b=null,E=null,k=null;for(z in n){var B=n[z];if(n.hasOwnProperty(z)&&B!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":b=B;default:l.hasOwnProperty(z)||Ce(e,t,z,null,l,B)}}for(var M in l){var z=l[M];if(B=n[M],l.hasOwnProperty(M)&&(z!=null||B!=null))switch(M){case"type":s=z;break;case"name":i=z;break;case"checked":E=z;break;case"defaultChecked":k=z;break;case"value":r=z;break;case"defaultValue":m=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(o(137,t));break;default:z!==B&&Ce(e,t,M,z,l,B)}}Es(e,r,m,b,E,k,s,i);return;case"select":z=r=m=M=null;for(s in n)if(b=n[s],n.hasOwnProperty(s)&&b!=null)switch(s){case"value":break;case"multiple":z=b;default:l.hasOwnProperty(s)||Ce(e,t,s,null,l,b)}for(i in l)if(s=l[i],b=n[i],l.hasOwnProperty(i)&&(s!=null||b!=null))switch(i){case"value":M=s;break;case"defaultValue":m=s;break;case"multiple":r=s;default:s!==b&&Ce(e,t,i,s,l,b)}t=m,n=r,l=z,M!=null?yl(e,!!n,M,!1):!!l!=!!n&&(t!=null?yl(e,!!n,t,!0):yl(e,!!n,n?[]:"",!1));return;case"textarea":z=M=null;for(m in n)if(i=n[m],n.hasOwnProperty(m)&&i!=null&&!l.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Ce(e,t,m,null,l,i)}for(r in l)if(i=l[r],s=n[r],l.hasOwnProperty(r)&&(i!=null||s!=null))switch(r){case"value":M=i;break;case"defaultValue":z=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(o(91));break;default:i!==s&&Ce(e,t,r,i,l,s)}fr(e,M,z);return;case"option":for(var ee in n)if(M=n[ee],n.hasOwnProperty(ee)&&M!=null&&!l.hasOwnProperty(ee))switch(ee){case"selected":e.selected=!1;break;default:Ce(e,t,ee,null,l,M)}for(b in l)if(M=l[b],z=n[b],l.hasOwnProperty(b)&&M!==z&&(M!=null||z!=null))switch(b){case"selected":e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:Ce(e,t,b,M,l,z)}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 re in n)M=n[re],n.hasOwnProperty(re)&&M!=null&&!l.hasOwnProperty(re)&&Ce(e,t,re,null,l,M);for(E in l)if(M=l[E],z=n[E],l.hasOwnProperty(E)&&M!==z&&(M!=null||z!=null))switch(E){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(o(137,t));break;default:Ce(e,t,E,M,l,z)}return;default:if(Ms(t)){for(var ze in n)M=n[ze],n.hasOwnProperty(ze)&&M!==void 0&&!l.hasOwnProperty(ze)&&hu(e,t,ze,void 0,l,M);for(k in l)M=l[k],z=n[k],!l.hasOwnProperty(k)||M===z||M===void 0&&z===void 0||hu(e,t,k,M,l,z);return}}for(var N in n)M=n[N],n.hasOwnProperty(N)&&M!=null&&!l.hasOwnProperty(N)&&Ce(e,t,N,null,l,M);for(B in l)M=l[B],z=n[B],!l.hasOwnProperty(B)||M===z||M==null&&z==null||Ce(e,t,B,M,l,z)}function bf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ex(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var i=n[l],s=i.transferSize,r=i.initiatorType,m=i.duration;if(s&&m&&bf(r)){for(r=0,m=i.responseEnd,l+=1;l<n.length;l++){var b=n[l],E=b.startTime;if(E>m)break;var k=b.transferSize,B=b.initiatorType;k&&bf(B)&&(b=b.responseEnd,r+=k*(b<m?1:(m-E)/(b-E)))}if(--l,t+=8*(s+r)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var xu=null,gu=null;function Wi(e){return e.nodeType===9?e:e.ownerDocument}function vf(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 yf(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 pu(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 bu=null;function Ax(){var e=window.event;return e&&e.type==="popstate"?e===bu?!1:(bu=e,!0):(bu=null,!1)}var jf=typeof setTimeout=="function"?setTimeout:void 0,Mx=typeof clearTimeout=="function"?clearTimeout:void 0,Nf=typeof Promise=="function"?Promise:void 0,wx=typeof queueMicrotask=="function"?queueMicrotask:typeof Nf<"u"?function(e){return Nf.resolve(null).then(e).catch(Cx)}:jf;function Cx(e){setTimeout(function(){throw e})}function Dn(e){return e==="head"}function Sf(e,t){var n=t,l=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(i),Wl(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Ha(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ha(n);for(var s=n.firstChild;s;){var r=s.nextSibling,m=s.nodeName;s[na]||m==="SCRIPT"||m==="STYLE"||m==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=r}}else n==="body"&&Ha(e.ownerDocument.body);n=i}while(n);Wl(t)}function _f(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 vu(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":vu(n),_s(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function zx(e,t,n,l){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[na])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=Rt(e.nextSibling),e===null)break}return null}function Dx(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Rt(e.nextSibling),e===null))return null;return e}function Tf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Rt(e.nextSibling),e===null))return null;return e}function yu(e){return e.data==="$?"||e.data==="$~"}function ju(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ox(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 Rt(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 Nu=null;function Ef(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Rt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Af(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 Mf(e,t,n){switch(t=Wi(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 Ha(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_s(e)}var kt=new Map,wf=new Set;function Pi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fn=H.d;H.d={f:Rx,r:kx,D:Ux,C:qx,L:Hx,m:Bx,X:Yx,S:Lx,M:Gx};function Rx(){var e=fn.f(),t=Qi();return e||t}function kx(e){var t=pl(e);t!==null&&t.tag===5&&t.type==="form"?Vo(t):fn.r(e)}var Jl=typeof document>"u"?null:document;function Cf(e,t,n){var l=Jl;if(l&&typeof t=="string"&&t){var i=At(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),wf.has(i)||(wf.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),it(t,"link",e),Ie(t),l.head.appendChild(t)))}}function Ux(e){fn.D(e),Cf("dns-prefetch",e,null)}function qx(e,t){fn.C(e,t),Cf("preconnect",e,t)}function Hx(e,t,n){fn.L(e,t,n);var l=Jl;if(l&&e&&t){var i='link[rel="preload"][as="'+At(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+At(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+At(n.imageSizes)+'"]')):i+='[href="'+At(e)+'"]';var s=i;switch(t){case"style":s=Fl(e);break;case"script":s=Il(e)}kt.has(s)||(e=C({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),kt.set(s,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(Ba(s))||t==="script"&&l.querySelector(La(s))||(t=l.createElement("link"),it(t,"link",e),Ie(t),l.head.appendChild(t)))}}function Bx(e,t){fn.m(e,t);var n=Jl;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+At(l)+'"][href="'+At(e)+'"]',s=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Il(e)}if(!kt.has(s)&&(e=C({rel:"modulepreload",href:e},t),kt.set(s,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(La(s)))return}l=n.createElement("link"),it(l,"link",e),Ie(l),n.head.appendChild(l)}}}function Lx(e,t,n){fn.S(e,t,n);var l=Jl;if(l&&e){var i=bl(l).hoistableStyles,s=Fl(e);t=t||"default";var r=i.get(s);if(!r){var m={loading:0,preload:null};if(r=l.querySelector(Ba(s)))m.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":t},n),(n=kt.get(s))&&Su(e,n);var b=r=l.createElement("link");Ie(b),it(b,"link",e),b._p=new Promise(function(E,k){b.onload=E,b.onerror=k}),b.addEventListener("load",function(){m.loading|=1}),b.addEventListener("error",function(){m.loading|=2}),m.loading|=4,es(r,t,l)}r={type:"stylesheet",instance:r,count:1,state:m},i.set(s,r)}}}function Yx(e,t){fn.X(e,t);var n=Jl;if(n&&e){var l=bl(n).hoistableScripts,i=Il(e),s=l.get(i);s||(s=n.querySelector(La(i)),s||(e=C({src:e,async:!0},t),(t=kt.get(i))&&_u(e,t),s=n.createElement("script"),Ie(s),it(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(i,s))}}function Gx(e,t){fn.M(e,t);var n=Jl;if(n&&e){var l=bl(n).hoistableScripts,i=Il(e),s=l.get(i);s||(s=n.querySelector(La(i)),s||(e=C({src:e,async:!0,type:"module"},t),(t=kt.get(i))&&_u(e,t),s=n.createElement("script"),Ie(s),it(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(i,s))}}function zf(e,t,n,l){var i=(i=ce.current)?Pi(i):null;if(!i)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Fl(n.href),n=bl(i).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Fl(n.href);var s=bl(i).hoistableStyles,r=s.get(e);if(r||(i=i.ownerDocument||i,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,r),(s=i.querySelector(Ba(e)))&&!s._p&&(r.instance=s,r.state.loading=5),kt.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},kt.set(e,n),s||Xx(i,e,n,r.state))),t&&l===null)throw Error(o(528,""));return r}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=Il(n),n=bl(i).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Fl(e){return'href="'+At(e)+'"'}function Ba(e){return'link[rel="stylesheet"]['+e+"]"}function Df(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function Xx(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}),it(t,"link",n),Ie(t),e.head.appendChild(t))}function Il(e){return'[src="'+At(e)+'"]'}function La(e){return"script[async]"+e}function Of(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+At(n.href)+'"]');if(l)return t.instance=l,Ie(l),l;var i=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Ie(l),it(l,"style",i),es(l,n.precedence,e),t.instance=l;case"stylesheet":i=Fl(n.href);var s=e.querySelector(Ba(i));if(s)return t.state.loading|=4,t.instance=s,Ie(s),s;l=Df(n),(i=kt.get(i))&&Su(l,i),s=(e.ownerDocument||e).createElement("link"),Ie(s);var r=s;return r._p=new Promise(function(m,b){r.onload=m,r.onerror=b}),it(s,"link",l),t.state.loading|=4,es(s,n.precedence,e),t.instance=s;case"script":return s=Il(n.src),(i=e.querySelector(La(s)))?(t.instance=i,Ie(i),i):(l=n,(i=kt.get(s))&&(l=C({},n),_u(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),Ie(i),it(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,es(l,n.precedence,e));return t.instance}function es(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,s=i,r=0;r<l.length;r++){var m=l[r];if(m.dataset.precedence===t)s=m;else if(s!==i)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Su(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _u(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ts=null;function Rf(e,t,n){if(ts===null){var l=new Map,i=ts=new Map;i.set(n,l)}else i=ts,l=i.get(n),l||(l=new Map,i.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var s=n[i];if(!(s[na]||s[tt]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var r=s.getAttribute(t)||"";r=e+r;var m=l.get(r);m?m.push(s):l.set(r,[s])}}return l}function kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Qx(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 Uf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Vx(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Fl(l.href),s=t.querySelector(Ba(i));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ns.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ie(s);return}s=t.ownerDocument||t,l=Df(l),(i=kt.get(i))&&Su(l,i),s=s.createElement("link"),Ie(s);var r=s;r._p=new Promise(function(m,b){r.onload=m,r.onerror=b}),it(s,"link",l),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ns.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Tu=0;function Zx(e,t){return e.stylesheets&&e.count===0&&as(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&as(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&Tu===0&&(Tu=62500*Ex());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&as(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>Tu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function ns(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)as(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ls=null;function as(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ls=new Map,t.forEach($x,e),ls=null,ns.call(e))}function $x(e,t){if(!(t.state.loading&4)){var n=ls.get(e);if(n)var l=n.get(null);else{n=new Map,ls.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<i.length;s++){var r=i[s];(r.nodeName==="LINK"||r.getAttribute("media")!=="not all")&&(n.set(r.dataset.precedence,r),l=r)}l&&n.set(null,l)}i=t.instance,r=i.getAttribute("data-precedence"),s=n.get(r)||l,s===l&&n.set(null,i),n.set(r,i),this.count++,l=ns.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),s?s.parentNode.insertBefore(i,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Ya={$$typeof:$,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function Kx(e,t,n,l,i,s,r,m,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=ys(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ys(0),this.hiddenUpdates=ys(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=s,this.onRecoverableError=r,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function qf(e,t,n,l,i,s,r,m,b,E,k,B){return e=new Kx(e,t,n,r,b,E,k,B,m),t=1,s===!0&&(t|=24),s=yt(3,null,null,t),e.current=s,s.stateNode=e,t=ac(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:l,isDehydrated:n,cache:t},uc(s),e}function Hf(e){return e?(e=Ml,e):Ml}function Bf(e,t,n,l,i,s){i=Hf(i),l.context===null?l.context=i:l.pendingContext=i,l=jn(t),l.payload={element:n},s=s===void 0?null:s,s!==null&&(l.callback=s),n=Nn(e,l,t),n!==null&&(gt(n,e,t),va(n,e,t))}function Lf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Eu(e,t){Lf(e,t),(e=e.alternate)&&Lf(e,t)}function Yf(e){if(e.tag===13||e.tag===31){var t=In(e,67108864);t!==null&&gt(t,e,67108864),Eu(e,67108864)}}function Gf(e){if(e.tag===13||e.tag===31){var t=Tt();t=js(t);var n=In(e,t);n!==null&&gt(n,e,t),Eu(e,t)}}var is=!0;function Jx(e,t,n,l){var i=S.T;S.T=null;var s=H.p;try{H.p=2,Au(e,t,n,l)}finally{H.p=s,S.T=i}}function Fx(e,t,n,l){var i=S.T;S.T=null;var s=H.p;try{H.p=8,Au(e,t,n,l)}finally{H.p=s,S.T=i}}function Au(e,t,n,l){if(is){var i=Mu(l);if(i===null)mu(e,t,l,ss,n),Qf(e,l);else if(Wx(i,e,t,n,l))l.stopPropagation();else if(Qf(e,l),t&4&&-1<Ix.indexOf(e)){for(;i!==null;){var s=pl(i);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var r=Zn(s.pendingLanes);if(r!==0){var m=s;for(m.pendingLanes|=2,m.entangledLanes|=2;r;){var b=1<<31-bt(r);m.entanglements[1]|=b,r&=~b}Qt(s),(Ee&6)===0&&(Gi=Ue()+500,ka(0))}}break;case 31:case 13:m=In(s,2),m!==null&&gt(m,s,2),Qi(),Eu(s,2)}if(s=Mu(l),s===null&&mu(e,t,l,ss,n),s===i)break;i=s}i!==null&&l.stopPropagation()}else mu(e,t,l,null,n)}}function Mu(e){return e=Cs(e),wu(e)}var ss=null;function wu(e){if(ss=null,e=gl(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=y(t),e!==null)return e;e=null}else if(n===31){if(e=v(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 ss=e,null}function Xf(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(Qn()){case Vn:return 2;case Fu:return 8;case Ja:case qm:return 32;case Iu:return 268435456;default:return 32}default:return 32}}var Cu=!1,On=null,Rn=null,kn=null,Ga=new Map,Xa=new Map,Un=[],Ix="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 Qf(e,t){switch(e){case"focusin":case"focusout":On=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":kn=null;break;case"pointerover":case"pointerout":Ga.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xa.delete(t.pointerId)}}function Qa(e,t,n,l,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:s,targetContainers:[i]},t!==null&&(t=pl(t),t!==null&&Yf(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Wx(e,t,n,l,i){switch(t){case"focusin":return On=Qa(On,e,t,n,l,i),!0;case"dragenter":return Rn=Qa(Rn,e,t,n,l,i),!0;case"mouseover":return kn=Qa(kn,e,t,n,l,i),!0;case"pointerover":var s=i.pointerId;return Ga.set(s,Qa(Ga.get(s)||null,e,t,n,l,i)),!0;case"gotpointercapture":return s=i.pointerId,Xa.set(s,Qa(Xa.get(s)||null,e,t,n,l,i)),!0}return!1}function Vf(e){var t=gl(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=y(n),t!==null){e.blockedOn=t,lr(e.priority,function(){Gf(n)});return}}else if(t===31){if(t=v(n),t!==null){e.blockedOn=t,lr(e.priority,function(){Gf(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 cs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Mu(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);ws=l,n.target.dispatchEvent(l),ws=null}else return t=pl(n),t!==null&&Yf(t),e.blockedOn=n,!1;t.shift()}return!0}function Zf(e,t,n){cs(e)&&n.delete(t)}function Px(){Cu=!1,On!==null&&cs(On)&&(On=null),Rn!==null&&cs(Rn)&&(Rn=null),kn!==null&&cs(kn)&&(kn=null),Ga.forEach(Zf),Xa.forEach(Zf)}function us(e,t){e.blockedOn===t&&(e.blockedOn=null,Cu||(Cu=!0,c.unstable_scheduleCallback(c.unstable_NormalPriority,Px)))}var rs=null;function $f(e){rs!==e&&(rs=e,c.unstable_scheduleCallback(c.unstable_NormalPriority,function(){rs===e&&(rs=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(wu(l||n)===null)continue;break}var s=pl(n);s!==null&&(e.splice(t,3),t-=3,Mc(s,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function Wl(e){function t(b){return us(b,e)}On!==null&&us(On,e),Rn!==null&&us(Rn,e),kn!==null&&us(kn,e),Ga.forEach(t),Xa.forEach(t);for(var n=0;n<Un.length;n++){var l=Un[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Un.length&&(n=Un[0],n.blockedOn===null);)Vf(n),n.blockedOn===null&&Un.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],s=n[l+1],r=i[ot]||null;if(typeof s=="function")r||$f(n);else if(r){var m=null;if(s&&s.hasAttribute("formAction")){if(i=s,r=s[ot]||null)m=r.formAction;else if(wu(i)!==null)continue}else m=r.action;typeof m=="function"?n[l+1]=m:(n.splice(l,3),l-=3),$f(n)}}}function Kf(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(r){return i=r})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function zu(e){this._internalRoot=e}os.prototype.render=zu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=Tt();Bf(n,l,e,t,null,null)},os.prototype.unmount=zu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bf(e.current,2,null,e,null,null),Qi(),t[xl]=null}};function os(e){this._internalRoot=e}os.prototype.unstable_scheduleHydration=function(e){if(e){var t=nr();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Un.length&&t!==0&&t<Un[n].priority;n++);Un.splice(n,0,e),n===0&&Vf(e)}};var Jf=u.version;if(Jf!=="19.2.4")throw Error(o(527,Jf,"19.2.4"));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=x(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var eg={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:S,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ds=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ds.isDisabled&&ds.supportsFiber)try{Pl=ds.inject(eg),pt=ds}catch{}}return Za.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,l="",i=td,s=nd,r=ld;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=qf(e,1,!1,null,null,n,l,null,i,s,r,Kf),e[xl]=t.current,fu(e),new zu(t)},Za.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var l=!1,i="",s=td,r=nd,m=ld,b=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(r=n.onCaughtError),n.onRecoverableError!==void 0&&(m=n.onRecoverableError),n.formState!==void 0&&(b=n.formState)),t=qf(e,1,!0,t,n??null,l,i,b,s,r,m,Kf),t.context=Hf(null),n=t.current,l=Tt(),l=js(l),i=jn(l),i.callback=null,Nn(n,i,l),n=l,t.current.lanes=n,ta(t,n),Qt(t),e[xl]=t.current,fu(e),new os(t)},Za.version="19.2.4",Za}var im;function fg(){if(im)return Ru.exports;im=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(u){console.error(u)}}return c(),Ru.exports=dg(),Ru.exports}var mg=fg();const dl="/dashboard";function sm(){const c=window.location.pathname;return c===dl||c===dl+"/"?"/":c.startsWith(dl+"/")?c.slice(dl.length):c||"/"}function fl(c){return c==="/"||c===""?dl+"/":dl+(c.startsWith("/")?c:"/"+c)}function ps(c){const u=fl(c);u!==window.location.pathname+window.location.search&&window.history.pushState({},"",u),window.dispatchEvent(new Event("dashboard:navigate"))}typeof document<"u"&&!window.__dashboardRouterInstalled&&(window.__dashboardRouterInstalled=!0,document.addEventListener("click",c=>{var o,d;if(c.defaultPrevented||c.button!==0||c.metaKey||c.ctrlKey||c.shiftKey||c.altKey)return;const u=(d=(o=c.target)==null?void 0:o.closest)==null?void 0:d.call(o,"a");if(!u)return;const f=u.getAttribute("href");f&&(u.hasAttribute("target")||u.hasAttribute("download")||f.startsWith(dl)&&(c.preventDefault(),f!==window.location.pathname+window.location.search&&window.history.pushState({},"",f),window.dispatchEvent(new Event("dashboard:navigate"))))}),window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("dashboard:navigate"))}));function vm(){const[c,u]=w.useState(sm());return w.useEffect(()=>{const f=()=>u(sm());return window.addEventListener("dashboard:navigate",f),()=>{window.removeEventListener("dashboard:navigate",f)}},[]),c}function hg(c){return new URLSearchParams(c).get("expert")==="1"}function cm(){return typeof window>"u"?!1:hg(window.location.search)}function ym(){const[c,u]=w.useState(cm);return w.useEffect(()=>{if(typeof window>"u")return;const f=window,o=()=>u(cm());return f.addEventListener("dashboard:navigate",o),()=>f.removeEventListener("dashboard:navigate",o)},[]),c}function jm(c){let u=c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");u=u.replace(/```(\w*)\n?([\s\S]*?)```/g,(h,y,v)=>`<pre class="md-code-block"><code>${v.trimEnd()}</code></pre>`),u=u.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),u=u.replace(/\*\*([^*\n]+)\*\*/g,"<strong>$1</strong>"),u=u.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const f=u.split(`
50
- `),o=[];let d=!1;for(let h=0;h<f.length;h++){const y=f[h],v=y.match(/^###\s+(.+)$/),g=y.match(/^##\s+(.+)$/),x=y.match(/^#\s+(.+)$/);if(v){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${v[1]}</h3>`);continue}if(g){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${g[1]}</h2>`);continue}if(x){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${x[1]}</h1>`);continue}const _=y.match(/^(\s*)[*-]\s+(.+)$/);if(_){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${_[2]}</li>`);continue}if(y.trim()===""){d&&(o.push("</ul>"),d=!1),o.push("");continue}d&&(o.push("</ul>"),d=!1),o.push(y)}return d&&o.push("</ul>"),o.join(`
48
+ `+l.stack}}var P=Object.prototype.hasOwnProperty,ke=c.unstable_scheduleCallback,Fe=c.unstable_cancelCallback,et=c.unstable_shouldYield,Ut=c.unstable_requestPaint,Ue=c.unstable_now,Vn=c.unstable_getCurrentPriorityLevel,Zn=c.unstable_ImmediatePriority,Fu=c.unstable_UserBlockingPriority,Ja=c.unstable_NormalPriority,qm=c.unstable_LowPriority,Iu=c.unstable_IdlePriority,Hm=c.log,Bm=c.unstable_setDisableYieldValue,Pl=null,pt=null;function mn(e){if(typeof Hm=="function"&&Bm(e),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(Pl,e)}catch{}}var bt=Math.clz32?Math.clz32:Gm,Lm=Math.log,Ym=Math.LN2;function Gm(e){return e>>>=0,e===0?32:31-(Lm(e)/Ym|0)|0}var Fa=256,Ia=262144,Wa=4194304;function $n(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 Pa(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,s=e.suspendedLanes,r=e.pingedLanes;e=e.warmLanes;var m=l&134217727;return m!==0?(l=m&~s,l!==0?i=$n(l):(r&=m,r!==0?i=$n(r):n||(n=m&~e,n!==0&&(i=$n(n))))):(m=l&~s,m!==0?i=$n(m):r!==0?i=$n(r):n||(n=l&~e,n!==0&&(i=$n(n)))),i===0?0:t!==0&&t!==i&&(t&s)===0&&(s=i&-i,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:i}function ea(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xm(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 Wu(){var e=Wa;return Wa<<=1,(Wa&62914560)===0&&(Wa=4194304),e}function ys(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ta(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qm(e,t,n,l,i,s){var r=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 m=e.entanglements,b=e.expirationTimes,E=e.hiddenUpdates;for(n=r&~n;0<n;){var k=31-bt(n),B=1<<k;m[k]=0,b[k]=-1;var M=E[k];if(M!==null)for(E[k]=null,k=0;k<M.length;k++){var z=M[k];z!==null&&(z.lane&=-536870913)}n&=~B}l!==0&&Pu(e,l,0),s!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=s&~(r&~t))}function Pu(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-bt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function er(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-bt(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function tr(e,t){var n=t&-t;return n=(n&42)!==0?1:js(n),(n&(e.suspendedLanes|t))!==0?0:n}function js(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 Ns(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function nr(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Xf(e.type))}function lr(e,t){var n=H.p;try{return H.p=e,t()}finally{H.p=n}}var hn=Math.random().toString(36).slice(2),tt="__reactFiber$"+hn,ot="__reactProps$"+hn,xl="__reactContainer$"+hn,Ss="__reactEvents$"+hn,Vm="__reactListeners$"+hn,Zm="__reactHandles$"+hn,ar="__reactResources$"+hn,na="__reactMarker$"+hn;function _s(e){delete e[tt],delete e[ot],delete e[Ss],delete e[Vm],delete e[Zm]}function gl(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[xl]||n[tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Af(e);e!==null;){if(n=e[tt])return n;e=Af(e)}return t}e=n,n=e.parentNode}return null}function pl(e){if(e=e[tt]||e[xl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function la(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function bl(e){var t=e[ar];return t||(t=e[ar]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ie(e){e[na]=!0}var ir=new Set,sr={};function Kn(e,t){vl(e,t),vl(e+"Capture",t)}function vl(e,t){for(sr[e]=t,e=0;e<t.length;e++)ir.add(t[e])}var $m=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]*$"),cr={},ur={};function Km(e){return P.call(ur,e)?!0:P.call(cr,e)?!1:$m.test(e)?ur[e]=!0:(cr[e]=!0,!1)}function ei(e,t,n){if(Km(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 ti(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 Kt(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 Et(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function rr(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jm(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var i=l.get,s=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(r){n=""+r,s.call(this,r)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(r){n=""+r},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ts(e){if(!e._valueTracker){var t=rr(e)?"checked":"value";e._valueTracker=Jm(e,t,""+e[t])}}function or(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=rr(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function ni(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 Fm=/[\n"\\]/g;function At(e){return e.replace(Fm,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Es(e,t,n,l,i,s,r,m){e.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?e.type=r:e.removeAttribute("type"),t!=null?r==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Et(t)):e.value!==""+Et(t)&&(e.value=""+Et(t)):r!=="submit"&&r!=="reset"||e.removeAttribute("value"),t!=null?As(e,r,Et(t)):n!=null?As(e,r,Et(n)):l!=null&&e.removeAttribute("value"),i==null&&s!=null&&(e.defaultChecked=!!s),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+Et(m):e.removeAttribute("name")}function dr(e,t,n,l,i,s,r,m){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){Ts(e);return}n=n!=null?""+Et(n):"",t=t!=null?""+Et(t):n,m||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=m?e.checked:!!l,e.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.name=r),Ts(e)}function As(e,t,n){t==="number"&&ni(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function yl(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Et(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function fr(e,t,n){if(t!=null&&(t=""+Et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Et(n):""}function mr(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if(A(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Et(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Ts(e)}function jl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Im=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 hr(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||Im.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function xr(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&hr(e,i,l)}else for(var s in t)t.hasOwnProperty(s)&&hr(e,s,t[s])}function Ms(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 Wm=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"]]),Pm=/^[\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 li(e){return Pm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Jt(){}var ws=null;function Cs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nl=null,Sl=null;function gr(e){var t=pl(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;e:switch(e=t.stateNode,t.type){case"input":if(Es(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="'+At(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[ot]||null;if(!i)throw Error(o(90));Es(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&or(l)}break e;case"textarea":fr(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&yl(e,!!n.multiple,t,!1)}}}var zs=!1;function pr(e,t,n){if(zs)return e(t,n);zs=!0;try{var l=e(t);return l}finally{if(zs=!1,(Nl!==null||Sl!==null)&&(Qi(),Nl&&(t=Nl,e=Sl,Sl=Nl=null,gr(t),e)))for(t=0;t<e.length;t++)gr(e[t])}}function aa(e,t){var n=e.stateNode;if(n===null)return null;var l=n[ot]||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 Ft=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ds=!1;if(Ft)try{var ia={};Object.defineProperty(ia,"passive",{get:function(){Ds=!0}}),window.addEventListener("test",ia,ia),window.removeEventListener("test",ia,ia)}catch{Ds=!1}var xn=null,Os=null,ai=null;function br(){if(ai)return ai;var e,t=Os,n=t.length,l,i="value"in xn?xn.value:xn.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var r=n-e;for(l=1;l<=r&&t[n-l]===i[s-l];l++);return ai=i.slice(e,1<l?1-l:void 0)}function ii(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 si(){return!0}function vr(){return!1}function dt(e){function t(n,l,i,s,r){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=s,this.target=r,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(n=e[m],this[m]=n?n(s):s[m]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?si:vr,this.isPropagationStopped=vr,this}return C(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=si)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=si)},persist:function(){},isPersistent:si}),t}var Jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ci=dt(Jn),sa=C({},Jn,{view:0,detail:0}),eh=dt(sa),Rs,ks,ca,ui=C({},sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qs,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!==ca&&(ca&&e.type==="mousemove"?(Rs=e.screenX-ca.screenX,ks=e.screenY-ca.screenY):ks=Rs=0,ca=e),Rs)},movementY:function(e){return"movementY"in e?e.movementY:ks}}),yr=dt(ui),th=C({},ui,{dataTransfer:0}),nh=dt(th),lh=C({},sa,{relatedTarget:0}),Us=dt(lh),ah=C({},Jn,{animationName:0,elapsedTime:0,pseudoElement:0}),ih=dt(ah),sh=C({},Jn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ch=dt(sh),uh=C({},Jn,{data:0}),jr=dt(uh),rh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oh={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"},dh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=dh[e])?!!t[e]:!1}function qs(){return fh}var mh=C({},sa,{key:function(e){if(e.key){var t=rh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ii(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?oh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qs,charCode:function(e){return e.type==="keypress"?ii(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ii(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hh=dt(mh),xh=C({},ui,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nr=dt(xh),gh=C({},sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qs}),ph=dt(gh),bh=C({},Jn,{propertyName:0,elapsedTime:0,pseudoElement:0}),vh=dt(bh),yh=C({},ui,{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}),jh=dt(yh),Nh=C({},Jn,{newState:0,oldState:0}),Sh=dt(Nh),_h=[9,13,27,32],Hs=Ft&&"CompositionEvent"in window,ua=null;Ft&&"documentMode"in document&&(ua=document.documentMode);var Th=Ft&&"TextEvent"in window&&!ua,Sr=Ft&&(!Hs||ua&&8<ua&&11>=ua),_r=" ",Tr=!1;function Er(e,t){switch(e){case"keyup":return _h.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ar(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _l=!1;function Eh(e,t){switch(e){case"compositionend":return Ar(t);case"keypress":return t.which!==32?null:(Tr=!0,_r);case"textInput":return e=t.data,e===_r&&Tr?null:e;default:return null}}function Ah(e,t){if(_l)return e==="compositionend"||!Hs&&Er(e,t)?(e=br(),ai=Os=xn=null,_l=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Sr&&t.locale!=="ko"?null:t.data;default:return null}}var Mh={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 Mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mh[e.type]:t==="textarea"}function wr(e,t,n,l){Nl?Sl?Sl.push(l):Sl=[l]:Nl=l,t=Ii(t,"onChange"),0<t.length&&(n=new ci("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var ra=null,oa=null;function wh(e){mf(e,0)}function ri(e){var t=la(e);if(or(t))return e}function Cr(e,t){if(e==="change")return t}var zr=!1;if(Ft){var Bs;if(Ft){var Ls="oninput"in document;if(!Ls){var Dr=document.createElement("div");Dr.setAttribute("oninput","return;"),Ls=typeof Dr.oninput=="function"}Bs=Ls}else Bs=!1;zr=Bs&&(!document.documentMode||9<document.documentMode)}function Or(){ra&&(ra.detachEvent("onpropertychange",Rr),oa=ra=null)}function Rr(e){if(e.propertyName==="value"&&ri(oa)){var t=[];wr(t,oa,e,Cs(e)),pr(wh,t)}}function Ch(e,t,n){e==="focusin"?(Or(),ra=t,oa=n,ra.attachEvent("onpropertychange",Rr)):e==="focusout"&&Or()}function zh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ri(oa)}function Dh(e,t){if(e==="click")return ri(t)}function Oh(e,t){if(e==="input"||e==="change")return ri(t)}function Rh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vt=typeof Object.is=="function"?Object.is:Rh;function da(e,t){if(vt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var i=n[l];if(!P.call(t,i)||!vt(e[i],t[i]))return!1}return!0}function kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ur(e,t){var n=kr(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=kr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ni(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=ni(e.document)}return t}function Ys(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 kh=Ft&&"documentMode"in document&&11>=document.documentMode,Tl=null,Gs=null,fa=null,Xs=!1;function Br(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xs||Tl==null||Tl!==ni(l)||(l=Tl,"selectionStart"in l&&Ys(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}),fa&&da(fa,l)||(fa=l,l=Ii(Gs,"onSelect"),0<l.length&&(t=new ci("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Tl)))}function Fn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var El={animationend:Fn("Animation","AnimationEnd"),animationiteration:Fn("Animation","AnimationIteration"),animationstart:Fn("Animation","AnimationStart"),transitionrun:Fn("Transition","TransitionRun"),transitionstart:Fn("Transition","TransitionStart"),transitioncancel:Fn("Transition","TransitionCancel"),transitionend:Fn("Transition","TransitionEnd")},Qs={},Lr={};Ft&&(Lr=document.createElement("div").style,"AnimationEvent"in window||(delete El.animationend.animation,delete El.animationiteration.animation,delete El.animationstart.animation),"TransitionEvent"in window||delete El.transitionend.transition);function In(e){if(Qs[e])return Qs[e];if(!El[e])return e;var t=El[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Qs[e]=t[n];return e}var Yr=In("animationend"),Gr=In("animationiteration"),Xr=In("animationstart"),Uh=In("transitionrun"),qh=In("transitionstart"),Hh=In("transitioncancel"),Qr=In("transitionend"),Vr=new Map,Vs="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(" ");Vs.push("scrollEnd");function qt(e,t){Vr.set(e,t),Kn(t,[e])}var oi=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)},Mt=[],Al=0,Zs=0;function di(){for(var e=Al,t=Zs=Al=0;t<e;){var n=Mt[t];Mt[t++]=null;var l=Mt[t];Mt[t++]=null;var i=Mt[t];Mt[t++]=null;var s=Mt[t];if(Mt[t++]=null,l!==null&&i!==null){var r=l.pending;r===null?i.next=i:(i.next=r.next,r.next=i),l.pending=i}s!==0&&Zr(n,i,s)}}function fi(e,t,n,l){Mt[Al++]=e,Mt[Al++]=t,Mt[Al++]=n,Mt[Al++]=l,Zs|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function $s(e,t,n,l){return fi(e,t,n,l),mi(e)}function Wn(e,t){return fi(e,null,null,t),mi(e)}function Zr(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,s=e.return;s!==null;)s.childLanes|=n,l=s.alternate,l!==null&&(l.childLanes|=n),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(i=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,i&&t!==null&&(i=31-bt(n),e=s.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),s):null}function mi(e){if(50<Ra)throw Ra=0,nu=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ml={};function Bh(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 yt(e,t,n,l){return new Bh(e,t,n,l)}function Ks(e){return e=e.prototype,!(!e||!e.isReactComponent)}function It(e,t){var n=e.alternate;return n===null?(n=yt(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 $r(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 hi(e,t,n,l,i,s){var r=0;if(l=e,typeof e=="function")Ks(e)&&(r=1);else if(typeof e=="string")r=Qx(e,n,L.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ue:return e=yt(31,n,t,i),e.elementType=ue,e.lanes=s,e;case I:return Pn(n.children,i,s,t);case X:r=8,i|=24;break;case de:return e=yt(12,n,t,i|2),e.elementType=de,e.lanes=s,e;case D:return e=yt(13,n,t,i),e.elementType=D,e.lanes=s,e;case ae:return e=yt(19,n,t,i),e.elementType=ae,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $:r=10;break e;case Z:r=9;break e;case Q:r=11;break e;case G:r=14;break e;case te:r=16,l=null;break e}r=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=yt(r,n,t,i),t.elementType=e,t.type=l,t.lanes=s,t}function Pn(e,t,n,l){return e=yt(7,e,l,t),e.lanes=n,e}function Js(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function Kr(e){var t=yt(18,null,null,0);return t.stateNode=e,t}function Fs(e,t,n){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Jr=new WeakMap;function wt(e,t){if(typeof e=="object"&&e!==null){var n=Jr.get(e);return n!==void 0?n:(t={value:e,source:t,stack:hl(t)},Jr.set(e,t),t)}return{value:e,source:t,stack:hl(t)}}var wl=[],Cl=0,xi=null,ma=0,Ct=[],zt=0,gn=null,Yt=1,Gt="";function Wt(e,t){wl[Cl++]=ma,wl[Cl++]=xi,xi=e,ma=t}function Fr(e,t,n){Ct[zt++]=Yt,Ct[zt++]=Gt,Ct[zt++]=gn,gn=e;var l=Yt;e=Gt;var i=32-bt(l)-1;l&=~(1<<i),n+=1;var s=32-bt(t)+i;if(30<s){var r=i-i%5;s=(l&(1<<r)-1).toString(32),l>>=r,i-=r,Yt=1<<32-bt(t)+i|n<<i|l,Gt=s+e}else Yt=1<<s|n<<i|l,Gt=e}function Is(e){e.return!==null&&(Wt(e,1),Fr(e,1,0))}function Ws(e){for(;e===xi;)xi=wl[--Cl],wl[Cl]=null,ma=wl[--Cl],wl[Cl]=null;for(;e===gn;)gn=Ct[--zt],Ct[zt]=null,Gt=Ct[--zt],Ct[zt]=null,Yt=Ct[--zt],Ct[zt]=null}function Ir(e,t){Ct[zt++]=Yt,Ct[zt++]=Gt,Ct[zt++]=gn,Yt=t.id,Gt=t.overflow,gn=e}var nt=null,Oe=null,Ne=!1,pn=null,Dt=!1,Ps=Error(o(519));function bn(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ha(wt(t,e)),Ps}function Wr(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[tt]=e,t[ot]=l,n){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(n=0;n<Ua.length;n++)ve(Ua[n],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),dr(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),mr(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||pf(t.textContent,n)?(l.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),l.onScroll!=null&&ve("scroll",t),l.onScrollEnd!=null&&ve("scrollend",t),l.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||bn(e,!0)}function Pr(e){for(nt=e.return;nt;)switch(nt.tag){case 5:case 31:case 13:Dt=!1;return;case 27:case 3:Dt=!0;return;default:nt=nt.return}}function zl(e){if(e!==nt)return!1;if(!Ne)return Pr(e),Ne=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||pu(e.type,e.memoizedProps)),n=!n),n&&Oe&&bn(e),Pr(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Oe=Ef(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Oe=Ef(e)}else t===27?(t=Oe,Dn(e.type)?(e=Nu,Nu=null,Oe=e):Oe=t):Oe=nt?Rt(e.stateNode.nextSibling):null;return!0}function el(){Oe=nt=null,Ne=!1}function ec(){var e=pn;return e!==null&&(xt===null?xt=e:xt.push.apply(xt,e),pn=null),e}function ha(e){pn===null?pn=[e]:pn.push(e)}var tc=p(null),tl=null,Pt=null;function vn(e,t,n){Y(tc,t._currentValue),t._currentValue=n}function en(e){e._currentValue=tc.current,O(tc)}function nc(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 lc(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var s=i.dependencies;if(s!==null){var r=i.child;s=s.firstContext;e:for(;s!==null;){var m=s;s=i;for(var b=0;b<t.length;b++)if(m.context===t[b]){s.lanes|=n,m=s.alternate,m!==null&&(m.lanes|=n),nc(s.return,n,e),l||(r=null);break e}s=m.next}}else if(i.tag===18){if(r=i.return,r===null)throw Error(o(341));r.lanes|=n,s=r.alternate,s!==null&&(s.lanes|=n),nc(r,n,e),r=null}else r=i.child;if(r!==null)r.return=i;else for(r=i;r!==null;){if(r===e){r=null;break}if(i=r.sibling,i!==null){i.return=r.return,r=i;break}r=r.return}i=r}}function Dl(e,t,n,l){e=null;for(var i=t,s=!1;i!==null;){if(!s){if((i.flags&524288)!==0)s=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var r=i.alternate;if(r===null)throw Error(o(387));if(r=r.memoizedProps,r!==null){var m=i.type;vt(i.pendingProps.value,r.value)||(e!==null?e.push(m):e=[m])}}else if(i===pe.current){if(r=i.alternate,r===null)throw Error(o(387));r.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Ya):e=[Ya])}i=i.return}e!==null&&lc(t,e,n,l),t.flags|=262144}function gi(e){for(e=e.firstContext;e!==null;){if(!vt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function nl(e){tl=e,Pt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function lt(e){return eo(tl,e)}function pi(e,t){return tl===null&&nl(e),eo(e,t)}function eo(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Pt===null){if(e===null)throw Error(o(308));Pt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pt=Pt.next=t;return n}var Lh=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()})}},Yh=c.unstable_scheduleCallback,Gh=c.unstable_NormalPriority,Ve={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ac(){return{controller:new Lh,data:new Map,refCount:0}}function xa(e){e.refCount--,e.refCount===0&&Yh(Gh,function(){e.controller.abort()})}var ga=null,ic=0,Ol=0,Rl=null;function Xh(e,t){if(ga===null){var n=ga=[];ic=0,Ol=uu(),Rl={status:"pending",value:void 0,then:function(l){n.push(l)}}}return ic++,t.then(to,to),t}function to(){if(--ic===0&&ga!==null){Rl!==null&&(Rl.status="fulfilled");var e=ga;ga=null,Ol=0,Rl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Qh(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),l}var no=S.S;S.S=function(e,t){Ld=Ue(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Xh(e,t),no!==null&&no(e,t)};var ll=p(null);function sc(){var e=ll.current;return e!==null?e:De.pooledCache}function bi(e,t){t===null?Y(ll,ll.current):Y(ll,t.pool)}function lo(){var e=sc();return e===null?null:{parent:Ve._currentValue,pool:e}}var kl=Error(o(460)),cc=Error(o(474)),vi=Error(o(542)),yi={then:function(){}};function ao(e){return e=e.status,e==="fulfilled"||e==="rejected"}function io(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jt,Jt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,co(e),e;default:if(typeof t.status=="string")t.then(Jt,Jt);else{if(e=De,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,co(e),e}throw il=t,kl}}function al(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(il=n,kl):n}}var il=null;function so(){if(il===null)throw Error(o(459));var e=il;return il=null,e}function co(e){if(e===kl||e===vi)throw Error(o(483))}var Ul=null,pa=0;function ji(e){var t=pa;return pa+=1,Ul===null&&(Ul=[]),io(Ul,e,t)}function ba(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ni(e,t){throw t.$$typeof===U?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function uo(e){function t(N,j){if(e){var T=N.deletions;T===null?(N.deletions=[j],N.flags|=16):T.push(j)}}function n(N,j){if(!e)return null;for(;j!==null;)t(N,j),j=j.sibling;return null}function l(N){for(var j=new Map;N!==null;)N.key!==null?j.set(N.key,N):j.set(N.index,N),N=N.sibling;return j}function i(N,j){return N=It(N,j),N.index=0,N.sibling=null,N}function s(N,j,T){return N.index=T,e?(T=N.alternate,T!==null?(T=T.index,T<j?(N.flags|=67108866,j):T):(N.flags|=67108866,j)):(N.flags|=1048576,j)}function r(N){return e&&N.alternate===null&&(N.flags|=67108866),N}function m(N,j,T,q){return j===null||j.tag!==6?(j=Js(T,N.mode,q),j.return=N,j):(j=i(j,T),j.return=N,j)}function b(N,j,T,q){var se=T.type;return se===I?k(N,j,T.props.children,q,T.key):j!==null&&(j.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===te&&al(se)===j.type)?(j=i(j,T.props),ba(j,T),j.return=N,j):(j=hi(T.type,T.key,T.props,null,N.mode,q),ba(j,T),j.return=N,j)}function E(N,j,T,q){return j===null||j.tag!==4||j.stateNode.containerInfo!==T.containerInfo||j.stateNode.implementation!==T.implementation?(j=Fs(T,N.mode,q),j.return=N,j):(j=i(j,T.children||[]),j.return=N,j)}function k(N,j,T,q,se){return j===null||j.tag!==7?(j=Pn(T,N.mode,q,se),j.return=N,j):(j=i(j,T),j.return=N,j)}function B(N,j,T){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=Js(""+j,N.mode,T),j.return=N,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case V:return T=hi(j.type,j.key,j.props,null,N.mode,T),ba(T,j),T.return=N,T;case F:return j=Fs(j,N.mode,T),j.return=N,j;case te:return j=al(j),B(N,j,T)}if(A(j)||J(j))return j=Pn(j,N.mode,T,null),j.return=N,j;if(typeof j.then=="function")return B(N,ji(j),T);if(j.$$typeof===$)return B(N,pi(N,j),T);Ni(N,j)}return null}function M(N,j,T,q){var se=j!==null?j.key:null;if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return se!==null?null:m(N,j,""+T,q);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case V:return T.key===se?b(N,j,T,q):null;case F:return T.key===se?E(N,j,T,q):null;case te:return T=al(T),M(N,j,T,q)}if(A(T)||J(T))return se!==null?null:k(N,j,T,q,null);if(typeof T.then=="function")return M(N,j,ji(T),q);if(T.$$typeof===$)return M(N,j,pi(N,T),q);Ni(N,T)}return null}function z(N,j,T,q,se){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return N=N.get(T)||null,m(j,N,""+q,se);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case V:return N=N.get(q.key===null?T:q.key)||null,b(j,N,q,se);case F:return N=N.get(q.key===null?T:q.key)||null,E(j,N,q,se);case te:return q=al(q),z(N,j,T,q,se)}if(A(q)||J(q))return N=N.get(T)||null,k(j,N,q,se,null);if(typeof q.then=="function")return z(N,j,T,ji(q),se);if(q.$$typeof===$)return z(N,j,T,pi(j,q),se);Ni(j,q)}return null}function ee(N,j,T,q){for(var se=null,_e=null,le=j,ge=j=0,je=null;le!==null&&ge<T.length;ge++){le.index>ge?(je=le,le=null):je=le.sibling;var Te=M(N,le,T[ge],q);if(Te===null){le===null&&(le=je);break}e&&le&&Te.alternate===null&&t(N,le),j=s(Te,j,ge),_e===null?se=Te:_e.sibling=Te,_e=Te,le=je}if(ge===T.length)return n(N,le),Ne&&Wt(N,ge),se;if(le===null){for(;ge<T.length;ge++)le=B(N,T[ge],q),le!==null&&(j=s(le,j,ge),_e===null?se=le:_e.sibling=le,_e=le);return Ne&&Wt(N,ge),se}for(le=l(le);ge<T.length;ge++)je=z(le,N,ge,T[ge],q),je!==null&&(e&&je.alternate!==null&&le.delete(je.key===null?ge:je.key),j=s(je,j,ge),_e===null?se=je:_e.sibling=je,_e=je);return e&&le.forEach(function(qn){return t(N,qn)}),Ne&&Wt(N,ge),se}function re(N,j,T,q){if(T==null)throw Error(o(151));for(var se=null,_e=null,le=j,ge=j=0,je=null,Te=T.next();le!==null&&!Te.done;ge++,Te=T.next()){le.index>ge?(je=le,le=null):je=le.sibling;var qn=M(N,le,Te.value,q);if(qn===null){le===null&&(le=je);break}e&&le&&qn.alternate===null&&t(N,le),j=s(qn,j,ge),_e===null?se=qn:_e.sibling=qn,_e=qn,le=je}if(Te.done)return n(N,le),Ne&&Wt(N,ge),se;if(le===null){for(;!Te.done;ge++,Te=T.next())Te=B(N,Te.value,q),Te!==null&&(j=s(Te,j,ge),_e===null?se=Te:_e.sibling=Te,_e=Te);return Ne&&Wt(N,ge),se}for(le=l(le);!Te.done;ge++,Te=T.next())Te=z(le,N,ge,Te.value,q),Te!==null&&(e&&Te.alternate!==null&&le.delete(Te.key===null?ge:Te.key),j=s(Te,j,ge),_e===null?se=Te:_e.sibling=Te,_e=Te);return e&&le.forEach(function(tg){return t(N,tg)}),Ne&&Wt(N,ge),se}function ze(N,j,T,q){if(typeof T=="object"&&T!==null&&T.type===I&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case V:e:{for(var se=T.key;j!==null;){if(j.key===se){if(se=T.type,se===I){if(j.tag===7){n(N,j.sibling),q=i(j,T.props.children),q.return=N,N=q;break e}}else if(j.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===te&&al(se)===j.type){n(N,j.sibling),q=i(j,T.props),ba(q,T),q.return=N,N=q;break e}n(N,j);break}else t(N,j);j=j.sibling}T.type===I?(q=Pn(T.props.children,N.mode,q,T.key),q.return=N,N=q):(q=hi(T.type,T.key,T.props,null,N.mode,q),ba(q,T),q.return=N,N=q)}return r(N);case F:e:{for(se=T.key;j!==null;){if(j.key===se)if(j.tag===4&&j.stateNode.containerInfo===T.containerInfo&&j.stateNode.implementation===T.implementation){n(N,j.sibling),q=i(j,T.children||[]),q.return=N,N=q;break e}else{n(N,j);break}else t(N,j);j=j.sibling}q=Fs(T,N.mode,q),q.return=N,N=q}return r(N);case te:return T=al(T),ze(N,j,T,q)}if(A(T))return ee(N,j,T,q);if(J(T)){if(se=J(T),typeof se!="function")throw Error(o(150));return T=se.call(T),re(N,j,T,q)}if(typeof T.then=="function")return ze(N,j,ji(T),q);if(T.$$typeof===$)return ze(N,j,pi(N,T),q);Ni(N,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,j!==null&&j.tag===6?(n(N,j.sibling),q=i(j,T),q.return=N,N=q):(n(N,j),q=Js(T,N.mode,q),q.return=N,N=q),r(N)):n(N,j)}return function(N,j,T,q){try{pa=0;var se=ze(N,j,T,q);return Ul=null,se}catch(le){if(le===kl||le===vi)throw le;var _e=yt(29,le,null,N.mode);return _e.lanes=q,_e.return=N,_e}finally{}}}var sl=uo(!0),ro=uo(!1),yn=!1;function uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rc(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 jn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Nn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ee&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=mi(e),Zr(e,null,n),t}return fi(e,l,t,n),mi(e)}function va(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,er(e,n)}}function oc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?i=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 dc=!1;function ya(){if(dc){var e=Rl;if(e!==null)throw e}}function ja(e,t,n,l){dc=!1;var i=e.updateQueue;yn=!1;var s=i.firstBaseUpdate,r=i.lastBaseUpdate,m=i.shared.pending;if(m!==null){i.shared.pending=null;var b=m,E=b.next;b.next=null,r===null?s=E:r.next=E,r=b;var k=e.alternate;k!==null&&(k=k.updateQueue,m=k.lastBaseUpdate,m!==r&&(m===null?k.firstBaseUpdate=E:m.next=E,k.lastBaseUpdate=b))}if(s!==null){var B=i.baseState;r=0,k=E=b=null,m=s;do{var M=m.lane&-536870913,z=M!==m.lane;if(z?(ye&M)===M:(l&M)===M){M!==0&&M===Ol&&(dc=!0),k!==null&&(k=k.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var ee=e,re=m;M=t;var ze=n;switch(re.tag){case 1:if(ee=re.payload,typeof ee=="function"){B=ee.call(ze,B,M);break e}B=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=re.payload,M=typeof ee=="function"?ee.call(ze,B,M):ee,M==null)break e;B=C({},B,M);break e;case 2:yn=!0}}M=m.callback,M!==null&&(e.flags|=64,z&&(e.flags|=8192),z=i.callbacks,z===null?i.callbacks=[M]:z.push(M))}else z={lane:M,tag:m.tag,payload:m.payload,callback:m.callback,next:null},k===null?(E=k=z,b=B):k=k.next=z,r|=M;if(m=m.next,m===null){if(m=i.shared.pending,m===null)break;z=m,m=z.next,z.next=null,i.lastBaseUpdate=z,i.shared.pending=null}}while(!0);k===null&&(b=B),i.baseState=b,i.firstBaseUpdate=E,i.lastBaseUpdate=k,s===null&&(i.shared.lanes=0),An|=r,e.lanes=r,e.memoizedState=B}}function oo(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function fo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)oo(n[e],t)}var ql=p(null),Si=p(0);function mo(e,t){e=on,Y(Si,e),Y(ql,t),on=e|t.baseLanes}function fc(){Y(Si,on),Y(ql,ql.current)}function mc(){on=Si.current,O(ql),O(Si)}var jt=p(null),Ot=null;function Sn(e){var t=e.alternate;Y(Ge,Ge.current&1),Y(jt,e),Ot===null&&(t===null||ql.current!==null||t.memoizedState!==null)&&(Ot=e)}function hc(e){Y(Ge,Ge.current),Y(jt,e),Ot===null&&(Ot=e)}function ho(e){e.tag===22?(Y(Ge,Ge.current),Y(jt,e),Ot===null&&(Ot=e)):_n()}function _n(){Y(Ge,Ge.current),Y(jt,jt.current)}function Nt(e){O(jt),Ot===e&&(Ot=null),O(Ge)}var Ge=p(0);function _i(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||yu(n)||ju(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 tn=0,xe=null,we=null,Ze=null,Ti=!1,Hl=!1,cl=!1,Ei=0,Na=0,Bl=null,Vh=0;function Le(){throw Error(o(321))}function xc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vt(e[n],t[n]))return!1;return!0}function gc(e,t,n,l,i,s){return tn=s,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,S.H=e===null||e.memoizedState===null?Io:zc,cl=!1,s=n(l,i),cl=!1,Hl&&(s=go(t,n,l,i)),xo(e),s}function xo(e){S.H=Ta;var t=we!==null&&we.next!==null;if(tn=0,Ze=we=xe=null,Ti=!1,Na=0,Bl=null,t)throw Error(o(300));e===null||$e||(e=e.dependencies,e!==null&&gi(e)&&($e=!0))}function go(e,t,n,l){xe=e;var i=0;do{if(Hl&&(Bl=null),Na=0,Hl=!1,25<=i)throw Error(o(301));if(i+=1,Ze=we=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}S.H=Wo,s=t(n,l)}while(Hl);return s}function Zh(){var e=S.H,t=e.useState()[0];return t=typeof t.then=="function"?Sa(t):t,e=e.useState()[0],(we!==null?we.memoizedState:null)!==e&&(xe.flags|=1024),t}function pc(){var e=Ei!==0;return Ei=0,e}function bc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function vc(e){if(Ti){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ti=!1}tn=0,Ze=we=xe=null,Hl=!1,Na=Ei=0,Bl=null}function ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?xe.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Xe(){if(we===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=we.next;var t=Ze===null?xe.memoizedState:Ze.next;if(t!==null)Ze=t,we=e;else{if(e===null)throw xe.alternate===null?Error(o(467)):Error(o(310));we=e,e={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},Ze===null?xe.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function Ai(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sa(e){var t=Na;return Na+=1,Bl===null&&(Bl=[]),e=io(Bl,e,t),t=xe,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,S.H=t===null||t.memoizedState===null?Io:zc),e}function Mi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sa(e);if(e.$$typeof===$)return lt(e)}throw Error(o(438,String(e)))}function yc(e){var t=null,n=xe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=xe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ai(),xe.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]=oe;return t.index++,n}function nn(e,t){return typeof t=="function"?t(e):t}function wi(e){var t=Xe();return jc(t,we,e)}function jc(e,t,n){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=n;var i=e.baseQueue,s=l.pending;if(s!==null){if(i!==null){var r=i.next;i.next=s.next,s.next=r}t.baseQueue=i=s,l.pending=null}if(s=e.baseState,i===null)e.memoizedState=s;else{t=i.next;var m=r=null,b=null,E=t,k=!1;do{var B=E.lane&-536870913;if(B!==E.lane?(ye&B)===B:(tn&B)===B){var M=E.revertLane;if(M===0)b!==null&&(b=b.next={lane:0,revertLane:0,gesture:null,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null}),B===Ol&&(k=!0);else if((tn&M)===M){E=E.next,M===Ol&&(k=!0);continue}else B={lane:0,revertLane:E.revertLane,gesture:null,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null},b===null?(m=b=B,r=s):b=b.next=B,xe.lanes|=M,An|=M;B=E.action,cl&&n(s,B),s=E.hasEagerState?E.eagerState:n(s,B)}else M={lane:B,revertLane:E.revertLane,gesture:E.gesture,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null},b===null?(m=b=M,r=s):b=b.next=M,xe.lanes|=B,An|=B;E=E.next}while(E!==null&&E!==t);if(b===null?r=s:b.next=m,!vt(s,e.memoizedState)&&($e=!0,k&&(n=Rl,n!==null)))throw n;e.memoizedState=s,e.baseState=r,e.baseQueue=b,l.lastRenderedState=s}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Nc(e){var t=Xe(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var r=i=i.next;do s=e(s,r.action),r=r.next;while(r!==i);vt(s,t.memoizedState)||($e=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,l]}function po(e,t,n){var l=xe,i=Xe(),s=Ne;if(s){if(n===void 0)throw Error(o(407));n=n()}else n=t();var r=!vt((we||i).memoizedState,n);if(r&&(i.memoizedState=n,$e=!0),i=i.queue,Tc(yo.bind(null,l,i,e),[e]),i.getSnapshot!==t||r||Ze!==null&&Ze.memoizedState.tag&1){if(l.flags|=2048,Ll(9,{destroy:void 0},vo.bind(null,l,i,n,t),null),De===null)throw Error(o(349));s||(tn&127)!==0||bo(l,t,n)}return n}function bo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xe.updateQueue,t===null?(t=Ai(),xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vo(e,t,n,l){t.value=n,t.getSnapshot=l,jo(t)&&No(e)}function yo(e,t,n){return n(function(){jo(t)&&No(e)})}function jo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vt(e,n)}catch{return!0}}function No(e){var t=Wn(e,2);t!==null&&gt(t,e,2)}function Sc(e){var t=ct();if(typeof e=="function"){var n=e;if(e=n(),cl){mn(!0);try{n()}finally{mn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nn,lastRenderedState:e},t}function So(e,t,n,l){return e.baseState=n,jc(e,we,typeof l=="function"?l:nn)}function $h(e,t,n,l,i){if(Di(e))throw Error(o(485));if(e=t.action,e!==null){var s={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(r){s.listeners.push(r)}};S.T!==null?n(!0):s.isTransition=!1,l(s),n=t.pending,n===null?(s.next=t.pending=s,_o(t,s)):(s.next=n.next,t.pending=n.next=s)}}function _o(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var s=S.T,r={};S.T=r;try{var m=n(i,l),b=S.S;b!==null&&b(r,m),To(e,t,m)}catch(E){_c(e,t,E)}finally{s!==null&&r.types!==null&&(s.types=r.types),S.T=s}}else try{s=n(i,l),To(e,t,s)}catch(E){_c(e,t,E)}}function To(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Eo(e,t,l)},function(l){return _c(e,t,l)}):Eo(e,t,n)}function Eo(e,t,n){t.status="fulfilled",t.value=n,Ao(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,_o(e,n)))}function _c(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Ao(t),t=t.next;while(t!==l)}e.action=null}function Ao(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Mo(e,t){return t}function wo(e,t){if(Ne){var n=De.formState;if(n!==null){e:{var l=xe;if(Ne){if(Oe){t:{for(var i=Oe,s=Dt;i.nodeType!==8;){if(!s){i=null;break t}if(i=Rt(i.nextSibling),i===null){i=null;break t}}s=i.data,i=s==="F!"||s==="F"?i:null}if(i){Oe=Rt(i.nextSibling),l=i.data==="F!";break e}}bn(l)}l=!1}l&&(t=n[0])}}return n=ct(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:t},n.queue=l,n=Ko.bind(null,xe,l),l.dispatch=n,l=Sc(!1),s=Cc.bind(null,xe,!1,l.queue),l=ct(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=$h.bind(null,xe,i,s,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function Co(e){var t=Xe();return zo(t,we,e)}function zo(e,t,n){if(t=jc(e,t,Mo)[0],e=wi(nn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Sa(t)}catch(r){throw r===kl?vi:r}else l=t;t=Xe();var i=t.queue,s=i.dispatch;return n!==t.memoizedState&&(xe.flags|=2048,Ll(9,{destroy:void 0},Kh.bind(null,i,n),null)),[l,s,e]}function Kh(e,t){e.action=t}function Do(e){var t=Xe(),n=we;if(n!==null)return zo(t,n,e);Xe(),t=t.memoizedState,n=Xe();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Ll(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=xe.updateQueue,t===null&&(t=Ai(),xe.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 Oo(){return Xe().memoizedState}function Ci(e,t,n,l){var i=ct();xe.flags|=e,i.memoizedState=Ll(1|t,{destroy:void 0},n,l===void 0?null:l)}function zi(e,t,n,l){var i=Xe();l=l===void 0?null:l;var s=i.memoizedState.inst;we!==null&&l!==null&&xc(l,we.memoizedState.deps)?i.memoizedState=Ll(t,s,n,l):(xe.flags|=e,i.memoizedState=Ll(1|t,s,n,l))}function Ro(e,t){Ci(8390656,8,e,t)}function Tc(e,t){zi(2048,8,e,t)}function Jh(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=Ai(),xe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ko(e){var t=Xe().memoizedState;return Jh({ref:t,nextImpl:e}),function(){if((Ee&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Uo(e,t){return zi(4,2,e,t)}function qo(e,t){return zi(4,4,e,t)}function Ho(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 Bo(e,t,n){n=n!=null?n.concat([e]):null,zi(4,4,Ho.bind(null,t,e),n)}function Ec(){}function Lo(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&xc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Yo(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&xc(t,l[1]))return l[0];if(l=e(),cl){mn(!0);try{e()}finally{mn(!1)}}return n.memoizedState=[l,t],l}function Ac(e,t,n){return n===void 0||(tn&1073741824)!==0&&(ye&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Gd(),xe.lanes|=e,An|=e,n)}function Go(e,t,n,l){return vt(n,t)?n:ql.current!==null?(e=Ac(e,n,l),vt(e,t)||($e=!0),e):(tn&42)===0||(tn&1073741824)!==0&&(ye&261930)===0?($e=!0,e.memoizedState=n):(e=Gd(),xe.lanes|=e,An|=e,t)}function Xo(e,t,n,l,i){var s=H.p;H.p=s!==0&&8>s?s:8;var r=S.T,m={};S.T=m,Cc(e,!1,t,n);try{var b=i(),E=S.S;if(E!==null&&E(m,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var k=Qh(b,l);_a(e,t,k,Tt(e))}else _a(e,t,l,Tt(e))}catch(B){_a(e,t,{then:function(){},status:"rejected",reason:B},Tt())}finally{H.p=s,r!==null&&m.types!==null&&(r.types=m.types),S.T=r}}function Fh(){}function Mc(e,t,n,l){if(e.tag!==5)throw Error(o(476));var i=Qo(e).queue;Xo(e,i,t,K,n===null?Fh:function(){return Vo(e),n(l)})}function Qo(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nn,lastRenderedState:K},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Vo(e){var t=Qo(e);t.next===null&&(t=e.alternate.memoizedState),_a(e,t.next.queue,{},Tt())}function wc(){return lt(Ya)}function Zo(){return Xe().memoizedState}function $o(){return Xe().memoizedState}function Ih(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tt();e=jn(n);var l=Nn(t,e,n);l!==null&&(gt(l,t,n),va(l,t,n)),t={cache:ac()},e.payload=t;return}t=t.return}}function Wh(e,t,n){var l=Tt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Di(e)?Jo(t,n):(n=$s(e,t,n,l),n!==null&&(gt(n,e,l),Fo(n,t,l)))}function Ko(e,t,n){var l=Tt();_a(e,t,n,l)}function _a(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Di(e))Jo(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var r=t.lastRenderedState,m=s(r,n);if(i.hasEagerState=!0,i.eagerState=m,vt(m,r))return fi(e,t,i,0),De===null&&di(),!1}catch{}finally{}if(n=$s(e,t,i,l),n!==null)return gt(n,e,l),Fo(n,t,l),!0}return!1}function Cc(e,t,n,l){if(l={lane:2,revertLane:uu(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Di(e)){if(t)throw Error(o(479))}else t=$s(e,n,l,2),t!==null&&gt(t,e,2)}function Di(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function Jo(e,t){Hl=Ti=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fo(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,er(e,n)}}var Ta={readContext:lt,use:Mi,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useLayoutEffect:Le,useInsertionEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useSyncExternalStore:Le,useId:Le,useHostTransitionStatus:Le,useFormState:Le,useActionState:Le,useOptimistic:Le,useMemoCache:Le,useCacheRefresh:Le};Ta.useEffectEvent=Le;var Io={readContext:lt,use:Mi,useCallback:function(e,t){return ct().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:Ro,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ci(4194308,4,Ho.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ci(4194308,4,e,t)},useInsertionEffect:function(e,t){Ci(4,2,e,t)},useMemo:function(e,t){var n=ct();t=t===void 0?null:t;var l=e();if(cl){mn(!0);try{e()}finally{mn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=ct();if(n!==void 0){var i=n(t);if(cl){mn(!0);try{n(t)}finally{mn(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=Wh.bind(null,xe,e),[l.memoizedState,e]},useRef:function(e){var t=ct();return e={current:e},t.memoizedState=e},useState:function(e){e=Sc(e);var t=e.queue,n=Ko.bind(null,xe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ec,useDeferredValue:function(e,t){var n=ct();return Ac(n,e,t)},useTransition:function(){var e=Sc(!1);return e=Xo.bind(null,xe,e.queue,!0,!1),ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=xe,i=ct();if(Ne){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),De===null)throw Error(o(349));(ye&127)!==0||bo(l,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Ro(yo.bind(null,l,s,e),[e]),l.flags|=2048,Ll(9,{destroy:void 0},vo.bind(null,l,s,n,t),null),n},useId:function(){var e=ct(),t=De.identifierPrefix;if(Ne){var n=Gt,l=Yt;n=(l&~(1<<32-bt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Ei++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Vh++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:wc,useFormState:wo,useActionState:wo,useOptimistic:function(e){var t=ct();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Cc.bind(null,xe,!0,n),n.dispatch=t,[e,t]},useMemoCache:yc,useCacheRefresh:function(){return ct().memoizedState=Ih.bind(null,xe)},useEffectEvent:function(e){var t=ct(),n={impl:e};return t.memoizedState=n,function(){if((Ee&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},zc={readContext:lt,use:Mi,useCallback:Lo,useContext:lt,useEffect:Tc,useImperativeHandle:Bo,useInsertionEffect:Uo,useLayoutEffect:qo,useMemo:Yo,useReducer:wi,useRef:Oo,useState:function(){return wi(nn)},useDebugValue:Ec,useDeferredValue:function(e,t){var n=Xe();return Go(n,we.memoizedState,e,t)},useTransition:function(){var e=wi(nn)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Sa(e),t]},useSyncExternalStore:po,useId:Zo,useHostTransitionStatus:wc,useFormState:Co,useActionState:Co,useOptimistic:function(e,t){var n=Xe();return So(n,we,e,t)},useMemoCache:yc,useCacheRefresh:$o};zc.useEffectEvent=ko;var Wo={readContext:lt,use:Mi,useCallback:Lo,useContext:lt,useEffect:Tc,useImperativeHandle:Bo,useInsertionEffect:Uo,useLayoutEffect:qo,useMemo:Yo,useReducer:Nc,useRef:Oo,useState:function(){return Nc(nn)},useDebugValue:Ec,useDeferredValue:function(e,t){var n=Xe();return we===null?Ac(n,e,t):Go(n,we.memoizedState,e,t)},useTransition:function(){var e=Nc(nn)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Sa(e),t]},useSyncExternalStore:po,useId:Zo,useHostTransitionStatus:wc,useFormState:Do,useActionState:Do,useOptimistic:function(e,t){var n=Xe();return we!==null?So(n,we,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:yc,useCacheRefresh:$o};Wo.useEffectEvent=ko;function Dc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:C({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Oc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=Tt(),i=jn(l);i.payload=t,n!=null&&(i.callback=n),t=Nn(e,i,l),t!==null&&(gt(t,e,l),va(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=Tt(),i=jn(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Nn(e,i,l),t!==null&&(gt(t,e,l),va(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tt(),l=jn(n);l.tag=2,t!=null&&(l.callback=t),t=Nn(e,l,n),t!==null&&(gt(t,e,n),va(t,e,n))}};function Po(e,t,n,l,i,s,r){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,s,r):t.prototype&&t.prototype.isPureReactComponent?!da(n,l)||!da(i,s):!0}function ed(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&&Oc.enqueueReplaceState(t,t.state,null)}function ul(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=C({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function td(e){oi(e)}function nd(e){console.error(e)}function ld(e){oi(e)}function Oi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function ad(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Rc(e,t,n){return n=jn(n),n.tag=3,n.payload={element:null},n.callback=function(){Oi(e,t)},n}function id(e){return e=jn(e),e.tag=3,e}function sd(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var s=l.value;e.payload=function(){return i(s)},e.callback=function(){ad(t,n,l)}}var r=n.stateNode;r!==null&&typeof r.componentDidCatch=="function"&&(e.callback=function(){ad(t,n,l),typeof i!="function"&&(Mn===null?Mn=new Set([this]):Mn.add(this));var m=l.stack;this.componentDidCatch(l.value,{componentStack:m!==null?m:""})})}function Ph(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Dl(t,n,i,!0),n=jt.current,n!==null){switch(n.tag){case 31:case 13:return Ot===null?Vi():n.alternate===null&&Ye===0&&(Ye=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===yi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),iu(e,l,i)),!1;case 22:return n.flags|=65536,l===yi?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)),iu(e,l,i)),!1}throw Error(o(435,n.tag))}return iu(e,l,i),Vi(),!1}if(Ne)return t=jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==Ps&&(e=Error(o(422),{cause:l}),ha(wt(e,n)))):(l!==Ps&&(t=Error(o(423),{cause:l}),ha(wt(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=wt(l,n),i=Rc(e.stateNode,l,i),oc(e,i),Ye!==4&&(Ye=2)),!1;var s=Error(o(520),{cause:l});if(s=wt(s,n),Oa===null?Oa=[s]:Oa.push(s),Ye!==4&&(Ye=2),t===null)return!0;l=wt(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Rc(n.stateNode,l,e),oc(n,e),!1;case 1:if(t=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Mn===null||!Mn.has(s))))return n.flags|=65536,i&=-i,n.lanes|=i,i=id(i),sd(i,e,n,l),oc(n,i),!1}n=n.return}while(n!==null);return!1}var kc=Error(o(461)),$e=!1;function at(e,t,n,l){t.child=e===null?ro(t,null,n,l):sl(t,e.child,n,l)}function cd(e,t,n,l,i){n=n.render;var s=t.ref;if("ref"in l){var r={};for(var m in l)m!=="ref"&&(r[m]=l[m])}else r=l;return nl(t),l=gc(e,t,n,r,s,i),m=pc(),e!==null&&!$e?(bc(e,t,i),ln(e,t,i)):(Ne&&m&&Is(t),t.flags|=1,at(e,t,l,i),t.child)}function ud(e,t,n,l,i){if(e===null){var s=n.type;return typeof s=="function"&&!Ks(s)&&s.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=s,rd(e,t,s,l,i)):(e=hi(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!Xc(e,i)){var r=s.memoizedProps;if(n=n.compare,n=n!==null?n:da,n(r,l)&&e.ref===t.ref)return ln(e,t,i)}return t.flags|=1,e=It(s,l),e.ref=t.ref,e.return=t,t.child=e}function rd(e,t,n,l,i){if(e!==null){var s=e.memoizedProps;if(da(s,l)&&e.ref===t.ref)if($e=!1,t.pendingProps=l=s,Xc(e,i))(e.flags&131072)!==0&&($e=!0);else return t.lanes=e.lanes,ln(e,t,i)}return Uc(e,t,n,l,i)}function od(e,t,n,l){var i=l.children,s=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(s=s!==null?s.baseLanes|n:n,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~s}else l=0,t.child=null;return dd(e,t,s,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bi(t,s!==null?s.cachePool:null),s!==null?mo(t,s):fc(),ho(t);else return l=t.lanes=536870912,dd(e,t,s!==null?s.baseLanes|n:n,n,l)}else s!==null?(bi(t,s.cachePool),mo(t,s),_n(),t.memoizedState=null):(e!==null&&bi(t,null),fc(),_n());return at(e,t,i,n),t.child}function Ea(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dd(e,t,n,l,i){var s=sc();return s=s===null?null:{parent:Ve._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},e!==null&&bi(t,null),fc(),ho(t),e!==null&&Dl(e,t,l,!0),t.childLanes=i,null}function Ri(e,t){return t=Ui({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fd(e,t,n){return sl(t,e.child,null,n),e=Ri(t,t.pendingProps),e.flags|=2,Nt(t),t.memoizedState=null,e}function ex(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ne){if(l.mode==="hidden")return e=Ri(t,l),t.lanes=536870912,Ea(null,e);if(hc(t),(e=Oe)?(e=Tf(e,Dt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gn!==null?{id:Yt,overflow:Gt}:null,retryLane:536870912,hydrationErrors:null},n=Kr(e),n.return=t,t.child=n,nt=t,Oe=null)):e=null,e===null)throw bn(t);return t.lanes=536870912,null}return Ri(t,l)}var s=e.memoizedState;if(s!==null){var r=s.dehydrated;if(hc(t),i)if(t.flags&256)t.flags&=-257,t=fd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if($e||Dl(e,t,n,!1),i=(n&e.childLanes)!==0,$e||i){if(l=De,l!==null&&(r=tr(l,n),r!==0&&r!==s.retryLane))throw s.retryLane=r,Wn(e,r),gt(l,e,r),kc;Vi(),t=fd(e,t,n)}else e=s.treeContext,Oe=Rt(r.nextSibling),nt=t,Ne=!0,pn=null,Dt=!1,e!==null&&Ir(t,e),t=Ri(t,l),t.flags|=4096;return t}return e=It(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ki(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 Uc(e,t,n,l,i){return nl(t),n=gc(e,t,n,l,void 0,i),l=pc(),e!==null&&!$e?(bc(e,t,i),ln(e,t,i)):(Ne&&l&&Is(t),t.flags|=1,at(e,t,n,i),t.child)}function md(e,t,n,l,i,s){return nl(t),t.updateQueue=null,n=go(t,l,n,i),xo(e),l=pc(),e!==null&&!$e?(bc(e,t,s),ln(e,t,s)):(Ne&&l&&Is(t),t.flags|=1,at(e,t,n,s),t.child)}function hd(e,t,n,l,i){if(nl(t),t.stateNode===null){var s=Ml,r=n.contextType;typeof r=="object"&&r!==null&&(s=lt(r)),s=new n(l,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Oc,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=l,s.state=t.memoizedState,s.refs={},uc(t),r=n.contextType,s.context=typeof r=="object"&&r!==null?lt(r):Ml,s.state=t.memoizedState,r=n.getDerivedStateFromProps,typeof r=="function"&&(Dc(t,n,r,l),s.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(r=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),r!==s.state&&Oc.enqueueReplaceState(s,s.state,null),ja(t,l,s,i),ya(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){s=t.stateNode;var m=t.memoizedProps,b=ul(n,m);s.props=b;var E=s.context,k=n.contextType;r=Ml,typeof k=="object"&&k!==null&&(r=lt(k));var B=n.getDerivedStateFromProps;k=typeof B=="function"||typeof s.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,k||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(m||E!==r)&&ed(t,s,l,r),yn=!1;var M=t.memoizedState;s.state=M,ja(t,l,s,i),ya(),E=t.memoizedState,m||M!==E||yn?(typeof B=="function"&&(Dc(t,n,B,l),E=t.memoizedState),(b=yn||Po(t,n,b,l,M,E,r))?(k||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=E),s.props=l,s.state=E,s.context=r,l=b):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{s=t.stateNode,rc(e,t),r=t.memoizedProps,k=ul(n,r),s.props=k,B=t.pendingProps,M=s.context,E=n.contextType,b=Ml,typeof E=="object"&&E!==null&&(b=lt(E)),m=n.getDerivedStateFromProps,(E=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(r!==B||M!==b)&&ed(t,s,l,b),yn=!1,M=t.memoizedState,s.state=M,ja(t,l,s,i),ya();var z=t.memoizedState;r!==B||M!==z||yn||e!==null&&e.dependencies!==null&&gi(e.dependencies)?(typeof m=="function"&&(Dc(t,n,m,l),z=t.memoizedState),(k=yn||Po(t,n,k,l,M,z,b)||e!==null&&e.dependencies!==null&&gi(e.dependencies))?(E||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(l,z,b),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(l,z,b)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||r===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=z),s.props=l,s.state=z,s.context=b,l=k):(typeof s.componentDidUpdate!="function"||r===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),l=!1)}return s=l,ki(e,t),l=(t.flags&128)!==0,s||l?(s=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&l?(t.child=sl(t,e.child,null,i),t.child=sl(t,null,n,i)):at(e,t,n,i),t.memoizedState=s.state,e=t.child):e=ln(e,t,i),e}function xd(e,t,n,l){return el(),t.flags|=256,at(e,t,n,l),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hc(e){return{baseLanes:e,cachePool:lo()}}function Bc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=_t),e}function gd(e,t,n){var l=t.pendingProps,i=!1,s=(t.flags&128)!==0,r;if((r=s)||(r=e!==null&&e.memoizedState===null?!1:(Ge.current&2)!==0),r&&(i=!0,t.flags&=-129),r=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ne){if(i?Sn(t):_n(),(e=Oe)?(e=Tf(e,Dt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gn!==null?{id:Yt,overflow:Gt}:null,retryLane:536870912,hydrationErrors:null},n=Kr(e),n.return=t,t.child=n,nt=t,Oe=null)):e=null,e===null)throw bn(t);return ju(e)?t.lanes=32:t.lanes=536870912,null}var m=l.children;return l=l.fallback,i?(_n(),i=t.mode,m=Ui({mode:"hidden",children:m},i),l=Pn(l,i,n,null),m.return=t,l.return=t,m.sibling=l,t.child=m,l=t.child,l.memoizedState=Hc(n),l.childLanes=Bc(e,r,n),t.memoizedState=qc,Ea(null,l)):(Sn(t),Lc(t,m))}var b=e.memoizedState;if(b!==null&&(m=b.dehydrated,m!==null)){if(s)t.flags&256?(Sn(t),t.flags&=-257,t=Yc(e,t,n)):t.memoizedState!==null?(_n(),t.child=e.child,t.flags|=128,t=null):(_n(),m=l.fallback,i=t.mode,l=Ui({mode:"visible",children:l.children},i),m=Pn(m,i,n,null),m.flags|=2,l.return=t,m.return=t,l.sibling=m,t.child=l,sl(t,e.child,null,n),l=t.child,l.memoizedState=Hc(n),l.childLanes=Bc(e,r,n),t.memoizedState=qc,t=Ea(null,l));else if(Sn(t),ju(m)){if(r=m.nextSibling&&m.nextSibling.dataset,r)var E=r.dgst;r=E,l=Error(o(419)),l.stack="",l.digest=r,ha({value:l,source:null,stack:null}),t=Yc(e,t,n)}else if($e||Dl(e,t,n,!1),r=(n&e.childLanes)!==0,$e||r){if(r=De,r!==null&&(l=tr(r,n),l!==0&&l!==b.retryLane))throw b.retryLane=l,Wn(e,l),gt(r,e,l),kc;yu(m)||Vi(),t=Yc(e,t,n)}else yu(m)?(t.flags|=192,t.child=e.child,t=null):(e=b.treeContext,Oe=Rt(m.nextSibling),nt=t,Ne=!0,pn=null,Dt=!1,e!==null&&Ir(t,e),t=Lc(t,l.children),t.flags|=4096);return t}return i?(_n(),m=l.fallback,i=t.mode,b=e.child,E=b.sibling,l=It(b,{mode:"hidden",children:l.children}),l.subtreeFlags=b.subtreeFlags&65011712,E!==null?m=It(E,m):(m=Pn(m,i,n,null),m.flags|=2),m.return=t,l.return=t,l.sibling=m,t.child=l,Ea(null,l),l=t.child,m=e.child.memoizedState,m===null?m=Hc(n):(i=m.cachePool,i!==null?(b=Ve._currentValue,i=i.parent!==b?{parent:b,pool:b}:i):i=lo(),m={baseLanes:m.baseLanes|n,cachePool:i}),l.memoizedState=m,l.childLanes=Bc(e,r,n),t.memoizedState=qc,Ea(e.child,l)):(Sn(t),n=e.child,e=n.sibling,n=It(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function Lc(e,t){return t=Ui({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ui(e,t){return e=yt(22,e,null,t),e.lanes=0,e}function Yc(e,t,n){return sl(t,e.child,null,n),e=Lc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pd(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),nc(e.return,t,n)}function Gc(e,t,n,l,i,s){var r=e.memoizedState;r===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:s}:(r.isBackwards=t,r.rendering=null,r.renderingStartTime=0,r.last=l,r.tail=n,r.tailMode=i,r.treeForkCount=s)}function bd(e,t,n){var l=t.pendingProps,i=l.revealOrder,s=l.tail;l=l.children;var r=Ge.current,m=(r&2)!==0;if(m?(r=r&1|2,t.flags|=128):r&=1,Y(Ge,r),at(e,t,l,n),l=Ne?ma:0,!m&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&pd(e,n,t);else if(e.tag===19)pd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&_i(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Gc(t,!1,i,n,s,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&_i(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Gc(t,!0,n,null,s,l);break;case"together":Gc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),An|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Dl(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=It(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=It(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Xc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&gi(e)))}function tx(e,t,n){switch(t.tag){case 3:Be(t,t.stateNode.containerInfo),vn(t,Ve,e.memoizedState.cache),el();break;case 27:case 5:Lt(t);break;case 4:Be(t,t.stateNode.containerInfo);break;case 10:vn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,hc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Sn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?gd(e,t,n):(Sn(t),e=ln(e,t,n),e!==null?e.sibling:null);Sn(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Dl(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return bd(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Y(Ge,Ge.current),l)break;return null;case 22:return t.lanes=0,od(e,t,n,t.pendingProps);case 24:vn(t,Ve,e.memoizedState.cache)}return ln(e,t,n)}function vd(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)$e=!0;else{if(!Xc(e,n)&&(t.flags&128)===0)return $e=!1,tx(e,t,n);$e=(e.flags&131072)!==0}else $e=!1,Ne&&(t.flags&1048576)!==0&&Fr(t,ma,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=al(t.elementType),t.type=e,typeof e=="function")Ks(e)?(l=ul(e,l),t.tag=1,t=hd(null,t,e,l,n)):(t.tag=0,t=Uc(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===Q){t.tag=11,t=cd(null,t,e,l,n);break e}else if(i===G){t.tag=14,t=ud(null,t,e,l,n);break e}}throw t=he(e)||e,Error(o(306,t,""))}}return t;case 0:return Uc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=ul(l,t.pendingProps),hd(e,t,l,i,n);case 3:e:{if(Be(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var s=t.memoizedState;i=s.element,rc(e,t),ja(t,l,null,n);var r=t.memoizedState;if(l=r.cache,vn(t,Ve,l),l!==s.cache&&lc(t,[Ve],n,!0),ya(),l=r.element,s.isDehydrated)if(s={element:l,isDehydrated:!1,cache:r.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=xd(e,t,l,n);break e}else if(l!==i){i=wt(Error(o(424)),t),ha(i),t=xd(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(Oe=Rt(e.firstChild),nt=t,Ne=!0,pn=null,Dt=!0,n=ro(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(el(),l===i){t=ln(e,t,n);break e}at(e,t,l,n)}t=t.child}return t;case 26:return ki(e,t),e===null?(n=zf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ne||(n=t.type,e=t.pendingProps,l=Wi(ce.current).createElement(n),l[tt]=t,l[ot]=e,it(l,n,e),Ie(l),t.stateNode=l):t.memoizedState=zf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Lt(t),e===null&&Ne&&(l=t.stateNode=Mf(t.type,t.pendingProps,ce.current),nt=t,Dt=!0,i=Oe,Dn(t.type)?(Nu=i,Oe=Rt(l.firstChild)):Oe=i),at(e,t,t.pendingProps.children,n),ki(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ne&&((i=l=Oe)&&(l=zx(l,t.type,t.pendingProps,Dt),l!==null?(t.stateNode=l,nt=t,Oe=Rt(l.firstChild),Dt=!1,i=!0):i=!1),i||bn(t)),Lt(t),i=t.type,s=t.pendingProps,r=e!==null?e.memoizedProps:null,l=s.children,pu(i,s)?l=null:r!==null&&pu(i,r)&&(t.flags|=32),t.memoizedState!==null&&(i=gc(e,t,Zh,null,null,n),Ya._currentValue=i),ki(e,t),at(e,t,l,n),t.child;case 6:return e===null&&Ne&&((e=n=Oe)&&(n=Dx(n,t.pendingProps,Dt),n!==null?(t.stateNode=n,nt=t,Oe=null,e=!0):e=!1),e||bn(t)),null;case 13:return gd(e,t,n);case 4:return Be(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=sl(t,null,l,n):at(e,t,l,n),t.child;case 11:return cd(e,t,t.type,t.pendingProps,n);case 7:return at(e,t,t.pendingProps,n),t.child;case 8:return at(e,t,t.pendingProps.children,n),t.child;case 12:return at(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,vn(t,t.type,l.value),at(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,nl(t),i=lt(i),l=l(i),t.flags|=1,at(e,t,l,n),t.child;case 14:return ud(e,t,t.type,t.pendingProps,n);case 15:return rd(e,t,t.type,t.pendingProps,n);case 19:return bd(e,t,n);case 31:return ex(e,t,n);case 22:return od(e,t,n,t.pendingProps);case 24:return nl(t),l=lt(Ve),e===null?(i=sc(),i===null&&(i=De,s=ac(),i.pooledCache=s,s.refCount++,s!==null&&(i.pooledCacheLanes|=n),i=s),t.memoizedState={parent:l,cache:i},uc(t),vn(t,Ve,i)):((e.lanes&n)!==0&&(rc(e,t),ja(t,null,null,n),ya()),i=e.memoizedState,s=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),vn(t,Ve,l)):(l=s.cache,vn(t,Ve,l),l!==i.cache&&lc(t,[Ve],n,!0))),at(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function an(e){e.flags|=4}function Qc(e,t,n,l,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Zd())e.flags|=8192;else throw il=yi,cc}else e.flags&=-16777217}function yd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Uf(t))if(Zd())e.flags|=8192;else throw il=yi,cc}function qi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Wu():536870912,e.lanes|=t,Ql|=t)}function Aa(e,t){if(!Ne)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 Re(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags&65011712,l|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function nx(e,t,n){var l=t.pendingProps;switch(Ws(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Re(t),null;case 1:return Re(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),en(Ve),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zl(t)?an(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ec())),Re(t),null;case 26:var i=t.type,s=t.memoizedState;return e===null?(an(t),s!==null?(Re(t),yd(t,s)):(Re(t),Qc(t,i,null,l,n))):s?s!==e.memoizedState?(an(t),Re(t),yd(t,s)):(Re(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&an(t),Re(t),Qc(t,i,e,l,n)),null;case 27:if(Zt(t),n=ce.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&an(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Re(t),null}e=L.current,zl(t)?Wr(t):(e=Mf(i,l,n),t.stateNode=e,an(t))}return Re(t),null;case 5:if(Zt(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&an(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Re(t),null}if(s=L.current,zl(t))Wr(t);else{var r=Wi(ce.current);switch(s){case 1:s=r.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:s=r.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":s=r.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":s=r.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":s=r.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(i,{is:l.is}):r.createElement(i)}}s[tt]=t,s[ot]=l;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=s;e:switch(it(s,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&an(t)}}return Re(t),Qc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&an(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=ce.current,zl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=nt,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||pf(e.nodeValue,n)),e||bn(t,!0)}else e=Wi(e).createTextNode(l),e[tt]=t,t.stateNode=e}return Re(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=zl(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[tt]=t}else el(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Re(t),e=!1}else n=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Nt(t),t):(Nt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Re(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=zl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(o(317));i[tt]=t}else el(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Re(t),i=!1}else i=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Nt(t),t):(Nt(t),null)}return Nt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),qi(t,t.updateQueue),Re(t),null);case 4:return fe(),e===null&&fu(t.stateNode.containerInfo),Re(t),null;case 10:return en(t.type),Re(t),null;case 19:if(O(Ge),l=t.memoizedState,l===null)return Re(t),null;if(i=(t.flags&128)!==0,s=l.rendering,s===null)if(i)Aa(l,!1);else{if(Ye!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=_i(e),s!==null){for(t.flags|=128,Aa(l,!1),e=s.updateQueue,t.updateQueue=e,qi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)$r(n,e),n=n.sibling;return Y(Ge,Ge.current&1|2),Ne&&Wt(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ue()>Gi&&(t.flags|=128,i=!0,Aa(l,!1),t.lanes=4194304)}else{if(!i)if(e=_i(s),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,qi(t,e),Aa(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!Ne)return Re(t),null}else 2*Ue()-l.renderingStartTime>Gi&&n!==536870912&&(t.flags|=128,i=!0,Aa(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(e=l.last,e!==null?e.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ue(),e.sibling=null,n=Ge.current,Y(Ge,i?n&1|2:n&1),Ne&&Wt(t,l.treeForkCount),e):(Re(t),null);case 22:case 23:return Nt(t),mc(),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&&(Re(t),t.subtreeFlags&6&&(t.flags|=8192)):Re(t),n=t.updateQueue,n!==null&&qi(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&&O(ll),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),en(Ve),Re(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function lx(e,t){switch(Ws(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return en(Ve),fe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Zt(t),null;case 31:if(t.memoizedState!==null){if(Nt(t),t.alternate===null)throw Error(o(340));el()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Nt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));el()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(Ge),null;case 4:return fe(),null;case 10:return en(t.type),null;case 22:case 23:return Nt(t),mc(),e!==null&&O(ll),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return en(Ve),null;case 25:return null;default:return null}}function jd(e,t){switch(Ws(t),t.tag){case 3:en(Ve),fe();break;case 26:case 27:case 5:Zt(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&Nt(t);break;case 13:Nt(t);break;case 19:O(Ge);break;case 10:en(t.type);break;case 22:case 23:Nt(t),mc(),e!==null&&O(ll);break;case 24:en(Ve)}}function Ma(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==i)}}catch(m){Me(t,t.return,m)}}function Tn(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var s=i.next;l=s;do{if((l.tag&e)===e){var r=l.inst,m=r.destroy;if(m!==void 0){r.destroy=void 0,i=t;var b=n,E=m;try{E()}catch(k){Me(i,b,k)}}}l=l.next}while(l!==s)}}catch(k){Me(t,t.return,k)}}function Nd(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{fo(t,n)}catch(l){Me(e,e.return,l)}}}function Sd(e,t,n){n.props=ul(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Me(e,t,l)}}function wa(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(i){Me(e,t,i)}}function Xt(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){Me(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Me(e,t,i)}else n.current=null}function _d(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(i){Me(e,e.return,i)}}function Vc(e,t,n){try{var l=e.stateNode;Tx(l,e.type,n,t),l[ot]=t}catch(i){Me(e,e.return,i)}}function Td(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Dn(e.type)||e.tag===4}function Zc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Td(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&&Dn(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 $c(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=Jt));else if(l!==4&&(l===27&&Dn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function Hi(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&&Dn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Hi(e,t,n),e=e.sibling;e!==null;)Hi(e,t,n),e=e.sibling}function Ed(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);it(t,l,n),t[tt]=e,t[ot]=n}catch(s){Me(e,e.return,s)}}var sn=!1,Ke=!1,Kc=!1,Ad=typeof WeakSet=="function"?WeakSet:Set,We=null;function ax(e,t){if(e=e.containerInfo,xu=is,e=Hr(e),Ys(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var i=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var r=0,m=-1,b=-1,E=0,k=0,B=e,M=null;t:for(;;){for(var z;B!==n||i!==0&&B.nodeType!==3||(m=r+i),B!==s||l!==0&&B.nodeType!==3||(b=r+l),B.nodeType===3&&(r+=B.nodeValue.length),(z=B.firstChild)!==null;)M=B,B=z;for(;;){if(B===e)break t;if(M===n&&++E===i&&(m=r),M===s&&++k===l&&(b=r),(z=B.nextSibling)!==null)break;B=M,M=B.parentNode}B=z}n=m===-1||b===-1?null:{start:m,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(gu={focusedElem:e,selectionRange:n},is=!1,We=t;We!==null;)if(t=We,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,We=e;else for(;We!==null;){switch(t=We,s=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&s!==null){e=void 0,n=t,i=s.memoizedProps,s=s.memoizedState,l=n.stateNode;try{var ee=ul(n.type,i);e=l.getSnapshotBeforeUpdate(ee,s),l.__reactInternalSnapshotBeforeUpdate=e}catch(re){Me(n,n.return,re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)vu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":vu(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,We=e;break}We=t.return}}function Md(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:un(e,n),l&4&&Ma(5,n);break;case 1:if(un(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(r){Me(n,n.return,r)}else{var i=ul(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(r){Me(n,n.return,r)}}l&64&&Nd(n),l&512&&wa(n,n.return);break;case 3:if(un(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{fo(e,t)}catch(r){Me(n,n.return,r)}}break;case 27:t===null&&l&4&&Ed(n);case 26:case 5:un(e,n),t===null&&l&4&&_d(n),l&512&&wa(n,n.return);break;case 12:un(e,n);break;case 31:un(e,n),l&4&&zd(e,n);break;case 13:un(e,n),l&4&&Dd(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=mx.bind(null,n),Ox(e,n))));break;case 22:if(l=n.memoizedState!==null||sn,!l){t=t!==null&&t.memoizedState!==null||Ke,i=sn;var s=Ke;sn=l,(Ke=t)&&!s?rn(e,n,(n.subtreeFlags&8772)!==0):un(e,n),sn=i,Ke=s}break;case 30:break;default:un(e,n)}}function wd(e){var t=e.alternate;t!==null&&(e.alternate=null,wd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_s(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var qe=null,ft=!1;function cn(e,t,n){for(n=n.child;n!==null;)Cd(e,t,n),n=n.sibling}function Cd(e,t,n){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(Pl,n)}catch{}switch(n.tag){case 26:Ke||Xt(n,t),cn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ke||Xt(n,t);var l=qe,i=ft;Dn(n.type)&&(qe=n.stateNode,ft=!1),cn(e,t,n),Ha(n.stateNode),qe=l,ft=i;break;case 5:Ke||Xt(n,t);case 6:if(l=qe,i=ft,qe=null,cn(e,t,n),qe=l,ft=i,qe!==null)if(ft)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(n.stateNode)}catch(s){Me(n,t,s)}else try{qe.removeChild(n.stateNode)}catch(s){Me(n,t,s)}break;case 18:qe!==null&&(ft?(e=qe,Sf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Wl(e)):Sf(qe,n.stateNode));break;case 4:l=qe,i=ft,qe=n.stateNode.containerInfo,ft=!0,cn(e,t,n),qe=l,ft=i;break;case 0:case 11:case 14:case 15:Tn(2,n,t),Ke||Tn(4,n,t),cn(e,t,n);break;case 1:Ke||(Xt(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Sd(n,t,l)),cn(e,t,n);break;case 21:cn(e,t,n);break;case 22:Ke=(l=Ke)||n.memoizedState!==null,cn(e,t,n),Ke=l;break;default:cn(e,t,n)}}function zd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wl(e)}catch(n){Me(t,t.return,n)}}}function Dd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wl(e)}catch(n){Me(t,t.return,n)}}function ix(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ad),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ad),t;default:throw Error(o(435,e.tag))}}function Bi(e,t){var n=ix(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=hx.bind(null,e,l);l.then(i,i)}})}function mt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],s=e,r=t,m=r;e:for(;m!==null;){switch(m.tag){case 27:if(Dn(m.type)){qe=m.stateNode,ft=!1;break e}break;case 5:qe=m.stateNode,ft=!1;break e;case 3:case 4:qe=m.stateNode.containerInfo,ft=!0;break e}m=m.return}if(qe===null)throw Error(o(160));Cd(s,r,i),qe=null,ft=!1,s=i.alternate,s!==null&&(s.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Od(t,e),t=t.sibling}var Ht=null;function Od(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:mt(t,e),ht(e),l&4&&(Tn(3,e,e.return),Ma(3,e),Tn(5,e,e.return));break;case 1:mt(t,e),ht(e),l&512&&(Ke||n===null||Xt(n,n.return)),l&64&&sn&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var i=Ht;if(mt(t,e),ht(e),l&512&&(Ke||n===null||Xt(n,n.return)),l&4){var s=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(l){case"title":s=i.getElementsByTagName("title")[0],(!s||s[na]||s[tt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=i.createElement(l),i.head.insertBefore(s,i.querySelector("head > title"))),it(s,l,n),s[tt]=e,Ie(s),l=s;break e;case"link":var r=Rf("link","href",i).get(l+(n.href||""));if(r){for(var m=0;m<r.length;m++)if(s=r[m],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){r.splice(m,1);break t}}s=i.createElement(l),it(s,l,n),i.head.appendChild(s);break;case"meta":if(r=Rf("meta","content",i).get(l+(n.content||""))){for(m=0;m<r.length;m++)if(s=r[m],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){r.splice(m,1);break t}}s=i.createElement(l),it(s,l,n),i.head.appendChild(s);break;default:throw Error(o(468,l))}s[tt]=e,Ie(s),l=s}e.stateNode=l}else kf(i,e.type,e.stateNode);else e.stateNode=Of(i,l,e.memoizedProps);else s!==l?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,l===null?kf(i,e.type,e.stateNode):Of(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Vc(e,e.memoizedProps,n.memoizedProps)}break;case 27:mt(t,e),ht(e),l&512&&(Ke||n===null||Xt(n,n.return)),n!==null&&l&4&&Vc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(mt(t,e),ht(e),l&512&&(Ke||n===null||Xt(n,n.return)),e.flags&32){i=e.stateNode;try{jl(i,"")}catch(ee){Me(e,e.return,ee)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,Vc(e,i,n!==null?n.memoizedProps:i)),l&1024&&(Kc=!0);break;case 6:if(mt(t,e),ht(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ee){Me(e,e.return,ee)}}break;case 3:if(ts=null,i=Ht,Ht=Pi(t.containerInfo),mt(t,e),Ht=i,ht(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Wl(t.containerInfo)}catch(ee){Me(e,e.return,ee)}Kc&&(Kc=!1,Rd(e));break;case 4:l=Ht,Ht=Pi(e.stateNode.containerInfo),mt(t,e),ht(e),Ht=l;break;case 12:mt(t,e),ht(e);break;case 31:mt(t,e),ht(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Bi(e,l)));break;case 13:mt(t,e),ht(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Yi=Ue()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Bi(e,l)));break;case 22:i=e.memoizedState!==null;var b=n!==null&&n.memoizedState!==null,E=sn,k=Ke;if(sn=E||i,Ke=k||b,mt(t,e),Ke=k,sn=E,ht(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||b||sn||Ke||rl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){b=n=t;try{if(s=b.stateNode,i)r=s.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none";else{m=b.stateNode;var B=b.memoizedProps.style,M=B!=null&&B.hasOwnProperty("display")?B.display:null;m.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(ee){Me(b,b.return,ee)}}}else if(t.tag===6){if(n===null){b=t;try{b.stateNode.nodeValue=i?"":b.memoizedProps}catch(ee){Me(b,b.return,ee)}}}else if(t.tag===18){if(n===null){b=t;try{var z=b.stateNode;i?_f(z,!0):_f(b.stateNode,!1)}catch(ee){Me(b,b.return,ee)}}}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,Bi(e,n))));break;case 19:mt(t,e),ht(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Bi(e,l)));break;case 30:break;case 21:break;default:mt(t,e),ht(e)}}function ht(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Td(l)){n=l;break}l=l.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var i=n.stateNode,s=Zc(e);Hi(e,s,i);break;case 5:var r=n.stateNode;n.flags&32&&(jl(r,""),n.flags&=-33);var m=Zc(e);Hi(e,m,r);break;case 3:case 4:var b=n.stateNode.containerInfo,E=Zc(e);$c(e,E,b);break;default:throw Error(o(161))}}catch(k){Me(e,e.return,k)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Rd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function un(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Md(e,t.alternate,t),t=t.sibling}function rl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Tn(4,t,t.return),rl(t);break;case 1:Xt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Sd(t,t.return,n),rl(t);break;case 27:Ha(t.stateNode);case 26:case 5:Xt(t,t.return),rl(t);break;case 22:t.memoizedState===null&&rl(t);break;case 30:rl(t);break;default:rl(t)}e=e.sibling}}function rn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,s=t,r=s.flags;switch(s.tag){case 0:case 11:case 15:rn(i,s,n),Ma(4,s);break;case 1:if(rn(i,s,n),l=s,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(E){Me(l,l.return,E)}if(l=s,i=l.updateQueue,i!==null){var m=l.stateNode;try{var b=i.shared.hiddenCallbacks;if(b!==null)for(i.shared.hiddenCallbacks=null,i=0;i<b.length;i++)oo(b[i],m)}catch(E){Me(l,l.return,E)}}n&&r&64&&Nd(s),wa(s,s.return);break;case 27:Ed(s);case 26:case 5:rn(i,s,n),n&&l===null&&r&4&&_d(s),wa(s,s.return);break;case 12:rn(i,s,n);break;case 31:rn(i,s,n),n&&r&4&&zd(i,s);break;case 13:rn(i,s,n),n&&r&4&&Dd(i,s);break;case 22:s.memoizedState===null&&rn(i,s,n),wa(s,s.return);break;case 30:break;default:rn(i,s,n)}t=t.sibling}}function Jc(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&&xa(n))}function Fc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xa(e))}function Bt(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kd(e,t,n,l),t=t.sibling}function kd(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Bt(e,t,n,l),i&2048&&Ma(9,t);break;case 1:Bt(e,t,n,l);break;case 3:Bt(e,t,n,l),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xa(e)));break;case 12:if(i&2048){Bt(e,t,n,l),e=t.stateNode;try{var s=t.memoizedProps,r=s.id,m=s.onPostCommit;typeof m=="function"&&m(r,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(b){Me(t,t.return,b)}}else Bt(e,t,n,l);break;case 31:Bt(e,t,n,l);break;case 13:Bt(e,t,n,l);break;case 23:break;case 22:s=t.stateNode,r=t.alternate,t.memoizedState!==null?s._visibility&2?Bt(e,t,n,l):Ca(e,t):s._visibility&2?Bt(e,t,n,l):(s._visibility|=2,Yl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Jc(r,t);break;case 24:Bt(e,t,n,l),i&2048&&Fc(t.alternate,t);break;default:Bt(e,t,n,l)}}function Yl(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,r=t,m=n,b=l,E=r.flags;switch(r.tag){case 0:case 11:case 15:Yl(s,r,m,b,i),Ma(8,r);break;case 23:break;case 22:var k=r.stateNode;r.memoizedState!==null?k._visibility&2?Yl(s,r,m,b,i):Ca(s,r):(k._visibility|=2,Yl(s,r,m,b,i)),i&&E&2048&&Jc(r.alternate,r);break;case 24:Yl(s,r,m,b,i),i&&E&2048&&Fc(r.alternate,r);break;default:Yl(s,r,m,b,i)}t=t.sibling}}function Ca(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,i=l.flags;switch(l.tag){case 22:Ca(n,l),i&2048&&Jc(l.alternate,l);break;case 24:Ca(n,l),i&2048&&Fc(l.alternate,l);break;default:Ca(n,l)}t=t.sibling}}var za=8192;function Gl(e,t,n){if(e.subtreeFlags&za)for(e=e.child;e!==null;)Ud(e,t,n),e=e.sibling}function Ud(e,t,n){switch(e.tag){case 26:Gl(e,t,n),e.flags&za&&e.memoizedState!==null&&Vx(n,Ht,e.memoizedState,e.memoizedProps);break;case 5:Gl(e,t,n);break;case 3:case 4:var l=Ht;Ht=Pi(e.stateNode.containerInfo),Gl(e,t,n),Ht=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=za,za=16777216,Gl(e,t,n),za=l):Gl(e,t,n));break;default:Gl(e,t,n)}}function qd(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 Da(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];We=l,Bd(l,e)}qd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hd(e),e=e.sibling}function Hd(e){switch(e.tag){case 0:case 11:case 15:Da(e),e.flags&2048&&Tn(9,e,e.return);break;case 3:Da(e);break;case 12:Da(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Li(e)):Da(e);break;default:Da(e)}}function Li(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];We=l,Bd(l,e)}qd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tn(8,t,t.return),Li(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Li(t));break;default:Li(t)}e=e.sibling}}function Bd(e,t){for(;We!==null;){var n=We;switch(n.tag){case 0:case 11:case 15:Tn(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:xa(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,We=l;else e:for(n=e;We!==null;){l=We;var i=l.sibling,s=l.return;if(wd(l),l===n){We=null;break e}if(i!==null){i.return=s,We=i;break e}We=s}}}var sx={getCacheForType:function(e){var t=lt(Ve),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return lt(Ve).controller.signal}},cx=typeof WeakMap=="function"?WeakMap:Map,Ee=0,De=null,be=null,ye=0,Ae=0,St=null,En=!1,Xl=!1,Ic=!1,on=0,Ye=0,An=0,ol=0,Wc=0,_t=0,Ql=0,Oa=null,xt=null,Pc=!1,Yi=0,Ld=0,Gi=1/0,Xi=null,Mn=null,Je=0,wn=null,Vl=null,dn=0,eu=0,tu=null,Yd=null,Ra=0,nu=null;function Tt(){return(Ee&2)!==0&&ye!==0?ye&-ye:S.T!==null?uu():nr()}function Gd(){if(_t===0)if((ye&536870912)===0||Ne){var e=Ia;Ia<<=1,(Ia&3932160)===0&&(Ia=262144),_t=e}else _t=536870912;return e=jt.current,e!==null&&(e.flags|=32),_t}function gt(e,t,n){(e===De&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)&&(Zl(e,0),Cn(e,ye,_t,!1)),ta(e,n),((Ee&2)===0||e!==De)&&(e===De&&((Ee&2)===0&&(ol|=n),Ye===4&&Cn(e,ye,_t,!1)),Qt(e))}function Xd(e,t,n){if((Ee&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ea(e,t),i=l?ox(e,t):au(e,t,!0),s=l;do{if(i===0){Xl&&!l&&Cn(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!ux(n)){i=au(e,t,!1),s=!1;continue}if(i===2){if(s=t,e.errorRecoveryDisabledLanes&s)var r=0;else r=e.pendingLanes&-536870913,r=r!==0?r:r&536870912?536870912:0;if(r!==0){t=r;e:{var m=e;i=Oa;var b=m.current.memoizedState.isDehydrated;if(b&&(Zl(m,r).flags|=256),r=au(m,r,!1),r!==2){if(Ic&&!b){m.errorRecoveryDisabledLanes|=s,ol|=s,i=4;break e}s=xt,xt=i,s!==null&&(xt===null?xt=s:xt.push.apply(xt,s))}i=r}if(s=!1,i!==2)continue}}if(i===1){Zl(e,0),Cn(e,t,0,!0);break}e:{switch(l=e,s=i,s){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Cn(l,t,_t,!En);break e;case 2:xt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=Yi+300-Ue(),10<i)){if(Cn(l,t,_t,!En),Pa(l,0,!0)!==0)break e;dn=t,l.timeoutHandle=jf(Qd.bind(null,l,n,xt,Xi,Pc,t,_t,ol,Ql,En,s,"Throttled",-0,0),i);break e}Qd(l,n,xt,Xi,Pc,t,_t,ol,Ql,En,s,null,-0,0)}}break}while(!0);Qt(e)}function Qd(e,t,n,l,i,s,r,m,b,E,k,B,M,z){if(e.timeoutHandle=-1,B=t.subtreeFlags,B&8192||(B&16785408)===16785408){B={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},Ud(t,s,B);var ee=(s&62914560)===s?Yi-Ue():(s&4194048)===s?Ld-Ue():0;if(ee=Zx(B,ee),ee!==null){dn=s,e.cancelPendingCommit=ee(Wd.bind(null,e,t,s,n,l,i,r,m,b,k,B,null,M,z)),Cn(e,s,r,!E);return}}Wd(e,t,s,n,l,i,r,m,b)}function ux(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var i=n[l],s=i.getSnapshot;i=i.value;try{if(!vt(s(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Cn(e,t,n,l){t&=~Wc,t&=~ol,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var s=31-bt(i),r=1<<s;l[s]=-1,i&=~r}n!==0&&Pu(e,n,t)}function Qi(){return(Ee&6)===0?(ka(0),!1):!0}function lu(){if(be!==null){if(Ae===0)var e=be.return;else e=be,Pt=tl=null,vc(e),Ul=null,pa=0,e=be;for(;e!==null;)jd(e.alternate,e),e=e.return;be=null}}function Zl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Mx(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),dn=0,lu(),De=e,be=n=It(e.current,null),ye=t,Ae=0,St=null,En=!1,Xl=ea(e,t),Ic=!1,Ql=_t=Wc=ol=An=Ye=0,xt=Oa=null,Pc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var i=31-bt(l),s=1<<i;t|=e[i],l&=~s}return on=t,di(),n}function Vd(e,t){xe=null,S.H=Ta,t===kl||t===vi?(t=so(),Ae=3):t===cc?(t=so(),Ae=4):Ae=t===kc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,St=t,be===null&&(Ye=1,Oi(e,wt(t,e.current)))}function Zd(){var e=jt.current;return e===null?!0:(ye&4194048)===ye?Ot===null:(ye&62914560)===ye||(ye&536870912)!==0?e===Ot:!1}function $d(){var e=S.H;return S.H=Ta,e===null?Ta:e}function Kd(){var e=S.A;return S.A=sx,e}function Vi(){Ye=4,En||(ye&4194048)!==ye&&jt.current!==null||(Xl=!0),(An&134217727)===0&&(ol&134217727)===0||De===null||Cn(De,ye,_t,!1)}function au(e,t,n){var l=Ee;Ee|=2;var i=$d(),s=Kd();(De!==e||ye!==t)&&(Xi=null,Zl(e,t)),t=!1;var r=Ye;e:do try{if(Ae!==0&&be!==null){var m=be,b=St;switch(Ae){case 8:lu(),r=6;break e;case 3:case 2:case 9:case 6:jt.current===null&&(t=!0);var E=Ae;if(Ae=0,St=null,$l(e,m,b,E),n&&Xl){r=0;break e}break;default:E=Ae,Ae=0,St=null,$l(e,m,b,E)}}rx(),r=Ye;break}catch(k){Vd(e,k)}while(!0);return t&&e.shellSuspendCounter++,Pt=tl=null,Ee=l,S.H=i,S.A=s,be===null&&(De=null,ye=0,di()),r}function rx(){for(;be!==null;)Jd(be)}function ox(e,t){var n=Ee;Ee|=2;var l=$d(),i=Kd();De!==e||ye!==t?(Xi=null,Gi=Ue()+500,Zl(e,t)):Xl=ea(e,t);e:do try{if(Ae!==0&&be!==null){t=be;var s=St;t:switch(Ae){case 1:Ae=0,St=null,$l(e,t,s,1);break;case 2:case 9:if(ao(s)){Ae=0,St=null,Fd(t);break}t=function(){Ae!==2&&Ae!==9||De!==e||(Ae=7),Qt(e)},s.then(t,t);break e;case 3:Ae=7;break e;case 4:Ae=5;break e;case 7:ao(s)?(Ae=0,St=null,Fd(t)):(Ae=0,St=null,$l(e,t,s,7));break;case 5:var r=null;switch(be.tag){case 26:r=be.memoizedState;case 5:case 27:var m=be;if(r?Uf(r):m.stateNode.complete){Ae=0,St=null;var b=m.sibling;if(b!==null)be=b;else{var E=m.return;E!==null?(be=E,Zi(E)):be=null}break t}}Ae=0,St=null,$l(e,t,s,5);break;case 6:Ae=0,St=null,$l(e,t,s,6);break;case 8:lu(),Ye=6;break e;default:throw Error(o(462))}}dx();break}catch(k){Vd(e,k)}while(!0);return Pt=tl=null,S.H=l,S.A=i,Ee=n,be!==null?0:(De=null,ye=0,di(),Ye)}function dx(){for(;be!==null&&!et();)Jd(be)}function Jd(e){var t=vd(e.alternate,e,on);e.memoizedProps=e.pendingProps,t===null?Zi(e):be=t}function Fd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=md(n,t,t.pendingProps,t.type,void 0,ye);break;case 11:t=md(n,t,t.pendingProps,t.type.render,t.ref,ye);break;case 5:vc(t);default:jd(n,t),t=be=$r(t,on),t=vd(n,t,on)}e.memoizedProps=e.pendingProps,t===null?Zi(e):be=t}function $l(e,t,n,l){Pt=tl=null,vc(t),Ul=null,pa=0;var i=t.return;try{if(Ph(e,i,t,n,ye)){Ye=1,Oi(e,wt(n,e.current)),be=null;return}}catch(s){if(i!==null)throw be=i,s;Ye=1,Oi(e,wt(n,e.current)),be=null;return}t.flags&32768?(Ne||l===1?e=!0:Xl||(ye&536870912)!==0?e=!1:(En=e=!0,(l===2||l===9||l===3||l===6)&&(l=jt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Id(t,e)):Zi(t)}function Zi(e){var t=e;do{if((t.flags&32768)!==0){Id(t,En);return}e=t.return;var n=nx(t.alternate,t,on);if(n!==null){be=n;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Ye===0&&(Ye=5)}function Id(e,t){do{var n=lx(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);Ye=6,be=null}function Wd(e,t,n,l,i,s,r,m,b){e.cancelPendingCommit=null;do $i();while(Je!==0);if((Ee&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(s=t.lanes|t.childLanes,s|=Zs,Qm(e,n,s,r,m,b),e===De&&(be=De=null,ye=0),Vl=t,wn=e,dn=n,eu=s,tu=i,Yd=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,xx(Ja,function(){return lf(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=S.T,S.T=null,i=H.p,H.p=2,r=Ee,Ee|=4;try{ax(e,t,n)}finally{Ee=r,H.p=i,S.T=l}}Je=1,Pd(),ef(),tf()}}function Pd(){if(Je===1){Je=0;var e=wn,t=Vl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=S.T,S.T=null;var l=H.p;H.p=2;var i=Ee;Ee|=4;try{Od(t,e);var s=gu,r=Hr(e.containerInfo),m=s.focusedElem,b=s.selectionRange;if(r!==m&&m&&m.ownerDocument&&qr(m.ownerDocument.documentElement,m)){if(b!==null&&Ys(m)){var E=b.start,k=b.end;if(k===void 0&&(k=E),"selectionStart"in m)m.selectionStart=E,m.selectionEnd=Math.min(k,m.value.length);else{var B=m.ownerDocument||document,M=B&&B.defaultView||window;if(M.getSelection){var z=M.getSelection(),ee=m.textContent.length,re=Math.min(b.start,ee),ze=b.end===void 0?re:Math.min(b.end,ee);!z.extend&&re>ze&&(r=ze,ze=re,re=r);var N=Ur(m,re),j=Ur(m,ze);if(N&&j&&(z.rangeCount!==1||z.anchorNode!==N.node||z.anchorOffset!==N.offset||z.focusNode!==j.node||z.focusOffset!==j.offset)){var T=B.createRange();T.setStart(N.node,N.offset),z.removeAllRanges(),re>ze?(z.addRange(T),z.extend(j.node,j.offset)):(T.setEnd(j.node,j.offset),z.addRange(T))}}}}for(B=[],z=m;z=z.parentNode;)z.nodeType===1&&B.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<B.length;m++){var q=B[m];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}is=!!xu,gu=xu=null}finally{Ee=i,H.p=l,S.T=n}}e.current=t,Je=2}}function ef(){if(Je===2){Je=0;var e=wn,t=Vl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=S.T,S.T=null;var l=H.p;H.p=2;var i=Ee;Ee|=4;try{Md(e,t.alternate,t)}finally{Ee=i,H.p=l,S.T=n}}Je=3}}function tf(){if(Je===4||Je===3){Je=0,Ut();var e=wn,t=Vl,n=dn,l=Yd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Je=5:(Je=0,Vl=wn=null,nf(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Mn=null),Ns(n),t=t.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(Pl,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=S.T,i=H.p,H.p=2,S.T=null;try{for(var s=e.onRecoverableError,r=0;r<l.length;r++){var m=l[r];s(m.value,{componentStack:m.stack})}}finally{S.T=t,H.p=i}}(dn&3)!==0&&$i(),Qt(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===nu?Ra++:(Ra=0,nu=e):Ra=0,ka(0)}}function nf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,xa(t)))}function $i(){return Pd(),ef(),tf(),lf()}function lf(){if(Je!==5)return!1;var e=wn,t=eu;eu=0;var n=Ns(dn),l=S.T,i=H.p;try{H.p=32>n?32:n,S.T=null,n=tu,tu=null;var s=wn,r=dn;if(Je=0,Vl=wn=null,dn=0,(Ee&6)!==0)throw Error(o(331));var m=Ee;if(Ee|=4,Hd(s.current),kd(s,s.current,r,n),Ee=m,ka(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(Pl,s)}catch{}return!0}finally{H.p=i,S.T=l,nf(e,t)}}function af(e,t,n){t=wt(n,t),t=Rc(e.stateNode,t,2),e=Nn(e,t,2),e!==null&&(ta(e,2),Qt(e))}function Me(e,t,n){if(e.tag===3)af(e,e,n);else for(;t!==null;){if(t.tag===3){af(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Mn===null||!Mn.has(l))){e=wt(n,e),n=id(2),l=Nn(t,n,2),l!==null&&(sd(n,l,t,e),ta(l,2),Qt(l));break}}t=t.return}}function iu(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new cx;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(Ic=!0,i.add(n),e=fx.bind(null,e,t,n),t.then(e,e))}function fx(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,De===e&&(ye&n)===n&&(Ye===4||Ye===3&&(ye&62914560)===ye&&300>Ue()-Yi?(Ee&2)===0&&Zl(e,0):Wc|=n,Ql===ye&&(Ql=0)),Qt(e)}function sf(e,t){t===0&&(t=Wu()),e=Wn(e,t),e!==null&&(ta(e,t),Qt(e))}function mx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sf(e,n)}function hx(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),sf(e,n)}function xx(e,t){return ke(e,t)}var Ki=null,Kl=null,su=!1,Ji=!1,cu=!1,zn=0;function Qt(e){e!==Kl&&e.next===null&&(Kl===null?Ki=Kl=e:Kl=Kl.next=e),Ji=!0,su||(su=!0,px())}function ka(e,t){if(!cu&&Ji){cu=!0;do for(var n=!1,l=Ki;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var s=0;else{var r=l.suspendedLanes,m=l.pingedLanes;s=(1<<31-bt(42|e)+1)-1,s&=i&~(r&~m),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,of(l,s))}else s=ye,s=Pa(l,l===De?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||ea(l,s)||(n=!0,of(l,s));l=l.next}while(n);cu=!1}}function gx(){cf()}function cf(){Ji=su=!1;var e=0;zn!==0&&Ax()&&(e=zn);for(var t=Ue(),n=null,l=Ki;l!==null;){var i=l.next,s=uf(l,t);s===0?(l.next=null,n===null?Ki=i:n.next=i,i===null&&(Kl=n)):(n=l,(e!==0||(s&3)!==0)&&(Ji=!0)),l=i}Je!==0&&Je!==5||ka(e),zn!==0&&(zn=0)}function uf(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var r=31-bt(s),m=1<<r,b=i[r];b===-1?((m&n)===0||(m&l)!==0)&&(i[r]=Xm(m,t)):b<=t&&(e.expiredLanes|=m),s&=~m}if(t=De,n=ye,n=Pa(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Fe(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ea(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Fe(l),Ns(n)){case 2:case 8:n=Fu;break;case 32:n=Ja;break;case 268435456:n=Iu;break;default:n=Ja}return l=rf.bind(null,e),n=ke(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Fe(l),e.callbackPriority=2,e.callbackNode=null,2}function rf(e,t){if(Je!==0&&Je!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if($i()&&e.callbackNode!==n)return null;var l=ye;return l=Pa(e,e===De?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Xd(e,l,t),uf(e,Ue()),e.callbackNode!=null&&e.callbackNode===n?rf.bind(null,e):null)}function of(e,t){if($i())return null;Xd(e,t,!0)}function px(){wx(function(){(Ee&6)!==0?ke(Zn,gx):cf()})}function uu(){if(zn===0){var e=Ol;e===0&&(e=Fa,Fa<<=1,(Fa&261888)===0&&(Fa=256)),zn=e}return zn}function df(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:li(""+e)}function ff(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 bx(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var s=df((i[ot]||null).action),r=l.submitter;r&&(t=(t=r[ot]||null)?df(t.formAction):r.getAttribute("formAction"),t!==null&&(s=t,r=null));var m=new ci("action","action",null,l,i);e.push({event:m,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(zn!==0){var b=r?ff(i,r):new FormData(i);Mc(n,{pending:!0,data:b,method:i.method,action:s},null,b)}}else typeof s=="function"&&(m.preventDefault(),b=r?ff(i,r):new FormData(i),Mc(n,{pending:!0,data:b,method:i.method,action:s},s,b))},currentTarget:i}]})}}for(var ru=0;ru<Vs.length;ru++){var ou=Vs[ru],vx=ou.toLowerCase(),yx=ou[0].toUpperCase()+ou.slice(1);qt(vx,"on"+yx)}qt(Yr,"onAnimationEnd"),qt(Gr,"onAnimationIteration"),qt(Xr,"onAnimationStart"),qt("dblclick","onDoubleClick"),qt("focusin","onFocus"),qt("focusout","onBlur"),qt(Uh,"onTransitionRun"),qt(qh,"onTransitionStart"),qt(Hh,"onTransitionCancel"),qt(Qr,"onTransitionEnd"),vl("onMouseEnter",["mouseout","mouseover"]),vl("onMouseLeave",["mouseout","mouseover"]),vl("onPointerEnter",["pointerout","pointerover"]),vl("onPointerLeave",["pointerout","pointerover"]),Kn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ua="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(" "),jx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ua));function mf(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],i=l.event;l=l.listeners;e:{var s=void 0;if(t)for(var r=l.length-1;0<=r;r--){var m=l[r],b=m.instance,E=m.currentTarget;if(m=m.listener,b!==s&&i.isPropagationStopped())break e;s=m,i.currentTarget=E;try{s(i)}catch(k){oi(k)}i.currentTarget=null,s=b}else for(r=0;r<l.length;r++){if(m=l[r],b=m.instance,E=m.currentTarget,m=m.listener,b!==s&&i.isPropagationStopped())break e;s=m,i.currentTarget=E;try{s(i)}catch(k){oi(k)}i.currentTarget=null,s=b}}}}function ve(e,t){var n=t[Ss];n===void 0&&(n=t[Ss]=new Set);var l=e+"__bubble";n.has(l)||(hf(t,e,2,!1),n.add(l))}function du(e,t,n){var l=0;t&&(l|=4),hf(n,e,l,t)}var Fi="_reactListening"+Math.random().toString(36).slice(2);function fu(e){if(!e[Fi]){e[Fi]=!0,ir.forEach(function(n){n!=="selectionchange"&&(jx.has(n)||du(n,!1,e),du(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fi]||(t[Fi]=!0,du("selectionchange",!1,t))}}function hf(e,t,n,l){switch(Xf(t)){case 2:var i=Jx;break;case 8:i=Fx;break;default:i=Au}n=i.bind(null,t,n,e),i=void 0,!Ds||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function mu(e,t,n,l,i){var s=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var r=l.tag;if(r===3||r===4){var m=l.stateNode.containerInfo;if(m===i)break;if(r===4)for(r=l.return;r!==null;){var b=r.tag;if((b===3||b===4)&&r.stateNode.containerInfo===i)return;r=r.return}for(;m!==null;){if(r=gl(m),r===null)return;if(b=r.tag,b===5||b===6||b===26||b===27){l=s=r;continue e}m=m.parentNode}}l=l.return}pr(function(){var E=s,k=Cs(n),B=[];e:{var M=Vr.get(e);if(M!==void 0){var z=ci,ee=e;switch(e){case"keypress":if(ii(n)===0)break e;case"keydown":case"keyup":z=hh;break;case"focusin":ee="focus",z=Us;break;case"focusout":ee="blur",z=Us;break;case"beforeblur":case"afterblur":z=Us;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":z=yr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=nh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=ph;break;case Yr:case Gr:case Xr:z=ih;break;case Qr:z=vh;break;case"scroll":case"scrollend":z=eh;break;case"wheel":z=jh;break;case"copy":case"cut":case"paste":z=ch;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=Nr;break;case"toggle":case"beforetoggle":z=Sh}var re=(t&4)!==0,ze=!re&&(e==="scroll"||e==="scrollend"),N=re?M!==null?M+"Capture":null:M;re=[];for(var j=E,T;j!==null;){var q=j;if(T=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||T===null||N===null||(q=aa(j,N),q!=null&&re.push(qa(j,q,T))),ze)break;j=j.return}0<re.length&&(M=new z(M,ee,null,n,k),B.push({event:M,listeners:re}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",z=e==="mouseout"||e==="pointerout",M&&n!==ws&&(ee=n.relatedTarget||n.fromElement)&&(gl(ee)||ee[xl]))break e;if((z||M)&&(M=k.window===k?k:(M=k.ownerDocument)?M.defaultView||M.parentWindow:window,z?(ee=n.relatedTarget||n.toElement,z=E,ee=ee?gl(ee):null,ee!==null&&(ze=h(ee),re=ee.tag,ee!==ze||re!==5&&re!==27&&re!==6)&&(ee=null)):(z=null,ee=E),z!==ee)){if(re=yr,q="onMouseLeave",N="onMouseEnter",j="mouse",(e==="pointerout"||e==="pointerover")&&(re=Nr,q="onPointerLeave",N="onPointerEnter",j="pointer"),ze=z==null?M:la(z),T=ee==null?M:la(ee),M=new re(q,j+"leave",z,n,k),M.target=ze,M.relatedTarget=T,q=null,gl(k)===E&&(re=new re(N,j+"enter",ee,n,k),re.target=T,re.relatedTarget=ze,q=re),ze=q,z&&ee)t:{for(re=Nx,N=z,j=ee,T=0,q=N;q;q=re(q))T++;q=0;for(var se=j;se;se=re(se))q++;for(;0<T-q;)N=re(N),T--;for(;0<q-T;)j=re(j),q--;for(;T--;){if(N===j||j!==null&&N===j.alternate){re=N;break t}N=re(N),j=re(j)}re=null}else re=null;z!==null&&xf(B,M,z,re,!1),ee!==null&&ze!==null&&xf(B,ze,ee,re,!0)}}e:{if(M=E?la(E):window,z=M.nodeName&&M.nodeName.toLowerCase(),z==="select"||z==="input"&&M.type==="file")var _e=Cr;else if(Mr(M))if(zr)_e=Oh;else{_e=zh;var le=Ch}else z=M.nodeName,!z||z.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?E&&Ms(E.elementType)&&(_e=Cr):_e=Dh;if(_e&&(_e=_e(e,E))){wr(B,_e,n,k);break e}le&&le(e,M,E),e==="focusout"&&E&&M.type==="number"&&E.memoizedProps.value!=null&&As(M,"number",M.value)}switch(le=E?la(E):window,e){case"focusin":(Mr(le)||le.contentEditable==="true")&&(Tl=le,Gs=E,fa=null);break;case"focusout":fa=Gs=Tl=null;break;case"mousedown":Xs=!0;break;case"contextmenu":case"mouseup":case"dragend":Xs=!1,Br(B,n,k);break;case"selectionchange":if(kh)break;case"keydown":case"keyup":Br(B,n,k)}var ge;if(Hs)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else _l?Er(e,n)&&(je="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(je="onCompositionStart");je&&(Sr&&n.locale!=="ko"&&(_l||je!=="onCompositionStart"?je==="onCompositionEnd"&&_l&&(ge=br()):(xn=k,Os="value"in xn?xn.value:xn.textContent,_l=!0)),le=Ii(E,je),0<le.length&&(je=new jr(je,e,null,n,k),B.push({event:je,listeners:le}),ge?je.data=ge:(ge=Ar(n),ge!==null&&(je.data=ge)))),(ge=Th?Eh(e,n):Ah(e,n))&&(je=Ii(E,"onBeforeInput"),0<je.length&&(le=new jr("onBeforeInput","beforeinput",null,n,k),B.push({event:le,listeners:je}),le.data=ge)),bx(B,e,E,n,k)}mf(B,t)})}function qa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ii(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,s=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||s===null||(i=aa(e,n),i!=null&&l.unshift(qa(e,i,s)),i=aa(e,t),i!=null&&l.push(qa(e,i,s))),e.tag===3)return l;e=e.return}return[]}function Nx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function xf(e,t,n,l,i){for(var s=t._reactName,r=[];n!==null&&n!==l;){var m=n,b=m.alternate,E=m.stateNode;if(m=m.tag,b!==null&&b===l)break;m!==5&&m!==26&&m!==27||E===null||(b=E,i?(E=aa(n,s),E!=null&&r.unshift(qa(n,E,b))):i||(E=aa(n,s),E!=null&&r.push(qa(n,E,b)))),n=n.return}r.length!==0&&e.push({event:t,listeners:r})}var Sx=/\r\n?/g,_x=/\u0000|\uFFFD/g;function gf(e){return(typeof e=="string"?e:""+e).replace(Sx,`
49
+ `).replace(_x,"")}function pf(e,t){return t=gf(t),gf(e)===t}function Ce(e,t,n,l,i,s){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||jl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&jl(e,""+l);break;case"className":ti(e,"class",l);break;case"tabIndex":ti(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ti(e,n,l);break;case"style":xr(e,l,s);break;case"data":if(t!=="object"){ti(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=li(""+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 s=="function"&&(n==="formAction"?(t!=="input"&&Ce(e,t,"name",i.name,i,null),Ce(e,t,"formEncType",i.formEncType,i,null),Ce(e,t,"formMethod",i.formMethod,i,null),Ce(e,t,"formTarget",i.formTarget,i,null)):(Ce(e,t,"encType",i.encType,i,null),Ce(e,t,"method",i.method,i,null),Ce(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=li(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Jt);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=li(""+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":ve("beforetoggle",e),ve("toggle",e),ei(e,"popover",l);break;case"xlinkActuate":Kt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Kt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Kt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Kt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Kt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Kt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ei(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=Wm.get(n)||n,ei(e,n,l))}}function hu(e,t,n,l,i,s){switch(n){case"style":xr(e,l,s);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof l=="string"?jl(e,l):(typeof l=="number"||typeof l=="bigint")&&jl(e,""+l);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Jt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sr.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),s=e[ot]||null,s=s!=null?s[n]:null,typeof s=="function"&&e.removeEventListener(t,s,i),typeof l=="function")){typeof s!="function"&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,i);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):ei(e,n,l)}}}function it(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var l=!1,i=!1,s;for(s in n)if(n.hasOwnProperty(s)){var r=n[s];if(r!=null)switch(s){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ce(e,t,s,r,n,null)}}i&&Ce(e,t,"srcSet",n.srcSet,n,null),l&&Ce(e,t,"src",n.src,n,null);return;case"input":ve("invalid",e);var m=s=r=i=null,b=null,E=null;for(l in n)if(n.hasOwnProperty(l)){var k=n[l];if(k!=null)switch(l){case"name":i=k;break;case"type":r=k;break;case"checked":b=k;break;case"defaultChecked":E=k;break;case"value":s=k;break;case"defaultValue":m=k;break;case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(o(137,t));break;default:Ce(e,t,l,k,n,null)}}dr(e,s,m,b,E,r,i,!1);return;case"select":ve("invalid",e),l=r=s=null;for(i in n)if(n.hasOwnProperty(i)&&(m=n[i],m!=null))switch(i){case"value":s=m;break;case"defaultValue":r=m;break;case"multiple":l=m;default:Ce(e,t,i,m,n,null)}t=s,n=r,e.multiple=!!l,t!=null?yl(e,!!l,t,!1):n!=null&&yl(e,!!l,n,!0);return;case"textarea":ve("invalid",e),s=i=l=null;for(r in n)if(n.hasOwnProperty(r)&&(m=n[r],m!=null))switch(r){case"value":l=m;break;case"defaultValue":i=m;break;case"children":s=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(o(91));break;default:Ce(e,t,r,m,n,null)}mr(e,l,i,s);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:Ce(e,t,b,l,n,null)}return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(l=0;l<Ua.length;l++)ve(Ua[l],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("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(E in n)if(n.hasOwnProperty(E)&&(l=n[E],l!=null))switch(E){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ce(e,t,E,l,n,null)}return;default:if(Ms(t)){for(k in n)n.hasOwnProperty(k)&&(l=n[k],l!==void 0&&hu(e,t,k,l,n,void 0));return}}for(m in n)n.hasOwnProperty(m)&&(l=n[m],l!=null&&Ce(e,t,m,l,n,null))}function Tx(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,r=null,m=null,b=null,E=null,k=null;for(z in n){var B=n[z];if(n.hasOwnProperty(z)&&B!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":b=B;default:l.hasOwnProperty(z)||Ce(e,t,z,null,l,B)}}for(var M in l){var z=l[M];if(B=n[M],l.hasOwnProperty(M)&&(z!=null||B!=null))switch(M){case"type":s=z;break;case"name":i=z;break;case"checked":E=z;break;case"defaultChecked":k=z;break;case"value":r=z;break;case"defaultValue":m=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(o(137,t));break;default:z!==B&&Ce(e,t,M,z,l,B)}}Es(e,r,m,b,E,k,s,i);return;case"select":z=r=m=M=null;for(s in n)if(b=n[s],n.hasOwnProperty(s)&&b!=null)switch(s){case"value":break;case"multiple":z=b;default:l.hasOwnProperty(s)||Ce(e,t,s,null,l,b)}for(i in l)if(s=l[i],b=n[i],l.hasOwnProperty(i)&&(s!=null||b!=null))switch(i){case"value":M=s;break;case"defaultValue":m=s;break;case"multiple":r=s;default:s!==b&&Ce(e,t,i,s,l,b)}t=m,n=r,l=z,M!=null?yl(e,!!n,M,!1):!!l!=!!n&&(t!=null?yl(e,!!n,t,!0):yl(e,!!n,n?[]:"",!1));return;case"textarea":z=M=null;for(m in n)if(i=n[m],n.hasOwnProperty(m)&&i!=null&&!l.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Ce(e,t,m,null,l,i)}for(r in l)if(i=l[r],s=n[r],l.hasOwnProperty(r)&&(i!=null||s!=null))switch(r){case"value":M=i;break;case"defaultValue":z=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(o(91));break;default:i!==s&&Ce(e,t,r,i,l,s)}fr(e,M,z);return;case"option":for(var ee in n)if(M=n[ee],n.hasOwnProperty(ee)&&M!=null&&!l.hasOwnProperty(ee))switch(ee){case"selected":e.selected=!1;break;default:Ce(e,t,ee,null,l,M)}for(b in l)if(M=l[b],z=n[b],l.hasOwnProperty(b)&&M!==z&&(M!=null||z!=null))switch(b){case"selected":e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:Ce(e,t,b,M,l,z)}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 re in n)M=n[re],n.hasOwnProperty(re)&&M!=null&&!l.hasOwnProperty(re)&&Ce(e,t,re,null,l,M);for(E in l)if(M=l[E],z=n[E],l.hasOwnProperty(E)&&M!==z&&(M!=null||z!=null))switch(E){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(o(137,t));break;default:Ce(e,t,E,M,l,z)}return;default:if(Ms(t)){for(var ze in n)M=n[ze],n.hasOwnProperty(ze)&&M!==void 0&&!l.hasOwnProperty(ze)&&hu(e,t,ze,void 0,l,M);for(k in l)M=l[k],z=n[k],!l.hasOwnProperty(k)||M===z||M===void 0&&z===void 0||hu(e,t,k,M,l,z);return}}for(var N in n)M=n[N],n.hasOwnProperty(N)&&M!=null&&!l.hasOwnProperty(N)&&Ce(e,t,N,null,l,M);for(B in l)M=l[B],z=n[B],!l.hasOwnProperty(B)||M===z||M==null&&z==null||Ce(e,t,B,M,l,z)}function bf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ex(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var i=n[l],s=i.transferSize,r=i.initiatorType,m=i.duration;if(s&&m&&bf(r)){for(r=0,m=i.responseEnd,l+=1;l<n.length;l++){var b=n[l],E=b.startTime;if(E>m)break;var k=b.transferSize,B=b.initiatorType;k&&bf(B)&&(b=b.responseEnd,r+=k*(b<m?1:(m-E)/(b-E)))}if(--l,t+=8*(s+r)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var xu=null,gu=null;function Wi(e){return e.nodeType===9?e:e.ownerDocument}function vf(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 yf(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 pu(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 bu=null;function Ax(){var e=window.event;return e&&e.type==="popstate"?e===bu?!1:(bu=e,!0):(bu=null,!1)}var jf=typeof setTimeout=="function"?setTimeout:void 0,Mx=typeof clearTimeout=="function"?clearTimeout:void 0,Nf=typeof Promise=="function"?Promise:void 0,wx=typeof queueMicrotask=="function"?queueMicrotask:typeof Nf<"u"?function(e){return Nf.resolve(null).then(e).catch(Cx)}:jf;function Cx(e){setTimeout(function(){throw e})}function Dn(e){return e==="head"}function Sf(e,t){var n=t,l=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(i),Wl(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Ha(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ha(n);for(var s=n.firstChild;s;){var r=s.nextSibling,m=s.nodeName;s[na]||m==="SCRIPT"||m==="STYLE"||m==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=r}}else n==="body"&&Ha(e.ownerDocument.body);n=i}while(n);Wl(t)}function _f(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 vu(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":vu(n),_s(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function zx(e,t,n,l){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[na])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=Rt(e.nextSibling),e===null)break}return null}function Dx(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Rt(e.nextSibling),e===null))return null;return e}function Tf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Rt(e.nextSibling),e===null))return null;return e}function yu(e){return e.data==="$?"||e.data==="$~"}function ju(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ox(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 Rt(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 Nu=null;function Ef(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Rt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Af(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 Mf(e,t,n){switch(t=Wi(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 Ha(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_s(e)}var kt=new Map,wf=new Set;function Pi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fn=H.d;H.d={f:Rx,r:kx,D:Ux,C:qx,L:Hx,m:Bx,X:Yx,S:Lx,M:Gx};function Rx(){var e=fn.f(),t=Qi();return e||t}function kx(e){var t=pl(e);t!==null&&t.tag===5&&t.type==="form"?Vo(t):fn.r(e)}var Jl=typeof document>"u"?null:document;function Cf(e,t,n){var l=Jl;if(l&&typeof t=="string"&&t){var i=At(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),wf.has(i)||(wf.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),it(t,"link",e),Ie(t),l.head.appendChild(t)))}}function Ux(e){fn.D(e),Cf("dns-prefetch",e,null)}function qx(e,t){fn.C(e,t),Cf("preconnect",e,t)}function Hx(e,t,n){fn.L(e,t,n);var l=Jl;if(l&&e&&t){var i='link[rel="preload"][as="'+At(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+At(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+At(n.imageSizes)+'"]')):i+='[href="'+At(e)+'"]';var s=i;switch(t){case"style":s=Fl(e);break;case"script":s=Il(e)}kt.has(s)||(e=C({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),kt.set(s,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(Ba(s))||t==="script"&&l.querySelector(La(s))||(t=l.createElement("link"),it(t,"link",e),Ie(t),l.head.appendChild(t)))}}function Bx(e,t){fn.m(e,t);var n=Jl;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+At(l)+'"][href="'+At(e)+'"]',s=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Il(e)}if(!kt.has(s)&&(e=C({rel:"modulepreload",href:e},t),kt.set(s,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(La(s)))return}l=n.createElement("link"),it(l,"link",e),Ie(l),n.head.appendChild(l)}}}function Lx(e,t,n){fn.S(e,t,n);var l=Jl;if(l&&e){var i=bl(l).hoistableStyles,s=Fl(e);t=t||"default";var r=i.get(s);if(!r){var m={loading:0,preload:null};if(r=l.querySelector(Ba(s)))m.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":t},n),(n=kt.get(s))&&Su(e,n);var b=r=l.createElement("link");Ie(b),it(b,"link",e),b._p=new Promise(function(E,k){b.onload=E,b.onerror=k}),b.addEventListener("load",function(){m.loading|=1}),b.addEventListener("error",function(){m.loading|=2}),m.loading|=4,es(r,t,l)}r={type:"stylesheet",instance:r,count:1,state:m},i.set(s,r)}}}function Yx(e,t){fn.X(e,t);var n=Jl;if(n&&e){var l=bl(n).hoistableScripts,i=Il(e),s=l.get(i);s||(s=n.querySelector(La(i)),s||(e=C({src:e,async:!0},t),(t=kt.get(i))&&_u(e,t),s=n.createElement("script"),Ie(s),it(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(i,s))}}function Gx(e,t){fn.M(e,t);var n=Jl;if(n&&e){var l=bl(n).hoistableScripts,i=Il(e),s=l.get(i);s||(s=n.querySelector(La(i)),s||(e=C({src:e,async:!0,type:"module"},t),(t=kt.get(i))&&_u(e,t),s=n.createElement("script"),Ie(s),it(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(i,s))}}function zf(e,t,n,l){var i=(i=ce.current)?Pi(i):null;if(!i)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Fl(n.href),n=bl(i).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Fl(n.href);var s=bl(i).hoistableStyles,r=s.get(e);if(r||(i=i.ownerDocument||i,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,r),(s=i.querySelector(Ba(e)))&&!s._p&&(r.instance=s,r.state.loading=5),kt.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},kt.set(e,n),s||Xx(i,e,n,r.state))),t&&l===null)throw Error(o(528,""));return r}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=Il(n),n=bl(i).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Fl(e){return'href="'+At(e)+'"'}function Ba(e){return'link[rel="stylesheet"]['+e+"]"}function Df(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function Xx(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}),it(t,"link",n),Ie(t),e.head.appendChild(t))}function Il(e){return'[src="'+At(e)+'"]'}function La(e){return"script[async]"+e}function Of(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+At(n.href)+'"]');if(l)return t.instance=l,Ie(l),l;var i=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Ie(l),it(l,"style",i),es(l,n.precedence,e),t.instance=l;case"stylesheet":i=Fl(n.href);var s=e.querySelector(Ba(i));if(s)return t.state.loading|=4,t.instance=s,Ie(s),s;l=Df(n),(i=kt.get(i))&&Su(l,i),s=(e.ownerDocument||e).createElement("link"),Ie(s);var r=s;return r._p=new Promise(function(m,b){r.onload=m,r.onerror=b}),it(s,"link",l),t.state.loading|=4,es(s,n.precedence,e),t.instance=s;case"script":return s=Il(n.src),(i=e.querySelector(La(s)))?(t.instance=i,Ie(i),i):(l=n,(i=kt.get(s))&&(l=C({},n),_u(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),Ie(i),it(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,es(l,n.precedence,e));return t.instance}function es(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,s=i,r=0;r<l.length;r++){var m=l[r];if(m.dataset.precedence===t)s=m;else if(s!==i)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Su(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _u(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ts=null;function Rf(e,t,n){if(ts===null){var l=new Map,i=ts=new Map;i.set(n,l)}else i=ts,l=i.get(n),l||(l=new Map,i.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var s=n[i];if(!(s[na]||s[tt]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var r=s.getAttribute(t)||"";r=e+r;var m=l.get(r);m?m.push(s):l.set(r,[s])}}return l}function kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Qx(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 Uf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Vx(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Fl(l.href),s=t.querySelector(Ba(i));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ns.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ie(s);return}s=t.ownerDocument||t,l=Df(l),(i=kt.get(i))&&Su(l,i),s=s.createElement("link"),Ie(s);var r=s;r._p=new Promise(function(m,b){r.onload=m,r.onerror=b}),it(s,"link",l),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ns.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Tu=0;function Zx(e,t){return e.stylesheets&&e.count===0&&as(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&as(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&Tu===0&&(Tu=62500*Ex());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&as(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>Tu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function ns(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)as(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ls=null;function as(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ls=new Map,t.forEach($x,e),ls=null,ns.call(e))}function $x(e,t){if(!(t.state.loading&4)){var n=ls.get(e);if(n)var l=n.get(null);else{n=new Map,ls.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<i.length;s++){var r=i[s];(r.nodeName==="LINK"||r.getAttribute("media")!=="not all")&&(n.set(r.dataset.precedence,r),l=r)}l&&n.set(null,l)}i=t.instance,r=i.getAttribute("data-precedence"),s=n.get(r)||l,s===l&&n.set(null,i),n.set(r,i),this.count++,l=ns.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),s?s.parentNode.insertBefore(i,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Ya={$$typeof:$,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function Kx(e,t,n,l,i,s,r,m,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=ys(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ys(0),this.hiddenUpdates=ys(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=s,this.onRecoverableError=r,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function qf(e,t,n,l,i,s,r,m,b,E,k,B){return e=new Kx(e,t,n,r,b,E,k,B,m),t=1,s===!0&&(t|=24),s=yt(3,null,null,t),e.current=s,s.stateNode=e,t=ac(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:l,isDehydrated:n,cache:t},uc(s),e}function Hf(e){return e?(e=Ml,e):Ml}function Bf(e,t,n,l,i,s){i=Hf(i),l.context===null?l.context=i:l.pendingContext=i,l=jn(t),l.payload={element:n},s=s===void 0?null:s,s!==null&&(l.callback=s),n=Nn(e,l,t),n!==null&&(gt(n,e,t),va(n,e,t))}function Lf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Eu(e,t){Lf(e,t),(e=e.alternate)&&Lf(e,t)}function Yf(e){if(e.tag===13||e.tag===31){var t=Wn(e,67108864);t!==null&&gt(t,e,67108864),Eu(e,67108864)}}function Gf(e){if(e.tag===13||e.tag===31){var t=Tt();t=js(t);var n=Wn(e,t);n!==null&&gt(n,e,t),Eu(e,t)}}var is=!0;function Jx(e,t,n,l){var i=S.T;S.T=null;var s=H.p;try{H.p=2,Au(e,t,n,l)}finally{H.p=s,S.T=i}}function Fx(e,t,n,l){var i=S.T;S.T=null;var s=H.p;try{H.p=8,Au(e,t,n,l)}finally{H.p=s,S.T=i}}function Au(e,t,n,l){if(is){var i=Mu(l);if(i===null)mu(e,t,l,ss,n),Qf(e,l);else if(Wx(i,e,t,n,l))l.stopPropagation();else if(Qf(e,l),t&4&&-1<Ix.indexOf(e)){for(;i!==null;){var s=pl(i);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var r=$n(s.pendingLanes);if(r!==0){var m=s;for(m.pendingLanes|=2,m.entangledLanes|=2;r;){var b=1<<31-bt(r);m.entanglements[1]|=b,r&=~b}Qt(s),(Ee&6)===0&&(Gi=Ue()+500,ka(0))}}break;case 31:case 13:m=Wn(s,2),m!==null&&gt(m,s,2),Qi(),Eu(s,2)}if(s=Mu(l),s===null&&mu(e,t,l,ss,n),s===i)break;i=s}i!==null&&l.stopPropagation()}else mu(e,t,l,null,n)}}function Mu(e){return e=Cs(e),wu(e)}var ss=null;function wu(e){if(ss=null,e=gl(e),e!==null){var t=h(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=y(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 ss=e,null}function Xf(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(Vn()){case Zn:return 2;case Fu:return 8;case Ja:case qm:return 32;case Iu:return 268435456;default:return 32}default:return 32}}var Cu=!1,On=null,Rn=null,kn=null,Ga=new Map,Xa=new Map,Un=[],Ix="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 Qf(e,t){switch(e){case"focusin":case"focusout":On=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":kn=null;break;case"pointerover":case"pointerout":Ga.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xa.delete(t.pointerId)}}function Qa(e,t,n,l,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:s,targetContainers:[i]},t!==null&&(t=pl(t),t!==null&&Yf(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Wx(e,t,n,l,i){switch(t){case"focusin":return On=Qa(On,e,t,n,l,i),!0;case"dragenter":return Rn=Qa(Rn,e,t,n,l,i),!0;case"mouseover":return kn=Qa(kn,e,t,n,l,i),!0;case"pointerover":var s=i.pointerId;return Ga.set(s,Qa(Ga.get(s)||null,e,t,n,l,i)),!0;case"gotpointercapture":return s=i.pointerId,Xa.set(s,Qa(Xa.get(s)||null,e,t,n,l,i)),!0}return!1}function Vf(e){var t=gl(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=v(n),t!==null){e.blockedOn=t,lr(e.priority,function(){Gf(n)});return}}else if(t===31){if(t=y(n),t!==null){e.blockedOn=t,lr(e.priority,function(){Gf(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 cs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Mu(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);ws=l,n.target.dispatchEvent(l),ws=null}else return t=pl(n),t!==null&&Yf(t),e.blockedOn=n,!1;t.shift()}return!0}function Zf(e,t,n){cs(e)&&n.delete(t)}function Px(){Cu=!1,On!==null&&cs(On)&&(On=null),Rn!==null&&cs(Rn)&&(Rn=null),kn!==null&&cs(kn)&&(kn=null),Ga.forEach(Zf),Xa.forEach(Zf)}function us(e,t){e.blockedOn===t&&(e.blockedOn=null,Cu||(Cu=!0,c.unstable_scheduleCallback(c.unstable_NormalPriority,Px)))}var rs=null;function $f(e){rs!==e&&(rs=e,c.unstable_scheduleCallback(c.unstable_NormalPriority,function(){rs===e&&(rs=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(wu(l||n)===null)continue;break}var s=pl(n);s!==null&&(e.splice(t,3),t-=3,Mc(s,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function Wl(e){function t(b){return us(b,e)}On!==null&&us(On,e),Rn!==null&&us(Rn,e),kn!==null&&us(kn,e),Ga.forEach(t),Xa.forEach(t);for(var n=0;n<Un.length;n++){var l=Un[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Un.length&&(n=Un[0],n.blockedOn===null);)Vf(n),n.blockedOn===null&&Un.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],s=n[l+1],r=i[ot]||null;if(typeof s=="function")r||$f(n);else if(r){var m=null;if(s&&s.hasAttribute("formAction")){if(i=s,r=s[ot]||null)m=r.formAction;else if(wu(i)!==null)continue}else m=r.action;typeof m=="function"?n[l+1]=m:(n.splice(l,3),l-=3),$f(n)}}}function Kf(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(r){return i=r})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function zu(e){this._internalRoot=e}os.prototype.render=zu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=Tt();Bf(n,l,e,t,null,null)},os.prototype.unmount=zu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bf(e.current,2,null,e,null,null),Qi(),t[xl]=null}};function os(e){this._internalRoot=e}os.prototype.unstable_scheduleHydration=function(e){if(e){var t=nr();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Un.length&&t!==0&&t<Un[n].priority;n++);Un.splice(n,0,e),n===0&&Vf(e)}};var Jf=u.version;if(Jf!=="19.2.4")throw Error(o(527,Jf,"19.2.4"));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=x(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var eg={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:S,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ds=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ds.isDisabled&&ds.supportsFiber)try{Pl=ds.inject(eg),pt=ds}catch{}}return Za.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,l="",i=td,s=nd,r=ld;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=qf(e,1,!1,null,null,n,l,null,i,s,r,Kf),e[xl]=t.current,fu(e),new zu(t)},Za.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var l=!1,i="",s=td,r=nd,m=ld,b=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(r=n.onCaughtError),n.onRecoverableError!==void 0&&(m=n.onRecoverableError),n.formState!==void 0&&(b=n.formState)),t=qf(e,1,!0,t,n??null,l,i,b,s,r,m,Kf),t.context=Hf(null),n=t.current,l=Tt(),l=js(l),i=jn(l),i.callback=null,Nn(n,i,l),n=l,t.current.lanes=n,ta(t,n),Qt(t),e[xl]=t.current,fu(e),new os(t)},Za.version="19.2.4",Za}var im;function fg(){if(im)return Ru.exports;im=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(u){console.error(u)}}return c(),Ru.exports=dg(),Ru.exports}var mg=fg();const fl="/dashboard";function sm(){const c=window.location.pathname;return c===fl||c===fl+"/"?"/":c.startsWith(fl+"/")?c.slice(fl.length):c||"/"}function Bn(c){return c==="/"||c===""?fl+"/":fl+(c.startsWith("/")?c:"/"+c)}function ps(c){const u=Bn(c);u!==window.location.pathname+window.location.search&&window.history.pushState({},"",u),window.dispatchEvent(new Event("dashboard:navigate"))}typeof document<"u"&&!window.__dashboardRouterInstalled&&(window.__dashboardRouterInstalled=!0,document.addEventListener("click",c=>{var o,d;if(c.defaultPrevented||c.button!==0||c.metaKey||c.ctrlKey||c.shiftKey||c.altKey)return;const u=(d=(o=c.target)==null?void 0:o.closest)==null?void 0:d.call(o,"a");if(!u)return;const f=u.getAttribute("href");f&&(u.hasAttribute("target")||u.hasAttribute("download")||f.startsWith(fl)&&(c.preventDefault(),f!==window.location.pathname+window.location.search&&window.history.pushState({},"",f),window.dispatchEvent(new Event("dashboard:navigate"))))}),window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("dashboard:navigate"))}));function vm(){const[c,u]=w.useState(sm());return w.useEffect(()=>{const f=()=>u(sm());return window.addEventListener("dashboard:navigate",f),()=>{window.removeEventListener("dashboard:navigate",f)}},[]),c}function hg(c){return new URLSearchParams(c).get("expert")==="1"}function cm(){return typeof window>"u"?!1:hg(window.location.search)}function ym(){const[c,u]=w.useState(cm);return w.useEffect(()=>{if(typeof window>"u")return;const f=window,o=()=>u(cm());return f.addEventListener("dashboard:navigate",o),()=>f.removeEventListener("dashboard:navigate",o)},[]),c}function jm(c){let u=c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");u=u.replace(/```(\w*)\n?([\s\S]*?)```/g,(h,v,y)=>`<pre class="md-code-block"><code>${y.trimEnd()}</code></pre>`),u=u.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),u=u.replace(/\*\*([^*\n]+)\*\*/g,"<strong>$1</strong>"),u=u.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const f=u.split(`
50
+ `),o=[];let d=!1;for(let h=0;h<f.length;h++){const v=f[h],y=v.match(/^###\s+(.+)$/),g=v.match(/^##\s+(.+)$/),x=v.match(/^#\s+(.+)$/);if(y){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${y[1]}</h3>`);continue}if(g){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${g[1]}</h2>`);continue}if(x){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${x[1]}</h1>`);continue}const _=v.match(/^(\s*)[*-]\s+(.+)$/);if(_){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${_[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
51
  `)}function bs(c){let u=c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");u=u.replace(/^\[(FINDING|SUGGESTION|INSIGHT)\]\s*/i,""),u=u.replace(/&lt;agent_finding[^&]*&gt;/g,""),u=u.replace(/&lt;\/agent_finding&gt;/g,""),u=u.replace(/&lt;cite\s+tag=&quot;file&quot;&gt;([^&]+)&lt;\/cite&gt;/g,'<code class="cite-file">$1</code>'),u=u.replace(/&lt;cite\s+tag=&quot;fn&quot;&gt;([^&]+)&lt;\/cite&gt;/g,'<code class="cite-fn">$1</code>'),u=u.replace(/&lt;fn&gt;([^&]+)&lt;\/fn&gt;/g,'<code class="cite-fn">$1</code>'),u=u.replace(/```(\w*)\n?([\s\S]*?)```/g,'<pre class="md-code-block"><code>$2</code></pre>'),u=u.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),u=u.replace(/\*\*([^*\n]+)\*\*/g,'<strong class="font-semibold text-foreground">$1</strong>'),u=u.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const f=u.split(`
52
- `),o=[];let d=!1;for(const h of f){const y=h.match(/^###\s+(.+)$/),v=h.match(/^##\s+(.+)$/),g=h.match(/^#\s+(.+)$/);if(y){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${y[1]}</h3>`);continue}if(v){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${v[1]}</h2>`);continue}if(g){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${g[1]}</h1>`);continue}const x=h.match(/^(\s*)[*-]\s+(.+)$/);if(x){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${x[2]}</li>`);continue}if(h.trim()===""){d&&(o.push("</ul>"),d=!1),o.push("");continue}d&&(o.push("</ul>"),d=!1),o.push(h)}return d&&o.push("</ul>"),o.join(`
53
- `)}function He(c){const u=Date.now(),f=typeof c=="string"?new Date(c).getTime():c,o=Math.max(0,Math.floor((u-f)/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 xg(c){if(!c)return"—";const u=Math.round(c/1e3);return u<60?u+"s":Math.floor(u/60)+"m "+u%60+"s"}function Xu(c){const u=c.split("-").filter(Boolean);return u.length>=2?(u[0][0]+u[1][0]).toUpperCase():(u[0]||c).slice(0,2).toUpperCase()}const um=["#8b5cf6","#06b6d4","#f97316","#34d399","#f43f5e","#fbbf24","#60a5fa","#e879f9"];function Ka(c){let u=0;for(let f=0;f<c.length;f++)u=u*31+c.charCodeAt(f)>>>0;return um[u%um.length]}function Bn({title:c,hint:u,compact:f=!1}){return a.jsxs("div",{className:`text-center ${f?"py-3":"py-6"}`,children:[a.jsx("div",{className:"font-mono text-xs text-muted-foreground",children:c}),u&&a.jsx("div",{className:"mt-1 font-mono text-[10px] text-muted-foreground/60",children:u})]})}function gg(c){return c==null||c<=0?"—":c<1e3?`${c}ms`:c<6e4?`${(c/1e3).toFixed(1)}s`:`${(c/6e4).toFixed(1)}m`}function ol({value:c,unit:u,label:f,valueClass:o,pulse:d,tooltip:h}){return a.jsxs("div",{className:"flex flex-col items-center py-4 px-3 text-center","data-tooltip":h,children:[a.jsxs("div",{className:"flex items-baseline gap-1",children:[d&&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-bold leading-none ${o}`,children:c}),u&&a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:u})]}),a.jsx("div",{className:"mt-1.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:f})]})}function Nm({overview:c,activeTasks:u,mode:f="dense",showActivity:o}){const d=c.relayCount+c.nativeCount,h=c.tasksCompleted+c.tasksFailed>0?Math.round(c.tasksCompleted/(c.tasksCompleted+c.tasksFailed)*100):null,y=c.totalFindings>0?Math.round(c.confirmedFindings/c.totalFindings*100):0,v=f==="calm",g=o??!v,x=v&&d===0;return a.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-primary/[0.03] px-3.5 py-3",children:[a.jsx("div",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-primary",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 shadow-[0_0_6px_rgba(52,211,153,0.5)]"}),"LIVE"]})]}),x?a.jsx(Bn,{title:"No agents registered yet",hint:"Run `gossip_setup` or see docs/ to get started."}):v?a.jsxs("div",{className:"grid grid-cols-3 border-b border-border",children:[a.jsx("div",{className:"border-r border-border",children:a.jsx(ol,{value:c.agentsOnline,label:"Agents Online",valueClass:c.agentsOnline>0?"text-primary":"text-foreground"})}),a.jsx("div",{className:"border-r border-border",children:a.jsx(ol,{value:u,label:"Active Tasks",valueClass:u>0?"text-unverified":"text-muted-foreground",pulse:u>0})}),a.jsx(ol,{value:`${y}%`,label:"Confirmed",valueClass:"text-confirmed"})]}):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:"font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground","data-tooltip":"Agents currently executing a task",children:"Dispatched"}),a.jsx("span",{className:`font-mono text-base font-bold leading-none ${c.agentsOnline>0?"text-primary":"text-foreground"}`,children:c.agentsOnline})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground","data-tooltip":"Relay agents with an active WebSocket connection",children:"Connected"}),a.jsx("span",{className:`font-mono text-base font-bold leading-none ${c.relayConnected>0?"text-confirmed":"text-muted-foreground"}`,children:c.relayConnected})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground","data-tooltip":"Total agents in gossipcat config",children:"Registered"}),a.jsx("span",{className:"font-mono text-base font-bold leading-none text-muted-foreground",children:d})]})]}),a.jsx(ol,{value:u,label:"Active Tasks",valueClass:u>0?"text-unverified":"text-muted-foreground",pulse:u>0}),a.jsx(ol,{value:c.consensusRuns,label:"Consensus",valueClass:"text-foreground"}),a.jsx(ol,{value:`${y}%`,label:"Confirmed",valueClass:"text-confirmed"})]}),a.jsx("a",{href:fl("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"block cursor-pointer border-t border-border transition-colors hover:bg-accent/30","aria-label":"View actionable findings on Signals page",children:a.jsx(ol,{value:c.actionableFindings,label:"Actionable",valueClass:c.actionableFindings>0?"text-orange-400":"text-confirmed",tooltip:"Findings still open and need operator review (disagreements + hallucinations + new findings)"})})]}),!v&&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",{className:"text-muted-foreground",children:"tasks completed"}),a.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:c.tasksCompleted})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{className:"text-muted-foreground",children:"signals total"}),a.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:c.totalSignals})]}),c.tasksFailed>0&&a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{className:"text-muted-foreground",children:"tasks failed"}),a.jsx("span",{className:"font-semibold text-destructive tabular-nums",children:c.tasksFailed})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{className:"text-muted-foreground",children:"avg duration"}),a.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:gg(c.avgDurationMs)})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{className:"text-muted-foreground",children:"success rate"}),a.jsx("span",{className:`font-semibold tabular-nums ${h===null?"text-muted-foreground":h>=95?"text-confirmed":h>=80?"text-unverified":"text-destructive"}`,children:h===null?"—":`${h}%`})]})]}),g&&a.jsx(pg,{hourly:c.hourlyActivity||[]}),c.lastConsensusTimestamp&&a.jsxs("div",{className:"border-t border-border px-3.5 py-2 font-mono text-[10px] text-muted-foreground/60",children:["last consensus ",He(c.lastConsensusTimestamp)]})]})}function pg({hourly:c}){const u=c.length===12?c:new Array(12).fill(0),f=Math.max(1,...u);return a.jsxs("div",{className:"border-t border-border bg-primary/[0.02] px-3.5 py-3",children:[a.jsx("div",{className:"mb-2 font-mono text-[9px] font-bold uppercase tracking-widest text-muted-foreground/60",children:"Activity Last 12h"}),a.jsx("div",{className:"flex h-6 items-end gap-0.5",children:u.map((o,d)=>{const h=11-d,y=o/f*100,v=d===11,g=h===0?"last hour":`${h}h ago`;return a.jsx("div",{className:`relative flex-1 cursor-pointer rounded-sm transition-opacity hover:opacity-100 ${o===0?"opacity-0":v?"bg-chart opacity-90":"bg-chart opacity-40"}`,style:{height:o===0?"0%":`${Math.max(8,y)}%`},"data-tooltip":`${g}
54
- ${o} task${o===1?"":"s"}`,"data-tooltip-pos":"bottom"},d)})}),a.jsxs("div",{className:"mt-1 flex justify-between font-mono text-[9px] text-muted-foreground/40",children:[a.jsx("span",{children:"12h ago"}),a.jsx("span",{children:"now"})]})]})}const $u="/dashboard/api";async function Qe(c,u){const f=await fetch(`${$u}/${c}`,{credentials:"include",...u});if(f.status===401)throw new Error("unauthorized");if(!f.ok)throw new Error(`API error: ${f.status}`);return f.json()}async function bg(c){return(await fetch(`${$u}/auth`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:c})})).ok}async function vg(){try{return(await fetch(`${$u}/overview`,{credentials:"include"})).ok}catch{return!1}}const yg=7200*1e3;function jg(c){const u=Date.now()-new Date(c).getTime();return u<0?"0s":u<6e4?`${Math.floor(u/1e3)}s`:u<36e5?`${Math.floor(u/6e4)}m ${Math.floor(u%6e4/1e3)}s`:`${Math.floor(u/36e5)}h ${Math.floor(u%36e5/6e4)}m`}function Sm({onCountChange:c}){const[u,f]=w.useState([]),[,o]=w.useState(0);w.useEffect(()=>{let v=!1;const g=async()=>{var _;try{const C=await Qe("active-tasks");v||(f(C.tasks||[]),c==null||c(((_=C.tasks)==null?void 0:_.length)||0))}catch{}};g();const x=setInterval(g,5e3);return()=>{v=!0,clearInterval(x)}},[c]),w.useEffect(()=>{if(u.length===0)return;const v=setInterval(()=>o(g=>g+1),1e3);return()=>clearInterval(v)},[u.length]);const d=Date.now(),h=u.filter(v=>d-new Date(v.startedAt).getTime()<yg),y=u.length-h.length;return h.length===0?y===0?null:a.jsx("div",{className:"rounded-lg border border-border bg-card/60 px-4 py-2.5",children:a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[y," stale task",y===1?"":"s"," — likely orphaned (>2h since last update)"]})}):a.jsxs("div",{className:"rounded-lg border border-border bg-card/60 px-4 py-2.5",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 shadow-[0_0_6px_rgba(52,211,153,0.5)]"}),a.jsx("span",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:"Live"}),a.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:[h.length," active"]}),y>0&&a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/50",children:["· ",y," stale"]})]}),a.jsx("div",{className:"max-h-40 space-y-1 overflow-y-auto",children:h.map(v=>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 text-foreground truncate",children:v.agentId}),a.jsx("span",{className:"min-w-0 truncate text-[11px] text-muted-foreground",children:v.task}),a.jsx("span",{className:"font-mono text-[11px] text-muted-foreground whitespace-nowrap tabular-nums",children:jg(v.startedAt)})]},v.taskId))})]})}function Ng(c){let u=0;for(let f=0;f<c.length;f++)u=(u<<5)-u+c.charCodeAt(f)|0;return Math.abs(u)}class Sg{constructor(u){Pe(this,"s");this.s=u}next(){return this.s=this.s*1103515245+12345&2147483647,this.s%1e4/1e4}range(u,f){return u+this.next()*(f-u)}}function ut(c,u){const f=parseInt(c.slice(1,3),16),o=parseInt(c.slice(3,5),16),d=parseInt(c.slice(5,7),16);return`rgba(${f},${o},${d},${Math.max(0,Math.min(1,u))})`}function _g(c){const u=Math.max(0,c);return Math.min(1.4,Math.pow(u/2e3,.55))}class Tg{constructor(u,f,o,d,h,y,v=.5){Pe(this,"ctx");Pe(this,"size");Pe(this,"accuracy");Pe(this,"uniqueness");Pe(this,"impact");Pe(this,"colorHex");Pe(this,"time",0);Pe(this,"variant");Pe(this,"scale");Pe(this,"exp");Pe(this,"particles",[]);Pe(this,"baseRotation");Pe(this,"armSeeds");Pe(this,"binaryCenters");Pe(this,"jetAxis");Pe(this,"tailAngle");const g=u.getContext("2d");if(!g)throw new Error("Canvas 2D context unavailable");this.ctx=g,this.size=u.width/2,this.accuracy=Math.max(0,Math.min(1,d)),this.uniqueness=Math.max(0,Math.min(1,h)),this.impact=Math.max(0,Math.min(1,v)),this.colorHex=y;const x=Ng(f);this.variant=x%12;const _=new Sg(x),C=_g(o);this.exp=C,this.scale=.2+C*.95;const U=Math.max(3,Math.round(4+C*180));this._buildVariant(_,U),this.baseRotation=_.next()*Math.PI*2}_buildVariant(u,f){const o=this.variant;if(o===0){this.armSeeds=[];for(let h=0;h<2;h++)this.armSeeds.push(u.next()*Math.PI*2);for(let h=0;h<f;h++){const y=h%2,v=u.next(),g=this.armSeeds[y]+v*Math.PI*2.4,x=u.range(-.04,.04)*Math.PI*2,_=g+x,C=(.08+v*.38)*this.size*this.scale;this.particles.push(this._mkParticle(u,C,_,1,1))}}else if(o===1)for(let d=0;d<f;d++){const h=u.range(.34,.42)*this.size*this.scale,y=u.next()*Math.PI*2;this.particles.push(this._mkParticle(u,h,y,1,1))}else if(o===2){const d=[.16,.28,.42];for(let h=0;h<f;h++){const y=h%3,v=(d[y]+u.range(-.015,.015))*this.size*this.scale,g=u.next()*Math.PI*2;this.particles.push(this._mkParticle(u,v,g,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 h=0;h<f;h++){const y=h%2,v=u.range(.04,.22)*this.size*this.scale,g=u.next()*Math.PI*2,x=this._mkParticle(u,v,g,1,1);x.binaryCore=y,x.angularVelocity*=y===0?1:-1,this.particles.push(x)}}else if(o===4)for(let d=0;d<f;d++){const h=u.range(.05,.32)*this.size*this.scale,y=u.next()*Math.PI*2,v=u.range(.7,1.3),g=u.range(.7,1.3),x=this._mkParticle(u,h,y,v,g);x.orbitTilt=u.range(0,Math.PI),this.particles.push(x)}else if(o===5){this.jetAxis=u.next()*Math.PI*2;const d=Math.floor(f*.7),h=f-d;for(let y=0;y<d;y++){const v=y%2===0?1:-1,g=u.next(),x=u.range(-.18,.18),_=this._mkParticle(u,g*.44*this.size*this.scale,0,1,1);_.jetSide=v,_.jetProgress=g,_.jetSpread=x,_.jetSpeed=u.range(.15,.35)*.001,_.size=u.range(.6,1.4),this.particles.push(_)}for(let y=0;y<h;y++){const v=u.range(.35,.42)*this.size*this.scale,g=u.next()*Math.PI*2,x=this._mkParticle(u,v,g,1,1);x.isDisk=!0,x.brightness*=.35,this.particles.push(x)}}else if(o===6)for(let d=0;d<f;d++){const h=u.next()*Math.PI*2,y=u.range(.05,.45)*this.size*this.scale,v=this._mkParticle(u,y,h,1,1);v.isNebula=!0,v.driftAngle=u.next()*Math.PI*2,v.driftSpeed=u.range(6e-4,.0014),v.driftPhase=u.next()*Math.PI*2,v.size=u.range(.8,2.2),v.brightness*=.6,this.particles.push(v)}else if(o===7){this.tailAngle=u.next()*Math.PI*2;const d=.1*this.size*this.scale,h=Math.floor(f*.3);for(let v=0;v<h;v++){const g=u.range(0,d),x=u.next()*Math.PI*2,_=this._mkParticle(u,g,x,1,1);_.size=u.range(.8,1.8),this.particles.push(_)}const y=f-h;for(let v=0;v<y;v++){const g=u.next(),x=d+g*.26*this.size*this.scale,_=(1-g*.5)*u.range(-.05,.05)*this.size*this.scale,C=this._mkParticle(u,0,0,1,1);C.isComet=!0,C.cometTailDist=x,C.cometPerp=_,C.cometT=g,C.brightness*=1-g*.6,C.size=(1-g*.5)*u.range(.6,1.2),this.particles.push(C)}}else if(o===8)for(let d=0;d<f;d++){const h=d%3,y=u.range(.3,.42)*this.size*this.scale,v=u.next()*Math.PI*2,g=this._mkParticle(u,y,v,1,1);g.gyroPlane=h,g.gyroAxis=h===0?"z":h===1?"x":"y",this.particles.push(g)}else if(o===9)for(let d=0;d<f;d++){const h=u.range(.06,.42)*this.size*this.scale,v=h/(.42*this.size*this.scale)*4*Math.PI+u.range(-.2,.2),g=this._mkParticle(u,h,v,1,1);g.isMaelstrom=!0,this.particles.push(g)}else if(o===10)for(let d=0;d<f;d++){const h=d/f,y=u.range(.35,.4)*this.size*this.scale,v=h*Math.PI*2+u.range(-.03,.03),g=this._mkParticle(u,y,v,1,1);g.ouroT=h,this.particles.push(g)}else for(let d=0;d<f;d++){const h=d%2,y=u.next(),v=this._mkParticle(u,0,0,1,1);v.isHelix=!0,v.helixStrand=h,v.helixT=y,v.helixSpeed=u.range(.3,.6)*.001,this.particles.push(v)}}_mkParticle(u,f,o,d,h){const y=8e-4+(.42*this.size-f)*4e-5,v=u.next()*Math.PI*2,g=u.range(.05,.3)*this.size;return{baseRadius:f,angle:o,angularVelocity:y*(u.next()>.5?1:.85),size:u.range(.5,1.8),brightness:u.range(.4,1),wobblePhase:u.next()*Math.PI*2,wobbleSpeed:u.range(.5,1.2),ellipX:d,ellipY:h,orbitTilt:0,binaryCore:0,chaosX:Math.cos(v)*g,chaosY:Math.sin(v)*g,chaosDriftPhase:u.next()*Math.PI*2,chaosDriftSpeed:u.range(3e-4,8e-4)}}update(u){this.time+=u}draw(){const{ctx:u,size:f,time:o,accuracy:d,uniqueness:h,impact:y,colorHex:v,variant:g}=this,x=f/2,_=f/2;u.clearRect(0,0,f,f);const C=.4+this.exp*.6,U=d*C,Q=h*C,F=y*C,I=.2+U*.8,X=.3+F*1.9,de=Q,Z=Math.min(1,Math.max(0,(this.exp-.15)*1.8)),$=1-Z,V=u.createRadialGradient(x,_,0,x,_,f*.45);if(V.addColorStop(0,ut(v,.05*I)),V.addColorStop(.4,ut(v,.015)),V.addColorStop(1,"transparent"),u.fillStyle=V,u.fillRect(0,0,f,f),g===0&&this.armSeeds){const O=o*5e-4*X;for(const ae of this.armSeeds){const G=ae+O;u.beginPath();for(let te=0;te<1;te+=.02){const ue=G+te*Math.PI*2.4,oe=(.08+te*.38)*f*this.scale,Se=x+Math.cos(ue)*oe,J=_+Math.sin(ue)*oe;te===0?u.moveTo(Se,J):u.lineTo(Se,J)}u.strokeStyle=ut(v,.12*I),u.lineWidth=1,u.stroke()}}for(const O of this.particles){const ae=Math.sin(o*O.wobbleSpeed*.001+O.wobblePhase)*1.2,G=O.baseRadius+ae,te=O.angle+o*O.angularVelocity*X;let ue,oe;if(g===3&&this.binaryCenters){const J=this.binaryCenters[O.binaryCore];ue=x+J.x+Math.cos(te)*G,oe=_+J.y+Math.sin(te)*G}else if(g===4){const J=Math.cos(O.orbitTilt),ie=Math.sin(O.orbitTilt),he=Math.cos(te)*G*O.ellipX,A=Math.sin(te)*G*O.ellipY;ue=x+he*J-A*ie,oe=_+he*ie+A*J}else if(g===5&&O.jetSide!==void 0&&!O.isDisk&&this.jetAxis!==void 0){const J=(O.jetProgress+o*O.jetSpeed*X)%1,ie=J*.44*f*this.scale,he=this.jetAxis+Math.PI/2;ue=x+Math.cos(this.jetAxis)*ie*O.jetSide+Math.cos(he)*O.jetSpread*ie,oe=_+Math.sin(this.jetAxis)*ie*O.jetSide+Math.sin(he)*O.jetSpread*ie,O._fadeMul=Math.sin(J*Math.PI)*.9+.1}else if(g===6&&O.isNebula){const J=o*O.driftSpeed*X,ie=Math.sin(J+O.driftPhase)*2;ue=x+Math.cos(O.angle+J*.3)*G+Math.cos(O.driftAngle)*ie,oe=_+Math.sin(O.angle+J*.3)*G+Math.sin(O.driftAngle)*ie}else if(g===7&&O.isComet&&this.tailAngle!==void 0){const J=(O.cometT+o*3e-4*X)%1,ie=O.cometTailDist+J*.06*f*this.scale,he=this.tailAngle+Math.PI/2;ue=x+Math.cos(this.tailAngle)*ie+Math.cos(he)*O.cometPerp,oe=_+Math.sin(this.tailAngle)*ie+Math.sin(he)*O.cometPerp}else if(g===8&&O.gyroAxis){const J=o*1e-4*X;O.gyroAxis==="z"?(ue=x+Math.cos(te)*G,oe=_+Math.sin(te)*G*.3):O.gyroAxis==="x"?(ue=x+Math.cos(te)*G*.3+Math.sin(J)*G*.1,oe=_+Math.sin(te)*G):(ue=x+Math.sin(te+J)*G*.6,oe=_+Math.cos(te+J)*G*.8)}else if(g===9){const J=(o*5e-4*X+O.wobblePhase)%1,ie=G*(1-J*.85);ue=x+Math.cos(te)*ie,oe=_+Math.sin(te)*ie,O._fadeMul=1-J}else if(g===10&&O.ouroT!==void 0){const J=(O.ouroT+o*3e-4*X)%1,ie=J*Math.PI*2;ue=x+Math.cos(ie)*G,oe=_+Math.sin(ie)*G;const he=Math.cos(J*Math.PI*2)*.5+.5;O._fadeMul=.3+he*.9}else if(g===11&&O.helixT!==void 0){const J=(O.helixT+o*O.helixSpeed*X)%1,ie=(J-.5)*.65*f*this.scale,he=O.helixStrand===0?0:Math.PI,A=.15*f*this.scale,S=Math.sin(J*Math.PI*3+he)*A;ue=x+S,oe=_+ie,O._fadeMul=.4+(Math.cos(J*Math.PI*3+he)+1)/2*.6}else ue=x+Math.cos(te)*G*O.ellipX,oe=_+Math.sin(te)*G*O.ellipY;if($>.01){const J=o*O.chaosDriftSpeed,ie=Math.cos(J+O.chaosDriftPhase)*2,he=Math.sin(J*1.13+O.chaosDriftPhase)*2,A=x+O.chaosX+ie,S=_+O.chaosY+he;ue=A*$+ue*Z,oe=S*$+oe*Z}const Se=O._fadeMul!==void 0?O._fadeMul:1;if(g<=4&&Z>.5){const J=2+Math.floor(y*3);for(let ie=0;ie<J;ie++){const he=O.angularVelocity*X*(ie+1)*80,A=te-he;let S,H;if(g===3&&this.binaryCenters){const R=this.binaryCenters[O.binaryCore];S=x+R.x+Math.cos(A)*G,H=_+R.y+Math.sin(A)*G}else if(g===4){const R=Math.cos(O.orbitTilt),W=Math.sin(O.orbitTilt),p=Math.cos(A)*G*O.ellipX,D=Math.sin(A)*G*O.ellipY;S=x+p*R-D*W,H=_+p*W+D*R}else S=x+Math.cos(A)*G*O.ellipX,H=_+Math.sin(A)*G*O.ellipY;const K=(1-ie/J)*.3*O.brightness*I*Z;u.beginPath(),u.arc(S,H,O.size*(1-ie*.25),0,Math.PI*2),u.fillStyle=ut(v,K),u.fill()}}else if(g===6&&O.isNebula){const J=O.size*3,ie=u.createRadialGradient(ue,oe,0,ue,oe,J);ie.addColorStop(0,ut(v,O.brightness*I*.4)),ie.addColorStop(1,"transparent"),u.fillStyle=ie,u.beginPath(),u.arc(ue,oe,J,0,Math.PI*2),u.fill()}u.beginPath(),u.arc(ue,oe,O.size,0,Math.PI*2),u.fillStyle=ut(v,O.brightness*I*Se),u.fill()}if(de>.05)for(let ae=0;ae<3;ae++){const G=(o*7e-4*de+ae*.33)%1;if(G>.5)continue;const te=(ae*1.618*Math.PI+o*1e-4)%(Math.PI*2),ue=f*.5*(1-G*1.6);if(ue<3)continue;const oe=x+Math.cos(te)*ue,Se=_+Math.sin(te)*ue,J=G<.2?G/.2:1-(G-.2)/.3,ie=5+(1-G)*4,he=u.createRadialGradient(oe,Se,0,oe,Se,ie);he.addColorStop(0,ut("#ffffff",J*.95)),he.addColorStop(.3,ut(v,J*.7)),he.addColorStop(1,"transparent"),u.fillStyle=he,u.beginPath(),u.arc(oe,Se,ie,0,Math.PI*2),u.fill()}if(g!==3){const O=.9+.1*Math.sin(o*.003),ae=(1+this.exp*9+d*2)*this.scale,G=Math.min(ae*(3+y*2),f*.4),te=u.createRadialGradient(x,_,0,x,_,G);te.addColorStop(0,ut("#ffffff",.95*O*I)),te.addColorStop(.2,ut(v,.75*O*I)),te.addColorStop(.5,ut(v,.2*I)),te.addColorStop(1,"transparent"),u.fillStyle=te,u.beginPath(),u.arc(x,_,G,0,Math.PI*2),u.fill(),u.beginPath(),u.arc(x,_,ae*O,0,Math.PI*2),u.fillStyle=ut("#ffffff",.95),u.fill()}else if(this.binaryCenters)for(const O of this.binaryCenters){const ae=x+O.x,G=_+O.y,te=(.8+this.exp*5+d*1.5)*this.scale,ue=Math.min(te*3.5,f*.22),oe=u.createRadialGradient(ae,G,0,ae,G,ue);oe.addColorStop(0,ut("#ffffff",.9*I)),oe.addColorStop(.3,ut(v,.6*I)),oe.addColorStop(1,"transparent"),u.fillStyle=oe,u.beginPath(),u.arc(ae,G,ue,0,Math.PI*2),u.fill(),u.beginPath(),u.arc(ae,G,te,0,Math.PI*2),u.fillStyle=ut("#ffffff",.9),u.fill()}}}function Ku({agentId:c,size:u=64,signals:f=0,accuracy:o=.5,uniqueness:d=.5,impact:h=.5}){const y=w.useRef(null),v=w.useRef(null),g=w.useRef(0),x=w.useRef(!0);return w.useEffect(()=>{const _=y.current;if(!_)return;_.width=u*2,_.height=u*2;const C=_.getContext("2d");if(!C)return;C.scale(2,2);const U=Ka(c),Q=new Tg(_,c,f,o,d,U,h);v.current=Q,Q.draw();const F=()=>{x.current&&(Q.update(16),Q.draw()),g.current=requestAnimationFrame(F)};return g.current=requestAnimationFrame(F),()=>{cancelAnimationFrame(g.current),v.current=null}},[c,u,f,o,d,h]),w.useEffect(()=>{const _=y.current;if(!_)return;const C=new IntersectionObserver(([U])=>{x.current=U.isIntersecting},{threshold:.1});return C.observe(_),()=>C.disconnect()},[]),a.jsx("canvas",{ref:y,"aria-hidden":"true",className:"shrink-0",style:{width:u,height:u,borderRadius:"50%"}})}function Ju(c){var u,f;return((u=c.bench)==null?void 0:u.state)==="benched"?"benched":c.circuitOpen?"struggling":((f=c.bench)==null?void 0:f.state)==="kept-for-coverage"?"kept-for-coverage":null}function _m(c){var u;return((u=c.scores.bench)==null?void 0:u.state)==="benched"||c.scores.circuitOpen}function fs(c){return`${Math.round(c*100)}%`}function Eg(c){return c>=1.2?"good":c>=.8?"mid":"low"}function Ag(c){return c>=.7?"good":c>=.4?"mid":"low"}function Mg({agent:c}){var v;const u=c.scores,f=(v=c.lastTask)!=null&&v.timestamp?He(c.lastTask.timestamp):"",o=Eg(u.dispatchWeight),d=o==="good"?"text-confirmed":o==="low"?"text-disputed":"text-foreground",h=Ag(u.accuracy),y=h==="good"?"bg-confirmed":h==="mid"?"bg-unverified":"bg-disputed";return a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(c.id)}`,className:"group relative block rounded-lg border border-border bg-card p-3 transition-all hover:-translate-y-0.5 hover:border-primary/30 hover:bg-card/90",children:[a.jsxs("div",{className:"mb-2.5 flex items-center gap-2.5",children:[a.jsx("div",{className:"relative shrink-0",children:a.jsx(Ku,{agentId:c.id,size:48,animate:c.online,signals:u.signals,accuracy:u.accuracy,uniqueness:u.uniqueness,impact:u.impactScore})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-foreground",children:c.id}),(()=>{const g=Ju(u);return g==="benched"?a.jsx("span",{className:"shrink-0 rounded-sm bg-destructive/10 px-1 py-0.5 font-mono text-[8px] font-bold text-destructive","data-tooltip":`Benched (${u.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"BENCHED"}):g==="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","data-tooltip":"Struggling: consecutive failures tripped the circuit breaker.",children:"STRUGGLING"}):g==="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","data-tooltip":`Would bench (${u.bench.reason??"rule"}), but kept as sole provider of a category.`,children:"KEPT FOR COVERAGE"}):null})()]}),a.jsxs("div",{className:"mt-1 flex items-center gap-2 font-inter text-[10px] text-muted-foreground/60",children:[a.jsxs("span",{className:`rounded-sm border border-border/60 bg-background/60 px-1.5 py-0.5 font-bold tabular-nums ${d}`,"data-tooltip":`Dispatch weight ${u.dispatchWeight.toFixed(2)}
55
- Scale 0.3 → 2.0`,"data-tooltip-pos":"bottom",children:[u.dispatchWeight.toFixed(2)," wt"]}),a.jsxs("span",{className:"truncate",children:[u.signals," signals",f?` · ${f}`:""]})]})]})]}),a.jsxs("div",{className:"space-y-1.5 rounded-lg border border-border/30 bg-background/40 px-2.5 py-2",children:[a.jsx(ms,{label:"accuracy",value:u.accuracy,fillClass:y,tooltip:`Accuracy ${fs(u.accuracy)}
52
+ `),o=[];let d=!1;for(const h of f){const v=h.match(/^###\s+(.+)$/),y=h.match(/^##\s+(.+)$/),g=h.match(/^#\s+(.+)$/);if(v){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${v[1]}</h3>`);continue}if(y){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${y[1]}</h2>`);continue}if(g){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${g[1]}</h1>`);continue}const x=h.match(/^(\s*)[*-]\s+(.+)$/);if(x){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${x[2]}</li>`);continue}if(h.trim()===""){d&&(o.push("</ul>"),d=!1),o.push("");continue}d&&(o.push("</ul>"),d=!1),o.push(h)}return d&&o.push("</ul>"),o.join(`
53
+ `)}function He(c){const u=Date.now(),f=typeof c=="string"?new Date(c).getTime():c,o=Math.max(0,Math.floor((u-f)/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 xg(c){if(!c)return"—";const u=Math.round(c/1e3);return u<60?u+"s":Math.floor(u/60)+"m "+u%60+"s"}function Xu(c){const u=c.split("-").filter(Boolean);return u.length>=2?(u[0][0]+u[1][0]).toUpperCase():(u[0]||c).slice(0,2).toUpperCase()}const um=["#8b5cf6","#06b6d4","#f97316","#34d399","#f43f5e","#fbbf24","#60a5fa","#e879f9"];function Ka(c){let u=0;for(let f=0;f<c.length;f++)u=u*31+c.charCodeAt(f)>>>0;return um[u%um.length]}function Ln({title:c,hint:u,compact:f=!1}){return a.jsxs("div",{className:`text-center ${f?"py-3":"py-6"}`,children:[a.jsx("div",{className:"font-mono text-xs text-muted-foreground",children:c}),u&&a.jsx("div",{className:"mt-1 font-mono text-[10px] text-muted-foreground/60",children:u})]})}function gg(c){return c==null||c<=0?"—":c<1e3?`${c}ms`:c<6e4?`${(c/1e3).toFixed(1)}s`:`${(c/6e4).toFixed(1)}m`}function dl({value:c,unit:u,label:f,valueClass:o,pulse:d,tooltip:h}){return a.jsxs("div",{className:"flex flex-col items-center py-4 px-3 text-center","data-tooltip":h,children:[a.jsxs("div",{className:"flex items-baseline gap-1",children:[d&&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-bold leading-none ${o}`,children:c}),u&&a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:u})]}),a.jsx("div",{className:"mt-1.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:f})]})}function Nm({overview:c,activeTasks:u,mode:f="dense",showActivity:o}){const d=c.relayCount+c.nativeCount,h=c.tasksCompleted+c.tasksFailed>0?Math.round(c.tasksCompleted/(c.tasksCompleted+c.tasksFailed)*100):null,v=c.totalFindings>0?Math.round(c.confirmedFindings/c.totalFindings*100):0,y=f==="calm",g=o??!y,x=y&&d===0;return a.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-primary/[0.03] px-3.5 py-3",children:[a.jsx("div",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-primary",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 shadow-[0_0_6px_rgba(52,211,153,0.5)]"}),"LIVE"]})]}),x?a.jsx(Ln,{title:"No agents registered yet",hint:"Run `gossip_setup` or see docs/ to get started."}):y?a.jsxs("div",{className:"grid grid-cols-3 border-b border-border",children:[a.jsx("div",{className:"border-r border-border",children:a.jsx(dl,{value:c.agentsOnline,label:"Agents Online",valueClass:c.agentsOnline>0?"text-primary":"text-foreground"})}),a.jsx("div",{className:"border-r border-border",children:a.jsx(dl,{value:u,label:"Active Tasks",valueClass:u>0?"text-unverified":"text-muted-foreground",pulse:u>0})}),a.jsx(dl,{value:`${v}%`,label:"Confirmed",valueClass:v>=50?"text-confirmed":v>0?"text-unverified":"text-muted-foreground"})]}):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:"font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground","data-tooltip":"Agents currently executing a task",children:"Dispatched"}),a.jsx("span",{className:`font-mono text-base font-bold leading-none ${c.agentsOnline>0?"text-primary":"text-foreground"}`,children:c.agentsOnline})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground","data-tooltip":"Relay agents with an active WebSocket connection",children:"Connected"}),a.jsx("span",{className:`font-mono text-base font-bold leading-none ${c.relayConnected>0?"text-confirmed":"text-muted-foreground"}`,children:c.relayConnected})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground","data-tooltip":"Total agents in gossipcat config",children:"Registered"}),a.jsx("span",{className:"font-mono text-base font-bold leading-none text-muted-foreground",children:d})]})]}),a.jsx(dl,{value:u,label:"Active Tasks",valueClass:u>0?"text-unverified":"text-muted-foreground",pulse:u>0}),a.jsx(dl,{value:c.consensusRuns,label:"Consensus",valueClass:"text-foreground"}),a.jsx(dl,{value:`${v}%`,label:"Confirmed",valueClass:"text-confirmed"})]}),a.jsx("a",{href:Bn("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"block cursor-pointer border-t border-border transition-colors hover:bg-accent/30","aria-label":"View actionable findings on Signals page",children:a.jsx(dl,{value:c.actionableFindings,label:"Actionable",valueClass:c.actionableFindings>0?"text-orange-400":"text-confirmed",tooltip:"Findings still open and need operator review (disagreements + hallucinations + new findings)"})})]}),!y&&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",{className:"text-muted-foreground",children:"tasks completed"}),a.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:c.tasksCompleted})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{className:"text-muted-foreground",children:"signals total"}),a.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:c.totalSignals})]}),c.tasksFailed>0&&a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{className:"text-muted-foreground",children:"tasks failed"}),a.jsx("span",{className:"font-semibold text-destructive tabular-nums",children:c.tasksFailed})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{className:"text-muted-foreground",children:"avg duration"}),a.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:gg(c.avgDurationMs)})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{className:"text-muted-foreground",children:"success rate"}),a.jsx("span",{className:`font-semibold tabular-nums ${h===null?"text-muted-foreground":h>=95?"text-confirmed":h>=80?"text-unverified":"text-destructive"}`,children:h===null?"—":`${h}%`})]})]}),g&&a.jsx(pg,{hourly:c.hourlyActivity||[]}),c.lastConsensusTimestamp&&a.jsxs("div",{className:"border-t border-border px-3.5 py-2 font-mono text-[10px] text-muted-foreground/60",children:["last consensus ",He(c.lastConsensusTimestamp)]})]})}function pg({hourly:c}){const u=c.length===12?c:new Array(12).fill(0),f=Math.max(1,...u);return a.jsxs("div",{className:"border-t border-border bg-primary/[0.02] px-3.5 py-3",children:[a.jsx("div",{className:"mb-2 font-mono text-[9px] font-bold uppercase tracking-widest text-muted-foreground/60",children:"Activity Last 12h"}),a.jsx("div",{className:"flex h-6 items-end gap-0.5",children:u.map((o,d)=>{const h=11-d,v=o/f*100,y=d===11,g=h===0?"last hour":`${h}h ago`;return a.jsx("div",{className:`relative flex-1 cursor-pointer rounded-sm transition-opacity hover:opacity-100 ${o===0?"opacity-0":y?"bg-chart opacity-90":"bg-chart opacity-40"}`,style:{height:o===0?"0%":`${Math.max(8,v)}%`},"data-tooltip":`${g}
54
+ ${o} task${o===1?"":"s"}`,"data-tooltip-pos":"bottom"},d)})}),a.jsxs("div",{className:"mt-1 flex justify-between font-mono text-[9px] text-muted-foreground/40",children:[a.jsx("span",{children:"12h ago"}),a.jsx("span",{children:"now"})]})]})}const $u="/dashboard/api";async function Qe(c,u){const f=await fetch(`${$u}/${c}`,{credentials:"include",...u});if(f.status===401)throw new Error("unauthorized");if(!f.ok)throw new Error(`API error: ${f.status}`);return f.json()}async function bg(c){return(await fetch(`${$u}/auth`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:c})})).ok}async function vg(){try{return(await fetch(`${$u}/overview`,{credentials:"include"})).ok}catch{return!1}}const yg=7200*1e3;function jg(c){const u=Date.now()-new Date(c).getTime();return u<0?"0s":u<6e4?`${Math.floor(u/1e3)}s`:u<36e5?`${Math.floor(u/6e4)}m ${Math.floor(u%6e4/1e3)}s`:`${Math.floor(u/36e5)}h ${Math.floor(u%36e5/6e4)}m`}function Sm({onCountChange:c}){const[u,f]=w.useState([]),[,o]=w.useState(0);w.useEffect(()=>{let y=!1;const g=async()=>{var _;try{const C=await Qe("active-tasks");y||(f(C.tasks||[]),c==null||c(((_=C.tasks)==null?void 0:_.length)||0))}catch{}};g();const x=setInterval(g,5e3);return()=>{y=!0,clearInterval(x)}},[c]),w.useEffect(()=>{if(u.length===0)return;const y=setInterval(()=>o(g=>g+1),1e3);return()=>clearInterval(y)},[u.length]);const d=Date.now(),h=u.filter(y=>d-new Date(y.startedAt).getTime()<yg),v=u.length-h.length;return h.length===0?v===0?null:a.jsx("div",{className:"rounded-lg border border-border bg-card/60 px-4 py-2.5",children:a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[v," stale task",v===1?"":"s"," — likely orphaned (>2h since last update)"]})}):a.jsxs("div",{className:"rounded-lg border border-border bg-card/60 px-4 py-2.5",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 shadow-[0_0_6px_rgba(52,211,153,0.5)]"}),a.jsx("span",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:"Live"}),a.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:[h.length," active"]}),v>0&&a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/50",children:["· ",v," stale"]})]}),a.jsx("div",{className:"max-h-40 space-y-1 overflow-y-auto",children:h.map(y=>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 text-foreground truncate",children:y.agentId}),a.jsx("span",{className:"min-w-0 truncate text-[11px] text-muted-foreground",children:y.task}),a.jsx("span",{className:"font-mono text-[11px] text-muted-foreground whitespace-nowrap tabular-nums",children:jg(y.startedAt)})]},y.taskId))})]})}function Ng(c){let u=0;for(let f=0;f<c.length;f++)u=(u<<5)-u+c.charCodeAt(f)|0;return Math.abs(u)}class Sg{constructor(u){Pe(this,"s");this.s=u}next(){return this.s=this.s*1103515245+12345&2147483647,this.s%1e4/1e4}range(u,f){return u+this.next()*(f-u)}}function ut(c,u){const f=parseInt(c.slice(1,3),16),o=parseInt(c.slice(3,5),16),d=parseInt(c.slice(5,7),16);return`rgba(${f},${o},${d},${Math.max(0,Math.min(1,u))})`}function _g(c){const u=Math.max(0,c);return Math.min(1.4,Math.pow(u/2e3,.55))}class Tg{constructor(u,f,o,d,h,v,y=.5){Pe(this,"ctx");Pe(this,"size");Pe(this,"accuracy");Pe(this,"uniqueness");Pe(this,"impact");Pe(this,"colorHex");Pe(this,"time",0);Pe(this,"variant");Pe(this,"scale");Pe(this,"exp");Pe(this,"particles",[]);Pe(this,"baseRotation");Pe(this,"armSeeds");Pe(this,"binaryCenters");Pe(this,"jetAxis");Pe(this,"tailAngle");const g=u.getContext("2d");if(!g)throw new Error("Canvas 2D context unavailable");this.ctx=g,this.size=u.width/2,this.accuracy=Math.max(0,Math.min(1,d)),this.uniqueness=Math.max(0,Math.min(1,h)),this.impact=Math.max(0,Math.min(1,y)),this.colorHex=v;const x=Ng(f);this.variant=x%12;const _=new Sg(x),C=_g(o);this.exp=C,this.scale=.2+C*.95;const U=Math.max(3,Math.round(4+C*180));this._buildVariant(_,U),this.baseRotation=_.next()*Math.PI*2}_buildVariant(u,f){const o=this.variant;if(o===0){this.armSeeds=[];for(let h=0;h<2;h++)this.armSeeds.push(u.next()*Math.PI*2);for(let h=0;h<f;h++){const v=h%2,y=u.next(),g=this.armSeeds[v]+y*Math.PI*2.4,x=u.range(-.04,.04)*Math.PI*2,_=g+x,C=(.08+y*.38)*this.size*this.scale;this.particles.push(this._mkParticle(u,C,_,1,1))}}else if(o===1)for(let d=0;d<f;d++){const h=u.range(.34,.42)*this.size*this.scale,v=u.next()*Math.PI*2;this.particles.push(this._mkParticle(u,h,v,1,1))}else if(o===2){const d=[.16,.28,.42];for(let h=0;h<f;h++){const v=h%3,y=(d[v]+u.range(-.015,.015))*this.size*this.scale,g=u.next()*Math.PI*2;this.particles.push(this._mkParticle(u,y,g,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 h=0;h<f;h++){const v=h%2,y=u.range(.04,.22)*this.size*this.scale,g=u.next()*Math.PI*2,x=this._mkParticle(u,y,g,1,1);x.binaryCore=v,x.angularVelocity*=v===0?1:-1,this.particles.push(x)}}else if(o===4)for(let d=0;d<f;d++){const h=u.range(.05,.32)*this.size*this.scale,v=u.next()*Math.PI*2,y=u.range(.7,1.3),g=u.range(.7,1.3),x=this._mkParticle(u,h,v,y,g);x.orbitTilt=u.range(0,Math.PI),this.particles.push(x)}else if(o===5){this.jetAxis=u.next()*Math.PI*2;const d=Math.floor(f*.7),h=f-d;for(let v=0;v<d;v++){const y=v%2===0?1:-1,g=u.next(),x=u.range(-.18,.18),_=this._mkParticle(u,g*.44*this.size*this.scale,0,1,1);_.jetSide=y,_.jetProgress=g,_.jetSpread=x,_.jetSpeed=u.range(.15,.35)*.001,_.size=u.range(.6,1.4),this.particles.push(_)}for(let v=0;v<h;v++){const y=u.range(.35,.42)*this.size*this.scale,g=u.next()*Math.PI*2,x=this._mkParticle(u,y,g,1,1);x.isDisk=!0,x.brightness*=.35,this.particles.push(x)}}else if(o===6)for(let d=0;d<f;d++){const h=u.next()*Math.PI*2,v=u.range(.05,.45)*this.size*this.scale,y=this._mkParticle(u,v,h,1,1);y.isNebula=!0,y.driftAngle=u.next()*Math.PI*2,y.driftSpeed=u.range(6e-4,.0014),y.driftPhase=u.next()*Math.PI*2,y.size=u.range(.8,2.2),y.brightness*=.6,this.particles.push(y)}else if(o===7){this.tailAngle=u.next()*Math.PI*2;const d=.1*this.size*this.scale,h=Math.floor(f*.3);for(let y=0;y<h;y++){const g=u.range(0,d),x=u.next()*Math.PI*2,_=this._mkParticle(u,g,x,1,1);_.size=u.range(.8,1.8),this.particles.push(_)}const v=f-h;for(let y=0;y<v;y++){const g=u.next(),x=d+g*.26*this.size*this.scale,_=(1-g*.5)*u.range(-.05,.05)*this.size*this.scale,C=this._mkParticle(u,0,0,1,1);C.isComet=!0,C.cometTailDist=x,C.cometPerp=_,C.cometT=g,C.brightness*=1-g*.6,C.size=(1-g*.5)*u.range(.6,1.2),this.particles.push(C)}}else if(o===8)for(let d=0;d<f;d++){const h=d%3,v=u.range(.3,.42)*this.size*this.scale,y=u.next()*Math.PI*2,g=this._mkParticle(u,v,y,1,1);g.gyroPlane=h,g.gyroAxis=h===0?"z":h===1?"x":"y",this.particles.push(g)}else if(o===9)for(let d=0;d<f;d++){const h=u.range(.06,.42)*this.size*this.scale,y=h/(.42*this.size*this.scale)*4*Math.PI+u.range(-.2,.2),g=this._mkParticle(u,h,y,1,1);g.isMaelstrom=!0,this.particles.push(g)}else if(o===10)for(let d=0;d<f;d++){const h=d/f,v=u.range(.35,.4)*this.size*this.scale,y=h*Math.PI*2+u.range(-.03,.03),g=this._mkParticle(u,v,y,1,1);g.ouroT=h,this.particles.push(g)}else for(let d=0;d<f;d++){const h=d%2,v=u.next(),y=this._mkParticle(u,0,0,1,1);y.isHelix=!0,y.helixStrand=h,y.helixT=v,y.helixSpeed=u.range(.3,.6)*.001,this.particles.push(y)}}_mkParticle(u,f,o,d,h){const v=8e-4+(.42*this.size-f)*4e-5,y=u.next()*Math.PI*2,g=u.range(.05,.3)*this.size;return{baseRadius:f,angle:o,angularVelocity:v*(u.next()>.5?1:.85),size:u.range(.5,1.8),brightness:u.range(.4,1),wobblePhase:u.next()*Math.PI*2,wobbleSpeed:u.range(.5,1.2),ellipX:d,ellipY:h,orbitTilt:0,binaryCore:0,chaosX:Math.cos(y)*g,chaosY:Math.sin(y)*g,chaosDriftPhase:u.next()*Math.PI*2,chaosDriftSpeed:u.range(3e-4,8e-4)}}update(u){this.time+=u}draw(){const{ctx:u,size:f,time:o,accuracy:d,uniqueness:h,impact:v,colorHex:y,variant:g}=this,x=f/2,_=f/2;u.clearRect(0,0,f,f);const C=.4+this.exp*.6,U=d*C,V=h*C,F=v*C,I=.2+U*.8,X=.3+F*1.9,de=V,Z=Math.min(1,Math.max(0,(this.exp-.15)*1.8)),$=1-Z,Q=u.createRadialGradient(x,_,0,x,_,f*.45);if(Q.addColorStop(0,ut(y,.05*I)),Q.addColorStop(.4,ut(y,.015)),Q.addColorStop(1,"transparent"),u.fillStyle=Q,u.fillRect(0,0,f,f),g===0&&this.armSeeds){const D=o*5e-4*X;for(const ae of this.armSeeds){const G=ae+D;u.beginPath();for(let te=0;te<1;te+=.02){const ue=G+te*Math.PI*2.4,oe=(.08+te*.38)*f*this.scale,Se=x+Math.cos(ue)*oe,J=_+Math.sin(ue)*oe;te===0?u.moveTo(Se,J):u.lineTo(Se,J)}u.strokeStyle=ut(y,.12*I),u.lineWidth=1,u.stroke()}}for(const D of this.particles){const ae=Math.sin(o*D.wobbleSpeed*.001+D.wobblePhase)*1.2,G=D.baseRadius+ae,te=D.angle+o*D.angularVelocity*X;let ue,oe;if(g===3&&this.binaryCenters){const J=this.binaryCenters[D.binaryCore];ue=x+J.x+Math.cos(te)*G,oe=_+J.y+Math.sin(te)*G}else if(g===4){const J=Math.cos(D.orbitTilt),ie=Math.sin(D.orbitTilt),he=Math.cos(te)*G*D.ellipX,A=Math.sin(te)*G*D.ellipY;ue=x+he*J-A*ie,oe=_+he*ie+A*J}else if(g===5&&D.jetSide!==void 0&&!D.isDisk&&this.jetAxis!==void 0){const J=(D.jetProgress+o*D.jetSpeed*X)%1,ie=J*.44*f*this.scale,he=this.jetAxis+Math.PI/2;ue=x+Math.cos(this.jetAxis)*ie*D.jetSide+Math.cos(he)*D.jetSpread*ie,oe=_+Math.sin(this.jetAxis)*ie*D.jetSide+Math.sin(he)*D.jetSpread*ie,D._fadeMul=Math.sin(J*Math.PI)*.9+.1}else if(g===6&&D.isNebula){const J=o*D.driftSpeed*X,ie=Math.sin(J+D.driftPhase)*2;ue=x+Math.cos(D.angle+J*.3)*G+Math.cos(D.driftAngle)*ie,oe=_+Math.sin(D.angle+J*.3)*G+Math.sin(D.driftAngle)*ie}else if(g===7&&D.isComet&&this.tailAngle!==void 0){const J=(D.cometT+o*3e-4*X)%1,ie=D.cometTailDist+J*.06*f*this.scale,he=this.tailAngle+Math.PI/2;ue=x+Math.cos(this.tailAngle)*ie+Math.cos(he)*D.cometPerp,oe=_+Math.sin(this.tailAngle)*ie+Math.sin(he)*D.cometPerp}else if(g===8&&D.gyroAxis){const J=o*1e-4*X;D.gyroAxis==="z"?(ue=x+Math.cos(te)*G,oe=_+Math.sin(te)*G*.3):D.gyroAxis==="x"?(ue=x+Math.cos(te)*G*.3+Math.sin(J)*G*.1,oe=_+Math.sin(te)*G):(ue=x+Math.sin(te+J)*G*.6,oe=_+Math.cos(te+J)*G*.8)}else if(g===9){const J=(o*5e-4*X+D.wobblePhase)%1,ie=G*(1-J*.85);ue=x+Math.cos(te)*ie,oe=_+Math.sin(te)*ie,D._fadeMul=1-J}else if(g===10&&D.ouroT!==void 0){const J=(D.ouroT+o*3e-4*X)%1,ie=J*Math.PI*2;ue=x+Math.cos(ie)*G,oe=_+Math.sin(ie)*G;const he=Math.cos(J*Math.PI*2)*.5+.5;D._fadeMul=.3+he*.9}else if(g===11&&D.helixT!==void 0){const J=(D.helixT+o*D.helixSpeed*X)%1,ie=(J-.5)*.65*f*this.scale,he=D.helixStrand===0?0:Math.PI,A=.15*f*this.scale,S=Math.sin(J*Math.PI*3+he)*A;ue=x+S,oe=_+ie,D._fadeMul=.4+(Math.cos(J*Math.PI*3+he)+1)/2*.6}else ue=x+Math.cos(te)*G*D.ellipX,oe=_+Math.sin(te)*G*D.ellipY;if($>.01){const J=o*D.chaosDriftSpeed,ie=Math.cos(J+D.chaosDriftPhase)*2,he=Math.sin(J*1.13+D.chaosDriftPhase)*2,A=x+D.chaosX+ie,S=_+D.chaosY+he;ue=A*$+ue*Z,oe=S*$+oe*Z}const Se=D._fadeMul!==void 0?D._fadeMul:1;if(g<=4&&Z>.5){const J=2+Math.floor(v*3);for(let ie=0;ie<J;ie++){const he=D.angularVelocity*X*(ie+1)*80,A=te-he;let S,H;if(g===3&&this.binaryCenters){const R=this.binaryCenters[D.binaryCore];S=x+R.x+Math.cos(A)*G,H=_+R.y+Math.sin(A)*G}else if(g===4){const R=Math.cos(D.orbitTilt),W=Math.sin(D.orbitTilt),p=Math.cos(A)*G*D.ellipX,O=Math.sin(A)*G*D.ellipY;S=x+p*R-O*W,H=_+p*W+O*R}else S=x+Math.cos(A)*G*D.ellipX,H=_+Math.sin(A)*G*D.ellipY;const K=(1-ie/J)*.3*D.brightness*I*Z;u.beginPath(),u.arc(S,H,D.size*(1-ie*.25),0,Math.PI*2),u.fillStyle=ut(y,K),u.fill()}}else if(g===6&&D.isNebula){const J=D.size*3,ie=u.createRadialGradient(ue,oe,0,ue,oe,J);ie.addColorStop(0,ut(y,D.brightness*I*.4)),ie.addColorStop(1,"transparent"),u.fillStyle=ie,u.beginPath(),u.arc(ue,oe,J,0,Math.PI*2),u.fill()}u.beginPath(),u.arc(ue,oe,D.size,0,Math.PI*2),u.fillStyle=ut(y,D.brightness*I*Se),u.fill()}if(de>.05)for(let ae=0;ae<3;ae++){const G=(o*7e-4*de+ae*.33)%1;if(G>.5)continue;const te=(ae*1.618*Math.PI+o*1e-4)%(Math.PI*2),ue=f*.5*(1-G*1.6);if(ue<3)continue;const oe=x+Math.cos(te)*ue,Se=_+Math.sin(te)*ue,J=G<.2?G/.2:1-(G-.2)/.3,ie=5+(1-G)*4,he=u.createRadialGradient(oe,Se,0,oe,Se,ie);he.addColorStop(0,ut("#ffffff",J*.95)),he.addColorStop(.3,ut(y,J*.7)),he.addColorStop(1,"transparent"),u.fillStyle=he,u.beginPath(),u.arc(oe,Se,ie,0,Math.PI*2),u.fill()}if(g!==3){const D=.9+.1*Math.sin(o*.003),ae=(1+this.exp*9+d*2)*this.scale,G=Math.min(ae*(3+v*2),f*.4),te=u.createRadialGradient(x,_,0,x,_,G);te.addColorStop(0,ut("#ffffff",.95*D*I)),te.addColorStop(.2,ut(y,.75*D*I)),te.addColorStop(.5,ut(y,.2*I)),te.addColorStop(1,"transparent"),u.fillStyle=te,u.beginPath(),u.arc(x,_,G,0,Math.PI*2),u.fill(),u.beginPath(),u.arc(x,_,ae*D,0,Math.PI*2),u.fillStyle=ut("#ffffff",.95),u.fill()}else if(this.binaryCenters)for(const D of this.binaryCenters){const ae=x+D.x,G=_+D.y,te=(.8+this.exp*5+d*1.5)*this.scale,ue=Math.min(te*3.5,f*.22),oe=u.createRadialGradient(ae,G,0,ae,G,ue);oe.addColorStop(0,ut("#ffffff",.9*I)),oe.addColorStop(.3,ut(y,.6*I)),oe.addColorStop(1,"transparent"),u.fillStyle=oe,u.beginPath(),u.arc(ae,G,ue,0,Math.PI*2),u.fill(),u.beginPath(),u.arc(ae,G,te,0,Math.PI*2),u.fillStyle=ut("#ffffff",.9),u.fill()}}}function Ku({agentId:c,size:u=64,signals:f=0,accuracy:o=.5,uniqueness:d=.5,impact:h=.5}){const v=w.useRef(null),y=w.useRef(null),g=w.useRef(0),x=w.useRef(!0);return w.useEffect(()=>{const _=v.current;if(!_)return;_.width=u*2,_.height=u*2;const C=_.getContext("2d");if(!C)return;C.scale(2,2);const U=Ka(c),V=new Tg(_,c,f,o,d,U,h);y.current=V,V.draw();const F=()=>{x.current&&(V.update(16),V.draw()),g.current=requestAnimationFrame(F)};return g.current=requestAnimationFrame(F),()=>{cancelAnimationFrame(g.current),y.current=null}},[c,u,f,o,d,h]),w.useEffect(()=>{const _=v.current;if(!_)return;const C=new IntersectionObserver(([U])=>{x.current=U.isIntersecting},{threshold:.1});return C.observe(_),()=>C.disconnect()},[]),a.jsx("canvas",{ref:v,"aria-hidden":"true",className:"shrink-0",style:{width:u,height:u,borderRadius:"50%"}})}function Ju(c){var u,f;return((u=c.bench)==null?void 0:u.state)==="benched"?"benched":c.circuitOpen?"struggling":((f=c.bench)==null?void 0:f.state)==="kept-for-coverage"?"kept-for-coverage":null}function _m(c){var u;return((u=c.scores.bench)==null?void 0:u.state)==="benched"||c.scores.circuitOpen}function fs(c){return`${Math.round(c*100)}%`}function Eg(c){return c>=1.2?"good":c>=.8?"mid":"low"}function Ag(c){return c>=.7?"good":c>=.4?"mid":"low"}function Mg({agent:c}){var y;const u=c.scores,f=(y=c.lastTask)!=null&&y.timestamp?He(c.lastTask.timestamp):"",o=Eg(u.dispatchWeight),d=o==="good"?"text-confirmed":o==="low"?"text-disputed":"text-foreground",h=Ag(u.accuracy),v=h==="good"?"bg-confirmed":h==="mid"?"bg-unverified":"bg-disputed";return a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(c.id)}`,className:"group relative block rounded-lg border border-border bg-card p-3 transition-all hover:-translate-y-0.5 hover:border-primary/30 hover:bg-card/90",children:[a.jsxs("div",{className:"mb-2.5 flex items-center gap-2.5",children:[a.jsx("div",{className:"relative shrink-0",children:a.jsx(Ku,{agentId:c.id,size:48,animate:c.online,signals:u.signals,accuracy:u.accuracy,uniqueness:u.uniqueness,impact:u.impactScore})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-foreground",children:c.id}),(()=>{const g=Ju(u);return g==="benched"?a.jsx("span",{className:"shrink-0 rounded-sm bg-destructive/10 px-1 py-0.5 font-mono text-[8px] font-bold text-destructive","data-tooltip":`Benched (${u.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"BENCHED"}):g==="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","data-tooltip":"Struggling: consecutive failures tripped the circuit breaker.",children:"STRUGGLING"}):g==="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","data-tooltip":`Would bench (${u.bench.reason??"rule"}), but kept as sole provider of a category.`,children:"KEPT FOR COVERAGE"}):null})()]}),a.jsxs("div",{className:"mt-1 flex items-center gap-2 font-inter text-[10px] text-muted-foreground/60",children:[a.jsxs("span",{className:`rounded-sm border border-border/60 bg-background/60 px-1.5 py-0.5 font-bold tabular-nums ${d}`,"data-tooltip":`Dispatch weight ${u.dispatchWeight.toFixed(2)}
55
+ Scale 0.3 → 2.0`,"data-tooltip-pos":"bottom",children:[u.dispatchWeight.toFixed(2)," wt"]}),a.jsxs("span",{className:"truncate",children:[u.signals," signals",f?` · ${f}`:""]})]})]})]}),a.jsxs("div",{className:"space-y-1.5 rounded-lg border border-border/30 bg-background/40 px-2.5 py-2",children:[a.jsx(ms,{label:"accuracy",value:u.accuracy,fillClass:v,tooltip:`Accuracy ${fs(u.accuracy)}
56
56
  Ratio of confirmed findings.
57
57
  Higher = more trustworthy.`}),a.jsx(ms,{label:"reliability",value:u.taskCompletionRate??0,fillClass:"bg-chart",tooltip:`Reliability ${fs(u.taskCompletionRate??0)}
58
58
  Task completion rate — fraction of dispatched tasks that finished without pipeline error or timeout.`}),a.jsx(ms,{label:"unique",value:u.uniqueness,fillClass:"bg-unique",tooltip:`Uniqueness ${fs(u.uniqueness)}
59
59
  Findings others missed.
60
60
  Higher = this agent sees what peers don't.`}),a.jsx(ms,{label:"impact",value:u.impactScore,fillClass:"bg-[var(--color-impact)]",tooltip:`Impact ${fs(u.impactScore)}
61
61
  Severity-weighted findings.
62
- Critical and high findings count more.`})]})]})}function ms({label:c,value:u,fillClass:f,tooltip:o}){const d=Number.isFinite(u)?u:0;return a.jsxs("div",{className:"grid grid-cols-[72px_1fr_38px] items-center gap-2.5",children:[a.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground","data-tooltip":o,children:c}),a.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-background/80",children:a.jsx("div",{className:`h-full rounded-full transition-all ${f}`,style:{width:`${Math.max(0,Math.min(100,d*100))}%`}})}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums text-foreground",children:[Math.round(d*100),"%"]})]})}function Tm({agents:c}){const u=[...c].sort((d,h)=>{var _,C,U,Q;const y=((_=d.lastTask)==null?void 0:_.timestamp)??"",v=((C=h.lastTask)==null?void 0:C.timestamp)??"";if(y!==v)return v.localeCompare(y);const g=((U=d.scores)==null?void 0:U.signals)||0,x=((Q=h.scores)==null?void 0:Q.signals)||0;return g!==x?x-g:d.id.localeCompare(h.id)}),f=u.slice(0,4),o=u.length>4;return a.jsxs("section",{children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Team ",a.jsx("span",{className:"text-primary",children:c.length})]}),o&&a.jsx("a",{href:"/dashboard/team",className:"font-mono text-xs text-muted-foreground transition hover:text-primary",children:"view all"})]}),a.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:f.map(d=>a.jsx(Mg,{agent:d},d.id))})]})}const wg=8;function Cg(c){const u=c.toLowerCase();return u==="completed"||u==="done"||u==="success"||u==="succeeded"?"completed":u==="running"||u==="active"||u==="in_progress"||u==="pending"?"running":u==="failed"||u==="error"||u==="errored"||u==="timeout"||u==="timed_out"?"failed":u==="cancelled"||u==="canceled"||u==="queued"||u==="waiting"?"cancelled":"unknown"}const zg={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:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1},unknown:{label:"Unknown",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1}},Dg={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 Og(c){return c.length>8?c.slice(0,8):c}function Rg(c){return c.endsWith("-implementer")?{label:"IMPL",cls:"text-unique"}:c.endsWith("-reviewer")?{label:"REVIEW",cls:"text-chart"}:c.endsWith("-tester")?{label:"TEST",cls:"text-unique"}:c.endsWith("-researcher")?{label:"RESEARCH",cls:"text-muted-foreground"}:c.endsWith("-designer")?{label:"DESIGN",cls:"text-chart"}:null}function Em({tasks:c,limit:u=wg}){const f=c.items.slice(0,u),o=c.items.length>u;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:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:["Tasks ",a.jsx("span",{className:"text-primary",children:c.total})]}),o&&a.jsx("a",{href:"/dashboard/tasks",className:"font-mono text-xs text-muted-foreground transition hover:text-foreground",children:"view all"})]}),a.jsx("div",{className:"flex-1 rounded-md border border-border/40 bg-card/80",children:f.length===0?a.jsx(Bn,{title:"No tasks yet",hint:"Dispatch with gossip_run to populate this view."}):f.map((d,h)=>{const y=Cg(d.status),v=zg[y],g=Rg(d.agentId);return a.jsxs("div",{className:`flex items-start gap-3 px-3.5 py-2.5 hover:bg-accent/20 transition-colors ${h>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 ${v.iconBox} ${v.text} ${v.pulse?"animate-pulse":""}`,"aria-label":`Status: ${v.label}`,"data-tooltip":v.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:Dg[y]})}),a.jsx("span",{className:"mt-0.5 shrink-0 rounded border border-border/40 bg-background/60 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-muted-foreground","data-tooltip":d.taskId,children:Og(d.taskId)}),g&&a.jsx("span",{className:`shrink-0 rounded-sm border border-border/40 bg-background/40 px-1 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider ${g.cls}`,"data-tooltip":d.agentId,children:g.label}),a.jsx("span",{className:"min-w-0 flex-1 line-clamp-2 font-inter text-[11px] leading-snug text-foreground",children:d.task}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px] text-muted-foreground/60 font-normal",children:d.agentId}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px] text-muted-foreground/50",children:He(d.timestamp)})]},d.taskId)})})]})}const kg={agreement:"confirmed",consensus_verified:"confirmed",unique_confirmed:"unique",unique_unconfirmed:"unique?",disagreement:"disputed",hallucination_caught:"hallucination",new_finding:"new",unverified:"unverified"};function Ug(c,u){return c?c.length>u?c.slice(0,u-1)+"…":c:""}function Am(){const[c,u]=w.useState(null),[f,o]=w.useState(null);return w.useEffect(()=>{Qe("signals?limit=5").then(d=>u(d.items??[])).catch(d=>o(String((d==null?void 0:d.message)??d)))},[]),a.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Recent Signals"}),a.jsx("button",{type:"button",onClick:()=>ps("/signals"),className:"font-mono text-[10px] text-muted-foreground hover:underline",children:"all signals →"})]}),f&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"unavailable"}),!f&&c&&c.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"no signals recorded"}),!f&&c&&c.length>0&&a.jsx("ul",{className:"space-y-1.5",children:c.map((d,h)=>a.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[a.jsx("span",{className:"w-14 shrink-0 text-muted-foreground tabular-nums",children:He(d.timestamp)}),a.jsx("span",{className:"w-20 shrink-0 font-mono uppercase tracking-wide text-foreground",children:kg[d.signal]??d.signal}),a.jsx("span",{className:"w-24 shrink-0 truncate font-mono text-muted-foreground",children:d.agentId}),a.jsx("span",{className:"flex-1 truncate font-mono text-muted-foreground",children:Ug(d.evidence??"",80)})]},`${d.timestamp}-${h}`))})]})}function qg({overview:c,agents:u,tasks:f,activeTaskCount:o,setActiveTaskCount:d}){const h=c.actionableFindings;return a.jsxs("div",{className:"mx-auto max-w-5xl space-y-8",children:[a.jsxs("header",{children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[a.jsx("h1",{className:"text-4xl font-bold tracking-tight text-foreground font-serif-editorial",children:"Overview"}),h>0&&a.jsxs("a",{href:fl("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"font-mono text-[11px] text-orange-400 transition hover:underline","data-tooltip":"Findings open for operator review",children:[h," actionable →"]})]}),a.jsx("p",{className:"mt-1 font-mono text-[13px] text-muted-foreground",children:"What your agents are doing right now."})]}),a.jsx(Nm,{overview:c,activeTasks:o,mode:"calm"}),a.jsx(Sm,{onCountChange:d}),u&&a.jsx(Tm,{agents:u}),f&&a.jsx(Em,{tasks:f,limit:3}),a.jsx(Am,{})]})}function Hg({onLogin:c,error:u}){const[f,o]=w.useState(""),d=h=>{h.preventDefault(),f.trim()&&c(f.trim())};return a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:a.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-border bg-card p-8 text-center shadow-2xl",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 drop-shadow-[0_0_28px_rgba(139,92,246,0.45)]"})}),a.jsx("p",{className:"mb-1 text-[30px] font-bold tracking-tight text-foreground",style:{fontFamily:"'Space Grotesk', system-ui, sans-serif",letterSpacing:"-0.02em",textShadow:"0 0 24px rgba(139,92,246,0.4)"},children:"Gossipcat"}),a.jsx("p",{className:"mb-6 text-sm text-muted-foreground",children:"Authenticate to access the dashboard"}),a.jsxs("form",{onSubmit:d,children:[a.jsx("input",{type:"password",value:f,onChange:h=>o(h.target.value),placeholder:"Dashboard key",autoFocus:!0,className:"w-full rounded-lg border border-border bg-background px-4 py-3 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-primary focus:ring-2 focus:ring-primary/20"}),a.jsx("button",{type:"submit",className:"mt-4 w-full rounded-lg bg-primary px-4 py-3 text-sm font-semibold text-primary-foreground transition hover:opacity-90",children:"Unlock"})]}),u&&a.jsx("p",{className:"mt-3 text-sm text-destructive",children:"Invalid key. Check your terminal for the correct key."})]})})}let rt=null,hs=3e3,Hu=null;const Qu=new Set;function Mm(){if((rt==null?void 0:rt.readyState)===WebSocket.OPEN||(rt==null?void 0:rt.readyState)===WebSocket.CONNECTING)return;const c=location.protocol==="https:"?"wss:":"ws:";rt=new WebSocket(`${c}//${location.host}/dashboard/ws`),rt.onopen=()=>{hs=3e3},rt.onmessage=u=>{try{const f=JSON.parse(u.data);Qu.forEach(o=>o(f))}catch{}},rt.onclose=()=>{rt=null,Hu&&clearTimeout(Hu),Hu=setTimeout(()=>{hs=Math.min(hs*1.5,3e4),Mm()},hs)},rt.onerror=()=>{}}function wm(c){return Qu.add(c),()=>Qu.delete(c)}function Bg(){return(rt==null?void 0:rt.readyState)??WebSocket.CLOSED}const Cm="dashboard:theme",Lg=["default","editorial"];function Yg(c){return c!==null&&Lg.includes(c)?c:"default"}function Gg(){return typeof window>"u"?"default":Yg(window.localStorage.getItem(Cm))}function Xg(){const[c,u]=w.useState(Gg);w.useEffect(()=>{typeof document>"u"||(c==="default"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=c)},[c]);function f(d){if(u(d),typeof window<"u")try{window.localStorage.setItem(Cm,d)}catch{}}return{theme:c,setTheme:f,toggle:()=>{f(c==="default"?"editorial":"default")}}}const Qg=[{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."}];function Vg({open:c,onClose:u}){const f=w.useRef(null);return w.useEffect(()=>{if(!c)return;const o=requestAnimationFrame(()=>{var h;(h=f.current)==null||h.focus()}),d=h=>{h.key==="Escape"&&u()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{cancelAnimationFrame(o),document.removeEventListener("keydown",d),document.body.style.overflow=""}},[c,u]),c?a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-6 backdrop-blur-sm",onClick:u,role:"presentation",children:a.jsxs("div",{className:"relative flex max-h-[calc(100vh-48px)] w-full max-w-2xl flex-col overflow-hidden rounded-lg border border-border bg-card shadow-2xl",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 text-foreground",children:"Gossipcat Glossary"}),a.jsx("button",{ref:f,onClick:u,"aria-label":"Close glossary",className:"flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded border border-border/40 bg-card font-mono text-xs text-muted-foreground transition hover:bg-muted hover:text-foreground",children:"×"})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:a.jsx("dl",{className:"space-y-5",children:Qg.map(({term:o,definition:d,seeAlso:h})=>a.jsxs("div",{className:"rounded-md border border-border/40 bg-background/40 px-4 py-3",children:[a.jsx("dt",{className:"font-mono text-[11px] font-bold uppercase tracking-[0.12em] text-amber-400",children:o}),a.jsx("dd",{className:"mt-1.5 font-mono text-xs leading-relaxed text-foreground/80",children:d}),h&&a.jsxs("dd",{className:"mt-1.5 font-mono text-[10px] text-muted-foreground/60",children:["See also: ",h]})]},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 text-amber-400 transition hover:text-amber-300 hover:underline",children:"Read the full HANDBOOK →"})})]})}):null}const Zg=[{to:"/",label:"Dashboard",match:c=>c==="/"||c==="/overview"},{to:"/team",label:"Team",match:c=>c==="/team"||c.startsWith("/agent/")},{to:"/debates",label:"Consensus Rounds",match:c=>c==="/debates"},{to:"/tasks",label:"Tasks",match:c=>c==="/tasks"},{to:"/signals",label:"Signals",match:c=>c==="/signals"},{to:"/logs",label:"Logs",match:c=>c==="/logs"}];function rm(){const[c,u]=w.useState(!1),[f,o]=w.useState(!1),d=vm(),h=ym(),{theme:y,toggle:v}=Xg();return w.useEffect(()=>{const g=setInterval(()=>{u(Bg()===WebSocket.OPEN)},2e3);return()=>clearInterval(g)},[]),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:fl("/"),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 text-primary",children:"gossipcat"})]}),a.jsx("div",{className:"flex gap-1",children:Zg.map(g=>{const x=g.match(d);return a.jsx("a",{href:fl(g.to),className:`rounded-md px-3.5 py-1.5 font-mono text-[13px] transition ${x?"bg-primary/10 font-semibold text-primary":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:g.label},g.to)})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>ps(h?"/":"/?expert=1"),"aria-label":h?"Return to overview":"Switch to expert view",className:`font-mono text-[10px] uppercase tracking-widest border border-border/40 rounded-sm px-2.5 py-1 transition ${h?"text-foreground hover:text-foreground":"text-muted-foreground/50 hover:text-muted-foreground"}`,children:h?"← Overview":"Expert view →"}),a.jsx("button",{onClick:v,"aria-label":y==="editorial"?"Switch to default theme":"Switch to editorial theme",title:y==="editorial"?"Switch to default theme":"Switch to editorial theme",className:`font-mono text-[10px] uppercase tracking-widest border border-border/40 rounded-sm px-2.5 py-1 transition ${y==="editorial"?"text-foreground border-border":"text-muted-foreground/50 hover:text-muted-foreground"}`,children:y==="editorial"?"Default":"Editorial"}),a.jsx("button",{onClick:()=>o(!0),"aria-label":"Open glossary",className:"flex items-center justify-center rounded-md border border-border/60 bg-card px-2.5 py-1 font-mono text-xs font-semibold text-foreground transition hover:border-border hover:text-foreground",children:"Glossary"}),a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-card px-3.5 py-1.5 font-mono text-xs text-muted-foreground",children:[a.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${c?"bg-confirmed shadow-[0_0_6px_rgba(52,211,153,0.5)]":"bg-destructive"}`}),c?"Connected":"Disconnected"]})]}),a.jsx(Vg,{open:f,onClose:()=>o(!1)})]})}function $g(c){var f,o;const u=c.scores;return((f=u.bench)==null?void 0:f.state)==="benched"?u.bench.reason==="chronic-low-accuracy"?{label:"benched (chronic)",cls:"bg-destructive/15 text-destructive"}:u.bench.reason==="burst-hallucination"?{label:"benched (burst)",cls:"bg-destructive/15 text-destructive"}:{label:"benched",cls:"bg-destructive/15 text-destructive"}:((o=u.bench)==null?void 0:o.state)==="kept-for-coverage"?{label:"kept for coverage",cls:"border border-unverified/40 bg-unverified/10 text-unverified"}:u.circuitOpen?{label:`struggling (${u.consecutiveFailures} fails)`,cls:"bg-unverified/15 text-unverified"}:{label:"",cls:""}}function Kg({agents:c}){const u=c.filter(_m);return u.length===0?null:a.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-destructive/[0.04] px-3.5 py-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center rounded-sm bg-destructive/15 font-mono text-[11px] font-bold text-destructive",children:"!"}),a.jsx("span",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-destructive",children:"Agents Needing Attention"})]}),a.jsx("span",{className:"rounded-full border border-destructive/20 bg-destructive/10 px-2 py-0.5 font-mono text-xs font-bold text-destructive",children:u.length})]}),a.jsx("div",{children:u.map((f,o)=>{var v,g;const d=(v=f.lastTask)!=null&&v.timestamp?He(f.lastTask.timestamp):"",h=$g(f),y=((g=f.scores.bench)==null?void 0:g.state)==="benched";return a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(f.id)}`,className:`block px-3.5 py-3 transition hover:bg-destructive/[0.03] ${o>0?"border-t border-border/40":""}`,children:[a.jsxs("div",{className:"mb-1 flex items-center gap-2.5",children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${y?"bg-destructive shadow-[0_0_6px_rgba(248,113,113,0.6)]":"bg-unverified"}`}),a.jsx("span",{className:"text-sm font-semibold text-foreground",children:f.id}),h.label&&a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${h.cls}`,children:h.label})]}),a.jsxs("div",{className:"flex items-center justify-between pl-4 font-mono text-[10px] text-muted-foreground",children:[a.jsxs("span",{children:[f.scores.consecutiveFailures," consecutive fails"]}),d&&a.jsx("span",{className:"text-muted-foreground/50",children:d})]})]},f.id)})})]})}function Vu(c){return c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}const Bu=5,Lu={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"}},om=[{key:"all",label:"All",cls:"text-muted-foreground border-border/40 hover:border-border/60",activeCls:"text-foreground bg-muted border-border"},{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-zinc-500 border-zinc-500/20 hover:border-zinc-500/40",activeCls:"text-zinc-400 bg-zinc-500/10 border-zinc-500/40",tooltip:"Observations without a specific file:line anchor. Not scored — cannot be confirmed or disputed by peers."}],Jg=[{key:"all",label:"All",cls:"text-muted-foreground border-border/40 hover:border-border/60",activeCls:"text-foreground bg-muted border-border"},{key:"critical",label:"Critical",cls:"text-red-400/50 border-red-400/20 hover:border-red-400/40",activeCls:"text-red-400 bg-red-400/10 border-red-400/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-yellow-400/50 border-yellow-400/20 hover:border-yellow-400/40",activeCls:"text-yellow-400 bg-yellow-400/10 border-yellow-400/40"},{key:"low",label:"Low",cls:"text-muted-foreground/50 border-border/40 hover:border-border/60",activeCls:"text-muted-foreground bg-muted/50 border-border"}],Fg={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:"text-muted-foreground bg-muted/50"},Ig="[&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400 [&_.inline-code]:rounded [&_.inline-code]:bg-muted [&_.inline-code]:px-1 [&_.inline-code]:py-0.5 [&_.inline-code]:font-mono [&_.inline-code]:text-[11px] [&_.inline-code]:text-foreground/80 [&_.inline-code-block]:my-1.5 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:bg-muted/70 [&_.inline-code-block]:p-2 [&_.inline-code-block]:font-mono [&_.inline-code-block]:text-[11px] [&_.inline-code-block]:text-foreground/70 [&_.inline-code-block]:overflow-x-auto",Wg={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 Pg({f:c,reviewInfo:u,diagnostics:f}){const o=c.tag==="confirmed"?"text-confirmed bg-confirmed/10 border-confirmed/20":c.tag==="disputed"?"text-disputed bg-disputed/10 border-disputed/20":c.tag==="unverified"?"text-unverified bg-unverified/10 border-unverified/20":"text-unique bg-unique/10 border-unique/20",d=c.severity&&Fg[c.severity]||"",h=c.findingType==="suggestion"?"SUGGESTION":c.findingType==="insight"?"INSIGHT":null,y=c.findingType==="suggestion"?"text-blue-400 bg-blue-500/10":c.findingType==="insight"?"text-zinc-400 bg-zinc-500/10":"",v=c.finding.match(/<cite\s+tag="file">([^<]+)<\/cite>/),g=v?v[1]:null;return a.jsxs("div",{className:"rounded-md border border-border/40 hover:border-border/60 transition-colors bg-card/30 px-4 py-3.5",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:c.tag.toUpperCase()}),c.severity&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${d}`,children:c.severity.toUpperCase()}),h&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${y}`,children:h}),g&&a.jsx("span",{className:"bg-blue-500/10 px-2 py-1 font-mono text-[10px] text-blue-400 border border-blue-500/15 rounded",children:g}),a.jsx("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground/40",children:c.originalAgentId}),c.confirmedBy&&c.confirmedBy.length>0&&(()=>{const x=[...new Set(c.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:
62
+ Critical and high findings count more.`})]})]})}function ms({label:c,value:u,fillClass:f,tooltip:o}){const d=Number.isFinite(u)?u:0;return a.jsxs("div",{className:"grid grid-cols-[72px_1fr_38px] items-center gap-2.5",children:[a.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground","data-tooltip":o,children:c}),a.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-background/80",children:a.jsx("div",{className:`h-full rounded-full transition-all ${f}`,style:{width:`${Math.max(0,Math.min(100,d*100))}%`}})}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums text-foreground",children:[Math.round(d*100),"%"]})]})}function Tm({agents:c}){const u=[...c].sort((d,h)=>{var _,C,U,V;const v=((_=d.lastTask)==null?void 0:_.timestamp)??"",y=((C=h.lastTask)==null?void 0:C.timestamp)??"";if(v!==y)return y.localeCompare(v);const g=((U=d.scores)==null?void 0:U.signals)||0,x=((V=h.scores)==null?void 0:V.signals)||0;return g!==x?x-g:d.id.localeCompare(h.id)}),f=u.slice(0,4),o=u.length>4;return a.jsxs("section",{children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Team ",a.jsx("span",{className:"text-primary",children:c.length})]}),o&&a.jsx("a",{href:"/dashboard/team",className:"font-mono text-xs text-muted-foreground transition hover:text-primary",children:"view all"})]}),a.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:f.map(d=>a.jsx(Mg,{agent:d},d.id))})]})}const wg=8;function Cg(c){const u=c.toLowerCase();return u==="completed"||u==="done"||u==="success"||u==="succeeded"?"completed":u==="running"||u==="active"||u==="in_progress"||u==="pending"?"running":u==="failed"||u==="error"||u==="errored"||u==="timeout"||u==="timed_out"?"failed":u==="cancelled"||u==="canceled"||u==="queued"||u==="waiting"?"cancelled":"unknown"}const zg={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:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1},unknown:{label:"Unknown",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1}},Dg={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 Og(c){return c.length>8?c.slice(0,8):c}function Rg(c){return c.endsWith("-implementer")?{label:"IMPL",cls:"text-unique"}:c.endsWith("-reviewer")?{label:"REVIEW",cls:"text-chart"}:c.endsWith("-tester")?{label:"TEST",cls:"text-unique"}:c.endsWith("-researcher")?{label:"RESEARCH",cls:"text-muted-foreground"}:c.endsWith("-designer")?{label:"DESIGN",cls:"text-chart"}:null}function Em({tasks:c,limit:u=wg}){const f=c.items.slice(0,u),o=c.items.length>u;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:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:["Tasks ",a.jsx("span",{className:"text-primary",children:c.total})]}),o&&a.jsx("a",{href:"/dashboard/tasks",className:"font-mono text-xs text-muted-foreground transition hover:text-foreground",children:"view all"})]}),a.jsx("div",{className:"flex-1 rounded-md border border-border/40 bg-card/80",children:f.length===0?a.jsx(Ln,{title:"No tasks yet",hint:"Dispatch with gossip_run to populate this view."}):f.map((d,h)=>{const v=Cg(d.status),y=zg[v],g=Rg(d.agentId);return a.jsxs("div",{className:`flex items-start gap-3 px-3.5 py-2.5 hover:bg-accent/20 transition-colors ${h>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 ${y.iconBox} ${y.text} ${y.pulse?"animate-pulse":""}`,"aria-label":`Status: ${y.label}`,"data-tooltip":y.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:Dg[v]})}),a.jsx("span",{className:"mt-0.5 shrink-0 rounded border border-border/40 bg-background/60 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-muted-foreground","data-tooltip":d.taskId,children:Og(d.taskId)}),g&&a.jsx("span",{className:`shrink-0 rounded-sm border border-border/40 bg-background/40 px-1 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider ${g.cls}`,"data-tooltip":d.agentId,children:g.label}),a.jsx("span",{className:"min-w-0 flex-1 line-clamp-2 font-inter text-[11px] leading-snug text-foreground",children:d.task}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px] text-muted-foreground/60 font-normal",children:d.agentId}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px] text-muted-foreground/50",children:He(d.timestamp)})]},d.taskId)})})]})}const kg={agreement:"confirmed",consensus_verified:"confirmed",unique_confirmed:"unique",unique_unconfirmed:"unique?",disagreement:"disputed",hallucination_caught:"hallucination",new_finding:"new",unverified:"unverified"};function Ug(c,u){return c?c.length>u?c.slice(0,u-1)+"…":c:""}function Am(){const[c,u]=w.useState(null),[f,o]=w.useState(null);return w.useEffect(()=>{Qe("signals?limit=5").then(d=>u(d.items??[])).catch(d=>o(String((d==null?void 0:d.message)??d)))},[]),a.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Recent Signals"}),a.jsx("button",{type:"button",onClick:()=>ps("/signals"),className:"font-mono text-[10px] text-muted-foreground hover:underline",children:"all signals →"})]}),f&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"unavailable"}),!f&&c&&c.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"no signals recorded"}),!f&&c&&c.length>0&&a.jsx("ul",{className:"space-y-1.5",children:c.map((d,h)=>a.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[a.jsx("span",{className:"w-14 shrink-0 text-muted-foreground tabular-nums",children:He(d.timestamp)}),a.jsx("span",{className:"w-20 shrink-0 font-mono uppercase tracking-wide text-foreground",children:kg[d.signal]??d.signal}),a.jsx("span",{className:"w-24 shrink-0 truncate font-mono text-muted-foreground",children:d.agentId}),a.jsx("span",{className:"flex-1 truncate font-mono text-muted-foreground",children:Ug(d.evidence??"",80)})]},`${d.timestamp}-${h}`))})]})}function qg({overview:c,agents:u,tasks:f,activeTaskCount:o,setActiveTaskCount:d}){const h=c.actionableFindings;return a.jsxs("div",{className:"mx-auto max-w-5xl space-y-8",children:[a.jsxs("header",{children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[a.jsx("h1",{className:"text-4xl font-bold tracking-tight text-foreground font-serif-editorial",children:"Overview"}),h>0&&a.jsxs("a",{href:Bn("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"font-mono text-[11px] text-orange-400 transition hover:underline","data-tooltip":"Findings open for operator review",children:[h," actionable →"]})]}),a.jsx("p",{className:"mt-1 font-mono text-[13px] text-muted-foreground",children:"What your agents are doing right now."})]}),a.jsx(Nm,{overview:c,activeTasks:o,mode:"calm"}),h>0&&a.jsxs("a",{href:Bn("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"inline-flex items-center gap-1.5 font-mono text-[12px] text-muted-foreground transition hover:text-foreground",children:[a.jsx("span",{children:"◆"}),a.jsx("span",{className:"font-bold text-unverified",children:h}),a.jsx("span",{children:"actionable signals →"})]}),a.jsx(Sm,{onCountChange:d}),u&&a.jsx(Tm,{agents:u}),f&&a.jsx(Em,{tasks:f,limit:3}),a.jsx(Am,{})]})}function Hg({onLogin:c,error:u}){const[f,o]=w.useState(""),d=h=>{h.preventDefault(),f.trim()&&c(f.trim())};return a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:a.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-border bg-card p-8 text-center shadow-2xl",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 drop-shadow-[0_0_28px_rgba(139,92,246,0.45)]"})}),a.jsx("p",{className:"mb-1 text-[30px] font-bold tracking-tight text-foreground",style:{fontFamily:"'Space Grotesk', system-ui, sans-serif",letterSpacing:"-0.02em",textShadow:"0 0 24px rgba(139,92,246,0.4)"},children:"Gossipcat"}),a.jsx("p",{className:"mb-6 text-sm text-muted-foreground",children:"Authenticate to access the dashboard"}),a.jsxs("form",{onSubmit:d,children:[a.jsx("input",{type:"password",value:f,onChange:h=>o(h.target.value),placeholder:"Dashboard key",autoFocus:!0,className:"w-full rounded-lg border border-border bg-background px-4 py-3 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-primary focus:ring-2 focus:ring-primary/20"}),a.jsx("button",{type:"submit",className:"mt-4 w-full rounded-lg bg-primary px-4 py-3 text-sm font-semibold text-primary-foreground transition hover:opacity-90",children:"Unlock"})]}),u&&a.jsx("p",{className:"mt-3 text-sm text-destructive",children:"Invalid key. Check your terminal for the correct key."})]})})}let rt=null,hs=3e3,Hu=null;const Qu=new Set;function Mm(){if((rt==null?void 0:rt.readyState)===WebSocket.OPEN||(rt==null?void 0:rt.readyState)===WebSocket.CONNECTING)return;const c=location.protocol==="https:"?"wss:":"ws:";rt=new WebSocket(`${c}//${location.host}/dashboard/ws`),rt.onopen=()=>{hs=3e3},rt.onmessage=u=>{try{const f=JSON.parse(u.data);Qu.forEach(o=>o(f))}catch{}},rt.onclose=()=>{rt=null,Hu&&clearTimeout(Hu),Hu=setTimeout(()=>{hs=Math.min(hs*1.5,3e4),Mm()},hs)},rt.onerror=()=>{}}function wm(c){return Qu.add(c),()=>Qu.delete(c)}function Bg(){return(rt==null?void 0:rt.readyState)??WebSocket.CLOSED}const Cm="dashboard:theme",Lg=["default","editorial"];function Yg(c){return c!==null&&Lg.includes(c)?c:"default"}function Gg(){return typeof window>"u"?"default":Yg(window.localStorage.getItem(Cm))}function Xg(){const[c,u]=w.useState(Gg);w.useEffect(()=>{typeof document>"u"||(c==="default"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=c)},[c]);function f(d){if(u(d),typeof window<"u")try{window.localStorage.setItem(Cm,d)}catch{}}return{theme:c,setTheme:f,toggle:()=>{f(c==="default"?"editorial":"default")}}}const Qg=[{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."}];function Vg({open:c,onClose:u}){const f=w.useRef(null);return w.useEffect(()=>{if(!c)return;const o=requestAnimationFrame(()=>{var h;(h=f.current)==null||h.focus()}),d=h=>{h.key==="Escape"&&u()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{cancelAnimationFrame(o),document.removeEventListener("keydown",d),document.body.style.overflow=""}},[c,u]),c?a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-6 backdrop-blur-sm",onClick:u,role:"presentation",children:a.jsxs("div",{className:"relative flex max-h-[calc(100vh-48px)] w-full max-w-2xl flex-col overflow-hidden rounded-lg border border-border bg-card shadow-2xl",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 text-foreground",children:"Gossipcat Glossary"}),a.jsx("button",{ref:f,onClick:u,"aria-label":"Close glossary",className:"flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded border border-border/40 bg-card font-mono text-xs text-muted-foreground transition hover:bg-muted hover:text-foreground",children:"×"})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:a.jsx("dl",{className:"space-y-5",children:Qg.map(({term:o,definition:d,seeAlso:h})=>a.jsxs("div",{className:"rounded-md border border-border/40 bg-background/40 px-4 py-3",children:[a.jsx("dt",{className:"font-mono text-[11px] font-bold uppercase tracking-[0.12em] text-amber-400",children:o}),a.jsx("dd",{className:"mt-1.5 font-mono text-xs leading-relaxed text-foreground/80",children:d}),h&&a.jsxs("dd",{className:"mt-1.5 font-mono text-[10px] text-muted-foreground/60",children:["See also: ",h]})]},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 text-amber-400 transition hover:text-amber-300 hover:underline",children:"Read the full HANDBOOK →"})})]})}):null}const Zg=[{to:"/",label:"Dashboard",match:c=>c==="/"||c==="/overview"},{to:"/team",label:"Team",match:c=>c==="/team"||c.startsWith("/agent/")},{to:"/debates",label:"Consensus Rounds",match:c=>c==="/debates"},{to:"/tasks",label:"Tasks",match:c=>c==="/tasks"},{to:"/signals",label:"Signals",match:c=>c==="/signals"},{to:"/logs",label:"Logs",match:c=>c==="/logs"}];function rm(){const[c,u]=w.useState(!1),[f,o]=w.useState(!1),d=vm(),h=ym(),{theme:v,toggle:y}=Xg();return w.useEffect(()=>{const g=setInterval(()=>{u(Bg()===WebSocket.OPEN)},2e3);return()=>clearInterval(g)},[]),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:Bn("/"),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 text-primary",children:"gossipcat"})]}),a.jsx("div",{className:"flex gap-1",children:Zg.map(g=>{const x=g.match(d);return a.jsx("a",{href:Bn(g.to),className:`rounded-md px-3.5 py-1.5 font-mono text-[13px] transition ${x?"bg-primary/10 font-semibold text-primary":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:g.label},g.to)})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>ps(h?"/":"/?expert=1"),"aria-label":h?"Return to overview":"Switch to expert view",className:`font-mono text-[10px] uppercase tracking-widest border border-border/40 rounded-sm px-2.5 py-1 transition ${h?"text-foreground hover:text-foreground":"text-muted-foreground/50 hover:text-muted-foreground"}`,children:h?"← Overview":"Expert view →"}),a.jsx("button",{onClick:y,"aria-label":v==="editorial"?"Switch to default theme":"Switch to editorial theme",title:v==="editorial"?"Switch to default theme":"Switch to editorial theme",className:`font-mono text-[10px] uppercase tracking-widest border border-border/40 rounded-sm px-2.5 py-1 transition ${v==="editorial"?"text-foreground border-border":"text-muted-foreground/50 hover:text-muted-foreground"}`,children:v==="editorial"?"Default":"Editorial"}),a.jsx("button",{onClick:()=>o(!0),"aria-label":"Open glossary",className:"flex items-center justify-center rounded-md border border-border/60 bg-card px-2.5 py-1 font-mono text-xs font-semibold text-foreground transition hover:border-border hover:text-foreground",children:"Glossary"}),a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-card px-3.5 py-1.5 font-mono text-xs text-muted-foreground",children:[a.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${c?"bg-confirmed shadow-[0_0_6px_rgba(52,211,153,0.5)]":"bg-destructive"}`}),c?"Connected":"Disconnected"]})]}),a.jsx(Vg,{open:f,onClose:()=>o(!1)})]})}function $g(c){var f,o;const u=c.scores;return((f=u.bench)==null?void 0:f.state)==="benched"?u.bench.reason==="chronic-low-accuracy"?{label:"benched (chronic)",cls:"bg-destructive/15 text-destructive"}:u.bench.reason==="burst-hallucination"?{label:"benched (burst)",cls:"bg-destructive/15 text-destructive"}:{label:"benched",cls:"bg-destructive/15 text-destructive"}:((o=u.bench)==null?void 0:o.state)==="kept-for-coverage"?{label:"kept for coverage",cls:"border border-unverified/40 bg-unverified/10 text-unverified"}:u.circuitOpen?{label:`struggling (${u.consecutiveFailures} fails)`,cls:"bg-unverified/15 text-unverified"}:{label:"",cls:""}}function Kg({agents:c}){const u=c.filter(_m);return u.length===0?null:a.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-destructive/[0.04] px-3.5 py-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center rounded-sm bg-destructive/15 font-mono text-[11px] font-bold text-destructive",children:"!"}),a.jsx("span",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-destructive",children:"Agents Needing Attention"})]}),a.jsx("span",{className:"rounded-full border border-destructive/20 bg-destructive/10 px-2 py-0.5 font-mono text-xs font-bold text-destructive",children:u.length})]}),a.jsx("div",{children:u.map((f,o)=>{var y,g;const d=(y=f.lastTask)!=null&&y.timestamp?He(f.lastTask.timestamp):"",h=$g(f),v=((g=f.scores.bench)==null?void 0:g.state)==="benched";return a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(f.id)}`,className:`block px-3.5 py-3 transition hover:bg-destructive/[0.03] ${o>0?"border-t border-border/40":""}`,children:[a.jsxs("div",{className:"mb-1 flex items-center gap-2.5",children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${v?"bg-destructive shadow-[0_0_6px_rgba(248,113,113,0.6)]":"bg-unverified"}`}),a.jsx("span",{className:"text-sm font-semibold text-foreground",children:f.id}),h.label&&a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${h.cls}`,children:h.label})]}),a.jsxs("div",{className:"flex items-center justify-between pl-4 font-mono text-[10px] text-muted-foreground",children:[a.jsxs("span",{children:[f.scores.consecutiveFailures," consecutive fails"]}),d&&a.jsx("span",{className:"text-muted-foreground/50",children:d})]})]},f.id)})})]})}function Vu(c){return c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}const Bu=5,Lu={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"}},om=[{key:"all",label:"All",cls:"text-muted-foreground border-border/40 hover:border-border/60",activeCls:"text-foreground bg-muted border-border"},{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."}],Jg=[{key:"all",label:"All",cls:"text-muted-foreground border-border/40 hover:border-border/60",activeCls:"text-foreground bg-muted border-border"},{key:"critical",label:"Critical",cls:"text-red-400/50 border-red-400/20 hover:border-red-400/40",activeCls:"text-red-400 bg-red-400/10 border-red-400/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-yellow-400/50 border-yellow-400/20 hover:border-yellow-400/40",activeCls:"text-yellow-400 bg-yellow-400/10 border-yellow-400/40"},{key:"low",label:"Low",cls:"text-muted-foreground/50 border-border/40 hover:border-border/60",activeCls:"text-muted-foreground bg-muted/50 border-border"}],Fg={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:"text-muted-foreground bg-muted/50"},Ig="[&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400 [&_.inline-code]:rounded [&_.inline-code]:bg-muted [&_.inline-code]:px-1 [&_.inline-code]:py-0.5 [&_.inline-code]:font-mono [&_.inline-code]:text-[11px] [&_.inline-code]:text-foreground/80 [&_.inline-code-block]:my-1.5 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:bg-muted/70 [&_.inline-code-block]:p-2 [&_.inline-code-block]:font-mono [&_.inline-code-block]:text-[11px] [&_.inline-code-block]:text-foreground/70 [&_.inline-code-block]:overflow-x-auto",Wg={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 Pg({f:c,reviewInfo:u,diagnostics:f}){const o=c.tag==="confirmed"?"text-confirmed bg-confirmed/10 border-confirmed/20":c.tag==="disputed"?"text-disputed bg-disputed/10 border-disputed/20":c.tag==="unverified"?"text-unverified bg-unverified/10 border-unverified/20":"text-unique bg-unique/10 border-unique/20",d=c.severity&&Fg[c.severity]||"",h=c.findingType==="suggestion"?"SUGGESTION":c.findingType==="insight"?"INSIGHT":null,v=c.findingType==="suggestion"?"text-blue-400 bg-blue-500/10":c.findingType==="insight"?"text-zinc-400 bg-zinc-500/10":"",y=c.finding.match(/<cite\s+tag="file">([^<]+)<\/cite>/),g=y?y[1]:null;return a.jsxs("div",{className:"rounded-md border border-border/40 hover:border-border/60 transition-colors bg-card/30 px-4 py-3.5",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:c.tag.toUpperCase()}),c.severity&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${d}`,children:c.severity.toUpperCase()}),h&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${v}`,children:h}),g&&a.jsx("span",{className:"bg-blue-500/10 px-2 py-1 font-mono text-[10px] text-blue-400 border border-blue-500/15 rounded",children:g}),a.jsx("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground/40",children:c.originalAgentId}),c.confirmedBy&&c.confirmedBy.length>0&&(()=>{const x=[...new Set(c.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:
63
63
  ${x.join(", ")}`,"data-tooltip-pos":"left",children:["+",x.length," ✓"]})})(),c.disputedBy&&c.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:
64
64
  ${c.disputedBy.map(x=>x.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[c.disputedBy.length," ⚡"]}),c.unverifiedBy&&c.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:
65
- ${c.unverifiedBy.map(x=>x.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[c.unverifiedBy.length," ◇"]})]}),f&&f.length>0&&a.jsx("div",{className:"mt-1.5 mb-1 space-y-1",children:f.map((x,_)=>a.jsxs("div",{className:"rounded border border-unverified/20 bg-unverified/5 px-2.5 py-1.5","data-diagnostic-code":x.code,children:[a.jsxs("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-unverified/80",children:["⚠ ",x.code]}),a.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground/80",dangerouslySetInnerHTML:{__html:Vu(Wg[x.code])+" — "+Vu(x.message)}})]},_))}),c.disputedBy&&c.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:c.disputedBy.map((x,_)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"font-mono font-bold text-disputed/70",children:x.agentId}),a.jsxs("span",{className:"text-muted-foreground/60",children:[" — ",x.reason||x.evidence||"No reason given"]})]},_))}),a.jsx("div",{className:`finding-md font-inter text-xs leading-relaxed text-muted-foreground ${Ig}`,dangerouslySetInnerHTML:{__html:bs(c.finding)}}),u&&a.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[u.reviewers.map(x=>a.jsx("span",{title:x,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:Ka(x)},children:Xu(x)},x)),a.jsxs("span",{className:`rounded px-1.5 py-0.5 font-mono text-[9px] font-bold ${u.assigned>=u.targetK?"text-confirmed/70 bg-confirmed/5":"text-unverified/70 bg-unverified/5"}`,children:[u.assigned>=u.targetK?"✓":"⚠"," ",u.assigned,"/",u.targetK]})]})]})}function zm({consensus:c,reports:u,showAll:f=!1,hideHeader:o=!1,filteredRuns:d}){const h=d??c.runs,y=f?h:h.slice(0,Bu);!f&&h.length>Bu;const[v,g]=w.useState(null),[x,_]=w.useState("all"),[C,U]=w.useState("all"),[Q,F]=w.useState(1),[I,X]=w.useState([]),[de,Z]=w.useState(0),[$,V]=w.useState(!1),[O,ae]=w.useState({});w.useEffect(()=>{if(!f&&(u!=null&&u.reports)&&(X(u.reports),Z(u.totalReports??u.reports.length),F(1)),u!=null&&u.roundRetractions){const A={};for(const S of u.roundRetractions)A[S.consensus_id]={reason:S.reason,retracted_at:S.retracted_at};ae(A)}},[u,f]),w.useEffect(()=>{if(!f)return;let A=!1;return(async()=>{var S;try{const H=await Qe("consensus-reports?page=1&pageSize=200");if(A)return;if(X(H.reports||[]),Z(H.totalReports??(((S=H.reports)==null?void 0:S.length)||0)),F(1),H.roundRetractions){const K={};for(const R of H.roundRetractions)K[R.consensus_id]={reason:R.reason,retracted_at:R.retracted_at};ae(K)}}catch{}})(),()=>{A=!0}},[f]);const G=I.slice().sort((A,S)=>S.timestamp.localeCompare(A.timestamp)),te=10,[ue,oe]=w.useState(0),Se=Math.max(1,Math.ceil(G.length/te)),J=Math.min(ue,Se-1),ie=f?G.slice(J*te,(J+1)*te):G.slice(0,Bu),he=A=>{const S=new Date,H=new Date(A),K=W=>new Date(W.getFullYear(),W.getMonth(),W.getDate()).getTime(),R=Math.round((K(S)-K(H))/864e5);return R<=0?"Today":R===1?"Yesterday":R<7?`${R} days ago`:R<30?`${Math.floor(R/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:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:["Consensus Rounds ",a.jsx("span",{className:"text-primary",children:c.totalRuns??c.runs.length})]}),!f&&a.jsx("a",{href:"/dashboard/debates",className:"font-mono text-xs text-muted-foreground transition hover:text-primary",children:"view all"})]}),ie.length>0?a.jsxs("div",{className:"space-y-2",children:[ie.map((A,S)=>{const H=S>0?ie[S-1]:null,K=f?he(A.timestamp):null,R=f&&H?he(H.timestamp):null,W=f&&K!==R,p={};if(A.crossReviewAssignments||A.crossReviewCoverage){const P={};if(A.crossReviewAssignments)for(const[ke,Fe]of Object.entries(A.crossReviewAssignments))for(const et of Fe)(P[et]??(P[et]=[])).push(ke);if(A.crossReviewCoverage)for(const ke of A.crossReviewCoverage)p[ke.findingId]={reviewers:P[ke.findingId]||[],assigned:ke.assigned,targetK:ke.targetK};else for(const[ke,Fe]of Object.entries(P))p[ke]={reviewers:Fe,assigned:Fe.length,targetK:Fe.length}}const D=[...A.confirmed,...A.disputed,...A.unverified,...A.unique,...A.insights||[]],Y=x==="all"?D:x==="insight"?D.filter(P=>P.findingType==="insight"||P.findingType==="suggestion"):D.filter(P=>P.tag===x),L=C==="all"?Y:Y.filter(P=>P.severity===C),ne=v===A.id,ce=(()=>{const P=new Set;return ke=>{var Ut;const Fe=(Ut=A.authorDiagnostics)==null?void 0:Ut[ke.originalAgentId];if(!Fe||Fe.length===0)return;const et=Fe.filter(Ue=>{const Qn=`${ke.originalAgentId}:${Ue.code}`;return P.has(Qn)?!1:(P.add(Qn),!0)});return et.length>0?et:void 0}})(),pe=D.length||1,Be=A.confirmed.length,fe=A.disputed.length,Lt=A.unverified.length,Zt=A.unique.length,Ln=(A.insights||[]).length,Yn=(()=>{if(pe<=1)return"border-l-border/40";const P=Be/pe,ke=fe/pe;return P>=.5?"border-l-confirmed/60":ke>=.4?"border-l-disputed/60":"border-l-unverified/50"})(),$t=[{count:Be,textCls:"text-confirmed",label:"confirmed"},{count:fe,textCls:"text-disputed",label:"disputed"},{count:Lt,textCls:"text-unverified",label:"unverified"},{count:Zt,textCls:"text-unique",label:"unique"},{count:Ln,textCls:"text-zinc-400",label:"insights"}].filter(P=>P.count>0),Gn=[...new Set(D.map(P=>P.originalAgentId).filter(Boolean))],ml=Gn.slice(0,5),Xn=O[A.id],hl=!!Xn;return a.jsxs("div",{children:[W&&a.jsxs("div",{className:`mb-2 flex items-center gap-3 ${S>0?"mt-4":""}`,children:[a.jsx("span",{className:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:K}),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
66
- ${Yn}
65
+ ${c.unverifiedBy.map(x=>x.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[c.unverifiedBy.length," ◇"]})]}),f&&f.length>0&&a.jsx("div",{className:"mt-1.5 mb-1 space-y-1",children:f.map((x,_)=>a.jsxs("div",{className:"rounded border border-unverified/20 bg-unverified/5 px-2.5 py-1.5","data-diagnostic-code":x.code,children:[a.jsxs("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-unverified/80",children:["⚠ ",x.code]}),a.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground/80",dangerouslySetInnerHTML:{__html:Vu(Wg[x.code])+" — "+Vu(x.message)}})]},_))}),c.disputedBy&&c.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:c.disputedBy.map((x,_)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"font-mono font-bold text-disputed/70",children:x.agentId}),a.jsxs("span",{className:"text-muted-foreground/60",children:[" — ",x.reason||x.evidence||"No reason given"]})]},_))}),a.jsx("div",{className:`finding-md font-inter text-xs leading-relaxed text-muted-foreground ${Ig}`,dangerouslySetInnerHTML:{__html:bs(c.finding)}}),u&&a.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[u.reviewers.map(x=>a.jsx("span",{title:x,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:Ka(x)},children:Xu(x)},x)),a.jsxs("span",{className:`rounded px-1.5 py-0.5 font-mono text-[9px] font-bold ${u.assigned>=u.targetK?"text-confirmed/70 bg-confirmed/5":"text-unverified/70 bg-unverified/5"}`,children:[u.assigned>=u.targetK?"✓":"⚠"," ",u.assigned,"/",u.targetK]})]})]})}function zm({consensus:c,reports:u,showAll:f=!1,hideHeader:o=!1,filteredRuns:d}){const h=d??c.runs,v=f?h:h.slice(0,Bu);!f&&h.length>Bu;const[y,g]=w.useState(null),[x,_]=w.useState("all"),[C,U]=w.useState("all"),[V,F]=w.useState(1),[I,X]=w.useState([]),[de,Z]=w.useState(0),[$,Q]=w.useState(!1),[D,ae]=w.useState({});w.useEffect(()=>{if(!f&&(u!=null&&u.reports)&&(X(u.reports),Z(u.totalReports??u.reports.length),F(1)),u!=null&&u.roundRetractions){const A={};for(const S of u.roundRetractions)A[S.consensus_id]={reason:S.reason,retracted_at:S.retracted_at};ae(A)}},[u,f]),w.useEffect(()=>{if(!f)return;let A=!1;return(async()=>{var S;try{const H=await Qe("consensus-reports?page=1&pageSize=200");if(A)return;if(X(H.reports||[]),Z(H.totalReports??(((S=H.reports)==null?void 0:S.length)||0)),F(1),H.roundRetractions){const K={};for(const R of H.roundRetractions)K[R.consensus_id]={reason:R.reason,retracted_at:R.retracted_at};ae(K)}}catch{}})(),()=>{A=!0}},[f]);const G=I.slice().sort((A,S)=>S.timestamp.localeCompare(A.timestamp)),te=10,[ue,oe]=w.useState(0),Se=Math.max(1,Math.ceil(G.length/te)),J=Math.min(ue,Se-1),ie=f?G.slice(J*te,(J+1)*te):G.slice(0,Bu),he=A=>{const S=new Date,H=new Date(A),K=W=>new Date(W.getFullYear(),W.getMonth(),W.getDate()).getTime(),R=Math.round((K(S)-K(H))/864e5);return R<=0?"Today":R===1?"Yesterday":R<7?`${R} days ago`:R<30?`${Math.floor(R/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:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:["Consensus Rounds ",a.jsx("span",{className:"text-primary",children:c.totalRuns??c.runs.length})]}),!f&&a.jsx("a",{href:"/dashboard/debates",className:"font-mono text-xs text-muted-foreground transition hover:text-primary",children:"view all"})]}),ie.length>0?a.jsxs("div",{className:"space-y-2",children:[ie.map((A,S)=>{const H=S>0?ie[S-1]:null,K=f?he(A.timestamp):null,R=f&&H?he(H.timestamp):null,W=f&&K!==R,p={};if(A.crossReviewAssignments||A.crossReviewCoverage){const P={};if(A.crossReviewAssignments)for(const[ke,Fe]of Object.entries(A.crossReviewAssignments))for(const et of Fe)(P[et]??(P[et]=[])).push(ke);if(A.crossReviewCoverage)for(const ke of A.crossReviewCoverage)p[ke.findingId]={reviewers:P[ke.findingId]||[],assigned:ke.assigned,targetK:ke.targetK};else for(const[ke,Fe]of Object.entries(P))p[ke]={reviewers:Fe,assigned:Fe.length,targetK:Fe.length}}const O=[...A.confirmed,...A.disputed,...A.unverified,...A.unique,...A.insights||[]],Y=x==="all"?O:x==="insight"?O.filter(P=>P.findingType==="insight"||P.findingType==="suggestion"):O.filter(P=>P.tag===x),L=C==="all"?Y:Y.filter(P=>P.severity===C),ne=y===A.id,ce=(()=>{const P=new Set;return ke=>{var Ut;const Fe=(Ut=A.authorDiagnostics)==null?void 0:Ut[ke.originalAgentId];if(!Fe||Fe.length===0)return;const et=Fe.filter(Ue=>{const Vn=`${ke.originalAgentId}:${Ue.code}`;return P.has(Vn)?!1:(P.add(Vn),!0)});return et.length>0?et:void 0}})(),pe=O.length||1,Be=A.confirmed.length,fe=A.disputed.length,Lt=A.unverified.length,Zt=A.unique.length,Yn=(A.insights||[]).length,Gn=(()=>{if(pe===0)return"border-l-border/40";const P=Be/pe,ke=fe/pe;return P>=.5?"border-l-confirmed/60":ke>=.4?"border-l-disputed/60":"border-l-unverified/50"})(),$t=[{count:Be,textCls:"text-confirmed",label:"confirmed"},{count:fe,textCls:"text-disputed",label:"disputed"},{count:Lt,textCls:"text-unverified",label:"unverified"},{count:Zt,textCls:"text-unique",label:"unique"},{count:Yn,textCls:"text-zinc-400",label:"insights"}].filter(P=>P.count>0),Xn=[...new Set(O.map(P=>P.originalAgentId).filter(Boolean))],ml=Xn.slice(0,5),Qn=D[A.id],hl=!!Qn;return a.jsxs("div",{children:[W&&a.jsxs("div",{className:`mb-2 flex items-center gap-3 ${S>0?"mt-4":""}`,children:[a.jsx("span",{className:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:K}),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
66
+ ${Gn}
67
67
  ${hl?"opacity-60 line-through decoration-disputed/40":""}
68
- ${ne?"bg-card border-r-border/60 border-t-border/60 border-b-border/60":"bg-card/50 hover:bg-card/70 hover:border-r-border/60 hover:border-t-border/60 hover:border-b-border/60 hover:shadow-sm hover:shadow-black/20 hover:-translate-y-px"}`,"data-retracted":hl?"true":void 0,children:[hl&&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"}),Xn.retracted_at&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",Xn.retracted_at.slice(0,10)]}),Xn.reason&&a.jsxs("span",{className:"ml-2 text-muted-foreground/80",children:["— ",Xn.reason]})]}),a.jsxs("button",{className:"flex w-full items-start gap-3 px-3 py-2.5 text-left","aria-expanded":ne,onClick:()=>{const P=!ne;g(P?A.id:null),P&&(_("all"),U("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 text-foreground",children:D.length}),a.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"findings"}),a.jsx("span",{className:"text-muted-foreground/30 text-[10px]",children:"·"}),a.jsxs("span",{className:"text-[11px] text-muted-foreground/60",children:[A.rounds,"r"]}),ml.length>0&&a.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[ml.map(P=>a.jsx("span",{title:P,className:"inline-flex h-4 w-4 items-center justify-center rounded-full font-mono text-[8px] font-bold text-background",style:{backgroundColor:Ka(P)},children:Xu(P)},P)),Gn.length>5&&a.jsxs("span",{className:"font-mono text-[9px] text-muted-foreground/40",children:["+",Gn.length-5]})]}),a.jsx("span",{className:"shrink-0 rounded border border-border/30 bg-muted/40 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-muted-foreground",title:A.id,children:A.id.slice(0,8)}),A.droppedFindingsByType&&Object.keys(A.droppedFindingsByType).length>0&&(()=>{const P=Object.entries(A.droppedFindingsByType),ke=P.reduce((et,[,Ut])=>et+Ut,0),Fe=P.map(([et,Ut])=>`${et}:${Ut}`).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=: ${Fe}. These never reach the dashboard, scores, or signals.`,children:[ke," dropped"]})})(),a.jsx("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground/50 shrink-0",children:He(A.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex items-center gap-3",children:$t.map(P=>a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${P.textCls}`,children:[P.count," ",P.label]},P.label))}),A.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 bg-muted/30 px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider text-muted-foreground/50",children:"Topic"}),a.jsx("span",{className:"font-inter text-[11px] leading-relaxed text-muted-foreground/70",children:A.topic})]})]}),a.jsx("span",{className:`mt-1 shrink-0 font-mono text-[10px] text-muted-foreground/40 transition-transform duration-150 ${ne?"rotate-90 text-primary/60":"group-hover:text-muted-foreground/60"}`,children:"▸"})]}),ne&&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] text-muted-foreground/50",children:"Type:"}),om.map(P=>a.jsx("button",{onClick:()=>_(P.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${x===P.key?P.activeCls:P.cls}`,...P.tooltip?{"data-tooltip":P.tooltip}:{},children:P.label},P.key))]}),a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/50",children:"Severity:"}),Jg.map(P=>a.jsx("button",{onClick:()=>U(P.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${C===P.key?P.activeCls:P.cls}`,children:P.label},P.key))]}),A.coverageDegraded&&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:["⚠ Coverage degraded — ",A.coverageDegraded.received," of ",A.coverageDegraded.expected," agents responded"]}),A.coverageDegraded.droppedAgents.length>0&&a.jsxs("p",{className:"mt-0.5 font-mono text-[9px] text-muted-foreground/70",children:["Dropped: ",A.coverageDegraded.droppedAgents.join(", ")]})]}),A.relayCrossReviewSkipped&&A.relayCrossReviewSkipped.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:["⚠ Cross-review skipped: ",A.relayCrossReviewSkipped.length," relay agent",A.relayCrossReviewSkipped.length===1?"":"s"," failed Phase 2"]}),a.jsx("p",{className:"mt-0.5 font-mono text-[9px] text-muted-foreground/70",children:A.relayCrossReviewSkipped.map(P=>P.agentId).join(", ")})]}),(A.crossReviewAssignments||A.crossReviewCoverage)&&(()=>{const P=A.crossReviewAssignments||{},ke=Object.entries(P),Fe=A.crossReviewCoverage||[],et=Fe.length,Ut=Fe.filter(Ue=>Ue.assigned<Ue.targetK);return a.jsxs("details",{className:"mb-3 rounded-md border border-border/30 bg-card/30",children:[a.jsxs("summary",{className:"flex cursor-pointer items-center gap-2 px-3 py-2 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground select-none",children:["Cross-Review Assignments",A.partialReview&&a.jsx("span",{className:"rounded border border-unverified/15 bg-unverified/5 px-1.5 py-0.5 font-mono text-[9px] font-bold normal-case tracking-normal text-unverified",children:"partial"}),a.jsxs("span",{className:"ml-auto font-mono text-[9px] font-normal normal-case tracking-normal text-muted-foreground/50",children:[ke.length," reviewers · ",et," findings"]})]}),a.jsxs("div",{className:"border-t border-border/20 px-3 pb-3 pt-2 space-y-2",children:[ke.map(([Ue,Qn])=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{title:Ue,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full font-mono text-[8px] font-bold text-background",style:{backgroundColor:Ka(Ue)},children:Xu(Ue)}),a.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:Ue}),a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/40",children:["(",Qn.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1 ml-1",children:Qn.map(Vn=>a.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground",children:Vn.length>12?Vn.slice(0,12)+"…":Vn},Vn))})]},Ue)),et>0&&a.jsx("div",{className:"mt-1 pt-1.5 border-t border-border/15",children:Ut.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:["⚠ ",Ut.length," of ",et," findings under-reviewed"]}):a.jsxs("span",{className:"font-mono text-[10px] font-semibold text-confirmed/60",children:["✓ All ",et," findings fully covered"]})})]})]})})(),a.jsx("div",{className:"space-y-3",children:L.length===0?a.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"No findings match this filter."}):L.map((P,ke)=>a.jsx(Pg,{f:P,reviewInfo:P.id?p[P.id]:void 0,diagnostics:ce(P)},ke))})]})]})]},A.id)}),f&&Se>1&&a.jsxs("div",{className:"flex items-center justify-center gap-3 pt-4 font-mono text-[11px] text-muted-foreground",children:[a.jsx("button",{onClick:()=>oe(A=>Math.max(0,A-1)),disabled:J===0,className:"rounded-sm border border-border/40 bg-card px-3 py-1 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{children:["Page ",J+1," of ",Se]}),a.jsx("button",{onClick:()=>oe(A=>Math.min(Se-1,A+1)),disabled:J>=Se-1,className:"rounded-sm border border-border/40 bg-card px-3 py-1 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]}):y.length===0?a.jsx(Bn,{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:y.map((A,S)=>{const H=A.counts,K=(H.agreement||0)+(H.disagreement||0)+(H.hallucination||0)+(H.unverified||0)+(H.unique||0)+(H.new||0),R=K||1,W=v===A.taskId,p=[{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"}],D=A.signals.filter(L=>{if(L.signal==="signal_retracted")return!1;if(x==="all")return!!Lu[L.signal];const ne=Lu[L.signal];return ne&&ne.filter===x}),Y=!!A.retracted;return a.jsxs("div",{className:`rounded-md border bg-card transition ${W?"border-primary/25":"border-border"} ${Y?"opacity-60":""}`,"data-retracted":Y?"true":void 0,title:Y&&A.retractionReason?`Retracted: ${A.retractionReason}`:void 0,children:[Y&&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"}),A.retractedAt&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",A.retractedAt.slice(0,10)]}),A.retractionReason&&a.jsxs("span",{className:"ml-2 text-muted-foreground/80",children:["— ",A.retractionReason]})]}),a.jsxs("button",{"aria-expanded":W,onClick:()=>{const L=!W;g(L?A.taskId:null),L&&(_("all"),U("all"))},className:"flex w-full items-center p-3 text-left transition hover:bg-accent/50",children:[a.jsx("span",{className:`mr-3 font-mono text-xs text-muted-foreground transition ${W?"text-primary":""}`,children:W?"▾":"▸"}),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] text-primary/50",children:A.taskId}),a.jsxs("span",{className:`font-mono text-sm font-semibold text-foreground ${Y?"line-through decoration-disputed/40":""}`,children:[K," findings"]}),a.jsxs("div",{className:"flex gap-1.5",children:[A.agents.slice(0,4).map(L=>a.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:L.split("-").map(ne=>ne[0]).join("").toUpperCase().slice(0,2)},L)),A.agents.length>4&&a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:["+",A.agents.length-4]})]})]}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:He(A.timestamp)})]}),a.jsx("div",{className:"mt-2 flex gap-2",children:p.map(L=>L.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${L.text} ${Y?"line-through decoration-disputed/40":""}`,children:[L.count," ",L.label]},L.key))}),a.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-sm",children:p.map(L=>L.count>0&&a.jsx("div",{className:`${L.color} transition-all`,style:{width:`${L.count/R*100}%`}},L.key))})]})]}),W&&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:om.map(L=>a.jsx("button",{onClick:()=>_(L.key),className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${x===L.key?L.activeCls:L.cls} hover:opacity-80`,...L.tooltip?{"data-tooltip":L.tooltip}:{},children:L.label},L.key))}),D.length===0?a.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"No findings match this filter."}):a.jsx("div",{className:"space-y-2",children:D.map((L,ne)=>{const ce=Lu[L.signal];return ce?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 ${ce.cls}`,children:ce.label}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"text-xs text-muted-foreground [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400",children:a.jsx("span",{className:"finding-md",dangerouslySetInnerHTML:{__html:bs(L.evidence||"")}})}),a.jsxs("span",{className:"ml-2 font-mono text-[10px] text-muted-foreground/50",children:[L.agentId,L.counterpartId?` + ${L.counterpartId}`:""]})]})]},ne):null})})]})]},A.taskId+S)})})]})}const ep={completed:{label:"COMPLETED",cls:"text-confirmed bg-confirmed/10"},failed:{label:"FAILED",cls:"text-destructive bg-destructive/10"},cancelled:{label:"CANCELLED",cls:"text-muted-foreground bg-muted/30"},running:{label:"RUNNING",cls:"text-unverified bg-unverified/10 animate-pulse"}};function tp({task:c,onClose:u}){if(w.useEffect(()=>{if(!c)return;const d=h=>{h.key==="Escape"&&u()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[c,u]),!c)return null;const f=ep[c.status],o=(c.inputTokens||0)+(c.outputTokens||0);return a.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto bg-background/80 p-6 backdrop-blur-sm",onClick:u,children:a.jsxs("div",{className:"relative mt-12 w-full max-w-3xl rounded-lg border border-border bg-card shadow-2xl",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 ${f.cls}`,children:f.label}),a.jsx("span",{className:"shrink-0 rounded border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-amber-400",children:c.taskId.slice(0,8)}),a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(c.agentId)}`,className:"truncate font-mono text-xs text-muted-foreground transition hover:text-primary",children:c.agentId})]}),a.jsxs("div",{className:"mt-2 flex flex-wrap gap-3 font-mono text-[10px] text-muted-foreground",children:[a.jsx("span",{children:He(c.timestamp)}),c.duration!=null&&a.jsxs("span",{children:["· ",xg(c.duration)]}),o>0&&a.jsxs("span",{children:["· ",o.toLocaleString()," tokens (",(c.inputTokens||0).toLocaleString()," in / ",(c.outputTokens||0).toLocaleString()," out)"]})]})]}),a.jsx("button",{onClick:u,className:"shrink-0 rounded-md border border-border/40 bg-card px-2 py-1 font-mono text-xs text-muted-foreground transition hover:bg-accent/50 hover:text-foreground","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 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Task"}),a.jsx("div",{className:"task-md rounded-md border border-border/40 bg-background/40 p-3 text-xs leading-relaxed text-foreground/90 overflow-x-auto",dangerouslySetInnerHTML:{__html:jm(c.task)}})]}),c.result?a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Result"}),a.jsx("div",{className:"finding-md rounded-md border border-border/40 bg-background/40 p-3 font-mono text-xs leading-relaxed text-foreground/90 whitespace-pre-wrap [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:text-purple-400 [&_.inline-code]:rounded [&_.inline-code]:bg-muted/40 [&_.inline-code]:px-1 [&_.inline-code-block]:my-2 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:bg-muted/30 [&_.inline-code-block]:p-2",dangerouslySetInnerHTML:{__html:bs(c.result)}})]}):a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Result"}),a.jsx("div",{className:"rounded-md border border-border/40 bg-background/40 p-3 text-center font-mono text-xs text-muted-foreground",children:c.status==="running"?"Task is still running...":"No result recorded."})]})]})]})})}const np=new Set(["shipped","closed"]);function Dm(c){var d,h,y,v;if(c.filename==="MEMORY.md")return"record";const u=c.filename.split("_")[0].toLowerCase(),f=(h=(d=c.frontmatter)==null?void 0:d.type)==null?void 0:h.toLowerCase(),o=(v=(y=c.frontmatter)==null?void 0:y.status)==null?void 0:v.toLowerCase();return u==="session"?"session":u==="feedback"||u==="user"?"rule":u==="project"?o&&np.has(o)?"record":"backlog":u==="gossip"?"record":f==="session"?"session":f==="feedback"||f==="user"?"rule":f==="reference"?"record":"backlog"}const Om=[{type:"backlog",label:"Backlog",blurb:"Open work, pending decisions"},{type:"record",label:"Record",blurb:"Shipped & closed reference"},{type:"session",label:"Session",blurb:"Per-session recaps"},{type:"rule",label:"Rule",blurb:"Feedback & user preferences"}];function lp(c){return c.origin?`${c.origin}/${c.filename}`:c.filename}function ap(c){const u=new Set,f=[];for(const o of c){const d=lp(o);u.has(d)||(u.add(d),f.push(o))}return f}const ip={backlog:"text-primary",record:"text-text-dim",session:"text-confirmed",rule:"text-unverified"},sp={backlog:"border-primary/30 bg-primary/[0.06]",record:"border-text-dim/30 bg-text-dim/[0.08]",session:"border-confirmed/30 bg-confirmed/[0.06]",rule:"border-unverified/30 bg-unverified/[0.06]"};function cp({folder:c,memories:u,onBack:f,onOpen:o}){const d=Om.find(g=>g.type===c),h=ip[c],y=sp[c],v=w.useMemo(()=>[...u].sort((g,x)=>g.filename<x.filename?1:-1),[u]);return a.jsxs("section",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"mb-3 flex items-center gap-2 font-mono text-xs",children:[a.jsx("button",{onClick:f,className:"font-bold uppercase tracking-widest text-muted-foreground transition hover:text-primary",children:"Memory"}),a.jsx("span",{className:"text-muted-foreground/40",children:"›"}),a.jsx("span",{className:`font-bold uppercase tracking-widest ${h}`,children:d.label}),a.jsx("span",{className:"ml-1 text-muted-foreground/60",children:v.length})]}),v.length===0?a.jsx("div",{className:"flex-1",children:a.jsx(Bn,{title:`No ${d.label.toLowerCase()} memories`,hint:d.blurb})}):a.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:v.map(g=>{const x=up(g),_=rp(g),C=op(g.frontmatter);return a.jsxs("button",{onClick:()=>o(g),className:"group flex flex-col gap-1.5 rounded-md border border-border/40 bg-muted p-3 text-left transition hover:border-primary/30 hover:bg-accent/40",children:[a.jsx("span",{className:`inline-block w-fit rounded-sm border px-1.5 py-[1px] font-mono text-[9px] font-bold uppercase tracking-[0.14em] ${y} ${h}`,children:d.label}),a.jsx("span",{className:"line-clamp-2 text-[13px] font-medium leading-snug text-foreground group-hover:text-primary",children:x}),a.jsxs("div",{className:"flex items-center justify-between gap-2 font-mono text-[10px] text-muted-foreground/70",children:[a.jsx("span",{className:"min-w-0 truncate",children:_}),C&&a.jsx("span",{className:"shrink-0",children:He(C)})]})]},`${g.agentId||""}/${g.filename}`)})})]})}function up(c){var o;const u=(o=c.frontmatter)==null?void 0:o.name;if(u)return u;const f=c.content.split(`
69
- `).find(d=>d.trim().length>0);if(f){const d=f.replace(/^#+\s*/,"").trim();if(d)return d.slice(0,80)}return c.filename.replace(/\.md$/,"")}function rp(c){const u=c.filename.replace(/\.md$/,"");return u||(c.agentId==="_project"?"project":c.agentId||"unknown")}function op(c){if(c)for(const u of["timestamp","updated","updatedAt","modified","created","date"]){const f=c[u];if(f&&!isNaN(new Date(f).getTime()))return f}}function dp({memory:c,onClose:u}){if(w.useEffect(()=>{if(!c)return;const v=g=>{g.key==="Escape"&&u()};return document.addEventListener("keydown",v),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",v),document.body.style.overflow=""}},[c,u]),!c)return null;const f=Dm(c),o=c.agentId==="_project"?"project":c.agentId||"unknown",d=`.gossip/agents/${c.agentId||"_project"}/memory/knowledge/${c.filename}`,h=fp(c.frontmatter),y=Object.entries(c.frontmatter||{});return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-y-auto bg-background/80 p-6 backdrop-blur-sm",onClick:u,children:a.jsxs("div",{className:"relative flex max-h-[calc(100vh-48px)] w-full max-w-xl flex-col overflow-hidden rounded-lg border border-primary/30 bg-card",style:{boxShadow:"0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(139, 92, 246, 0.06)"},onClick:v=>v.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/60 px-4 py-3.5",children:[a.jsx("span",{className:"shrink-0 rounded-sm border border-primary/30 bg-primary/[0.06] px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase tracking-[0.14em] text-primary",children:f}),a.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs font-medium text-foreground",children:c.filename}),a.jsx("button",{onClick:u,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground transition hover:bg-muted hover:text-foreground","aria-label":"Close",children:a.jsx("span",{className:"text-base leading-none",children:"✕"})})]}),a.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto px-4 py-4 text-[13px] leading-relaxed text-foreground",children:[a.jsxs("section",{children:[a.jsx("h3",{className:"mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:"Owner"}),a.jsxs("div",{className:"flex flex-wrap gap-3 font-mono text-[11px] text-muted-foreground",children:[a.jsx("span",{children:o}),h&&a.jsxs("span",{children:["· updated ",He(h)]})]}),a.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground/60",children:d})]}),y.length>0&&a.jsxs("section",{children:[a.jsx("h3",{className:"mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:"Frontmatter"}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border/40 bg-background/40",children:a.jsx("table",{className:"w-full text-left font-mono text-[11px]",children:a.jsx("tbody",{children:y.map(([v,g])=>a.jsxs("tr",{className:"border-b border-border/20 last:border-b-0",children:[a.jsx("td",{className:"w-32 px-3 py-1.5 text-muted-foreground/70",children:v}),a.jsx("td",{className:"px-3 py-1.5 break-all text-foreground/90",children:g})]},v))})})})]}),a.jsxs("section",{children:[a.jsx("h3",{className:"mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:"Content"}),a.jsx("div",{className:"task-md overflow-x-auto rounded-md border border-border/40 bg-background/40 p-3 text-xs leading-relaxed text-foreground/90",dangerouslySetInnerHTML:{__html:jm(c.content)}})]})]})]})})}function fp(c){if(c)for(const u of["timestamp","updated","updatedAt","modified","created","date"]){const f=c[u];if(f&&!isNaN(new Date(f).getTime()))return f}}const mp=new Set(["shipped","closed"]),hp={backlog:"text-primary",record:"text-text-dim",session:"text-confirmed",rule:"text-unverified"},xp={backlog:{bg:"bg-primary",glow:"rgba(139, 92, 246, 0.6)"},record:{bg:"bg-text-dim",glow:"rgba(102, 102, 116, 0.55)"},session:{bg:"bg-confirmed",glow:"rgba(52, 211, 153, 0.55)"},rule:{bg:"bg-unverified",glow:"rgba(251, 191, 36, 0.55)"}},gp={backlog:"bg-primary/[0.06] border-primary/30",record:"bg-text-dim/[0.08] border-text-dim/20",session:"bg-confirmed/[0.06] border-confirmed/25",rule:"bg-unverified/[0.06] border-unverified/25"},pp={backlog:a.jsx("path",{d:"M20 7h-7L10.3 4.3A1 1 0 0 0 9.6 4H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"}),record:a.jsxs(a.Fragment,{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"})]}),session:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}),rule:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})},bp=1440*60*1e3;function vp({memories:c,heading:u="Memory",statusFilter:f=!1}){const[o,d]=w.useState(null),[h,y]=w.useState(null),[v,g]=w.useState("all"),x=w.useMemo(()=>ap(c),[c]),_=w.useMemo(()=>!f||v==="all"?x:x.filter(U=>{var F;const Q=(((F=U.frontmatter)==null?void 0:F.status)||"").toLowerCase();return v==="shipped"?mp.has(Q):Q==="open"||!Q}),[x,f,v]),C=w.useMemo(()=>{const U={backlog:[],record:[],session:[],rule:[]},Q={backlog:!1,record:!1,session:!1,rule:!1},F=Date.now();for(const I of _){const X=Dm(I);U[X].push(I),!Q[X]&&yp(I,F)&&(Q[X]=!0)}return{buckets:U,recent:Q}},[_]);return o?a.jsxs(a.Fragment,{children:[a.jsx(cp,{folder:o,memories:C.buckets[o],onBack:()=>d(null),onOpen:y}),a.jsx(dp,{memory:h,onClose:()=>y(null)})]}):a.jsxs("section",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[a.jsxs("h2",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:[u," ",a.jsx("span",{className:"text-primary",children:_.length})]}),f&&a.jsx("div",{className:"flex gap-1 font-mono text-[10px]",role:"tablist","aria-label":"Status filter",children:["all","open","shipped"].map(U=>a.jsx("button",{role:"tab","aria-selected":v===U,onClick:()=>g(U),className:`rounded-sm border px-2 py-0.5 uppercase tracking-widest transition ${v===U?"border-primary/50 bg-primary/10 text-primary":"border-border/30 text-muted-foreground hover:border-primary/30 hover:text-foreground"}`,children:U},U))})]}),a.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:Om.map(({type:U,label:Q,blurb:F})=>{const I=C.buckets[U].length,X=C.recent[U],de=hp[U],Z=xp[U],$=gp[U],V=I===0;return a.jsxs("button",{onClick:()=>d(U),disabled:V,className:`group relative grid grid-cols-[auto_1fr_auto] grid-rows-[auto_auto] items-center gap-x-3 gap-y-1 rounded-md border bg-muted p-3.5 text-left transition ${V?"cursor-default border-border/20 opacity-55":"border-border/40 hover:border-primary/30 hover:bg-accent/40"}`,children:[a.jsxs("span",{className:`relative row-span-2 flex h-9 w-9 items-center justify-center rounded-sm border ${$} ${de}`,"aria-hidden":!0,children:[X&&a.jsx("span",{className:`pointer-events-none absolute -right-1 -top-1 h-1.5 w-1.5 rounded-full ${Z.bg}`,style:{boxShadow:`0 0 8px ${Z.glow}`},"data-tooltip":"Activity in the last 24h","aria-label":"Activity in the last 24h"}),a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:pp[U]})]}),a.jsx("span",{className:"self-end font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:Q}),a.jsx("span",{className:`row-span-2 self-center font-mono text-sm font-bold tabular-nums ${V?"text-muted-foreground/40":de}`,children:I}),a.jsx("span",{className:"self-start font-mono text-[10px] leading-snug text-muted-foreground/70",children:F})]},U)})})]})}function yp(c,u){const f=c.frontmatter;if(!f)return!1;for(const o of["lastAccessed","updated","timestamp","updatedAt","modified","created","date"]){const d=f[o];if(!d)continue;const h=new Date(d).getTime();if(!isNaN(h)&&u-h<=bp)return!0}return!1}function jp(c){const u=new Map;for(const o of c){const d=u.get(o.agentId)??[];d.push(o),u.set(o.agentId,d)}const f=[];for(const[o,d]of u){d.sort((y,v)=>y.day.localeCompare(v.day));const h=d.length>0?d[d.length-1].accuracy:0;f.push({agentId:o,points:d,latest:h})}return f.sort((o,d)=>d.latest-o.latest),f}function Np({values:c,className:u}){if(c.length===0)return a.jsx("svg",{width:120,height:20});if(c.length===1){const y=20-c[0]*20;return a.jsx("svg",{width:120,height:20,className:u,children:a.jsx("circle",{cx:120/2,cy:y,r:2,fill:"currentColor"})})}const d=120/(c.length-1),h=c.map((y,v)=>`${(v*d).toFixed(1)},${(20-y*20).toFixed(1)}`).join(" ");return a.jsx("svg",{width:120,height:20,className:u,children:a.jsx("polyline",{points:h,fill:"none",stroke:"currentColor",strokeWidth:1.5})})}function Sp(){const[c,u]=w.useState(null),[f,o]=w.useState(null);w.useEffect(()=>{Qe("fleet-trend?days=30").then(u).catch(h=>o(String((h==null?void 0:h.message)??h)))},[]);const d=w.useMemo(()=>c?jp(c.points):[],[c]);return a.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Fleet Health Trend"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"last 30d"})]}),!c&&!f&&a.jsx(Bn,{title:"Loading…",compact:!0}),f&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"failed to load trend data"}),!f&&c&&d.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"no recent consensus signals"}),!f&&d.length>0&&a.jsx("ul",{className:"space-y-1.5",children:d.map(h=>{const y=h.latest===0;return a.jsxs("li",{className:`flex items-center justify-between gap-3 text-xs${y?" opacity-40":""}`,children:[a.jsx("span",{className:"truncate font-mono text-foreground",children:h.agentId}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Np,{values:h.points.map(v=>v.accuracy),className:h.latest>=.7?"text-confirmed":h.latest>=.4?"text-unverified":"text-disputed"}),a.jsxs("span",{className:"w-10 text-right tabular-nums text-muted-foreground",children:[Math.round(h.latest*100),"%"]})]})]},h.agentId)})})]})}function _p(){var v;const[c,u]=w.useState(null),[f,o]=w.useState(null);w.useEffect(()=>{let g=!1;return Qe("violations?pageSize=1").then(x=>{g||u(x)}).catch(x=>{g||o(String((x==null?void 0:x.message)??x))}),()=>{g=!0}},[]);const d=(c==null?void 0:c.total)??0,h=((v=c==null?void 0:c.items)==null?void 0:v[0])??null,y=d>0;return a.jsxs("div",{className:`rounded-lg border ${y?"border-destructive/30 bg-destructive/10":"border-border bg-muted/20"}`,children:[a.jsxs("div",{className:`flex items-center justify-between border-b px-3.5 py-3 ${y?"border-destructive/20 bg-destructive/[0.06]":"border-border/40"}`,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`inline-flex h-4 w-4 items-center justify-center rounded-sm font-mono text-[11px] font-bold ${y?"bg-destructive/15 text-destructive":"bg-muted text-muted-foreground"}`,children:"!"}),a.jsx("span",{className:`min-w-0 truncate font-mono text-[11px] font-bold uppercase tracking-widest ${y?"text-destructive":"text-muted-foreground"}`,children:"Process Violations"})]}),y&&a.jsx("span",{className:"shrink-0 rounded-full border border-destructive/20 bg-destructive/10 px-2 py-0.5 font-mono text-xs font-bold text-destructive",children:d})]}),a.jsxs("div",{className:"min-h-[52px] px-3.5 py-3",children:[f&&a.jsx("p",{className:"font-mono text-[10px] text-muted-foreground",children:"failed to load violation data"}),!f&&!c&&a.jsx("p",{className:"font-mono text-[10px] text-muted-foreground/60",children:"Loading…"}),!f&&c&&!y&&a.jsx("p",{className:"font-mono text-[10px] text-muted-foreground/70",children:"No violations detected"}),!f&&c&&y&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"font-mono text-[11px] text-foreground",children:[d," direct master push",d===1?"":"es"," detected"]}),h&&a.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[a.jsx("span",{className:"shrink-0",children:"Most recent:"}),a.jsx("span",{className:"truncate text-foreground",children:h.agentId}),a.jsx("span",{className:"shrink-0 text-muted-foreground/50",children:He(h.detectedAt)})]})]}),!f&&c&&a.jsx("div",{className:"mt-2 text-right",children:a.jsx("a",{href:fl("/violations"),className:`font-mono text-[10px] transition hover:underline ${y?"text-destructive":"text-muted-foreground hover:text-foreground"}`,children:"View all →"})})]})]})}const xs=25;function Tp({commits:c}){const[u,f]=w.useState(!1);if(c.length===0)return a.jsx("span",{className:"text-muted-foreground/50",children:"—"});const o=c[0],d=o.includes(" ")?o.slice(o.indexOf(" ")+1):o,h=c.length-1;return a.jsxs("span",{className:"font-mono text-[11px]",children:[a.jsx("span",{className:"text-foreground",children:d}),h>0&&a.jsxs(a.Fragment,{children:[" ",a.jsx("button",{type:"button","aria-expanded":u,onClick:()=>f(y=>!y),className:"font-mono text-[10px] text-muted-foreground/70 underline hover:text-foreground",children:u?"(collapse)":`(+${h} more)`}),u&&a.jsx("ul",{className:"mt-1 space-y-0.5 pl-2",children:c.slice(1).map((y,v)=>{const g=y.includes(" ")?y.slice(y.indexOf(" ")+1):y;return a.jsx("li",{className:"font-mono text-[10px] text-muted-foreground/80",children:g},v)})})]})]})}function Ep({row:c}){const u=c.preSha.slice(0,8),f=c.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] text-muted-foreground/80",children:He(c.detectedAt)}),a.jsx("td",{className:"max-w-[160px] truncate whitespace-nowrap py-3 pr-4",children:a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(c.agentId)}`,className:"font-mono text-[11px] text-foreground hover:text-primary hover:underline",children:c.agentId})}),a.jsxs("td",{className:"whitespace-nowrap py-3 pr-4 font-mono text-[10px]",children:[a.jsx("span",{className:"text-muted-foreground/70",children:u}),a.jsx("span",{className:"mx-1 text-muted-foreground/40",children:"→"}),a.jsx("span",{className:"text-foreground",children:f})]}),a.jsx("td",{className:"py-3 pr-4",children:a.jsx(Tp,{commits:c.commits})})]})}function Ap(){const[c,u]=w.useState([]),[f,o]=w.useState(0),[d,h]=w.useState(1),[y,v]=w.useState(!1),[g,x]=w.useState(null);w.useEffect(()=>{let C=!1;return v(!0),x(null),Qe(`violations?page=${d}&pageSize=${xs}`).then(U=>{C||(u(U.items??[]),o(U.total??0))}).catch(U=>{C||x(String((U==null?void 0:U.message)??U))}).finally(()=>{C||v(!1)}),()=>{C=!0}},[d]);const _=Math.max(1,Math.ceil(f/xs));return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Process Violations"}),f>0&&a.jsx("span",{className:"rounded-full border border-destructive/30 bg-destructive/10 px-2 py-0.5 font-mono text-xs font-bold text-destructive",children:f})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/70",children:"Direct master pushes detected by the ref-allowlist enforcer"})]}),a.jsxs("div",{className:"overflow-hidden rounded-md border border-border/40 bg-card/80",children:[g&&a.jsx("div",{className:"border-b border-border/60 bg-destructive/10 px-3 py-2 font-mono text-[10px] text-destructive",children:g}),!g&&a.jsxs("table",{className:"w-full table-fixed text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/40 bg-muted/20 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/80",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:[!y&&c.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center font-mono text-[11px] text-muted-foreground/50",children:"No violations recorded"})}),y&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center font-mono text-[10px] text-muted-foreground/50",children:"Loading…"})}),!y&&c.map(C=>a.jsx(Ep,{row:C},`${C.taskId}-${C.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] text-muted-foreground/60",children:y?"loading…":f===0?"no violations":`${(d-1)*xs+1}–${Math.min(d*xs,f)} of ${f}`}),a.jsxs("div",{className:`flex items-center gap-2 font-mono text-[10px] text-muted-foreground ${_<=1?"invisible":""}`,children:[a.jsx("button",{type:"button",onClick:()=>h(C=>Math.max(1,C-1)),disabled:d===1||y,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[d," / ",_]}),a.jsx("button",{type:"button",onClick:()=>h(C=>Math.min(_,C+1)),disabled:d>=_||y,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]})]})]})}const Yu=[{key:"passed",label:"passed",bar:"bg-emerald-400",dot:"bg-emerald-400",text:"text-emerald-400"},{key:"pending",label:"pending",bar:"bg-sky-400",dot:"bg-sky-400",text:"text-sky-400"},{key:"insufficient_evidence",label:"insufficient",bar:"bg-yellow-400",dot:"bg-yellow-400",text:"text-yellow-400"},{key:"inconclusive",label:"inconclusive",bar:"bg-orange-400",dot:"bg-orange-400",text:"text-orange-400"},{key:"silent_skill",label:"silent",bar:"bg-zinc-500",dot:"bg-zinc-500",text:"text-zinc-400"},{key:"failed",label:"failed",bar:"bg-red-400",dot:"bg-red-400",text:"text-red-400"}];function Mp({overview:c}){const u=c==null?void 0:c.skillVerdictSummary,f=u?Yu.reduce((o,d)=>o+(u[d.key]??0),0):0;return a.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Skill Verdicts"}),a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:[f," total"]})]}),!u||f===0?a.jsx("p",{className:"font-mono text-[11px] text-muted-foreground/60",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 bg-muted/40",children:Yu.map(o=>{const d=u[o.key]??0;if(d===0)return null;const h=d/f*100;return a.jsx("div",{className:o.bar,style:{width:`${h}%`},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:Yu.map(o=>{const d=u[o.key]??0,h=d===0;return a.jsxs("li",{className:`flex items-center gap-1.5 ${h?"opacity-40":""}`,children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${o.dot}`}),a.jsx("span",{className:"text-muted-foreground",children:o.label}),a.jsx("span",{className:`ml-auto tabular-nums ${h?"text-muted-foreground/50":o.text}`,children:d})]},o.key)})})]})]})}const dm=["bg-primary/70","bg-cyan-500/60","bg-unique","bg-muted-foreground/60","bg-primary/50","bg-confirmed/70"];function fm(c){let u=0;for(let f=0;f<c.length;f++)u=u*31+c.charCodeAt(f)>>>0;return dm[u%dm.length]}function wp({overview:c}){const u=c==null?void 0:c.droppedFindingTypeCounts,f=u?Object.entries(u).sort((d,h)=>h[1]-d[1]):[],o=f.reduce((d,[,h])=>d+h,0);return a.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsxs("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Invalid Output Types",a.jsx("span",{className:"text-muted-foreground/50 font-normal normal-case ml-2",children:"agent_finding tags rejected by the parser"})]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"last 20 rounds"})]}),o===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"all clean — no invalid types"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mb-3 flex h-3 w-full overflow-hidden rounded",children:f.map(([d,h])=>{const y=h/o*100;return a.jsx("div",{className:fm(d),style:{width:`${y}%`},title:`invalid type "${d}" emitted ${h} times in last 20 consensus rounds`},d)})}),a.jsx("ul",{className:"space-y-1 text-xs",children:f.map(([d,h])=>a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`h-2 w-2 rounded-sm ${fm(d)}`}),a.jsx("span",{className:"truncate font-mono text-foreground",children:d}),a.jsx("span",{className:"ml-auto tabular-nums text-muted-foreground",children:h})]},d))})]})]})}function Cp({categoryAccuracy:c,categoryCorrect:u,categoryHallucinated:f}){const o=Object.keys(c??{});if(o.length===0)return a.jsx(Bn,{title:"No category data yet",hint:"Accuracy accrues after ≥5 signals per category.",compact:!0});const d=o.map(h=>{const y=Math.max(0,Math.min(1,c[h]??0)),v=(u==null?void 0:u[h])??0,g=(f==null?void 0:f[h])??0;return{key:h,acc:y,c:v,h:g,n:v+g}}).sort((h,y)=>y.acc-h.acc);return a.jsx("div",{className:"space-y-2",children:d.map(h=>{const y=h.acc>=.7?"bg-confirmed":h.acc>=.4?"bg-unverified":"bg-disputed",v=h.n>0?`${h.c} correct / ${h.h} hallucinated / ${h.n} total`:void 0;return a.jsxs("div",{className:`grid grid-cols-[128px_1fr_auto_44px] items-center gap-3 ${h.n>0&&h.n<10?"opacity-50":""}`,title:h.n>0&&h.n<10?`${v} — low sample (n<10)`:v,children:[a.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:h.key.replace(/_/g," ")}),a.jsx("div",{className:"h-2 overflow-hidden rounded-sm bg-muted/30",children:a.jsx("div",{className:`h-full rounded-sm transition-all ${y}`,style:{width:`${h.acc*100}%`}})}),a.jsx("span",{className:"shrink-0 text-right font-mono text-[10px] tabular-nums text-muted-foreground/60 w-16",children:h.n>0?a.jsxs(a.Fragment,{children:[h.c,"/",h.n,h.h>0&&a.jsxs("span",{className:"ml-1 text-disputed/70",children:["·",h.h,"✗"]})]}):"—"}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums text-foreground",children:[Math.round(h.acc*100),"%"]})]},h.key)})})}const zp=new Set(["passed","failed","silent_skill","insufficient_evidence","flagged_for_manual_review"]);function Dp(c,u,f){return(!c||!zp.has(c))&&u!==void 0&&f!==void 0&&f>0}const Op={silent_skill:"No signals recorded after bind — skill may not be injecting correctly",insufficient_evidence:"Fewer than 120 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"},Rp={pending:"border-border/50 bg-muted/30 text-muted-foreground",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-orange-400/40 bg-orange-500/10 text-orange-400",flagged_for_manual_review:"border-disputed/40 bg-disputed/10 text-disputed"};function kp(c){const u=Math.round(c*100),f=u>0?"+":"",o=u>0?"text-confirmed":u<0?"text-disputed":"text-muted-foreground";return{text:`${f}${u}pp`,cls:o}}function Up({slot:c}){const u=c.status,f=u?Rp[u]:"border-border/50 bg-muted/30 text-muted-foreground",o=u==="inconclusive"&&(c.inconclusiveStrikes??0)>0,d=c.forcedDevelops??[],h=d.length>0?d[d.length-1]:null,y=typeof c.effectiveness=="number"?kp(c.effectiveness):null,v=Dp(u,c.postBindSignals,c.minEvidence);return a.jsxs("div",{className:`rounded-md border bg-card/80 p-3 ${c.enabled?"border-border/50":"border-border/30 opacity-60"}`,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 ${c.enabled?"text-foreground":"text-muted-foreground line-through"}`,children:[c.mode==="contextual"&&"⚡ ",c.name]}),a.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground",children:c.source}),c.mode==="contextual"&&a.jsx("span",{className:"rounded-sm border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 font-mono text-[9px] text-amber-400",children:"contextual"})]}),a.jsxs("div",{className:"mt-1 font-mono text-[10px] text-muted-foreground/60",children:["bound ",He(c.boundAt)]}),v&&(()=>{const g=c.postBindSignals,x=c.minEvidence,_=Math.round(g/x*100),C=Math.min(g/x,1)*100;return a.jsxs("div",{className:"mt-1.5",title:`MIN_EVIDENCE gate: ${g} of ${x} post-bind signals (${_}%)`,children:[a.jsxs("div",{className:"mb-0.5 font-mono text-[9px] text-muted-foreground/50",children:["post-bind: ",g," / ",x]}),a.jsx("div",{className:"relative h-1 w-full overflow-hidden rounded-full border border-border/40 bg-muted/30",children:a.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full border-r border-confirmed/40 bg-confirmed/20",style:{width:`${C}%`}})})]})})()]}),u&&a.jsx("span",{className:`shrink-0 rounded-sm border px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${f}`,title:Op[u],children:u.replace(/_/g," ")})]}),a.jsxs("div",{className:"mt-2 flex items-center gap-3 font-mono text-[10px]",children:[y&&a.jsx("span",{className:y.cls,title:"Effectiveness: change in hallucination rate pre/post",children:y.text}),o&&a.jsxs("span",{className:"text-unique",title:c.inconclusiveAt?`last strike ${He(c.inconclusiveAt)}`:void 0,children:[c.inconclusiveStrikes," strike",c.inconclusiveStrikes===1?"":"s"]})]}),d.length>0&&a.jsxs("div",{className:"mt-2 border-t border-border/40 pt-2 font-mono text-[10px] text-muted-foreground",title:h!=null&&h.reason?`latest: ${h.reason}`:void 0,children:["forced ",d.length," time",d.length===1?"":"s",h&&` · last ${He(h.timestamp)}`]})]})}function qp({open:c,onOpenChange:u,children:f}){return w.useEffect(()=>{if(!c)return;const o=h=>{h.key==="Escape"&&u(!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}},[c,u]),c?a.jsxs("div",{className:"fixed inset-0 z-50",children:[a.jsx("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-sm",onClick:()=>u(!1)}),a.jsx("div",{className:"absolute inset-y-0 right-0 flex",children:a.jsx("div",{onClick:o=>o.stopPropagation(),className:"contents",children:f})})]}):null}function Hp({side:c="right",className:u="",children:f,...o}){return a.jsx("div",{className:`h-full border-l border-border/60 bg-card shadow-xl p-6 ${u}`,...o,children:f})}function Bp({className:c="",...u}){return a.jsx("div",{className:`mb-2 ${c}`,...u})}function Lp({className:c="",...u}){return a.jsx("h2",{className:`font-semibold ${c}`,...u})}function Yp({citation:c}){const u=c.snippet.split(`
70
- `);return a.jsxs("div",{className:"rounded-md border border-border/40 bg-card/60 overflow-hidden",children:[a.jsx("div",{className:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/40",children:a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:[c.file,":",c.line]})}),a.jsx("pre",{className:"px-3 py-2 font-mono text-[11px] leading-relaxed overflow-x-auto",children:u.map((f,o)=>a.jsx("div",{className:"whitespace-pre",children:f||" "},o))})]})}const Gp={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:"text-muted-foreground bg-muted/50"},Xp={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-muted-foreground bg-muted border border-border/40",newFinding:"text-unique bg-unique/10 border border-unique/20"};function vs({open:c,onOpenChange:u,consensusId:f,findingId:o}){const[d,h]=w.useState(null),[y,v]=w.useState(null);return w.useEffect(()=>{if(!c||!f||!o){h(null),v(null);return}h(null),v(null),Qe(`finding/${encodeURIComponent(f)}/${encodeURIComponent(o)}`).then(h).catch(g=>v(g.message||"failed to load finding"))},[c,f,o]),a.jsx(qp,{open:c,onOpenChange:u,children:a.jsxs(Hp,{side:"right",className:"w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto",children:[a.jsx(Bp,{children:a.jsx(Lp,{className:"font-mono text-sm",children:"Finding detail"})}),y&&a.jsx("div",{className:"mt-4 text-[11px] text-disputed",children:y}),!y&&!d&&a.jsx("div",{className:"mt-4 text-[11px] text-muted-foreground",children:"Loading…"}),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-widest px-2 py-0.5 rounded ${Xp[d.finding.tag]||"bg-muted"}`,children:d.finding.tag}),d.finding.severity&&a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded ${Gp[d.finding.severity]||"bg-muted"}`,children:d.finding.severity}),a.jsxs("span",{className:"font-mono text-[9px] text-muted-foreground",children:["by ",d.finding.originalAgentId]}),d.retracted&&a.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded bg-disputed/50",children:"retracted"})]}),a.jsx("div",{className:"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-widest text-muted-foreground",children:"Citations"}),d.citations.map((g,x)=>a.jsx(Yp,{citation:g},x))]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-muted-foreground",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((g,x)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-disputed",children:"✗"})," disputed by ",g.agentId,": ",a.jsx("span",{className:"text-muted-foreground",children:g.reason})]},x)),d.finding.confirmedBy.length===0&&d.finding.disputedBy.length===0&&a.jsx("div",{className:"text-[11px] text-muted-foreground",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-widest text-muted-foreground",children:["Signals (",d.signals.length,")"]}),a.jsx("div",{className:"space-y-1",children:d.signals.map((g,x)=>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:g.signal}),a.jsx("span",{className:"text-muted-foreground",children:"·"}),a.jsx("span",{children:g.agentId}),g.counterpartId&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-muted-foreground",children:"→"}),a.jsx("span",{children:g.counterpartId})]}),a.jsx("span",{className:"text-muted-foreground ml-auto",children:He(g.timestamp)})]}),g.evidence&&a.jsx("div",{className:"text-muted-foreground mt-0.5",children:g.evidence.slice(0,200)})]},x))})]}),a.jsx("div",{className:"pt-2 border-t border-border/40",children:a.jsxs("a",{href:`#/consensus/${d.consensusId}`,className:"font-mono text-[10px] text-primary hover:underline",children:["→ consensus round ",d.consensusId]})})]})]})})}const Qp={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 Vp({agentId:c}){const[u,f]=w.useState([]),[o,d]=w.useState(!0),[h,y]=w.useState("all"),[v,g]=w.useState(null);w.useEffect(()=>{let U=!1;return d(!0),Qe(`signals?agent=${encodeURIComponent(c)}&limit=100`).then(Q=>{U||(f(Q.items||[]),d(!1))}).catch(()=>{U||(f([]),d(!1))}),()=>{U=!0}},[c]);const x=[...u].sort((U,Q)=>(Q.timestamp||"").localeCompare(U.timestamp||"")),_=h==="all"||h==="signals"?x:[],C=({k:U,label:Q,enabled:F})=>a.jsx("button",{type:"button",onClick:()=>F&&y(U),disabled:!F,className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${h===U?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"} ${F?"":"opacity-40 cursor-not-allowed"}`,children:Q});return a.jsxs("div",{className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsx("span",{className:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Activity"}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(C,{k:"all",label:"All",enabled:!0}),a.jsx(C,{k:"signals",label:"Signals",enabled:!0}),a.jsx(C,{k:"tasks",label:"Tasks (none yet)",enabled:!1}),a.jsx(C,{k:"skills",label:"Skills (none yet)",enabled:!1})]})]}),o?a.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"Loading…"}):_.length===0?a.jsx(Bn,{title:"No activity yet",hint:"Signals, task completions, and skill binds will appear here.",compact:!0}):a.jsx("div",{className:"space-y-1",children:_.map((U,Q)=>{const F=Qp[U.signal]||"text-muted-foreground bg-muted",I=!!(U.consensusId&&U.findingId),X=a.jsxs("div",{className:"flex items-start gap-2 py-1.5",children:[a.jsx("span",{className:"shrink-0 font-mono text-[9px] text-muted-foreground/60 tabular-nums w-16",children:He(U.timestamp)}),a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${F}`,children:U.signal}),a.jsxs("div",{className:"min-w-0 flex-1 text-[11px] text-muted-foreground",children:[U.counterpartId&&a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:["→ ",U.counterpartId," · "]}),U.evidence&&a.jsx("span",{children:U.evidence.length>160?U.evidence.slice(0,160)+"…":U.evidence})]})]});return I?a.jsx("button",{type:"button",onClick:()=>g({consensusId:U.consensusId,findingId:U.findingId}),className:"w-full rounded-sm text-left transition hover:bg-accent/40",children:X},Q):a.jsx("div",{children:X},Q)})}),a.jsx(vs,{open:!!v,onOpenChange:U=>{U||g(null)},consensusId:(v==null?void 0:v.consensusId)??null,findingId:(v==null?void 0:v.findingId)??null})]})}function Zp(){const c=w.useRef(null),[u,f]=w.useState(0);return w.useEffect(()=>{const o=c.current;if(!o||typeof ResizeObserver>"u")return;const d=new ResizeObserver(h=>{for(const y of h)f(y.contentRect.width)});return d.observe(o),()=>d.disconnect()},[]),[c,u]}const $p={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"},Kp={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"},Jp=6,Fp=500,Rm=100,Ip=150;function Wp(c){if(c<=0)return Rm;const u=Math.floor(c/Jp);return Math.max(1,Math.min(u,Fp))}function Pp({agentId:c}){const[u,f]=w.useState([]),[o,d]=w.useState(0),[h,y]=w.useState(!1),[v,g]=w.useState(null),[x,_]=Zp(),[C,U]=w.useState(Rm),Q=w.useRef(null);w.useEffect(()=>{if(_<=0)return;const Z=Wp(_);return Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>{U($=>$===Z?$:Z)},Ip),()=>{Q.current&&clearTimeout(Q.current)}},[_]),w.useEffect(()=>{Qe(`signals?agent=${encodeURIComponent(c)}&limit=${C}`).then(Z=>{f(Z.items||[]),d(Z.total||0)}).catch(()=>{})},[c,C]);const F=w.useMemo(()=>[...u].reverse(),[u]),I={confirmed:0,disputed:0,unique:0,unverified:0,fabricated:0};for(const Z of u)Z.signal==="agreement"||Z.signal==="consensus_verified"?I.confirmed++:Z.signal==="disagreement"||Z.signal==="hallucination_caught"?I.disputed++:Z.signal==="unique_confirmed"||Z.signal==="unique_unconfirmed"||Z.signal==="new_finding"?I.unique++:Z.signal==="unverified"?I.unverified++:Z.signal==="citation_fabricated"&&I.fabricated++;const X=u.length,de=o>X;return u.length===0?a.jsx("div",{ref:x,className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",children:a.jsx(Bn,{title:"No signal history yet",hint:"Signals are recorded during consensus rounds.",compact:!0})}):a.jsxs("div",{ref:x,className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",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:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Signal Timeline"}),a.jsx("span",{className:"font-mono text-[9px] text-muted-foreground/50",children:de?`last ${X} 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:[I.confirmed," confirmed"]}),I.disputed>0&&a.jsxs("span",{className:"text-disputed",children:[I.disputed," disputed"]}),I.unique>0&&a.jsxs("span",{className:"text-unique",children:[I.unique," unique"]}),I.unverified>0&&a.jsxs("span",{className:"text-unverified",children:[I.unverified," unverified"]}),I.fabricated>0&&a.jsxs("span",{className:"text-amber-500",children:[I.fabricated," fabricated"]})]})]}),a.jsx("div",{className:"flex items-center gap-0.5",children:F.map((Z,$)=>{const V=!!(Z.consensusId&&Z.findingId);return a.jsx("button",{type:"button",disabled:!V,onClick:()=>{Z.consensusId&&Z.findingId&&(g({consensusId:Z.consensusId,findingId:Z.findingId}),y(!0))},className:`h-4 min-w-[4px] flex-1 rounded-sm transition-opacity hover:opacity-80 ${$p[Z.signal]||"bg-muted"} ${V?"cursor-pointer":"cursor-default"}`,title:`${Kp[Z.signal]||Z.signal} — ${He(Z.timestamp)}${V?" (click for detail)":""}`},$)})}),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(Z=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:`h-2 w-2 rounded-sm ${Z.color}`}),a.jsx("span",{className:"font-mono text-[9px] text-muted-foreground/60",children:Z.label})]},Z.label))}),a.jsx(vs,{open:h,onOpenChange:y,consensusId:(v==null?void 0:v.consensusId)??null,findingId:(v==null?void 0:v.findingId)??null})]})}function e0(c){const u=c.toLowerCase();return u==="completed"||u==="done"||u==="success"||u==="succeeded"?"completed":u==="running"||u==="active"||u==="in_progress"||u==="pending"?"running":u==="failed"||u==="error"||u==="errored"||u==="timeout"||u==="timed_out"?"failed":u==="cancelled"||u==="canceled"||u==="queued"||u==="waiting"?"cancelled":"unknown"}const t0={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:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1},unknown:{label:"Unknown",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1}},n0={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 l0(c){if(!c)return"—";if(c<1e3)return"< 1s";if(c<6e4)return Math.floor(c/1e3)+"s";if(c<36e5){const o=Math.floor(c/6e4),d=Math.floor(c%6e4/1e3);return d>0?`${o}m ${d}s`:`${o}m`}const u=Math.floor(c/36e5),f=Math.floor(c%36e5/6e4);return f>0?`${u}h ${f}m`:`${u}h`}function km({task:c,onClick:u}){const f=e0(c.status),o=t0[f];return a.jsxs("tr",{className:`border-b border-border hover:bg-accent/30 transition-colors ${u?"cursor-pointer":""}`,onClick:u?d=>{d.target.closest("a")||u(c)}: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":""}`,"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:n0[f]})}),a.jsx("span",{className:`font-mono text-[10px] font-semibold uppercase tracking-wider ${o.text}`,children:o.label})]})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsx("span",{className:"rounded border border-amber-500/25 bg-amber-500/8 px-2 py-1 font-mono text-[10px] font-semibold text-amber-400",children:c.taskId.slice(0,8)})}),a.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs text-muted-foreground",children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(c.agentId)}`,className:"inline-flex items-center gap-1.5 transition hover:text-primary",children:[a.jsx("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:Ka(c.agentId)}}),c.agentId]})}),a.jsx("td",{className:"py-2.5 pr-3 font-inter text-sm text-foreground/80",children:(()=>{const d=c.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 text-muted-foreground",children:f==="running"?"running":l0(c.duration)}),a.jsx("td",{className:"py-2.5 pr-4 text-right font-mono text-xs text-muted-foreground/50",children:He(c.timestamp)})]})}const a0=3,i0=720*60*60*1e3;function s0({agentId:c,agents:u,tasks:f,consensus:o}){const d=u.find(R=>R.id===c),[h,y]=w.useState([]),[v,g]=w.useState([]),[x,_]=w.useState(null),[C,U]=w.useState(null),[Q,F]=w.useState(null),[I,X]=w.useState(0),[de,Z]=w.useState(0);w.useEffect(()=>{Qe(`memory/${c}`).then(R=>{y(R.knowledge||[])}).catch(()=>y([]))},[c]),w.useEffect(()=>{let R=!1;return Qe("consensus-reports?page=1&pageSize=200").then(W=>{R||g(W.reports||[])}).catch(()=>{R||g([])}),()=>{R=!0}},[]);const $=w.useMemo(()=>{var D;const R=Date.now(),W=new Map;for(const Y of v){const L=Date.parse(Y.timestamp);if(Number.isNaN(L)||R-L>i0)continue;const ne=(D=Y.authorDiagnostics)==null?void 0:D[c];if(ne)for(const ce of ne)W.set(ce.code,(W.get(ce.code)??0)+1)}const p=[];for(const[Y,L]of W)L>=a0&&p.push({code:Y,count:L});return p},[v,c]);if(!d)return a.jsxs("div",{className:"py-20 text-center text-muted-foreground",children:["Agent not found: ",c]});const V=d.scores,O=(f==null?void 0:f.items.filter(R=>R.agentId===c))||[],ae=(o==null?void 0:o.runs.filter(R=>R.agents.includes(c)))||[],G=[{label:"accuracy",value:V.accuracy,fill:V.accuracy>=.7?"bg-confirmed":V.accuracy>=.4?"bg-unverified":"bg-disputed"},{label:"reliability",value:V.taskCompletionRate??0,fill:"bg-chart",tooltip:"Task completion rate — fraction of dispatched tasks that finished without pipeline error or timeout"},{label:"unique",value:V.uniqueness,fill:"bg-unique"},{label:"impact",value:V.impactScore,fill:"bg-[var(--color-impact)]"}],te=V.unverifiedsEmitted??0,ue=V.unverifiedsReceived??0,oe=te+ue,Se=[{label:"Signals",value:String(V.signals),color:"text-foreground"},{label:"Agreements",value:String(V.agreements),color:"text-confirmed"},{label:"Disagreements",value:String(V.disagreements),color:"text-disputed"},{label:"Hallucinations",value:String(V.hallucinations),color:V.hallucinations>0?"text-disputed":"text-muted-foreground"},{label:"Unverified",value:oe>0?`${te}↑ ${ue}↓`:"0",color:oe>0?"text-unverified":"text-muted-foreground",title:oe>0?`${te} emitted (as reviewer) · ${ue} received (as author)`:void 0},{label:"Tokens",value:d.totalTokens.toLocaleString(),color:"text-foreground"}],J=10,ie=Math.max(1,Math.ceil(O.length/J)),he=Math.min(I,ie-1),A=O.slice(he*J,(he+1)*J),S=w.useMemo(()=>{const R=new Map;for(const W of h){const p=W.filename.match(/^(\d{4}-\d{2}-\d{2})/),D=p?p[1]:"undated",Y=R.get(D)||[];Y.push(W),R.set(D,Y)}return Array.from(R.entries()).sort(([W],[p])=>W==="undated"?1:p==="undated"?-1:p.localeCompare(W)).map(([W,p])=>({day:W,items:p}))},[h]),H=Math.min(de,Math.max(0,S.length-1)),K=S[H];return a.jsxs(a.Fragment,{children:[(()=>{const R=Ju(V);return R==="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 (",V.bench.reason??"unknown","). Agent excluded from dispatch until scores recover."]})]})}):R==="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:[V.consecutiveFailures,"+ consecutive failures. Deprioritized until clean signals recorded."]})]})}):R==="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 (",V.bench.reason??"rule","), but is the sole provider of a category — kept to preserve coverage."]})]})}):null})(),$.length>0&&a.jsx("div",{className:"mb-6 space-y-2",children:$.map(({code:R,count:W})=>a.jsxs("div",{className:"rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3","data-diagnostic-code":R,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:Vu(R)}}),a.jsxs("span",{className:"font-mono text-[11px] text-unverified/60",children:["· ",W," fires in 30d"]})]}),a.jsxs("div",{className:"mt-1 text-xs text-muted-foreground/80",children:["This agent's raw output has repeatedly tripped ",a.jsx("span",{className:"font-mono",children:R}),". Inspect recent consensus rounds on this page for the per-finding banner, or check upstream pipeline layers (sanitizer / renderer / relay encoding)."]})]},R))}),a.jsx("div",{className:"relative mb-6 rounded-xl border border-border bg-card p-5",children:a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsx("div",{className:"relative shrink-0",children:a.jsx(Ku,{agentId:d.id,size:120,signals:V.signals,accuracy:V.accuracy,uniqueness:V.uniqueness,impact:V.impactScore})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("h1",{className:"truncate font-mono text-2xl font-bold text-foreground",children:d.id}),a.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",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-primary bg-primary/10":"text-confirmed bg-confirmed/10"}`,children:d.native?"NATIVE":"RELAY"}),d.preset&&a.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 font-mono text-[10px] text-muted-foreground",children:d.preset}),a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/60",children:[V.signals," signals",d.lastTask?` · ${He(d.lastTask.timestamp)}`:""]})]})]}),a.jsxs("div",{className:"flex shrink-0 flex-col items-end rounded-md border border-border bg-background/60 px-3 py-2","data-tooltip":`Dispatch weight ${V.dispatchWeight.toFixed(2)}
71
- Scale 0.3 → 2.0`,"data-tooltip-pos":"left",children:[a.jsx("span",{className:"font-mono text-2xl font-bold tabular-nums leading-none text-foreground",children:V.dispatchWeight.toFixed(2)}),a.jsx("span",{className:"mt-1 font-mono text-[9px] uppercase text-muted-foreground/50",children:"weight"})]})]})}),a.jsx("section",{className:"mb-6",children:a.jsx(Pp,{agentId:c})}),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 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Metrics"}),a.jsxs("div",{className:"rounded-lg border border-border/40 bg-card/80 p-4 shadow-[inset_0_1px_3px_rgba(0,0,0,0.35)]",children:[a.jsx("div",{className:"space-y-2.5",children:G.map(R=>a.jsxs("div",{className:"grid grid-cols-[72px_1fr_44px] items-center gap-3",...R.tooltip?{"data-tooltip":R.tooltip}:{},children:[a.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:R.label}),a.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-background/80",children:a.jsx("div",{className:`h-full rounded-full transition-all ${R.fill}`,style:{width:`${Math.max(0,Math.min(100,R.value*100))}%`}})}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums text-foreground",children:[Math.round(R.value*100),"%"]})]},R.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:Se.map(R=>a.jsxs("div",{className:"bg-background/60 px-2 py-2 text-center",title:R.title,children:[a.jsx("div",{className:`font-mono text-sm font-bold tabular-nums ${R.color}`,children:R.value}),a.jsx("div",{className:"mt-0.5 font-mono text-[9px] uppercase tracking-wider text-muted-foreground/70",children:R.label})]},R.label))})]})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"mb-1 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Category Competency"}),a.jsx("p",{className:"mb-3 mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Raw per-category ratio — unweighted. Overall accuracy in Metrics applies a hallucination penalty."}),a.jsx(Cp,{categoryAccuracy:V.categoryAccuracy,categoryCorrect:V.categoryCorrect,categoryHallucinated:V.categoryHallucinated})]})]}),(d.skillSlots.length>0||d.skills.length>0)&&a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Skills ",a.jsx("span",{className:"text-primary",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(R=>a.jsx(Up,{slot:R},R.name))}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:d.skills.map(R=>a.jsx("span",{className:"rounded-sm border border-border bg-card px-2.5 py-1 font-mono text-xs text-muted-foreground",children:R},R))})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Tasks ",a.jsx("span",{className:"text-primary",children:O.length})]}),ie>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[a.jsx("button",{onClick:()=>X(R=>Math.max(0,R-1)),disabled:he===0,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{children:[he+1," / ",ie]}),a.jsx("button",{onClick:()=>X(R=>Math.min(ie-1,R+1)),disabled:he>=ie-1,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]}),O.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 bg-card",children:[a.jsx("th",{className:"py-2 pl-4 pr-2 text-xs font-medium text-muted-foreground",style:{width:32}}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium text-muted-foreground",children:"ID"}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium text-muted-foreground",children:"Agent"}),a.jsx("th",{className:"py-2 pr-3 text-xs font-medium text-muted-foreground",children:"Description"}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium text-muted-foreground",children:"Duration"}),a.jsx("th",{className:"py-2 pr-4 text-right font-mono text-xs font-medium text-muted-foreground",children:"When"})]})}),a.jsx("tbody",{children:A.map(R=>a.jsx(km,{task:R},R.taskId))})]})}):a.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tasks recorded."})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Consensus Runs ",a.jsx("span",{className:"text-primary",children:ae.length})]}),ae.length>0?a.jsx("div",{className:"space-y-2",children:ae.slice(0,20).map((R,W)=>{const p=R.counts,D=(p.agreement||0)+(p.disagreement||0)+(p.hallucination||0)+(p.unverified||0)+(p.unique||0)+(p.new||0),Y=D||1,L=[{key:"confirmed",count:p.agreement||0,color:"bg-confirmed",text:"text-confirmed"},{key:"disputed",count:(p.disagreement||0)+(p.hallucination||0),color:"bg-disputed",text:"text-disputed"},{key:"unverified",count:p.unverified||0,color:"bg-unverified",text:"text-unverified"},{key:"unique",count:(p.unique||0)+(p.new||0),color:"bg-unique",text:"text-unique"}],ne={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"}},ce=R.signals.filter(fe=>fe.signal!=="signal_retracted"&&ne[fe.signal]),pe=R.taskId+":"+W,Be=C===pe;return a.jsxs("div",{className:"rounded-md border border-border/40 bg-card",children:[a.jsx("button",{type:"button",onClick:()=>U(Be?null:pe),disabled:ce.length===0,className:`flex w-full items-center p-3 text-left transition ${ce.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 text-foreground",children:[ce.length>0&&a.jsx("span",{className:"mr-1.5 inline-block text-muted-foreground",children:Be?"▾":"▸"}),D," findings"]}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:He(R.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex gap-2",children:L.map(fe=>fe.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${fe.text}`,children:[fe.count," ",fe.key]},fe.key))}),a.jsx("div",{className:"mt-1.5 flex h-1.5 overflow-hidden rounded-sm",children:L.map(fe=>fe.count>0&&a.jsx("div",{className:fe.color,style:{width:`${fe.count/Y*100}%`}},fe.key))})]})}),Be&&ce.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:ce.map((fe,Lt)=>{const Zt=ne[fe.signal],Ln=!!(fe.findingId&&R.taskId),Yn=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 text-muted-foreground [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400",dangerouslySetInnerHTML:{__html:bs(fe.evidence||"")}}),a.jsxs("span",{className:"ml-2 font-mono text-[10px] text-muted-foreground/50",children:[fe.agentId,fe.counterpartId?` + ${fe.counterpartId}`:""]})]})]});return Ln?a.jsx("button",{type:"button",onClick:()=>F({consensusId:R.taskId,findingId:fe.findingId}),className:"block w-full rounded-sm text-left transition hover:bg-accent/40",children:Yn},Lt):a.jsx("div",{children:Yn},Lt)})})})]},pe)})}):a.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No consensus participation recorded."})]}),a.jsx("section",{className:"mb-8",children:a.jsx(Vp,{agentId:c})}),a.jsx(vs,{open:!!Q,onOpenChange:R=>{R||F(null)},consensusId:(Q==null?void 0:Q.consensusId)??null,findingId:(Q==null?void 0:Q.findingId)??null}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Memory ",a.jsxs("span",{className:"text-primary",children:[h.length," files"]}),K&&a.jsxs("span",{className:"ml-2 font-mono text-[10px] text-muted-foreground",children:["· ",K.day," (",K.items.length,")"]})]}),S.length>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[a.jsx("button",{onClick:()=>Z(R=>Math.max(0,R-1)),disabled:H===0,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Newer"}),a.jsxs("span",{children:[H+1," / ",S.length]}),a.jsx("button",{onClick:()=>Z(R=>Math.min(S.length-1,R+1)),disabled:H>=S.length-1,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Older ▸"})]})]}),K&&K.items.length>0?a.jsx("div",{className:"space-y-1.5",children:K.items.map(R=>{var Y,L;const W=x===R.filename,p=((Y=R.frontmatter)==null?void 0:Y.type)||"memory",D=((L=R.frontmatter)==null?void 0:L.name)||R.filename.replace(/\.md$/,"");return a.jsxs("div",{className:"rounded-md border border-border/40 bg-card/80",children:[a.jsxs("button",{onClick:()=>_(W?null:R.filename),className:"flex w-full items-center gap-2 p-3 text-left transition hover:bg-accent/50",children:[a.jsx("span",{className:`font-mono text-xs ${W?"text-primary":"text-muted-foreground"}`,children:W?"▾":"▸"}),a.jsx("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase text-muted-foreground",children:p}),a.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:D}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-muted-foreground",children:R.filename})]}),W&&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 text-muted-foreground",children:R.content})})]},R.filename)})}):a.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No memory files."})]})]})}const mm={dispatch:"text-muted-foreground/80",consensus:"text-primary/70",error:"text-disputed",timeout:"text-unverified",worker:"text-muted-foreground/70",gemini:"text-muted-foreground/70",skill:"text-muted-foreground/80",boot:"text-muted-foreground/50",relay:"text-muted-foreground/80",gossip:"text-muted-foreground/80",utility:"text-muted-foreground/60",memory:"text-muted-foreground/80",persist:"text-muted-foreground/50",toolserver:"text-muted-foreground/50",other:"text-muted-foreground/70"},c0=[[/^\[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 u0(c){for(const[u,f]of c0)if(u.test(c))return f;return"other"}const r0=[{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"}],hm=1e3;function o0(){const[c,u]=w.useState([]),[f,o]=w.useState(0),[d,h]=w.useState(0),[y,v]=w.useState("all"),[g,x]=w.useState(!0),[_,C]=w.useState(!0),U=w.useRef(null),Q=w.useRef(0);w.useEffect(()=>{let X=!1;return(async()=>{try{const Z=await Qe("logs?tail=500");if(X)return;u(Z.entries),o(Z.totalLines),h(Z.fileSize),Q.current=Z.totalLines+1}catch{}})(),()=>{X=!0}},[]),w.useEffect(()=>{if(_)return wm(X=>{var Z;if(X.type!=="log_lines")return;const de=(Z=X.data)==null?void 0:Z.lines;de!=null&&de.length&&u($=>{const V=de.map((ae,G)=>({line:Q.current+G,text:ae,category:u0(ae)}));Q.current+=de.length,o(ae=>ae+de.length);const O=[...$,...V];return O.length>hm?O.slice(-hm):O})})},[_]),w.useEffect(()=>{g&&U.current&&U.current.scrollIntoView({behavior:"smooth"})},[c,g]);const F=y==="all"?c:c.filter(X=>X.category===y),I=w.useCallback(X=>X<1024?`${X} B`:X<1048576?`${(X/1024).toFixed(1)} KB`:`${(X/1048576).toFixed(1)} MB`,[]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[a.jsxs("h2",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:["MCP Log ",a.jsxs("span",{className:"text-primary",children:[f," lines"]})]}),a.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/50",children:I(d)}),_&&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:[r0.map(X=>a.jsx("button",{onClick:()=>v(X.key),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${y===X.key?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:X.label},X.key)),a.jsxs("div",{className:"ml-auto flex gap-1.5",children:[a.jsx("button",{onClick:()=>C(!_),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${_?"bg-confirmed/10 text-confirmed":"text-muted-foreground"}`,children:_?"● Live":"○ Paused"}),a.jsx("button",{onClick:()=>x(!g),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${g?"bg-primary/10 text-primary":"text-muted-foreground"}`,children:g?"⤓ Auto":"⤓ Scroll"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border bg-card",children:a.jsxs("div",{className:"max-h-[70vh] overflow-y-auto p-3 font-mono text-xs leading-relaxed",children:[F.map(X=>a.jsxs("div",{className:"flex gap-2 hover:bg-muted/30",children:[a.jsx("span",{className:"w-10 shrink-0 select-none text-right text-muted-foreground/30",children:X.line}),a.jsx("span",{className:mm[X.category]||mm.other,children:X.text})]},X.line)),F.length===0&&a.jsx("div",{className:"py-8 text-center font-mono text-xs text-muted-foreground",children:c.length===0?"Loading...":"No matching log entries."}),a.jsx("div",{ref:U})]})})]})}const d0=["critical","high","medium","low"],f0=["manual","impl","meta","auto-provisional"];function xm(c,u){return c.includes(u)?c.filter(f=>f!==u):[...c,u]}const Vt="mb-1 block font-mono text-[9px] font-semibold uppercase tracking-widest text-muted-foreground/70",Hn="w-full rounded border border-border bg-background px-2 py-1 font-mono text-[10px] text-foreground focus:border-primary focus:outline-none";function m0({filters:c,onChange:u,agents:f,signalTypes:o}){const d=h=>y=>{const v=y.target.value;u({[h]:v===""?void 0:v})};return a.jsxs("aside",{className:"space-y-3 rounded-md border border-border/60 bg-card/70 p-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"font-mono text-[11px] font-semibold uppercase tracking-widest text-primary",children:"Filters"}),a.jsx("button",{type:"button",className:"font-mono text-[9px] text-muted-foreground/70 hover:text-foreground",onClick:()=>u({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:Vt,children:["Agents (",c.agents.length," selected)"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 bg-background p-1",children:[f.length===0&&a.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px] text-muted-foreground/50",children:"no agents"}),f.map(h=>a.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] text-foreground hover:bg-muted/40",children:[a.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:c.agents.includes(h),onChange:()=>u({agents:xm(c.agents,h)})}),a.jsx("span",{children:h})]},h))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Counterpart"}),a.jsxs("select",{className:Hn,value:c.counterpart??"",onChange:d("counterpart"),children:[a.jsx("option",{value:"",children:"any"}),f.map(h=>a.jsx("option",{value:h,children:h},h))]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:Vt,children:["Signal types (",c.signals.length,")"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 bg-background p-1",children:[o.length===0&&a.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px] text-muted-foreground/50",children:"no signals"}),o.map(h=>a.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] text-foreground hover:bg-muted/40",children:[a.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:c.signals.includes(h),onChange:()=>u({signals:xm(c.signals,h)})}),a.jsx("span",{children:h})]},h))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Severity"}),a.jsxs("select",{className:Hn,value:c.severity??"",onChange:d("severity"),children:[a.jsx("option",{value:"",children:"any"}),d0.map(h=>a.jsx("option",{value:h,children:h},h))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,"data-tooltip":"manual = operator-recorded · impl = implementer pipeline · meta = orchestrator self-telemetry · auto-provisional = unvalidated",children:"Source"}),a.jsxs("select",{className:Hn,value:c.source??"",onChange:d("source"),children:[a.jsx("option",{value:"",children:"any"}),f0.map(h=>a.jsx("option",{value:h,children:h},h))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Category"}),a.jsx("input",{type:"text",className:Hn,value:c.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:Vt,children:"Since"}),a.jsx("input",{type:"datetime-local",className:Hn,value:c.since?c.since.slice(0,16):"",onChange:h=>u({since:h.target.value?new Date(h.target.value).toISOString():void 0})})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Until"}),a.jsx("input",{type:"datetime-local",className:Hn,value:c.until?c.until.slice(0,16):"",onChange:h=>u({until:h.target.value?new Date(h.target.value).toISOString():void 0})})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Consensus ID (prefix)"}),a.jsx("input",{type:"text",className:Hn,value:c.consensusId??"",onChange:d("consensusId"),placeholder:"e.g. d07eac46"})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Finding ID (prefix)"}),a.jsx("input",{type:"text",className:Hn,value:c.findingId??"",onChange:d("findingId"),placeholder:"e.g. d07eac46-5f464e89:sonnet"})]})]})}const gm={agents:[],signals:[]},h0=["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"],x0={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"},g0={agreement:"text-confirmed",consensus_verified:"text-confirmed",impl_test_pass:"text-confirmed",impl_typecheck_pass:"text-confirmed",impl_peer_approved:"text-confirmed",disagreement:"text-disputed",hallucination_caught:"text-disputed",impl_test_fail:"text-disputed",impl_typecheck_fail:"text-disputed",impl_peer_rejected:"text-disputed",boundary_escape:"text-disputed",unique_confirmed:"text-unique",new_finding:"text-unique",unique_unconfirmed:"text-unique/70",unverified:"text-unverified"},p0={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:"text-muted-foreground bg-muted/50"},$a=100;function b0(){if(typeof window>"u")return{filters:gm,hadAny:!1};const c=new URLSearchParams(window.location.search),u=c.getAll("signal").filter(Boolean),f=c.get("agent"),o=c.get("counterpart")??void 0,d=c.get("category")??void 0,h=c.get("severity"),y=h==="critical"||h==="high"||h==="medium"||h==="low"?h:void 0,v=c.get("since")??void 0,g=c.get("until")??void 0,x=c.get("consensus_id")??void 0,_=c.get("finding_id")??void 0,C=c.get("source"),U=C==="manual"||C==="impl"||C==="meta"||C==="auto-provisional"?C:void 0;return u.length>0||f||o||d||y||v||g||x||_||U?{filters:{agents:f?[f]:[],signals:u,counterpart:o,category:d,severity:y,since:v,until:g,consensusId:x,findingId:_,source:U},hadAny:!0}:{filters:gm,hadAny:!1}}function v0(c,u,f=$a){const o=new URLSearchParams;o.set("limit",String(f)),o.set("offset",String(u)),c.agents.length===1&&o.set("agent",c.agents[0]),c.counterpart&&o.set("counterpart",c.counterpart);for(const d of c.signals)o.append("signal",d);return c.category&&o.set("category",c.category),c.severity&&o.set("severity",c.severity),c.since&&o.set("since",c.since),c.until&&o.set("until",c.until),c.consensusId&&o.set("consensus_id",c.consensusId),c.findingId&&o.set("finding_id",c.findingId),c.source&&o.set("source",c.source),o}function Gu(c,u){return c?c.length>u?c.slice(0,u)+"…":c:""}function y0(){const[{filters:c,hadAny:u}]=w.useState(b0),[f,o]=w.useState(c),[d,h]=w.useState([]),[y,v]=w.useState(0),[g,x]=w.useState(0),[_,C]=w.useState(!1),[U,Q]=w.useState(null),[F,I]=w.useState([]),[X,de]=w.useState(!1),[Z,$]=w.useState(null),[V,O]=w.useState(null),ae=w.useRef(null),G=w.useRef(0),te=w.useCallback(async(A,S)=>{const H=++G.current;C(!0),Q(null);try{const K=v0(A,S*$a),R=await Qe(`signals?${K.toString()}`);if(H!==G.current)return;h(R.items??[]),x(R.total??0)}catch(K){if(H!==G.current)return;Q(K instanceof Error?K.message:"fetch failed")}finally{H===G.current&&C(!1)}},[]);w.useEffect(()=>{Qe("agents").then(A=>{const S=(A??[]).map(H=>H.id).filter(Boolean).sort();S.length>0&&I(S)}).catch(()=>{})},[]),w.useEffect(()=>{v(0)},[f]),w.useEffect(()=>(ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{te(f,y)},250),()=>{ae.current&&clearTimeout(ae.current)}),[f,y,te]);const ue=w.useCallback(A=>{o(S=>({...S,...A}))},[]),oe=Math.max(1,Math.ceil(g/$a)),Se=Math.min(y,oe-1),J=g>0||u||_,ie=(A,S)=>{!A||!S||($(A),O(S),de(!0))},he=w.useMemo(()=>{const A=[];return f.agents.length&&A.push(`${f.agents.length} agents`),f.signals.length&&A.push(`${f.signals.length} signals`),f.severity&&A.push(f.severity),f.source&&A.push(f.source),(f.since||f.until)&&A.push("time window"),A.length?A.join(" · "):"all signals"},[f]);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:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Signals"}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Scored events emitted by agents during consensus review."}),a.jsxs("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/70",children:[he," — showing ",d.length," of ",g]})]})}),u&&a.jsxs("div",{className:"rounded-md border border-border/40 bg-muted/30 px-3 py-2 font-mono text-[10px] text-muted-foreground",children:["Filtered view — ",f.signals.length," signal type",f.signals.length!==1?"s":"",f.agents.length>0?` · ${f.agents.length} agent${f.agents.length!==1?"s":""}`:"",f.severity?` · severity: ${f.severity}`:"",f.source?` · source: ${f.source}`:"",". ",a.jsx("a",{href:fl("/signals"),className:"text-primary hover:text-foreground",children:"Clear filters"})]}),a.jsxs("div",{className:`grid grid-cols-1 gap-4 ${J?"lg:grid-cols-[260px_1fr]":""} lg:items-start`,children:[J&&a.jsx("div",{className:u?"opacity-70 transition-opacity hover:opacity-100 focus-within:opacity-100":void 0,children:a.jsx(m0,{filters:f,onChange:ue,agents:F,signalTypes:h0})}),a.jsxs("section",{className:"min-w-0 overflow-hidden rounded-md border border-border/60 bg-card/70",children:[U&&a.jsx("div",{className:"border-b border-border/60 bg-disputed/10 px-3 py-2 font-mono text-[10px] text-disputed",children:U}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full border-collapse font-mono text-[10px]",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/60 text-left text-muted-foreground/70",children:[a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Time"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Agent"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Signal"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest","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 font-semibold uppercase tracking-widest","data-tooltip":"Severity of the associated finding (critical / high / medium / low)",children:"Sev"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest","data-tooltip":"Finding ID — click row to open finding detail",children:"Finding"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Consensus"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Evidence"})]})}),a.jsxs("tbody",{children:[d.length===0&&!_&&a.jsx("tr",{children:a.jsx("td",{colSpan:8,className:"px-2 py-8 text-center text-muted-foreground/50",children:"no signals match these filters"})}),d.map((A,S)=>{const H=!!(A.consensusId&&A.findingId);return a.jsxs("tr",{className:`border-b border-border/30 ${H?"cursor-pointer hover:bg-muted/30":""}`,onClick:()=>H&&ie(A.consensusId,A.findingId),children:[a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/80",title:A.timestamp,children:He(A.timestamp)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-foreground",children:A.agentId}),a.jsx("td",{className:`whitespace-nowrap px-2 py-1 ${g0[A.signal]??"text-foreground"}`,children:x0[A.signal]??A.signal}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/80",children:A.counterpartId??"—"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1",children:A.severity?a.jsx("span",{className:`rounded border px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${p0[A.severity]??"bg-muted"}`,children:A.severity}):a.jsx("span",{className:"text-muted-foreground/40",children:"—"})}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/70",title:A.findingId,children:A.findingId?Gu(A.findingId,24):"—"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/70",title:A.consensusId,children:A.consensusId?Gu(A.consensusId,16):"—"}),a.jsx("td",{className:"max-w-[300px] truncate px-2 py-1 text-muted-foreground/80",title:A.evidence,children:Gu(A.evidence,80)})]},`${A.timestamp}-${A.agentId}-${S}`)})]})]})}),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] text-muted-foreground/60",children:_?"loading…":`${Se*$a+1}–${Se*$a+d.length} of ${g}`}),a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[a.jsx("button",{type:"button",onClick:()=>v(A=>Math.max(0,A-1)),disabled:Se===0||_,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[Se+1," / ",oe]}),a.jsx("button",{type:"button",onClick:()=>v(A=>Math.min(oe-1,A+1)),disabled:Se>=oe-1||_,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]})]})]}),a.jsx(vs,{open:X,onOpenChange:de,consensusId:Z,findingId:V})]})}function j0(){const[c,u]=w.useState(null),[f,o]=w.useState(!1);w.useEffect(()=>{vg().then(u)},[]);const d=w.useCallback(async h=>{o(!1),await bg(h)?u(!0):o(!0)},[]);return{authed:c,login:d,error:f}}function N0(c){w.useEffect(()=>(Mm(),wm(c)),[c])}const S0=5e3;function _0(){const[c,u]=w.useState({overview:null,agents:null,tasks:null,consensus:null,consensusReports:null,nativeMemories:null,gossipMemories:null,memories:null,loading:!0,error:null}),f=w.useRef(!1),o=w.useCallback(async()=>{if(!f.current){f.current=!0;try{const[d,h,y,v,g,x,_]=await Promise.all([Qe("overview"),Qe("agents"),Qe("tasks?limit=2000"),Qe("consensus?pageSize=500"),Qe("consensus-reports?page=1&pageSize=5").catch(()=>({reports:[]})),Qe("native-memory").catch(()=>({knowledge:[]})),Qe("gossip-memory").catch(()=>({knowledge:[]}))]),C=[...x.knowledge||[]].map(Q=>({...Q,origin:"native"})).sort((Q,F)=>F.filename>Q.filename?1:-1),U=[..._.knowledge||[]].map(Q=>({...Q,origin:"gossip"})).sort((Q,F)=>F.filename>Q.filename?1:-1);u({overview:d,agents:h,tasks:y,consensus:v,consensusReports:g,nativeMemories:C,gossipMemories:U,memories:C,loading:!1,error:null})}catch(d){u(h=>({...h,loading:!1,error:d.message}))}finally{f.current=!1}}},[]);return w.useEffect(()=>{o()},[o]),w.useEffect(()=>{const d=setInterval(()=>{o()},S0);return()=>clearInterval(d)},[o]),{...c,refresh:o}}const Um="dashboard:lastEventId";function T0(){if(typeof window>"u")return 0;const c=window.localStorage.getItem(Um);if(!c)return 0;const u=parseInt(c,10);return Number.isFinite(u)?u:0}function E0(c){typeof window>"u"||window.localStorage.setItem(Um,String(c))}const pm=1e3,A0=5e3;function M0(c){w.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let u=null,f=null,o=pm,d=!1;function h(){if(d)return;const y=T0();u=new window.EventSource(`/dashboard/api/events?last_id=${y}`),u.onmessage=v=>{try{const g=JSON.parse(v.data);c(g),E0(g.id),o=pm}catch{}},u.onerror=()=>{u&&(u.close(),u=null),!d&&(f=setTimeout(()=>{h()},o),o=Math.min(o*2,A0))}}return h(),()=>{d=!0,f!==null&&clearTimeout(f),u&&(u.close(),u=null)}},[])}const bm=5,w0=6e3;function C0({toast:c,onDismiss:u}){const f=w.useRef(null),o=w.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]),d=w.useCallback(()=>{o(),f.current=setTimeout(()=>u(c.id),w0)},[c.id,u,o]);w.useEffect(()=>(d(),o),[d,o]);const{type:h,payload:y}=c.event,v=h==="task.completed"?a.jsx("span",{className:"text-muted-foreground",children:"✓"}):y.confirmed>y.disputed?a.jsx("span",{className:"text-confirmed",children:"◎"}):a.jsx("span",{className:"text-disputed",children:"◎"});let g;if(h==="task.completed"){const _=String(y.agentId??"agent"),C=typeof y.durationMs=="number"?y.durationMs:null,U=C!==null?`${(C/1e3).toFixed(1)}s`:"—";g=`${_} finished in ${U}`}else{const _=Number(y.confirmed??0),C=Number(y.disputed??0);g=`Consensus done — ${_} confirmed · ${C} disputed`}const x=()=>{o(),h==="task.completed"&&y.taskId?ps("/tasks"):h==="consensus.completed"&&y.consensusId&&ps("/debates"),u(c.id)};return a.jsx("div",{className:["pointer-events-auto bg-card border rounded shadow-sm px-4 py-3 max-w-sm cursor-pointer","transition-all duration-200","motion-reduce:transition-none motion-reduce:transform-none","hover:bg-muted/30 hover:border-border",c.exiting?"opacity-0 scale-95 opacity-0 translate-y-2":"opacity-100 scale-100 translate-x-0"].join(" "),onClick:x,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:v}),a.jsx("span",{title:g,className:"font-mono text-[11px] text-foreground min-w-0 truncate",children:g}),a.jsx("button",{className:"ml-auto shrink-0 text-muted-foreground/50 hover:text-muted-foreground text-xs leading-none",onClick:_=>{_.stopPropagation(),o(),u(c.id)},"aria-label":"Dismiss notification",children:"×"})]})})}function z0(){const[c,u]=w.useState([]),f=w.useCallback(d=>{u(h=>h.map(y=>y.id===d?{...y,exiting:!0}:y)),setTimeout(()=>{u(h=>h.filter(y=>y.id!==d))},250)},[]),o=w.useCallback(d=>{u(h=>{const y={id:d.id,event:d,exiting:!1},v=[...h,y];if(v.length>bm){const g=v.length-bm;return v.slice(g)}return v})},[]);return M0(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:c.map(d=>a.jsx(C0,{toast:d,onDismiss:f},d.id))})}function D0({agents:c,tasks:u}){const[f,o]=w.useState("weight"),[d,h]=w.useState("desc"),[y,v]=w.useState(""),g=w.useMemo(()=>{const $=new Map;if(u)for(const V of u.items){const O=$.get(V.agentId);(!O||V.timestamp>O.timestamp)&&$.set(V.agentId,V)}return $},[u]),x=c.filter(_m).length,_=c.filter($=>$.scores.accuracy>=.5).length,C=c.reduce(($,V)=>$+V.scores.signals,0),U=c.reduce(($,V)=>$+V.totalTokens,0),Q=y.trim().toLowerCase(),F=Q?c.filter($=>$.id.toLowerCase().includes(Q)||$.provider.toLowerCase().includes(Q)||$.model.toLowerCase().includes(Q)):c,I=$=>{const V=$.scores;switch(f){case"weight":return V.dispatchWeight;case"accuracy":return V.accuracy;case"uniqueness":return V.uniqueness;case"impact":return V.impactScore;case"signals":return V.signals;case"agreements":return V.agreements;case"hallucinations":return V.hallucinations;case"lastTask":{const O=g.get($.id);return O?new Date(O.timestamp).getTime():0}}},X=[...F].sort(($,V)=>{const O=I($),ae=I(V);return d==="desc"?ae-O:O-ae}),de=$=>{f===$?h(V=>V==="desc"?"asc":"desc"):(o($),h("desc"))},Z=$=>f===$?d==="desc"?"▾":"▴":"";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Team ",a.jsx("span",{className:"ml-2 text-primary",children:c.length})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",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 border-border/40 bg-border/30 sm:grid-cols-4",children:[{label:"Healthy",value:_,color:"text-confirmed"},{label:"Benched",value:x,color:x>0?"text-destructive":"text-muted-foreground"},{label:"Total Signals",value:C.toLocaleString(),color:"text-foreground"},{label:"Tokens Used",value:U.toLocaleString(),color:"text-foreground"}].map($=>a.jsxs("div",{className:"bg-card/80 px-4 py-3",children:[a.jsx("div",{className:`font-mono text-lg font-bold tabular-nums ${$.color}`,children:$.value}),a.jsx("div",{className:"mt-0.5 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/70",children:$.label})]},$.label))})]}),a.jsx("div",{className:"mb-3",children:a.jsx("input",{type:"text",value:y,onChange:$=>v($.target.value),placeholder:"Search agents by id, provider, or model...",className:"w-full max-w-md rounded-md border border-border/40 bg-card/80 px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none"})}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border/40 bg-card/80",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-border/40 bg-muted/20 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/80",children:[a.jsx("th",{className:"py-2.5 pl-5 pr-2 text-center",children:"#"}),a.jsx("th",{className:"py-2.5 pr-3 text-left",children:"Agent"}),a.jsxs("th",{className:"py-2.5 pr-4 text-right cursor-pointer select-none hover:text-foreground",onClick:()=>de("weight"),children:["Weight ",Z("weight")]}),a.jsx("th",{className:"py-2.5 pr-4 text-left align-top",children:a.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[a.jsxs("button",{onClick:()=>de("accuracy"),className:"flex items-center gap-1 hover:text-foreground","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",Z("accuracy")]}),a.jsx("span",{className:"text-muted-foreground/30",children:"·"}),a.jsxs("button",{onClick:()=>de("uniqueness"),className:"flex items-center gap-1 hover:text-foreground","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",Z("uniqueness")]}),a.jsx("span",{className:"text-muted-foreground/30",children:"·"}),a.jsxs("button",{onClick:()=>de("impact"),className:"flex items-center gap-1 hover:text-foreground","data-tooltip":"Impact — severity-weighted finding score",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-[var(--color-impact)]"}),"Imp",Z("impact")]})]})}),a.jsxs("th",{className:"py-2.5 pr-4 text-right cursor-pointer select-none hover:text-foreground",onClick:()=>de("signals"),children:["Signals ",Z("signals")]}),a.jsxs("th",{className:"py-2.5 pr-4 text-right cursor-pointer select-none hover:text-foreground",onClick:()=>de("hallucinations"),"data-tooltip":"Hallucinations — fabricated findings caught by cross-review",children:["Halluc ",Z("hallucinations")]}),a.jsxs("th",{className:"py-2.5 pr-5 text-left cursor-pointer select-none hover:text-foreground",onClick:()=>de("lastTask"),children:["Last Task ",Z("lastTask")]})]})}),a.jsx("tbody",{children:X.map(($,V)=>{const O=$.scores,ae=g.get($.id),G=O.dispatchWeight>=1.2?"text-confirmed":O.dispatchWeight>=.8?"text-foreground":"text-disputed",te=V+1;return a.jsxs("tr",{className:"group border-t border-border/20 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 ${te===1?"font-bold text-primary":te===2||te===3?"font-semibold text-foreground/80":"text-muted-foreground/40"}`,children:te})}),a.jsx("td",{className:"py-2.5 pr-3 align-top",children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent($.id)}`,className:"flex items-center gap-3",children:[a.jsx(Ku,{agentId:$.id,size:32,signals:O.signals,accuracy:O.accuracy,uniqueness:O.uniqueness,impact:O.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 text-foreground group-hover:text-primary",children:$.id}),(()=>{const ue=Ju(O);return ue==="benched"?a.jsx("span",{className:"shrink-0 rounded bg-destructive/15 px-1 font-mono text-[8px] font-bold uppercase tracking-wider text-destructive","data-tooltip":`Benched (${O.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"benched"}):ue==="struggling"?a.jsx("span",{className:"shrink-0 rounded bg-unverified/15 px-1 font-mono text-[8px] font-bold uppercase tracking-wider text-unverified","data-tooltip":"Struggling: consecutive failures tripped the circuit breaker. Deprioritized until new clean signals recover the score.",children:"struggling"}):ue==="kept-for-coverage"?a.jsx("span",{className:"shrink-0 rounded border border-unverified/40 px-1 font-mono text-[8px] font-bold uppercase tracking-wider text-unverified","data-tooltip":`Would bench (${O.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] text-muted-foreground/50",children:[$.provider,"/",$.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 ${G}`,children:O.dispatchWeight.toFixed(2)})}),a.jsx("td",{className:"py-3 pr-4 align-top",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(gs,{label:"A",value:O.accuracy,fillClass:O.accuracy>=.7?"bg-confirmed":O.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(gs,{label:"Rel",value:O.taskCompletionRate??0,fillClass:"bg-chart",tooltip:"Reliability — fraction of dispatched tasks that finished without pipeline error or timeout"}),a.jsx(gs,{label:"U",value:O.uniqueness,fillClass:"bg-unique",tooltip:"Uniqueness — findings this agent surfaced that no other agent found"}),a.jsx(gs,{label:"I",value:O.impactScore,fillClass:"bg-[var(--color-impact)]",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 text-foreground",children:O.signals.toLocaleString()}),a.jsx("td",{className:"py-3 pr-4 text-right align-top font-mono text-xs tabular-nums",children:a.jsx("span",{className:O.hallucinations>0?"font-bold text-disputed":"text-muted-foreground/40","data-tooltip":`Agreements ${O.agreements} · Disagreements ${O.disagreements} · Hallucinations ${O.hallucinations}`,children:O.hallucinations})}),a.jsx("td",{className:"py-3 pr-5 align-top",children:ae?a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx("span",{className:"shrink-0 rounded border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 font-mono text-[9px] font-semibold text-amber-400",children:ae.taskId.slice(0,8)}),a.jsx("span",{className:"truncate font-inter text-[11px] text-muted-foreground/80",style:{maxWidth:260},children:ae.task}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-muted-foreground/50",children:He(ae.timestamp)})]}):a.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/30",children:"no tasks"})})]},$.id)})})]})})]})}function gs({label:c,value:u,fillClass:f,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 font-mono text-[8px] uppercase text-muted-foreground/50",children:c}),a.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full bg-background/60",children:a.jsx("div",{className:`h-full rounded-full ${f}`,style:{width:`${Math.max(0,Math.min(100,u*100))}%`}})}),a.jsxs("span",{className:"w-8 text-right font-mono text-[10px] tabular-nums text-foreground/80",children:[Math.round(u*100),"%"]})]})}function O0({tasks:c}){const[u,f]=w.useState(""),[o,d]=w.useState(0),[h,y]=w.useState(null),v=100,g=c.items.filter(X=>X.status==="completed").length,x=c.items.filter(X=>X.status==="failed").length,_=c.items.filter(X=>X.status==="running").length,C=u.trim().toLowerCase(),U=C?c.items.filter(X=>{var de,Z,$,V;return((de=X.task)==null?void 0:de.toLowerCase().includes(C))||((Z=X.agentId)==null?void 0:Z.toLowerCase().includes(C))||(($=X.taskId)==null?void 0:$.toLowerCase().includes(C))||((V=X.status)==null?void 0:V.toLowerCase().includes(C))}):c.items,Q=Math.max(1,Math.ceil(U.length/v)),F=Math.min(o,Q-1),I=U.slice(F*v,(F+1)*v);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Tasks ",a.jsx("span",{className:"ml-2 text-primary",children:c.total})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Live dispatched tasks and their relay status."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px] text-muted-foreground",children:[a.jsxs("span",{children:[a.jsx("span",{className:"text-confirmed",children:g})," completed"]}),x>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-destructive",children:x})," failed"]}),_>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:_})," running"]}),a.jsxs("span",{children:["showing ",I.length," of ",U.length,C&&` (filtered from ${c.items.length})`]})]})]}),a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[a.jsx("input",{type:"text",value:u,onChange:X=>{f(X.target.value),d(0)},placeholder:"Search tasks by description, agent, id, status...",className:"w-full max-w-md rounded-md border border-border/40 bg-card/80 px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none"}),a.jsxs("div",{className:`flex shrink-0 items-center gap-2 font-mono text-[11px] text-muted-foreground ${Q<=1?"invisible":""}`,children:[a.jsx("button",{onClick:()=>d(X=>Math.max(0,X-1)),disabled:F===0,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{children:[F+1," / ",Q]}),a.jsx("button",{onClick:()=>d(X=>Math.min(Q-1,X+1)),disabled:F>=Q-1,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border/40 bg-card/80",children:I.length===0?a.jsx("div",{className:"py-12 text-center text-sm text-muted-foreground",children:C?"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-border/40 bg-muted/30",children:[a.jsx("th",{className:"py-2.5 pl-4 pr-2 text-xs font-medium text-muted-foreground",style:{width:32}}),a.jsx("th",{className:"py-2.5 pr-3 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"ID"}),a.jsx("th",{className:"py-2.5 pr-3 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Agent"}),a.jsx("th",{className:"py-2.5 pr-3 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Description"}),a.jsx("th",{className:"py-2.5 pr-3 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Duration"}),a.jsx("th",{className:"py-2.5 pr-4 text-right font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"When"})]})}),a.jsx("tbody",{children:I.map(X=>a.jsx(km,{task:X,onClick:y},X.taskId))})]})}),a.jsx(tp,{task:h,onClose:()=>y(null)})]})}function R0({consensus:c,consensusReports:u}){const[f,o]=w.useState(!1),d=f?c.runs:c.runs.filter(x=>!x.retracted),h=c.runs.filter(x=>x.retracted).length,y=d.reduce((x,_)=>x+(_.counts.agreement||0),0),v=d.reduce((x,_)=>x+((_.counts.disagreement||0)+(_.counts.hallucination||0)),0),g=d.reduce((x,_)=>x+(_.counts.unverified||0),0);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Consensus Rounds ",a.jsx("span",{className:"ml-2 text-primary",children:d.length}),!f&&h>0&&a.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal text-muted-foreground/60",children:["/ ",c.totalRuns??c.runs.length," total"]})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Multi-agent review rounds — findings confirmed when ≥2 agents agree."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px] text-muted-foreground",children:[a.jsxs("span",{children:[a.jsx("span",{className:"text-confirmed",children:y})," confirmed"]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-disputed",children:v})," disputed"]}),g>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:g})," unverified"]}),a.jsxs("span",{children:[c.totalSignals," total signals"]})]}),h>0&&a.jsxs("div",{className:"mt-2 flex items-center gap-2 font-mono text-[11px] text-muted-foreground/70",children:[a.jsx("span",{children:f?`${h} retracted run${h===1?"":"s"} shown`:`${h} retracted run${h===1?"":"s"} hidden`}),a.jsx("button",{type:"button",onClick:()=>o(x=>!x),className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 text-[10px] transition hover:bg-accent/50 hover:text-foreground",children:f?"hide":"show"})]})]}),a.jsx(zm,{consensus:c,filteredRuns:d,reports:u,showAll:!0,hideHeader:!0})]})}function k0(){const c=vm(),u=ym(),{overview:f,agents:o,tasks:d,consensus:h,consensusReports:y,nativeMemories:v,gossipMemories:g,loading:x,refresh:_}=_0(),[C,U]=w.useState(0),Q=w.useCallback(Z=>{Z.type!=="log_lines"&&_()},[_]);if(N0(Q),x||!f||!h)return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx(rm,{}),a.jsx("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:"Loading dashboard..."})]});let F;const I=c.match(/^\/agent\/(.+)$/);if(I&&o){const Z=decodeURIComponent(I[1]);F=a.jsx(s0,{agentId:Z,agents:o,tasks:d,consensus:h})}else c==="/team"&&o?F=a.jsx(D0,{agents:o,tasks:d}):c==="/tasks"&&d?F=a.jsx(O0,{tasks:d}):c==="/debates"&&h?F=a.jsx(R0,{consensus:h,consensusReports:y}):c==="/logs"?F=a.jsx(o0,{}):c==="/signals"?F=a.jsx(y0,{}):c==="/violations"?F=a.jsx(Ap,{}):c==="/"&&!u||c==="/overview"?F=a.jsx(qg,{overview:f,agents:o,tasks:d,activeTaskCount:C,setActiveTaskCount:U}):F=a.jsxs("div",{className:"space-y-6",children:[a.jsxs("header",{children:[a.jsx("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Dashboard"}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Multi-agent code review with grounded reward signals. Live activity, agent scores, and consensus rounds."})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-[280px_1fr] lg:items-start",children:[a.jsxs("aside",{className:"space-y-4 lg:sticky lg:top-4",children:[a.jsx(Nm,{overview:f,activeTasks:C}),o&&a.jsx(Kg,{agents:o}),a.jsx(_p,{})]}),a.jsxs("main",{className:"min-w-0 space-y-6",children:[a.jsx(Sm,{onCountChange:U}),a.jsx(zm,{consensus:h,reports:y}),d&&a.jsx(Em,{tasks:d,limit:5}),o&&a.jsx(Tm,{agents:o}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[a.jsx(Sp,{}),a.jsx(Mp,{overview:f})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[a.jsx(Am,{}),a.jsx(wp,{overview:f})]}),(g||v)&&a.jsx(vp,{memories:[...g??[],...v??[]],heading:"Memory",statusFilter:!0})]})]})]});const de=c==="/"&&!u||c==="/overview"?"px-6 py-6":"mx-auto max-w-7xl space-y-6 px-6 py-6";return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx(rm,{}),a.jsx("main",{className:de,children:F})]})}function U0(){const{authed:c,login:u,error:f}=j0();return c===null?a.jsx("div",{className:"flex min-h-screen items-center justify-center text-muted-foreground",children:"Loading..."}):c?a.jsxs(a.Fragment,{children:[a.jsx(k0,{}),a.jsx(z0,{})]}):a.jsx(Hg,{onLogin:u,error:f})}mg.createRoot(document.getElementById("root")).render(a.jsx(w.StrictMode,{children:a.jsx(U0,{})}));
68
+ ${ne?"bg-card border-r-border/60 border-t-border/60 border-b-border/60":"bg-card/50 hover:bg-card/70 hover:border-r-border/60 hover:border-t-border/60 hover:border-b-border/60 hover:shadow-sm hover:shadow-black/20 hover:-translate-y-px"}`,"data-retracted":hl?"true":void 0,children:[hl&&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"}),Qn.retracted_at&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",Qn.retracted_at.slice(0,10)]}),Qn.reason&&a.jsxs("span",{className:"ml-2 text-muted-foreground/80",children:["— ",Qn.reason]})]}),a.jsxs("button",{className:"flex w-full items-start gap-3 px-3 py-2.5 text-left","aria-expanded":ne,onClick:()=>{const P=!ne;g(P?A.id:null),P&&(_("all"),U("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 text-foreground",children:O.length}),a.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"findings"}),a.jsx("span",{className:"text-muted-foreground/30 text-[10px]",children:"·"}),a.jsxs("span",{className:"text-[11px] text-muted-foreground/60",children:[A.rounds,"r"]}),ml.length>0&&a.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[ml.map(P=>a.jsx("span",{title:P,className:"inline-flex h-4 w-4 items-center justify-center rounded-full font-mono text-[8px] font-bold text-background",style:{backgroundColor:Ka(P)},children:Xu(P)},P)),Xn.length>5&&a.jsxs("span",{className:"font-mono text-[9px] text-muted-foreground/40",children:["+",Xn.length-5]})]}),a.jsx("span",{className:"shrink-0 rounded border border-border/30 bg-muted/40 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-muted-foreground",title:A.id,children:A.id.slice(0,8)}),A.droppedFindingsByType&&Object.keys(A.droppedFindingsByType).length>0&&(()=>{const P=Object.entries(A.droppedFindingsByType),ke=P.reduce((et,[,Ut])=>et+Ut,0),Fe=P.map(([et,Ut])=>`${et}:${Ut}`).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=: ${Fe}. These never reach the dashboard, scores, or signals.`,children:[ke," dropped"]})})(),a.jsx("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground/50 shrink-0",children:He(A.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex items-center gap-3",children:$t.map(P=>a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${P.textCls}`,children:[P.count," ",P.label]},P.label))}),A.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 bg-muted/30 px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider text-muted-foreground/50",children:"Topic"}),a.jsx("span",{className:"font-inter text-[11px] leading-relaxed text-muted-foreground/70",children:A.topic})]})]}),a.jsx("span",{className:`mt-1 shrink-0 font-mono text-[10px] text-muted-foreground/40 transition-transform duration-150 ${ne?"rotate-90 text-primary/60":"group-hover:text-muted-foreground/60"}`,children:"▸"})]}),ne&&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] text-muted-foreground/50",children:"Type:"}),om.map(P=>a.jsx("button",{onClick:()=>_(P.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${x===P.key?P.activeCls:P.cls}`,...P.tooltip?{"data-tooltip":P.tooltip}:{},children:P.label},P.key))]}),a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/50",children:"Severity:"}),Jg.map(P=>a.jsx("button",{onClick:()=>U(P.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${C===P.key?P.activeCls:P.cls}`,children:P.label},P.key))]}),A.coverageDegraded&&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:["⚠ Coverage degraded — ",A.coverageDegraded.received," of ",A.coverageDegraded.expected," agents responded"]}),A.coverageDegraded.droppedAgents.length>0&&a.jsxs("p",{className:"mt-0.5 font-mono text-[9px] text-muted-foreground/70",children:["Dropped: ",A.coverageDegraded.droppedAgents.join(", ")]})]}),A.relayCrossReviewSkipped&&A.relayCrossReviewSkipped.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:["⚠ Cross-review skipped: ",A.relayCrossReviewSkipped.length," relay agent",A.relayCrossReviewSkipped.length===1?"":"s"," failed Phase 2"]}),a.jsx("p",{className:"mt-0.5 font-mono text-[9px] text-muted-foreground/70",children:A.relayCrossReviewSkipped.map(P=>P.agentId).join(", ")})]}),(A.crossReviewAssignments||A.crossReviewCoverage)&&(()=>{const P=A.crossReviewAssignments||{},ke=Object.entries(P),Fe=A.crossReviewCoverage||[],et=Fe.length,Ut=Fe.filter(Ue=>Ue.assigned<Ue.targetK);return a.jsxs("details",{className:"mb-3 rounded-md border border-border/30 bg-card/30",children:[a.jsxs("summary",{className:"flex cursor-pointer items-center gap-2 px-3 py-2 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground select-none",children:["Cross-Review Assignments",A.partialReview&&a.jsx("span",{className:"rounded border border-unverified/15 bg-unverified/5 px-1.5 py-0.5 font-mono text-[9px] font-bold normal-case tracking-normal text-unverified",children:"partial"}),a.jsxs("span",{className:"ml-auto font-mono text-[9px] font-normal normal-case tracking-normal text-muted-foreground/50",children:[ke.length," reviewers · ",et," findings"]})]}),a.jsxs("div",{className:"border-t border-border/20 px-3 pb-3 pt-2 space-y-2",children:[ke.map(([Ue,Vn])=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{title:Ue,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full font-mono text-[8px] font-bold text-background",style:{backgroundColor:Ka(Ue)},children:Xu(Ue)}),a.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:Ue}),a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/40",children:["(",Vn.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1 ml-1",children:Vn.map(Zn=>a.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground",children:Zn.length>12?Zn.slice(0,12)+"…":Zn},Zn))})]},Ue)),et>0&&a.jsx("div",{className:"mt-1 pt-1.5 border-t border-border/15",children:Ut.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:["⚠ ",Ut.length," of ",et," findings under-reviewed"]}):a.jsxs("span",{className:"font-mono text-[10px] font-semibold text-confirmed/60",children:["✓ All ",et," findings fully covered"]})})]})]})})(),a.jsx("div",{className:"space-y-3",children:L.length===0?a.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"No findings match this filter."}):L.map((P,ke)=>a.jsx(Pg,{f:P,reviewInfo:P.id?p[P.id]:void 0,diagnostics:ce(P)},ke))})]})]})]},A.id)}),f&&Se>1&&a.jsxs("div",{className:"flex items-center justify-center gap-3 pt-4 font-mono text-[11px] text-muted-foreground",children:[a.jsx("button",{onClick:()=>oe(A=>Math.max(0,A-1)),disabled:J===0,className:"rounded-sm border border-border/40 bg-card px-3 py-1 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{children:["Page ",J+1," of ",Se]}),a.jsx("button",{onClick:()=>oe(A=>Math.min(Se-1,A+1)),disabled:J>=Se-1,className:"rounded-sm border border-border/40 bg-card px-3 py-1 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]}):v.length===0?a.jsx(Ln,{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((A,S)=>{const H=A.counts,K=(H.agreement||0)+(H.disagreement||0)+(H.hallucination||0)+(H.unverified||0)+(H.unique||0)+(H.new||0),R=K||1,W=y===A.taskId,p=[{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"}],O=A.signals.filter(L=>{if(L.signal==="signal_retracted")return!1;if(x==="all")return!!Lu[L.signal];const ne=Lu[L.signal];return ne&&ne.filter===x}),Y=!!A.retracted;return a.jsxs("div",{className:`rounded-md border bg-card transition ${W?"border-primary/25":"border-border"} ${Y?"opacity-60":""}`,"data-retracted":Y?"true":void 0,title:Y&&A.retractionReason?`Retracted: ${A.retractionReason}`:void 0,children:[Y&&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"}),A.retractedAt&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",A.retractedAt.slice(0,10)]}),A.retractionReason&&a.jsxs("span",{className:"ml-2 text-muted-foreground/80",children:["— ",A.retractionReason]})]}),a.jsxs("button",{"aria-expanded":W,onClick:()=>{const L=!W;g(L?A.taskId:null),L&&(_("all"),U("all"))},className:"flex w-full items-center p-3 text-left transition hover:bg-accent/50",children:[a.jsx("span",{className:`mr-3 font-mono text-xs text-muted-foreground transition ${W?"text-primary":""}`,children:W?"▾":"▸"}),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] text-primary/50",children:A.taskId}),a.jsxs("span",{className:`font-mono text-sm font-semibold text-foreground ${Y?"line-through decoration-disputed/40":""}`,children:[K," findings"]}),a.jsxs("div",{className:"flex gap-1.5",children:[A.agents.slice(0,4).map(L=>a.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:L.split("-").map(ne=>ne[0]).join("").toUpperCase().slice(0,2)},L)),A.agents.length>4&&a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:["+",A.agents.length-4]})]})]}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:He(A.timestamp)})]}),a.jsx("div",{className:"mt-2 flex gap-2",children:p.map(L=>L.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${L.text} ${Y?"line-through decoration-disputed/40":""}`,children:[L.count," ",L.label]},L.key))}),a.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-sm",children:p.map(L=>L.count>0&&a.jsx("div",{className:`${L.color} transition-all`,style:{width:`${L.count/R*100}%`}},L.key))})]})]}),W&&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:om.map(L=>a.jsx("button",{onClick:()=>_(L.key),className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${x===L.key?L.activeCls:L.cls} hover:opacity-80`,...L.tooltip?{"data-tooltip":L.tooltip}:{},children:L.label},L.key))}),O.length===0?a.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"No findings match this filter."}):a.jsx("div",{className:"space-y-2",children:O.map((L,ne)=>{const ce=Lu[L.signal];return ce?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 ${ce.cls}`,children:ce.label}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"text-xs text-muted-foreground [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400",children:a.jsx("span",{className:"finding-md",dangerouslySetInnerHTML:{__html:bs(L.evidence||"")}})}),a.jsxs("span",{className:"ml-2 font-mono text-[10px] text-muted-foreground/50",children:[L.agentId,L.counterpartId?` + ${L.counterpartId}`:""]})]})]},ne):null})})]})]},A.taskId+S)})})]})}const ep={completed:{label:"COMPLETED",cls:"text-confirmed bg-confirmed/10"},failed:{label:"FAILED",cls:"text-destructive bg-destructive/10"},cancelled:{label:"CANCELLED",cls:"text-muted-foreground bg-muted/30"},running:{label:"RUNNING",cls:"text-unverified bg-unverified/10 animate-pulse"}};function tp({task:c,onClose:u}){if(w.useEffect(()=>{if(!c)return;const d=h=>{h.key==="Escape"&&u()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[c,u]),!c)return null;const f=ep[c.status],o=(c.inputTokens||0)+(c.outputTokens||0);return a.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto bg-background/80 p-6 backdrop-blur-sm",onClick:u,children:a.jsxs("div",{className:"relative mt-12 w-full max-w-3xl rounded-lg border border-border bg-card shadow-2xl",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 ${f.cls}`,children:f.label}),a.jsx("span",{className:"shrink-0 rounded border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-amber-400",children:c.taskId.slice(0,8)}),a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(c.agentId)}`,className:"truncate font-mono text-xs text-muted-foreground transition hover:text-primary",children:c.agentId})]}),a.jsxs("div",{className:"mt-2 flex flex-wrap gap-3 font-mono text-[10px] text-muted-foreground",children:[a.jsx("span",{children:He(c.timestamp)}),c.duration!=null&&a.jsxs("span",{children:["· ",xg(c.duration)]}),o>0&&a.jsxs("span",{children:["· ",o.toLocaleString()," tokens (",(c.inputTokens||0).toLocaleString()," in / ",(c.outputTokens||0).toLocaleString()," out)"]})]})]}),a.jsx("button",{onClick:u,className:"shrink-0 rounded-md border border-border/40 bg-card px-2 py-1 font-mono text-xs text-muted-foreground transition hover:bg-accent/50 hover:text-foreground","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 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Task"}),a.jsx("div",{className:"task-md rounded-md border border-border/40 bg-background/40 p-3 text-xs leading-relaxed text-foreground/90 overflow-x-auto",dangerouslySetInnerHTML:{__html:jm(c.task)}})]}),c.result?a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Result"}),a.jsx("div",{className:"finding-md rounded-md border border-border/40 bg-background/40 p-3 font-mono text-xs leading-relaxed text-foreground/90 whitespace-pre-wrap [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:text-purple-400 [&_.inline-code]:rounded [&_.inline-code]:bg-muted/40 [&_.inline-code]:px-1 [&_.inline-code-block]:my-2 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:bg-muted/30 [&_.inline-code-block]:p-2",dangerouslySetInnerHTML:{__html:bs(c.result)}})]}):a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Result"}),a.jsx("div",{className:"rounded-md border border-border/40 bg-background/40 p-3 text-center font-mono text-xs text-muted-foreground",children:c.status==="running"?"Task is still running...":"No result recorded."})]})]})]})})}const np=new Set(["shipped","closed"]);function Dm(c){var d,h,v,y;if(c.filename==="MEMORY.md")return"record";const u=c.filename.split("_")[0].toLowerCase(),f=(h=(d=c.frontmatter)==null?void 0:d.type)==null?void 0:h.toLowerCase(),o=(y=(v=c.frontmatter)==null?void 0:v.status)==null?void 0:y.toLowerCase();return u==="session"?"session":u==="feedback"||u==="user"?"rule":u==="project"?o&&np.has(o)?"record":"backlog":u==="gossip"?"record":f==="session"?"session":f==="feedback"||f==="user"?"rule":f==="reference"?"record":"backlog"}const Om=[{type:"backlog",label:"Backlog",blurb:"Open work, pending decisions"},{type:"record",label:"Record",blurb:"Shipped & closed reference"},{type:"session",label:"Session",blurb:"Per-session recaps"},{type:"rule",label:"Rule",blurb:"Feedback & user preferences"}];function lp(c){return c.origin?`${c.origin}/${c.filename}`:c.filename}function ap(c){const u=new Set,f=[];for(const o of c){const d=lp(o);u.has(d)||(u.add(d),f.push(o))}return f}const ip={backlog:"text-primary",record:"text-text-dim",session:"text-confirmed",rule:"text-unverified"},sp={backlog:"border-primary/30 bg-primary/[0.06]",record:"border-text-dim/30 bg-text-dim/[0.08]",session:"border-confirmed/30 bg-confirmed/[0.06]",rule:"border-unverified/30 bg-unverified/[0.06]"};function cp({folder:c,memories:u,onBack:f,onOpen:o}){const d=Om.find(g=>g.type===c),h=ip[c],v=sp[c],y=w.useMemo(()=>[...u].sort((g,x)=>g.filename<x.filename?1:-1),[u]);return a.jsxs("section",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"mb-3 flex items-center gap-2 font-mono text-xs",children:[a.jsx("button",{onClick:f,className:"font-bold uppercase tracking-widest text-muted-foreground transition hover:text-primary",children:"Memory"}),a.jsx("span",{className:"text-muted-foreground/40",children:"›"}),a.jsx("span",{className:`font-bold uppercase tracking-widest ${h}`,children:d.label}),a.jsx("span",{className:"ml-1 text-muted-foreground/60",children:y.length})]}),y.length===0?a.jsx("div",{className:"flex-1",children:a.jsx(Ln,{title:`No ${d.label.toLowerCase()} memories`,hint:d.blurb})}):a.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:y.map(g=>{const x=up(g),_=rp(g),C=op(g.frontmatter);return a.jsxs("button",{onClick:()=>o(g),className:"group flex flex-col gap-1.5 rounded-md border border-border/40 bg-muted p-3 text-left transition hover:border-primary/30 hover:bg-accent/40",children:[a.jsx("span",{className:`inline-block w-fit rounded-sm border px-1.5 py-[1px] font-mono text-[9px] font-bold uppercase tracking-[0.14em] ${v} ${h}`,children:d.label}),a.jsx("span",{className:"line-clamp-2 text-[13px] font-medium leading-snug text-foreground group-hover:text-primary",children:x}),a.jsxs("div",{className:"flex items-center justify-between gap-2 font-mono text-[10px] text-muted-foreground/70",children:[a.jsx("span",{className:"min-w-0 truncate",children:_}),C&&a.jsx("span",{className:"shrink-0",children:He(C)})]})]},`${g.agentId||""}/${g.filename}`)})})]})}function up(c){var o;const u=(o=c.frontmatter)==null?void 0:o.name;if(u)return u;const f=c.content.split(`
69
+ `).find(d=>d.trim().length>0);if(f){const d=f.replace(/^#+\s*/,"").trim();if(d)return d.slice(0,80)}return c.filename.replace(/\.md$/,"")}function rp(c){const u=c.filename.replace(/\.md$/,"");return u||(c.agentId==="_project"?"project":c.agentId||"unknown")}function op(c){if(c)for(const u of["timestamp","updated","updatedAt","modified","created","date"]){const f=c[u];if(f&&!isNaN(new Date(f).getTime()))return f}}function dp({memory:c,onClose:u}){if(w.useEffect(()=>{if(!c)return;const y=g=>{g.key==="Escape"&&u()};return document.addEventListener("keydown",y),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",y),document.body.style.overflow=""}},[c,u]),!c)return null;const f=Dm(c),o=c.agentId==="_project"?"project":c.agentId||"unknown",d=`.gossip/agents/${c.agentId||"_project"}/memory/knowledge/${c.filename}`,h=fp(c.frontmatter),v=Object.entries(c.frontmatter||{});return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-y-auto bg-background/80 p-6 backdrop-blur-sm",onClick:u,children:a.jsxs("div",{className:"relative flex max-h-[calc(100vh-48px)] w-full max-w-xl flex-col overflow-hidden rounded-lg border border-primary/30 bg-card",style:{boxShadow:"0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(139, 92, 246, 0.06)"},onClick:y=>y.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/60 px-4 py-3.5",children:[a.jsx("span",{className:"shrink-0 rounded-sm border border-primary/30 bg-primary/[0.06] px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase tracking-[0.14em] text-primary",children:f}),a.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs font-medium text-foreground",children:c.filename}),a.jsx("button",{onClick:u,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground transition hover:bg-muted hover:text-foreground","aria-label":"Close",children:a.jsx("span",{className:"text-base leading-none",children:"✕"})})]}),a.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto px-4 py-4 text-[13px] leading-relaxed text-foreground",children:[a.jsxs("section",{children:[a.jsx("h3",{className:"mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:"Owner"}),a.jsxs("div",{className:"flex flex-wrap gap-3 font-mono text-[11px] text-muted-foreground",children:[a.jsx("span",{children:o}),h&&a.jsxs("span",{children:["· updated ",He(h)]})]}),a.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground/60",children:d})]}),v.length>0&&a.jsxs("section",{children:[a.jsx("h3",{className:"mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:"Frontmatter"}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border/40 bg-background/40",children:a.jsx("table",{className:"w-full text-left font-mono text-[11px]",children:a.jsx("tbody",{children:v.map(([y,g])=>a.jsxs("tr",{className:"border-b border-border/20 last:border-b-0",children:[a.jsx("td",{className:"w-32 px-3 py-1.5 text-muted-foreground/70",children:y}),a.jsx("td",{className:"px-3 py-1.5 break-all text-foreground/90",children:g})]},y))})})})]}),a.jsxs("section",{children:[a.jsx("h3",{className:"mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:"Content"}),a.jsx("div",{className:"task-md overflow-x-auto rounded-md border border-border/40 bg-background/40 p-3 text-xs leading-relaxed text-foreground/90",dangerouslySetInnerHTML:{__html:jm(c.content)}})]})]})]})})}function fp(c){if(c)for(const u of["timestamp","updated","updatedAt","modified","created","date"]){const f=c[u];if(f&&!isNaN(new Date(f).getTime()))return f}}const mp=new Set(["shipped","closed"]),hp={backlog:"text-primary",record:"text-text-dim",session:"text-confirmed",rule:"text-unverified"},xp={backlog:{bg:"bg-primary",glow:"rgba(139, 92, 246, 0.6)"},record:{bg:"bg-text-dim",glow:"rgba(102, 102, 116, 0.55)"},session:{bg:"bg-confirmed",glow:"rgba(52, 211, 153, 0.55)"},rule:{bg:"bg-unverified",glow:"rgba(251, 191, 36, 0.55)"}},gp={backlog:"bg-primary/[0.06] border-primary/30",record:"bg-text-dim/[0.08] border-text-dim/20",session:"bg-confirmed/[0.06] border-confirmed/25",rule:"bg-unverified/[0.06] border-unverified/25"},pp={backlog:a.jsx("path",{d:"M20 7h-7L10.3 4.3A1 1 0 0 0 9.6 4H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"}),record:a.jsxs(a.Fragment,{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"})]}),session:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}),rule:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})},bp=1440*60*1e3;function vp({memories:c,heading:u="Memory",statusFilter:f=!1}){const[o,d]=w.useState(null),[h,v]=w.useState(null),[y,g]=w.useState("all"),x=w.useMemo(()=>ap(c),[c]),_=w.useMemo(()=>!f||y==="all"?x:x.filter(U=>{var F;const V=(((F=U.frontmatter)==null?void 0:F.status)||"").toLowerCase();return y==="shipped"?mp.has(V):V==="open"||!V}),[x,f,y]),C=w.useMemo(()=>{const U={backlog:[],record:[],session:[],rule:[]},V={backlog:!1,record:!1,session:!1,rule:!1},F=Date.now();for(const I of _){const X=Dm(I);U[X].push(I),!V[X]&&yp(I,F)&&(V[X]=!0)}return{buckets:U,recent:V}},[_]);return o?a.jsxs(a.Fragment,{children:[a.jsx(cp,{folder:o,memories:C.buckets[o],onBack:()=>d(null),onOpen:v}),a.jsx(dp,{memory:h,onClose:()=>v(null)})]}):a.jsxs("section",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[a.jsxs("h2",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:[u," ",a.jsx("span",{className:"text-primary",children:_.length})]}),f&&a.jsx("div",{className:"flex gap-1 font-mono text-[10px]",role:"tablist","aria-label":"Status filter",children:["all","open","shipped"].map(U=>a.jsx("button",{role:"tab","aria-selected":y===U,onClick:()=>g(U),className:`rounded-sm border px-2 py-0.5 uppercase tracking-widest transition ${y===U?"border-primary/50 bg-primary/10 text-primary":"border-border/30 text-muted-foreground hover:border-primary/30 hover:text-foreground"}`,children:U},U))})]}),a.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:Om.map(({type:U,label:V,blurb:F})=>{const I=C.buckets[U].length,X=C.recent[U],de=hp[U],Z=xp[U],$=gp[U],Q=I===0;return a.jsxs("button",{onClick:()=>d(U),disabled:Q,className:`group relative grid grid-cols-[auto_1fr_auto] grid-rows-[auto_auto] items-center gap-x-3 gap-y-1 rounded-md border bg-muted p-3.5 text-left transition ${Q?"cursor-default border-border/20 opacity-55":"border-border/40 hover:border-primary/30 hover:bg-accent/40"}`,children:[a.jsxs("span",{className:`relative row-span-2 flex h-9 w-9 items-center justify-center rounded-sm border ${$} ${de}`,"aria-hidden":!0,children:[X&&a.jsx("span",{className:`pointer-events-none absolute -right-1 -top-1 h-1.5 w-1.5 rounded-full ${Z.bg}`,style:{boxShadow:`0 0 8px ${Z.glow}`},"data-tooltip":"Activity in the last 24h","aria-label":"Activity in the last 24h"}),a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:pp[U]})]}),a.jsx("span",{className:"self-end font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:V}),a.jsx("span",{className:`row-span-2 self-center font-mono text-sm font-bold tabular-nums ${Q?"text-muted-foreground/40":de}`,children:I}),a.jsx("span",{className:"self-start font-mono text-[10px] leading-snug text-muted-foreground/70",children:F})]},U)})})]})}function yp(c,u){const f=c.frontmatter;if(!f)return!1;for(const o of["lastAccessed","updated","timestamp","updatedAt","modified","created","date"]){const d=f[o];if(!d)continue;const h=new Date(d).getTime();if(!isNaN(h)&&u-h<=bp)return!0}return!1}function jp(c){const u=new Map;for(const o of c){const d=u.get(o.agentId)??[];d.push(o),u.set(o.agentId,d)}const f=[];for(const[o,d]of u){d.sort((v,y)=>v.day.localeCompare(y.day));const h=d.length>0?d[d.length-1].accuracy:0;f.push({agentId:o,points:d,latest:h})}return f.sort((o,d)=>d.latest-o.latest),f}function Np({values:c,className:u}){if(c.length===0)return a.jsx("svg",{width:120,height:20});if(c.length===1){const v=20-c[0]*20;return a.jsx("svg",{width:120,height:20,className:u,children:a.jsx("circle",{cx:120/2,cy:v,r:2,fill:"currentColor"})})}const d=120/(c.length-1),h=c.map((v,y)=>`${(y*d).toFixed(1)},${(20-v*20).toFixed(1)}`).join(" ");return a.jsx("svg",{width:120,height:20,className:u,children:a.jsx("polyline",{points:h,fill:"none",stroke:"currentColor",strokeWidth:1.5})})}function Sp(){const[c,u]=w.useState(null),[f,o]=w.useState(null);w.useEffect(()=>{Qe("fleet-trend?days=30").then(u).catch(h=>o(String((h==null?void 0:h.message)??h)))},[]);const d=w.useMemo(()=>c?jp(c.points):[],[c]);return a.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Fleet Health Trend"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"last 30d"})]}),!c&&!f&&a.jsx(Ln,{title:"Loading…",compact:!0}),f&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"failed to load trend data"}),!f&&c&&d.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"no recent consensus signals"}),!f&&d.length>0&&a.jsx("ul",{className:"space-y-1.5",children:d.map(h=>{const v=h.latest===0;return a.jsxs("li",{className:`flex items-center justify-between gap-3 text-xs${v?" opacity-40":""}`,children:[a.jsx("span",{className:"truncate font-mono text-foreground",children:h.agentId}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Np,{values:h.points.map(y=>y.accuracy),className:h.latest>=.7?"text-confirmed":h.latest>=.4?"text-unverified":"text-disputed"}),a.jsxs("span",{className:"w-10 text-right tabular-nums text-muted-foreground",children:[Math.round(h.latest*100),"%"]})]})]},h.agentId)})})]})}function _p(){var y;const[c,u]=w.useState(null),[f,o]=w.useState(null);w.useEffect(()=>{let g=!1;return Qe("violations?pageSize=1").then(x=>{g||u(x)}).catch(x=>{g||o(String((x==null?void 0:x.message)??x))}),()=>{g=!0}},[]);const d=(c==null?void 0:c.total)??0,h=((y=c==null?void 0:c.items)==null?void 0:y[0])??null,v=d>0;return a.jsxs("div",{className:`rounded-lg border ${v?"border-destructive/30 bg-destructive/10":"border-border bg-muted/20"}`,children:[a.jsxs("div",{className:`flex items-center justify-between border-b px-3.5 py-3 ${v?"border-destructive/20 bg-destructive/[0.06]":"border-border/40"}`,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`inline-flex h-4 w-4 items-center justify-center rounded-sm font-mono text-[11px] font-bold ${v?"bg-destructive/15 text-destructive":"bg-muted text-muted-foreground"}`,children:"!"}),a.jsx("span",{className:`min-w-0 truncate font-mono text-[11px] font-bold uppercase tracking-widest ${v?"text-destructive":"text-muted-foreground"}`,children:"Process Violations"})]}),v&&a.jsx("span",{className:"shrink-0 rounded-full border border-destructive/20 bg-destructive/10 px-2 py-0.5 font-mono text-xs font-bold text-destructive",children:d})]}),a.jsxs("div",{className:"min-h-[52px] px-3.5 py-3",children:[f&&a.jsx("p",{className:"font-mono text-[10px] text-muted-foreground",children:"failed to load violation data"}),!f&&!c&&a.jsx("p",{className:"font-mono text-[10px] text-muted-foreground/60",children:"Loading…"}),!f&&c&&!v&&a.jsx("p",{className:"font-mono text-[10px] text-muted-foreground/70",children:"No violations detected"}),!f&&c&&v&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"font-mono text-[11px] text-foreground",children:[d," direct master push",d===1?"":"es"," detected"]}),h&&a.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[a.jsx("span",{className:"shrink-0",children:"Most recent:"}),a.jsx("span",{className:"truncate text-foreground",children:h.agentId}),a.jsx("span",{className:"shrink-0 text-muted-foreground/50",children:He(h.detectedAt)})]})]}),!f&&c&&a.jsx("div",{className:"mt-2 text-right",children:a.jsx("a",{href:Bn("/violations"),className:`font-mono text-[10px] transition hover:underline ${v?"text-destructive":"text-muted-foreground hover:text-foreground"}`,children:"View all →"})})]})]})}const xs=25;function Tp({commits:c}){const[u,f]=w.useState(!1);if(c.length===0)return a.jsx("span",{className:"text-muted-foreground/50",children:"—"});const o=c[0],d=o.includes(" ")?o.slice(o.indexOf(" ")+1):o,h=c.length-1;return a.jsxs("span",{className:"font-mono text-[11px]",children:[a.jsx("span",{className:"text-foreground",children:d}),h>0&&a.jsxs(a.Fragment,{children:[" ",a.jsx("button",{type:"button","aria-expanded":u,onClick:()=>f(v=>!v),className:"font-mono text-[10px] text-muted-foreground/70 underline hover:text-foreground",children:u?"(collapse)":`(+${h} more)`}),u&&a.jsx("ul",{className:"mt-1 space-y-0.5 pl-2",children:c.slice(1).map((v,y)=>{const g=v.includes(" ")?v.slice(v.indexOf(" ")+1):v;return a.jsx("li",{className:"font-mono text-[10px] text-muted-foreground/80",children:g},y)})})]})]})}function Ep({row:c}){const u=c.preSha.slice(0,8),f=c.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] text-muted-foreground/80",children:He(c.detectedAt)}),a.jsx("td",{className:"max-w-[160px] truncate whitespace-nowrap py-3 pr-4",children:a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(c.agentId)}`,className:"font-mono text-[11px] text-foreground hover:text-primary hover:underline",children:c.agentId})}),a.jsxs("td",{className:"whitespace-nowrap py-3 pr-4 font-mono text-[10px]",children:[a.jsx("span",{className:"text-muted-foreground/70",children:u}),a.jsx("span",{className:"mx-1 text-muted-foreground/40",children:"→"}),a.jsx("span",{className:"text-foreground",children:f})]}),a.jsx("td",{className:"py-3 pr-4",children:a.jsx(Tp,{commits:c.commits})})]})}function Ap(){const[c,u]=w.useState([]),[f,o]=w.useState(0),[d,h]=w.useState(1),[v,y]=w.useState(!1),[g,x]=w.useState(null);w.useEffect(()=>{let C=!1;return y(!0),x(null),Qe(`violations?page=${d}&pageSize=${xs}`).then(U=>{C||(u(U.items??[]),o(U.total??0))}).catch(U=>{C||x(String((U==null?void 0:U.message)??U))}).finally(()=>{C||y(!1)}),()=>{C=!0}},[d]);const _=Math.max(1,Math.ceil(f/xs));return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Process Violations"}),f>0&&a.jsx("span",{className:"rounded-full border border-disputed/30 bg-disputed/10 px-2 py-0.5 font-mono text-xs font-bold text-disputed",children:f})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/70",children:"Direct master pushes detected by the ref-allowlist enforcer"})]}),a.jsxs("div",{className:"overflow-hidden rounded-md border border-border/40 bg-card/80",children:[g&&a.jsx("div",{className:"border-b border-border/60 bg-disputed/10 px-3 py-2 font-mono text-[10px] text-disputed",children:g}),!g&&a.jsxs("table",{className:"w-full table-fixed text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/40 bg-muted/20 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/80",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&&c.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center font-mono text-[11px] text-muted-foreground/50",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] text-muted-foreground/50",children:"Loading…"})}),!v&&c.map(C=>a.jsx(Ep,{row:C},`${C.taskId}-${C.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] text-muted-foreground/60",children:v?"loading…":f===0?"no violations":`${(d-1)*xs+1}–${Math.min(d*xs,f)} of ${f}`}),a.jsxs("div",{className:`flex items-center gap-2 font-mono text-[10px] text-muted-foreground ${_<=1?"invisible":""}`,children:[a.jsx("button",{type:"button",onClick:()=>h(C=>Math.max(1,C-1)),disabled:d===1||v,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[d," / ",_]}),a.jsx("button",{type:"button",onClick:()=>h(C=>Math.min(_,C+1)),disabled:d>=_||v,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]})]})]})}const Yu=[{key:"passed",label:"passed",bar:"bg-emerald-400",dot:"bg-emerald-400",text:"text-emerald-400"},{key:"pending",label:"pending",bar:"bg-sky-400",dot:"bg-sky-400",text:"text-sky-400"},{key:"insufficient_evidence",label:"insufficient",bar:"bg-yellow-400",dot:"bg-yellow-400",text:"text-yellow-400"},{key:"inconclusive",label:"inconclusive",bar:"bg-orange-400",dot:"bg-orange-400",text:"text-orange-400"},{key:"silent_skill",label:"silent",bar:"bg-zinc-500",dot:"bg-zinc-500",text:"text-zinc-400"},{key:"failed",label:"failed",bar:"bg-red-400",dot:"bg-red-400",text:"text-red-400"}];function Mp({overview:c}){const u=c==null?void 0:c.skillVerdictSummary,f=u?Yu.reduce((o,d)=>o+(u[d.key]??0),0):0;return a.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Skill Verdicts"}),a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:[f," total"]})]}),!u||f===0?a.jsx("p",{className:"font-mono text-[11px] text-muted-foreground/60",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 bg-muted/40",children:Yu.map(o=>{const d=u[o.key]??0;if(d===0)return null;const h=d/f*100;return a.jsx("div",{className:o.bar,style:{width:`${h}%`},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:Yu.map(o=>{const d=u[o.key]??0,h=d===0;return a.jsxs("li",{className:`flex items-center gap-1.5 ${h?"opacity-40":""}`,children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${o.dot}`}),a.jsx("span",{className:"text-muted-foreground",children:o.label}),a.jsx("span",{className:`ml-auto tabular-nums ${h?"text-muted-foreground/50":o.text}`,children:d})]},o.key)})})]})]})}const dm=["bg-primary/70","bg-cyan-500/60","bg-unique","bg-muted-foreground/60","bg-primary/50","bg-confirmed/70"];function fm(c){let u=0;for(let f=0;f<c.length;f++)u=u*31+c.charCodeAt(f)>>>0;return dm[u%dm.length]}function wp({overview:c}){const u=c==null?void 0:c.droppedFindingTypeCounts,f=u?Object.entries(u).sort((d,h)=>h[1]-d[1]):[],o=f.reduce((d,[,h])=>d+h,0);return a.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsxs("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Invalid Output Types",a.jsx("span",{className:"text-muted-foreground/50 font-normal normal-case ml-2",children:"agent_finding tags rejected by the parser"})]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"last 20 rounds"})]}),o===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"all clean — no invalid types"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mb-3 flex h-3 w-full overflow-hidden rounded",children:f.map(([d,h])=>{const v=h/o*100;return a.jsx("div",{className:fm(d),style:{width:`${v}%`},title:`invalid type "${d}" emitted ${h} times in last 20 consensus rounds`},d)})}),a.jsx("ul",{className:"space-y-1 text-xs",children:f.map(([d,h])=>a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`h-2 w-2 rounded-sm ${fm(d)}`}),a.jsx("span",{className:"truncate font-mono text-foreground",children:d}),a.jsx("span",{className:"ml-auto tabular-nums text-muted-foreground",children:h})]},d))})]})]})}function Cp({categoryAccuracy:c,categoryCorrect:u,categoryHallucinated:f}){const o=Object.keys(c??{});if(o.length===0)return a.jsx(Ln,{title:"No category data yet",hint:"Accuracy accrues after ≥5 signals per category.",compact:!0});const d=o.map(h=>{const v=Math.max(0,Math.min(1,c[h]??0)),y=(u==null?void 0:u[h])??0,g=(f==null?void 0:f[h])??0;return{key:h,acc:v,c:y,h:g,n:y+g}}).sort((h,v)=>v.acc-h.acc);return a.jsx("div",{className:"space-y-2",children:d.map(h=>{const v=h.acc>=.7?"bg-confirmed":h.acc>=.4?"bg-unverified":"bg-disputed",y=h.n>0?`${h.c} correct / ${h.h} hallucinated / ${h.n} total`:void 0;return a.jsxs("div",{className:`grid grid-cols-[128px_1fr_auto_44px] items-center gap-3 ${h.n>0&&h.n<10?"opacity-50":""}`,title:h.n>0&&h.n<10?`${y} — low sample (n<10)`:y,children:[a.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:h.key.replace(/_/g," ")}),a.jsx("div",{className:"h-2 overflow-hidden rounded-sm bg-muted/30",children:a.jsx("div",{className:`h-full rounded-sm transition-all ${v}`,style:{width:`${h.acc*100}%`}})}),a.jsx("span",{className:"shrink-0 text-right font-mono text-[10px] tabular-nums text-muted-foreground/60 w-16",children:h.n>0?a.jsxs(a.Fragment,{children:[h.c,"/",h.n,h.h>0&&a.jsxs("span",{className:"ml-1 text-disputed/70",children:["·",h.h,"✗"]})]}):"—"}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums text-foreground",children:[Math.round(h.acc*100),"%"]})]},h.key)})})}const zp=new Set(["passed","failed","silent_skill","insufficient_evidence","flagged_for_manual_review"]);function Dp(c,u,f){return(!c||!zp.has(c))&&u!==void 0&&f!==void 0&&f>0}const Op={silent_skill:"No signals recorded after bind — skill may not be injecting correctly",insufficient_evidence:"Fewer than 120 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"},Rp={pending:"border-border/50 bg-muted/30 text-muted-foreground",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-orange-400/40 bg-orange-500/10 text-orange-400",flagged_for_manual_review:"border-disputed/40 bg-disputed/10 text-disputed"};function kp(c){const u=Math.round(c*100),f=u>0?"+":"",o=u>0?"text-confirmed":u<0?"text-disputed":"text-muted-foreground";return{text:`${f}${u}pp`,cls:o}}function Up({slot:c}){const u=c.status,f=u?Rp[u]:"border-border/50 bg-muted/30 text-muted-foreground",o=u==="inconclusive"&&(c.inconclusiveStrikes??0)>0,d=c.forcedDevelops??[],h=d.length>0?d[d.length-1]:null,v=typeof c.effectiveness=="number"?kp(c.effectiveness):null,y=Dp(u,c.postBindSignals,c.minEvidence);return a.jsxs("div",{className:`rounded-md border bg-card/80 p-3 ${c.enabled?"border-border/50":"border-border/30 opacity-60"}`,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 ${c.enabled?"text-foreground":"text-muted-foreground line-through"}`,children:[c.mode==="contextual"&&"⚡ ",c.name]}),a.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground",children:c.source}),c.mode==="contextual"&&a.jsx("span",{className:"rounded-sm border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 font-mono text-[9px] text-amber-400",children:"contextual"})]}),a.jsxs("div",{className:"mt-1 font-mono text-[10px] text-muted-foreground/60",children:["bound ",He(c.boundAt)]}),y&&(()=>{const g=c.postBindSignals,x=c.minEvidence,_=Math.round(g/x*100),C=Math.min(g/x,1)*100;return a.jsxs("div",{className:"mt-1.5",title:`MIN_EVIDENCE gate: ${g} of ${x} post-bind signals (${_}%)`,children:[a.jsxs("div",{className:"mb-0.5 font-mono text-[9px] text-muted-foreground/50",children:["post-bind: ",g," / ",x]}),a.jsx("div",{className:"relative h-1 w-full overflow-hidden rounded-full border border-border/40 bg-muted/30",children:a.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full border-r border-confirmed/40 bg-confirmed/20",style:{width:`${C}%`}})})]})})()]}),u&&a.jsx("span",{className:`shrink-0 rounded-sm border px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${f}`,title:Op[u],children:u.replace(/_/g," ")})]}),a.jsxs("div",{className:"mt-2 flex items-center gap-3 font-mono text-[10px]",children:[v&&a.jsx("span",{className:v.cls,title:"Effectiveness: change in hallucination rate pre/post",children:v.text}),o&&a.jsxs("span",{className:"text-unique",title:c.inconclusiveAt?`last strike ${He(c.inconclusiveAt)}`:void 0,children:[c.inconclusiveStrikes," strike",c.inconclusiveStrikes===1?"":"s"]})]}),d.length>0&&a.jsxs("div",{className:"mt-2 border-t border-border/40 pt-2 font-mono text-[10px] text-muted-foreground",title:h!=null&&h.reason?`latest: ${h.reason}`:void 0,children:["forced ",d.length," time",d.length===1?"":"s",h&&` · last ${He(h.timestamp)}`]})]})}function qp({open:c,onOpenChange:u,children:f}){return w.useEffect(()=>{if(!c)return;const o=h=>{h.key==="Escape"&&u(!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}},[c,u]),c?a.jsxs("div",{className:"fixed inset-0 z-50",children:[a.jsx("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-sm",onClick:()=>u(!1)}),a.jsx("div",{className:"absolute inset-y-0 right-0 flex",children:a.jsx("div",{onClick:o=>o.stopPropagation(),className:"contents",children:f})})]}):null}function Hp({side:c="right",className:u="",children:f,...o}){return a.jsx("div",{className:`h-full border-l border-border/60 bg-card shadow-xl p-6 ${u}`,...o,children:f})}function Bp({className:c="",...u}){return a.jsx("div",{className:`mb-2 ${c}`,...u})}function Lp({className:c="",...u}){return a.jsx("h2",{className:`font-semibold ${c}`,...u})}function Yp({citation:c}){const u=c.snippet.split(`
70
+ `);return a.jsxs("div",{className:"rounded-md border border-border/40 bg-card/60 overflow-hidden",children:[a.jsx("div",{className:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/40",children:a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:[c.file,":",c.line]})}),a.jsx("pre",{className:"px-3 py-2 font-mono text-[11px] leading-relaxed overflow-x-auto",children:u.map((f,o)=>a.jsx("div",{className:"whitespace-pre",children:f||" "},o))})]})}const Gp={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:"text-muted-foreground bg-muted/50"},Xp={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"};function vs({open:c,onOpenChange:u,consensusId:f,findingId:o}){const[d,h]=w.useState(null),[v,y]=w.useState(null);return w.useEffect(()=>{if(!c||!f||!o){h(null),y(null);return}h(null),y(null),Qe(`finding/${encodeURIComponent(f)}/${encodeURIComponent(o)}`).then(h).catch(g=>y(g.message||"failed to load finding"))},[c,f,o]),a.jsx(qp,{open:c,onOpenChange:u,children:a.jsxs(Hp,{side:"right",className:"w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto",children:[a.jsx(Bp,{children:a.jsx(Lp,{className:"font-mono text-sm",children:"Finding detail"})}),v&&a.jsx("div",{className:"mt-4 text-[11px] text-disputed",children:v}),!v&&!d&&a.jsx("div",{className:"mt-4 text-[11px] text-muted-foreground",children:"Loading…"}),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-widest px-2 py-0.5 rounded ${Xp[d.finding.tag]||"bg-muted"}`,children:d.finding.tag}),d.finding.severity&&a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded ${Gp[d.finding.severity]||"bg-muted"}`,children:d.finding.severity}),a.jsxs("span",{className:"font-mono text-[9px] text-muted-foreground",children:["by ",d.finding.originalAgentId]}),d.retracted&&a.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded bg-disputed/50",children:"retracted"})]}),a.jsx("div",{className:"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-widest text-muted-foreground",children:"Citations"}),d.citations.map((g,x)=>a.jsx(Yp,{citation:g},x))]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-muted-foreground",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((g,x)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-disputed",children:"✗"})," disputed by ",g.agentId,": ",a.jsx("span",{className:"text-muted-foreground",children:g.reason})]},x)),d.finding.confirmedBy.length===0&&d.finding.disputedBy.length===0&&a.jsx("div",{className:"text-[11px] text-muted-foreground",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-widest text-muted-foreground",children:["Signals (",d.signals.length,")"]}),a.jsx("div",{className:"space-y-1",children:d.signals.map((g,x)=>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:g.signal}),a.jsx("span",{className:"text-muted-foreground",children:"·"}),a.jsx("span",{children:g.agentId}),g.counterpartId&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-muted-foreground",children:"→"}),a.jsx("span",{children:g.counterpartId})]}),a.jsx("span",{className:"text-muted-foreground ml-auto",children:He(g.timestamp)})]}),g.evidence&&a.jsx("div",{className:"text-muted-foreground mt-0.5",children:g.evidence.slice(0,200)})]},x))})]}),a.jsx("div",{className:"pt-2 border-t border-border/40",children:a.jsxs("a",{href:`#/consensus/${d.consensusId}`,className:"font-mono text-[10px] text-primary hover:underline",children:["→ consensus round ",d.consensusId]})})]})]})})}const Qp={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 Vp({agentId:c}){const[u,f]=w.useState([]),[o,d]=w.useState(!0),[h,v]=w.useState("all"),[y,g]=w.useState(null);w.useEffect(()=>{let U=!1;return d(!0),Qe(`signals?agent=${encodeURIComponent(c)}&limit=100`).then(V=>{U||(f(V.items||[]),d(!1))}).catch(()=>{U||(f([]),d(!1))}),()=>{U=!0}},[c]);const x=[...u].sort((U,V)=>(V.timestamp||"").localeCompare(U.timestamp||"")),_=h==="all"||h==="signals"?x:[],C=({k:U,label:V,enabled:F})=>a.jsx("button",{type:"button",onClick:()=>F&&v(U),disabled:!F,className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${h===U?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"} ${F?"":"opacity-40 cursor-not-allowed"}`,children:V});return a.jsxs("div",{className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsx("span",{className:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Activity"}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(C,{k:"all",label:"All",enabled:!0}),a.jsx(C,{k:"signals",label:"Signals",enabled:!0}),a.jsx(C,{k:"tasks",label:"Tasks (none yet)",enabled:!1}),a.jsx(C,{k:"skills",label:"Skills (none yet)",enabled:!1})]})]}),o?a.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"Loading…"}):_.length===0?a.jsx(Ln,{title:"No activity yet",hint:"Signals, task completions, and skill binds will appear here.",compact:!0}):a.jsx("div",{className:"space-y-1",children:_.map((U,V)=>{const F=Qp[U.signal]||"text-muted-foreground bg-muted",I=!!(U.consensusId&&U.findingId),X=a.jsxs("div",{className:"flex items-start gap-2 py-1.5",children:[a.jsx("span",{className:"shrink-0 font-mono text-[9px] text-muted-foreground/60 tabular-nums w-16",children:He(U.timestamp)}),a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${F}`,children:U.signal}),a.jsxs("div",{className:"min-w-0 flex-1 text-[11px] text-muted-foreground",children:[U.counterpartId&&a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:["→ ",U.counterpartId," · "]}),U.evidence&&a.jsx("span",{children:U.evidence.length>160?U.evidence.slice(0,160)+"…":U.evidence})]})]});return I?a.jsx("button",{type:"button",onClick:()=>g({consensusId:U.consensusId,findingId:U.findingId}),className:"w-full rounded-sm text-left transition hover:bg-accent/40",children:X},V):a.jsx("div",{children:X},V)})}),a.jsx(vs,{open:!!y,onOpenChange:U=>{U||g(null)},consensusId:(y==null?void 0:y.consensusId)??null,findingId:(y==null?void 0:y.findingId)??null})]})}function Zp(){const c=w.useRef(null),[u,f]=w.useState(0);return w.useEffect(()=>{const o=c.current;if(!o||typeof ResizeObserver>"u")return;const d=new ResizeObserver(h=>{for(const v of h)f(v.contentRect.width)});return d.observe(o),()=>d.disconnect()},[]),[c,u]}const $p={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"},Kp={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"},Jp=6,Fp=500,Rm=100,Ip=150;function Wp(c){if(c<=0)return Rm;const u=Math.floor(c/Jp);return Math.max(1,Math.min(u,Fp))}function Pp({agentId:c}){const[u,f]=w.useState([]),[o,d]=w.useState(0),[h,v]=w.useState(!1),[y,g]=w.useState(null),[x,_]=Zp(),[C,U]=w.useState(Rm),V=w.useRef(null);w.useEffect(()=>{if(_<=0)return;const Z=Wp(_);return V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{U($=>$===Z?$:Z)},Ip),()=>{V.current&&clearTimeout(V.current)}},[_]),w.useEffect(()=>{Qe(`signals?agent=${encodeURIComponent(c)}&limit=${C}`).then(Z=>{f(Z.items||[]),d(Z.total||0)}).catch(()=>{})},[c,C]);const F=w.useMemo(()=>[...u].reverse(),[u]),I={confirmed:0,disputed:0,unique:0,unverified:0,fabricated:0};for(const Z of u)Z.signal==="agreement"||Z.signal==="consensus_verified"?I.confirmed++:Z.signal==="disagreement"||Z.signal==="hallucination_caught"?I.disputed++:Z.signal==="unique_confirmed"||Z.signal==="unique_unconfirmed"||Z.signal==="new_finding"?I.unique++:Z.signal==="unverified"?I.unverified++:Z.signal==="citation_fabricated"&&I.fabricated++;const X=u.length,de=o>X;return u.length===0?a.jsx("div",{ref:x,className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",children:a.jsx(Ln,{title:"No signal history yet",hint:"Signals are recorded during consensus rounds.",compact:!0})}):a.jsxs("div",{ref:x,className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",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:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Signal Timeline"}),a.jsx("span",{className:"font-mono text-[9px] text-muted-foreground/50",children:de?`last ${X} 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:[I.confirmed," confirmed"]}),I.disputed>0&&a.jsxs("span",{className:"text-disputed",children:[I.disputed," disputed"]}),I.unique>0&&a.jsxs("span",{className:"text-unique",children:[I.unique," unique"]}),I.unverified>0&&a.jsxs("span",{className:"text-unverified",children:[I.unverified," unverified"]}),I.fabricated>0&&a.jsxs("span",{className:"text-amber-500",children:[I.fabricated," fabricated"]})]})]}),a.jsx("div",{className:"flex items-center gap-0.5",children:F.map((Z,$)=>{const Q=!!(Z.consensusId&&Z.findingId);return a.jsx("button",{type:"button",disabled:!Q,onClick:()=>{Z.consensusId&&Z.findingId&&(g({consensusId:Z.consensusId,findingId:Z.findingId}),v(!0))},className:`h-4 min-w-[4px] flex-1 rounded-sm transition-opacity hover:opacity-80 ${$p[Z.signal]||"bg-muted"} ${Q?"cursor-pointer":"cursor-default"}`,title:`${Kp[Z.signal]||Z.signal} — ${He(Z.timestamp)}${Q?" (click for detail)":""}`},$)})}),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(Z=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:`h-2 w-2 rounded-sm ${Z.color}`}),a.jsx("span",{className:"font-mono text-[9px] text-muted-foreground/60",children:Z.label})]},Z.label))}),a.jsx(vs,{open:h,onOpenChange:v,consensusId:(y==null?void 0:y.consensusId)??null,findingId:(y==null?void 0:y.findingId)??null})]})}function e0(c){const u=c.toLowerCase();return u==="completed"||u==="done"||u==="success"||u==="succeeded"?"completed":u==="running"||u==="active"||u==="in_progress"||u==="pending"?"running":u==="failed"||u==="error"||u==="errored"||u==="timeout"||u==="timed_out"?"failed":u==="cancelled"||u==="canceled"||u==="queued"||u==="waiting"?"cancelled":"unknown"}const t0={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:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1},unknown:{label:"Unknown",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1}},n0={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 l0(c){if(!c)return"—";if(c<1e3)return"< 1s";if(c<6e4)return Math.floor(c/1e3)+"s";if(c<36e5){const o=Math.floor(c/6e4),d=Math.floor(c%6e4/1e3);return d>0?`${o}m ${d}s`:`${o}m`}const u=Math.floor(c/36e5),f=Math.floor(c%36e5/6e4);return f>0?`${u}h ${f}m`:`${u}h`}function km({task:c,onClick:u}){const f=e0(c.status),o=t0[f];return a.jsxs("tr",{className:`border-b border-border hover:bg-accent/30 transition-colors ${u?"cursor-pointer":""}`,onClick:u?d=>{d.target.closest("a")||u(c)}: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":""}`,"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:n0[f]})}),a.jsx("span",{className:`font-mono text-[10px] font-semibold uppercase tracking-wider ${o.text}`,children:o.label})]})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsx("span",{className:"rounded border border-amber-500/25 bg-amber-500/8 px-2 py-1 font-mono text-[10px] font-semibold text-amber-400",title:c.taskId,children:c.taskId.slice(0,8)})}),a.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs text-muted-foreground",children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(c.agentId)}`,className:"inline-flex items-center gap-1.5 transition hover:text-primary",children:[a.jsx("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:Ka(c.agentId)}}),c.agentId]})}),a.jsx("td",{className:"py-2.5 pr-3 font-inter text-sm text-foreground/80",children:(()=>{const d=c.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 text-muted-foreground",children:f==="running"?"running":l0(c.duration)}),a.jsx("td",{className:"py-2.5 pr-4 text-right font-mono text-xs text-muted-foreground/50",children:He(c.timestamp)})]})}const a0=3,i0=720*60*60*1e3;function s0({agentId:c,agents:u,tasks:f,consensus:o}){const d=u.find(R=>R.id===c),[h,v]=w.useState([]),[y,g]=w.useState([]),[x,_]=w.useState(null),[C,U]=w.useState(null),[V,F]=w.useState(null),[I,X]=w.useState(0),[de,Z]=w.useState(0);w.useEffect(()=>{Qe(`memory/${c}`).then(R=>{v(R.knowledge||[])}).catch(()=>v([]))},[c]),w.useEffect(()=>{let R=!1;return Qe("consensus-reports?page=1&pageSize=200").then(W=>{R||g(W.reports||[])}).catch(()=>{R||g([])}),()=>{R=!0}},[]);const $=w.useMemo(()=>{var O;const R=Date.now(),W=new Map;for(const Y of y){const L=Date.parse(Y.timestamp);if(Number.isNaN(L)||R-L>i0)continue;const ne=(O=Y.authorDiagnostics)==null?void 0:O[c];if(ne)for(const ce of ne)W.set(ce.code,(W.get(ce.code)??0)+1)}const p=[];for(const[Y,L]of W)L>=a0&&p.push({code:Y,count:L});return p},[y,c]);if(!d)return a.jsxs("div",{className:"py-20 text-center text-muted-foreground",children:["Agent not found: ",c]});const Q=d.scores,D=(f==null?void 0:f.items.filter(R=>R.agentId===c))||[],ae=(o==null?void 0:o.runs.filter(R=>R.agents.includes(c)))||[],G=[{label:"accuracy",value:Q.accuracy,fill:Q.accuracy>=.7?"bg-confirmed":Q.accuracy>=.4?"bg-unverified":"bg-disputed"},{label:"reliability",value:Q.taskCompletionRate??0,fill:"bg-chart",tooltip:"Task completion rate — fraction of dispatched tasks that finished without pipeline error or timeout"},{label:"unique",value:Q.uniqueness,fill:"bg-unique"},{label:"impact",value:Q.impactScore,fill:"bg-[var(--color-impact)]"}],te=Q.unverifiedsEmitted??0,ue=Q.unverifiedsReceived??0,oe=te+ue,Se=[{label:"Signals",value:String(Q.signals),color:"text-foreground"},{label:"Agreements",value:String(Q.agreements),color:"text-confirmed"},{label:"Disagreements",value:String(Q.disagreements),color:"text-disputed"},{label:"Hallucinations",value:String(Q.hallucinations),color:Q.hallucinations>0?"text-disputed":"text-muted-foreground"},{label:"Unverified",value:oe>0?`${te}↑ ${ue}↓`:"0",color:oe>0?"text-unverified":"text-muted-foreground",title:oe>0?`${te} emitted (as reviewer) · ${ue} received (as author)`:void 0},{label:"Tokens",value:d.totalTokens.toLocaleString(),color:"text-foreground"}],J=10,ie=Math.max(1,Math.ceil(D.length/J)),he=Math.min(I,ie-1),A=D.slice(he*J,(he+1)*J),S=w.useMemo(()=>{const R=new Map;for(const W of h){const p=W.filename.match(/^(\d{4}-\d{2}-\d{2})/),O=p?p[1]:"undated",Y=R.get(O)||[];Y.push(W),R.set(O,Y)}return Array.from(R.entries()).sort(([W],[p])=>W==="undated"?1:p==="undated"?-1:p.localeCompare(W)).map(([W,p])=>({day:W,items:p}))},[h]),H=Math.min(de,Math.max(0,S.length-1)),K=S[H];return a.jsxs(a.Fragment,{children:[(()=>{const R=Ju(Q);return R==="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 (",Q.bench.reason??"unknown","). Agent excluded from dispatch until scores recover."]})]})}):R==="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:[Q.consecutiveFailures,"+ consecutive failures. Deprioritized until clean signals recorded."]})]})}):R==="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 (",Q.bench.reason??"rule","), but is the sole provider of a category — kept to preserve coverage."]})]})}):null})(),$.length>0&&a.jsx("div",{className:"mb-6 space-y-2",children:$.map(({code:R,count:W})=>a.jsxs("div",{className:"rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3","data-diagnostic-code":R,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:Vu(R)}}),a.jsxs("span",{className:"font-mono text-[11px] text-unverified/60",children:["· ",W," fires in 30d"]})]}),a.jsxs("div",{className:"mt-1 text-xs text-muted-foreground/80",children:["This agent's raw output has repeatedly tripped ",a.jsx("span",{className:"font-mono",children:R}),". Inspect recent consensus rounds on this page for the per-finding banner, or check upstream pipeline layers (sanitizer / renderer / relay encoding)."]})]},R))}),a.jsx("div",{className:"relative mb-6 rounded-xl border border-border bg-card p-5",children:a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsx("div",{className:"relative shrink-0","data-tooltip":`Accuracy ${Math.round(Q.accuracy*100)}% · Uniqueness ${Math.round(Q.uniqueness*100)}% · Impact ${Math.round(Q.impactScore*100)}%`,children:a.jsx(Ku,{agentId:d.id,size:120,signals:Q.signals,accuracy:Q.accuracy,uniqueness:Q.uniqueness,impact:Q.impactScore})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("h1",{className:"truncate font-mono text-2xl font-bold text-foreground",children:d.id}),a.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",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-primary bg-primary/10":"text-confirmed bg-confirmed/10"}`,children:d.native?"NATIVE":"RELAY"}),d.preset&&a.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 font-mono text-[10px] text-muted-foreground",children:d.preset}),a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/60",children:[Q.signals," signals",d.lastTask?` · ${He(d.lastTask.timestamp)}`:""]})]})]}),a.jsxs("div",{className:"flex shrink-0 flex-col items-end rounded-md border border-border bg-background/60 px-3 py-2","data-tooltip":`Dispatch weight ${Q.dispatchWeight.toFixed(2)}
71
+ Scale 0.3 → 2.0`,"data-tooltip-pos":"left",children:[a.jsx("span",{className:"font-mono text-2xl font-bold tabular-nums leading-none text-foreground",children:Q.dispatchWeight.toFixed(2)}),a.jsx("span",{className:"mt-1 font-mono text-[9px] uppercase text-muted-foreground/50",children:"weight"})]})]})}),a.jsx("section",{className:"mb-6",children:a.jsx(Pp,{agentId:c})}),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 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Metrics"}),a.jsxs("div",{className:"rounded-lg border border-border/40 bg-card/80 p-4 shadow-[inset_0_1px_3px_rgba(0,0,0,0.35)]",children:[a.jsx("div",{className:"space-y-2.5",children:G.map(R=>a.jsxs("div",{className:"grid grid-cols-[72px_1fr_44px] items-center gap-3",...R.tooltip?{"data-tooltip":R.tooltip}:{},children:[a.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:R.label}),a.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-background/80",children:a.jsx("div",{className:`h-full rounded-full transition-all ${R.fill}`,style:{width:`${Math.max(0,Math.min(100,R.value*100))}%`}})}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums text-foreground",children:[Math.round(R.value*100),"%"]})]},R.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:Se.map(R=>a.jsxs("div",{className:"bg-background/60 px-2 py-2 text-center",title:R.title,children:[a.jsx("div",{className:`font-mono text-sm font-bold tabular-nums ${R.color}`,children:R.value}),a.jsx("div",{className:"mt-0.5 font-mono text-[9px] uppercase tracking-wider text-muted-foreground/70",children:R.label})]},R.label))})]})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"mb-1 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Category Competency"}),a.jsx("p",{className:"mb-3 mt-0.5 font-mono text-[11px] text-muted-foreground/80",children:"◆ Raw per-category ratio — unweighted. Overall accuracy in Metrics applies a hallucination penalty."}),a.jsx(Cp,{categoryAccuracy:Q.categoryAccuracy,categoryCorrect:Q.categoryCorrect,categoryHallucinated:Q.categoryHallucinated})]})]}),(d.skillSlots.length>0||d.skills.length>0)&&a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Skills ",a.jsx("span",{className:"text-primary",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(R=>a.jsx(Up,{slot:R},R.name))}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:d.skills.map(R=>a.jsx("span",{className:"rounded-sm border border-border bg-card px-2.5 py-1 font-mono text-xs text-muted-foreground",children:R},R))})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Tasks ",a.jsx("span",{className:"text-primary",children:D.length})]}),ie>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[a.jsx("button",{onClick:()=>X(R=>Math.max(0,R-1)),disabled:he===0,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{children:[he+1," / ",ie]}),a.jsx("button",{onClick:()=>X(R=>Math.min(ie-1,R+1)),disabled:he>=ie-1,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]}),D.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 bg-card",children:[a.jsx("th",{className:"py-2 pl-4 pr-2 text-xs font-medium text-muted-foreground",style:{width:32}}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium text-muted-foreground",children:"ID"}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium text-muted-foreground",children:"Agent"}),a.jsx("th",{className:"py-2 pr-3 text-xs font-medium text-muted-foreground",children:"Description"}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium text-muted-foreground",children:"Duration"}),a.jsx("th",{className:"py-2 pr-4 text-right font-mono text-xs font-medium text-muted-foreground",children:"When"})]})}),a.jsx("tbody",{children:A.map(R=>a.jsx(km,{task:R},R.taskId))})]})}):a.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tasks recorded."})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Consensus Runs ",a.jsx("span",{className:"text-primary",children:ae.length})]}),ae.length>0?a.jsx("div",{className:"space-y-2",children:ae.slice(0,20).map((R,W)=>{const p=R.counts,O=(p.agreement||0)+(p.disagreement||0)+(p.hallucination||0)+(p.unverified||0)+(p.unique||0)+(p.new||0),Y=O||1,L=[{key:"confirmed",count:p.agreement||0,color:"bg-confirmed",text:"text-confirmed"},{key:"disputed",count:(p.disagreement||0)+(p.hallucination||0),color:"bg-disputed",text:"text-disputed"},{key:"unverified",count:p.unverified||0,color:"bg-unverified",text:"text-unverified"},{key:"unique",count:(p.unique||0)+(p.new||0),color:"bg-unique",text:"text-unique"}],ne={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"}},ce=R.signals.filter(fe=>fe.signal!=="signal_retracted"&&ne[fe.signal]),pe=R.taskId+":"+W,Be=C===pe;return a.jsxs("div",{className:"rounded-md border border-border/40 bg-card",children:[a.jsx("button",{type:"button",onClick:()=>U(Be?null:pe),disabled:ce.length===0,className:`flex w-full items-center p-3 text-left transition ${ce.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 text-foreground",children:[ce.length>0&&a.jsx("span",{className:"mr-1.5 inline-block text-muted-foreground",children:Be?"▾":"▸"}),O," findings"]}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:He(R.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex gap-2",children:L.map(fe=>fe.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${fe.text}`,children:[fe.count," ",fe.key]},fe.key))}),a.jsx("div",{className:"mt-1.5 flex h-1.5 overflow-hidden rounded-sm",children:L.map(fe=>fe.count>0&&a.jsx("div",{className:fe.color,style:{width:`${fe.count/Y*100}%`}},fe.key))})]})}),Be&&ce.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:ce.map((fe,Lt)=>{const Zt=ne[fe.signal],Yn=!!(fe.findingId&&R.taskId),Gn=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 text-muted-foreground [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400",dangerouslySetInnerHTML:{__html:bs(fe.evidence||"")}}),a.jsxs("span",{className:"ml-2 font-mono text-[10px] text-muted-foreground/50",children:[fe.agentId,fe.counterpartId?` + ${fe.counterpartId}`:""]})]})]});return Yn?a.jsx("button",{type:"button",onClick:()=>F({consensusId:R.taskId,findingId:fe.findingId}),className:"block w-full rounded-sm text-left transition hover:bg-accent/40",children:Gn},Lt):a.jsx("div",{children:Gn},Lt)})})})]},pe)})}):a.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No consensus participation recorded."})]}),a.jsx("section",{className:"mb-8",children:a.jsx(Vp,{agentId:c})}),a.jsx(vs,{open:!!V,onOpenChange:R=>{R||F(null)},consensusId:(V==null?void 0:V.consensusId)??null,findingId:(V==null?void 0:V.findingId)??null}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Memory ",a.jsxs("span",{className:"text-primary",children:[h.length," files"]}),K&&a.jsxs("span",{className:"ml-2 font-mono text-[10px] text-muted-foreground",children:["· ",K.day," (",K.items.length,")"]})]}),S.length>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[a.jsx("button",{onClick:()=>Z(R=>Math.max(0,R-1)),disabled:H===0,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Newer"}),a.jsxs("span",{children:[H+1," / ",S.length]}),a.jsx("button",{onClick:()=>Z(R=>Math.min(S.length-1,R+1)),disabled:H>=S.length-1,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Older ▸"})]})]}),K&&K.items.length>0?a.jsx("div",{className:"space-y-1.5",children:K.items.map(R=>{var Y,L;const W=x===R.filename,p=((Y=R.frontmatter)==null?void 0:Y.type)||"memory",O=((L=R.frontmatter)==null?void 0:L.name)||R.filename.replace(/\.md$/,"");return a.jsxs("div",{className:"rounded-md border border-border/40 bg-card/80",children:[a.jsxs("button",{onClick:()=>_(W?null:R.filename),className:"flex w-full items-center gap-2 p-3 text-left transition hover:bg-accent/50",children:[a.jsx("span",{className:`font-mono text-xs ${W?"text-primary":"text-muted-foreground"}`,children:W?"▾":"▸"}),a.jsx("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase text-muted-foreground",children:p}),a.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:O}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-muted-foreground",children:R.filename})]}),W&&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 text-muted-foreground",children:R.content})})]},R.filename)})}):a.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No memory files."})]})]})}const mm={dispatch:"text-muted-foreground/80",consensus:"text-primary/70",error:"text-disputed",timeout:"text-unverified",worker:"text-muted-foreground/70",gemini:"text-muted-foreground/70",skill:"text-muted-foreground/80",boot:"text-muted-foreground/50",relay:"text-muted-foreground/80",gossip:"text-muted-foreground/80",utility:"text-muted-foreground/60",memory:"text-muted-foreground/80",persist:"text-muted-foreground/50",toolserver:"text-muted-foreground/50",other:"text-muted-foreground/70"},c0=[[/^\[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 u0(c){for(const[u,f]of c0)if(u.test(c))return f;return"other"}const r0=[{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"}],hm=1e3;function o0(){const[c,u]=w.useState([]),[f,o]=w.useState(0),[d,h]=w.useState(0),[v,y]=w.useState("all"),[g,x]=w.useState(!0),[_,C]=w.useState(!0),U=w.useRef(null),V=w.useRef(0);w.useEffect(()=>{let X=!1;return(async()=>{try{const Z=await Qe("logs?tail=500");if(X)return;u(Z.entries),o(Z.totalLines),h(Z.fileSize),V.current=Z.totalLines+1}catch{}})(),()=>{X=!0}},[]),w.useEffect(()=>{if(_)return wm(X=>{var Z;if(X.type!=="log_lines")return;const de=(Z=X.data)==null?void 0:Z.lines;de!=null&&de.length&&u($=>{const Q=de.map((ae,G)=>({line:V.current+G,text:ae,category:u0(ae)}));V.current+=de.length,o(ae=>ae+de.length);const D=[...$,...Q];return D.length>hm?D.slice(-hm):D})})},[_]),w.useEffect(()=>{g&&U.current&&U.current.scrollIntoView({behavior:"smooth"})},[c,g]);const F=v==="all"?c:c.filter(X=>X.category===v),I=w.useCallback(X=>X<1024?`${X} B`:X<1048576?`${(X/1024).toFixed(1)} KB`:`${(X/1048576).toFixed(1)} MB`,[]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[a.jsxs("h2",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:["MCP Log ",a.jsxs("span",{className:"text-primary",children:[f," lines"]})]}),a.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/50",children:I(d)}),_&&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:[r0.map(X=>a.jsx("button",{onClick:()=>y(X.key),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${v===X.key?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:X.label},X.key)),a.jsxs("div",{className:"ml-auto flex gap-1.5",children:[a.jsx("button",{onClick:()=>C(!_),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${_?"bg-confirmed/10 text-confirmed":"text-muted-foreground"}`,children:_?"● Live":"○ Paused"}),a.jsx("button",{onClick:()=>x(!g),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${g?"bg-primary/10 text-primary":"text-muted-foreground"}`,children:g?"⤓ Auto":"⤓ Scroll"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border bg-card",children:a.jsxs("div",{className:"max-h-[70vh] overflow-y-auto p-3 font-mono text-xs leading-relaxed",children:[F.map(X=>a.jsxs("div",{className:"flex gap-2 hover:bg-muted/30",children:[a.jsx("span",{className:"w-10 shrink-0 select-none text-right text-muted-foreground/30",children:X.line}),a.jsx("span",{className:mm[X.category]||mm.other,children:X.text})]},X.line)),F.length===0&&a.jsx("div",{className:"py-8 text-center font-mono text-xs text-muted-foreground",children:c.length===0?"Loading...":v==="all"?"No log entries in current tail.":`No ${v} entries in current tail.`}),a.jsx("div",{ref:U})]})})]})}const d0=["critical","high","medium","low"],f0=["manual","impl","meta","auto-provisional"];function xm(c,u){return c.includes(u)?c.filter(f=>f!==u):[...c,u]}const Vt="mb-1 block font-mono text-[9px] font-semibold uppercase tracking-widest text-muted-foreground/70",Hn="w-full rounded border border-border bg-background px-2 py-1 font-mono text-[10px] text-foreground focus:border-primary focus:outline-none";function m0({filters:c,onChange:u,agents:f,signalTypes:o}){const d=h=>v=>{const y=v.target.value;u({[h]:y===""?void 0:y})};return a.jsxs("aside",{className:"space-y-3 rounded-md border border-border/60 bg-card/70 p-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"font-mono text-[11px] font-semibold uppercase tracking-widest text-primary",children:"Filters"}),a.jsx("button",{type:"button",className:"font-mono text-[9px] text-muted-foreground/70 hover:text-foreground",onClick:()=>u({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:Vt,children:["Agents (",c.agents.length," selected)"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 bg-background p-1",children:[f.length===0&&a.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px] text-muted-foreground/50",children:"no agents"}),f.map(h=>a.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] text-foreground hover:bg-muted/40",children:[a.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:c.agents.includes(h),onChange:()=>u({agents:xm(c.agents,h)})}),a.jsx("span",{children:h})]},h))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Counterpart"}),a.jsxs("select",{className:Hn,value:c.counterpart??"",onChange:d("counterpart"),children:[a.jsx("option",{value:"",children:"any"}),f.map(h=>a.jsx("option",{value:h,children:h},h))]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:Vt,children:["Signal types (",c.signals.length,")"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 bg-background p-1",children:[o.length===0&&a.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px] text-muted-foreground/50",children:"no signals"}),o.map(h=>a.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] text-foreground hover:bg-muted/40",children:[a.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:c.signals.includes(h),onChange:()=>u({signals:xm(c.signals,h)})}),a.jsx("span",{children:h})]},h))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Severity"}),a.jsxs("select",{className:Hn,value:c.severity??"",onChange:d("severity"),children:[a.jsx("option",{value:"",children:"any"}),d0.map(h=>a.jsx("option",{value:h,children:h},h))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,"data-tooltip":"manual = operator-recorded · impl = implementer pipeline · meta = orchestrator self-telemetry · auto-provisional = unvalidated",children:"Source"}),a.jsxs("select",{className:Hn,value:c.source??"",onChange:d("source"),children:[a.jsx("option",{value:"",children:"any"}),f0.map(h=>a.jsx("option",{value:h,children:h},h))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Category"}),a.jsx("input",{type:"text",className:Hn,value:c.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:Vt,children:"Since"}),a.jsx("input",{type:"datetime-local",className:Hn,value:c.since?c.since.slice(0,16):"",onChange:h=>u({since:h.target.value?new Date(h.target.value).toISOString():void 0})})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Until"}),a.jsx("input",{type:"datetime-local",className:Hn,value:c.until?c.until.slice(0,16):"",onChange:h=>u({until:h.target.value?new Date(h.target.value).toISOString():void 0})})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Consensus ID (prefix)"}),a.jsx("input",{type:"text",className:Hn,value:c.consensusId??"",onChange:d("consensusId"),placeholder:"e.g. d07eac46"})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Finding ID (prefix)"}),a.jsx("input",{type:"text",className:Hn,value:c.findingId??"",onChange:d("findingId"),placeholder:"e.g. d07eac46-5f464e89:sonnet"})]})]})}const gm={agents:[],signals:[]},h0=["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"],x0={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"},g0={agreement:"text-confirmed",consensus_verified:"text-confirmed",impl_test_pass:"text-confirmed",impl_typecheck_pass:"text-confirmed",impl_peer_approved:"text-confirmed",disagreement:"text-disputed",hallucination_caught:"text-disputed",impl_test_fail:"text-disputed",impl_typecheck_fail:"text-disputed",impl_peer_rejected:"text-disputed",boundary_escape:"text-disputed",unique_confirmed:"text-unique",new_finding:"text-unique",unique_unconfirmed:"text-unique/70",unverified:"text-unverified"},p0={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:"text-muted-foreground bg-muted/50"},$a=100;function b0(){if(typeof window>"u")return{filters:gm,hadAny:!1};const c=new URLSearchParams(window.location.search),u=c.getAll("signal").filter(Boolean),f=c.get("agent"),o=c.get("counterpart")??void 0,d=c.get("category")??void 0,h=c.get("severity"),v=h==="critical"||h==="high"||h==="medium"||h==="low"?h:void 0,y=c.get("since")??void 0,g=c.get("until")??void 0,x=c.get("consensus_id")??void 0,_=c.get("finding_id")??void 0,C=c.get("source"),U=C==="manual"||C==="impl"||C==="meta"||C==="auto-provisional"?C:void 0;return u.length>0||f||o||d||v||y||g||x||_||U?{filters:{agents:f?[f]:[],signals:u,counterpart:o,category:d,severity:v,since:y,until:g,consensusId:x,findingId:_,source:U},hadAny:!0}:{filters:gm,hadAny:!1}}function v0(c,u,f=$a){const o=new URLSearchParams;o.set("limit",String(f)),o.set("offset",String(u)),c.agents.length===1&&o.set("agent",c.agents[0]),c.counterpart&&o.set("counterpart",c.counterpart);for(const d of c.signals)o.append("signal",d);return c.category&&o.set("category",c.category),c.severity&&o.set("severity",c.severity),c.since&&o.set("since",c.since),c.until&&o.set("until",c.until),c.consensusId&&o.set("consensus_id",c.consensusId),c.findingId&&o.set("finding_id",c.findingId),c.source&&o.set("source",c.source),o}function Gu(c,u){return c?c.length>u?c.slice(0,u)+"…":c:""}function y0(){const[{filters:c,hadAny:u}]=w.useState(b0),[f,o]=w.useState(c),[d,h]=w.useState([]),[v,y]=w.useState(0),[g,x]=w.useState(0),[_,C]=w.useState(!1),[U,V]=w.useState(null),[F,I]=w.useState([]),[X,de]=w.useState(!1),[Z,$]=w.useState(null),[Q,D]=w.useState(null),ae=w.useRef(null),G=w.useRef(0),te=w.useCallback(async(A,S)=>{const H=++G.current;C(!0),V(null);try{const K=v0(A,S*$a),R=await Qe(`signals?${K.toString()}`);if(H!==G.current)return;h(R.items??[]),x(R.total??0)}catch(K){if(H!==G.current)return;V(K instanceof Error?K.message:"fetch failed")}finally{H===G.current&&C(!1)}},[]);w.useEffect(()=>{Qe("agents").then(A=>{const S=(A??[]).map(H=>H.id).filter(Boolean).sort();S.length>0&&I(S)}).catch(()=>{})},[]),w.useEffect(()=>{y(0)},[f]),w.useEffect(()=>(ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{te(f,v)},250),()=>{ae.current&&clearTimeout(ae.current)}),[f,v,te]);const ue=w.useCallback(A=>{o(S=>({...S,...A}))},[]),oe=Math.max(1,Math.ceil(g/$a)),Se=Math.min(v,oe-1),J=g>0||u||_,ie=(A,S)=>{!A||!S||($(A),D(S),de(!0))},he=w.useMemo(()=>{const A=[];return f.agents.length&&A.push(`${f.agents.length} agents`),f.signals.length&&A.push(`${f.signals.length} signals`),f.severity&&A.push(f.severity),f.source&&A.push(f.source),(f.since||f.until)&&A.push("time window"),A.length?A.join(" · "):"all signals"},[f]);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:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Signals"}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Scored events emitted by agents during consensus review."}),a.jsxs("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/70",children:[he," — showing ",d.length," of ",g]})]})}),u&&a.jsxs("div",{className:"rounded-md border border-border/40 bg-muted/30 px-3 py-2 font-mono text-[10px] text-muted-foreground",children:["Filtered view — ",f.signals.length," signal type",f.signals.length!==1?"s":"",f.agents.length>0?` · ${f.agents.length} agent${f.agents.length!==1?"s":""}`:"",f.severity?` · severity: ${f.severity}`:"",f.source?` · source: ${f.source}`:"",". ",a.jsx("a",{href:Bn("/signals"),className:"text-primary hover:text-foreground",children:"Clear filters"})]}),a.jsxs("div",{className:`grid grid-cols-1 gap-4 ${J?"lg:grid-cols-[260px_1fr]":""} lg:items-start`,children:[J&&a.jsx("div",{className:u?"opacity-70 transition-opacity hover:opacity-100 focus-within:opacity-100":void 0,children:a.jsx(m0,{filters:f,onChange:ue,agents:F,signalTypes:h0})}),a.jsxs("section",{className:"min-w-0 overflow-hidden rounded-md border border-border/60 bg-card/70",children:[U&&a.jsx("div",{className:"border-b border-border/60 bg-disputed/10 px-3 py-2 font-mono text-[10px] text-disputed",children:U}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full border-collapse font-mono text-[10px]",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/60 text-left text-muted-foreground/70",children:[a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Time"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Agent"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Signal"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest","data-tooltip":"Severity of the associated finding (critical / high / medium / low)",children:"Sev"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Evidence"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest","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 font-semibold uppercase tracking-widest","data-tooltip":"Finding ID — click row to open finding detail",children:"Finding"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Consensus"})]})}),a.jsxs("tbody",{children:[d.length===0&&!_&&a.jsx("tr",{children:a.jsx("td",{colSpan:8,className:"px-2 py-8 text-center text-muted-foreground/50",children:"no signals match these filters"})}),d.map((A,S)=>{const H=!!(A.consensusId&&A.findingId);return a.jsxs("tr",{className:`border-b border-border/30 ${H?"cursor-pointer hover:bg-muted/30":""}`,onClick:()=>H&&ie(A.consensusId,A.findingId),children:[a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/80",title:A.timestamp,children:He(A.timestamp)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-foreground",children:A.agentId}),a.jsx("td",{className:`whitespace-nowrap px-2 py-1 ${g0[A.signal]??"text-foreground"}`,children:x0[A.signal]??A.signal}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1",children:A.severity?a.jsx("span",{className:`rounded border px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${p0[A.severity]??"bg-muted"}`,children:A.severity}):a.jsx("span",{className:"text-muted-foreground/40",children:"—"})}),a.jsx("td",{className:"max-w-[300px] truncate px-2 py-1 text-muted-foreground/80",title:A.evidence,children:Gu(A.evidence,80)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/80",children:A.counterpartId??"—"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/70",title:A.findingId,children:A.findingId?Gu(A.findingId,24):"—"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/70",title:A.consensusId,children:A.consensusId?Gu(A.consensusId,16):"—"})]},`${A.timestamp}-${A.agentId}-${S}`)})]})]})}),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] text-muted-foreground/60",children:_?"loading…":`${Se*$a+1}–${Se*$a+d.length} of ${g}`}),a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[a.jsx("button",{type:"button",onClick:()=>y(A=>Math.max(0,A-1)),disabled:Se===0||_,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[Se+1," / ",oe]}),a.jsx("button",{type:"button",onClick:()=>y(A=>Math.min(oe-1,A+1)),disabled:Se>=oe-1||_,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]})]})]}),a.jsx(vs,{open:X,onOpenChange:de,consensusId:Z,findingId:Q})]})}function j0(){const[c,u]=w.useState(null),[f,o]=w.useState(!1);w.useEffect(()=>{vg().then(u)},[]);const d=w.useCallback(async h=>{o(!1),await bg(h)?u(!0):o(!0)},[]);return{authed:c,login:d,error:f}}function N0(c){w.useEffect(()=>(Mm(),wm(c)),[c])}const S0=5e3;function _0(){const[c,u]=w.useState({overview:null,agents:null,tasks:null,consensus:null,consensusReports:null,nativeMemories:null,gossipMemories:null,memories:null,loading:!0,error:null}),f=w.useRef(!1),o=w.useCallback(async()=>{if(!f.current){f.current=!0;try{const[d,h,v,y,g,x,_]=await Promise.all([Qe("overview"),Qe("agents"),Qe("tasks?limit=2000"),Qe("consensus?pageSize=500"),Qe("consensus-reports?page=1&pageSize=5").catch(()=>({reports:[]})),Qe("native-memory").catch(()=>({knowledge:[]})),Qe("gossip-memory").catch(()=>({knowledge:[]}))]),C=[...x.knowledge||[]].map(V=>({...V,origin:"native"})).sort((V,F)=>F.filename>V.filename?1:-1),U=[..._.knowledge||[]].map(V=>({...V,origin:"gossip"})).sort((V,F)=>F.filename>V.filename?1:-1);u({overview:d,agents:h,tasks:v,consensus:y,consensusReports:g,nativeMemories:C,gossipMemories:U,memories:C,loading:!1,error:null})}catch(d){u(h=>({...h,loading:!1,error:d.message}))}finally{f.current=!1}}},[]);return w.useEffect(()=>{o()},[o]),w.useEffect(()=>{const d=setInterval(()=>{o()},S0);return()=>clearInterval(d)},[o]),{...c,refresh:o}}const Um="dashboard:lastEventId";function T0(){if(typeof window>"u")return 0;const c=window.localStorage.getItem(Um);if(!c)return 0;const u=parseInt(c,10);return Number.isFinite(u)?u:0}function E0(c){typeof window>"u"||window.localStorage.setItem(Um,String(c))}const pm=1e3,A0=5e3;function M0(c){w.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let u=null,f=null,o=pm,d=!1;function h(){if(d)return;const v=T0();u=new window.EventSource(`/dashboard/api/events?last_id=${v}`),u.onmessage=y=>{try{const g=JSON.parse(y.data);c(g),E0(g.id),o=pm}catch{}},u.onerror=()=>{u&&(u.close(),u=null),!d&&(f=setTimeout(()=>{h()},o),o=Math.min(o*2,A0))}}return h(),()=>{d=!0,f!==null&&clearTimeout(f),u&&(u.close(),u=null)}},[])}const bm=5,w0=6e3;function C0({toast:c,onDismiss:u}){const f=w.useRef(null),o=w.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]),d=w.useCallback(()=>{o(),f.current=setTimeout(()=>u(c.id),w0)},[c.id,u,o]);w.useEffect(()=>(d(),o),[d,o]);const{type:h,payload:v}=c.event,y=h==="task.completed"?a.jsx("span",{className:"text-muted-foreground",children:"✓"}):v.confirmed>v.disputed?a.jsx("span",{className:"text-confirmed",children:"◎"}):a.jsx("span",{className:"text-disputed",children:"◎"});let g;if(h==="task.completed"){const _=String(v.agentId??"agent"),C=typeof v.durationMs=="number"?v.durationMs:null,U=C!==null?`${(C/1e3).toFixed(1)}s`:"—";g=`${_} finished in ${U}`}else{const _=Number(v.confirmed??0),C=Number(v.disputed??0);g=`Consensus done — ${_} confirmed · ${C} disputed`}const x=()=>{o(),h==="task.completed"&&v.taskId?ps("/tasks"):h==="consensus.completed"&&v.consensusId&&ps("/debates"),u(c.id)};return a.jsx("div",{className:["pointer-events-auto bg-card border rounded shadow-sm px-4 py-3 max-w-sm cursor-pointer","transition-all duration-200","motion-reduce:transition-none motion-reduce:transform-none","hover:bg-muted/30 hover:border-border",c.exiting?"opacity-0 scale-95 opacity-0 translate-y-2":"opacity-100 scale-100 translate-x-0"].join(" "),onClick:x,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:y}),a.jsx("span",{title:g,className:"font-mono text-[11px] text-foreground min-w-0 truncate",children:g}),a.jsx("button",{className:"ml-auto shrink-0 text-muted-foreground/50 hover:text-muted-foreground text-xs leading-none",onClick:_=>{_.stopPropagation(),o(),u(c.id)},"aria-label":"Dismiss notification",children:"×"})]})})}function z0(){const[c,u]=w.useState([]),f=w.useCallback(d=>{u(h=>h.map(v=>v.id===d?{...v,exiting:!0}:v)),setTimeout(()=>{u(h=>h.filter(v=>v.id!==d))},250)},[]),o=w.useCallback(d=>{u(h=>{const v={id:d.id,event:d,exiting:!1},y=[...h,v];if(y.length>bm){const g=y.length-bm;return y.slice(g)}return y})},[]);return M0(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:c.map(d=>a.jsx(C0,{toast:d,onDismiss:f},d.id))})}function D0({agents:c,tasks:u}){const[f,o]=w.useState("weight"),[d,h]=w.useState("desc"),[v,y]=w.useState(""),g=w.useMemo(()=>{const $=new Map;if(u)for(const Q of u.items){const D=$.get(Q.agentId);(!D||Q.timestamp>D.timestamp)&&$.set(Q.agentId,Q)}return $},[u]),x=c.filter(_m).length,_=c.filter($=>$.scores.accuracy>=.5).length,C=c.reduce(($,Q)=>$+Q.scores.signals,0),U=c.reduce(($,Q)=>$+Q.totalTokens,0),V=v.trim().toLowerCase(),F=V?c.filter($=>$.id.toLowerCase().includes(V)||$.provider.toLowerCase().includes(V)||$.model.toLowerCase().includes(V)):c,I=$=>{const Q=$.scores;switch(f){case"weight":return Q.dispatchWeight;case"accuracy":return Q.accuracy;case"uniqueness":return Q.uniqueness;case"impact":return Q.impactScore;case"signals":return Q.signals;case"agreements":return Q.agreements;case"hallucinations":return Q.hallucinations;case"lastTask":{const D=g.get($.id);return D?new Date(D.timestamp).getTime():0}}},X=[...F].sort(($,Q)=>{const D=I($),ae=I(Q);return d==="desc"?ae-D:D-ae}),de=$=>{f===$?h(Q=>Q==="desc"?"asc":"desc"):(o($),h("desc"))},Z=$=>f===$?d==="desc"?"▾":"▴":"";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Team ",a.jsx("span",{className:"ml-2 text-primary",children:c.length})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",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 border-border/40 bg-border/30 sm:grid-cols-4",children:[{label:"Healthy",value:_,color:"text-confirmed"},{label:"Benched",value:x,color:x>0?"text-destructive":"text-muted-foreground"},{label:"Total Signals",value:C.toLocaleString(),color:"text-foreground"},{label:"Tokens Used",value:U.toLocaleString(),color:"text-foreground"}].map($=>a.jsxs("div",{className:"bg-card/80 px-4 py-3",children:[a.jsx("div",{className:`font-mono text-lg font-bold tabular-nums ${$.color}`,children:$.value}),a.jsx("div",{className:"mt-0.5 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/70",children:$.label})]},$.label))})]}),a.jsx("div",{className:"mb-3",children:a.jsx("input",{type:"text",value:v,onChange:$=>y($.target.value),placeholder:"Search agents by id, provider, or model...",className:"w-full max-w-md rounded-md border border-border/40 bg-card/80 px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none"})}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border/40 bg-card/80",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-border/40 bg-muted/20 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/80",children:[a.jsx("th",{className:"py-2.5 pl-5 pr-2 text-center",children:"#"}),a.jsx("th",{className:"py-2.5 pr-3 text-left",children:"Agent"}),a.jsxs("th",{className:"py-2.5 pr-4 text-right cursor-pointer select-none hover:text-foreground",onClick:()=>de("weight"),children:["Weight ",Z("weight")]}),a.jsx("th",{className:"py-2.5 pr-4 text-left align-top",children:a.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[a.jsxs("button",{onClick:()=>de("accuracy"),className:"flex items-center gap-1 hover:text-foreground","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",Z("accuracy")]}),a.jsx("span",{className:"text-muted-foreground/30",children:"·"}),a.jsxs("button",{onClick:()=>de("uniqueness"),className:"flex items-center gap-1 hover:text-foreground","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",Z("uniqueness")]}),a.jsx("span",{className:"text-muted-foreground/30",children:"·"}),a.jsxs("button",{onClick:()=>de("impact"),className:"flex items-center gap-1 hover:text-foreground","data-tooltip":"Impact — severity-weighted finding score",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-[var(--color-impact)]"}),"Imp",Z("impact")]})]})}),a.jsxs("th",{className:"py-2.5 pr-4 text-right cursor-pointer select-none hover:text-foreground",onClick:()=>de("signals"),children:["Signals ",Z("signals")]}),a.jsxs("th",{className:"py-2.5 pr-4 text-right cursor-pointer select-none hover:text-foreground",onClick:()=>de("hallucinations"),"data-tooltip":"Hallucinations — fabricated findings caught by cross-review",children:["Halluc ",Z("hallucinations")]}),a.jsxs("th",{className:"py-2.5 pr-5 text-left cursor-pointer select-none hover:text-foreground",onClick:()=>de("lastTask"),children:["Last Task ",Z("lastTask")]})]})}),a.jsx("tbody",{children:X.map(($,Q)=>{const D=$.scores,ae=g.get($.id),G=D.dispatchWeight>=1.2?"text-confirmed":D.dispatchWeight>=.8?"text-foreground":"text-disputed",te=Q+1;return a.jsxs("tr",{className:"group border-t border-border/20 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 ${te===1?"font-bold text-primary":te===2||te===3?"font-semibold text-foreground/80":"text-muted-foreground/40"}`,children:te})}),a.jsx("td",{className:"py-2.5 pr-3 align-top",children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent($.id)}`,className:"flex items-center gap-3",children:[a.jsx(Ku,{agentId:$.id,size:32,signals:D.signals,accuracy:D.accuracy,uniqueness:D.uniqueness,impact:D.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 text-foreground group-hover:text-primary",children:$.id}),(()=>{const ue=Ju(D);return ue==="benched"?a.jsx("span",{className:"shrink-0 rounded bg-destructive/15 px-1 font-mono text-[8px] font-bold uppercase tracking-wider text-destructive","data-tooltip":`Benched (${D.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"benched"}):ue==="struggling"?a.jsx("span",{className:"shrink-0 rounded bg-unverified/15 px-1 font-mono text-[8px] font-bold uppercase tracking-wider text-unverified","data-tooltip":"Struggling: consecutive failures tripped the circuit breaker. Deprioritized until new clean signals recover the score.",children:"struggling"}):ue==="kept-for-coverage"?a.jsx("span",{className:"shrink-0 rounded border border-unverified/40 px-1 font-mono text-[8px] font-bold uppercase tracking-wider text-unverified","data-tooltip":`Would bench (${D.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] text-muted-foreground/50",children:[$.provider,"/",$.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 ${G}`,children:D.dispatchWeight.toFixed(2)})}),a.jsx("td",{className:"py-3 pr-4 align-top",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(gs,{label:"A",value:D.accuracy,fillClass:D.accuracy>=.7?"bg-confirmed":D.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(gs,{label:"Rel",value:D.taskCompletionRate??0,fillClass:"bg-chart",tooltip:"Reliability — fraction of dispatched tasks that finished without pipeline error or timeout"}),a.jsx(gs,{label:"U",value:D.uniqueness,fillClass:"bg-unique",tooltip:"Uniqueness — findings this agent surfaced that no other agent found"}),a.jsx(gs,{label:"I",value:D.impactScore,fillClass:"bg-[var(--color-impact)]",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 text-foreground",children:D.signals.toLocaleString()}),a.jsx("td",{className:"py-3 pr-4 text-right align-top font-mono text-xs tabular-nums",children:a.jsx("span",{className:D.hallucinations>10?"font-bold text-disputed":D.hallucinations>0?"text-disputed":"text-muted-foreground/40","data-tooltip":`Agreements ${D.agreements} · Disagreements ${D.disagreements} · Hallucinations ${D.hallucinations}`,children:D.hallucinations})}),a.jsx("td",{className:"py-3 pr-5 align-top",children:ae?a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx("span",{className:"shrink-0 rounded border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 font-mono text-[9px] font-semibold text-amber-400",children:ae.taskId.slice(0,8)}),a.jsx("span",{className:"truncate font-inter text-[11px] text-muted-foreground/80",style:{maxWidth:260},children:ae.task}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-muted-foreground/50",children:He(ae.timestamp)})]}):a.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/30",children:"no tasks"})})]},$.id)})})]})})]})}function gs({label:c,value:u,fillClass:f,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 font-mono text-[8px] uppercase text-muted-foreground/50",children:c}),a.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full bg-background/60",children:a.jsx("div",{className:`h-full rounded-full ${f}`,style:{width:`${Math.max(0,Math.min(100,u*100))}%`}})}),a.jsxs("span",{className:"w-8 text-right font-mono text-[10px] tabular-nums text-foreground/80",children:[Math.round(u*100),"%"]})]})}function O0({tasks:c}){const[u,f]=w.useState(""),[o,d]=w.useState(0),[h,v]=w.useState(null),y=100,g=c.items.filter(X=>X.status==="completed").length,x=c.items.filter(X=>X.status==="failed").length,_=c.items.filter(X=>X.status==="running").length,C=u.trim().toLowerCase(),U=C?c.items.filter(X=>{var de,Z,$,Q;return((de=X.task)==null?void 0:de.toLowerCase().includes(C))||((Z=X.agentId)==null?void 0:Z.toLowerCase().includes(C))||(($=X.taskId)==null?void 0:$.toLowerCase().includes(C))||((Q=X.status)==null?void 0:Q.toLowerCase().includes(C))}):c.items,V=Math.max(1,Math.ceil(U.length/y)),F=Math.min(o,V-1),I=U.slice(F*y,(F+1)*y);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Tasks ",a.jsx("span",{className:"ml-2 text-primary",children:c.total})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Live dispatched tasks and their relay status."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px] text-muted-foreground",children:[a.jsxs("span",{children:[a.jsx("span",{className:"text-confirmed",children:g})," completed"]}),x>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-destructive",children:x})," failed"]}),_>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:_})," running"]}),a.jsxs("span",{children:["showing ",I.length," of ",U.length,C&&` (filtered from ${c.items.length})`]})]})]}),a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[a.jsx("input",{type:"text",value:u,onChange:X=>{f(X.target.value),d(0)},placeholder:"Search tasks by description, agent, id, status...",className:"w-full max-w-md rounded-md border border-border/40 bg-card/80 px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none"}),a.jsxs("div",{className:`flex shrink-0 items-center gap-2 font-mono text-[11px] text-muted-foreground ${V<=1?"invisible":""}`,children:[a.jsx("button",{onClick:()=>d(X=>Math.max(0,X-1)),disabled:F===0,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{children:[F+1," / ",V]}),a.jsx("button",{onClick:()=>d(X=>Math.min(V-1,X+1)),disabled:F>=V-1,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border/40 bg-card/80",children:I.length===0?a.jsx("div",{className:"py-12 text-center text-sm text-muted-foreground",children:C?"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-border/40 bg-muted/30",children:[a.jsx("th",{className:"py-2.5 pl-4 pr-2 text-xs font-medium text-muted-foreground",style:{width:32}}),a.jsx("th",{className:"py-2.5 pr-3 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"ID"}),a.jsx("th",{className:"py-2.5 pr-3 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Agent"}),a.jsx("th",{className:"py-2.5 pr-3 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Description"}),a.jsx("th",{className:"py-2.5 pr-3 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Duration"}),a.jsx("th",{className:"py-2.5 pr-4 text-right font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"When"})]})}),a.jsx("tbody",{children:I.map(X=>a.jsx(km,{task:X,onClick:v},X.taskId))})]})}),a.jsx(tp,{task:h,onClose:()=>v(null)})]})}function R0({consensus:c,consensusReports:u}){const[f,o]=w.useState(!1),d=f?c.runs:c.runs.filter(x=>!x.retracted),h=c.runs.filter(x=>x.retracted).length,v=d.reduce((x,_)=>x+(_.counts.agreement||0),0),y=d.reduce((x,_)=>x+((_.counts.disagreement||0)+(_.counts.hallucination||0)),0),g=d.reduce((x,_)=>x+(_.counts.unverified||0),0);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Consensus Rounds ",a.jsx("span",{className:"ml-2 text-primary",children:d.length}),!f&&h>0&&a.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal text-muted-foreground/60",children:["/ ",c.totalRuns??c.runs.length," total"]})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Multi-agent review rounds — findings confirmed when ≥2 agents agree."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px] text-muted-foreground",children:[a.jsxs("span",{children:[a.jsx("span",{className:"text-confirmed",children:v})," confirmed"]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-disputed",children:y})," disputed"]}),g>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:g})," unverified"]}),a.jsxs("span",{children:[c.totalSignals," total signals"]})]}),h>0&&a.jsxs("div",{className:"mt-2 flex items-center gap-2 font-mono text-[11px] text-muted-foreground/70",children:[a.jsx("span",{children:f?`${h} retracted run${h===1?"":"s"} shown`:`${h} retracted run${h===1?"":"s"} hidden`}),a.jsx("button",{type:"button",onClick:()=>o(x=>!x),className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 text-[10px] transition hover:bg-accent/50 hover:text-foreground",children:f?"hide":"show"})]})]}),a.jsx(zm,{consensus:c,filteredRuns:d,reports:u,showAll:!0,hideHeader:!0})]})}function k0(){const c=vm(),u=ym(),{overview:f,agents:o,tasks:d,consensus:h,consensusReports:v,nativeMemories:y,gossipMemories:g,loading:x,refresh:_}=_0(),[C,U]=w.useState(0),V=w.useCallback(Z=>{Z.type!=="log_lines"&&_()},[_]);if(N0(V),x||!f||!h)return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx(rm,{}),a.jsx("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:"Loading dashboard..."})]});let F;const I=c.match(/^\/agent\/(.+)$/);if(I&&o){const Z=decodeURIComponent(I[1]);F=a.jsx(s0,{agentId:Z,agents:o,tasks:d,consensus:h})}else c==="/team"&&o?F=a.jsx(D0,{agents:o,tasks:d}):c==="/tasks"&&d?F=a.jsx(O0,{tasks:d}):c==="/debates"&&h?F=a.jsx(R0,{consensus:h,consensusReports:v}):c==="/logs"?F=a.jsx(o0,{}):c==="/signals"?F=a.jsx(y0,{}):c==="/violations"?F=a.jsx(Ap,{}):c==="/"&&!u||c==="/overview"?F=a.jsx(qg,{overview:f,agents:o,tasks:d,activeTaskCount:C,setActiveTaskCount:U}):F=a.jsxs("div",{className:"space-y-6",children:[a.jsxs("header",{children:[a.jsx("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Dashboard"}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Multi-agent code review with grounded reward signals. Live activity, agent scores, and consensus rounds."})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-[280px_1fr] lg:items-start",children:[a.jsxs("aside",{className:"space-y-4 lg:sticky lg:top-4",children:[a.jsx(Nm,{overview:f,activeTasks:C}),o&&a.jsx(Kg,{agents:o}),a.jsx(_p,{})]}),a.jsxs("main",{className:"min-w-0 space-y-6",children:[a.jsx(Sm,{onCountChange:U}),a.jsx(zm,{consensus:h,reports:v}),d&&a.jsx(Em,{tasks:d,limit:5}),o&&a.jsx(Tm,{agents:o}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[a.jsx(Sp,{}),a.jsx(Mp,{overview:f})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[a.jsx(Am,{}),a.jsx(wp,{overview:f})]}),(g||y)&&a.jsx(vp,{memories:[...g??[],...y??[]],heading:"Memory",statusFilter:!0})]})]})]});const de=c==="/"&&!u||c==="/overview"?"px-6 py-6":"mx-auto max-w-7xl space-y-6 px-6 py-6";return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx(rm,{}),a.jsx("main",{className:de,children:F})]})}function U0(){const{authed:c,login:u,error:f}=j0();return c===null?a.jsx("div",{className:"flex min-h-screen items-center justify-center text-muted-foreground",children:"Loading..."}):c?a.jsxs(a.Fragment,{children:[a.jsx(k0,{}),a.jsx(z0,{})]}):a.jsx(Hg,{onLogin:u,error:f})}mg.createRoot(document.getElementById("root")).render(a.jsx(w.StrictMode,{children:a.jsx(U0,{})}));