@mcp-shark/mcp-shark 1.5.0 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- (function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))p(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const x of f.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&p(x)}).observe(document,{childList:!0,subtree:!0});function u(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function p(d){if(d.ep)return;d.ep=!0;const f=u(d);fetch(d.href,f)}})();function Qc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ts={exports:{}},Or={},ns={exports:{}},he={};var wc;function Pf(){if(wc)return he;wc=1;var r=Symbol.for("react.element"),s=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),x=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),j=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),b=Symbol.iterator;function T(w){return w===null||typeof w!="object"?null:(w=b&&w[b]||w["@@iterator"],typeof w=="function"?w:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,R={};function P(w,N,le){this.props=w,this.context=N,this.refs=R,this.updater=le||_}P.prototype.isReactComponent={},P.prototype.setState=function(w,N){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,N,"setState")},P.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function I(){}I.prototype=P.prototype;function O(w,N,le){this.props=w,this.context=N,this.refs=R,this.updater=le||_}var U=O.prototype=new I;U.constructor=O,z(U,P.prototype),U.isPureReactComponent=!0;var W=Array.isArray,$=Object.prototype.hasOwnProperty,H={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function V(w,N,le){var de,pe={},ye=null,je=null;if(N!=null)for(de in N.ref!==void 0&&(je=N.ref),N.key!==void 0&&(ye=""+N.key),N)$.call(N,de)&&!K.hasOwnProperty(de)&&(pe[de]=N[de]);var ke=arguments.length-2;if(ke===1)pe.children=le;else if(1<ke){for(var Z=Array(ke),fe=0;fe<ke;fe++)Z[fe]=arguments[fe+2];pe.children=Z}if(w&&w.defaultProps)for(de in ke=w.defaultProps,ke)pe[de]===void 0&&(pe[de]=ke[de]);return{$$typeof:r,type:w,key:ye,ref:je,props:pe,_owner:H.current}}function G(w,N){return{$$typeof:r,type:w.type,key:N,ref:w.ref,props:w.props,_owner:w._owner}}function Y(w){return typeof w=="object"&&w!==null&&w.$$typeof===r}function ce(w){var N={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(le){return N[le]})}var Se=/\/+/g;function ve(w,N){return typeof w=="object"&&w!==null&&w.key!=null?ce(""+w.key):N.toString(36)}function Ee(w,N,le,de,pe){var ye=typeof w;(ye==="undefined"||ye==="boolean")&&(w=null);var je=!1;if(w===null)je=!0;else switch(ye){case"string":case"number":je=!0;break;case"object":switch(w.$$typeof){case r:case s:je=!0}}if(je)return je=w,pe=pe(je),w=de===""?"."+ve(je,0):de,W(pe)?(le="",w!=null&&(le=w.replace(Se,"$&/")+"/"),Ee(pe,N,le,"",function(fe){return fe})):pe!=null&&(Y(pe)&&(pe=G(pe,le+(!pe.key||je&&je.key===pe.key?"":(""+pe.key).replace(Se,"$&/")+"/")+w)),N.push(pe)),1;if(je=0,de=de===""?".":de+":",W(w))for(var ke=0;ke<w.length;ke++){ye=w[ke];var Z=de+ve(ye,ke);je+=Ee(ye,N,le,Z,pe)}else if(Z=T(w),typeof Z=="function")for(w=Z.call(w),ke=0;!(ye=w.next()).done;)ye=ye.value,Z=de+ve(ye,ke++),je+=Ee(ye,N,le,Z,pe);else if(ye==="object")throw N=String(w),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.");return je}function Ne(w,N,le){if(w==null)return w;var de=[],pe=0;return Ee(w,de,"","",function(ye){return N.call(le,ye,pe++)}),de}function Re(w){if(w._status===-1){var N=w._result;N=N(),N.then(function(le){(w._status===0||w._status===-1)&&(w._status=1,w._result=le)},function(le){(w._status===0||w._status===-1)&&(w._status=2,w._result=le)}),w._status===-1&&(w._status=0,w._result=N)}if(w._status===1)return w._result.default;throw w._result}var xe={current:null},J={transition:null},ee={ReactCurrentDispatcher:xe,ReactCurrentBatchConfig:J,ReactCurrentOwner:H};function X(){throw Error("act(...) is not supported in production builds of React.")}return he.Children={map:Ne,forEach:function(w,N,le){Ne(w,function(){N.apply(this,arguments)},le)},count:function(w){var N=0;return Ne(w,function(){N++}),N},toArray:function(w){return Ne(w,function(N){return N})||[]},only:function(w){if(!Y(w))throw Error("React.Children.only expected to receive a single React element child.");return w}},he.Component=P,he.Fragment=u,he.Profiler=d,he.PureComponent=O,he.StrictMode=p,he.Suspense=g,he.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,he.act=X,he.cloneElement=function(w,N,le){if(w==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+w+".");var de=z({},w.props),pe=w.key,ye=w.ref,je=w._owner;if(N!=null){if(N.ref!==void 0&&(ye=N.ref,je=H.current),N.key!==void 0&&(pe=""+N.key),w.type&&w.type.defaultProps)var ke=w.type.defaultProps;for(Z in N)$.call(N,Z)&&!K.hasOwnProperty(Z)&&(de[Z]=N[Z]===void 0&&ke!==void 0?ke[Z]:N[Z])}var Z=arguments.length-2;if(Z===1)de.children=le;else if(1<Z){ke=Array(Z);for(var fe=0;fe<Z;fe++)ke[fe]=arguments[fe+2];de.children=ke}return{$$typeof:r,type:w.type,key:pe,ref:ye,props:de,_owner:je}},he.createContext=function(w){return w={$$typeof:x,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},w.Provider={$$typeof:f,_context:w},w.Consumer=w},he.createElement=V,he.createFactory=function(w){var N=V.bind(null,w);return N.type=w,N},he.createRef=function(){return{current:null}},he.forwardRef=function(w){return{$$typeof:y,render:w}},he.isValidElement=Y,he.lazy=function(w){return{$$typeof:S,_payload:{_status:-1,_result:w},_init:Re}},he.memo=function(w,N){return{$$typeof:j,type:w,compare:N===void 0?null:N}},he.startTransition=function(w){var N=J.transition;J.transition={};try{w()}finally{J.transition=N}},he.unstable_act=X,he.useCallback=function(w,N){return xe.current.useCallback(w,N)},he.useContext=function(w){return xe.current.useContext(w)},he.useDebugValue=function(){},he.useDeferredValue=function(w){return xe.current.useDeferredValue(w)},he.useEffect=function(w,N){return xe.current.useEffect(w,N)},he.useId=function(){return xe.current.useId()},he.useImperativeHandle=function(w,N,le){return xe.current.useImperativeHandle(w,N,le)},he.useInsertionEffect=function(w,N){return xe.current.useInsertionEffect(w,N)},he.useLayoutEffect=function(w,N){return xe.current.useLayoutEffect(w,N)},he.useMemo=function(w,N){return xe.current.useMemo(w,N)},he.useReducer=function(w,N,le){return xe.current.useReducer(w,N,le)},he.useRef=function(w){return xe.current.useRef(w)},he.useState=function(w){return xe.current.useState(w)},he.useSyncExternalStore=function(w,N,le){return xe.current.useSyncExternalStore(w,N,le)},he.useTransition=function(){return xe.current.useTransition()},he.version="18.3.1",he}var jc;function cs(){return jc||(jc=1,ns.exports=Pf()),ns.exports}var Cc;function _f(){if(Cc)return Or;Cc=1;var r=cs(),s=Symbol.for("react.element"),u=Symbol.for("react.fragment"),p=Object.prototype.hasOwnProperty,d=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function x(y,g,j){var S,b={},T=null,_=null;j!==void 0&&(T=""+j),g.key!==void 0&&(T=""+g.key),g.ref!==void 0&&(_=g.ref);for(S in g)p.call(g,S)&&!f.hasOwnProperty(S)&&(b[S]=g[S]);if(y&&y.defaultProps)for(S in g=y.defaultProps,g)b[S]===void 0&&(b[S]=g[S]);return{$$typeof:s,type:y,key:T,ref:_,props:b,_owner:d.current}}return Or.Fragment=u,Or.jsx=x,Or.jsxs=x,Or}var Tc;function Lf(){return Tc||(Tc=1,ts.exports=_f()),ts.exports}var l=Lf(),L=cs();const Zo=Qc(L);var Xo={},rs={exports:{}},st={},os={exports:{}},is={};var Pc;function zf(){return Pc||(Pc=1,(function(r){function s(J,ee){var X=J.length;J.push(ee);e:for(;0<X;){var w=X-1>>>1,N=J[w];if(0<d(N,ee))J[w]=ee,J[X]=N,X=w;else break e}}function u(J){return J.length===0?null:J[0]}function p(J){if(J.length===0)return null;var ee=J[0],X=J.pop();if(X!==ee){J[0]=X;e:for(var w=0,N=J.length,le=N>>>1;w<le;){var de=2*(w+1)-1,pe=J[de],ye=de+1,je=J[ye];if(0>d(pe,X))ye<N&&0>d(je,pe)?(J[w]=je,J[ye]=X,w=ye):(J[w]=pe,J[de]=X,w=de);else if(ye<N&&0>d(je,X))J[w]=je,J[ye]=X,w=ye;else break e}}return ee}function d(J,ee){var X=J.sortIndex-ee.sortIndex;return X!==0?X:J.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var x=Date,y=x.now();r.unstable_now=function(){return x.now()-y}}var g=[],j=[],S=1,b=null,T=3,_=!1,z=!1,R=!1,P=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function U(J){for(var ee=u(j);ee!==null;){if(ee.callback===null)p(j);else if(ee.startTime<=J)p(j),ee.sortIndex=ee.expirationTime,s(g,ee);else break;ee=u(j)}}function W(J){if(R=!1,U(J),!z)if(u(g)!==null)z=!0,Re($);else{var ee=u(j);ee!==null&&xe(W,ee.startTime-J)}}function $(J,ee){z=!1,R&&(R=!1,I(V),V=-1),_=!0;var X=T;try{for(U(ee),b=u(g);b!==null&&(!(b.expirationTime>ee)||J&&!ce());){var w=b.callback;if(typeof w=="function"){b.callback=null,T=b.priorityLevel;var N=w(b.expirationTime<=ee);ee=r.unstable_now(),typeof N=="function"?b.callback=N:b===u(g)&&p(g),U(ee)}else p(g);b=u(g)}if(b!==null)var le=!0;else{var de=u(j);de!==null&&xe(W,de.startTime-ee),le=!1}return le}finally{b=null,T=X,_=!1}}var H=!1,K=null,V=-1,G=5,Y=-1;function ce(){return!(r.unstable_now()-Y<G)}function Se(){if(K!==null){var J=r.unstable_now();Y=J;var ee=!0;try{ee=K(!0,J)}finally{ee?ve():(H=!1,K=null)}}else H=!1}var ve;if(typeof O=="function")ve=function(){O(Se)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,Ne=Ee.port2;Ee.port1.onmessage=Se,ve=function(){Ne.postMessage(null)}}else ve=function(){P(Se,0)};function Re(J){K=J,H||(H=!0,ve())}function xe(J,ee){V=P(function(){J(r.unstable_now())},ee)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(J){J.callback=null},r.unstable_continueExecution=function(){z||_||(z=!0,Re($))},r.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<J?Math.floor(1e3/J):5},r.unstable_getCurrentPriorityLevel=function(){return T},r.unstable_getFirstCallbackNode=function(){return u(g)},r.unstable_next=function(J){switch(T){case 1:case 2:case 3:var ee=3;break;default:ee=T}var X=T;T=ee;try{return J()}finally{T=X}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(J,ee){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var X=T;T=J;try{return ee()}finally{T=X}},r.unstable_scheduleCallback=function(J,ee,X){var w=r.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?w+X:w):X=w,J){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=X+N,J={id:S++,callback:ee,priorityLevel:J,startTime:X,expirationTime:N,sortIndex:-1},X>w?(J.sortIndex=X,s(j,J),u(g)===null&&J===u(j)&&(R?(I(V),V=-1):R=!0,xe(W,X-w))):(J.sortIndex=N,s(g,J),z||_||(z=!0,Re($))),J},r.unstable_shouldYield=ce,r.unstable_wrapCallback=function(J){var ee=T;return function(){var X=T;T=ee;try{return J.apply(this,arguments)}finally{T=X}}}})(is)),is}var _c;function Ef(){return _c||(_c=1,os.exports=zf()),os.exports}var Lc;function Rf(){if(Lc)return st;Lc=1;var r=cs(),s=Ef();function u(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var p=new Set,d={};function f(e,t){x(e,t),x(e+"Capture",t)}function x(e,t){for(d[e]=t,e=0;e<t.length;e++)p.add(t[e])}var y=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,j=/^[: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]*$/,S={},b={};function T(e){return g.call(b,e)?!0:g.call(S,e)?!1:j.test(e)?b[e]=!0:(S[e]=!0,!1)}function _(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function z(e,t,n,i){if(t===null||typeof t>"u"||_(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function R(e,t,n,i,a,c,h){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=h}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){P[e]=new R(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];P[t]=new R(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){P[e]=new R(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){P[e]=new R(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){P[e]=new R(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){P[e]=new R(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){P[e]=new R(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){P[e]=new R(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){P[e]=new R(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function O(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(I,O);P[t]=new R(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(I,O);P[t]=new R(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(I,O);P[t]=new R(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){P[e]=new R(e,1,!1,e.toLowerCase(),null,!1,!1)}),P.xlinkHref=new R("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){P[e]=new R(e,1,!1,e.toLowerCase(),null,!0,!0)});function U(e,t,n,i){var a=P.hasOwnProperty(t)?P[t]:null;(a!==null?a.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(z(t,n,a,i)&&(n=null),i||a===null?T(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,i=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,i?e.setAttributeNS(i,t,n):e.setAttribute(t,n))))}var W=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$=Symbol.for("react.element"),H=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),Y=Symbol.for("react.provider"),ce=Symbol.for("react.context"),Se=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),Ee=Symbol.for("react.suspense_list"),Ne=Symbol.for("react.memo"),Re=Symbol.for("react.lazy"),xe=Symbol.for("react.offscreen"),J=Symbol.iterator;function ee(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var X=Object.assign,w;function N(e){if(w===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);w=t&&t[1]||""}return`
1
+ (function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))p(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const x of f.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&p(x)}).observe(document,{childList:!0,subtree:!0});function u(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function p(d){if(d.ep)return;d.ep=!0;const f=u(d);fetch(d.href,f)}})();function Qc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ns={exports:{}},Or={},rs={exports:{}},he={};var wc;function Pf(){if(wc)return he;wc=1;var r=Symbol.for("react.element"),s=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),x=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),j=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),b=Symbol.iterator;function T(w){return w===null||typeof w!="object"?null:(w=b&&w[b]||w["@@iterator"],typeof w=="function"?w:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,R={};function P(w,N,le){this.props=w,this.context=N,this.refs=R,this.updater=le||_}P.prototype.isReactComponent={},P.prototype.setState=function(w,N){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,N,"setState")},P.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function I(){}I.prototype=P.prototype;function O(w,N,le){this.props=w,this.context=N,this.refs=R,this.updater=le||_}var U=O.prototype=new I;U.constructor=O,z(U,P.prototype),U.isPureReactComponent=!0;var W=Array.isArray,$=Object.prototype.hasOwnProperty,H={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function V(w,N,le){var de,pe={},ye=null,je=null;if(N!=null)for(de in N.ref!==void 0&&(je=N.ref),N.key!==void 0&&(ye=""+N.key),N)$.call(N,de)&&!K.hasOwnProperty(de)&&(pe[de]=N[de]);var ke=arguments.length-2;if(ke===1)pe.children=le;else if(1<ke){for(var Z=Array(ke),fe=0;fe<ke;fe++)Z[fe]=arguments[fe+2];pe.children=Z}if(w&&w.defaultProps)for(de in ke=w.defaultProps,ke)pe[de]===void 0&&(pe[de]=ke[de]);return{$$typeof:r,type:w,key:ye,ref:je,props:pe,_owner:H.current}}function G(w,N){return{$$typeof:r,type:w.type,key:N,ref:w.ref,props:w.props,_owner:w._owner}}function Y(w){return typeof w=="object"&&w!==null&&w.$$typeof===r}function ce(w){var N={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(le){return N[le]})}var Se=/\/+/g;function ve(w,N){return typeof w=="object"&&w!==null&&w.key!=null?ce(""+w.key):N.toString(36)}function Ee(w,N,le,de,pe){var ye=typeof w;(ye==="undefined"||ye==="boolean")&&(w=null);var je=!1;if(w===null)je=!0;else switch(ye){case"string":case"number":je=!0;break;case"object":switch(w.$$typeof){case r:case s:je=!0}}if(je)return je=w,pe=pe(je),w=de===""?"."+ve(je,0):de,W(pe)?(le="",w!=null&&(le=w.replace(Se,"$&/")+"/"),Ee(pe,N,le,"",function(fe){return fe})):pe!=null&&(Y(pe)&&(pe=G(pe,le+(!pe.key||je&&je.key===pe.key?"":(""+pe.key).replace(Se,"$&/")+"/")+w)),N.push(pe)),1;if(je=0,de=de===""?".":de+":",W(w))for(var ke=0;ke<w.length;ke++){ye=w[ke];var Z=de+ve(ye,ke);je+=Ee(ye,N,le,Z,pe)}else if(Z=T(w),typeof Z=="function")for(w=Z.call(w),ke=0;!(ye=w.next()).done;)ye=ye.value,Z=de+ve(ye,ke++),je+=Ee(ye,N,le,Z,pe);else if(ye==="object")throw N=String(w),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.");return je}function Ne(w,N,le){if(w==null)return w;var de=[],pe=0;return Ee(w,de,"","",function(ye){return N.call(le,ye,pe++)}),de}function Re(w){if(w._status===-1){var N=w._result;N=N(),N.then(function(le){(w._status===0||w._status===-1)&&(w._status=1,w._result=le)},function(le){(w._status===0||w._status===-1)&&(w._status=2,w._result=le)}),w._status===-1&&(w._status=0,w._result=N)}if(w._status===1)return w._result.default;throw w._result}var xe={current:null},J={transition:null},ee={ReactCurrentDispatcher:xe,ReactCurrentBatchConfig:J,ReactCurrentOwner:H};function X(){throw Error("act(...) is not supported in production builds of React.")}return he.Children={map:Ne,forEach:function(w,N,le){Ne(w,function(){N.apply(this,arguments)},le)},count:function(w){var N=0;return Ne(w,function(){N++}),N},toArray:function(w){return Ne(w,function(N){return N})||[]},only:function(w){if(!Y(w))throw Error("React.Children.only expected to receive a single React element child.");return w}},he.Component=P,he.Fragment=u,he.Profiler=d,he.PureComponent=O,he.StrictMode=p,he.Suspense=g,he.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,he.act=X,he.cloneElement=function(w,N,le){if(w==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+w+".");var de=z({},w.props),pe=w.key,ye=w.ref,je=w._owner;if(N!=null){if(N.ref!==void 0&&(ye=N.ref,je=H.current),N.key!==void 0&&(pe=""+N.key),w.type&&w.type.defaultProps)var ke=w.type.defaultProps;for(Z in N)$.call(N,Z)&&!K.hasOwnProperty(Z)&&(de[Z]=N[Z]===void 0&&ke!==void 0?ke[Z]:N[Z])}var Z=arguments.length-2;if(Z===1)de.children=le;else if(1<Z){ke=Array(Z);for(var fe=0;fe<Z;fe++)ke[fe]=arguments[fe+2];de.children=ke}return{$$typeof:r,type:w.type,key:pe,ref:ye,props:de,_owner:je}},he.createContext=function(w){return w={$$typeof:x,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},w.Provider={$$typeof:f,_context:w},w.Consumer=w},he.createElement=V,he.createFactory=function(w){var N=V.bind(null,w);return N.type=w,N},he.createRef=function(){return{current:null}},he.forwardRef=function(w){return{$$typeof:y,render:w}},he.isValidElement=Y,he.lazy=function(w){return{$$typeof:S,_payload:{_status:-1,_result:w},_init:Re}},he.memo=function(w,N){return{$$typeof:j,type:w,compare:N===void 0?null:N}},he.startTransition=function(w){var N=J.transition;J.transition={};try{w()}finally{J.transition=N}},he.unstable_act=X,he.useCallback=function(w,N){return xe.current.useCallback(w,N)},he.useContext=function(w){return xe.current.useContext(w)},he.useDebugValue=function(){},he.useDeferredValue=function(w){return xe.current.useDeferredValue(w)},he.useEffect=function(w,N){return xe.current.useEffect(w,N)},he.useId=function(){return xe.current.useId()},he.useImperativeHandle=function(w,N,le){return xe.current.useImperativeHandle(w,N,le)},he.useInsertionEffect=function(w,N){return xe.current.useInsertionEffect(w,N)},he.useLayoutEffect=function(w,N){return xe.current.useLayoutEffect(w,N)},he.useMemo=function(w,N){return xe.current.useMemo(w,N)},he.useReducer=function(w,N,le){return xe.current.useReducer(w,N,le)},he.useRef=function(w){return xe.current.useRef(w)},he.useState=function(w){return xe.current.useState(w)},he.useSyncExternalStore=function(w,N,le){return xe.current.useSyncExternalStore(w,N,le)},he.useTransition=function(){return xe.current.useTransition()},he.version="18.3.1",he}var jc;function ds(){return jc||(jc=1,rs.exports=Pf()),rs.exports}var Cc;function _f(){if(Cc)return Or;Cc=1;var r=ds(),s=Symbol.for("react.element"),u=Symbol.for("react.fragment"),p=Object.prototype.hasOwnProperty,d=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function x(y,g,j){var S,b={},T=null,_=null;j!==void 0&&(T=""+j),g.key!==void 0&&(T=""+g.key),g.ref!==void 0&&(_=g.ref);for(S in g)p.call(g,S)&&!f.hasOwnProperty(S)&&(b[S]=g[S]);if(y&&y.defaultProps)for(S in g=y.defaultProps,g)b[S]===void 0&&(b[S]=g[S]);return{$$typeof:s,type:y,key:T,ref:_,props:b,_owner:d.current}}return Or.Fragment=u,Or.jsx=x,Or.jsxs=x,Or}var Tc;function Lf(){return Tc||(Tc=1,ns.exports=_f()),ns.exports}var l=Lf(),L=ds();const Zo=Qc(L);var Xo={},os={exports:{}},st={},is={exports:{}},ls={};var Pc;function zf(){return Pc||(Pc=1,(function(r){function s(J,ee){var X=J.length;J.push(ee);e:for(;0<X;){var w=X-1>>>1,N=J[w];if(0<d(N,ee))J[w]=ee,J[X]=N,X=w;else break e}}function u(J){return J.length===0?null:J[0]}function p(J){if(J.length===0)return null;var ee=J[0],X=J.pop();if(X!==ee){J[0]=X;e:for(var w=0,N=J.length,le=N>>>1;w<le;){var de=2*(w+1)-1,pe=J[de],ye=de+1,je=J[ye];if(0>d(pe,X))ye<N&&0>d(je,pe)?(J[w]=je,J[ye]=X,w=ye):(J[w]=pe,J[de]=X,w=de);else if(ye<N&&0>d(je,X))J[w]=je,J[ye]=X,w=ye;else break e}}return ee}function d(J,ee){var X=J.sortIndex-ee.sortIndex;return X!==0?X:J.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var x=Date,y=x.now();r.unstable_now=function(){return x.now()-y}}var g=[],j=[],S=1,b=null,T=3,_=!1,z=!1,R=!1,P=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function U(J){for(var ee=u(j);ee!==null;){if(ee.callback===null)p(j);else if(ee.startTime<=J)p(j),ee.sortIndex=ee.expirationTime,s(g,ee);else break;ee=u(j)}}function W(J){if(R=!1,U(J),!z)if(u(g)!==null)z=!0,Re($);else{var ee=u(j);ee!==null&&xe(W,ee.startTime-J)}}function $(J,ee){z=!1,R&&(R=!1,I(V),V=-1),_=!0;var X=T;try{for(U(ee),b=u(g);b!==null&&(!(b.expirationTime>ee)||J&&!ce());){var w=b.callback;if(typeof w=="function"){b.callback=null,T=b.priorityLevel;var N=w(b.expirationTime<=ee);ee=r.unstable_now(),typeof N=="function"?b.callback=N:b===u(g)&&p(g),U(ee)}else p(g);b=u(g)}if(b!==null)var le=!0;else{var de=u(j);de!==null&&xe(W,de.startTime-ee),le=!1}return le}finally{b=null,T=X,_=!1}}var H=!1,K=null,V=-1,G=5,Y=-1;function ce(){return!(r.unstable_now()-Y<G)}function Se(){if(K!==null){var J=r.unstable_now();Y=J;var ee=!0;try{ee=K(!0,J)}finally{ee?ve():(H=!1,K=null)}}else H=!1}var ve;if(typeof O=="function")ve=function(){O(Se)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,Ne=Ee.port2;Ee.port1.onmessage=Se,ve=function(){Ne.postMessage(null)}}else ve=function(){P(Se,0)};function Re(J){K=J,H||(H=!0,ve())}function xe(J,ee){V=P(function(){J(r.unstable_now())},ee)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(J){J.callback=null},r.unstable_continueExecution=function(){z||_||(z=!0,Re($))},r.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<J?Math.floor(1e3/J):5},r.unstable_getCurrentPriorityLevel=function(){return T},r.unstable_getFirstCallbackNode=function(){return u(g)},r.unstable_next=function(J){switch(T){case 1:case 2:case 3:var ee=3;break;default:ee=T}var X=T;T=ee;try{return J()}finally{T=X}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(J,ee){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var X=T;T=J;try{return ee()}finally{T=X}},r.unstable_scheduleCallback=function(J,ee,X){var w=r.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?w+X:w):X=w,J){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=X+N,J={id:S++,callback:ee,priorityLevel:J,startTime:X,expirationTime:N,sortIndex:-1},X>w?(J.sortIndex=X,s(j,J),u(g)===null&&J===u(j)&&(R?(I(V),V=-1):R=!0,xe(W,X-w))):(J.sortIndex=N,s(g,J),z||_||(z=!0,Re($))),J},r.unstable_shouldYield=ce,r.unstable_wrapCallback=function(J){var ee=T;return function(){var X=T;T=ee;try{return J.apply(this,arguments)}finally{T=X}}}})(ls)),ls}var _c;function Ef(){return _c||(_c=1,is.exports=zf()),is.exports}var Lc;function Rf(){if(Lc)return st;Lc=1;var r=ds(),s=Ef();function u(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var p=new Set,d={};function f(e,t){x(e,t),x(e+"Capture",t)}function x(e,t){for(d[e]=t,e=0;e<t.length;e++)p.add(t[e])}var y=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,j=/^[: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]*$/,S={},b={};function T(e){return g.call(b,e)?!0:g.call(S,e)?!1:j.test(e)?b[e]=!0:(S[e]=!0,!1)}function _(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function z(e,t,n,i){if(t===null||typeof t>"u"||_(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function R(e,t,n,i,a,c,h){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=h}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){P[e]=new R(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];P[t]=new R(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){P[e]=new R(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){P[e]=new R(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){P[e]=new R(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){P[e]=new R(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){P[e]=new R(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){P[e]=new R(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){P[e]=new R(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function O(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(I,O);P[t]=new R(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(I,O);P[t]=new R(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(I,O);P[t]=new R(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){P[e]=new R(e,1,!1,e.toLowerCase(),null,!1,!1)}),P.xlinkHref=new R("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){P[e]=new R(e,1,!1,e.toLowerCase(),null,!0,!0)});function U(e,t,n,i){var a=P.hasOwnProperty(t)?P[t]:null;(a!==null?a.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(z(t,n,a,i)&&(n=null),i||a===null?T(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,i=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,i?e.setAttributeNS(i,t,n):e.setAttribute(t,n))))}var W=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$=Symbol.for("react.element"),H=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),Y=Symbol.for("react.provider"),ce=Symbol.for("react.context"),Se=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),Ee=Symbol.for("react.suspense_list"),Ne=Symbol.for("react.memo"),Re=Symbol.for("react.lazy"),xe=Symbol.for("react.offscreen"),J=Symbol.iterator;function ee(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var X=Object.assign,w;function N(e){if(w===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);w=t&&t[1]||""}return`
2
2
  `+w+e}var le=!1;function de(e,t){if(!e||le)return"";le=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(F){var i=F}Reflect.construct(e,[],t)}else{try{t.call()}catch(F){i=F}e.call(t.prototype)}else{try{throw Error()}catch(F){i=F}e()}}catch(F){if(F&&i&&typeof F.stack=="string"){for(var a=F.stack.split(`
3
3
  `),c=i.stack.split(`
4
4
  `),h=a.length-1,m=c.length-1;1<=h&&0<=m&&a[h]!==c[m];)m--;for(;1<=h&&0<=m;h--,m--)if(a[h]!==c[m]){if(h!==1||m!==1)do if(h--,m--,0>m||a[h]!==c[m]){var k=`
5
- `+a[h].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),k}while(1<=h&&0<=m);break}}}finally{le=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?N(e):""}function pe(e){switch(e.tag){case 5:return N(e.type);case 16:return N("Lazy");case 13:return N("Suspense");case 19:return N("SuspenseList");case 0:case 2:case 15:return e=de(e.type,!1),e;case 11:return e=de(e.type.render,!1),e;case 1:return e=de(e.type,!0),e;default:return""}}function ye(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case H:return"Portal";case G:return"Profiler";case V:return"StrictMode";case ve:return"Suspense";case Ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ce:return(e.displayName||"Context")+".Consumer";case Y:return(e._context.displayName||"Context")+".Provider";case Se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ne:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case Re:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}function je(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(t);case 8:return t===V?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ke(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Z(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function fe(e){var t=Z(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(h){i=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(h){i=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fe(e){e._valueTracker||(e._valueTracker=fe(e))}function tt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Z(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function jn(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}}function ai(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function zs(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=ke(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Es(e,t){t=t.checked,t!=null&&U(e,"checked",t,!1)}function ui(e,t){Es(e,t);var n=ke(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ci(e,t.type,n):t.hasOwnProperty("defaultValue")&&ci(e,t.type,ke(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rs(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ci(e,t,n){(t!=="number"||jn(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qn=Array.isArray;function Cn(e,t,n,i){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&i&&(e[n].defaultSelected=!0)}else{for(n=""+ke(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,i&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function di(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(u(91));return X({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ms(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(u(92));if(qn(n)){if(1<n.length)throw Error(u(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ke(n)}}function Fs(e,t){var n=ke(t.value),i=ke(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),i!=null&&(e.defaultValue=""+i)}function Is(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function $s(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pi(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?$s(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ar,Ns=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,i,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,i,a)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ar=Ar||document.createElement("div"),Ar.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ar.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function er(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var tr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zd=["Webkit","ms","Moz","O"];Object.keys(tr).forEach(function(e){zd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),tr[t]=tr[e]})});function Os(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||tr.hasOwnProperty(e)&&tr[e]?(""+t).trim():t+"px"}function Bs(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,a=Os(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,a):e[n]=a}}var Ed=X({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fi(e,t){if(t){if(Ed[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(u(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(u(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(u(61))}if(t.style!=null&&typeof t.style!="object")throw Error(u(62))}}function gi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 hi=null;function xi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yi=null,Tn=null,Pn=null;function Ds(e){if(e=wr(e)){if(typeof yi!="function")throw Error(u(280));var t=e.stateNode;t&&(t=po(t),yi(e.stateNode,e.type,t))}}function Ws(e){Tn?Pn?Pn.push(e):Pn=[e]:Tn=e}function As(){if(Tn){var e=Tn,t=Pn;if(Pn=Tn=null,Ds(e),t)for(e=0;e<t.length;e++)Ds(t[e])}}function Hs(e,t){return e(t)}function Us(){}var mi=!1;function Vs(e,t,n){if(mi)return e(t,n);mi=!0;try{return Hs(e,t,n)}finally{mi=!1,(Tn!==null||Pn!==null)&&(Us(),As())}}function nr(e,t){var n=e.stateNode;if(n===null)return null;var i=po(n);if(i===null)return null;n=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var vi=!1;if(y)try{var rr={};Object.defineProperty(rr,"passive",{get:function(){vi=!0}}),window.addEventListener("test",rr,rr),window.removeEventListener("test",rr,rr)}catch{vi=!1}function Rd(e,t,n,i,a,c,h,m,k){var F=Array.prototype.slice.call(arguments,3);try{t.apply(n,F)}catch(D){this.onError(D)}}var or=!1,Hr=null,Ur=!1,Si=null,Md={onError:function(e){or=!0,Hr=e}};function Fd(e,t,n,i,a,c,h,m,k){or=!1,Hr=null,Rd.apply(Md,arguments)}function Id(e,t,n,i,a,c,h,m,k){if(Fd.apply(this,arguments),or){if(or){var F=Hr;or=!1,Hr=null}else throw Error(u(198));Ur||(Ur=!0,Si=F)}}function cn(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 Qs(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 Ys(e){if(cn(e)!==e)throw Error(u(188))}function $d(e){var t=e.alternate;if(!t){if(t=cn(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var c=a.alternate;if(c===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===c.child){for(c=a.child;c;){if(c===n)return Ys(a),e;if(c===i)return Ys(a),t;c=c.sibling}throw Error(u(188))}if(n.return!==i.return)n=a,i=c;else{for(var h=!1,m=a.child;m;){if(m===n){h=!0,n=a,i=c;break}if(m===i){h=!0,i=a,n=c;break}m=m.sibling}if(!h){for(m=c.child;m;){if(m===n){h=!0,n=c,i=a;break}if(m===i){h=!0,i=c,n=a;break}m=m.sibling}if(!h)throw Error(u(189))}}if(n.alternate!==i)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function Js(e){return e=$d(e),e!==null?Ks(e):null}function Ks(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ks(e);if(t!==null)return t;e=e.sibling}return null}var Gs=s.unstable_scheduleCallback,Xs=s.unstable_cancelCallback,Nd=s.unstable_shouldYield,Od=s.unstable_requestPaint,Be=s.unstable_now,Bd=s.unstable_getCurrentPriorityLevel,bi=s.unstable_ImmediatePriority,Zs=s.unstable_UserBlockingPriority,Vr=s.unstable_NormalPriority,Dd=s.unstable_LowPriority,qs=s.unstable_IdlePriority,Qr=null,Tt=null;function Wd(e){if(Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(Qr,e,void 0,(e.current.flags&128)===128)}catch{}}var mt=Math.clz32?Math.clz32:Ud,Ad=Math.log,Hd=Math.LN2;function Ud(e){return e>>>=0,e===0?32:31-(Ad(e)/Hd|0)|0}var Yr=64,Jr=4194304;function ir(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Kr(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,a=e.suspendedLanes,c=e.pingedLanes,h=n&268435455;if(h!==0){var m=h&~a;m!==0?i=ir(m):(c&=h,c!==0&&(i=ir(c)))}else h=n&~a,h!==0?i=ir(h):c!==0&&(i=ir(c));if(i===0)return 0;if(t!==0&&t!==i&&(t&a)===0&&(a=i&-i,c=t&-t,a>=c||a===16&&(c&4194240)!==0))return t;if((i&4)!==0&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)n=31-mt(t),a=1<<n,i|=e[n],t&=~a;return i}function Vd(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qd(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,c=e.pendingLanes;0<c;){var h=31-mt(c),m=1<<h,k=a[h];k===-1?((m&n)===0||(m&i)!==0)&&(a[h]=Vd(m,t)):k<=t&&(e.expiredLanes|=m),c&=~m}}function ki(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ea(){var e=Yr;return Yr<<=1,(Yr&4194240)===0&&(Yr=64),e}function wi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-mt(t),e[t]=n}function Yd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-mt(n),c=1<<a;t[a]=0,i[a]=-1,e[a]=-1,n&=~c}}function ji(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-mt(n),a=1<<i;a&t|e[i]&t&&(e[i]|=t),n&=~a}}var Ce=0;function ta(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var na,Ci,ra,oa,ia,Ti=!1,Gr=[],At=null,Ht=null,Ut=null,sr=new Map,ar=new Map,Vt=[],Jd="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 submit".split(" ");function la(e,t){switch(e){case"focusin":case"focusout":At=null;break;case"dragenter":case"dragleave":Ht=null;break;case"mouseover":case"mouseout":Ut=null;break;case"pointerover":case"pointerout":sr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ar.delete(t.pointerId)}}function ur(e,t,n,i,a,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:c,targetContainers:[a]},t!==null&&(t=wr(t),t!==null&&Ci(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Kd(e,t,n,i,a){switch(t){case"focusin":return At=ur(At,e,t,n,i,a),!0;case"dragenter":return Ht=ur(Ht,e,t,n,i,a),!0;case"mouseover":return Ut=ur(Ut,e,t,n,i,a),!0;case"pointerover":var c=a.pointerId;return sr.set(c,ur(sr.get(c)||null,e,t,n,i,a)),!0;case"gotpointercapture":return c=a.pointerId,ar.set(c,ur(ar.get(c)||null,e,t,n,i,a)),!0}return!1}function sa(e){var t=dn(e.target);if(t!==null){var n=cn(t);if(n!==null){if(t=n.tag,t===13){if(t=Qs(n),t!==null){e.blockedOn=t,ia(e.priority,function(){ra(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 Xr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_i(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);hi=i,n.target.dispatchEvent(i),hi=null}else return t=wr(n),t!==null&&Ci(t),e.blockedOn=n,!1;t.shift()}return!0}function aa(e,t,n){Xr(e)&&n.delete(t)}function Gd(){Ti=!1,At!==null&&Xr(At)&&(At=null),Ht!==null&&Xr(Ht)&&(Ht=null),Ut!==null&&Xr(Ut)&&(Ut=null),sr.forEach(aa),ar.forEach(aa)}function cr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ti||(Ti=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Gd)))}function dr(e){function t(a){return cr(a,e)}if(0<Gr.length){cr(Gr[0],e);for(var n=1;n<Gr.length;n++){var i=Gr[n];i.blockedOn===e&&(i.blockedOn=null)}}for(At!==null&&cr(At,e),Ht!==null&&cr(Ht,e),Ut!==null&&cr(Ut,e),sr.forEach(t),ar.forEach(t),n=0;n<Vt.length;n++)i=Vt[n],i.blockedOn===e&&(i.blockedOn=null);for(;0<Vt.length&&(n=Vt[0],n.blockedOn===null);)sa(n),n.blockedOn===null&&Vt.shift()}var _n=W.ReactCurrentBatchConfig,Zr=!0;function Xd(e,t,n,i){var a=Ce,c=_n.transition;_n.transition=null;try{Ce=1,Pi(e,t,n,i)}finally{Ce=a,_n.transition=c}}function Zd(e,t,n,i){var a=Ce,c=_n.transition;_n.transition=null;try{Ce=4,Pi(e,t,n,i)}finally{Ce=a,_n.transition=c}}function Pi(e,t,n,i){if(Zr){var a=_i(e,t,n,i);if(a===null)Vi(e,t,i,qr,n),la(e,i);else if(Kd(a,e,t,n,i))i.stopPropagation();else if(la(e,i),t&4&&-1<Jd.indexOf(e)){for(;a!==null;){var c=wr(a);if(c!==null&&na(c),c=_i(e,t,n,i),c===null&&Vi(e,t,i,qr,n),c===a)break;a=c}a!==null&&i.stopPropagation()}else Vi(e,t,i,null,n)}}var qr=null;function _i(e,t,n,i){if(qr=null,e=xi(i),e=dn(e),e!==null)if(t=cn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Qs(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 qr=e,null}function ua(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Bd()){case bi:return 1;case Zs:return 4;case Vr:case Dd:return 16;case qs:return 536870912;default:return 16}default:return 16}}var Qt=null,Li=null,eo=null;function ca(){if(eo)return eo;var e,t=Li,n=t.length,i,a="value"in Qt?Qt.value:Qt.textContent,c=a.length;for(e=0;e<n&&t[e]===a[e];e++);var h=n-e;for(i=1;i<=h&&t[n-i]===a[c-i];i++);return eo=a.slice(e,1<i?1-i:void 0)}function to(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 no(){return!0}function da(){return!1}function at(e){function t(n,i,a,c,h){this._reactName=n,this._targetInst=a,this.type=i,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(n=e[m],this[m]=n?n(c):c[m]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?no:da,this.isPropagationStopped=da,this}return X(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=no)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=no)},persist:function(){},isPersistent:no}),t}var Ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zi=at(Ln),pr=X({},Ln,{view:0,detail:0}),qd=at(pr),Ei,Ri,fr,ro=X({},pr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fi,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!==fr&&(fr&&e.type==="mousemove"?(Ei=e.screenX-fr.screenX,Ri=e.screenY-fr.screenY):Ri=Ei=0,fr=e),Ei)},movementY:function(e){return"movementY"in e?e.movementY:Ri}}),pa=at(ro),ep=X({},ro,{dataTransfer:0}),tp=at(ep),np=X({},pr,{relatedTarget:0}),Mi=at(np),rp=X({},Ln,{animationName:0,elapsedTime:0,pseudoElement:0}),op=at(rp),ip=X({},Ln,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lp=at(ip),sp=X({},Ln,{data:0}),fa=at(sp),ap={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},up={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"},cp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cp[e])?!!t[e]:!1}function Fi(){return dp}var pp=X({},pr,{key:function(e){if(e.key){var t=ap[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=to(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?up[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fi,charCode:function(e){return e.type==="keypress"?to(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?to(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fp=at(pp),gp=X({},ro,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ga=at(gp),hp=X({},pr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fi}),xp=at(hp),yp=X({},Ln,{propertyName:0,elapsedTime:0,pseudoElement:0}),mp=at(yp),vp=X({},ro,{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}),Sp=at(vp),bp=[9,13,27,32],Ii=y&&"CompositionEvent"in window,gr=null;y&&"documentMode"in document&&(gr=document.documentMode);var kp=y&&"TextEvent"in window&&!gr,ha=y&&(!Ii||gr&&8<gr&&11>=gr),xa=" ",ya=!1;function ma(e,t){switch(e){case"keyup":return bp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function va(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zn=!1;function wp(e,t){switch(e){case"compositionend":return va(t);case"keypress":return t.which!==32?null:(ya=!0,xa);case"textInput":return e=t.data,e===xa&&ya?null:e;default:return null}}function jp(e,t){if(zn)return e==="compositionend"||!Ii&&ma(e,t)?(e=ca(),eo=Li=Qt=null,zn=!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 ha&&t.locale!=="ko"?null:t.data;default:return null}}var Cp={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 Sa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Cp[e.type]:t==="textarea"}function ba(e,t,n,i){Ws(i),t=ao(t,"onChange"),0<t.length&&(n=new zi("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var hr=null,xr=null;function Tp(e){Ba(e,0)}function oo(e){var t=In(e);if(tt(t))return e}function Pp(e,t){if(e==="change")return t}var ka=!1;if(y){var $i;if(y){var Ni="oninput"in document;if(!Ni){var wa=document.createElement("div");wa.setAttribute("oninput","return;"),Ni=typeof wa.oninput=="function"}$i=Ni}else $i=!1;ka=$i&&(!document.documentMode||9<document.documentMode)}function ja(){hr&&(hr.detachEvent("onpropertychange",Ca),xr=hr=null)}function Ca(e){if(e.propertyName==="value"&&oo(xr)){var t=[];ba(t,xr,e,xi(e)),Vs(Tp,t)}}function _p(e,t,n){e==="focusin"?(ja(),hr=t,xr=n,hr.attachEvent("onpropertychange",Ca)):e==="focusout"&&ja()}function Lp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return oo(xr)}function zp(e,t){if(e==="click")return oo(t)}function Ep(e,t){if(e==="input"||e==="change")return oo(t)}function Rp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vt=typeof Object.is=="function"?Object.is:Rp;function yr(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),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var a=n[i];if(!g.call(t,a)||!vt(e[a],t[a]))return!1}return!0}function Ta(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pa(e,t){var n=Ta(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ta(n)}}function _a(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_a(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function La(){for(var e=window,t=jn();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=jn(e.document)}return t}function Oi(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")}function Mp(e){var t=La(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&_a(n.ownerDocument.documentElement,n)){if(i!==null&&Oi(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,c=Math.min(i.start,a);i=i.end===void 0?c:Math.min(i.end,a),!e.extend&&c>i&&(a=i,i=c,c=a),a=Pa(n,c);var h=Pa(n,i);a&&h&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==h.node||e.focusOffset!==h.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),c>i?(e.addRange(t),e.extend(h.node,h.offset)):(t.setEnd(h.node,h.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Fp=y&&"documentMode"in document&&11>=document.documentMode,En=null,Bi=null,mr=null,Di=!1;function za(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Di||En==null||En!==jn(i)||(i=En,"selectionStart"in i&&Oi(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),mr&&yr(mr,i)||(mr=i,i=ao(Bi,"onSelect"),0<i.length&&(t=new zi("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=En)))}function io(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Rn={animationend:io("Animation","AnimationEnd"),animationiteration:io("Animation","AnimationIteration"),animationstart:io("Animation","AnimationStart"),transitionend:io("Transition","TransitionEnd")},Wi={},Ea={};y&&(Ea=document.createElement("div").style,"AnimationEvent"in window||(delete Rn.animationend.animation,delete Rn.animationiteration.animation,delete Rn.animationstart.animation),"TransitionEvent"in window||delete Rn.transitionend.transition);function lo(e){if(Wi[e])return Wi[e];if(!Rn[e])return e;var t=Rn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ea)return Wi[e]=t[n];return e}var Ra=lo("animationend"),Ma=lo("animationiteration"),Fa=lo("animationstart"),Ia=lo("transitionend"),$a=new Map,Na="abort auxClick 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(" ");function Yt(e,t){$a.set(e,t),f(t,[e])}for(var Ai=0;Ai<Na.length;Ai++){var Hi=Na[Ai],Ip=Hi.toLowerCase(),$p=Hi[0].toUpperCase()+Hi.slice(1);Yt(Ip,"on"+$p)}Yt(Ra,"onAnimationEnd"),Yt(Ma,"onAnimationIteration"),Yt(Fa,"onAnimationStart"),Yt("dblclick","onDoubleClick"),Yt("focusin","onFocus"),Yt("focusout","onBlur"),Yt(Ia,"onTransitionEnd"),x("onMouseEnter",["mouseout","mouseover"]),x("onMouseLeave",["mouseout","mouseover"]),x("onPointerEnter",["pointerout","pointerover"]),x("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vr="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(" "),Np=new Set("cancel close invalid load scroll toggle".split(" ").concat(vr));function Oa(e,t,n){var i=e.type||"unknown-event";e.currentTarget=n,Id(i,t,void 0,e),e.currentTarget=null}function Ba(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],a=i.event;i=i.listeners;e:{var c=void 0;if(t)for(var h=i.length-1;0<=h;h--){var m=i[h],k=m.instance,F=m.currentTarget;if(m=m.listener,k!==c&&a.isPropagationStopped())break e;Oa(a,m,F),c=k}else for(h=0;h<i.length;h++){if(m=i[h],k=m.instance,F=m.currentTarget,m=m.listener,k!==c&&a.isPropagationStopped())break e;Oa(a,m,F),c=k}}}if(Ur)throw e=Si,Ur=!1,Si=null,e}function Le(e,t){var n=t[Xi];n===void 0&&(n=t[Xi]=new Set);var i=e+"__bubble";n.has(i)||(Da(t,e,2,!1),n.add(i))}function Ui(e,t,n){var i=0;t&&(i|=4),Da(n,e,i,t)}var so="_reactListening"+Math.random().toString(36).slice(2);function Sr(e){if(!e[so]){e[so]=!0,p.forEach(function(n){n!=="selectionchange"&&(Np.has(n)||Ui(n,!1,e),Ui(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[so]||(t[so]=!0,Ui("selectionchange",!1,t))}}function Da(e,t,n,i){switch(ua(t)){case 1:var a=Xd;break;case 4:a=Zd;break;default:a=Pi}n=a.bind(null,t,n,e),a=void 0,!vi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),i?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Vi(e,t,n,i,a){var c=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var h=i.tag;if(h===3||h===4){var m=i.stateNode.containerInfo;if(m===a||m.nodeType===8&&m.parentNode===a)break;if(h===4)for(h=i.return;h!==null;){var k=h.tag;if((k===3||k===4)&&(k=h.stateNode.containerInfo,k===a||k.nodeType===8&&k.parentNode===a))return;h=h.return}for(;m!==null;){if(h=dn(m),h===null)return;if(k=h.tag,k===5||k===6){i=c=h;continue e}m=m.parentNode}}i=i.return}Vs(function(){var F=c,D=xi(n),A=[];e:{var B=$a.get(e);if(B!==void 0){var q=zi,ne=e;switch(e){case"keypress":if(to(n)===0)break e;case"keydown":case"keyup":q=fp;break;case"focusin":ne="focus",q=Mi;break;case"focusout":ne="blur",q=Mi;break;case"beforeblur":case"afterblur":q=Mi;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":q=pa;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=tp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=xp;break;case Ra:case Ma:case Fa:q=op;break;case Ia:q=mp;break;case"scroll":q=qd;break;case"wheel":q=Sp;break;case"copy":case"cut":case"paste":q=lp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=ga}var re=(t&4)!==0,De=!re&&e==="scroll",E=re?B!==null?B+"Capture":null:B;re=[];for(var C=F,M;C!==null;){M=C;var Q=M.stateNode;if(M.tag===5&&Q!==null&&(M=Q,E!==null&&(Q=nr(C,E),Q!=null&&re.push(br(C,Q,M)))),De)break;C=C.return}0<re.length&&(B=new q(B,ne,null,n,D),A.push({event:B,listeners:re}))}}if((t&7)===0){e:{if(B=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",B&&n!==hi&&(ne=n.relatedTarget||n.fromElement)&&(dn(ne)||ne[Mt]))break e;if((q||B)&&(B=D.window===D?D:(B=D.ownerDocument)?B.defaultView||B.parentWindow:window,q?(ne=n.relatedTarget||n.toElement,q=F,ne=ne?dn(ne):null,ne!==null&&(De=cn(ne),ne!==De||ne.tag!==5&&ne.tag!==6)&&(ne=null)):(q=null,ne=F),q!==ne)){if(re=pa,Q="onMouseLeave",E="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(re=ga,Q="onPointerLeave",E="onPointerEnter",C="pointer"),De=q==null?B:In(q),M=ne==null?B:In(ne),B=new re(Q,C+"leave",q,n,D),B.target=De,B.relatedTarget=M,Q=null,dn(D)===F&&(re=new re(E,C+"enter",ne,n,D),re.target=M,re.relatedTarget=De,Q=re),De=Q,q&&ne)t:{for(re=q,E=ne,C=0,M=re;M;M=Mn(M))C++;for(M=0,Q=E;Q;Q=Mn(Q))M++;for(;0<C-M;)re=Mn(re),C--;for(;0<M-C;)E=Mn(E),M--;for(;C--;){if(re===E||E!==null&&re===E.alternate)break t;re=Mn(re),E=Mn(E)}re=null}else re=null;q!==null&&Wa(A,B,q,re,!1),ne!==null&&De!==null&&Wa(A,De,ne,re,!0)}}e:{if(B=F?In(F):window,q=B.nodeName&&B.nodeName.toLowerCase(),q==="select"||q==="input"&&B.type==="file")var oe=Pp;else if(Sa(B))if(ka)oe=Ep;else{oe=Lp;var se=_p}else(q=B.nodeName)&&q.toLowerCase()==="input"&&(B.type==="checkbox"||B.type==="radio")&&(oe=zp);if(oe&&(oe=oe(e,F))){ba(A,oe,n,D);break e}se&&se(e,B,F),e==="focusout"&&(se=B._wrapperState)&&se.controlled&&B.type==="number"&&ci(B,"number",B.value)}switch(se=F?In(F):window,e){case"focusin":(Sa(se)||se.contentEditable==="true")&&(En=se,Bi=F,mr=null);break;case"focusout":mr=Bi=En=null;break;case"mousedown":Di=!0;break;case"contextmenu":case"mouseup":case"dragend":Di=!1,za(A,n,D);break;case"selectionchange":if(Fp)break;case"keydown":case"keyup":za(A,n,D)}var ae;if(Ii)e:{switch(e){case"compositionstart":var ue="onCompositionStart";break e;case"compositionend":ue="onCompositionEnd";break e;case"compositionupdate":ue="onCompositionUpdate";break e}ue=void 0}else zn?ma(e,n)&&(ue="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ue="onCompositionStart");ue&&(ha&&n.locale!=="ko"&&(zn||ue!=="onCompositionStart"?ue==="onCompositionEnd"&&zn&&(ae=ca()):(Qt=D,Li="value"in Qt?Qt.value:Qt.textContent,zn=!0)),se=ao(F,ue),0<se.length&&(ue=new fa(ue,e,null,n,D),A.push({event:ue,listeners:se}),ae?ue.data=ae:(ae=va(n),ae!==null&&(ue.data=ae)))),(ae=kp?wp(e,n):jp(e,n))&&(F=ao(F,"onBeforeInput"),0<F.length&&(D=new fa("onBeforeInput","beforeinput",null,n,D),A.push({event:D,listeners:F}),D.data=ae))}Ba(A,t)})}function br(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ao(e,t){for(var n=t+"Capture",i=[];e!==null;){var a=e,c=a.stateNode;a.tag===5&&c!==null&&(a=c,c=nr(e,n),c!=null&&i.unshift(br(e,c,a)),c=nr(e,t),c!=null&&i.push(br(e,c,a))),e=e.return}return i}function Mn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Wa(e,t,n,i,a){for(var c=t._reactName,h=[];n!==null&&n!==i;){var m=n,k=m.alternate,F=m.stateNode;if(k!==null&&k===i)break;m.tag===5&&F!==null&&(m=F,a?(k=nr(n,c),k!=null&&h.unshift(br(n,k,m))):a||(k=nr(n,c),k!=null&&h.push(br(n,k,m)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Op=/\r\n?/g,Bp=/\u0000|\uFFFD/g;function Aa(e){return(typeof e=="string"?e:""+e).replace(Op,`
6
- `).replace(Bp,"")}function uo(e,t,n){if(t=Aa(t),Aa(e)!==t&&n)throw Error(u(425))}function co(){}var Qi=null,Yi=null;function Ji(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ki=typeof setTimeout=="function"?setTimeout:void 0,Dp=typeof clearTimeout=="function"?clearTimeout:void 0,Ha=typeof Promise=="function"?Promise:void 0,Wp=typeof queueMicrotask=="function"?queueMicrotask:typeof Ha<"u"?function(e){return Ha.resolve(null).then(e).catch(Ap)}:Ki;function Ap(e){setTimeout(function(){throw e})}function Gi(e,t){var n=t,i=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(i===0){e.removeChild(a),dr(t);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=a}while(n);dr(t)}function Jt(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==="$?")break;if(t==="/$")return null}}return e}function Ua(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Fn=Math.random().toString(36).slice(2),Pt="__reactFiber$"+Fn,kr="__reactProps$"+Fn,Mt="__reactContainer$"+Fn,Xi="__reactEvents$"+Fn,Hp="__reactListeners$"+Fn,Up="__reactHandles$"+Fn;function dn(e){var t=e[Pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Mt]||n[Pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ua(e);e!==null;){if(n=e[Pt])return n;e=Ua(e)}return t}e=n,n=e.parentNode}return null}function wr(e){return e=e[Pt]||e[Mt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function In(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(u(33))}function po(e){return e[kr]||null}var Zi=[],$n=-1;function Kt(e){return{current:e}}function ze(e){0>$n||(e.current=Zi[$n],Zi[$n]=null,$n--)}function _e(e,t){$n++,Zi[$n]=e.current,e.current=t}var Gt={},Ke=Kt(Gt),nt=Kt(!1),pn=Gt;function Nn(e,t){var n=e.type.contextTypes;if(!n)return Gt;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var a={},c;for(c in n)a[c]=t[c];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function rt(e){return e=e.childContextTypes,e!=null}function fo(){ze(nt),ze(Ke)}function Va(e,t,n){if(Ke.current!==Gt)throw Error(u(168));_e(Ke,t),_e(nt,n)}function Qa(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var a in i)if(!(a in t))throw Error(u(108,je(e)||"Unknown",a));return X({},n,i)}function go(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gt,pn=Ke.current,_e(Ke,e),_e(nt,nt.current),!0}function Ya(e,t,n){var i=e.stateNode;if(!i)throw Error(u(169));n?(e=Qa(e,t,pn),i.__reactInternalMemoizedMergedChildContext=e,ze(nt),ze(Ke),_e(Ke,e)):ze(nt),_e(nt,n)}var Ft=null,ho=!1,qi=!1;function Ja(e){Ft===null?Ft=[e]:Ft.push(e)}function Vp(e){ho=!0,Ja(e)}function Xt(){if(!qi&&Ft!==null){qi=!0;var e=0,t=Ce;try{var n=Ft;for(Ce=1;e<n.length;e++){var i=n[e];do i=i(!0);while(i!==null)}Ft=null,ho=!1}catch(a){throw Ft!==null&&(Ft=Ft.slice(e+1)),Gs(bi,Xt),a}finally{Ce=t,qi=!1}}return null}var On=[],Bn=0,xo=null,yo=0,pt=[],ft=0,fn=null,It=1,$t="";function gn(e,t){On[Bn++]=yo,On[Bn++]=xo,xo=e,yo=t}function Ka(e,t,n){pt[ft++]=It,pt[ft++]=$t,pt[ft++]=fn,fn=e;var i=It;e=$t;var a=32-mt(i)-1;i&=~(1<<a),n+=1;var c=32-mt(t)+a;if(30<c){var h=a-a%5;c=(i&(1<<h)-1).toString(32),i>>=h,a-=h,It=1<<32-mt(t)+a|n<<a|i,$t=c+e}else It=1<<c|n<<a|i,$t=e}function el(e){e.return!==null&&(gn(e,1),Ka(e,1,0))}function tl(e){for(;e===xo;)xo=On[--Bn],On[Bn]=null,yo=On[--Bn],On[Bn]=null;for(;e===fn;)fn=pt[--ft],pt[ft]=null,$t=pt[--ft],pt[ft]=null,It=pt[--ft],pt[ft]=null}var ut=null,ct=null,Me=!1,St=null;function Ga(e,t){var n=yt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Xa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ut=e,ct=Jt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ut=e,ct=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=fn!==null?{id:It,overflow:$t}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=yt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ut=e,ct=null,!0):!1;default:return!1}}function nl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function rl(e){if(Me){var t=ct;if(t){var n=t;if(!Xa(e,t)){if(nl(e))throw Error(u(418));t=Jt(n.nextSibling);var i=ut;t&&Xa(e,t)?Ga(i,n):(e.flags=e.flags&-4097|2,Me=!1,ut=e)}}else{if(nl(e))throw Error(u(418));e.flags=e.flags&-4097|2,Me=!1,ut=e}}}function Za(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ut=e}function mo(e){if(e!==ut)return!1;if(!Me)return Za(e),Me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ji(e.type,e.memoizedProps)),t&&(t=ct)){if(nl(e))throw qa(),Error(u(418));for(;t;)Ga(e,t),t=Jt(t.nextSibling)}if(Za(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ct=Jt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ct=null}}else ct=ut?Jt(e.stateNode.nextSibling):null;return!0}function qa(){for(var e=ct;e;)e=Jt(e.nextSibling)}function Dn(){ct=ut=null,Me=!1}function ol(e){St===null?St=[e]:St.push(e)}var Qp=W.ReactCurrentBatchConfig;function jr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(u(309));var i=n.stateNode}if(!i)throw Error(u(147,e));var a=i,c=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===c?t.ref:(t=function(h){var m=a.refs;h===null?delete m[c]:m[c]=h},t._stringRef=c,t)}if(typeof e!="string")throw Error(u(284));if(!n._owner)throw Error(u(290,e))}return e}function vo(e,t){throw e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function eu(e){var t=e._init;return t(e._payload)}function tu(e){function t(E,C){if(e){var M=E.deletions;M===null?(E.deletions=[C],E.flags|=16):M.push(C)}}function n(E,C){if(!e)return null;for(;C!==null;)t(E,C),C=C.sibling;return null}function i(E,C){for(E=new Map;C!==null;)C.key!==null?E.set(C.key,C):E.set(C.index,C),C=C.sibling;return E}function a(E,C){return E=ln(E,C),E.index=0,E.sibling=null,E}function c(E,C,M){return E.index=M,e?(M=E.alternate,M!==null?(M=M.index,M<C?(E.flags|=2,C):M):(E.flags|=2,C)):(E.flags|=1048576,C)}function h(E){return e&&E.alternate===null&&(E.flags|=2),E}function m(E,C,M,Q){return C===null||C.tag!==6?(C=Kl(M,E.mode,Q),C.return=E,C):(C=a(C,M),C.return=E,C)}function k(E,C,M,Q){var oe=M.type;return oe===K?D(E,C,M.props.children,Q,M.key):C!==null&&(C.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===Re&&eu(oe)===C.type)?(Q=a(C,M.props),Q.ref=jr(E,C,M),Q.return=E,Q):(Q=Ho(M.type,M.key,M.props,null,E.mode,Q),Q.ref=jr(E,C,M),Q.return=E,Q)}function F(E,C,M,Q){return C===null||C.tag!==4||C.stateNode.containerInfo!==M.containerInfo||C.stateNode.implementation!==M.implementation?(C=Gl(M,E.mode,Q),C.return=E,C):(C=a(C,M.children||[]),C.return=E,C)}function D(E,C,M,Q,oe){return C===null||C.tag!==7?(C=kn(M,E.mode,Q,oe),C.return=E,C):(C=a(C,M),C.return=E,C)}function A(E,C,M){if(typeof C=="string"&&C!==""||typeof C=="number")return C=Kl(""+C,E.mode,M),C.return=E,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case $:return M=Ho(C.type,C.key,C.props,null,E.mode,M),M.ref=jr(E,null,C),M.return=E,M;case H:return C=Gl(C,E.mode,M),C.return=E,C;case Re:var Q=C._init;return A(E,Q(C._payload),M)}if(qn(C)||ee(C))return C=kn(C,E.mode,M,null),C.return=E,C;vo(E,C)}return null}function B(E,C,M,Q){var oe=C!==null?C.key:null;if(typeof M=="string"&&M!==""||typeof M=="number")return oe!==null?null:m(E,C,""+M,Q);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case $:return M.key===oe?k(E,C,M,Q):null;case H:return M.key===oe?F(E,C,M,Q):null;case Re:return oe=M._init,B(E,C,oe(M._payload),Q)}if(qn(M)||ee(M))return oe!==null?null:D(E,C,M,Q,null);vo(E,M)}return null}function q(E,C,M,Q,oe){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return E=E.get(M)||null,m(C,E,""+Q,oe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case $:return E=E.get(Q.key===null?M:Q.key)||null,k(C,E,Q,oe);case H:return E=E.get(Q.key===null?M:Q.key)||null,F(C,E,Q,oe);case Re:var se=Q._init;return q(E,C,M,se(Q._payload),oe)}if(qn(Q)||ee(Q))return E=E.get(M)||null,D(C,E,Q,oe,null);vo(C,Q)}return null}function ne(E,C,M,Q){for(var oe=null,se=null,ae=C,ue=C=0,Qe=null;ae!==null&&ue<M.length;ue++){ae.index>ue?(Qe=ae,ae=null):Qe=ae.sibling;var we=B(E,ae,M[ue],Q);if(we===null){ae===null&&(ae=Qe);break}e&&ae&&we.alternate===null&&t(E,ae),C=c(we,C,ue),se===null?oe=we:se.sibling=we,se=we,ae=Qe}if(ue===M.length)return n(E,ae),Me&&gn(E,ue),oe;if(ae===null){for(;ue<M.length;ue++)ae=A(E,M[ue],Q),ae!==null&&(C=c(ae,C,ue),se===null?oe=ae:se.sibling=ae,se=ae);return Me&&gn(E,ue),oe}for(ae=i(E,ae);ue<M.length;ue++)Qe=q(ae,E,ue,M[ue],Q),Qe!==null&&(e&&Qe.alternate!==null&&ae.delete(Qe.key===null?ue:Qe.key),C=c(Qe,C,ue),se===null?oe=Qe:se.sibling=Qe,se=Qe);return e&&ae.forEach(function(sn){return t(E,sn)}),Me&&gn(E,ue),oe}function re(E,C,M,Q){var oe=ee(M);if(typeof oe!="function")throw Error(u(150));if(M=oe.call(M),M==null)throw Error(u(151));for(var se=oe=null,ae=C,ue=C=0,Qe=null,we=M.next();ae!==null&&!we.done;ue++,we=M.next()){ae.index>ue?(Qe=ae,ae=null):Qe=ae.sibling;var sn=B(E,ae,we.value,Q);if(sn===null){ae===null&&(ae=Qe);break}e&&ae&&sn.alternate===null&&t(E,ae),C=c(sn,C,ue),se===null?oe=sn:se.sibling=sn,se=sn,ae=Qe}if(we.done)return n(E,ae),Me&&gn(E,ue),oe;if(ae===null){for(;!we.done;ue++,we=M.next())we=A(E,we.value,Q),we!==null&&(C=c(we,C,ue),se===null?oe=we:se.sibling=we,se=we);return Me&&gn(E,ue),oe}for(ae=i(E,ae);!we.done;ue++,we=M.next())we=q(ae,E,ue,we.value,Q),we!==null&&(e&&we.alternate!==null&&ae.delete(we.key===null?ue:we.key),C=c(we,C,ue),se===null?oe=we:se.sibling=we,se=we);return e&&ae.forEach(function(Tf){return t(E,Tf)}),Me&&gn(E,ue),oe}function De(E,C,M,Q){if(typeof M=="object"&&M!==null&&M.type===K&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case $:e:{for(var oe=M.key,se=C;se!==null;){if(se.key===oe){if(oe=M.type,oe===K){if(se.tag===7){n(E,se.sibling),C=a(se,M.props.children),C.return=E,E=C;break e}}else if(se.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===Re&&eu(oe)===se.type){n(E,se.sibling),C=a(se,M.props),C.ref=jr(E,se,M),C.return=E,E=C;break e}n(E,se);break}else t(E,se);se=se.sibling}M.type===K?(C=kn(M.props.children,E.mode,Q,M.key),C.return=E,E=C):(Q=Ho(M.type,M.key,M.props,null,E.mode,Q),Q.ref=jr(E,C,M),Q.return=E,E=Q)}return h(E);case H:e:{for(se=M.key;C!==null;){if(C.key===se)if(C.tag===4&&C.stateNode.containerInfo===M.containerInfo&&C.stateNode.implementation===M.implementation){n(E,C.sibling),C=a(C,M.children||[]),C.return=E,E=C;break e}else{n(E,C);break}else t(E,C);C=C.sibling}C=Gl(M,E.mode,Q),C.return=E,E=C}return h(E);case Re:return se=M._init,De(E,C,se(M._payload),Q)}if(qn(M))return ne(E,C,M,Q);if(ee(M))return re(E,C,M,Q);vo(E,M)}return typeof M=="string"&&M!==""||typeof M=="number"?(M=""+M,C!==null&&C.tag===6?(n(E,C.sibling),C=a(C,M),C.return=E,E=C):(n(E,C),C=Kl(M,E.mode,Q),C.return=E,E=C),h(E)):n(E,C)}return De}var Wn=tu(!0),nu=tu(!1),So=Kt(null),bo=null,An=null,il=null;function ll(){il=An=bo=null}function sl(e){var t=So.current;ze(So),e._currentValue=t}function al(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function Hn(e,t){bo=e,il=An=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ot=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(il!==e)if(e={context:e,memoizedValue:t,next:null},An===null){if(bo===null)throw Error(u(308));An=e,bo.dependencies={lanes:0,firstContext:e}}else An=An.next=e;return t}var hn=null;function ul(e){hn===null?hn=[e]:hn.push(e)}function ru(e,t,n,i){var a=t.interleaved;return a===null?(n.next=n,ul(t)):(n.next=a.next,a.next=n),t.interleaved=n,Nt(e,i)}function Nt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Zt=!1;function cl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ou(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ot(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qt(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(be&2)!==0){var a=i.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),i.pending=t,Nt(e,n)}return a=i.interleaved,a===null?(t.next=t,ul(i)):(t.next=a.next,a.next=t),i.interleaved=t,Nt(e,n)}function ko(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,ji(e,n)}}function iu(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var a=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var h={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};c===null?a=c=h:c=c.next=h,n=n.next}while(n!==null);c===null?a=c=t:c=c.next=t}else a=c=t;n={baseState:i.baseState,firstBaseUpdate:a,lastBaseUpdate:c,shared:i.shared,effects:i.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function wo(e,t,n,i){var a=e.updateQueue;Zt=!1;var c=a.firstBaseUpdate,h=a.lastBaseUpdate,m=a.shared.pending;if(m!==null){a.shared.pending=null;var k=m,F=k.next;k.next=null,h===null?c=F:h.next=F,h=k;var D=e.alternate;D!==null&&(D=D.updateQueue,m=D.lastBaseUpdate,m!==h&&(m===null?D.firstBaseUpdate=F:m.next=F,D.lastBaseUpdate=k))}if(c!==null){var A=a.baseState;h=0,D=F=k=null,m=c;do{var B=m.lane,q=m.eventTime;if((i&B)===B){D!==null&&(D=D.next={eventTime:q,lane:0,tag:m.tag,payload:m.payload,callback:m.callback,next:null});e:{var ne=e,re=m;switch(B=t,q=n,re.tag){case 1:if(ne=re.payload,typeof ne=="function"){A=ne.call(q,A,B);break e}A=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=re.payload,B=typeof ne=="function"?ne.call(q,A,B):ne,B==null)break e;A=X({},A,B);break e;case 2:Zt=!0}}m.callback!==null&&m.lane!==0&&(e.flags|=64,B=a.effects,B===null?a.effects=[m]:B.push(m))}else q={eventTime:q,lane:B,tag:m.tag,payload:m.payload,callback:m.callback,next:null},D===null?(F=D=q,k=A):D=D.next=q,h|=B;if(m=m.next,m===null){if(m=a.shared.pending,m===null)break;B=m,m=B.next,B.next=null,a.lastBaseUpdate=B,a.shared.pending=null}}while(!0);if(D===null&&(k=A),a.baseState=k,a.firstBaseUpdate=F,a.lastBaseUpdate=D,t=a.shared.interleaved,t!==null){a=t;do h|=a.lane,a=a.next;while(a!==t)}else c===null&&(a.shared.lanes=0);mn|=h,e.lanes=h,e.memoizedState=A}}function lu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!="function")throw Error(u(191,a));a.call(i)}}}var Cr={},_t=Kt(Cr),Tr=Kt(Cr),Pr=Kt(Cr);function xn(e){if(e===Cr)throw Error(u(174));return e}function dl(e,t){switch(_e(Pr,t),_e(Tr,e),_e(_t,Cr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=pi(t,e)}ze(_t),_e(_t,t)}function Un(){ze(_t),ze(Tr),ze(Pr)}function su(e){xn(Pr.current);var t=xn(_t.current),n=pi(t,e.type);t!==n&&(_e(Tr,e),_e(_t,n))}function pl(e){Tr.current===e&&(ze(_t),ze(Tr))}var Ie=Kt(0);function jo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 fl=[];function gl(){for(var e=0;e<fl.length;e++)fl[e]._workInProgressVersionPrimary=null;fl.length=0}var Co=W.ReactCurrentDispatcher,hl=W.ReactCurrentBatchConfig,yn=0,$e=null,Ae=null,Ue=null,To=!1,_r=!1,Lr=0,Yp=0;function Ge(){throw Error(u(321))}function xl(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 yl(e,t,n,i,a,c){if(yn=c,$e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Co.current=e===null||e.memoizedState===null?Xp:Zp,e=n(i,a),_r){c=0;do{if(_r=!1,Lr=0,25<=c)throw Error(u(301));c+=1,Ue=Ae=null,t.updateQueue=null,Co.current=qp,e=n(i,a)}while(_r)}if(Co.current=Lo,t=Ae!==null&&Ae.next!==null,yn=0,Ue=Ae=$e=null,To=!1,t)throw Error(u(300));return e}function ml(){var e=Lr!==0;return Lr=0,e}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ue===null?$e.memoizedState=Ue=e:Ue=Ue.next=e,Ue}function ht(){if(Ae===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=Ae.next;var t=Ue===null?$e.memoizedState:Ue.next;if(t!==null)Ue=t,Ae=e;else{if(e===null)throw Error(u(310));Ae=e,e={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},Ue===null?$e.memoizedState=Ue=e:Ue=Ue.next=e}return Ue}function zr(e,t){return typeof t=="function"?t(e):t}function vl(e){var t=ht(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var i=Ae,a=i.baseQueue,c=n.pending;if(c!==null){if(a!==null){var h=a.next;a.next=c.next,c.next=h}i.baseQueue=a=c,n.pending=null}if(a!==null){c=a.next,i=i.baseState;var m=h=null,k=null,F=c;do{var D=F.lane;if((yn&D)===D)k!==null&&(k=k.next={lane:0,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),i=F.hasEagerState?F.eagerState:e(i,F.action);else{var A={lane:D,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null};k===null?(m=k=A,h=i):k=k.next=A,$e.lanes|=D,mn|=D}F=F.next}while(F!==null&&F!==c);k===null?h=i:k.next=m,vt(i,t.memoizedState)||(ot=!0),t.memoizedState=i,t.baseState=h,t.baseQueue=k,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do c=a.lane,$e.lanes|=c,mn|=c,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Sl(e){var t=ht(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,c=t.memoizedState;if(a!==null){n.pending=null;var h=a=a.next;do c=e(c,h.action),h=h.next;while(h!==a);vt(c,t.memoizedState)||(ot=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,i]}function au(){}function uu(e,t){var n=$e,i=ht(),a=t(),c=!vt(i.memoizedState,a);if(c&&(i.memoizedState=a,ot=!0),i=i.queue,bl(pu.bind(null,n,i,e),[e]),i.getSnapshot!==t||c||Ue!==null&&Ue.memoizedState.tag&1){if(n.flags|=2048,Er(9,du.bind(null,n,i,a,t),void 0,null),Ve===null)throw Error(u(349));(yn&30)!==0||cu(n,t,a)}return a}function cu(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$e.updateQueue,t===null?(t={lastEffect:null,stores:null},$e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function du(e,t,n,i){t.value=n,t.getSnapshot=i,fu(t)&&gu(e)}function pu(e,t,n){return n(function(){fu(t)&&gu(e)})}function fu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vt(e,n)}catch{return!0}}function gu(e){var t=Nt(e,1);t!==null&&jt(t,e,1,-1)}function hu(e){var t=Lt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:zr,lastRenderedState:e},t.queue=e,e=e.dispatch=Gp.bind(null,$e,e),[t.memoizedState,e]}function Er(e,t,n,i){return e={tag:e,create:t,destroy:n,deps:i,next:null},t=$e.updateQueue,t===null?(t={lastEffect:null,stores:null},$e.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e)),e}function xu(){return ht().memoizedState}function Po(e,t,n,i){var a=Lt();$e.flags|=e,a.memoizedState=Er(1|t,n,void 0,i===void 0?null:i)}function _o(e,t,n,i){var a=ht();i=i===void 0?null:i;var c=void 0;if(Ae!==null){var h=Ae.memoizedState;if(c=h.destroy,i!==null&&xl(i,h.deps)){a.memoizedState=Er(t,n,c,i);return}}$e.flags|=e,a.memoizedState=Er(1|t,n,c,i)}function yu(e,t){return Po(8390656,8,e,t)}function bl(e,t){return _o(2048,8,e,t)}function mu(e,t){return _o(4,2,e,t)}function vu(e,t){return _o(4,4,e,t)}function Su(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function bu(e,t,n){return n=n!=null?n.concat([e]):null,_o(4,4,Su.bind(null,t,e),n)}function kl(){}function ku(e,t){var n=ht();t=t===void 0?null:t;var i=n.memoizedState;return i!==null&&t!==null&&xl(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function wu(e,t){var n=ht();t=t===void 0?null:t;var i=n.memoizedState;return i!==null&&t!==null&&xl(t,i[1])?i[0]:(e=e(),n.memoizedState=[e,t],e)}function ju(e,t,n){return(yn&21)===0?(e.baseState&&(e.baseState=!1,ot=!0),e.memoizedState=n):(vt(n,t)||(n=ea(),$e.lanes|=n,mn|=n,e.baseState=!0),t)}function Jp(e,t){var n=Ce;Ce=n!==0&&4>n?n:4,e(!0);var i=hl.transition;hl.transition={};try{e(!1),t()}finally{Ce=n,hl.transition=i}}function Cu(){return ht().memoizedState}function Kp(e,t,n){var i=rn(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},Tu(e))Pu(t,n);else if(n=ru(e,t,n,i),n!==null){var a=et();jt(n,e,i,a),_u(n,t,i)}}function Gp(e,t,n){var i=rn(e),a={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(Tu(e))Pu(t,a);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,m=c(h,n);if(a.hasEagerState=!0,a.eagerState=m,vt(m,h)){var k=t.interleaved;k===null?(a.next=a,ul(t)):(a.next=k.next,k.next=a),t.interleaved=a;return}}catch{}n=ru(e,t,a,i),n!==null&&(a=et(),jt(n,e,i,a),_u(n,t,i))}}function Tu(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function Pu(e,t){_r=To=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _u(e,t,n){if((n&4194240)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,ji(e,n)}}var Lo={readContext:gt,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useInsertionEffect:Ge,useLayoutEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useMutableSource:Ge,useSyncExternalStore:Ge,useId:Ge,unstable_isNewReconciler:!1},Xp={readContext:gt,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:yu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Po(4194308,4,Su.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Po(4194308,4,e,t)},useInsertionEffect:function(e,t){return Po(4,2,e,t)},useMemo:function(e,t){var n=Lt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=Lt();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Kp.bind(null,$e,e),[i.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:hu,useDebugValue:kl,useDeferredValue:function(e){return Lt().memoizedState=e},useTransition:function(){var e=hu(!1),t=e[0];return e=Jp.bind(null,e[1]),Lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=$e,a=Lt();if(Me){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Ve===null)throw Error(u(349));(yn&30)!==0||cu(i,t,n)}a.memoizedState=n;var c={value:n,getSnapshot:t};return a.queue=c,yu(pu.bind(null,i,c,e),[e]),i.flags|=2048,Er(9,du.bind(null,i,c,n,t),void 0,null),n},useId:function(){var e=Lt(),t=Ve.identifierPrefix;if(Me){var n=$t,i=It;n=(i&~(1<<32-mt(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=Lr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Yp++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Zp={readContext:gt,useCallback:ku,useContext:gt,useEffect:bl,useImperativeHandle:bu,useInsertionEffect:mu,useLayoutEffect:vu,useMemo:wu,useReducer:vl,useRef:xu,useState:function(){return vl(zr)},useDebugValue:kl,useDeferredValue:function(e){var t=ht();return ju(t,Ae.memoizedState,e)},useTransition:function(){var e=vl(zr)[0],t=ht().memoizedState;return[e,t]},useMutableSource:au,useSyncExternalStore:uu,useId:Cu,unstable_isNewReconciler:!1},qp={readContext:gt,useCallback:ku,useContext:gt,useEffect:bl,useImperativeHandle:bu,useInsertionEffect:mu,useLayoutEffect:vu,useMemo:wu,useReducer:Sl,useRef:xu,useState:function(){return Sl(zr)},useDebugValue:kl,useDeferredValue:function(e){var t=ht();return Ae===null?t.memoizedState=e:ju(t,Ae.memoizedState,e)},useTransition:function(){var e=Sl(zr)[0],t=ht().memoizedState;return[e,t]},useMutableSource:au,useSyncExternalStore:uu,useId:Cu,unstable_isNewReconciler:!1};function bt(e,t){if(e&&e.defaultProps){t=X({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function wl(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:X({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zo={isMounted:function(e){return(e=e._reactInternals)?cn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var i=et(),a=rn(e),c=Ot(i,a);c.payload=t,n!=null&&(c.callback=n),t=qt(e,c,a),t!==null&&(jt(t,e,a,i),ko(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=et(),a=rn(e),c=Ot(i,a);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=qt(e,c,a),t!==null&&(jt(t,e,a,i),ko(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=et(),i=rn(e),a=Ot(n,i);a.tag=2,t!=null&&(a.callback=t),t=qt(e,a,i),t!==null&&(jt(t,e,i,n),ko(t,e,i))}};function Lu(e,t,n,i,a,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,c,h):t.prototype&&t.prototype.isPureReactComponent?!yr(n,i)||!yr(a,c):!0}function zu(e,t,n){var i=!1,a=Gt,c=t.contextType;return typeof c=="object"&&c!==null?c=gt(c):(a=rt(t)?pn:Ke.current,i=t.contextTypes,c=(i=i!=null)?Nn(e,a):Gt),t=new t(n,c),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=zo,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=c),t}function Eu(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&zo.enqueueReplaceState(t,t.state,null)}function jl(e,t,n,i){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},cl(e);var c=t.contextType;typeof c=="object"&&c!==null?a.context=gt(c):(c=rt(t)?pn:Ke.current,a.context=Nn(e,c)),a.state=e.memoizedState,c=t.getDerivedStateFromProps,typeof c=="function"&&(wl(e,t,c,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&zo.enqueueReplaceState(a,a.state,null),wo(e,n,a,i),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Vn(e,t){try{var n="",i=t;do n+=pe(i),i=i.return;while(i);var a=n}catch(c){a=`
5
+ `+a[h].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),k}while(1<=h&&0<=m);break}}}finally{le=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?N(e):""}function pe(e){switch(e.tag){case 5:return N(e.type);case 16:return N("Lazy");case 13:return N("Suspense");case 19:return N("SuspenseList");case 0:case 2:case 15:return e=de(e.type,!1),e;case 11:return e=de(e.type.render,!1),e;case 1:return e=de(e.type,!0),e;default:return""}}function ye(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case H:return"Portal";case G:return"Profiler";case V:return"StrictMode";case ve:return"Suspense";case Ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ce:return(e.displayName||"Context")+".Consumer";case Y:return(e._context.displayName||"Context")+".Provider";case Se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ne:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case Re:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}function je(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(t);case 8:return t===V?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ke(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Z(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function fe(e){var t=Z(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(h){i=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(h){i=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fe(e){e._valueTracker||(e._valueTracker=fe(e))}function tt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Z(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function jn(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}}function ui(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function zs(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=ke(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Es(e,t){t=t.checked,t!=null&&U(e,"checked",t,!1)}function ci(e,t){Es(e,t);var n=ke(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?di(e,t.type,n):t.hasOwnProperty("defaultValue")&&di(e,t.type,ke(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rs(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function di(e,t,n){(t!=="number"||jn(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qn=Array.isArray;function Cn(e,t,n,i){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&i&&(e[n].defaultSelected=!0)}else{for(n=""+ke(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,i&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function pi(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(u(91));return X({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ms(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(u(92));if(qn(n)){if(1<n.length)throw Error(u(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ke(n)}}function Fs(e,t){var n=ke(t.value),i=ke(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),i!=null&&(e.defaultValue=""+i)}function Is(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function $s(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function fi(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?$s(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ar,Ns=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,i,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,i,a)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ar=Ar||document.createElement("div"),Ar.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ar.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function er(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var tr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zd=["Webkit","ms","Moz","O"];Object.keys(tr).forEach(function(e){zd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),tr[t]=tr[e]})});function Os(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||tr.hasOwnProperty(e)&&tr[e]?(""+t).trim():t+"px"}function Bs(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,a=Os(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,a):e[n]=a}}var Ed=X({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function gi(e,t){if(t){if(Ed[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(u(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(u(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(u(61))}if(t.style!=null&&typeof t.style!="object")throw Error(u(62))}}function hi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 xi=null;function yi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mi=null,Tn=null,Pn=null;function Ds(e){if(e=wr(e)){if(typeof mi!="function")throw Error(u(280));var t=e.stateNode;t&&(t=po(t),mi(e.stateNode,e.type,t))}}function Ws(e){Tn?Pn?Pn.push(e):Pn=[e]:Tn=e}function As(){if(Tn){var e=Tn,t=Pn;if(Pn=Tn=null,Ds(e),t)for(e=0;e<t.length;e++)Ds(t[e])}}function Hs(e,t){return e(t)}function Us(){}var vi=!1;function Vs(e,t,n){if(vi)return e(t,n);vi=!0;try{return Hs(e,t,n)}finally{vi=!1,(Tn!==null||Pn!==null)&&(Us(),As())}}function nr(e,t){var n=e.stateNode;if(n===null)return null;var i=po(n);if(i===null)return null;n=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var Si=!1;if(y)try{var rr={};Object.defineProperty(rr,"passive",{get:function(){Si=!0}}),window.addEventListener("test",rr,rr),window.removeEventListener("test",rr,rr)}catch{Si=!1}function Rd(e,t,n,i,a,c,h,m,k){var F=Array.prototype.slice.call(arguments,3);try{t.apply(n,F)}catch(D){this.onError(D)}}var or=!1,Hr=null,Ur=!1,bi=null,Md={onError:function(e){or=!0,Hr=e}};function Fd(e,t,n,i,a,c,h,m,k){or=!1,Hr=null,Rd.apply(Md,arguments)}function Id(e,t,n,i,a,c,h,m,k){if(Fd.apply(this,arguments),or){if(or){var F=Hr;or=!1,Hr=null}else throw Error(u(198));Ur||(Ur=!0,bi=F)}}function cn(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 Qs(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 Ys(e){if(cn(e)!==e)throw Error(u(188))}function $d(e){var t=e.alternate;if(!t){if(t=cn(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var c=a.alternate;if(c===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===c.child){for(c=a.child;c;){if(c===n)return Ys(a),e;if(c===i)return Ys(a),t;c=c.sibling}throw Error(u(188))}if(n.return!==i.return)n=a,i=c;else{for(var h=!1,m=a.child;m;){if(m===n){h=!0,n=a,i=c;break}if(m===i){h=!0,i=a,n=c;break}m=m.sibling}if(!h){for(m=c.child;m;){if(m===n){h=!0,n=c,i=a;break}if(m===i){h=!0,i=c,n=a;break}m=m.sibling}if(!h)throw Error(u(189))}}if(n.alternate!==i)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function Js(e){return e=$d(e),e!==null?Ks(e):null}function Ks(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ks(e);if(t!==null)return t;e=e.sibling}return null}var Gs=s.unstable_scheduleCallback,Xs=s.unstable_cancelCallback,Nd=s.unstable_shouldYield,Od=s.unstable_requestPaint,Be=s.unstable_now,Bd=s.unstable_getCurrentPriorityLevel,ki=s.unstable_ImmediatePriority,Zs=s.unstable_UserBlockingPriority,Vr=s.unstable_NormalPriority,Dd=s.unstable_LowPriority,qs=s.unstable_IdlePriority,Qr=null,Tt=null;function Wd(e){if(Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(Qr,e,void 0,(e.current.flags&128)===128)}catch{}}var mt=Math.clz32?Math.clz32:Ud,Ad=Math.log,Hd=Math.LN2;function Ud(e){return e>>>=0,e===0?32:31-(Ad(e)/Hd|0)|0}var Yr=64,Jr=4194304;function ir(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Kr(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,a=e.suspendedLanes,c=e.pingedLanes,h=n&268435455;if(h!==0){var m=h&~a;m!==0?i=ir(m):(c&=h,c!==0&&(i=ir(c)))}else h=n&~a,h!==0?i=ir(h):c!==0&&(i=ir(c));if(i===0)return 0;if(t!==0&&t!==i&&(t&a)===0&&(a=i&-i,c=t&-t,a>=c||a===16&&(c&4194240)!==0))return t;if((i&4)!==0&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)n=31-mt(t),a=1<<n,i|=e[n],t&=~a;return i}function Vd(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qd(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,c=e.pendingLanes;0<c;){var h=31-mt(c),m=1<<h,k=a[h];k===-1?((m&n)===0||(m&i)!==0)&&(a[h]=Vd(m,t)):k<=t&&(e.expiredLanes|=m),c&=~m}}function wi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ea(){var e=Yr;return Yr<<=1,(Yr&4194240)===0&&(Yr=64),e}function ji(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-mt(t),e[t]=n}function Yd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-mt(n),c=1<<a;t[a]=0,i[a]=-1,e[a]=-1,n&=~c}}function Ci(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-mt(n),a=1<<i;a&t|e[i]&t&&(e[i]|=t),n&=~a}}var Ce=0;function ta(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var na,Ti,ra,oa,ia,Pi=!1,Gr=[],At=null,Ht=null,Ut=null,sr=new Map,ar=new Map,Vt=[],Jd="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 submit".split(" ");function la(e,t){switch(e){case"focusin":case"focusout":At=null;break;case"dragenter":case"dragleave":Ht=null;break;case"mouseover":case"mouseout":Ut=null;break;case"pointerover":case"pointerout":sr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ar.delete(t.pointerId)}}function ur(e,t,n,i,a,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:c,targetContainers:[a]},t!==null&&(t=wr(t),t!==null&&Ti(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Kd(e,t,n,i,a){switch(t){case"focusin":return At=ur(At,e,t,n,i,a),!0;case"dragenter":return Ht=ur(Ht,e,t,n,i,a),!0;case"mouseover":return Ut=ur(Ut,e,t,n,i,a),!0;case"pointerover":var c=a.pointerId;return sr.set(c,ur(sr.get(c)||null,e,t,n,i,a)),!0;case"gotpointercapture":return c=a.pointerId,ar.set(c,ur(ar.get(c)||null,e,t,n,i,a)),!0}return!1}function sa(e){var t=dn(e.target);if(t!==null){var n=cn(t);if(n!==null){if(t=n.tag,t===13){if(t=Qs(n),t!==null){e.blockedOn=t,ia(e.priority,function(){ra(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 Xr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Li(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);xi=i,n.target.dispatchEvent(i),xi=null}else return t=wr(n),t!==null&&Ti(t),e.blockedOn=n,!1;t.shift()}return!0}function aa(e,t,n){Xr(e)&&n.delete(t)}function Gd(){Pi=!1,At!==null&&Xr(At)&&(At=null),Ht!==null&&Xr(Ht)&&(Ht=null),Ut!==null&&Xr(Ut)&&(Ut=null),sr.forEach(aa),ar.forEach(aa)}function cr(e,t){e.blockedOn===t&&(e.blockedOn=null,Pi||(Pi=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Gd)))}function dr(e){function t(a){return cr(a,e)}if(0<Gr.length){cr(Gr[0],e);for(var n=1;n<Gr.length;n++){var i=Gr[n];i.blockedOn===e&&(i.blockedOn=null)}}for(At!==null&&cr(At,e),Ht!==null&&cr(Ht,e),Ut!==null&&cr(Ut,e),sr.forEach(t),ar.forEach(t),n=0;n<Vt.length;n++)i=Vt[n],i.blockedOn===e&&(i.blockedOn=null);for(;0<Vt.length&&(n=Vt[0],n.blockedOn===null);)sa(n),n.blockedOn===null&&Vt.shift()}var _n=W.ReactCurrentBatchConfig,Zr=!0;function Xd(e,t,n,i){var a=Ce,c=_n.transition;_n.transition=null;try{Ce=1,_i(e,t,n,i)}finally{Ce=a,_n.transition=c}}function Zd(e,t,n,i){var a=Ce,c=_n.transition;_n.transition=null;try{Ce=4,_i(e,t,n,i)}finally{Ce=a,_n.transition=c}}function _i(e,t,n,i){if(Zr){var a=Li(e,t,n,i);if(a===null)Qi(e,t,i,qr,n),la(e,i);else if(Kd(a,e,t,n,i))i.stopPropagation();else if(la(e,i),t&4&&-1<Jd.indexOf(e)){for(;a!==null;){var c=wr(a);if(c!==null&&na(c),c=Li(e,t,n,i),c===null&&Qi(e,t,i,qr,n),c===a)break;a=c}a!==null&&i.stopPropagation()}else Qi(e,t,i,null,n)}}var qr=null;function Li(e,t,n,i){if(qr=null,e=yi(i),e=dn(e),e!==null)if(t=cn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Qs(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 qr=e,null}function ua(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Bd()){case ki:return 1;case Zs:return 4;case Vr:case Dd:return 16;case qs:return 536870912;default:return 16}default:return 16}}var Qt=null,zi=null,eo=null;function ca(){if(eo)return eo;var e,t=zi,n=t.length,i,a="value"in Qt?Qt.value:Qt.textContent,c=a.length;for(e=0;e<n&&t[e]===a[e];e++);var h=n-e;for(i=1;i<=h&&t[n-i]===a[c-i];i++);return eo=a.slice(e,1<i?1-i:void 0)}function to(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 no(){return!0}function da(){return!1}function at(e){function t(n,i,a,c,h){this._reactName=n,this._targetInst=a,this.type=i,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(n=e[m],this[m]=n?n(c):c[m]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?no:da,this.isPropagationStopped=da,this}return X(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=no)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=no)},persist:function(){},isPersistent:no}),t}var Ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ei=at(Ln),pr=X({},Ln,{view:0,detail:0}),qd=at(pr),Ri,Mi,fr,ro=X({},pr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ii,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!==fr&&(fr&&e.type==="mousemove"?(Ri=e.screenX-fr.screenX,Mi=e.screenY-fr.screenY):Mi=Ri=0,fr=e),Ri)},movementY:function(e){return"movementY"in e?e.movementY:Mi}}),pa=at(ro),ep=X({},ro,{dataTransfer:0}),tp=at(ep),np=X({},pr,{relatedTarget:0}),Fi=at(np),rp=X({},Ln,{animationName:0,elapsedTime:0,pseudoElement:0}),op=at(rp),ip=X({},Ln,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lp=at(ip),sp=X({},Ln,{data:0}),fa=at(sp),ap={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},up={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"},cp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cp[e])?!!t[e]:!1}function Ii(){return dp}var pp=X({},pr,{key:function(e){if(e.key){var t=ap[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=to(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?up[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ii,charCode:function(e){return e.type==="keypress"?to(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?to(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fp=at(pp),gp=X({},ro,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ga=at(gp),hp=X({},pr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ii}),xp=at(hp),yp=X({},Ln,{propertyName:0,elapsedTime:0,pseudoElement:0}),mp=at(yp),vp=X({},ro,{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}),Sp=at(vp),bp=[9,13,27,32],$i=y&&"CompositionEvent"in window,gr=null;y&&"documentMode"in document&&(gr=document.documentMode);var kp=y&&"TextEvent"in window&&!gr,ha=y&&(!$i||gr&&8<gr&&11>=gr),xa=" ",ya=!1;function ma(e,t){switch(e){case"keyup":return bp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function va(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zn=!1;function wp(e,t){switch(e){case"compositionend":return va(t);case"keypress":return t.which!==32?null:(ya=!0,xa);case"textInput":return e=t.data,e===xa&&ya?null:e;default:return null}}function jp(e,t){if(zn)return e==="compositionend"||!$i&&ma(e,t)?(e=ca(),eo=zi=Qt=null,zn=!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 ha&&t.locale!=="ko"?null:t.data;default:return null}}var Cp={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 Sa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Cp[e.type]:t==="textarea"}function ba(e,t,n,i){Ws(i),t=ao(t,"onChange"),0<t.length&&(n=new Ei("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var hr=null,xr=null;function Tp(e){Ba(e,0)}function oo(e){var t=In(e);if(tt(t))return e}function Pp(e,t){if(e==="change")return t}var ka=!1;if(y){var Ni;if(y){var Oi="oninput"in document;if(!Oi){var wa=document.createElement("div");wa.setAttribute("oninput","return;"),Oi=typeof wa.oninput=="function"}Ni=Oi}else Ni=!1;ka=Ni&&(!document.documentMode||9<document.documentMode)}function ja(){hr&&(hr.detachEvent("onpropertychange",Ca),xr=hr=null)}function Ca(e){if(e.propertyName==="value"&&oo(xr)){var t=[];ba(t,xr,e,yi(e)),Vs(Tp,t)}}function _p(e,t,n){e==="focusin"?(ja(),hr=t,xr=n,hr.attachEvent("onpropertychange",Ca)):e==="focusout"&&ja()}function Lp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return oo(xr)}function zp(e,t){if(e==="click")return oo(t)}function Ep(e,t){if(e==="input"||e==="change")return oo(t)}function Rp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vt=typeof Object.is=="function"?Object.is:Rp;function yr(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),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var a=n[i];if(!g.call(t,a)||!vt(e[a],t[a]))return!1}return!0}function Ta(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pa(e,t){var n=Ta(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ta(n)}}function _a(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_a(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function La(){for(var e=window,t=jn();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=jn(e.document)}return t}function Bi(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")}function Mp(e){var t=La(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&_a(n.ownerDocument.documentElement,n)){if(i!==null&&Bi(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,c=Math.min(i.start,a);i=i.end===void 0?c:Math.min(i.end,a),!e.extend&&c>i&&(a=i,i=c,c=a),a=Pa(n,c);var h=Pa(n,i);a&&h&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==h.node||e.focusOffset!==h.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),c>i?(e.addRange(t),e.extend(h.node,h.offset)):(t.setEnd(h.node,h.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Fp=y&&"documentMode"in document&&11>=document.documentMode,En=null,Di=null,mr=null,Wi=!1;function za(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wi||En==null||En!==jn(i)||(i=En,"selectionStart"in i&&Bi(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),mr&&yr(mr,i)||(mr=i,i=ao(Di,"onSelect"),0<i.length&&(t=new Ei("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=En)))}function io(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Rn={animationend:io("Animation","AnimationEnd"),animationiteration:io("Animation","AnimationIteration"),animationstart:io("Animation","AnimationStart"),transitionend:io("Transition","TransitionEnd")},Ai={},Ea={};y&&(Ea=document.createElement("div").style,"AnimationEvent"in window||(delete Rn.animationend.animation,delete Rn.animationiteration.animation,delete Rn.animationstart.animation),"TransitionEvent"in window||delete Rn.transitionend.transition);function lo(e){if(Ai[e])return Ai[e];if(!Rn[e])return e;var t=Rn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ea)return Ai[e]=t[n];return e}var Ra=lo("animationend"),Ma=lo("animationiteration"),Fa=lo("animationstart"),Ia=lo("transitionend"),$a=new Map,Na="abort auxClick 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(" ");function Yt(e,t){$a.set(e,t),f(t,[e])}for(var Hi=0;Hi<Na.length;Hi++){var Ui=Na[Hi],Ip=Ui.toLowerCase(),$p=Ui[0].toUpperCase()+Ui.slice(1);Yt(Ip,"on"+$p)}Yt(Ra,"onAnimationEnd"),Yt(Ma,"onAnimationIteration"),Yt(Fa,"onAnimationStart"),Yt("dblclick","onDoubleClick"),Yt("focusin","onFocus"),Yt("focusout","onBlur"),Yt(Ia,"onTransitionEnd"),x("onMouseEnter",["mouseout","mouseover"]),x("onMouseLeave",["mouseout","mouseover"]),x("onPointerEnter",["pointerout","pointerover"]),x("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vr="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(" "),Np=new Set("cancel close invalid load scroll toggle".split(" ").concat(vr));function Oa(e,t,n){var i=e.type||"unknown-event";e.currentTarget=n,Id(i,t,void 0,e),e.currentTarget=null}function Ba(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],a=i.event;i=i.listeners;e:{var c=void 0;if(t)for(var h=i.length-1;0<=h;h--){var m=i[h],k=m.instance,F=m.currentTarget;if(m=m.listener,k!==c&&a.isPropagationStopped())break e;Oa(a,m,F),c=k}else for(h=0;h<i.length;h++){if(m=i[h],k=m.instance,F=m.currentTarget,m=m.listener,k!==c&&a.isPropagationStopped())break e;Oa(a,m,F),c=k}}}if(Ur)throw e=bi,Ur=!1,bi=null,e}function Le(e,t){var n=t[Zi];n===void 0&&(n=t[Zi]=new Set);var i=e+"__bubble";n.has(i)||(Da(t,e,2,!1),n.add(i))}function Vi(e,t,n){var i=0;t&&(i|=4),Da(n,e,i,t)}var so="_reactListening"+Math.random().toString(36).slice(2);function Sr(e){if(!e[so]){e[so]=!0,p.forEach(function(n){n!=="selectionchange"&&(Np.has(n)||Vi(n,!1,e),Vi(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[so]||(t[so]=!0,Vi("selectionchange",!1,t))}}function Da(e,t,n,i){switch(ua(t)){case 1:var a=Xd;break;case 4:a=Zd;break;default:a=_i}n=a.bind(null,t,n,e),a=void 0,!Si||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),i?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Qi(e,t,n,i,a){var c=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var h=i.tag;if(h===3||h===4){var m=i.stateNode.containerInfo;if(m===a||m.nodeType===8&&m.parentNode===a)break;if(h===4)for(h=i.return;h!==null;){var k=h.tag;if((k===3||k===4)&&(k=h.stateNode.containerInfo,k===a||k.nodeType===8&&k.parentNode===a))return;h=h.return}for(;m!==null;){if(h=dn(m),h===null)return;if(k=h.tag,k===5||k===6){i=c=h;continue e}m=m.parentNode}}i=i.return}Vs(function(){var F=c,D=yi(n),A=[];e:{var B=$a.get(e);if(B!==void 0){var q=Ei,ne=e;switch(e){case"keypress":if(to(n)===0)break e;case"keydown":case"keyup":q=fp;break;case"focusin":ne="focus",q=Fi;break;case"focusout":ne="blur",q=Fi;break;case"beforeblur":case"afterblur":q=Fi;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":q=pa;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=tp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=xp;break;case Ra:case Ma:case Fa:q=op;break;case Ia:q=mp;break;case"scroll":q=qd;break;case"wheel":q=Sp;break;case"copy":case"cut":case"paste":q=lp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=ga}var re=(t&4)!==0,De=!re&&e==="scroll",E=re?B!==null?B+"Capture":null:B;re=[];for(var C=F,M;C!==null;){M=C;var Q=M.stateNode;if(M.tag===5&&Q!==null&&(M=Q,E!==null&&(Q=nr(C,E),Q!=null&&re.push(br(C,Q,M)))),De)break;C=C.return}0<re.length&&(B=new q(B,ne,null,n,D),A.push({event:B,listeners:re}))}}if((t&7)===0){e:{if(B=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",B&&n!==xi&&(ne=n.relatedTarget||n.fromElement)&&(dn(ne)||ne[Mt]))break e;if((q||B)&&(B=D.window===D?D:(B=D.ownerDocument)?B.defaultView||B.parentWindow:window,q?(ne=n.relatedTarget||n.toElement,q=F,ne=ne?dn(ne):null,ne!==null&&(De=cn(ne),ne!==De||ne.tag!==5&&ne.tag!==6)&&(ne=null)):(q=null,ne=F),q!==ne)){if(re=pa,Q="onMouseLeave",E="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(re=ga,Q="onPointerLeave",E="onPointerEnter",C="pointer"),De=q==null?B:In(q),M=ne==null?B:In(ne),B=new re(Q,C+"leave",q,n,D),B.target=De,B.relatedTarget=M,Q=null,dn(D)===F&&(re=new re(E,C+"enter",ne,n,D),re.target=M,re.relatedTarget=De,Q=re),De=Q,q&&ne)t:{for(re=q,E=ne,C=0,M=re;M;M=Mn(M))C++;for(M=0,Q=E;Q;Q=Mn(Q))M++;for(;0<C-M;)re=Mn(re),C--;for(;0<M-C;)E=Mn(E),M--;for(;C--;){if(re===E||E!==null&&re===E.alternate)break t;re=Mn(re),E=Mn(E)}re=null}else re=null;q!==null&&Wa(A,B,q,re,!1),ne!==null&&De!==null&&Wa(A,De,ne,re,!0)}}e:{if(B=F?In(F):window,q=B.nodeName&&B.nodeName.toLowerCase(),q==="select"||q==="input"&&B.type==="file")var oe=Pp;else if(Sa(B))if(ka)oe=Ep;else{oe=Lp;var se=_p}else(q=B.nodeName)&&q.toLowerCase()==="input"&&(B.type==="checkbox"||B.type==="radio")&&(oe=zp);if(oe&&(oe=oe(e,F))){ba(A,oe,n,D);break e}se&&se(e,B,F),e==="focusout"&&(se=B._wrapperState)&&se.controlled&&B.type==="number"&&di(B,"number",B.value)}switch(se=F?In(F):window,e){case"focusin":(Sa(se)||se.contentEditable==="true")&&(En=se,Di=F,mr=null);break;case"focusout":mr=Di=En=null;break;case"mousedown":Wi=!0;break;case"contextmenu":case"mouseup":case"dragend":Wi=!1,za(A,n,D);break;case"selectionchange":if(Fp)break;case"keydown":case"keyup":za(A,n,D)}var ae;if($i)e:{switch(e){case"compositionstart":var ue="onCompositionStart";break e;case"compositionend":ue="onCompositionEnd";break e;case"compositionupdate":ue="onCompositionUpdate";break e}ue=void 0}else zn?ma(e,n)&&(ue="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ue="onCompositionStart");ue&&(ha&&n.locale!=="ko"&&(zn||ue!=="onCompositionStart"?ue==="onCompositionEnd"&&zn&&(ae=ca()):(Qt=D,zi="value"in Qt?Qt.value:Qt.textContent,zn=!0)),se=ao(F,ue),0<se.length&&(ue=new fa(ue,e,null,n,D),A.push({event:ue,listeners:se}),ae?ue.data=ae:(ae=va(n),ae!==null&&(ue.data=ae)))),(ae=kp?wp(e,n):jp(e,n))&&(F=ao(F,"onBeforeInput"),0<F.length&&(D=new fa("onBeforeInput","beforeinput",null,n,D),A.push({event:D,listeners:F}),D.data=ae))}Ba(A,t)})}function br(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ao(e,t){for(var n=t+"Capture",i=[];e!==null;){var a=e,c=a.stateNode;a.tag===5&&c!==null&&(a=c,c=nr(e,n),c!=null&&i.unshift(br(e,c,a)),c=nr(e,t),c!=null&&i.push(br(e,c,a))),e=e.return}return i}function Mn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Wa(e,t,n,i,a){for(var c=t._reactName,h=[];n!==null&&n!==i;){var m=n,k=m.alternate,F=m.stateNode;if(k!==null&&k===i)break;m.tag===5&&F!==null&&(m=F,a?(k=nr(n,c),k!=null&&h.unshift(br(n,k,m))):a||(k=nr(n,c),k!=null&&h.push(br(n,k,m)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Op=/\r\n?/g,Bp=/\u0000|\uFFFD/g;function Aa(e){return(typeof e=="string"?e:""+e).replace(Op,`
6
+ `).replace(Bp,"")}function uo(e,t,n){if(t=Aa(t),Aa(e)!==t&&n)throw Error(u(425))}function co(){}var Yi=null,Ji=null;function Ki(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gi=typeof setTimeout=="function"?setTimeout:void 0,Dp=typeof clearTimeout=="function"?clearTimeout:void 0,Ha=typeof Promise=="function"?Promise:void 0,Wp=typeof queueMicrotask=="function"?queueMicrotask:typeof Ha<"u"?function(e){return Ha.resolve(null).then(e).catch(Ap)}:Gi;function Ap(e){setTimeout(function(){throw e})}function Xi(e,t){var n=t,i=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(i===0){e.removeChild(a),dr(t);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=a}while(n);dr(t)}function Jt(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==="$?")break;if(t==="/$")return null}}return e}function Ua(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Fn=Math.random().toString(36).slice(2),Pt="__reactFiber$"+Fn,kr="__reactProps$"+Fn,Mt="__reactContainer$"+Fn,Zi="__reactEvents$"+Fn,Hp="__reactListeners$"+Fn,Up="__reactHandles$"+Fn;function dn(e){var t=e[Pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Mt]||n[Pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ua(e);e!==null;){if(n=e[Pt])return n;e=Ua(e)}return t}e=n,n=e.parentNode}return null}function wr(e){return e=e[Pt]||e[Mt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function In(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(u(33))}function po(e){return e[kr]||null}var qi=[],$n=-1;function Kt(e){return{current:e}}function ze(e){0>$n||(e.current=qi[$n],qi[$n]=null,$n--)}function _e(e,t){$n++,qi[$n]=e.current,e.current=t}var Gt={},Ke=Kt(Gt),nt=Kt(!1),pn=Gt;function Nn(e,t){var n=e.type.contextTypes;if(!n)return Gt;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var a={},c;for(c in n)a[c]=t[c];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function rt(e){return e=e.childContextTypes,e!=null}function fo(){ze(nt),ze(Ke)}function Va(e,t,n){if(Ke.current!==Gt)throw Error(u(168));_e(Ke,t),_e(nt,n)}function Qa(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var a in i)if(!(a in t))throw Error(u(108,je(e)||"Unknown",a));return X({},n,i)}function go(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gt,pn=Ke.current,_e(Ke,e),_e(nt,nt.current),!0}function Ya(e,t,n){var i=e.stateNode;if(!i)throw Error(u(169));n?(e=Qa(e,t,pn),i.__reactInternalMemoizedMergedChildContext=e,ze(nt),ze(Ke),_e(Ke,e)):ze(nt),_e(nt,n)}var Ft=null,ho=!1,el=!1;function Ja(e){Ft===null?Ft=[e]:Ft.push(e)}function Vp(e){ho=!0,Ja(e)}function Xt(){if(!el&&Ft!==null){el=!0;var e=0,t=Ce;try{var n=Ft;for(Ce=1;e<n.length;e++){var i=n[e];do i=i(!0);while(i!==null)}Ft=null,ho=!1}catch(a){throw Ft!==null&&(Ft=Ft.slice(e+1)),Gs(ki,Xt),a}finally{Ce=t,el=!1}}return null}var On=[],Bn=0,xo=null,yo=0,pt=[],ft=0,fn=null,It=1,$t="";function gn(e,t){On[Bn++]=yo,On[Bn++]=xo,xo=e,yo=t}function Ka(e,t,n){pt[ft++]=It,pt[ft++]=$t,pt[ft++]=fn,fn=e;var i=It;e=$t;var a=32-mt(i)-1;i&=~(1<<a),n+=1;var c=32-mt(t)+a;if(30<c){var h=a-a%5;c=(i&(1<<h)-1).toString(32),i>>=h,a-=h,It=1<<32-mt(t)+a|n<<a|i,$t=c+e}else It=1<<c|n<<a|i,$t=e}function tl(e){e.return!==null&&(gn(e,1),Ka(e,1,0))}function nl(e){for(;e===xo;)xo=On[--Bn],On[Bn]=null,yo=On[--Bn],On[Bn]=null;for(;e===fn;)fn=pt[--ft],pt[ft]=null,$t=pt[--ft],pt[ft]=null,It=pt[--ft],pt[ft]=null}var ut=null,ct=null,Me=!1,St=null;function Ga(e,t){var n=yt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Xa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ut=e,ct=Jt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ut=e,ct=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=fn!==null?{id:It,overflow:$t}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=yt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ut=e,ct=null,!0):!1;default:return!1}}function rl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ol(e){if(Me){var t=ct;if(t){var n=t;if(!Xa(e,t)){if(rl(e))throw Error(u(418));t=Jt(n.nextSibling);var i=ut;t&&Xa(e,t)?Ga(i,n):(e.flags=e.flags&-4097|2,Me=!1,ut=e)}}else{if(rl(e))throw Error(u(418));e.flags=e.flags&-4097|2,Me=!1,ut=e}}}function Za(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ut=e}function mo(e){if(e!==ut)return!1;if(!Me)return Za(e),Me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ki(e.type,e.memoizedProps)),t&&(t=ct)){if(rl(e))throw qa(),Error(u(418));for(;t;)Ga(e,t),t=Jt(t.nextSibling)}if(Za(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ct=Jt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ct=null}}else ct=ut?Jt(e.stateNode.nextSibling):null;return!0}function qa(){for(var e=ct;e;)e=Jt(e.nextSibling)}function Dn(){ct=ut=null,Me=!1}function il(e){St===null?St=[e]:St.push(e)}var Qp=W.ReactCurrentBatchConfig;function jr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(u(309));var i=n.stateNode}if(!i)throw Error(u(147,e));var a=i,c=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===c?t.ref:(t=function(h){var m=a.refs;h===null?delete m[c]:m[c]=h},t._stringRef=c,t)}if(typeof e!="string")throw Error(u(284));if(!n._owner)throw Error(u(290,e))}return e}function vo(e,t){throw e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function eu(e){var t=e._init;return t(e._payload)}function tu(e){function t(E,C){if(e){var M=E.deletions;M===null?(E.deletions=[C],E.flags|=16):M.push(C)}}function n(E,C){if(!e)return null;for(;C!==null;)t(E,C),C=C.sibling;return null}function i(E,C){for(E=new Map;C!==null;)C.key!==null?E.set(C.key,C):E.set(C.index,C),C=C.sibling;return E}function a(E,C){return E=ln(E,C),E.index=0,E.sibling=null,E}function c(E,C,M){return E.index=M,e?(M=E.alternate,M!==null?(M=M.index,M<C?(E.flags|=2,C):M):(E.flags|=2,C)):(E.flags|=1048576,C)}function h(E){return e&&E.alternate===null&&(E.flags|=2),E}function m(E,C,M,Q){return C===null||C.tag!==6?(C=Gl(M,E.mode,Q),C.return=E,C):(C=a(C,M),C.return=E,C)}function k(E,C,M,Q){var oe=M.type;return oe===K?D(E,C,M.props.children,Q,M.key):C!==null&&(C.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===Re&&eu(oe)===C.type)?(Q=a(C,M.props),Q.ref=jr(E,C,M),Q.return=E,Q):(Q=Ho(M.type,M.key,M.props,null,E.mode,Q),Q.ref=jr(E,C,M),Q.return=E,Q)}function F(E,C,M,Q){return C===null||C.tag!==4||C.stateNode.containerInfo!==M.containerInfo||C.stateNode.implementation!==M.implementation?(C=Xl(M,E.mode,Q),C.return=E,C):(C=a(C,M.children||[]),C.return=E,C)}function D(E,C,M,Q,oe){return C===null||C.tag!==7?(C=kn(M,E.mode,Q,oe),C.return=E,C):(C=a(C,M),C.return=E,C)}function A(E,C,M){if(typeof C=="string"&&C!==""||typeof C=="number")return C=Gl(""+C,E.mode,M),C.return=E,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case $:return M=Ho(C.type,C.key,C.props,null,E.mode,M),M.ref=jr(E,null,C),M.return=E,M;case H:return C=Xl(C,E.mode,M),C.return=E,C;case Re:var Q=C._init;return A(E,Q(C._payload),M)}if(qn(C)||ee(C))return C=kn(C,E.mode,M,null),C.return=E,C;vo(E,C)}return null}function B(E,C,M,Q){var oe=C!==null?C.key:null;if(typeof M=="string"&&M!==""||typeof M=="number")return oe!==null?null:m(E,C,""+M,Q);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case $:return M.key===oe?k(E,C,M,Q):null;case H:return M.key===oe?F(E,C,M,Q):null;case Re:return oe=M._init,B(E,C,oe(M._payload),Q)}if(qn(M)||ee(M))return oe!==null?null:D(E,C,M,Q,null);vo(E,M)}return null}function q(E,C,M,Q,oe){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return E=E.get(M)||null,m(C,E,""+Q,oe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case $:return E=E.get(Q.key===null?M:Q.key)||null,k(C,E,Q,oe);case H:return E=E.get(Q.key===null?M:Q.key)||null,F(C,E,Q,oe);case Re:var se=Q._init;return q(E,C,M,se(Q._payload),oe)}if(qn(Q)||ee(Q))return E=E.get(M)||null,D(C,E,Q,oe,null);vo(C,Q)}return null}function ne(E,C,M,Q){for(var oe=null,se=null,ae=C,ue=C=0,Qe=null;ae!==null&&ue<M.length;ue++){ae.index>ue?(Qe=ae,ae=null):Qe=ae.sibling;var we=B(E,ae,M[ue],Q);if(we===null){ae===null&&(ae=Qe);break}e&&ae&&we.alternate===null&&t(E,ae),C=c(we,C,ue),se===null?oe=we:se.sibling=we,se=we,ae=Qe}if(ue===M.length)return n(E,ae),Me&&gn(E,ue),oe;if(ae===null){for(;ue<M.length;ue++)ae=A(E,M[ue],Q),ae!==null&&(C=c(ae,C,ue),se===null?oe=ae:se.sibling=ae,se=ae);return Me&&gn(E,ue),oe}for(ae=i(E,ae);ue<M.length;ue++)Qe=q(ae,E,ue,M[ue],Q),Qe!==null&&(e&&Qe.alternate!==null&&ae.delete(Qe.key===null?ue:Qe.key),C=c(Qe,C,ue),se===null?oe=Qe:se.sibling=Qe,se=Qe);return e&&ae.forEach(function(sn){return t(E,sn)}),Me&&gn(E,ue),oe}function re(E,C,M,Q){var oe=ee(M);if(typeof oe!="function")throw Error(u(150));if(M=oe.call(M),M==null)throw Error(u(151));for(var se=oe=null,ae=C,ue=C=0,Qe=null,we=M.next();ae!==null&&!we.done;ue++,we=M.next()){ae.index>ue?(Qe=ae,ae=null):Qe=ae.sibling;var sn=B(E,ae,we.value,Q);if(sn===null){ae===null&&(ae=Qe);break}e&&ae&&sn.alternate===null&&t(E,ae),C=c(sn,C,ue),se===null?oe=sn:se.sibling=sn,se=sn,ae=Qe}if(we.done)return n(E,ae),Me&&gn(E,ue),oe;if(ae===null){for(;!we.done;ue++,we=M.next())we=A(E,we.value,Q),we!==null&&(C=c(we,C,ue),se===null?oe=we:se.sibling=we,se=we);return Me&&gn(E,ue),oe}for(ae=i(E,ae);!we.done;ue++,we=M.next())we=q(ae,E,ue,we.value,Q),we!==null&&(e&&we.alternate!==null&&ae.delete(we.key===null?ue:we.key),C=c(we,C,ue),se===null?oe=we:se.sibling=we,se=we);return e&&ae.forEach(function(Tf){return t(E,Tf)}),Me&&gn(E,ue),oe}function De(E,C,M,Q){if(typeof M=="object"&&M!==null&&M.type===K&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case $:e:{for(var oe=M.key,se=C;se!==null;){if(se.key===oe){if(oe=M.type,oe===K){if(se.tag===7){n(E,se.sibling),C=a(se,M.props.children),C.return=E,E=C;break e}}else if(se.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===Re&&eu(oe)===se.type){n(E,se.sibling),C=a(se,M.props),C.ref=jr(E,se,M),C.return=E,E=C;break e}n(E,se);break}else t(E,se);se=se.sibling}M.type===K?(C=kn(M.props.children,E.mode,Q,M.key),C.return=E,E=C):(Q=Ho(M.type,M.key,M.props,null,E.mode,Q),Q.ref=jr(E,C,M),Q.return=E,E=Q)}return h(E);case H:e:{for(se=M.key;C!==null;){if(C.key===se)if(C.tag===4&&C.stateNode.containerInfo===M.containerInfo&&C.stateNode.implementation===M.implementation){n(E,C.sibling),C=a(C,M.children||[]),C.return=E,E=C;break e}else{n(E,C);break}else t(E,C);C=C.sibling}C=Xl(M,E.mode,Q),C.return=E,E=C}return h(E);case Re:return se=M._init,De(E,C,se(M._payload),Q)}if(qn(M))return ne(E,C,M,Q);if(ee(M))return re(E,C,M,Q);vo(E,M)}return typeof M=="string"&&M!==""||typeof M=="number"?(M=""+M,C!==null&&C.tag===6?(n(E,C.sibling),C=a(C,M),C.return=E,E=C):(n(E,C),C=Gl(M,E.mode,Q),C.return=E,E=C),h(E)):n(E,C)}return De}var Wn=tu(!0),nu=tu(!1),So=Kt(null),bo=null,An=null,ll=null;function sl(){ll=An=bo=null}function al(e){var t=So.current;ze(So),e._currentValue=t}function ul(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function Hn(e,t){bo=e,ll=An=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ot=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(ll!==e)if(e={context:e,memoizedValue:t,next:null},An===null){if(bo===null)throw Error(u(308));An=e,bo.dependencies={lanes:0,firstContext:e}}else An=An.next=e;return t}var hn=null;function cl(e){hn===null?hn=[e]:hn.push(e)}function ru(e,t,n,i){var a=t.interleaved;return a===null?(n.next=n,cl(t)):(n.next=a.next,a.next=n),t.interleaved=n,Nt(e,i)}function Nt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Zt=!1;function dl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ou(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ot(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qt(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(be&2)!==0){var a=i.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),i.pending=t,Nt(e,n)}return a=i.interleaved,a===null?(t.next=t,cl(i)):(t.next=a.next,a.next=t),i.interleaved=t,Nt(e,n)}function ko(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Ci(e,n)}}function iu(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var a=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var h={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};c===null?a=c=h:c=c.next=h,n=n.next}while(n!==null);c===null?a=c=t:c=c.next=t}else a=c=t;n={baseState:i.baseState,firstBaseUpdate:a,lastBaseUpdate:c,shared:i.shared,effects:i.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function wo(e,t,n,i){var a=e.updateQueue;Zt=!1;var c=a.firstBaseUpdate,h=a.lastBaseUpdate,m=a.shared.pending;if(m!==null){a.shared.pending=null;var k=m,F=k.next;k.next=null,h===null?c=F:h.next=F,h=k;var D=e.alternate;D!==null&&(D=D.updateQueue,m=D.lastBaseUpdate,m!==h&&(m===null?D.firstBaseUpdate=F:m.next=F,D.lastBaseUpdate=k))}if(c!==null){var A=a.baseState;h=0,D=F=k=null,m=c;do{var B=m.lane,q=m.eventTime;if((i&B)===B){D!==null&&(D=D.next={eventTime:q,lane:0,tag:m.tag,payload:m.payload,callback:m.callback,next:null});e:{var ne=e,re=m;switch(B=t,q=n,re.tag){case 1:if(ne=re.payload,typeof ne=="function"){A=ne.call(q,A,B);break e}A=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=re.payload,B=typeof ne=="function"?ne.call(q,A,B):ne,B==null)break e;A=X({},A,B);break e;case 2:Zt=!0}}m.callback!==null&&m.lane!==0&&(e.flags|=64,B=a.effects,B===null?a.effects=[m]:B.push(m))}else q={eventTime:q,lane:B,tag:m.tag,payload:m.payload,callback:m.callback,next:null},D===null?(F=D=q,k=A):D=D.next=q,h|=B;if(m=m.next,m===null){if(m=a.shared.pending,m===null)break;B=m,m=B.next,B.next=null,a.lastBaseUpdate=B,a.shared.pending=null}}while(!0);if(D===null&&(k=A),a.baseState=k,a.firstBaseUpdate=F,a.lastBaseUpdate=D,t=a.shared.interleaved,t!==null){a=t;do h|=a.lane,a=a.next;while(a!==t)}else c===null&&(a.shared.lanes=0);mn|=h,e.lanes=h,e.memoizedState=A}}function lu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!="function")throw Error(u(191,a));a.call(i)}}}var Cr={},_t=Kt(Cr),Tr=Kt(Cr),Pr=Kt(Cr);function xn(e){if(e===Cr)throw Error(u(174));return e}function pl(e,t){switch(_e(Pr,t),_e(Tr,e),_e(_t,Cr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fi(t,e)}ze(_t),_e(_t,t)}function Un(){ze(_t),ze(Tr),ze(Pr)}function su(e){xn(Pr.current);var t=xn(_t.current),n=fi(t,e.type);t!==n&&(_e(Tr,e),_e(_t,n))}function fl(e){Tr.current===e&&(ze(_t),ze(Tr))}var Ie=Kt(0);function jo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 gl=[];function hl(){for(var e=0;e<gl.length;e++)gl[e]._workInProgressVersionPrimary=null;gl.length=0}var Co=W.ReactCurrentDispatcher,xl=W.ReactCurrentBatchConfig,yn=0,$e=null,Ae=null,Ue=null,To=!1,_r=!1,Lr=0,Yp=0;function Ge(){throw Error(u(321))}function yl(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 ml(e,t,n,i,a,c){if(yn=c,$e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Co.current=e===null||e.memoizedState===null?Xp:Zp,e=n(i,a),_r){c=0;do{if(_r=!1,Lr=0,25<=c)throw Error(u(301));c+=1,Ue=Ae=null,t.updateQueue=null,Co.current=qp,e=n(i,a)}while(_r)}if(Co.current=Lo,t=Ae!==null&&Ae.next!==null,yn=0,Ue=Ae=$e=null,To=!1,t)throw Error(u(300));return e}function vl(){var e=Lr!==0;return Lr=0,e}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ue===null?$e.memoizedState=Ue=e:Ue=Ue.next=e,Ue}function ht(){if(Ae===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=Ae.next;var t=Ue===null?$e.memoizedState:Ue.next;if(t!==null)Ue=t,Ae=e;else{if(e===null)throw Error(u(310));Ae=e,e={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},Ue===null?$e.memoizedState=Ue=e:Ue=Ue.next=e}return Ue}function zr(e,t){return typeof t=="function"?t(e):t}function Sl(e){var t=ht(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var i=Ae,a=i.baseQueue,c=n.pending;if(c!==null){if(a!==null){var h=a.next;a.next=c.next,c.next=h}i.baseQueue=a=c,n.pending=null}if(a!==null){c=a.next,i=i.baseState;var m=h=null,k=null,F=c;do{var D=F.lane;if((yn&D)===D)k!==null&&(k=k.next={lane:0,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),i=F.hasEagerState?F.eagerState:e(i,F.action);else{var A={lane:D,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null};k===null?(m=k=A,h=i):k=k.next=A,$e.lanes|=D,mn|=D}F=F.next}while(F!==null&&F!==c);k===null?h=i:k.next=m,vt(i,t.memoizedState)||(ot=!0),t.memoizedState=i,t.baseState=h,t.baseQueue=k,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do c=a.lane,$e.lanes|=c,mn|=c,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function bl(e){var t=ht(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,c=t.memoizedState;if(a!==null){n.pending=null;var h=a=a.next;do c=e(c,h.action),h=h.next;while(h!==a);vt(c,t.memoizedState)||(ot=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,i]}function au(){}function uu(e,t){var n=$e,i=ht(),a=t(),c=!vt(i.memoizedState,a);if(c&&(i.memoizedState=a,ot=!0),i=i.queue,kl(pu.bind(null,n,i,e),[e]),i.getSnapshot!==t||c||Ue!==null&&Ue.memoizedState.tag&1){if(n.flags|=2048,Er(9,du.bind(null,n,i,a,t),void 0,null),Ve===null)throw Error(u(349));(yn&30)!==0||cu(n,t,a)}return a}function cu(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$e.updateQueue,t===null?(t={lastEffect:null,stores:null},$e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function du(e,t,n,i){t.value=n,t.getSnapshot=i,fu(t)&&gu(e)}function pu(e,t,n){return n(function(){fu(t)&&gu(e)})}function fu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vt(e,n)}catch{return!0}}function gu(e){var t=Nt(e,1);t!==null&&jt(t,e,1,-1)}function hu(e){var t=Lt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:zr,lastRenderedState:e},t.queue=e,e=e.dispatch=Gp.bind(null,$e,e),[t.memoizedState,e]}function Er(e,t,n,i){return e={tag:e,create:t,destroy:n,deps:i,next:null},t=$e.updateQueue,t===null?(t={lastEffect:null,stores:null},$e.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e)),e}function xu(){return ht().memoizedState}function Po(e,t,n,i){var a=Lt();$e.flags|=e,a.memoizedState=Er(1|t,n,void 0,i===void 0?null:i)}function _o(e,t,n,i){var a=ht();i=i===void 0?null:i;var c=void 0;if(Ae!==null){var h=Ae.memoizedState;if(c=h.destroy,i!==null&&yl(i,h.deps)){a.memoizedState=Er(t,n,c,i);return}}$e.flags|=e,a.memoizedState=Er(1|t,n,c,i)}function yu(e,t){return Po(8390656,8,e,t)}function kl(e,t){return _o(2048,8,e,t)}function mu(e,t){return _o(4,2,e,t)}function vu(e,t){return _o(4,4,e,t)}function Su(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function bu(e,t,n){return n=n!=null?n.concat([e]):null,_o(4,4,Su.bind(null,t,e),n)}function wl(){}function ku(e,t){var n=ht();t=t===void 0?null:t;var i=n.memoizedState;return i!==null&&t!==null&&yl(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function wu(e,t){var n=ht();t=t===void 0?null:t;var i=n.memoizedState;return i!==null&&t!==null&&yl(t,i[1])?i[0]:(e=e(),n.memoizedState=[e,t],e)}function ju(e,t,n){return(yn&21)===0?(e.baseState&&(e.baseState=!1,ot=!0),e.memoizedState=n):(vt(n,t)||(n=ea(),$e.lanes|=n,mn|=n,e.baseState=!0),t)}function Jp(e,t){var n=Ce;Ce=n!==0&&4>n?n:4,e(!0);var i=xl.transition;xl.transition={};try{e(!1),t()}finally{Ce=n,xl.transition=i}}function Cu(){return ht().memoizedState}function Kp(e,t,n){var i=rn(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},Tu(e))Pu(t,n);else if(n=ru(e,t,n,i),n!==null){var a=et();jt(n,e,i,a),_u(n,t,i)}}function Gp(e,t,n){var i=rn(e),a={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(Tu(e))Pu(t,a);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,m=c(h,n);if(a.hasEagerState=!0,a.eagerState=m,vt(m,h)){var k=t.interleaved;k===null?(a.next=a,cl(t)):(a.next=k.next,k.next=a),t.interleaved=a;return}}catch{}n=ru(e,t,a,i),n!==null&&(a=et(),jt(n,e,i,a),_u(n,t,i))}}function Tu(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function Pu(e,t){_r=To=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _u(e,t,n){if((n&4194240)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Ci(e,n)}}var Lo={readContext:gt,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useInsertionEffect:Ge,useLayoutEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useMutableSource:Ge,useSyncExternalStore:Ge,useId:Ge,unstable_isNewReconciler:!1},Xp={readContext:gt,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:yu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Po(4194308,4,Su.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Po(4194308,4,e,t)},useInsertionEffect:function(e,t){return Po(4,2,e,t)},useMemo:function(e,t){var n=Lt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=Lt();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Kp.bind(null,$e,e),[i.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:hu,useDebugValue:wl,useDeferredValue:function(e){return Lt().memoizedState=e},useTransition:function(){var e=hu(!1),t=e[0];return e=Jp.bind(null,e[1]),Lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=$e,a=Lt();if(Me){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Ve===null)throw Error(u(349));(yn&30)!==0||cu(i,t,n)}a.memoizedState=n;var c={value:n,getSnapshot:t};return a.queue=c,yu(pu.bind(null,i,c,e),[e]),i.flags|=2048,Er(9,du.bind(null,i,c,n,t),void 0,null),n},useId:function(){var e=Lt(),t=Ve.identifierPrefix;if(Me){var n=$t,i=It;n=(i&~(1<<32-mt(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=Lr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Yp++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Zp={readContext:gt,useCallback:ku,useContext:gt,useEffect:kl,useImperativeHandle:bu,useInsertionEffect:mu,useLayoutEffect:vu,useMemo:wu,useReducer:Sl,useRef:xu,useState:function(){return Sl(zr)},useDebugValue:wl,useDeferredValue:function(e){var t=ht();return ju(t,Ae.memoizedState,e)},useTransition:function(){var e=Sl(zr)[0],t=ht().memoizedState;return[e,t]},useMutableSource:au,useSyncExternalStore:uu,useId:Cu,unstable_isNewReconciler:!1},qp={readContext:gt,useCallback:ku,useContext:gt,useEffect:kl,useImperativeHandle:bu,useInsertionEffect:mu,useLayoutEffect:vu,useMemo:wu,useReducer:bl,useRef:xu,useState:function(){return bl(zr)},useDebugValue:wl,useDeferredValue:function(e){var t=ht();return Ae===null?t.memoizedState=e:ju(t,Ae.memoizedState,e)},useTransition:function(){var e=bl(zr)[0],t=ht().memoizedState;return[e,t]},useMutableSource:au,useSyncExternalStore:uu,useId:Cu,unstable_isNewReconciler:!1};function bt(e,t){if(e&&e.defaultProps){t=X({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function jl(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:X({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zo={isMounted:function(e){return(e=e._reactInternals)?cn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var i=et(),a=rn(e),c=Ot(i,a);c.payload=t,n!=null&&(c.callback=n),t=qt(e,c,a),t!==null&&(jt(t,e,a,i),ko(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=et(),a=rn(e),c=Ot(i,a);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=qt(e,c,a),t!==null&&(jt(t,e,a,i),ko(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=et(),i=rn(e),a=Ot(n,i);a.tag=2,t!=null&&(a.callback=t),t=qt(e,a,i),t!==null&&(jt(t,e,i,n),ko(t,e,i))}};function Lu(e,t,n,i,a,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,c,h):t.prototype&&t.prototype.isPureReactComponent?!yr(n,i)||!yr(a,c):!0}function zu(e,t,n){var i=!1,a=Gt,c=t.contextType;return typeof c=="object"&&c!==null?c=gt(c):(a=rt(t)?pn:Ke.current,i=t.contextTypes,c=(i=i!=null)?Nn(e,a):Gt),t=new t(n,c),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=zo,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=c),t}function Eu(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&zo.enqueueReplaceState(t,t.state,null)}function Cl(e,t,n,i){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},dl(e);var c=t.contextType;typeof c=="object"&&c!==null?a.context=gt(c):(c=rt(t)?pn:Ke.current,a.context=Nn(e,c)),a.state=e.memoizedState,c=t.getDerivedStateFromProps,typeof c=="function"&&(jl(e,t,c,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&zo.enqueueReplaceState(a,a.state,null),wo(e,n,a,i),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Vn(e,t){try{var n="",i=t;do n+=pe(i),i=i.return;while(i);var a=n}catch(c){a=`
7
7
  Error generating stack: `+c.message+`
8
- `+c.stack}return{value:e,source:t,stack:a,digest:null}}function Cl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Tl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ef=typeof WeakMap=="function"?WeakMap:Map;function Ru(e,t,n){n=Ot(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){No||(No=!0,Wl=i),Tl(e,t)},n}function Mu(e,t,n){n=Ot(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var a=t.value;n.payload=function(){return i(a)},n.callback=function(){Tl(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(n.callback=function(){Tl(e,t),typeof i!="function"&&(tn===null?tn=new Set([this]):tn.add(this));var h=t.stack;this.componentDidCatch(t.value,{componentStack:h!==null?h:""})}),n}function Fu(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new ef;var a=new Set;i.set(t,a)}else a=i.get(t),a===void 0&&(a=new Set,i.set(t,a));a.has(n)||(a.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function Iu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function $u(e,t,n,i,a){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ot(-1,1),t.tag=2,qt(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}var tf=W.ReactCurrentOwner,ot=!1;function qe(e,t,n,i){t.child=e===null?nu(t,null,n,i):Wn(t,e.child,n,i)}function Nu(e,t,n,i,a){n=n.render;var c=t.ref;return Hn(t,a),i=yl(e,t,n,i,c,a),n=ml(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Bt(e,t,a)):(Me&&n&&el(t),t.flags|=1,qe(e,t,i,a),t.child)}function Ou(e,t,n,i,a){if(e===null){var c=n.type;return typeof c=="function"&&!Jl(c)&&c.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=c,Bu(e,t,c,i,a)):(e=Ho(n.type,null,i,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&a)===0){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:yr,n(h,i)&&e.ref===t.ref)return Bt(e,t,a)}return t.flags|=1,e=ln(c,i),e.ref=t.ref,e.return=t,t.child=e}function Bu(e,t,n,i,a){if(e!==null){var c=e.memoizedProps;if(yr(c,i)&&e.ref===t.ref)if(ot=!1,t.pendingProps=i=c,(e.lanes&a)!==0)(e.flags&131072)!==0&&(ot=!0);else return t.lanes=e.lanes,Bt(e,t,a)}return Pl(e,t,n,i,a)}function Du(e,t,n){var i=t.pendingProps,a=i.children,c=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_e(Yn,dt),dt|=n;else{if((n&1073741824)===0)return e=c!==null?c.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,_e(Yn,dt),dt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=c!==null?c.baseLanes:n,_e(Yn,dt),dt|=i}else c!==null?(i=c.baseLanes|n,t.memoizedState=null):i=n,_e(Yn,dt),dt|=i;return qe(e,t,a,n),t.child}function Wu(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Pl(e,t,n,i,a){var c=rt(n)?pn:Ke.current;return c=Nn(t,c),Hn(t,a),n=yl(e,t,n,i,c,a),i=ml(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Bt(e,t,a)):(Me&&i&&el(t),t.flags|=1,qe(e,t,n,a),t.child)}function Au(e,t,n,i,a){if(rt(n)){var c=!0;go(t)}else c=!1;if(Hn(t,a),t.stateNode===null)Ro(e,t),zu(t,n,i),jl(t,n,i,a),i=!0;else if(e===null){var h=t.stateNode,m=t.memoizedProps;h.props=m;var k=h.context,F=n.contextType;typeof F=="object"&&F!==null?F=gt(F):(F=rt(n)?pn:Ke.current,F=Nn(t,F));var D=n.getDerivedStateFromProps,A=typeof D=="function"||typeof h.getSnapshotBeforeUpdate=="function";A||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(m!==i||k!==F)&&Eu(t,h,i,F),Zt=!1;var B=t.memoizedState;h.state=B,wo(t,i,h,a),k=t.memoizedState,m!==i||B!==k||nt.current||Zt?(typeof D=="function"&&(wl(t,n,D,i),k=t.memoizedState),(m=Zt||Lu(t,n,m,i,B,k,F))?(A||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=k),h.props=i,h.state=k,h.context=F,i=m):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{h=t.stateNode,ou(e,t),m=t.memoizedProps,F=t.type===t.elementType?m:bt(t.type,m),h.props=F,A=t.pendingProps,B=h.context,k=n.contextType,typeof k=="object"&&k!==null?k=gt(k):(k=rt(n)?pn:Ke.current,k=Nn(t,k));var q=n.getDerivedStateFromProps;(D=typeof q=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(m!==A||B!==k)&&Eu(t,h,i,k),Zt=!1,B=t.memoizedState,h.state=B,wo(t,i,h,a);var ne=t.memoizedState;m!==A||B!==ne||nt.current||Zt?(typeof q=="function"&&(wl(t,n,q,i),ne=t.memoizedState),(F=Zt||Lu(t,n,F,i,B,ne,k)||!1)?(D||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(i,ne,k),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(i,ne,k)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||m===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ne),h.props=i,h.state=ne,h.context=k,i=F):(typeof h.componentDidUpdate!="function"||m===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),i=!1)}return _l(e,t,n,i,c,a)}function _l(e,t,n,i,a,c){Wu(e,t);var h=(t.flags&128)!==0;if(!i&&!h)return a&&Ya(t,n,!1),Bt(e,t,c);i=t.stateNode,tf.current=t;var m=h&&typeof n.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&h?(t.child=Wn(t,e.child,null,c),t.child=Wn(t,null,m,c)):qe(e,t,m,c),t.memoizedState=i.state,a&&Ya(t,n,!0),t.child}function Hu(e){var t=e.stateNode;t.pendingContext?Va(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Va(e,t.context,!1),dl(e,t.containerInfo)}function Uu(e,t,n,i,a){return Dn(),ol(a),t.flags|=256,qe(e,t,n,i),t.child}var Ll={dehydrated:null,treeContext:null,retryLane:0};function zl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Vu(e,t,n){var i=t.pendingProps,a=Ie.current,c=!1,h=(t.flags&128)!==0,m;if((m=h)||(m=e!==null&&e.memoizedState===null?!1:(a&2)!==0),m?(c=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),_e(Ie,a&1),e===null)return rl(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(h=i.children,e=i.fallback,c?(i=t.mode,c=t.child,h={mode:"hidden",children:h},(i&1)===0&&c!==null?(c.childLanes=0,c.pendingProps=h):c=Uo(h,i,0,null),e=kn(e,i,n,null),c.return=t,e.return=t,c.sibling=e,t.child=c,t.child.memoizedState=zl(n),t.memoizedState=Ll,e):El(t,h));if(a=e.memoizedState,a!==null&&(m=a.dehydrated,m!==null))return nf(e,t,h,i,m,a,n);if(c){c=i.fallback,h=t.mode,a=e.child,m=a.sibling;var k={mode:"hidden",children:i.children};return(h&1)===0&&t.child!==a?(i=t.child,i.childLanes=0,i.pendingProps=k,t.deletions=null):(i=ln(a,k),i.subtreeFlags=a.subtreeFlags&14680064),m!==null?c=ln(m,c):(c=kn(c,h,n,null),c.flags|=2),c.return=t,i.return=t,i.sibling=c,t.child=i,i=c,c=t.child,h=e.child.memoizedState,h=h===null?zl(n):{baseLanes:h.baseLanes|n,cachePool:null,transitions:h.transitions},c.memoizedState=h,c.childLanes=e.childLanes&~n,t.memoizedState=Ll,i}return c=e.child,e=c.sibling,i=ln(c,{mode:"visible",children:i.children}),(t.mode&1)===0&&(i.lanes=n),i.return=t,i.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function El(e,t){return t=Uo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Eo(e,t,n,i){return i!==null&&ol(i),Wn(t,e.child,null,n),e=El(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nf(e,t,n,i,a,c,h){if(n)return t.flags&256?(t.flags&=-257,i=Cl(Error(u(422))),Eo(e,t,h,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(c=i.fallback,a=t.mode,i=Uo({mode:"visible",children:i.children},a,0,null),c=kn(c,a,h,null),c.flags|=2,i.return=t,c.return=t,i.sibling=c,t.child=i,(t.mode&1)!==0&&Wn(t,e.child,null,h),t.child.memoizedState=zl(h),t.memoizedState=Ll,c);if((t.mode&1)===0)return Eo(e,t,h,null);if(a.data==="$!"){if(i=a.nextSibling&&a.nextSibling.dataset,i)var m=i.dgst;return i=m,c=Error(u(419)),i=Cl(c,i,void 0),Eo(e,t,h,i)}if(m=(h&e.childLanes)!==0,ot||m){if(i=Ve,i!==null){switch(h&-h){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|h))!==0?0:a,a!==0&&a!==c.retryLane&&(c.retryLane=a,Nt(e,a),jt(i,e,a,-1))}return Yl(),i=Cl(Error(u(421))),Eo(e,t,h,i)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=xf.bind(null,e),a._reactRetry=t,null):(e=c.treeContext,ct=Jt(a.nextSibling),ut=t,Me=!0,St=null,e!==null&&(pt[ft++]=It,pt[ft++]=$t,pt[ft++]=fn,It=e.id,$t=e.overflow,fn=t),t=El(t,i.children),t.flags|=4096,t)}function Qu(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),al(e.return,t,n)}function Rl(e,t,n,i,a){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:a}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=i,c.tail=n,c.tailMode=a)}function Yu(e,t,n){var i=t.pendingProps,a=i.revealOrder,c=i.tail;if(qe(e,t,i.children,n),i=Ie.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qu(e,n,t);else if(e.tag===19)Qu(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}i&=1}if(_e(Ie,i),(t.mode&1)===0)t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&jo(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Rl(t,!1,a,n,c);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&jo(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Rl(t,!0,n,null,c);break;case"together":Rl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ro(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Bt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mn|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=ln(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ln(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function rf(e,t,n){switch(t.tag){case 3:Hu(t),Dn();break;case 5:su(t);break;case 1:rt(t.type)&&go(t);break;case 4:dl(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,a=t.memoizedProps.value;_e(So,i._currentValue),i._currentValue=a;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(_e(Ie,Ie.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Vu(e,t,n):(_e(Ie,Ie.current&1),e=Bt(e,t,n),e!==null?e.sibling:null);_e(Ie,Ie.current&1);break;case 19:if(i=(n&t.childLanes)!==0,(e.flags&128)!==0){if(i)return Yu(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),_e(Ie,Ie.current),i)break;return null;case 22:case 23:return t.lanes=0,Du(e,t,n)}return Bt(e,t,n)}var Ju,Ml,Ku,Gu;Ju=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ml=function(){},Ku=function(e,t,n,i){var a=e.memoizedProps;if(a!==i){e=t.stateNode,xn(_t.current);var c=null;switch(n){case"input":a=ai(e,a),i=ai(e,i),c=[];break;case"select":a=X({},a,{value:void 0}),i=X({},i,{value:void 0}),c=[];break;case"textarea":a=di(e,a),i=di(e,i),c=[];break;default:typeof a.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=co)}fi(n,i);var h;n=null;for(F in a)if(!i.hasOwnProperty(F)&&a.hasOwnProperty(F)&&a[F]!=null)if(F==="style"){var m=a[F];for(h in m)m.hasOwnProperty(h)&&(n||(n={}),n[h]="")}else F!=="dangerouslySetInnerHTML"&&F!=="children"&&F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&F!=="autoFocus"&&(d.hasOwnProperty(F)?c||(c=[]):(c=c||[]).push(F,null));for(F in i){var k=i[F];if(m=a?.[F],i.hasOwnProperty(F)&&k!==m&&(k!=null||m!=null))if(F==="style")if(m){for(h in m)!m.hasOwnProperty(h)||k&&k.hasOwnProperty(h)||(n||(n={}),n[h]="");for(h in k)k.hasOwnProperty(h)&&m[h]!==k[h]&&(n||(n={}),n[h]=k[h])}else n||(c||(c=[]),c.push(F,n)),n=k;else F==="dangerouslySetInnerHTML"?(k=k?k.__html:void 0,m=m?m.__html:void 0,k!=null&&m!==k&&(c=c||[]).push(F,k)):F==="children"?typeof k!="string"&&typeof k!="number"||(c=c||[]).push(F,""+k):F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&(d.hasOwnProperty(F)?(k!=null&&F==="onScroll"&&Le("scroll",e),c||m===k||(c=[])):(c=c||[]).push(F,k))}n&&(c=c||[]).push("style",n);var F=c;(t.updateQueue=F)&&(t.flags|=4)}},Gu=function(e,t,n,i){n!==i&&(t.flags|=4)};function Rr(e,t){if(!Me)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 i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,i|=a.subtreeFlags&14680064,i|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,i|=a.subtreeFlags,i|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function of(e,t,n){var i=t.pendingProps;switch(tl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return rt(t.type)&&fo(),Xe(t),null;case 3:return i=t.stateNode,Un(),ze(nt),ze(Ke),gl(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(mo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,St!==null&&(Ul(St),St=null))),Ml(e,t),Xe(t),null;case 5:pl(t);var a=xn(Pr.current);if(n=t.type,e!==null&&t.stateNode!=null)Ku(e,t,n,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(u(166));return Xe(t),null}if(e=xn(_t.current),mo(t)){i=t.stateNode,n=t.type;var c=t.memoizedProps;switch(i[Pt]=t,i[kr]=c,e=(t.mode&1)!==0,n){case"dialog":Le("cancel",i),Le("close",i);break;case"iframe":case"object":case"embed":Le("load",i);break;case"video":case"audio":for(a=0;a<vr.length;a++)Le(vr[a],i);break;case"source":Le("error",i);break;case"img":case"image":case"link":Le("error",i),Le("load",i);break;case"details":Le("toggle",i);break;case"input":zs(i,c),Le("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!c.multiple},Le("invalid",i);break;case"textarea":Ms(i,c),Le("invalid",i)}fi(n,c),a=null;for(var h in c)if(c.hasOwnProperty(h)){var m=c[h];h==="children"?typeof m=="string"?i.textContent!==m&&(c.suppressHydrationWarning!==!0&&uo(i.textContent,m,e),a=["children",m]):typeof m=="number"&&i.textContent!==""+m&&(c.suppressHydrationWarning!==!0&&uo(i.textContent,m,e),a=["children",""+m]):d.hasOwnProperty(h)&&m!=null&&h==="onScroll"&&Le("scroll",i)}switch(n){case"input":Fe(i),Rs(i,c,!0);break;case"textarea":Fe(i),Is(i);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(i.onclick=co)}i=a,t.updateQueue=i,i!==null&&(t.flags|=4)}else{h=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=$s(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=h.createElement(n,{is:i.is}):(e=h.createElement(n),n==="select"&&(h=e,i.multiple?h.multiple=!0:i.size&&(h.size=i.size))):e=h.createElementNS(e,n),e[Pt]=t,e[kr]=i,Ju(e,t,!1,!1),t.stateNode=e;e:{switch(h=gi(n,i),n){case"dialog":Le("cancel",e),Le("close",e),a=i;break;case"iframe":case"object":case"embed":Le("load",e),a=i;break;case"video":case"audio":for(a=0;a<vr.length;a++)Le(vr[a],e);a=i;break;case"source":Le("error",e),a=i;break;case"img":case"image":case"link":Le("error",e),Le("load",e),a=i;break;case"details":Le("toggle",e),a=i;break;case"input":zs(e,i),a=ai(e,i),Le("invalid",e);break;case"option":a=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},a=X({},i,{value:void 0}),Le("invalid",e);break;case"textarea":Ms(e,i),a=di(e,i),Le("invalid",e);break;default:a=i}fi(n,a),m=a;for(c in m)if(m.hasOwnProperty(c)){var k=m[c];c==="style"?Bs(e,k):c==="dangerouslySetInnerHTML"?(k=k?k.__html:void 0,k!=null&&Ns(e,k)):c==="children"?typeof k=="string"?(n!=="textarea"||k!=="")&&er(e,k):typeof k=="number"&&er(e,""+k):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(d.hasOwnProperty(c)?k!=null&&c==="onScroll"&&Le("scroll",e):k!=null&&U(e,c,k,h))}switch(n){case"input":Fe(e),Rs(e,i,!1);break;case"textarea":Fe(e),Is(e);break;case"option":i.value!=null&&e.setAttribute("value",""+ke(i.value));break;case"select":e.multiple=!!i.multiple,c=i.value,c!=null?Cn(e,!!i.multiple,c,!1):i.defaultValue!=null&&Cn(e,!!i.multiple,i.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=co)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Xe(t),null;case 6:if(e&&t.stateNode!=null)Gu(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(n=xn(Pr.current),xn(_t.current),mo(t)){if(i=t.stateNode,n=t.memoizedProps,i[Pt]=t,(c=i.nodeValue!==n)&&(e=ut,e!==null))switch(e.tag){case 3:uo(i.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&uo(i.nodeValue,n,(e.mode&1)!==0)}c&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Pt]=t,t.stateNode=i}return Xe(t),null;case 13:if(ze(Ie),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Me&&ct!==null&&(t.mode&1)!==0&&(t.flags&128)===0)qa(),Dn(),t.flags|=98560,c=!1;else if(c=mo(t),i!==null&&i.dehydrated!==null){if(e===null){if(!c)throw Error(u(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(u(317));c[Pt]=t}else Dn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),c=!1}else St!==null&&(Ul(St),St=null),c=!0;if(!c)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ie.current&1)!==0?He===0&&(He=3):Yl())),t.updateQueue!==null&&(t.flags|=4),Xe(t),null);case 4:return Un(),Ml(e,t),e===null&&Sr(t.stateNode.containerInfo),Xe(t),null;case 10:return sl(t.type._context),Xe(t),null;case 17:return rt(t.type)&&fo(),Xe(t),null;case 19:if(ze(Ie),c=t.memoizedState,c===null)return Xe(t),null;if(i=(t.flags&128)!==0,h=c.rendering,h===null)if(i)Rr(c,!1);else{if(He!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=jo(e),h!==null){for(t.flags|=128,Rr(c,!1),i=h.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)c=n,e=i,c.flags&=14680066,h=c.alternate,h===null?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=h.childLanes,c.lanes=h.lanes,c.child=h.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=h.memoizedProps,c.memoizedState=h.memoizedState,c.updateQueue=h.updateQueue,c.type=h.type,e=h.dependencies,c.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _e(Ie,Ie.current&1|2),t.child}e=e.sibling}c.tail!==null&&Be()>Jn&&(t.flags|=128,i=!0,Rr(c,!1),t.lanes=4194304)}else{if(!i)if(e=jo(h),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Rr(c,!0),c.tail===null&&c.tailMode==="hidden"&&!h.alternate&&!Me)return Xe(t),null}else 2*Be()-c.renderingStartTime>Jn&&n!==1073741824&&(t.flags|=128,i=!0,Rr(c,!1),t.lanes=4194304);c.isBackwards?(h.sibling=t.child,t.child=h):(n=c.last,n!==null?n.sibling=h:t.child=h,c.last=h)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Be(),t.sibling=null,n=Ie.current,_e(Ie,i?n&1|2:n&1),t):(Xe(t),null);case 22:case 23:return Ql(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(dt&1073741824)!==0&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),null;case 24:return null;case 25:return null}throw Error(u(156,t.tag))}function lf(e,t){switch(tl(t),t.tag){case 1:return rt(t.type)&&fo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Un(),ze(nt),ze(Ke),gl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return pl(t),null;case 13:if(ze(Ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Dn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ze(Ie),null;case 4:return Un(),null;case 10:return sl(t.type._context),null;case 22:case 23:return Ql(),null;case 24:return null;default:return null}}var Mo=!1,Ze=!1,sf=typeof WeakSet=="function"?WeakSet:Set,te=null;function Qn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){Oe(e,t,i)}else n.current=null}function Fl(e,t,n){try{n()}catch(i){Oe(e,t,i)}}var Xu=!1;function af(e,t){if(Qi=Zr,e=La(),Oi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,c=i.focusNode;i=i.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var h=0,m=-1,k=-1,F=0,D=0,A=e,B=null;t:for(;;){for(var q;A!==n||a!==0&&A.nodeType!==3||(m=h+a),A!==c||i!==0&&A.nodeType!==3||(k=h+i),A.nodeType===3&&(h+=A.nodeValue.length),(q=A.firstChild)!==null;)B=A,A=q;for(;;){if(A===e)break t;if(B===n&&++F===a&&(m=h),B===c&&++D===i&&(k=h),(q=A.nextSibling)!==null)break;A=B,B=A.parentNode}A=q}n=m===-1||k===-1?null:{start:m,end:k}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yi={focusedElem:e,selectionRange:n},Zr=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var ne=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ne!==null){var re=ne.memoizedProps,De=ne.memoizedState,E=t.stateNode,C=E.getSnapshotBeforeUpdate(t.elementType===t.type?re:bt(t.type,re),De);E.__reactInternalSnapshotBeforeUpdate=C}break;case 3:var M=t.stateNode.containerInfo;M.nodeType===1?M.textContent="":M.nodeType===9&&M.documentElement&&M.removeChild(M.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(Q){Oe(t,t.return,Q)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return ne=Xu,Xu=!1,ne}function Mr(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var a=i=i.next;do{if((a.tag&e)===e){var c=a.destroy;a.destroy=void 0,c!==void 0&&Fl(t,n,c)}a=a.next}while(a!==i)}}function Fo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function Il(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Zu(e){var t=e.alternate;t!==null&&(e.alternate=null,Zu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Pt],delete t[kr],delete t[Xi],delete t[Hp],delete t[Up])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function qu(e){return e.tag===5||e.tag===3||e.tag===4}function ec(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qu(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.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 $l(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=co));else if(i!==4&&(e=e.child,e!==null))for($l(e,t,n),e=e.sibling;e!==null;)$l(e,t,n),e=e.sibling}function Nl(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Nl(e,t,n),e=e.sibling;e!==null;)Nl(e,t,n),e=e.sibling}var Ye=null,kt=!1;function en(e,t,n){for(n=n.child;n!==null;)tc(e,t,n),n=n.sibling}function tc(e,t,n){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Qr,n)}catch{}switch(n.tag){case 5:Ze||Qn(n,t);case 6:var i=Ye,a=kt;Ye=null,en(e,t,n),Ye=i,kt=a,Ye!==null&&(kt?(e=Ye,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ye.removeChild(n.stateNode));break;case 18:Ye!==null&&(kt?(e=Ye,n=n.stateNode,e.nodeType===8?Gi(e.parentNode,n):e.nodeType===1&&Gi(e,n),dr(e)):Gi(Ye,n.stateNode));break;case 4:i=Ye,a=kt,Ye=n.stateNode.containerInfo,kt=!0,en(e,t,n),Ye=i,kt=a;break;case 0:case 11:case 14:case 15:if(!Ze&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){a=i=i.next;do{var c=a,h=c.destroy;c=c.tag,h!==void 0&&((c&2)!==0||(c&4)!==0)&&Fl(n,t,h),a=a.next}while(a!==i)}en(e,t,n);break;case 1:if(!Ze&&(Qn(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(m){Oe(n,t,m)}en(e,t,n);break;case 21:en(e,t,n);break;case 22:n.mode&1?(Ze=(i=Ze)||n.memoizedState!==null,en(e,t,n),Ze=i):en(e,t,n);break;default:en(e,t,n)}}function nc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new sf),t.forEach(function(i){var a=yf.bind(null,e,i);n.has(i)||(n.add(i),i.then(a,a))})}}function wt(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var c=e,h=t,m=h;e:for(;m!==null;){switch(m.tag){case 5:Ye=m.stateNode,kt=!1;break e;case 3:Ye=m.stateNode.containerInfo,kt=!0;break e;case 4:Ye=m.stateNode.containerInfo,kt=!0;break e}m=m.return}if(Ye===null)throw Error(u(160));tc(c,h,a),Ye=null,kt=!1;var k=a.alternate;k!==null&&(k.return=null),a.return=null}catch(F){Oe(a,t,F)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)rc(t,e),t=t.sibling}function rc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(wt(t,e),zt(e),i&4){try{Mr(3,e,e.return),Fo(3,e)}catch(re){Oe(e,e.return,re)}try{Mr(5,e,e.return)}catch(re){Oe(e,e.return,re)}}break;case 1:wt(t,e),zt(e),i&512&&n!==null&&Qn(n,n.return);break;case 5:if(wt(t,e),zt(e),i&512&&n!==null&&Qn(n,n.return),e.flags&32){var a=e.stateNode;try{er(a,"")}catch(re){Oe(e,e.return,re)}}if(i&4&&(a=e.stateNode,a!=null)){var c=e.memoizedProps,h=n!==null?n.memoizedProps:c,m=e.type,k=e.updateQueue;if(e.updateQueue=null,k!==null)try{m==="input"&&c.type==="radio"&&c.name!=null&&Es(a,c),gi(m,h);var F=gi(m,c);for(h=0;h<k.length;h+=2){var D=k[h],A=k[h+1];D==="style"?Bs(a,A):D==="dangerouslySetInnerHTML"?Ns(a,A):D==="children"?er(a,A):U(a,D,A,F)}switch(m){case"input":ui(a,c);break;case"textarea":Fs(a,c);break;case"select":var B=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!c.multiple;var q=c.value;q!=null?Cn(a,!!c.multiple,q,!1):B!==!!c.multiple&&(c.defaultValue!=null?Cn(a,!!c.multiple,c.defaultValue,!0):Cn(a,!!c.multiple,c.multiple?[]:"",!1))}a[kr]=c}catch(re){Oe(e,e.return,re)}}break;case 6:if(wt(t,e),zt(e),i&4){if(e.stateNode===null)throw Error(u(162));a=e.stateNode,c=e.memoizedProps;try{a.nodeValue=c}catch(re){Oe(e,e.return,re)}}break;case 3:if(wt(t,e),zt(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{dr(t.containerInfo)}catch(re){Oe(e,e.return,re)}break;case 4:wt(t,e),zt(e);break;case 13:wt(t,e),zt(e),a=e.child,a.flags&8192&&(c=a.memoizedState!==null,a.stateNode.isHidden=c,!c||a.alternate!==null&&a.alternate.memoizedState!==null||(Dl=Be())),i&4&&nc(e);break;case 22:if(D=n!==null&&n.memoizedState!==null,e.mode&1?(Ze=(F=Ze)||D,wt(t,e),Ze=F):wt(t,e),zt(e),i&8192){if(F=e.memoizedState!==null,(e.stateNode.isHidden=F)&&!D&&(e.mode&1)!==0)for(te=e,D=e.child;D!==null;){for(A=te=D;te!==null;){switch(B=te,q=B.child,B.tag){case 0:case 11:case 14:case 15:Mr(4,B,B.return);break;case 1:Qn(B,B.return);var ne=B.stateNode;if(typeof ne.componentWillUnmount=="function"){i=B,n=B.return;try{t=i,ne.props=t.memoizedProps,ne.state=t.memoizedState,ne.componentWillUnmount()}catch(re){Oe(i,n,re)}}break;case 5:Qn(B,B.return);break;case 22:if(B.memoizedState!==null){lc(A);continue}}q!==null?(q.return=B,te=q):lc(A)}D=D.sibling}e:for(D=null,A=e;;){if(A.tag===5){if(D===null){D=A;try{a=A.stateNode,F?(c=a.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(m=A.stateNode,k=A.memoizedProps.style,h=k!=null&&k.hasOwnProperty("display")?k.display:null,m.style.display=Os("display",h))}catch(re){Oe(e,e.return,re)}}}else if(A.tag===6){if(D===null)try{A.stateNode.nodeValue=F?"":A.memoizedProps}catch(re){Oe(e,e.return,re)}}else if((A.tag!==22&&A.tag!==23||A.memoizedState===null||A===e)&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===e)break e;for(;A.sibling===null;){if(A.return===null||A.return===e)break e;D===A&&(D=null),A=A.return}D===A&&(D=null),A.sibling.return=A.return,A=A.sibling}}break;case 19:wt(t,e),zt(e),i&4&&nc(e);break;case 21:break;default:wt(t,e),zt(e)}}function zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(qu(n)){var i=n;break e}n=n.return}throw Error(u(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(er(a,""),i.flags&=-33);var c=ec(e);Nl(e,c,a);break;case 3:case 4:var h=i.stateNode.containerInfo,m=ec(e);$l(e,m,h);break;default:throw Error(u(161))}}catch(k){Oe(e,e.return,k)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function uf(e,t,n){te=e,oc(e)}function oc(e,t,n){for(var i=(e.mode&1)!==0;te!==null;){var a=te,c=a.child;if(a.tag===22&&i){var h=a.memoizedState!==null||Mo;if(!h){var m=a.alternate,k=m!==null&&m.memoizedState!==null||Ze;m=Mo;var F=Ze;if(Mo=h,(Ze=k)&&!F)for(te=a;te!==null;)h=te,k=h.child,h.tag===22&&h.memoizedState!==null?sc(a):k!==null?(k.return=h,te=k):sc(a);for(;c!==null;)te=c,oc(c),c=c.sibling;te=a,Mo=m,Ze=F}ic(e)}else(a.subtreeFlags&8772)!==0&&c!==null?(c.return=a,te=c):ic(e)}}function ic(e){for(;te!==null;){var t=te;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Ze||Fo(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ze)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:bt(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var c=t.updateQueue;c!==null&&lu(t,c,i);break;case 3:var h=t.updateQueue;if(h!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}lu(t,h,n)}break;case 5:var m=t.stateNode;if(n===null&&t.flags&4){n=m;var k=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":k.autoFocus&&n.focus();break;case"img":k.src&&(n.src=k.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var F=t.alternate;if(F!==null){var D=F.memoizedState;if(D!==null){var A=D.dehydrated;A!==null&&dr(A)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(u(163))}Ze||t.flags&512&&Il(t)}catch(B){Oe(t,t.return,B)}}if(t===e){te=null;break}if(n=t.sibling,n!==null){n.return=t.return,te=n;break}te=t.return}}function lc(e){for(;te!==null;){var t=te;if(t===e){te=null;break}var n=t.sibling;if(n!==null){n.return=t.return,te=n;break}te=t.return}}function sc(e){for(;te!==null;){var t=te;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Fo(4,t)}catch(k){Oe(t,n,k)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var a=t.return;try{i.componentDidMount()}catch(k){Oe(t,a,k)}}var c=t.return;try{Il(t)}catch(k){Oe(t,c,k)}break;case 5:var h=t.return;try{Il(t)}catch(k){Oe(t,h,k)}}}catch(k){Oe(t,t.return,k)}if(t===e){te=null;break}var m=t.sibling;if(m!==null){m.return=t.return,te=m;break}te=t.return}}var cf=Math.ceil,Io=W.ReactCurrentDispatcher,Ol=W.ReactCurrentOwner,xt=W.ReactCurrentBatchConfig,be=0,Ve=null,We=null,Je=0,dt=0,Yn=Kt(0),He=0,Fr=null,mn=0,$o=0,Bl=0,Ir=null,it=null,Dl=0,Jn=1/0,Dt=null,No=!1,Wl=null,tn=null,Oo=!1,nn=null,Bo=0,$r=0,Al=null,Do=-1,Wo=0;function et(){return(be&6)!==0?Be():Do!==-1?Do:Do=Be()}function rn(e){return(e.mode&1)===0?1:(be&2)!==0&&Je!==0?Je&-Je:Qp.transition!==null?(Wo===0&&(Wo=ea()),Wo):(e=Ce,e!==0||(e=window.event,e=e===void 0?16:ua(e.type)),e)}function jt(e,t,n,i){if(50<$r)throw $r=0,Al=null,Error(u(185));lr(e,n,i),((be&2)===0||e!==Ve)&&(e===Ve&&((be&2)===0&&($o|=n),He===4&&on(e,Je)),lt(e,i),n===1&&be===0&&(t.mode&1)===0&&(Jn=Be()+500,ho&&Xt()))}function lt(e,t){var n=e.callbackNode;Qd(e,t);var i=Kr(e,e===Ve?Je:0);if(i===0)n!==null&&Xs(n),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(n!=null&&Xs(n),t===1)e.tag===0?Vp(uc.bind(null,e)):Ja(uc.bind(null,e)),Wp(function(){(be&6)===0&&Xt()}),n=null;else{switch(ta(i)){case 1:n=bi;break;case 4:n=Zs;break;case 16:n=Vr;break;case 536870912:n=qs;break;default:n=Vr}n=yc(n,ac.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ac(e,t){if(Do=-1,Wo=0,(be&6)!==0)throw Error(u(327));var n=e.callbackNode;if(Kn()&&e.callbackNode!==n)return null;var i=Kr(e,e===Ve?Je:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||t)t=Ao(e,i);else{t=i;var a=be;be|=2;var c=dc();(Ve!==e||Je!==t)&&(Dt=null,Jn=Be()+500,Sn(e,t));do try{ff();break}catch(m){cc(e,m)}while(!0);ll(),Io.current=c,be=a,We!==null?t=0:(Ve=null,Je=0,t=He)}if(t!==0){if(t===2&&(a=ki(e),a!==0&&(i=a,t=Hl(e,a))),t===1)throw n=Fr,Sn(e,0),on(e,i),lt(e,Be()),n;if(t===6)on(e,i);else{if(a=e.current.alternate,(i&30)===0&&!df(a)&&(t=Ao(e,i),t===2&&(c=ki(e),c!==0&&(i=c,t=Hl(e,c))),t===1))throw n=Fr,Sn(e,0),on(e,i),lt(e,Be()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(u(345));case 2:bn(e,it,Dt);break;case 3:if(on(e,i),(i&130023424)===i&&(t=Dl+500-Be(),10<t)){if(Kr(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){et(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Ki(bn.bind(null,e,it,Dt),t);break}bn(e,it,Dt);break;case 4:if(on(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var h=31-mt(i);c=1<<h,h=t[h],h>a&&(a=h),i&=~c}if(i=a,i=Be()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*cf(i/1960))-i,10<i){e.timeoutHandle=Ki(bn.bind(null,e,it,Dt),i);break}bn(e,it,Dt);break;case 5:bn(e,it,Dt);break;default:throw Error(u(329))}}}return lt(e,Be()),e.callbackNode===n?ac.bind(null,e):null}function Hl(e,t){var n=Ir;return e.current.memoizedState.isDehydrated&&(Sn(e,t).flags|=256),e=Ao(e,t),e!==2&&(t=it,it=n,t!==null&&Ul(t)),e}function Ul(e){it===null?it=e:it.push.apply(it,e)}function df(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var i=0;i<n.length;i++){var a=n[i],c=a.getSnapshot;a=a.value;try{if(!vt(c(),a))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 on(e,t){for(t&=~Bl,t&=~$o,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-mt(t),i=1<<n;e[n]=-1,t&=~i}}function uc(e){if((be&6)!==0)throw Error(u(327));Kn();var t=Kr(e,0);if((t&1)===0)return lt(e,Be()),null;var n=Ao(e,t);if(e.tag!==0&&n===2){var i=ki(e);i!==0&&(t=i,n=Hl(e,i))}if(n===1)throw n=Fr,Sn(e,0),on(e,t),lt(e,Be()),n;if(n===6)throw Error(u(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bn(e,it,Dt),lt(e,Be()),null}function Vl(e,t){var n=be;be|=1;try{return e(t)}finally{be=n,be===0&&(Jn=Be()+500,ho&&Xt())}}function vn(e){nn!==null&&nn.tag===0&&(be&6)===0&&Kn();var t=be;be|=1;var n=xt.transition,i=Ce;try{if(xt.transition=null,Ce=1,e)return e()}finally{Ce=i,xt.transition=n,be=t,(be&6)===0&&Xt()}}function Ql(){dt=Yn.current,ze(Yn)}function Sn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Dp(n)),We!==null)for(n=We.return;n!==null;){var i=n;switch(tl(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&fo();break;case 3:Un(),ze(nt),ze(Ke),gl();break;case 5:pl(i);break;case 4:Un();break;case 13:ze(Ie);break;case 19:ze(Ie);break;case 10:sl(i.type._context);break;case 22:case 23:Ql()}n=n.return}if(Ve=e,We=e=ln(e.current,null),Je=dt=t,He=0,Fr=null,Bl=$o=mn=0,it=Ir=null,hn!==null){for(t=0;t<hn.length;t++)if(n=hn[t],i=n.interleaved,i!==null){n.interleaved=null;var a=i.next,c=n.pending;if(c!==null){var h=c.next;c.next=a,i.next=h}n.pending=i}hn=null}return e}function cc(e,t){do{var n=We;try{if(ll(),Co.current=Lo,To){for(var i=$e.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}To=!1}if(yn=0,Ue=Ae=$e=null,_r=!1,Lr=0,Ol.current=null,n===null||n.return===null){He=1,Fr=t,We=null;break}e:{var c=e,h=n.return,m=n,k=t;if(t=Je,m.flags|=32768,k!==null&&typeof k=="object"&&typeof k.then=="function"){var F=k,D=m,A=D.tag;if((D.mode&1)===0&&(A===0||A===11||A===15)){var B=D.alternate;B?(D.updateQueue=B.updateQueue,D.memoizedState=B.memoizedState,D.lanes=B.lanes):(D.updateQueue=null,D.memoizedState=null)}var q=Iu(h);if(q!==null){q.flags&=-257,$u(q,h,m,c,t),q.mode&1&&Fu(c,F,t),t=q,k=F;var ne=t.updateQueue;if(ne===null){var re=new Set;re.add(k),t.updateQueue=re}else ne.add(k);break e}else{if((t&1)===0){Fu(c,F,t),Yl();break e}k=Error(u(426))}}else if(Me&&m.mode&1){var De=Iu(h);if(De!==null){(De.flags&65536)===0&&(De.flags|=256),$u(De,h,m,c,t),ol(Vn(k,m));break e}}c=k=Vn(k,m),He!==4&&(He=2),Ir===null?Ir=[c]:Ir.push(c),c=h;do{switch(c.tag){case 3:c.flags|=65536,t&=-t,c.lanes|=t;var E=Ru(c,k,t);iu(c,E);break e;case 1:m=k;var C=c.type,M=c.stateNode;if((c.flags&128)===0&&(typeof C.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&(tn===null||!tn.has(M)))){c.flags|=65536,t&=-t,c.lanes|=t;var Q=Mu(c,m,t);iu(c,Q);break e}}c=c.return}while(c!==null)}fc(n)}catch(oe){t=oe,We===n&&n!==null&&(We=n=n.return);continue}break}while(!0)}function dc(){var e=Io.current;return Io.current=Lo,e===null?Lo:e}function Yl(){(He===0||He===3||He===2)&&(He=4),Ve===null||(mn&268435455)===0&&($o&268435455)===0||on(Ve,Je)}function Ao(e,t){var n=be;be|=2;var i=dc();(Ve!==e||Je!==t)&&(Dt=null,Sn(e,t));do try{pf();break}catch(a){cc(e,a)}while(!0);if(ll(),be=n,Io.current=i,We!==null)throw Error(u(261));return Ve=null,Je=0,He}function pf(){for(;We!==null;)pc(We)}function ff(){for(;We!==null&&!Nd();)pc(We)}function pc(e){var t=xc(e.alternate,e,dt);e.memoizedProps=e.pendingProps,t===null?fc(e):We=t,Ol.current=null}function fc(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=of(n,t,dt),n!==null){We=n;return}}else{if(n=lf(n,t),n!==null){n.flags&=32767,We=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{He=6,We=null;return}}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);He===0&&(He=5)}function bn(e,t,n){var i=Ce,a=xt.transition;try{xt.transition=null,Ce=1,gf(e,t,n,i)}finally{xt.transition=a,Ce=i}return null}function gf(e,t,n,i){do Kn();while(nn!==null);if((be&6)!==0)throw Error(u(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(u(177));e.callbackNode=null,e.callbackPriority=0;var c=n.lanes|n.childLanes;if(Yd(e,c),e===Ve&&(We=Ve=null,Je=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Oo||(Oo=!0,yc(Vr,function(){return Kn(),null})),c=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||c){c=xt.transition,xt.transition=null;var h=Ce;Ce=1;var m=be;be|=4,Ol.current=null,af(e,n),rc(n,e),Mp(Yi),Zr=!!Qi,Yi=Qi=null,e.current=n,uf(n),Od(),be=m,Ce=h,xt.transition=c}else e.current=n;if(Oo&&(Oo=!1,nn=e,Bo=a),c=e.pendingLanes,c===0&&(tn=null),Wd(n.stateNode),lt(e,Be()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(No)throw No=!1,e=Wl,Wl=null,e;return(Bo&1)!==0&&e.tag!==0&&Kn(),c=e.pendingLanes,(c&1)!==0?e===Al?$r++:($r=0,Al=e):$r=0,Xt(),null}function Kn(){if(nn!==null){var e=ta(Bo),t=xt.transition,n=Ce;try{if(xt.transition=null,Ce=16>e?16:e,nn===null)var i=!1;else{if(e=nn,nn=null,Bo=0,(be&6)!==0)throw Error(u(331));var a=be;for(be|=4,te=e.current;te!==null;){var c=te,h=c.child;if((te.flags&16)!==0){var m=c.deletions;if(m!==null){for(var k=0;k<m.length;k++){var F=m[k];for(te=F;te!==null;){var D=te;switch(D.tag){case 0:case 11:case 15:Mr(8,D,c)}var A=D.child;if(A!==null)A.return=D,te=A;else for(;te!==null;){D=te;var B=D.sibling,q=D.return;if(Zu(D),D===F){te=null;break}if(B!==null){B.return=q,te=B;break}te=q}}}var ne=c.alternate;if(ne!==null){var re=ne.child;if(re!==null){ne.child=null;do{var De=re.sibling;re.sibling=null,re=De}while(re!==null)}}te=c}}if((c.subtreeFlags&2064)!==0&&h!==null)h.return=c,te=h;else e:for(;te!==null;){if(c=te,(c.flags&2048)!==0)switch(c.tag){case 0:case 11:case 15:Mr(9,c,c.return)}var E=c.sibling;if(E!==null){E.return=c.return,te=E;break e}te=c.return}}var C=e.current;for(te=C;te!==null;){h=te;var M=h.child;if((h.subtreeFlags&2064)!==0&&M!==null)M.return=h,te=M;else e:for(h=C;te!==null;){if(m=te,(m.flags&2048)!==0)try{switch(m.tag){case 0:case 11:case 15:Fo(9,m)}}catch(oe){Oe(m,m.return,oe)}if(m===h){te=null;break e}var Q=m.sibling;if(Q!==null){Q.return=m.return,te=Q;break e}te=m.return}}if(be=a,Xt(),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(Qr,e)}catch{}i=!0}return i}finally{Ce=n,xt.transition=t}}return!1}function gc(e,t,n){t=Vn(n,t),t=Ru(e,t,1),e=qt(e,t,1),t=et(),e!==null&&(lr(e,1,t),lt(e,t))}function Oe(e,t,n){if(e.tag===3)gc(e,e,n);else for(;t!==null;){if(t.tag===3){gc(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(tn===null||!tn.has(i))){e=Vn(n,e),e=Mu(t,e,1),t=qt(t,e,1),e=et(),t!==null&&(lr(t,1,e),lt(t,e));break}}t=t.return}}function hf(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),t=et(),e.pingedLanes|=e.suspendedLanes&n,Ve===e&&(Je&n)===n&&(He===4||He===3&&(Je&130023424)===Je&&500>Be()-Dl?Sn(e,0):Bl|=n),lt(e,t)}function hc(e,t){t===0&&((e.mode&1)===0?t=1:(t=Jr,Jr<<=1,(Jr&130023424)===0&&(Jr=4194304)));var n=et();e=Nt(e,t),e!==null&&(lr(e,t,n),lt(e,n))}function xf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hc(e,n)}function yf(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(u(314))}i!==null&&i.delete(t),hc(e,n)}var xc;xc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)ot=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ot=!1,rf(e,t,n);ot=(e.flags&131072)!==0}else ot=!1,Me&&(t.flags&1048576)!==0&&Ka(t,yo,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Ro(e,t),e=t.pendingProps;var a=Nn(t,Ke.current);Hn(t,n),a=yl(null,t,i,e,a,n);var c=ml();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(i)?(c=!0,go(t)):c=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,cl(t),a.updater=zo,t.stateNode=a,a._reactInternals=t,jl(t,i,e,n),t=_l(null,t,i,!0,c,n)):(t.tag=0,Me&&c&&el(t),qe(null,t,a,n),t=t.child),t;case 16:i=t.elementType;e:{switch(Ro(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=vf(i),e=bt(i,e),a){case 0:t=Pl(null,t,i,e,n);break e;case 1:t=Au(null,t,i,e,n);break e;case 11:t=Nu(null,t,i,e,n);break e;case 14:t=Ou(null,t,i,bt(i.type,e),n);break e}throw Error(u(306,i,""))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:bt(i,a),Pl(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:bt(i,a),Au(e,t,i,a,n);case 3:e:{if(Hu(t),e===null)throw Error(u(387));i=t.pendingProps,c=t.memoizedState,a=c.element,ou(e,t),wo(t,i,null,n);var h=t.memoizedState;if(i=h.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:h.cache,pendingSuspenseBoundaries:h.pendingSuspenseBoundaries,transitions:h.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){a=Vn(Error(u(423)),t),t=Uu(e,t,i,n,a);break e}else if(i!==a){a=Vn(Error(u(424)),t),t=Uu(e,t,i,n,a);break e}else for(ct=Jt(t.stateNode.containerInfo.firstChild),ut=t,Me=!0,St=null,n=nu(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Dn(),i===a){t=Bt(e,t,n);break e}qe(e,t,i,n)}t=t.child}return t;case 5:return su(t),e===null&&rl(t),i=t.type,a=t.pendingProps,c=e!==null?e.memoizedProps:null,h=a.children,Ji(i,a)?h=null:c!==null&&Ji(i,c)&&(t.flags|=32),Wu(e,t),qe(e,t,h,n),t.child;case 6:return e===null&&rl(t),null;case 13:return Vu(e,t,n);case 4:return dl(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Wn(t,null,i,n):qe(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:bt(i,a),Nu(e,t,i,a,n);case 7:return qe(e,t,t.pendingProps,n),t.child;case 8:return qe(e,t,t.pendingProps.children,n),t.child;case 12:return qe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,a=t.pendingProps,c=t.memoizedProps,h=a.value,_e(So,i._currentValue),i._currentValue=h,c!==null)if(vt(c.value,h)){if(c.children===a.children&&!nt.current){t=Bt(e,t,n);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var m=c.dependencies;if(m!==null){h=c.child;for(var k=m.firstContext;k!==null;){if(k.context===i){if(c.tag===1){k=Ot(-1,n&-n),k.tag=2;var F=c.updateQueue;if(F!==null){F=F.shared;var D=F.pending;D===null?k.next=k:(k.next=D.next,D.next=k),F.pending=k}}c.lanes|=n,k=c.alternate,k!==null&&(k.lanes|=n),al(c.return,n,t),m.lanes|=n;break}k=k.next}}else if(c.tag===10)h=c.type===t.type?null:c.child;else if(c.tag===18){if(h=c.return,h===null)throw Error(u(341));h.lanes|=n,m=h.alternate,m!==null&&(m.lanes|=n),al(h,n,t),h=c.sibling}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===t){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}qe(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Hn(t,n),a=gt(a),i=i(a),t.flags|=1,qe(e,t,i,n),t.child;case 14:return i=t.type,a=bt(i,t.pendingProps),a=bt(i.type,a),Ou(e,t,i,a,n);case 15:return Bu(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:bt(i,a),Ro(e,t),t.tag=1,rt(i)?(e=!0,go(t)):e=!1,Hn(t,n),zu(t,i,a),jl(t,i,a,n),_l(null,t,i,!0,e,n);case 19:return Yu(e,t,n);case 22:return Du(e,t,n)}throw Error(u(156,t.tag))};function yc(e,t){return Gs(e,t)}function mf(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,n,i){return new mf(e,t,n,i)}function Jl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vf(e){if(typeof e=="function")return Jl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Se)return 11;if(e===Ne)return 14}return 2}function ln(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&14680064,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}function Ho(e,t,n,i,a,c){var h=2;if(i=e,typeof e=="function")Jl(e)&&(h=1);else if(typeof e=="string")h=5;else e:switch(e){case K:return kn(n.children,a,c,t);case V:h=8,a|=8;break;case G:return e=yt(12,n,t,a|2),e.elementType=G,e.lanes=c,e;case ve:return e=yt(13,n,t,a),e.elementType=ve,e.lanes=c,e;case Ee:return e=yt(19,n,t,a),e.elementType=Ee,e.lanes=c,e;case xe:return Uo(n,a,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:h=10;break e;case ce:h=9;break e;case Se:h=11;break e;case Ne:h=14;break e;case Re:h=16,i=null;break e}throw Error(u(130,e==null?e:typeof e,""))}return t=yt(h,n,t,a),t.elementType=e,t.type=i,t.lanes=c,t}function kn(e,t,n,i){return e=yt(7,e,i,t),e.lanes=n,e}function Uo(e,t,n,i){return e=yt(22,e,i,t),e.elementType=xe,e.lanes=n,e.stateNode={isHidden:!1},e}function Kl(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function Gl(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}function Sf(e,t,n,i,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wi(0),this.expirationTimes=wi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wi(0),this.identifierPrefix=i,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Xl(e,t,n,i,a,c,h,m,k){return e=new Sf(e,t,n,m,k),t===1?(t=1,c===!0&&(t|=8)):t=0,c=yt(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},cl(c),e}function bf(e,t,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H,key:i==null?null:""+i,children:e,containerInfo:t,implementation:n}}function mc(e){if(!e)return Gt;e=e._reactInternals;e:{if(cn(e)!==e||e.tag!==1)throw Error(u(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(rt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(u(171))}if(e.tag===1){var n=e.type;if(rt(n))return Qa(e,n,t)}return t}function vc(e,t,n,i,a,c,h,m,k){return e=Xl(n,i,!0,e,a,c,h,m,k),e.context=mc(null),n=e.current,i=et(),a=rn(n),c=Ot(i,a),c.callback=t??null,qt(n,c,a),e.current.lanes=a,lr(e,a,i),lt(e,i),e}function Vo(e,t,n,i){var a=t.current,c=et(),h=rn(a);return n=mc(n),t.context===null?t.context=n:t.pendingContext=n,t=Ot(c,h),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=qt(a,t,h),e!==null&&(jt(e,a,h,c),ko(e,a,h)),h}function Qo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Sc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Zl(e,t){Sc(e,t),(e=e.alternate)&&Sc(e,t)}function kf(){return null}var bc=typeof reportError=="function"?reportError:function(e){console.error(e)};function ql(e){this._internalRoot=e}Yo.prototype.render=ql.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));Vo(e,t,null,null)},Yo.prototype.unmount=ql.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vn(function(){Vo(null,e,null,null)}),t[Mt]=null}};function Yo(e){this._internalRoot=e}Yo.prototype.unstable_scheduleHydration=function(e){if(e){var t=oa();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vt.length&&t!==0&&t<Vt[n].priority;n++);Vt.splice(n,0,e),n===0&&sa(e)}};function es(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Jo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function kc(){}function wf(e,t,n,i,a){if(a){if(typeof i=="function"){var c=i;i=function(){var F=Qo(h);c.call(F)}}var h=vc(t,i,e,0,null,!1,!1,"",kc);return e._reactRootContainer=h,e[Mt]=h.current,Sr(e.nodeType===8?e.parentNode:e),vn(),h}for(;a=e.lastChild;)e.removeChild(a);if(typeof i=="function"){var m=i;i=function(){var F=Qo(k);m.call(F)}}var k=Xl(e,0,!1,null,null,!1,!1,"",kc);return e._reactRootContainer=k,e[Mt]=k.current,Sr(e.nodeType===8?e.parentNode:e),vn(function(){Vo(t,k,n,i)}),k}function Ko(e,t,n,i,a){var c=n._reactRootContainer;if(c){var h=c;if(typeof a=="function"){var m=a;a=function(){var k=Qo(h);m.call(k)}}Vo(t,h,e,a)}else h=wf(n,t,e,a,i);return Qo(h)}na=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ir(t.pendingLanes);n!==0&&(ji(t,n|1),lt(t,Be()),(be&6)===0&&(Jn=Be()+500,Xt()))}break;case 13:vn(function(){var i=Nt(e,1);if(i!==null){var a=et();jt(i,e,1,a)}}),Zl(e,1)}},Ci=function(e){if(e.tag===13){var t=Nt(e,134217728);if(t!==null){var n=et();jt(t,e,134217728,n)}Zl(e,134217728)}},ra=function(e){if(e.tag===13){var t=rn(e),n=Nt(e,t);if(n!==null){var i=et();jt(n,e,t,i)}Zl(e,t)}},oa=function(){return Ce},ia=function(e,t){var n=Ce;try{return Ce=e,t()}finally{Ce=n}},yi=function(e,t,n){switch(t){case"input":if(ui(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=po(i);if(!a)throw Error(u(90));tt(i),ui(i,a)}}}break;case"textarea":Fs(e,n);break;case"select":t=n.value,t!=null&&Cn(e,!!n.multiple,t,!1)}},Hs=Vl,Us=vn;var jf={usingClientEntryPoint:!1,Events:[wr,In,po,Ws,As,Vl]},Nr={findFiberByHostInstance:dn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Cf={bundleType:Nr.bundleType,version:Nr.version,rendererPackageName:Nr.rendererPackageName,rendererConfig:Nr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:W.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Js(e),e===null?null:e.stateNode},findFiberByHostInstance:Nr.findFiberByHostInstance||kf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Go=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Go.isDisabled&&Go.supportsFiber)try{Qr=Go.inject(Cf),Tt=Go}catch{}}return st.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jf,st.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!es(t))throw Error(u(200));return bf(e,t,null,n)},st.createRoot=function(e,t){if(!es(e))throw Error(u(299));var n=!1,i="",a=bc;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=Xl(e,1,!1,null,null,n,!1,i,a),e[Mt]=t.current,Sr(e.nodeType===8?e.parentNode:e),new ql(t)},st.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=Js(t),e=e===null?null:e.stateNode,e},st.flushSync=function(e){return vn(e)},st.hydrate=function(e,t,n){if(!Jo(t))throw Error(u(200));return Ko(null,e,t,!0,n)},st.hydrateRoot=function(e,t,n){if(!es(e))throw Error(u(405));var i=n!=null&&n.hydratedSources||null,a=!1,c="",h=bc;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onRecoverableError!==void 0&&(h=n.onRecoverableError)),t=vc(t,null,e,1,n??null,a,!1,c,h),e[Mt]=t.current,Sr(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Yo(t)},st.render=function(e,t,n){if(!Jo(t))throw Error(u(200));return Ko(null,e,t,!1,n)},st.unmountComponentAtNode=function(e){if(!Jo(e))throw Error(u(40));return e._reactRootContainer?(vn(function(){Ko(null,null,e,!1,function(){e._reactRootContainer=null,e[Mt]=null})}),!0):!1},st.unstable_batchedUpdates=Vl,st.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Jo(n))throw Error(u(200));if(e==null||e._reactInternals===void 0)throw Error(u(38));return Ko(e,t,n,!1,i)},st.version="18.3.1-next-f1338f8080-20240426",st}var zc;function Mf(){if(zc)return rs.exports;zc=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(s){console.error(s)}}return r(),rs.exports=Rf(),rs.exports}var Ec;function Ff(){if(Ec)return Xo;Ec=1;var r=Mf();return Xo.createRoot=r.createRoot,Xo.hydrateRoot=r.hydrateRoot,Xo}var If=Ff();const $f=Qc(If),o={bgPrimary:"#ffffff",bgSecondary:"#f8f9fa",bgTertiary:"#f1f3f4",bgCard:"#ffffff",bgHover:"#f1f3f4",bgSelected:"#e8f0fe",bgUnpaired:"#fef7e0",textPrimary:"#202124",textSecondary:"#5f6368",textTertiary:"#80868b",textInverse:"#ffffff",borderLight:"#dadce0",borderMedium:"#bdc1c6",accentBlue:"#1a73e8",accentBlueHover:"#1557b0",accentGreen:"#34a853",accentOrange:"#ea8600",success:"#34a853",warning:"#fbbc04",error:"#ea4335",info:"#1a73e8",buttonPrimary:"#4285f4",buttonPrimaryHover:"#3367d6",buttonSecondary:"#f1f3f4",buttonSecondaryHover:"#e8eaed",buttonDanger:"#ea4335",buttonDangerHover:"#d33b2c",shadowSm:"rgba(60, 64, 67, 0.08)",shadowMd:"rgba(60, 64, 67, 0.12)",shadowLg:"rgba(60, 64, 67, 0.16)"};function Xn(r,s){const u=r.replace("#",""),p=Number.parseInt(u.substring(0,2),16),d=Number.parseInt(u.substring(2,4),16),f=Number.parseInt(u.substring(4,6),16);return`rgba(${p}, ${d}, ${f}, ${s})`}const v={body:"'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",mono:"'Roboto Mono', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace"};function Nf({logs:r,filteredLogs:s,logEndRef:u,getLogColor:p}){return l.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px",fontFamily:v.mono,fontSize:"12px",background:o.bgCard},children:s.length===0?l.jsx("div",{style:{color:o.textSecondary,padding:"40px",textAlign:"center",fontFamily:v.body},children:r.length===0?"No logs available. Start the MCP Shark server to see logs here.":"No logs match the current filter."}):l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:u}),s.map((d,f)=>l.jsxs("div",{style:{display:"flex",gap:"12px",padding:"12px 16px",borderBottom:`1px solid ${o.borderLight}`,background:o.bgCard,transition:"background-color 0.15s ease"},onMouseEnter:x=>{x.currentTarget.style.background=o.bgHover},onMouseLeave:x=>{x.currentTarget.style.background=o.bgCard},children:[l.jsx("span",{style:{color:o.textTertiary,minWidth:"140px",flexShrink:0,fontFamily:v.mono,fontSize:"11px"},children:new Date(d.timestamp).toLocaleTimeString()}),l.jsx("span",{style:{color:o.textTertiary,minWidth:"70px",flexShrink:0,textTransform:"uppercase",fontFamily:v.body,fontSize:"10px",fontWeight:"600",letterSpacing:"0.05em"},children:d.type}),l.jsx("span",{style:{color:p(d.type),whiteSpace:"pre-wrap",wordBreak:"break-word",flex:1,fontFamily:v.mono,fontSize:"12px",lineHeight:"1.5"},children:d.line})]},`${d.timestamp}-${f}`))]})})}var Of={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const Pe=(r,s,u,p)=>{const d=L.forwardRef(({color:f="currentColor",size:x=24,stroke:y=2,title:g,className:j,children:S,...b},T)=>L.createElement("svg",{ref:T,...Of[r],width:x,height:x,className:["tabler-icon",`tabler-icon-${s}`,j].join(" "),strokeWidth:y,stroke:f,...b},[g&&L.createElement("title",{key:"svg-title"},g),...p.map(([_,z])=>L.createElement(_,z)),...Array.isArray(S)?S:[S]]));return d.displayName=`${u}`,d};const Bf=[["path",{d:"M12 9v4",key:"svg-0"}],["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],Df=Pe("outline","alert-triangle","AlertTriangle",Bf);const Wf=[["path",{d:"M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6",key:"svg-0"}],["path",{d:"M9 17v1a3 3 0 0 0 6 0v-1",key:"svg-1"}]],Af=Pe("outline","bell","Bell",Wf);const Hf=[["path",{d:"M4 17v1a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M8 16h8",key:"svg-1"}],["path",{d:"M8.322 12.582l7.956 .836",key:"svg-2"}],["path",{d:"M8.787 9.168l7.826 1.664",key:"svg-3"}],["path",{d:"M10.096 5.764l7.608 2.472",key:"svg-4"}]],Uf=Pe("outline","brand-stackoverflow","BrandStackoverflow",Hf);const Vf=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],Qf=Pe("outline","check","Check",Vf);const Yf=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],ds=Pe("outline","chevron-down","ChevronDown",Yf);const Jf=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],Yc=Pe("outline","clock","Clock",Jf);const Kf=[["path",{d:"M7 8l-4 4l4 4",key:"svg-0"}],["path",{d:"M17 8l4 4l-4 4",key:"svg-1"}],["path",{d:"M14 4l-4 16",key:"svg-2"}]],Gf=Pe("outline","code","Code",Kf);const Xf=[["path",{d:"M12 6m-8 0a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 6v6a8 3 0 0 0 16 0v-6",key:"svg-1"}],["path",{d:"M4 12v6a8 3 0 0 0 16 0v-6",key:"svg-2"}]],Zf=Pe("outline","database","Database",Xf);const qf=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],Jc=Pe("outline","download","Download",qf);const eg=[["path",{d:"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6",key:"svg-0"}],["path",{d:"M11 13l9 -9",key:"svg-1"}],["path",{d:"M15 4h5v5",key:"svg-2"}]],Kc=Pe("outline","external-link","ExternalLink",eg);const tg=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],ps=Pe("outline","eye","Eye",tg);const ng=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M9 9l1 0",key:"svg-2"}],["path",{d:"M9 13l6 0",key:"svg-3"}],["path",{d:"M9 17l6 0",key:"svg-4"}]],rg=Pe("outline","file-text","FileText",ng);const og=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11v6",key:"svg-2"}],["path",{d:"M9.5 13.5l2.5 -2.5l2.5 2.5",key:"svg-3"}]],ig=Pe("outline","file-upload","FileUpload",og);const lg=[["path",{d:"M9 6l11 0",key:"svg-0"}],["path",{d:"M9 12l11 0",key:"svg-1"}],["path",{d:"M9 18l11 0",key:"svg-2"}],["path",{d:"M5 6l0 .01",key:"svg-3"}],["path",{d:"M5 12l0 .01",key:"svg-4"}],["path",{d:"M5 18l0 .01",key:"svg-5"}]],sg=Pe("outline","list","List",lg);const ag=[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l16 0",key:"svg-2"}]],ug=Pe("outline","menu-2","Menu2",ag);const cg=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]],dg=Pe("outline","message","Message",cg);const pg=[["path",{d:"M6 9a6 6 0 1 0 12 0a6 6 0 0 0 -12 0",key:"svg-0"}],["path",{d:"M12 3c1.333 .333 2 2.333 2 6s-.667 5.667 -2 6",key:"svg-1"}],["path",{d:"M12 3c-1.333 .333 -2 2.333 -2 6s.667 5.667 2 6",key:"svg-2"}],["path",{d:"M6 9h12",key:"svg-3"}],["path",{d:"M3 20h7",key:"svg-4"}],["path",{d:"M14 20h7",key:"svg-5"}],["path",{d:"M10 20a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-6"}],["path",{d:"M12 15v3",key:"svg-7"}]],Gc=Pe("outline","network","Network",pg);const fg=[["path",{d:"M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5",key:"svg-0"}],["path",{d:"M12 12l8 -4.5",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}],["path",{d:"M12 12l-8 -4.5",key:"svg-3"}],["path",{d:"M16 5.25l-8 4.5",key:"svg-4"}]],Rc=Pe("outline","package","Package",fg);const gg=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],qo=Pe("outline","refresh","Refresh",gg);const hg=[["path",{d:"M3.06 13a9 9 0 1 0 .49 -4.087",key:"svg-0"}],["path",{d:"M3 4.001v5h5",key:"svg-1"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],xg=Pe("outline","restore","Restore",hg);const yg=[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],Xc=Pe("outline","search","Search",yg);const mg=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],vg=Pe("outline","settings","Settings",mg);const Sg=[["path",{d:"M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3",key:"svg-0"}]],Zc=Pe("outline","shield","Shield",Sg);const bg=[["path",{d:"M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5",key:"svg-0"}]],kg=Pe("outline","tool","Tool",bg);const wg=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],fs=Pe("outline","trash","Trash",wg);const jg=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]],Cg=Pe("outline","user","User",jg);const Tg=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],qc=Pe("outline","x","X",Tg);function Pg({filter:r,setFilter:s,logType:u,setLogType:p,autoScroll:d,setAutoScroll:f,onClearLogs:x,onExportLogs:y,filteredCount:g,totalCount:j}){return l.jsxs("div",{style:{padding:"12px 16px",borderBottom:`1px solid ${o.borderLight}`,background:o.bgCard,display:"flex",gap:"10px",alignItems:"center",flexWrap:"wrap",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[l.jsxs("div",{style:{position:"relative",width:"300px"},children:[l.jsx(Xc,{size:16,stroke:1.5,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:o.textTertiary,pointerEvents:"none"}}),l.jsx("input",{type:"text",placeholder:"Filter logs...",value:r,onChange:S=>s(S.target.value),style:{padding:"8px 12px 8px 36px",background:o.bgCard,border:`1px solid ${o.borderLight}`,color:o.textPrimary,fontSize:"13px",fontFamily:v.body,width:"100%",borderRadius:"8px",transition:"all 0.2s"},onFocus:S=>{S.currentTarget.style.borderColor=o.accentBlue,S.currentTarget.style.boxShadow=`0 0 0 3px ${o.accentBlue}20`},onBlur:S=>{S.currentTarget.style.borderColor=o.borderLight,S.currentTarget.style.boxShadow="none"}})]}),l.jsxs("select",{value:u,onChange:S=>p(S.target.value),style:{padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderLight}`,color:o.textPrimary,fontSize:"13px",fontFamily:v.body,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s"},onFocus:S=>{S.currentTarget.style.borderColor=o.accentBlue,S.currentTarget.style.boxShadow=`0 0 0 3px ${o.accentBlue}20`},onBlur:S=>{S.currentTarget.style.borderColor=o.borderLight,S.currentTarget.style.boxShadow="none"},children:[l.jsx("option",{value:"all",children:"All Types"}),l.jsx("option",{value:"stdout",children:"Stdout"}),l.jsx("option",{value:"stderr",children:"Stderr"}),l.jsx("option",{value:"error",children:"Errors"}),l.jsx("option",{value:"exit",children:"Exit"})]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",color:o.textPrimary,fontSize:"13px",fontFamily:v.body,cursor:"pointer"},children:[l.jsx("input",{type:"checkbox",checked:d,onChange:S=>f(S.target.checked),style:{cursor:"pointer"}}),"Auto-scroll"]}),l.jsxs("button",{type:"button",onClick:x,style:{padding:"8px 14px",background:o.buttonDanger,border:"none",color:o.textInverse,fontSize:"12px",fontFamily:v.body,fontWeight:"500",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`,display:"flex",alignItems:"center",gap:"6px"},onMouseEnter:S=>{S.currentTarget.style.background=o.buttonDangerHover,S.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:S=>{S.currentTarget.style.background=o.buttonDanger,S.currentTarget.style.transform="translateY(0)"},children:[l.jsx(fs,{size:14,stroke:1.5}),"Clear Logs"]}),l.jsxs("button",{type:"button",onClick:y,style:{padding:"8px 14px",background:o.buttonPrimary,border:"none",color:o.textInverse,fontSize:"12px",fontFamily:v.body,fontWeight:"500",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`,display:"flex",alignItems:"center",gap:"6px"},onMouseEnter:S=>{S.currentTarget.style.background=o.buttonPrimaryHover,S.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:S=>{S.currentTarget.style.background=o.buttonPrimary,S.currentTarget.style.transform="translateY(0)"},children:[l.jsx(Jc,{size:14,stroke:1.5}),"Export Logs"]}),l.jsxs("div",{style:{marginLeft:"auto",color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:[g," / ",j," lines"]})]})}function _g(){const[r,s]=L.useState([]),[u,p]=L.useState(!0),[d,f]=L.useState(""),[x,y]=L.useState("all"),g=L.useRef(null),j=L.useRef(null);L.useEffect(()=>{u&&g.current&&g.current.scrollIntoView({behavior:"smooth",block:"start"})},[u]),L.useEffect(()=>{(async()=>{try{const O=await(await fetch("/api/composite/logs?limit=5000")).json();s(O)}catch(I){console.error("Failed to load logs:",I)}})();const R=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,P=new WebSocket(R);return j.current=P,P.onopen=()=>{console.log("WebSocket connected for logs")},P.onerror=I=>{console.error("WebSocket error:",I)},P.onmessage=I=>{try{const O=JSON.parse(I.data);O.type==="log"&&s(U=>[O.data,...U].slice(0,5e3))}catch(O){console.error("Failed to parse WebSocket message:",O)}},P.onclose=()=>{console.log("WebSocket closed, attempting to reconnect..."),setTimeout(()=>{j.current?.readyState===WebSocket.CLOSED&&console.log("WebSocket reconnection needed")},3e3)},()=>{(P.readyState===WebSocket.OPEN||P.readyState===WebSocket.CONNECTING)&&P.close()}},[]);const S=async()=>{try{await fetch("/api/composite/logs/clear",{method:"POST"}),s([])}catch(z){console.error("Failed to clear logs:",z)}},b=z=>{switch(z){case"stderr":case"error":return o.error;case"stdout":return o.textPrimary;case"exit":return o.accentOrange;default:return o.textSecondary}},T=r.filter(z=>!(x!=="all"&&z.type!==x||d&&!z.line.toLowerCase().includes(d.toLowerCase()))),_=async()=>{try{const R=await(await fetch("/api/composite/logs/export")).blob(),P=window.URL.createObjectURL(R),I=document.createElement("a");I.href=P,I.download=`mcp-shark-logs-${new Date().toISOString().replace(/[:.]/g,"-")}.txt`,document.body.appendChild(I),I.click(),window.URL.revokeObjectURL(P),document.body.removeChild(I)}catch(z){console.error("Failed to export logs:",z)}};return l.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",background:o.bgPrimary,overflow:"hidden"},children:[l.jsx(Pg,{filter:d,setFilter:f,logType:x,setLogType:y,autoScroll:u,setAutoScroll:p,onClearLogs:S,onExportLogs:_,filteredCount:T.length,totalCount:r.length}),l.jsx(Nf,{logs:r,filteredLogs:T,logEndRef:g,getLogColor:b})]})}function Lg({backups:r,loadingBackups:s,onRefresh:u,onRestore:p,onView:d,onDelete:f}){return r.length===0?null:l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"20px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[l.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:"Backup Files"}),l.jsxs("button",{type:"button",onClick:u,disabled:s,style:{padding:"4px 8px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:s?"not-allowed":"pointer",fontSize:"11px",borderRadius:"8px",opacity:s?.5:1},title:"Refresh backups",children:[l.jsx(qo,{size:14,stroke:1.5,style:{marginRight:"4px"}}),s?"Loading...":"Refresh"]})]}),l.jsx("p",{style:{fontSize:"12px",color:o.textSecondary,marginBottom:"12px",lineHeight:"1.4"},children:"View, restore, or delete backups of your MCP configuration files. Backups are created automatically when starting MCP Shark."}),l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((x,y)=>l.jsxs("div",{style:{padding:"12px",background:o.bgPrimary,border:`1px solid ${o.borderMedium}`,borderRadius:"8px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{style:{flex:1},children:[l.jsx("div",{style:{color:o.textPrimary,fontSize:"12px",fontWeight:"500",marginBottom:"4px"},children:x.displayPath}),l.jsxs("div",{style:{color:o.textTertiary,fontSize:"11px",fontFamily:v.body},children:["Created: ",new Date(x.modifiedAt||x.createdAt).toLocaleString()," • Size:"," ",(x.size/1024).toFixed(2)," KB"]})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsxs("button",{type:"button",onClick:()=>d(x.backupPath),style:{padding:"6px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:"pointer",fontSize:"12px",borderRadius:"8px",fontWeight:"500"},onMouseEnter:g=>{g.currentTarget.style.background=o.bgCard,g.currentTarget.style.borderColor=o.borderLight},onMouseLeave:g=>{g.currentTarget.style.background="transparent",g.currentTarget.style.borderColor=o.borderMedium},title:"View backup content",children:[l.jsx(ps,{size:14,stroke:1.5,style:{marginRight:"4px"}}),"View"]}),l.jsxs("button",{type:"button",onClick:()=>{confirm("Are you sure you want to delete this backup?")&&f(x.backupPath)},style:{padding:"6px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.error,cursor:"pointer",fontSize:"12px",borderRadius:"8px",fontWeight:"500",fontFamily:v.body,display:"flex",alignItems:"center",gap:"4px"},onMouseEnter:g=>{g.currentTarget.style.background=Xn(o.error,.15),g.currentTarget.style.borderColor=o.error},onMouseLeave:g=>{g.currentTarget.style.background="transparent",g.currentTarget.style.borderColor=o.borderMedium},title:"Delete backup",children:[l.jsx(fs,{size:14,stroke:1.5}),"Delete"]}),l.jsxs("button",{type:"button",onClick:()=>p(x.backupPath,x.originalPath),style:{padding:"6px 12px",background:o.buttonPrimary,border:`1px solid ${o.buttonPrimary}`,color:o.textInverse,cursor:"pointer",fontSize:"12px",borderRadius:"8px",fontWeight:"500",fontFamily:v.body,display:"flex",alignItems:"center",gap:"4px"},onMouseEnter:g=>{g.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:g=>{g.currentTarget.style.background=o.buttonPrimary},title:"Restore this backup",children:[l.jsx(xg,{size:14,stroke:1.5}),"Restore"]})]})]},x.backupPath||`backup-${y}`))})]})}function zg({detectedPaths:r,detecting:s,onDetect:u,onSelect:p,onView:d}){return r.length===0?null:l.jsxs("div",{style:{marginBottom:"8px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[l.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontWeight:"600",fontFamily:v.body},children:"Detected Configuration Files:"}),l.jsx("button",{type:"button",onClick:u,disabled:s,title:"Refresh detection",style:{padding:"4px 8px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:s?"not-allowed":"pointer",fontSize:"11px",borderRadius:"8px",opacity:s?.5:1,display:"flex",alignItems:"center",gap:"4px"},children:s?l.jsxs(l.Fragment,{children:[l.jsx(qo,{size:12,stroke:1.5,style:{animation:"spin 1s linear infinite"}}),l.jsx("span",{children:"Detecting..."})]}):l.jsxs(l.Fragment,{children:[l.jsx(qo,{size:12,stroke:1.5}),l.jsx("span",{children:"Refresh"})]})})]}),l.jsx("div",{"data-tour":"detected-editors",style:{display:"flex",flexDirection:"column",gap:"6px"},children:r.map((f,x)=>l.jsxs("button",{type:"button","data-tour":x===0?"first-detected-editor":void 0,onClick:()=>p(f.path),onDoubleClick:()=>{f.exists&&d(f.path)},style:{padding:"8px 12px",background:f.exists?`${o.accentBlue}20`:o.bgSecondary,border:`1px solid ${f.exists?o.accentBlue:o.borderMedium}`,color:o.textPrimary,cursor:"pointer",fontSize:"12px",borderRadius:"8px",textAlign:"left",display:"flex",justifyContent:"space-between",alignItems:"center",transition:"all 0.2s"},onMouseEnter:y=>{y.currentTarget.style.background=f.exists?`${o.accentBlue}30`:o.bgHover},onMouseLeave:y=>{y.currentTarget.style.background=f.exists?`${o.accentBlue}20`:o.bgSecondary},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("span",{style:{display:"inline-flex",alignItems:"center"},children:f.editor==="Cursor"?l.jsx(Gf,{size:14,stroke:1.5}):l.jsx(Yc,{size:14,stroke:1.5})}),l.jsxs("div",{children:[l.jsx("div",{style:{fontWeight:"500"},children:f.editor}),l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:f.displayPath})]})]}),l.jsx("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:f.exists&&l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{fontSize:"10px",padding:"2px 6px",background:o.success,color:o.textInverse,borderRadius:"6px",fontWeight:"500"},children:"Found"}),l.jsxs("button",{type:"button",onClick:y=>{y.stopPropagation(),d(f.path)},title:"View file content",style:{fontSize:"10px",padding:"2px 6px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,borderRadius:"6px",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px"},children:[l.jsx(ps,{size:10,stroke:1.5}),l.jsx("span",{children:"View"})]})]})})]},`${f.editor}-${f.path}-${x}`))})]})}function Eg({filePath:r,fileContent:s,updatePath:u,onFileSelect:p,onPathChange:d,onUpdatePathChange:f}){return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsxs("label",{"data-tour":"select-file",style:{padding:"8px 16px",background:o.buttonPrimary,border:`1px solid ${o.buttonPrimary}`,color:o.textInverse,cursor:"pointer",fontSize:"13px",borderRadius:"8px",fontWeight:"500",whiteSpace:"nowrap",transition:"background 0.2s"},onMouseEnter:x=>{x.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:x=>{x.currentTarget.style.background=o.buttonPrimary},children:[l.jsx(ig,{size:14,stroke:1.5,style:{marginRight:"6px",display:"inline-block"}}),"Select File",l.jsx("input",{type:"file",accept:".json",onChange:p,style:{display:"none"}})]}),l.jsx("span",{style:{color:o.textTertiary,fontSize:"13px",fontWeight:"500",fontFamily:v.body},children:"OR"}),l.jsx("input",{type:"text",placeholder:"Enter file path (e.g., ~/.cursor/mcp.json)",value:r,onChange:d,style:{flex:1,padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderMedium}`,color:o.textPrimary,fontSize:"13px",borderRadius:"8px"}})]}),s&&!r&&l.jsxs("div",{children:[l.jsx("label",{htmlFor:"update-path-input",style:{display:"block",fontSize:"12px",color:o.textSecondary,marginBottom:"6px"},children:"Optional: File Path to Update"}),l.jsx("input",{id:"update-path-input",type:"text",placeholder:"Enter file path to update (e.g., ~/.cursor/mcp.json)",value:u,onChange:f,style:{width:"100%",padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderMedium}`,color:o.textPrimary,fontSize:"13px",borderRadius:"8px"}}),l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,marginTop:"6px",fontFamily:v.body},children:"Provide the file path if you want to update the original config file (backup will be created)"})]}),s&&l.jsxs("div",{style:{marginTop:"8px"},children:[l.jsx("div",{style:{color:o.textSecondary,fontSize:"12px",marginBottom:"6px",fontWeight:"500"},children:"File Content Preview"}),l.jsx("pre",{style:{background:o.bgCard,padding:"12px",borderRadius:"8px",fontSize:"12px",fontFamily:"monospace",color:o.textPrimary,maxHeight:"200px",overflow:"auto",border:`1px solid ${o.borderLight}`,lineHeight:"1.5"},children:s})]})]})}function Rg({services:r,selectedServices:s,onSelectionChange:u}){return r.length===0?null:l.jsxs("div",{style:{marginTop:"16px"},children:[l.jsxs("div",{style:{marginBottom:"12px"},children:[l.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"8px",color:o.textPrimary,fontFamily:v.body},children:"Select Services"}),l.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,lineHeight:"1.5",fontFamily:v.body},children:"Choose which services to include in the MCP Shark server. Only selected services will be available."})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"12px",flexWrap:"wrap"},children:[l.jsx("button",{type:"button",onClick:()=>{u(new Set(r.map(p=>p.name)))},style:{padding:"4px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:"pointer",fontSize:"12px",borderRadius:"8px"},children:"Select All"}),l.jsx("button",{type:"button",onClick:()=>{u(new Set)},style:{padding:"4px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:"pointer",fontSize:"12px",borderRadius:"8px"},children:"Deselect All"}),l.jsxs("div",{style:{marginLeft:"auto",fontSize:"12px",color:o.textSecondary,display:"flex",alignItems:"center"},children:[s.size," of ",r.length," selected"]})]}),l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"300px",overflowY:"auto",padding:"8px",background:o.bgPrimary,borderRadius:"4px",border:`1px solid ${o.borderLight}`},children:r.map(p=>{const d=s.has(p.name);return l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px",background:d?o.bgSelected:"transparent",border:`1px solid ${d?o.accentBlue:o.borderMedium}`,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:f=>{d||(f.currentTarget.style.background=o.bgHover)},onMouseLeave:f=>{d||(f.currentTarget.style.background="transparent")},children:[l.jsx("input",{type:"checkbox",checked:d,onChange:f=>{const x=new Set(s);f.target.checked?x.add(p.name):x.delete(p.name),u(x)},style:{width:"18px",height:"18px",cursor:"pointer"}}),l.jsxs("div",{style:{flex:1},children:[l.jsx("div",{style:{fontWeight:"500",color:o.textPrimary,fontSize:"13px",marginBottom:"4px"},children:p.name}),l.jsxs("div",{style:{fontSize:"11px",color:o.textSecondary,display:"flex",gap:"12px",flexWrap:"wrap"},children:[l.jsx("span",{style:{padding:"2px 6px",background:p.type==="http"?"#0e639c":"#4a9e5f",color:o.textInverse,borderRadius:"6px",fontSize:"10px",fontWeight:"500"},children:p.type.toUpperCase()}),p.url&&l.jsx("span",{style:{fontFamily:"monospace",fontSize:"11px"},children:p.url}),p.command&&l.jsxs("span",{style:{fontFamily:"monospace",fontSize:"11px"},children:[p.command," ",p.args?.join(" ")||""]})]})]})]},p.name)})}),s.size===0&&l.jsx("div",{style:{marginTop:"8px",padding:"8px 12px",background:Xn(o.error,.15),border:`1px solid ${o.error}`,borderRadius:"8px",color:o.error,fontSize:"12px"},children:"⚠️ Please select at least one service to start the server"})]})}function Mg({detectedPaths:r,detecting:s,onDetect:u,onPathSelect:p,onViewConfig:d,filePath:f,fileContent:x,updatePath:y,onFileSelect:g,onPathChange:j,onUpdatePathChange:S,services:b,selectedServices:T,onSelectionChange:_}){return l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"20px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[l.jsxs("div",{style:{marginBottom:"16px"},children:[l.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"8px",color:o.textPrimary,fontFamily:v.body},children:"Configuration File"}),l.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,lineHeight:"1.5",fontFamily:v.body},children:"Select your MCP configuration file or provide a file path. The file will be converted to MCP Shark format and used to start the server."})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[l.jsx(zg,{detectedPaths:r,detecting:s,onDetect:u,onSelect:p,onView:d}),l.jsx(Eg,{filePath:f,fileContent:x,updatePath:y,onFileSelect:g,onPathChange:j,onUpdatePathChange:S}),l.jsx(Rg,{services:b,selectedServices:T,onSelectionChange:_})]})]})}function Fg({viewingConfig:r,configContent:s,loadingConfig:u,onClose:p,viewingBackup:d,backupContent:f,loadingBackup:x}){const y=d!==null;if(!(r!==null)&&!y)return null;const j=y?f:s,S=y?x:u,b=y?"Backup File":"MCP Configuration File";return l.jsx("dialog",{open:!0,"aria-modal":"true",style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,padding:"20px",border:"none",margin:0,width:"100%",height:"100%"},onClick:p,onKeyDown:T=>{T.key==="Escape"&&p()},children:l.jsxs("div",{role:"document",style:{background:o.bgPrimary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",width:"100%",maxWidth:"800px",maxHeight:"90vh",display:"flex",flexDirection:"column",overflow:"hidden"},onClick:T=>T.stopPropagation(),onKeyDown:T=>T.stopPropagation(),children:[l.jsxs("div",{style:{padding:"16px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{children:[l.jsx("h3",{style:{fontSize:"16px",fontWeight:"500",marginBottom:"4px",color:o.textPrimary},children:b}),j&&l.jsxs("div",{style:{fontSize:"12px",color:"#858585"},children:[j.displayPath,y&&j.createdAt&&l.jsxs("span",{style:{marginLeft:"12px",color:"#666"},children:["Created: ",new Date(j.createdAt).toLocaleString()]})]})]}),l.jsx("button",{type:"button",onClick:p,style:{background:"transparent",border:"none",color:o.textPrimary,cursor:"pointer",fontSize:"24px",padding:"0",width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center"},children:"×"})]}),l.jsx("div",{style:{flex:1,overflow:"auto",padding:"20px"},children:S?l.jsx("div",{style:{color:"#858585",textAlign:"center",padding:"40px"},children:"Loading..."}):j?l.jsx("pre",{style:{background:o.bgPrimary,padding:"16px",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",color:o.textPrimary,overflow:"auto",border:`1px solid ${o.borderLight}`,lineHeight:"1.6",margin:0},children:j.content}):l.jsx("div",{style:{color:"#f48771",textAlign:"center",padding:"40px"},children:"Failed to load file content"})})]})})}function Ig({message:r,error:s}){return!r&&!s?null:l.jsx("div",{style:{marginBottom:"20px",padding:"12px 16px",background:Xn(r?o.info:o.error,.15),border:`1px solid ${r?o.info:o.error}`,borderRadius:"8px",color:r?o.textPrimary:o.error,fontSize:"13px",lineHeight:"1.6",fontFamily:v.body,boxShadow:`0 2px 4px ${o.shadowSm}`},children:r||s})}function $g({status:r,loading:s,onStart:u,onStop:p,canStart:d}){return l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"20px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[l.jsx("div",{style:{marginBottom:"16px"},children:l.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"8px",color:o.textPrimary,fontFamily:v.body},children:"Server Control"})}),l.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center",flexWrap:"wrap"},children:[r.running?l.jsx("button",{type:"button",onClick:p,disabled:s,style:{padding:"10px 20px",background:o.buttonDanger,border:`1px solid ${o.buttonDanger}`,color:o.textInverse,cursor:s?"not-allowed":"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:"500",borderRadius:"8px",opacity:s?.5:1,transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`},onMouseEnter:f=>{s||(f.currentTarget.style.background=o.buttonDangerHover,f.currentTarget.style.transform="translateY(-1px)")},onMouseLeave:f=>{f.currentTarget.style.background=o.buttonDanger,f.currentTarget.style.transform="translateY(0)"},children:s?"Stopping...":"Stop MCP Shark"}):l.jsx("button",{type:"button","data-tour":"start-button",onClick:u,disabled:s||!d,style:{padding:"10px 20px",background:o.buttonPrimary,border:`1px solid ${o.buttonPrimary}`,color:o.textInverse,cursor:s||!d?"not-allowed":"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:"500",borderRadius:"8px",opacity:s||!d?.5:1,transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`},onMouseEnter:f=>{!s&&d&&(f.currentTarget.style.background=o.buttonPrimaryHover,f.currentTarget.style.transform="translateY(-1px)")},onMouseLeave:f=>{f.currentTarget.style.background=o.buttonPrimary,f.currentTarget.style.transform="translateY(0)"},children:s?"Processing...":"Start MCP Shark"}),l.jsxs("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"10px",padding:"8px 16px",background:o.bgPrimary,border:`1px solid ${o.borderLight}`,borderRadius:"8px"},children:[l.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:r.running?o.success:o.textTertiary,boxShadow:r.running?`0 0 8px ${o.success}80`:"none",transition:"all 0.3s"}}),l.jsx("span",{style:{color:o.textPrimary,fontSize:"13px",fontWeight:"500",fontFamily:v.body},children:r.running?r.pid?`Running (PID: ${r.pid})`:"Running":"Stopped"})]})]})]})}function Ng(){return l.jsxs("div",{style:{marginBottom:"24px"},children:[l.jsx("h2",{style:{fontSize:"24px",fontWeight:"700",marginBottom:"12px",color:o.textPrimary,fontFamily:v.body},children:"MCP Shark Server Setup"}),l.jsx("p",{style:{fontSize:"15px",color:o.textSecondary,lineHeight:"1.6",fontFamily:v.body},children:"Convert your MCP configuration file and start the MCP Shark server to aggregate multiple MCP servers into a single endpoint."})]})}function Og({filePath:r,updatePath:s}){return l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[l.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"12px",color:o.textPrimary,fontFamily:v.body},children:"What This Does"}),l.jsxs("ul",{style:{margin:0,paddingLeft:"20px",fontSize:"13px",color:o.textSecondary,lineHeight:"1.8",fontFamily:v.body},children:[l.jsxs("li",{children:["Converts your MCP config (",l.jsx("code",{style:{color:o.accentOrange,fontFamily:v.mono},children:"mcpServers"}),") to MCP Shark format (",l.jsx("code",{style:{color:o.accentOrange,fontFamily:v.mono},children:"servers"}),")"]}),l.jsxs("li",{children:["Starts the MCP Shark server on"," ",l.jsx("code",{style:{color:o.accentBlue,fontFamily:v.mono},children:"http://localhost:9851/mcp"})]}),l.jsx("li",{children:r||s?"Updates your original config file to point to the MCP Shark server (creates a backup first)":"Note: Provide a file path to update your original config file automatically"}),(r||s)&&l.jsx("li",{style:{color:o.success,marginTop:"4px",fontWeight:"500"},children:"✓ Original config will be automatically restored when you stop the server or close the UI"})]})]})}function Bg(){const[r,s]=L.useState([]),[u,p]=L.useState(!0),[d,f]=L.useState([]),[x,y]=L.useState(!1),[g,j]=L.useState(null),[S,b]=L.useState(null),[T,_]=L.useState(!1),[z,R]=L.useState(null),[P,I]=L.useState(null),[O,U]=L.useState(!1),W=L.useCallback(async()=>{p(!0);try{const Y=await(await fetch("/api/config/detect")).json();s(Y.detected||[])}catch(G){console.error("Failed to detect config paths:",G)}finally{p(!1)}},[]),$=L.useCallback(async()=>{y(!0);try{const Y=await(await fetch("/api/config/backups")).json();f(Y.backups||[])}catch(G){console.error("Failed to load backups:",G)}finally{y(!1)}},[]),H=async G=>{_(!0),j(G);try{const Y=await fetch(`/api/config/read?filePath=${encodeURIComponent(G)}`),ce=await Y.json();Y.ok?b(ce):b(null)}catch{b(null)}finally{_(!1)}},K=async G=>{U(!0),R(G);try{const Y=await fetch(`/api/config/backup/view?backupPath=${encodeURIComponent(G)}`),ce=await Y.json();Y.ok?I(ce):I(null)}catch{I(null)}finally{U(!1)}},V=async G=>{try{return(await fetch("/api/config/backup/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupPath:G})})).ok?(await $(),!0):!1}catch(Y){return console.error("Failed to delete backup:",Y),!1}};return L.useEffect(()=>{W(),$()},[W,$]),{detectedPaths:r,detecting:u,detectConfigPaths:W,backups:d,loadingBackups:x,loadBackups:$,viewingConfig:g,configContent:S,loadingConfig:T,handleViewConfig:H,setViewingConfig:j,setConfigContent:b,viewingBackup:z,backupContent:P,loadingBackup:O,handleViewBackup:K,handleDeleteBackup:V,setViewingBackup:R,setBackupContent:I}}function Dg(r,s){const[u,p]=L.useState([]),[d,f]=L.useState(new Set),[x,y]=L.useState(!1),g=L.useCallback(async()=>{if(!r&&!s){p([]),f(new Set);return}y(!0);try{const S=await fetch("/api/config/services",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r?{fileContent:r}:{filePath:s})}),b=await S.json();S.ok&&b.services?(p(b.services),f(new Set(b.services.map(T=>T.name)))):(p([]),f(new Set))}catch(j){console.error("Failed to extract services:",j),p([]),f(new Set)}finally{y(!1)}},[r,s]);return L.useEffect(()=>{r||s?g():(p([]),f(new Set))},[r,s,g]),{services:u,selectedServices:d,setSelectedServices:f,loadingServices:x}}function Wg(){const[r,s]=L.useState(""),[u,p]=L.useState(""),[d,f]=L.useState(""),[x,y]=L.useState({running:!1,pid:null}),[g,j]=L.useState(!1),[S,b]=L.useState(null),[T,_]=L.useState(null),{services:z,selectedServices:R,setSelectedServices:P}=Dg(r,u),{detectedPaths:I,detecting:O,detectConfigPaths:U,backups:W,loadingBackups:$,loadBackups:H,viewingConfig:K,configContent:V,loadingConfig:G,handleViewConfig:Y,setViewingConfig:ce,setConfigContent:Se,viewingBackup:ve,backupContent:Ee,loadingBackup:Ne,handleViewBackup:Re,handleDeleteBackup:xe,setViewingBackup:J,setBackupContent:ee}=Bg();L.useEffect(()=>{N();const Z=setInterval(N,2e3);return()=>clearInterval(Z)},[]);const X=async(Z,fe)=>{if(confirm("Are you sure you want to restore this backup? This will overwrite the current config file."))try{const Fe=await fetch("/api/config/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupPath:Z,originalPath:fe})}),tt=await Fe.json();Fe.ok?(b(tt.message||"Config restored successfully"),_(null),H(),U()):(_(tt.error||"Failed to restore backup"),b(null))}catch(Fe){_(Fe.message||"Failed to restore backup"),b(null)}},w=async Z=>{await xe(Z)?(b("Backup deleted successfully"),_(null)):(_("Failed to delete backup"),b(null))},N=async()=>{try{const fe=await(await fetch("/api/composite/status")).json();y(fe)}catch(Z){console.error("Failed to fetch status:",Z)}},le=Z=>{const fe=Z.target.files[0];if(fe){const Fe=new FileReader;Fe.onload=tt=>{s(tt.target.result)},Fe.readAsText(fe)}},de=Z=>{const fe=Z.target.value;p(fe),fe&&s("")},pe=Z=>{f(Z.target.value)},ye=async()=>{j(!0),_(null),b(null);try{const Z=r?{fileContent:r,filePath:d||null}:{filePath:u};R.size>0&&(Z.selectedServices=Array.from(R));const fe=await fetch("/api/composite/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Z)}),Fe=await fe.json();if(fe.ok){const tt=Fe.message||"MCP Shark server started successfully";b(Fe.backupPath?`${tt} (Backup saved to ${Fe.backupPath})`:tt),s(""),p(""),f(""),P(new Set),setTimeout(N,1e3)}else _(Fe.error||"Failed to setup MCP Shark server")}catch(Z){_(Z.message||"Failed to setup MCP Shark server")}finally{j(!1)}},je=async()=>{j(!0),_(null),b(null);try{const Z=await fetch("/api/composite/stop",{method:"POST"}),fe=await Z.json();if(Z.ok){const Fe=fe.message||"MCP Shark server stopped";b(fe.message?.includes("restored")?"MCP Shark server stopped and original config file restored":Fe),setTimeout(N,1e3)}else _(fe.error||"Failed to stop MCP Shark server")}catch(Z){_(Z.message||"Failed to stop MCP Shark server")}finally{j(!1)}},ke=(r||u)&&(z.length===0||R.size>0);return l.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",background:o.bgPrimary,overflow:"auto"},children:[l.jsxs("div",{style:{width:"100%",maxWidth:"1200px",margin:"0 auto",padding:"32px",minHeight:"100%",boxSizing:"border-box"},children:[l.jsx(Ng,{}),l.jsx(Mg,{detectedPaths:I,detecting:O,onDetect:U,onPathSelect:Z=>{p(Z),s(""),f(Z)},onViewConfig:Y,filePath:u,fileContent:r,updatePath:d,onFileSelect:le,onPathChange:de,onUpdatePathChange:pe,services:z,selectedServices:R,onSelectionChange:P}),l.jsx($g,{status:x,loading:g,onStart:ye,onStop:je,canStart:ke}),l.jsx(Ig,{message:S,error:T}),l.jsx(Lg,{backups:W,loadingBackups:$,onRefresh:H,onRestore:X,onView:Re,onDelete:w}),l.jsx(Og,{filePath:u,updatePath:d})]}),l.jsx(Fg,{viewingConfig:K,configContent:V,loadingConfig:G,viewingBackup:ve,backupContent:Ee,loadingBackup:Ne,onClose:()=>{ce(null),Se(null),J(null),ee(null)}})]})}function Ag({elementRect:r,_onClick:s}){if(!r)return l.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.8)"}});const u=8,p=3;return l.jsxs(l.Fragment,{children:[r.top>0&&l.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,height:`${r.top-u}px`,background:"rgba(0, 0, 0, 0.8)",zIndex:9999}}),r.bottom<window.innerHeight&&l.jsx("div",{style:{position:"fixed",bottom:0,left:0,right:0,height:`${window.innerHeight-r.bottom-u}px`,background:"rgba(0, 0, 0, 0.8)",zIndex:9999}}),r.left>0&&l.jsx("div",{style:{position:"fixed",top:`${Math.max(0,r.top-u)}px`,left:0,width:`${r.left-u}px`,height:`${r.height+u*2}px`,background:"rgba(0, 0, 0, 0.8)",zIndex:9999}}),r.right<window.innerWidth&&l.jsx("div",{style:{position:"fixed",top:`${Math.max(0,r.top-u)}px`,right:0,width:`${window.innerWidth-r.right-u}px`,height:`${r.height+u*2}px`,background:"rgba(0, 0, 0, 0.8)",zIndex:9999}}),l.jsx("div",{style:{position:"fixed",left:r.left-u-p,top:r.top-u-p,width:r.width+(u+p)*2,height:r.height+(u+p)*2,border:`${p}px solid #4ec9b0`,borderRadius:"8px",boxShadow:"0 0 0 2px rgba(78, 201, 176, 0.3), 0 0 20px rgba(78, 201, 176, 0.5), 0 0 40px rgba(78, 201, 176, 0.3), inset 0 0 20px rgba(78, 201, 176, 0.1)",zIndex:1e4,pointerEvents:"none",animation:"pulse 2s ease-in-out infinite"}}),l.jsx("style",{children:`
8
+ `+c.stack}return{value:e,source:t,stack:a,digest:null}}function Tl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Pl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ef=typeof WeakMap=="function"?WeakMap:Map;function Ru(e,t,n){n=Ot(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){No||(No=!0,Al=i),Pl(e,t)},n}function Mu(e,t,n){n=Ot(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var a=t.value;n.payload=function(){return i(a)},n.callback=function(){Pl(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(n.callback=function(){Pl(e,t),typeof i!="function"&&(tn===null?tn=new Set([this]):tn.add(this));var h=t.stack;this.componentDidCatch(t.value,{componentStack:h!==null?h:""})}),n}function Fu(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new ef;var a=new Set;i.set(t,a)}else a=i.get(t),a===void 0&&(a=new Set,i.set(t,a));a.has(n)||(a.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function Iu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function $u(e,t,n,i,a){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ot(-1,1),t.tag=2,qt(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}var tf=W.ReactCurrentOwner,ot=!1;function qe(e,t,n,i){t.child=e===null?nu(t,null,n,i):Wn(t,e.child,n,i)}function Nu(e,t,n,i,a){n=n.render;var c=t.ref;return Hn(t,a),i=ml(e,t,n,i,c,a),n=vl(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Bt(e,t,a)):(Me&&n&&tl(t),t.flags|=1,qe(e,t,i,a),t.child)}function Ou(e,t,n,i,a){if(e===null){var c=n.type;return typeof c=="function"&&!Kl(c)&&c.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=c,Bu(e,t,c,i,a)):(e=Ho(n.type,null,i,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&a)===0){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:yr,n(h,i)&&e.ref===t.ref)return Bt(e,t,a)}return t.flags|=1,e=ln(c,i),e.ref=t.ref,e.return=t,t.child=e}function Bu(e,t,n,i,a){if(e!==null){var c=e.memoizedProps;if(yr(c,i)&&e.ref===t.ref)if(ot=!1,t.pendingProps=i=c,(e.lanes&a)!==0)(e.flags&131072)!==0&&(ot=!0);else return t.lanes=e.lanes,Bt(e,t,a)}return _l(e,t,n,i,a)}function Du(e,t,n){var i=t.pendingProps,a=i.children,c=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_e(Yn,dt),dt|=n;else{if((n&1073741824)===0)return e=c!==null?c.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,_e(Yn,dt),dt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=c!==null?c.baseLanes:n,_e(Yn,dt),dt|=i}else c!==null?(i=c.baseLanes|n,t.memoizedState=null):i=n,_e(Yn,dt),dt|=i;return qe(e,t,a,n),t.child}function Wu(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function _l(e,t,n,i,a){var c=rt(n)?pn:Ke.current;return c=Nn(t,c),Hn(t,a),n=ml(e,t,n,i,c,a),i=vl(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Bt(e,t,a)):(Me&&i&&tl(t),t.flags|=1,qe(e,t,n,a),t.child)}function Au(e,t,n,i,a){if(rt(n)){var c=!0;go(t)}else c=!1;if(Hn(t,a),t.stateNode===null)Ro(e,t),zu(t,n,i),Cl(t,n,i,a),i=!0;else if(e===null){var h=t.stateNode,m=t.memoizedProps;h.props=m;var k=h.context,F=n.contextType;typeof F=="object"&&F!==null?F=gt(F):(F=rt(n)?pn:Ke.current,F=Nn(t,F));var D=n.getDerivedStateFromProps,A=typeof D=="function"||typeof h.getSnapshotBeforeUpdate=="function";A||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(m!==i||k!==F)&&Eu(t,h,i,F),Zt=!1;var B=t.memoizedState;h.state=B,wo(t,i,h,a),k=t.memoizedState,m!==i||B!==k||nt.current||Zt?(typeof D=="function"&&(jl(t,n,D,i),k=t.memoizedState),(m=Zt||Lu(t,n,m,i,B,k,F))?(A||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=k),h.props=i,h.state=k,h.context=F,i=m):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{h=t.stateNode,ou(e,t),m=t.memoizedProps,F=t.type===t.elementType?m:bt(t.type,m),h.props=F,A=t.pendingProps,B=h.context,k=n.contextType,typeof k=="object"&&k!==null?k=gt(k):(k=rt(n)?pn:Ke.current,k=Nn(t,k));var q=n.getDerivedStateFromProps;(D=typeof q=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(m!==A||B!==k)&&Eu(t,h,i,k),Zt=!1,B=t.memoizedState,h.state=B,wo(t,i,h,a);var ne=t.memoizedState;m!==A||B!==ne||nt.current||Zt?(typeof q=="function"&&(jl(t,n,q,i),ne=t.memoizedState),(F=Zt||Lu(t,n,F,i,B,ne,k)||!1)?(D||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(i,ne,k),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(i,ne,k)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||m===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ne),h.props=i,h.state=ne,h.context=k,i=F):(typeof h.componentDidUpdate!="function"||m===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),i=!1)}return Ll(e,t,n,i,c,a)}function Ll(e,t,n,i,a,c){Wu(e,t);var h=(t.flags&128)!==0;if(!i&&!h)return a&&Ya(t,n,!1),Bt(e,t,c);i=t.stateNode,tf.current=t;var m=h&&typeof n.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&h?(t.child=Wn(t,e.child,null,c),t.child=Wn(t,null,m,c)):qe(e,t,m,c),t.memoizedState=i.state,a&&Ya(t,n,!0),t.child}function Hu(e){var t=e.stateNode;t.pendingContext?Va(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Va(e,t.context,!1),pl(e,t.containerInfo)}function Uu(e,t,n,i,a){return Dn(),il(a),t.flags|=256,qe(e,t,n,i),t.child}var zl={dehydrated:null,treeContext:null,retryLane:0};function El(e){return{baseLanes:e,cachePool:null,transitions:null}}function Vu(e,t,n){var i=t.pendingProps,a=Ie.current,c=!1,h=(t.flags&128)!==0,m;if((m=h)||(m=e!==null&&e.memoizedState===null?!1:(a&2)!==0),m?(c=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),_e(Ie,a&1),e===null)return ol(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(h=i.children,e=i.fallback,c?(i=t.mode,c=t.child,h={mode:"hidden",children:h},(i&1)===0&&c!==null?(c.childLanes=0,c.pendingProps=h):c=Uo(h,i,0,null),e=kn(e,i,n,null),c.return=t,e.return=t,c.sibling=e,t.child=c,t.child.memoizedState=El(n),t.memoizedState=zl,e):Rl(t,h));if(a=e.memoizedState,a!==null&&(m=a.dehydrated,m!==null))return nf(e,t,h,i,m,a,n);if(c){c=i.fallback,h=t.mode,a=e.child,m=a.sibling;var k={mode:"hidden",children:i.children};return(h&1)===0&&t.child!==a?(i=t.child,i.childLanes=0,i.pendingProps=k,t.deletions=null):(i=ln(a,k),i.subtreeFlags=a.subtreeFlags&14680064),m!==null?c=ln(m,c):(c=kn(c,h,n,null),c.flags|=2),c.return=t,i.return=t,i.sibling=c,t.child=i,i=c,c=t.child,h=e.child.memoizedState,h=h===null?El(n):{baseLanes:h.baseLanes|n,cachePool:null,transitions:h.transitions},c.memoizedState=h,c.childLanes=e.childLanes&~n,t.memoizedState=zl,i}return c=e.child,e=c.sibling,i=ln(c,{mode:"visible",children:i.children}),(t.mode&1)===0&&(i.lanes=n),i.return=t,i.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Rl(e,t){return t=Uo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Eo(e,t,n,i){return i!==null&&il(i),Wn(t,e.child,null,n),e=Rl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nf(e,t,n,i,a,c,h){if(n)return t.flags&256?(t.flags&=-257,i=Tl(Error(u(422))),Eo(e,t,h,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(c=i.fallback,a=t.mode,i=Uo({mode:"visible",children:i.children},a,0,null),c=kn(c,a,h,null),c.flags|=2,i.return=t,c.return=t,i.sibling=c,t.child=i,(t.mode&1)!==0&&Wn(t,e.child,null,h),t.child.memoizedState=El(h),t.memoizedState=zl,c);if((t.mode&1)===0)return Eo(e,t,h,null);if(a.data==="$!"){if(i=a.nextSibling&&a.nextSibling.dataset,i)var m=i.dgst;return i=m,c=Error(u(419)),i=Tl(c,i,void 0),Eo(e,t,h,i)}if(m=(h&e.childLanes)!==0,ot||m){if(i=Ve,i!==null){switch(h&-h){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|h))!==0?0:a,a!==0&&a!==c.retryLane&&(c.retryLane=a,Nt(e,a),jt(i,e,a,-1))}return Jl(),i=Tl(Error(u(421))),Eo(e,t,h,i)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=xf.bind(null,e),a._reactRetry=t,null):(e=c.treeContext,ct=Jt(a.nextSibling),ut=t,Me=!0,St=null,e!==null&&(pt[ft++]=It,pt[ft++]=$t,pt[ft++]=fn,It=e.id,$t=e.overflow,fn=t),t=Rl(t,i.children),t.flags|=4096,t)}function Qu(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),ul(e.return,t,n)}function Ml(e,t,n,i,a){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:a}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=i,c.tail=n,c.tailMode=a)}function Yu(e,t,n){var i=t.pendingProps,a=i.revealOrder,c=i.tail;if(qe(e,t,i.children,n),i=Ie.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qu(e,n,t);else if(e.tag===19)Qu(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}i&=1}if(_e(Ie,i),(t.mode&1)===0)t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&jo(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Ml(t,!1,a,n,c);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&jo(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Ml(t,!0,n,null,c);break;case"together":Ml(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ro(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Bt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mn|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=ln(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ln(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function rf(e,t,n){switch(t.tag){case 3:Hu(t),Dn();break;case 5:su(t);break;case 1:rt(t.type)&&go(t);break;case 4:pl(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,a=t.memoizedProps.value;_e(So,i._currentValue),i._currentValue=a;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(_e(Ie,Ie.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Vu(e,t,n):(_e(Ie,Ie.current&1),e=Bt(e,t,n),e!==null?e.sibling:null);_e(Ie,Ie.current&1);break;case 19:if(i=(n&t.childLanes)!==0,(e.flags&128)!==0){if(i)return Yu(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),_e(Ie,Ie.current),i)break;return null;case 22:case 23:return t.lanes=0,Du(e,t,n)}return Bt(e,t,n)}var Ju,Fl,Ku,Gu;Ju=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Fl=function(){},Ku=function(e,t,n,i){var a=e.memoizedProps;if(a!==i){e=t.stateNode,xn(_t.current);var c=null;switch(n){case"input":a=ui(e,a),i=ui(e,i),c=[];break;case"select":a=X({},a,{value:void 0}),i=X({},i,{value:void 0}),c=[];break;case"textarea":a=pi(e,a),i=pi(e,i),c=[];break;default:typeof a.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=co)}gi(n,i);var h;n=null;for(F in a)if(!i.hasOwnProperty(F)&&a.hasOwnProperty(F)&&a[F]!=null)if(F==="style"){var m=a[F];for(h in m)m.hasOwnProperty(h)&&(n||(n={}),n[h]="")}else F!=="dangerouslySetInnerHTML"&&F!=="children"&&F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&F!=="autoFocus"&&(d.hasOwnProperty(F)?c||(c=[]):(c=c||[]).push(F,null));for(F in i){var k=i[F];if(m=a?.[F],i.hasOwnProperty(F)&&k!==m&&(k!=null||m!=null))if(F==="style")if(m){for(h in m)!m.hasOwnProperty(h)||k&&k.hasOwnProperty(h)||(n||(n={}),n[h]="");for(h in k)k.hasOwnProperty(h)&&m[h]!==k[h]&&(n||(n={}),n[h]=k[h])}else n||(c||(c=[]),c.push(F,n)),n=k;else F==="dangerouslySetInnerHTML"?(k=k?k.__html:void 0,m=m?m.__html:void 0,k!=null&&m!==k&&(c=c||[]).push(F,k)):F==="children"?typeof k!="string"&&typeof k!="number"||(c=c||[]).push(F,""+k):F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&(d.hasOwnProperty(F)?(k!=null&&F==="onScroll"&&Le("scroll",e),c||m===k||(c=[])):(c=c||[]).push(F,k))}n&&(c=c||[]).push("style",n);var F=c;(t.updateQueue=F)&&(t.flags|=4)}},Gu=function(e,t,n,i){n!==i&&(t.flags|=4)};function Rr(e,t){if(!Me)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 i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,i|=a.subtreeFlags&14680064,i|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,i|=a.subtreeFlags,i|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function of(e,t,n){var i=t.pendingProps;switch(nl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return rt(t.type)&&fo(),Xe(t),null;case 3:return i=t.stateNode,Un(),ze(nt),ze(Ke),hl(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(mo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,St!==null&&(Vl(St),St=null))),Fl(e,t),Xe(t),null;case 5:fl(t);var a=xn(Pr.current);if(n=t.type,e!==null&&t.stateNode!=null)Ku(e,t,n,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(u(166));return Xe(t),null}if(e=xn(_t.current),mo(t)){i=t.stateNode,n=t.type;var c=t.memoizedProps;switch(i[Pt]=t,i[kr]=c,e=(t.mode&1)!==0,n){case"dialog":Le("cancel",i),Le("close",i);break;case"iframe":case"object":case"embed":Le("load",i);break;case"video":case"audio":for(a=0;a<vr.length;a++)Le(vr[a],i);break;case"source":Le("error",i);break;case"img":case"image":case"link":Le("error",i),Le("load",i);break;case"details":Le("toggle",i);break;case"input":zs(i,c),Le("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!c.multiple},Le("invalid",i);break;case"textarea":Ms(i,c),Le("invalid",i)}gi(n,c),a=null;for(var h in c)if(c.hasOwnProperty(h)){var m=c[h];h==="children"?typeof m=="string"?i.textContent!==m&&(c.suppressHydrationWarning!==!0&&uo(i.textContent,m,e),a=["children",m]):typeof m=="number"&&i.textContent!==""+m&&(c.suppressHydrationWarning!==!0&&uo(i.textContent,m,e),a=["children",""+m]):d.hasOwnProperty(h)&&m!=null&&h==="onScroll"&&Le("scroll",i)}switch(n){case"input":Fe(i),Rs(i,c,!0);break;case"textarea":Fe(i),Is(i);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(i.onclick=co)}i=a,t.updateQueue=i,i!==null&&(t.flags|=4)}else{h=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=$s(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=h.createElement(n,{is:i.is}):(e=h.createElement(n),n==="select"&&(h=e,i.multiple?h.multiple=!0:i.size&&(h.size=i.size))):e=h.createElementNS(e,n),e[Pt]=t,e[kr]=i,Ju(e,t,!1,!1),t.stateNode=e;e:{switch(h=hi(n,i),n){case"dialog":Le("cancel",e),Le("close",e),a=i;break;case"iframe":case"object":case"embed":Le("load",e),a=i;break;case"video":case"audio":for(a=0;a<vr.length;a++)Le(vr[a],e);a=i;break;case"source":Le("error",e),a=i;break;case"img":case"image":case"link":Le("error",e),Le("load",e),a=i;break;case"details":Le("toggle",e),a=i;break;case"input":zs(e,i),a=ui(e,i),Le("invalid",e);break;case"option":a=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},a=X({},i,{value:void 0}),Le("invalid",e);break;case"textarea":Ms(e,i),a=pi(e,i),Le("invalid",e);break;default:a=i}gi(n,a),m=a;for(c in m)if(m.hasOwnProperty(c)){var k=m[c];c==="style"?Bs(e,k):c==="dangerouslySetInnerHTML"?(k=k?k.__html:void 0,k!=null&&Ns(e,k)):c==="children"?typeof k=="string"?(n!=="textarea"||k!=="")&&er(e,k):typeof k=="number"&&er(e,""+k):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(d.hasOwnProperty(c)?k!=null&&c==="onScroll"&&Le("scroll",e):k!=null&&U(e,c,k,h))}switch(n){case"input":Fe(e),Rs(e,i,!1);break;case"textarea":Fe(e),Is(e);break;case"option":i.value!=null&&e.setAttribute("value",""+ke(i.value));break;case"select":e.multiple=!!i.multiple,c=i.value,c!=null?Cn(e,!!i.multiple,c,!1):i.defaultValue!=null&&Cn(e,!!i.multiple,i.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=co)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Xe(t),null;case 6:if(e&&t.stateNode!=null)Gu(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(n=xn(Pr.current),xn(_t.current),mo(t)){if(i=t.stateNode,n=t.memoizedProps,i[Pt]=t,(c=i.nodeValue!==n)&&(e=ut,e!==null))switch(e.tag){case 3:uo(i.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&uo(i.nodeValue,n,(e.mode&1)!==0)}c&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Pt]=t,t.stateNode=i}return Xe(t),null;case 13:if(ze(Ie),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Me&&ct!==null&&(t.mode&1)!==0&&(t.flags&128)===0)qa(),Dn(),t.flags|=98560,c=!1;else if(c=mo(t),i!==null&&i.dehydrated!==null){if(e===null){if(!c)throw Error(u(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(u(317));c[Pt]=t}else Dn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),c=!1}else St!==null&&(Vl(St),St=null),c=!0;if(!c)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ie.current&1)!==0?He===0&&(He=3):Jl())),t.updateQueue!==null&&(t.flags|=4),Xe(t),null);case 4:return Un(),Fl(e,t),e===null&&Sr(t.stateNode.containerInfo),Xe(t),null;case 10:return al(t.type._context),Xe(t),null;case 17:return rt(t.type)&&fo(),Xe(t),null;case 19:if(ze(Ie),c=t.memoizedState,c===null)return Xe(t),null;if(i=(t.flags&128)!==0,h=c.rendering,h===null)if(i)Rr(c,!1);else{if(He!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=jo(e),h!==null){for(t.flags|=128,Rr(c,!1),i=h.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)c=n,e=i,c.flags&=14680066,h=c.alternate,h===null?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=h.childLanes,c.lanes=h.lanes,c.child=h.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=h.memoizedProps,c.memoizedState=h.memoizedState,c.updateQueue=h.updateQueue,c.type=h.type,e=h.dependencies,c.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _e(Ie,Ie.current&1|2),t.child}e=e.sibling}c.tail!==null&&Be()>Jn&&(t.flags|=128,i=!0,Rr(c,!1),t.lanes=4194304)}else{if(!i)if(e=jo(h),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Rr(c,!0),c.tail===null&&c.tailMode==="hidden"&&!h.alternate&&!Me)return Xe(t),null}else 2*Be()-c.renderingStartTime>Jn&&n!==1073741824&&(t.flags|=128,i=!0,Rr(c,!1),t.lanes=4194304);c.isBackwards?(h.sibling=t.child,t.child=h):(n=c.last,n!==null?n.sibling=h:t.child=h,c.last=h)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Be(),t.sibling=null,n=Ie.current,_e(Ie,i?n&1|2:n&1),t):(Xe(t),null);case 22:case 23:return Yl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(dt&1073741824)!==0&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),null;case 24:return null;case 25:return null}throw Error(u(156,t.tag))}function lf(e,t){switch(nl(t),t.tag){case 1:return rt(t.type)&&fo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Un(),ze(nt),ze(Ke),hl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return fl(t),null;case 13:if(ze(Ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Dn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ze(Ie),null;case 4:return Un(),null;case 10:return al(t.type._context),null;case 22:case 23:return Yl(),null;case 24:return null;default:return null}}var Mo=!1,Ze=!1,sf=typeof WeakSet=="function"?WeakSet:Set,te=null;function Qn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){Oe(e,t,i)}else n.current=null}function Il(e,t,n){try{n()}catch(i){Oe(e,t,i)}}var Xu=!1;function af(e,t){if(Yi=Zr,e=La(),Bi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,c=i.focusNode;i=i.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var h=0,m=-1,k=-1,F=0,D=0,A=e,B=null;t:for(;;){for(var q;A!==n||a!==0&&A.nodeType!==3||(m=h+a),A!==c||i!==0&&A.nodeType!==3||(k=h+i),A.nodeType===3&&(h+=A.nodeValue.length),(q=A.firstChild)!==null;)B=A,A=q;for(;;){if(A===e)break t;if(B===n&&++F===a&&(m=h),B===c&&++D===i&&(k=h),(q=A.nextSibling)!==null)break;A=B,B=A.parentNode}A=q}n=m===-1||k===-1?null:{start:m,end:k}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ji={focusedElem:e,selectionRange:n},Zr=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var ne=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ne!==null){var re=ne.memoizedProps,De=ne.memoizedState,E=t.stateNode,C=E.getSnapshotBeforeUpdate(t.elementType===t.type?re:bt(t.type,re),De);E.__reactInternalSnapshotBeforeUpdate=C}break;case 3:var M=t.stateNode.containerInfo;M.nodeType===1?M.textContent="":M.nodeType===9&&M.documentElement&&M.removeChild(M.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(Q){Oe(t,t.return,Q)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return ne=Xu,Xu=!1,ne}function Mr(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var a=i=i.next;do{if((a.tag&e)===e){var c=a.destroy;a.destroy=void 0,c!==void 0&&Il(t,n,c)}a=a.next}while(a!==i)}}function Fo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function $l(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Zu(e){var t=e.alternate;t!==null&&(e.alternate=null,Zu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Pt],delete t[kr],delete t[Zi],delete t[Hp],delete t[Up])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function qu(e){return e.tag===5||e.tag===3||e.tag===4}function ec(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qu(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.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 Nl(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=co));else if(i!==4&&(e=e.child,e!==null))for(Nl(e,t,n),e=e.sibling;e!==null;)Nl(e,t,n),e=e.sibling}function Ol(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Ol(e,t,n),e=e.sibling;e!==null;)Ol(e,t,n),e=e.sibling}var Ye=null,kt=!1;function en(e,t,n){for(n=n.child;n!==null;)tc(e,t,n),n=n.sibling}function tc(e,t,n){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Qr,n)}catch{}switch(n.tag){case 5:Ze||Qn(n,t);case 6:var i=Ye,a=kt;Ye=null,en(e,t,n),Ye=i,kt=a,Ye!==null&&(kt?(e=Ye,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ye.removeChild(n.stateNode));break;case 18:Ye!==null&&(kt?(e=Ye,n=n.stateNode,e.nodeType===8?Xi(e.parentNode,n):e.nodeType===1&&Xi(e,n),dr(e)):Xi(Ye,n.stateNode));break;case 4:i=Ye,a=kt,Ye=n.stateNode.containerInfo,kt=!0,en(e,t,n),Ye=i,kt=a;break;case 0:case 11:case 14:case 15:if(!Ze&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){a=i=i.next;do{var c=a,h=c.destroy;c=c.tag,h!==void 0&&((c&2)!==0||(c&4)!==0)&&Il(n,t,h),a=a.next}while(a!==i)}en(e,t,n);break;case 1:if(!Ze&&(Qn(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(m){Oe(n,t,m)}en(e,t,n);break;case 21:en(e,t,n);break;case 22:n.mode&1?(Ze=(i=Ze)||n.memoizedState!==null,en(e,t,n),Ze=i):en(e,t,n);break;default:en(e,t,n)}}function nc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new sf),t.forEach(function(i){var a=yf.bind(null,e,i);n.has(i)||(n.add(i),i.then(a,a))})}}function wt(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var c=e,h=t,m=h;e:for(;m!==null;){switch(m.tag){case 5:Ye=m.stateNode,kt=!1;break e;case 3:Ye=m.stateNode.containerInfo,kt=!0;break e;case 4:Ye=m.stateNode.containerInfo,kt=!0;break e}m=m.return}if(Ye===null)throw Error(u(160));tc(c,h,a),Ye=null,kt=!1;var k=a.alternate;k!==null&&(k.return=null),a.return=null}catch(F){Oe(a,t,F)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)rc(t,e),t=t.sibling}function rc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(wt(t,e),zt(e),i&4){try{Mr(3,e,e.return),Fo(3,e)}catch(re){Oe(e,e.return,re)}try{Mr(5,e,e.return)}catch(re){Oe(e,e.return,re)}}break;case 1:wt(t,e),zt(e),i&512&&n!==null&&Qn(n,n.return);break;case 5:if(wt(t,e),zt(e),i&512&&n!==null&&Qn(n,n.return),e.flags&32){var a=e.stateNode;try{er(a,"")}catch(re){Oe(e,e.return,re)}}if(i&4&&(a=e.stateNode,a!=null)){var c=e.memoizedProps,h=n!==null?n.memoizedProps:c,m=e.type,k=e.updateQueue;if(e.updateQueue=null,k!==null)try{m==="input"&&c.type==="radio"&&c.name!=null&&Es(a,c),hi(m,h);var F=hi(m,c);for(h=0;h<k.length;h+=2){var D=k[h],A=k[h+1];D==="style"?Bs(a,A):D==="dangerouslySetInnerHTML"?Ns(a,A):D==="children"?er(a,A):U(a,D,A,F)}switch(m){case"input":ci(a,c);break;case"textarea":Fs(a,c);break;case"select":var B=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!c.multiple;var q=c.value;q!=null?Cn(a,!!c.multiple,q,!1):B!==!!c.multiple&&(c.defaultValue!=null?Cn(a,!!c.multiple,c.defaultValue,!0):Cn(a,!!c.multiple,c.multiple?[]:"",!1))}a[kr]=c}catch(re){Oe(e,e.return,re)}}break;case 6:if(wt(t,e),zt(e),i&4){if(e.stateNode===null)throw Error(u(162));a=e.stateNode,c=e.memoizedProps;try{a.nodeValue=c}catch(re){Oe(e,e.return,re)}}break;case 3:if(wt(t,e),zt(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{dr(t.containerInfo)}catch(re){Oe(e,e.return,re)}break;case 4:wt(t,e),zt(e);break;case 13:wt(t,e),zt(e),a=e.child,a.flags&8192&&(c=a.memoizedState!==null,a.stateNode.isHidden=c,!c||a.alternate!==null&&a.alternate.memoizedState!==null||(Wl=Be())),i&4&&nc(e);break;case 22:if(D=n!==null&&n.memoizedState!==null,e.mode&1?(Ze=(F=Ze)||D,wt(t,e),Ze=F):wt(t,e),zt(e),i&8192){if(F=e.memoizedState!==null,(e.stateNode.isHidden=F)&&!D&&(e.mode&1)!==0)for(te=e,D=e.child;D!==null;){for(A=te=D;te!==null;){switch(B=te,q=B.child,B.tag){case 0:case 11:case 14:case 15:Mr(4,B,B.return);break;case 1:Qn(B,B.return);var ne=B.stateNode;if(typeof ne.componentWillUnmount=="function"){i=B,n=B.return;try{t=i,ne.props=t.memoizedProps,ne.state=t.memoizedState,ne.componentWillUnmount()}catch(re){Oe(i,n,re)}}break;case 5:Qn(B,B.return);break;case 22:if(B.memoizedState!==null){lc(A);continue}}q!==null?(q.return=B,te=q):lc(A)}D=D.sibling}e:for(D=null,A=e;;){if(A.tag===5){if(D===null){D=A;try{a=A.stateNode,F?(c=a.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(m=A.stateNode,k=A.memoizedProps.style,h=k!=null&&k.hasOwnProperty("display")?k.display:null,m.style.display=Os("display",h))}catch(re){Oe(e,e.return,re)}}}else if(A.tag===6){if(D===null)try{A.stateNode.nodeValue=F?"":A.memoizedProps}catch(re){Oe(e,e.return,re)}}else if((A.tag!==22&&A.tag!==23||A.memoizedState===null||A===e)&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===e)break e;for(;A.sibling===null;){if(A.return===null||A.return===e)break e;D===A&&(D=null),A=A.return}D===A&&(D=null),A.sibling.return=A.return,A=A.sibling}}break;case 19:wt(t,e),zt(e),i&4&&nc(e);break;case 21:break;default:wt(t,e),zt(e)}}function zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(qu(n)){var i=n;break e}n=n.return}throw Error(u(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(er(a,""),i.flags&=-33);var c=ec(e);Ol(e,c,a);break;case 3:case 4:var h=i.stateNode.containerInfo,m=ec(e);Nl(e,m,h);break;default:throw Error(u(161))}}catch(k){Oe(e,e.return,k)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function uf(e,t,n){te=e,oc(e)}function oc(e,t,n){for(var i=(e.mode&1)!==0;te!==null;){var a=te,c=a.child;if(a.tag===22&&i){var h=a.memoizedState!==null||Mo;if(!h){var m=a.alternate,k=m!==null&&m.memoizedState!==null||Ze;m=Mo;var F=Ze;if(Mo=h,(Ze=k)&&!F)for(te=a;te!==null;)h=te,k=h.child,h.tag===22&&h.memoizedState!==null?sc(a):k!==null?(k.return=h,te=k):sc(a);for(;c!==null;)te=c,oc(c),c=c.sibling;te=a,Mo=m,Ze=F}ic(e)}else(a.subtreeFlags&8772)!==0&&c!==null?(c.return=a,te=c):ic(e)}}function ic(e){for(;te!==null;){var t=te;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Ze||Fo(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ze)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:bt(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var c=t.updateQueue;c!==null&&lu(t,c,i);break;case 3:var h=t.updateQueue;if(h!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}lu(t,h,n)}break;case 5:var m=t.stateNode;if(n===null&&t.flags&4){n=m;var k=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":k.autoFocus&&n.focus();break;case"img":k.src&&(n.src=k.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var F=t.alternate;if(F!==null){var D=F.memoizedState;if(D!==null){var A=D.dehydrated;A!==null&&dr(A)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(u(163))}Ze||t.flags&512&&$l(t)}catch(B){Oe(t,t.return,B)}}if(t===e){te=null;break}if(n=t.sibling,n!==null){n.return=t.return,te=n;break}te=t.return}}function lc(e){for(;te!==null;){var t=te;if(t===e){te=null;break}var n=t.sibling;if(n!==null){n.return=t.return,te=n;break}te=t.return}}function sc(e){for(;te!==null;){var t=te;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Fo(4,t)}catch(k){Oe(t,n,k)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var a=t.return;try{i.componentDidMount()}catch(k){Oe(t,a,k)}}var c=t.return;try{$l(t)}catch(k){Oe(t,c,k)}break;case 5:var h=t.return;try{$l(t)}catch(k){Oe(t,h,k)}}}catch(k){Oe(t,t.return,k)}if(t===e){te=null;break}var m=t.sibling;if(m!==null){m.return=t.return,te=m;break}te=t.return}}var cf=Math.ceil,Io=W.ReactCurrentDispatcher,Bl=W.ReactCurrentOwner,xt=W.ReactCurrentBatchConfig,be=0,Ve=null,We=null,Je=0,dt=0,Yn=Kt(0),He=0,Fr=null,mn=0,$o=0,Dl=0,Ir=null,it=null,Wl=0,Jn=1/0,Dt=null,No=!1,Al=null,tn=null,Oo=!1,nn=null,Bo=0,$r=0,Hl=null,Do=-1,Wo=0;function et(){return(be&6)!==0?Be():Do!==-1?Do:Do=Be()}function rn(e){return(e.mode&1)===0?1:(be&2)!==0&&Je!==0?Je&-Je:Qp.transition!==null?(Wo===0&&(Wo=ea()),Wo):(e=Ce,e!==0||(e=window.event,e=e===void 0?16:ua(e.type)),e)}function jt(e,t,n,i){if(50<$r)throw $r=0,Hl=null,Error(u(185));lr(e,n,i),((be&2)===0||e!==Ve)&&(e===Ve&&((be&2)===0&&($o|=n),He===4&&on(e,Je)),lt(e,i),n===1&&be===0&&(t.mode&1)===0&&(Jn=Be()+500,ho&&Xt()))}function lt(e,t){var n=e.callbackNode;Qd(e,t);var i=Kr(e,e===Ve?Je:0);if(i===0)n!==null&&Xs(n),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(n!=null&&Xs(n),t===1)e.tag===0?Vp(uc.bind(null,e)):Ja(uc.bind(null,e)),Wp(function(){(be&6)===0&&Xt()}),n=null;else{switch(ta(i)){case 1:n=ki;break;case 4:n=Zs;break;case 16:n=Vr;break;case 536870912:n=qs;break;default:n=Vr}n=yc(n,ac.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ac(e,t){if(Do=-1,Wo=0,(be&6)!==0)throw Error(u(327));var n=e.callbackNode;if(Kn()&&e.callbackNode!==n)return null;var i=Kr(e,e===Ve?Je:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||t)t=Ao(e,i);else{t=i;var a=be;be|=2;var c=dc();(Ve!==e||Je!==t)&&(Dt=null,Jn=Be()+500,Sn(e,t));do try{ff();break}catch(m){cc(e,m)}while(!0);sl(),Io.current=c,be=a,We!==null?t=0:(Ve=null,Je=0,t=He)}if(t!==0){if(t===2&&(a=wi(e),a!==0&&(i=a,t=Ul(e,a))),t===1)throw n=Fr,Sn(e,0),on(e,i),lt(e,Be()),n;if(t===6)on(e,i);else{if(a=e.current.alternate,(i&30)===0&&!df(a)&&(t=Ao(e,i),t===2&&(c=wi(e),c!==0&&(i=c,t=Ul(e,c))),t===1))throw n=Fr,Sn(e,0),on(e,i),lt(e,Be()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(u(345));case 2:bn(e,it,Dt);break;case 3:if(on(e,i),(i&130023424)===i&&(t=Wl+500-Be(),10<t)){if(Kr(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){et(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Gi(bn.bind(null,e,it,Dt),t);break}bn(e,it,Dt);break;case 4:if(on(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var h=31-mt(i);c=1<<h,h=t[h],h>a&&(a=h),i&=~c}if(i=a,i=Be()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*cf(i/1960))-i,10<i){e.timeoutHandle=Gi(bn.bind(null,e,it,Dt),i);break}bn(e,it,Dt);break;case 5:bn(e,it,Dt);break;default:throw Error(u(329))}}}return lt(e,Be()),e.callbackNode===n?ac.bind(null,e):null}function Ul(e,t){var n=Ir;return e.current.memoizedState.isDehydrated&&(Sn(e,t).flags|=256),e=Ao(e,t),e!==2&&(t=it,it=n,t!==null&&Vl(t)),e}function Vl(e){it===null?it=e:it.push.apply(it,e)}function df(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var i=0;i<n.length;i++){var a=n[i],c=a.getSnapshot;a=a.value;try{if(!vt(c(),a))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 on(e,t){for(t&=~Dl,t&=~$o,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-mt(t),i=1<<n;e[n]=-1,t&=~i}}function uc(e){if((be&6)!==0)throw Error(u(327));Kn();var t=Kr(e,0);if((t&1)===0)return lt(e,Be()),null;var n=Ao(e,t);if(e.tag!==0&&n===2){var i=wi(e);i!==0&&(t=i,n=Ul(e,i))}if(n===1)throw n=Fr,Sn(e,0),on(e,t),lt(e,Be()),n;if(n===6)throw Error(u(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bn(e,it,Dt),lt(e,Be()),null}function Ql(e,t){var n=be;be|=1;try{return e(t)}finally{be=n,be===0&&(Jn=Be()+500,ho&&Xt())}}function vn(e){nn!==null&&nn.tag===0&&(be&6)===0&&Kn();var t=be;be|=1;var n=xt.transition,i=Ce;try{if(xt.transition=null,Ce=1,e)return e()}finally{Ce=i,xt.transition=n,be=t,(be&6)===0&&Xt()}}function Yl(){dt=Yn.current,ze(Yn)}function Sn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Dp(n)),We!==null)for(n=We.return;n!==null;){var i=n;switch(nl(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&fo();break;case 3:Un(),ze(nt),ze(Ke),hl();break;case 5:fl(i);break;case 4:Un();break;case 13:ze(Ie);break;case 19:ze(Ie);break;case 10:al(i.type._context);break;case 22:case 23:Yl()}n=n.return}if(Ve=e,We=e=ln(e.current,null),Je=dt=t,He=0,Fr=null,Dl=$o=mn=0,it=Ir=null,hn!==null){for(t=0;t<hn.length;t++)if(n=hn[t],i=n.interleaved,i!==null){n.interleaved=null;var a=i.next,c=n.pending;if(c!==null){var h=c.next;c.next=a,i.next=h}n.pending=i}hn=null}return e}function cc(e,t){do{var n=We;try{if(sl(),Co.current=Lo,To){for(var i=$e.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}To=!1}if(yn=0,Ue=Ae=$e=null,_r=!1,Lr=0,Bl.current=null,n===null||n.return===null){He=1,Fr=t,We=null;break}e:{var c=e,h=n.return,m=n,k=t;if(t=Je,m.flags|=32768,k!==null&&typeof k=="object"&&typeof k.then=="function"){var F=k,D=m,A=D.tag;if((D.mode&1)===0&&(A===0||A===11||A===15)){var B=D.alternate;B?(D.updateQueue=B.updateQueue,D.memoizedState=B.memoizedState,D.lanes=B.lanes):(D.updateQueue=null,D.memoizedState=null)}var q=Iu(h);if(q!==null){q.flags&=-257,$u(q,h,m,c,t),q.mode&1&&Fu(c,F,t),t=q,k=F;var ne=t.updateQueue;if(ne===null){var re=new Set;re.add(k),t.updateQueue=re}else ne.add(k);break e}else{if((t&1)===0){Fu(c,F,t),Jl();break e}k=Error(u(426))}}else if(Me&&m.mode&1){var De=Iu(h);if(De!==null){(De.flags&65536)===0&&(De.flags|=256),$u(De,h,m,c,t),il(Vn(k,m));break e}}c=k=Vn(k,m),He!==4&&(He=2),Ir===null?Ir=[c]:Ir.push(c),c=h;do{switch(c.tag){case 3:c.flags|=65536,t&=-t,c.lanes|=t;var E=Ru(c,k,t);iu(c,E);break e;case 1:m=k;var C=c.type,M=c.stateNode;if((c.flags&128)===0&&(typeof C.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&(tn===null||!tn.has(M)))){c.flags|=65536,t&=-t,c.lanes|=t;var Q=Mu(c,m,t);iu(c,Q);break e}}c=c.return}while(c!==null)}fc(n)}catch(oe){t=oe,We===n&&n!==null&&(We=n=n.return);continue}break}while(!0)}function dc(){var e=Io.current;return Io.current=Lo,e===null?Lo:e}function Jl(){(He===0||He===3||He===2)&&(He=4),Ve===null||(mn&268435455)===0&&($o&268435455)===0||on(Ve,Je)}function Ao(e,t){var n=be;be|=2;var i=dc();(Ve!==e||Je!==t)&&(Dt=null,Sn(e,t));do try{pf();break}catch(a){cc(e,a)}while(!0);if(sl(),be=n,Io.current=i,We!==null)throw Error(u(261));return Ve=null,Je=0,He}function pf(){for(;We!==null;)pc(We)}function ff(){for(;We!==null&&!Nd();)pc(We)}function pc(e){var t=xc(e.alternate,e,dt);e.memoizedProps=e.pendingProps,t===null?fc(e):We=t,Bl.current=null}function fc(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=of(n,t,dt),n!==null){We=n;return}}else{if(n=lf(n,t),n!==null){n.flags&=32767,We=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{He=6,We=null;return}}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);He===0&&(He=5)}function bn(e,t,n){var i=Ce,a=xt.transition;try{xt.transition=null,Ce=1,gf(e,t,n,i)}finally{xt.transition=a,Ce=i}return null}function gf(e,t,n,i){do Kn();while(nn!==null);if((be&6)!==0)throw Error(u(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(u(177));e.callbackNode=null,e.callbackPriority=0;var c=n.lanes|n.childLanes;if(Yd(e,c),e===Ve&&(We=Ve=null,Je=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Oo||(Oo=!0,yc(Vr,function(){return Kn(),null})),c=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||c){c=xt.transition,xt.transition=null;var h=Ce;Ce=1;var m=be;be|=4,Bl.current=null,af(e,n),rc(n,e),Mp(Ji),Zr=!!Yi,Ji=Yi=null,e.current=n,uf(n),Od(),be=m,Ce=h,xt.transition=c}else e.current=n;if(Oo&&(Oo=!1,nn=e,Bo=a),c=e.pendingLanes,c===0&&(tn=null),Wd(n.stateNode),lt(e,Be()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(No)throw No=!1,e=Al,Al=null,e;return(Bo&1)!==0&&e.tag!==0&&Kn(),c=e.pendingLanes,(c&1)!==0?e===Hl?$r++:($r=0,Hl=e):$r=0,Xt(),null}function Kn(){if(nn!==null){var e=ta(Bo),t=xt.transition,n=Ce;try{if(xt.transition=null,Ce=16>e?16:e,nn===null)var i=!1;else{if(e=nn,nn=null,Bo=0,(be&6)!==0)throw Error(u(331));var a=be;for(be|=4,te=e.current;te!==null;){var c=te,h=c.child;if((te.flags&16)!==0){var m=c.deletions;if(m!==null){for(var k=0;k<m.length;k++){var F=m[k];for(te=F;te!==null;){var D=te;switch(D.tag){case 0:case 11:case 15:Mr(8,D,c)}var A=D.child;if(A!==null)A.return=D,te=A;else for(;te!==null;){D=te;var B=D.sibling,q=D.return;if(Zu(D),D===F){te=null;break}if(B!==null){B.return=q,te=B;break}te=q}}}var ne=c.alternate;if(ne!==null){var re=ne.child;if(re!==null){ne.child=null;do{var De=re.sibling;re.sibling=null,re=De}while(re!==null)}}te=c}}if((c.subtreeFlags&2064)!==0&&h!==null)h.return=c,te=h;else e:for(;te!==null;){if(c=te,(c.flags&2048)!==0)switch(c.tag){case 0:case 11:case 15:Mr(9,c,c.return)}var E=c.sibling;if(E!==null){E.return=c.return,te=E;break e}te=c.return}}var C=e.current;for(te=C;te!==null;){h=te;var M=h.child;if((h.subtreeFlags&2064)!==0&&M!==null)M.return=h,te=M;else e:for(h=C;te!==null;){if(m=te,(m.flags&2048)!==0)try{switch(m.tag){case 0:case 11:case 15:Fo(9,m)}}catch(oe){Oe(m,m.return,oe)}if(m===h){te=null;break e}var Q=m.sibling;if(Q!==null){Q.return=m.return,te=Q;break e}te=m.return}}if(be=a,Xt(),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(Qr,e)}catch{}i=!0}return i}finally{Ce=n,xt.transition=t}}return!1}function gc(e,t,n){t=Vn(n,t),t=Ru(e,t,1),e=qt(e,t,1),t=et(),e!==null&&(lr(e,1,t),lt(e,t))}function Oe(e,t,n){if(e.tag===3)gc(e,e,n);else for(;t!==null;){if(t.tag===3){gc(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(tn===null||!tn.has(i))){e=Vn(n,e),e=Mu(t,e,1),t=qt(t,e,1),e=et(),t!==null&&(lr(t,1,e),lt(t,e));break}}t=t.return}}function hf(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),t=et(),e.pingedLanes|=e.suspendedLanes&n,Ve===e&&(Je&n)===n&&(He===4||He===3&&(Je&130023424)===Je&&500>Be()-Wl?Sn(e,0):Dl|=n),lt(e,t)}function hc(e,t){t===0&&((e.mode&1)===0?t=1:(t=Jr,Jr<<=1,(Jr&130023424)===0&&(Jr=4194304)));var n=et();e=Nt(e,t),e!==null&&(lr(e,t,n),lt(e,n))}function xf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hc(e,n)}function yf(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(u(314))}i!==null&&i.delete(t),hc(e,n)}var xc;xc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)ot=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ot=!1,rf(e,t,n);ot=(e.flags&131072)!==0}else ot=!1,Me&&(t.flags&1048576)!==0&&Ka(t,yo,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Ro(e,t),e=t.pendingProps;var a=Nn(t,Ke.current);Hn(t,n),a=ml(null,t,i,e,a,n);var c=vl();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(i)?(c=!0,go(t)):c=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,dl(t),a.updater=zo,t.stateNode=a,a._reactInternals=t,Cl(t,i,e,n),t=Ll(null,t,i,!0,c,n)):(t.tag=0,Me&&c&&tl(t),qe(null,t,a,n),t=t.child),t;case 16:i=t.elementType;e:{switch(Ro(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=vf(i),e=bt(i,e),a){case 0:t=_l(null,t,i,e,n);break e;case 1:t=Au(null,t,i,e,n);break e;case 11:t=Nu(null,t,i,e,n);break e;case 14:t=Ou(null,t,i,bt(i.type,e),n);break e}throw Error(u(306,i,""))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:bt(i,a),_l(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:bt(i,a),Au(e,t,i,a,n);case 3:e:{if(Hu(t),e===null)throw Error(u(387));i=t.pendingProps,c=t.memoizedState,a=c.element,ou(e,t),wo(t,i,null,n);var h=t.memoizedState;if(i=h.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:h.cache,pendingSuspenseBoundaries:h.pendingSuspenseBoundaries,transitions:h.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){a=Vn(Error(u(423)),t),t=Uu(e,t,i,n,a);break e}else if(i!==a){a=Vn(Error(u(424)),t),t=Uu(e,t,i,n,a);break e}else for(ct=Jt(t.stateNode.containerInfo.firstChild),ut=t,Me=!0,St=null,n=nu(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Dn(),i===a){t=Bt(e,t,n);break e}qe(e,t,i,n)}t=t.child}return t;case 5:return su(t),e===null&&ol(t),i=t.type,a=t.pendingProps,c=e!==null?e.memoizedProps:null,h=a.children,Ki(i,a)?h=null:c!==null&&Ki(i,c)&&(t.flags|=32),Wu(e,t),qe(e,t,h,n),t.child;case 6:return e===null&&ol(t),null;case 13:return Vu(e,t,n);case 4:return pl(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Wn(t,null,i,n):qe(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:bt(i,a),Nu(e,t,i,a,n);case 7:return qe(e,t,t.pendingProps,n),t.child;case 8:return qe(e,t,t.pendingProps.children,n),t.child;case 12:return qe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,a=t.pendingProps,c=t.memoizedProps,h=a.value,_e(So,i._currentValue),i._currentValue=h,c!==null)if(vt(c.value,h)){if(c.children===a.children&&!nt.current){t=Bt(e,t,n);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var m=c.dependencies;if(m!==null){h=c.child;for(var k=m.firstContext;k!==null;){if(k.context===i){if(c.tag===1){k=Ot(-1,n&-n),k.tag=2;var F=c.updateQueue;if(F!==null){F=F.shared;var D=F.pending;D===null?k.next=k:(k.next=D.next,D.next=k),F.pending=k}}c.lanes|=n,k=c.alternate,k!==null&&(k.lanes|=n),ul(c.return,n,t),m.lanes|=n;break}k=k.next}}else if(c.tag===10)h=c.type===t.type?null:c.child;else if(c.tag===18){if(h=c.return,h===null)throw Error(u(341));h.lanes|=n,m=h.alternate,m!==null&&(m.lanes|=n),ul(h,n,t),h=c.sibling}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===t){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}qe(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Hn(t,n),a=gt(a),i=i(a),t.flags|=1,qe(e,t,i,n),t.child;case 14:return i=t.type,a=bt(i,t.pendingProps),a=bt(i.type,a),Ou(e,t,i,a,n);case 15:return Bu(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:bt(i,a),Ro(e,t),t.tag=1,rt(i)?(e=!0,go(t)):e=!1,Hn(t,n),zu(t,i,a),Cl(t,i,a,n),Ll(null,t,i,!0,e,n);case 19:return Yu(e,t,n);case 22:return Du(e,t,n)}throw Error(u(156,t.tag))};function yc(e,t){return Gs(e,t)}function mf(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,n,i){return new mf(e,t,n,i)}function Kl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vf(e){if(typeof e=="function")return Kl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Se)return 11;if(e===Ne)return 14}return 2}function ln(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&14680064,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}function Ho(e,t,n,i,a,c){var h=2;if(i=e,typeof e=="function")Kl(e)&&(h=1);else if(typeof e=="string")h=5;else e:switch(e){case K:return kn(n.children,a,c,t);case V:h=8,a|=8;break;case G:return e=yt(12,n,t,a|2),e.elementType=G,e.lanes=c,e;case ve:return e=yt(13,n,t,a),e.elementType=ve,e.lanes=c,e;case Ee:return e=yt(19,n,t,a),e.elementType=Ee,e.lanes=c,e;case xe:return Uo(n,a,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:h=10;break e;case ce:h=9;break e;case Se:h=11;break e;case Ne:h=14;break e;case Re:h=16,i=null;break e}throw Error(u(130,e==null?e:typeof e,""))}return t=yt(h,n,t,a),t.elementType=e,t.type=i,t.lanes=c,t}function kn(e,t,n,i){return e=yt(7,e,i,t),e.lanes=n,e}function Uo(e,t,n,i){return e=yt(22,e,i,t),e.elementType=xe,e.lanes=n,e.stateNode={isHidden:!1},e}function Gl(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function Xl(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}function Sf(e,t,n,i,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ji(0),this.expirationTimes=ji(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ji(0),this.identifierPrefix=i,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Zl(e,t,n,i,a,c,h,m,k){return e=new Sf(e,t,n,m,k),t===1?(t=1,c===!0&&(t|=8)):t=0,c=yt(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},dl(c),e}function bf(e,t,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H,key:i==null?null:""+i,children:e,containerInfo:t,implementation:n}}function mc(e){if(!e)return Gt;e=e._reactInternals;e:{if(cn(e)!==e||e.tag!==1)throw Error(u(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(rt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(u(171))}if(e.tag===1){var n=e.type;if(rt(n))return Qa(e,n,t)}return t}function vc(e,t,n,i,a,c,h,m,k){return e=Zl(n,i,!0,e,a,c,h,m,k),e.context=mc(null),n=e.current,i=et(),a=rn(n),c=Ot(i,a),c.callback=t??null,qt(n,c,a),e.current.lanes=a,lr(e,a,i),lt(e,i),e}function Vo(e,t,n,i){var a=t.current,c=et(),h=rn(a);return n=mc(n),t.context===null?t.context=n:t.pendingContext=n,t=Ot(c,h),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=qt(a,t,h),e!==null&&(jt(e,a,h,c),ko(e,a,h)),h}function Qo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Sc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ql(e,t){Sc(e,t),(e=e.alternate)&&Sc(e,t)}function kf(){return null}var bc=typeof reportError=="function"?reportError:function(e){console.error(e)};function es(e){this._internalRoot=e}Yo.prototype.render=es.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));Vo(e,t,null,null)},Yo.prototype.unmount=es.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vn(function(){Vo(null,e,null,null)}),t[Mt]=null}};function Yo(e){this._internalRoot=e}Yo.prototype.unstable_scheduleHydration=function(e){if(e){var t=oa();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vt.length&&t!==0&&t<Vt[n].priority;n++);Vt.splice(n,0,e),n===0&&sa(e)}};function ts(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Jo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function kc(){}function wf(e,t,n,i,a){if(a){if(typeof i=="function"){var c=i;i=function(){var F=Qo(h);c.call(F)}}var h=vc(t,i,e,0,null,!1,!1,"",kc);return e._reactRootContainer=h,e[Mt]=h.current,Sr(e.nodeType===8?e.parentNode:e),vn(),h}for(;a=e.lastChild;)e.removeChild(a);if(typeof i=="function"){var m=i;i=function(){var F=Qo(k);m.call(F)}}var k=Zl(e,0,!1,null,null,!1,!1,"",kc);return e._reactRootContainer=k,e[Mt]=k.current,Sr(e.nodeType===8?e.parentNode:e),vn(function(){Vo(t,k,n,i)}),k}function Ko(e,t,n,i,a){var c=n._reactRootContainer;if(c){var h=c;if(typeof a=="function"){var m=a;a=function(){var k=Qo(h);m.call(k)}}Vo(t,h,e,a)}else h=wf(n,t,e,a,i);return Qo(h)}na=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ir(t.pendingLanes);n!==0&&(Ci(t,n|1),lt(t,Be()),(be&6)===0&&(Jn=Be()+500,Xt()))}break;case 13:vn(function(){var i=Nt(e,1);if(i!==null){var a=et();jt(i,e,1,a)}}),ql(e,1)}},Ti=function(e){if(e.tag===13){var t=Nt(e,134217728);if(t!==null){var n=et();jt(t,e,134217728,n)}ql(e,134217728)}},ra=function(e){if(e.tag===13){var t=rn(e),n=Nt(e,t);if(n!==null){var i=et();jt(n,e,t,i)}ql(e,t)}},oa=function(){return Ce},ia=function(e,t){var n=Ce;try{return Ce=e,t()}finally{Ce=n}},mi=function(e,t,n){switch(t){case"input":if(ci(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=po(i);if(!a)throw Error(u(90));tt(i),ci(i,a)}}}break;case"textarea":Fs(e,n);break;case"select":t=n.value,t!=null&&Cn(e,!!n.multiple,t,!1)}},Hs=Ql,Us=vn;var jf={usingClientEntryPoint:!1,Events:[wr,In,po,Ws,As,Ql]},Nr={findFiberByHostInstance:dn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Cf={bundleType:Nr.bundleType,version:Nr.version,rendererPackageName:Nr.rendererPackageName,rendererConfig:Nr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:W.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Js(e),e===null?null:e.stateNode},findFiberByHostInstance:Nr.findFiberByHostInstance||kf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Go=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Go.isDisabled&&Go.supportsFiber)try{Qr=Go.inject(Cf),Tt=Go}catch{}}return st.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jf,st.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ts(t))throw Error(u(200));return bf(e,t,null,n)},st.createRoot=function(e,t){if(!ts(e))throw Error(u(299));var n=!1,i="",a=bc;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=Zl(e,1,!1,null,null,n,!1,i,a),e[Mt]=t.current,Sr(e.nodeType===8?e.parentNode:e),new es(t)},st.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=Js(t),e=e===null?null:e.stateNode,e},st.flushSync=function(e){return vn(e)},st.hydrate=function(e,t,n){if(!Jo(t))throw Error(u(200));return Ko(null,e,t,!0,n)},st.hydrateRoot=function(e,t,n){if(!ts(e))throw Error(u(405));var i=n!=null&&n.hydratedSources||null,a=!1,c="",h=bc;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onRecoverableError!==void 0&&(h=n.onRecoverableError)),t=vc(t,null,e,1,n??null,a,!1,c,h),e[Mt]=t.current,Sr(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Yo(t)},st.render=function(e,t,n){if(!Jo(t))throw Error(u(200));return Ko(null,e,t,!1,n)},st.unmountComponentAtNode=function(e){if(!Jo(e))throw Error(u(40));return e._reactRootContainer?(vn(function(){Ko(null,null,e,!1,function(){e._reactRootContainer=null,e[Mt]=null})}),!0):!1},st.unstable_batchedUpdates=Ql,st.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Jo(n))throw Error(u(200));if(e==null||e._reactInternals===void 0)throw Error(u(38));return Ko(e,t,n,!1,i)},st.version="18.3.1-next-f1338f8080-20240426",st}var zc;function Mf(){if(zc)return os.exports;zc=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(s){console.error(s)}}return r(),os.exports=Rf(),os.exports}var Ec;function Ff(){if(Ec)return Xo;Ec=1;var r=Mf();return Xo.createRoot=r.createRoot,Xo.hydrateRoot=r.hydrateRoot,Xo}var If=Ff();const $f=Qc(If),o={bgPrimary:"#ffffff",bgSecondary:"#f8f9fa",bgTertiary:"#f1f3f4",bgCard:"#ffffff",bgHover:"#f1f3f4",bgSelected:"#e8f0fe",bgUnpaired:"#fef7e0",textPrimary:"#202124",textSecondary:"#5f6368",textTertiary:"#80868b",textInverse:"#ffffff",borderLight:"#dadce0",borderMedium:"#bdc1c6",accentBlue:"#1a73e8",accentBlueHover:"#1557b0",accentGreen:"#34a853",accentOrange:"#ea8600",success:"#34a853",warning:"#fbbc04",error:"#ea4335",info:"#1a73e8",buttonPrimary:"#4285f4",buttonPrimaryHover:"#3367d6",buttonSecondary:"#f1f3f4",buttonSecondaryHover:"#e8eaed",buttonDanger:"#ea4335",buttonDangerHover:"#d33b2c",shadowSm:"rgba(60, 64, 67, 0.08)",shadowMd:"rgba(60, 64, 67, 0.12)",shadowLg:"rgba(60, 64, 67, 0.16)"};function Xn(r,s){const u=r.replace("#",""),p=Number.parseInt(u.substring(0,2),16),d=Number.parseInt(u.substring(2,4),16),f=Number.parseInt(u.substring(4,6),16);return`rgba(${p}, ${d}, ${f}, ${s})`}const v={body:"'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",mono:"'Roboto Mono', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace"};function Nf({logs:r,filteredLogs:s,logEndRef:u,getLogColor:p}){return l.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px",fontFamily:v.mono,fontSize:"12px",background:o.bgCard},children:s.length===0?l.jsx("div",{style:{color:o.textSecondary,padding:"40px",textAlign:"center",fontFamily:v.body},children:r.length===0?"No logs available. Start the MCP Shark server to see logs here.":"No logs match the current filter."}):l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:u}),s.map((d,f)=>l.jsxs("div",{style:{display:"flex",gap:"12px",padding:"12px 16px",borderBottom:`1px solid ${o.borderLight}`,background:o.bgCard,transition:"background-color 0.15s ease"},onMouseEnter:x=>{x.currentTarget.style.background=o.bgHover},onMouseLeave:x=>{x.currentTarget.style.background=o.bgCard},children:[l.jsx("span",{style:{color:o.textTertiary,minWidth:"140px",flexShrink:0,fontFamily:v.mono,fontSize:"11px"},children:new Date(d.timestamp).toLocaleTimeString()}),l.jsx("span",{style:{color:o.textTertiary,minWidth:"70px",flexShrink:0,textTransform:"uppercase",fontFamily:v.body,fontSize:"10px",fontWeight:"600",letterSpacing:"0.05em"},children:d.type}),l.jsx("span",{style:{color:p(d.type),whiteSpace:"pre-wrap",wordBreak:"break-word",flex:1,fontFamily:v.mono,fontSize:"12px",lineHeight:"1.5"},children:d.line})]},`${d.timestamp}-${f}`))]})})}var Of={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const Pe=(r,s,u,p)=>{const d=L.forwardRef(({color:f="currentColor",size:x=24,stroke:y=2,title:g,className:j,children:S,...b},T)=>L.createElement("svg",{ref:T,...Of[r],width:x,height:x,className:["tabler-icon",`tabler-icon-${s}`,j].join(" "),strokeWidth:y,stroke:f,...b},[g&&L.createElement("title",{key:"svg-title"},g),...p.map(([_,z])=>L.createElement(_,z)),...Array.isArray(S)?S:[S]]));return d.displayName=`${u}`,d};const Bf=[["path",{d:"M12 9v4",key:"svg-0"}],["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],Df=Pe("outline","alert-triangle","AlertTriangle",Bf);const Wf=[["path",{d:"M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6",key:"svg-0"}],["path",{d:"M9 17v1a3 3 0 0 0 6 0v-1",key:"svg-1"}]],Af=Pe("outline","bell","Bell",Wf);const Hf=[["path",{d:"M4 17v1a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M8 16h8",key:"svg-1"}],["path",{d:"M8.322 12.582l7.956 .836",key:"svg-2"}],["path",{d:"M8.787 9.168l7.826 1.664",key:"svg-3"}],["path",{d:"M10.096 5.764l7.608 2.472",key:"svg-4"}]],Uf=Pe("outline","brand-stackoverflow","BrandStackoverflow",Hf);const Vf=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],Qf=Pe("outline","check","Check",Vf);const Yf=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],ps=Pe("outline","chevron-down","ChevronDown",Yf);const Jf=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],Yc=Pe("outline","clock","Clock",Jf);const Kf=[["path",{d:"M7 8l-4 4l4 4",key:"svg-0"}],["path",{d:"M17 8l4 4l-4 4",key:"svg-1"}],["path",{d:"M14 4l-4 16",key:"svg-2"}]],Gf=Pe("outline","code","Code",Kf);const Xf=[["path",{d:"M12 6m-8 0a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 6v6a8 3 0 0 0 16 0v-6",key:"svg-1"}],["path",{d:"M4 12v6a8 3 0 0 0 16 0v-6",key:"svg-2"}]],Zf=Pe("outline","database","Database",Xf);const qf=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],Jc=Pe("outline","download","Download",qf);const eg=[["path",{d:"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6",key:"svg-0"}],["path",{d:"M11 13l9 -9",key:"svg-1"}],["path",{d:"M15 4h5v5",key:"svg-2"}]],Kc=Pe("outline","external-link","ExternalLink",eg);const tg=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],fs=Pe("outline","eye","Eye",tg);const ng=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M9 9l1 0",key:"svg-2"}],["path",{d:"M9 13l6 0",key:"svg-3"}],["path",{d:"M9 17l6 0",key:"svg-4"}]],rg=Pe("outline","file-text","FileText",ng);const og=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11v6",key:"svg-2"}],["path",{d:"M9.5 13.5l2.5 -2.5l2.5 2.5",key:"svg-3"}]],ig=Pe("outline","file-upload","FileUpload",og);const lg=[["path",{d:"M9 6l11 0",key:"svg-0"}],["path",{d:"M9 12l11 0",key:"svg-1"}],["path",{d:"M9 18l11 0",key:"svg-2"}],["path",{d:"M5 6l0 .01",key:"svg-3"}],["path",{d:"M5 12l0 .01",key:"svg-4"}],["path",{d:"M5 18l0 .01",key:"svg-5"}]],sg=Pe("outline","list","List",lg);const ag=[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l16 0",key:"svg-2"}]],ug=Pe("outline","menu-2","Menu2",ag);const cg=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]],dg=Pe("outline","message","Message",cg);const pg=[["path",{d:"M6 9a6 6 0 1 0 12 0a6 6 0 0 0 -12 0",key:"svg-0"}],["path",{d:"M12 3c1.333 .333 2 2.333 2 6s-.667 5.667 -2 6",key:"svg-1"}],["path",{d:"M12 3c-1.333 .333 -2 2.333 -2 6s.667 5.667 2 6",key:"svg-2"}],["path",{d:"M6 9h12",key:"svg-3"}],["path",{d:"M3 20h7",key:"svg-4"}],["path",{d:"M14 20h7",key:"svg-5"}],["path",{d:"M10 20a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-6"}],["path",{d:"M12 15v3",key:"svg-7"}]],Gc=Pe("outline","network","Network",pg);const fg=[["path",{d:"M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5",key:"svg-0"}],["path",{d:"M12 12l8 -4.5",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}],["path",{d:"M12 12l-8 -4.5",key:"svg-3"}],["path",{d:"M16 5.25l-8 4.5",key:"svg-4"}]],Rc=Pe("outline","package","Package",fg);const gg=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],qo=Pe("outline","refresh","Refresh",gg);const hg=[["path",{d:"M3.06 13a9 9 0 1 0 .49 -4.087",key:"svg-0"}],["path",{d:"M3 4.001v5h5",key:"svg-1"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],xg=Pe("outline","restore","Restore",hg);const yg=[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],Xc=Pe("outline","search","Search",yg);const mg=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],vg=Pe("outline","settings","Settings",mg);const Sg=[["path",{d:"M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3",key:"svg-0"}]],Zc=Pe("outline","shield","Shield",Sg);const bg=[["path",{d:"M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5",key:"svg-0"}]],kg=Pe("outline","tool","Tool",bg);const wg=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],ri=Pe("outline","trash","Trash",wg);const jg=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]],Cg=Pe("outline","user","User",jg);const Tg=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],qc=Pe("outline","x","X",Tg);function Pg({filter:r,setFilter:s,logType:u,setLogType:p,autoScroll:d,setAutoScroll:f,onClearLogs:x,onExportLogs:y,filteredCount:g,totalCount:j}){return l.jsxs("div",{style:{padding:"12px 16px",borderBottom:`1px solid ${o.borderLight}`,background:o.bgCard,display:"flex",gap:"10px",alignItems:"center",flexWrap:"wrap",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[l.jsxs("div",{style:{position:"relative",width:"300px"},children:[l.jsx(Xc,{size:16,stroke:1.5,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:o.textTertiary,pointerEvents:"none"}}),l.jsx("input",{type:"text",placeholder:"Filter logs...",value:r,onChange:S=>s(S.target.value),style:{padding:"8px 12px 8px 36px",background:o.bgCard,border:`1px solid ${o.borderLight}`,color:o.textPrimary,fontSize:"13px",fontFamily:v.body,width:"100%",borderRadius:"8px",transition:"all 0.2s"},onFocus:S=>{S.currentTarget.style.borderColor=o.accentBlue,S.currentTarget.style.boxShadow=`0 0 0 3px ${o.accentBlue}20`},onBlur:S=>{S.currentTarget.style.borderColor=o.borderLight,S.currentTarget.style.boxShadow="none"}})]}),l.jsxs("select",{value:u,onChange:S=>p(S.target.value),style:{padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderLight}`,color:o.textPrimary,fontSize:"13px",fontFamily:v.body,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s"},onFocus:S=>{S.currentTarget.style.borderColor=o.accentBlue,S.currentTarget.style.boxShadow=`0 0 0 3px ${o.accentBlue}20`},onBlur:S=>{S.currentTarget.style.borderColor=o.borderLight,S.currentTarget.style.boxShadow="none"},children:[l.jsx("option",{value:"all",children:"All Types"}),l.jsx("option",{value:"stdout",children:"Stdout"}),l.jsx("option",{value:"stderr",children:"Stderr"}),l.jsx("option",{value:"error",children:"Errors"}),l.jsx("option",{value:"exit",children:"Exit"})]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",color:o.textPrimary,fontSize:"13px",fontFamily:v.body,cursor:"pointer"},children:[l.jsx("input",{type:"checkbox",checked:d,onChange:S=>f(S.target.checked),style:{cursor:"pointer"}}),"Auto-scroll"]}),l.jsxs("button",{type:"button",onClick:x,style:{padding:"8px 14px",background:o.buttonDanger,border:"none",color:o.textInverse,fontSize:"12px",fontFamily:v.body,fontWeight:"500",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`,display:"flex",alignItems:"center",gap:"6px"},onMouseEnter:S=>{S.currentTarget.style.background=o.buttonDangerHover,S.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:S=>{S.currentTarget.style.background=o.buttonDanger,S.currentTarget.style.transform="translateY(0)"},children:[l.jsx(ri,{size:14,stroke:1.5}),"Clear Logs"]}),l.jsxs("button",{type:"button",onClick:y,style:{padding:"8px 14px",background:o.buttonPrimary,border:"none",color:o.textInverse,fontSize:"12px",fontFamily:v.body,fontWeight:"500",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`,display:"flex",alignItems:"center",gap:"6px"},onMouseEnter:S=>{S.currentTarget.style.background=o.buttonPrimaryHover,S.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:S=>{S.currentTarget.style.background=o.buttonPrimary,S.currentTarget.style.transform="translateY(0)"},children:[l.jsx(Jc,{size:14,stroke:1.5}),"Export Logs"]}),l.jsxs("div",{style:{marginLeft:"auto",color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:[g," / ",j," lines"]})]})}function _g(){const[r,s]=L.useState([]),[u,p]=L.useState(!0),[d,f]=L.useState(""),[x,y]=L.useState("all"),g=L.useRef(null),j=L.useRef(null);L.useEffect(()=>{u&&g.current&&g.current.scrollIntoView({behavior:"smooth",block:"start"})},[u]),L.useEffect(()=>{(async()=>{try{const O=await(await fetch("/api/composite/logs?limit=5000")).json();s(O)}catch(I){console.error("Failed to load logs:",I)}})();const R=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,P=new WebSocket(R);return j.current=P,P.onopen=()=>{console.log("WebSocket connected for logs")},P.onerror=I=>{console.error("WebSocket error:",I)},P.onmessage=I=>{try{const O=JSON.parse(I.data);O.type==="log"&&s(U=>[O.data,...U].slice(0,5e3))}catch(O){console.error("Failed to parse WebSocket message:",O)}},P.onclose=()=>{console.log("WebSocket closed, attempting to reconnect..."),setTimeout(()=>{j.current?.readyState===WebSocket.CLOSED&&console.log("WebSocket reconnection needed")},3e3)},()=>{(P.readyState===WebSocket.OPEN||P.readyState===WebSocket.CONNECTING)&&P.close()}},[]);const S=async()=>{try{await fetch("/api/composite/logs/clear",{method:"POST"}),s([])}catch(z){console.error("Failed to clear logs:",z)}},b=z=>{switch(z){case"stderr":case"error":return o.error;case"stdout":return o.textPrimary;case"exit":return o.accentOrange;default:return o.textSecondary}},T=r.filter(z=>!(x!=="all"&&z.type!==x||d&&!z.line.toLowerCase().includes(d.toLowerCase()))),_=async()=>{try{const R=await(await fetch("/api/composite/logs/export")).blob(),P=window.URL.createObjectURL(R),I=document.createElement("a");I.href=P,I.download=`mcp-shark-logs-${new Date().toISOString().replace(/[:.]/g,"-")}.txt`,document.body.appendChild(I),I.click(),window.URL.revokeObjectURL(P),document.body.removeChild(I)}catch(z){console.error("Failed to export logs:",z)}};return l.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",background:o.bgPrimary,overflow:"hidden"},children:[l.jsx(Pg,{filter:d,setFilter:f,logType:x,setLogType:y,autoScroll:u,setAutoScroll:p,onClearLogs:S,onExportLogs:_,filteredCount:T.length,totalCount:r.length}),l.jsx(Nf,{logs:r,filteredLogs:T,logEndRef:g,getLogColor:b})]})}function Lg({backups:r,loadingBackups:s,onRefresh:u,onRestore:p,onView:d,onDelete:f}){return r.length===0?null:l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"20px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[l.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:"Backup Files"}),l.jsxs("button",{type:"button",onClick:u,disabled:s,style:{padding:"4px 8px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:s?"not-allowed":"pointer",fontSize:"11px",borderRadius:"8px",opacity:s?.5:1},title:"Refresh backups",children:[l.jsx(qo,{size:14,stroke:1.5,style:{marginRight:"4px"}}),s?"Loading...":"Refresh"]})]}),l.jsx("p",{style:{fontSize:"12px",color:o.textSecondary,marginBottom:"12px",lineHeight:"1.4"},children:"View, restore, or delete backups of your MCP configuration files. Backups are created automatically when starting MCP Shark."}),l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((x,y)=>l.jsxs("div",{style:{padding:"12px",background:o.bgPrimary,border:`1px solid ${o.borderMedium}`,borderRadius:"8px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{style:{flex:1},children:[l.jsx("div",{style:{color:o.textPrimary,fontSize:"12px",fontWeight:"500",marginBottom:"4px"},children:x.displayPath}),l.jsxs("div",{style:{color:o.textTertiary,fontSize:"11px",fontFamily:v.body},children:["Created: ",new Date(x.modifiedAt||x.createdAt).toLocaleString()," • Size:"," ",(x.size/1024).toFixed(2)," KB"]})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsxs("button",{type:"button",onClick:()=>d(x.backupPath),style:{padding:"6px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:"pointer",fontSize:"12px",borderRadius:"8px",fontWeight:"500"},onMouseEnter:g=>{g.currentTarget.style.background=o.bgCard,g.currentTarget.style.borderColor=o.borderLight},onMouseLeave:g=>{g.currentTarget.style.background="transparent",g.currentTarget.style.borderColor=o.borderMedium},title:"View backup content",children:[l.jsx(fs,{size:14,stroke:1.5,style:{marginRight:"4px"}}),"View"]}),l.jsxs("button",{type:"button",onClick:()=>{confirm("Are you sure you want to delete this backup?")&&f(x.backupPath)},style:{padding:"6px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.error,cursor:"pointer",fontSize:"12px",borderRadius:"8px",fontWeight:"500",fontFamily:v.body,display:"flex",alignItems:"center",gap:"4px"},onMouseEnter:g=>{g.currentTarget.style.background=Xn(o.error,.15),g.currentTarget.style.borderColor=o.error},onMouseLeave:g=>{g.currentTarget.style.background="transparent",g.currentTarget.style.borderColor=o.borderMedium},title:"Delete backup",children:[l.jsx(ri,{size:14,stroke:1.5}),"Delete"]}),l.jsxs("button",{type:"button",onClick:()=>p(x.backupPath,x.originalPath),style:{padding:"6px 12px",background:o.buttonPrimary,border:`1px solid ${o.buttonPrimary}`,color:o.textInverse,cursor:"pointer",fontSize:"12px",borderRadius:"8px",fontWeight:"500",fontFamily:v.body,display:"flex",alignItems:"center",gap:"4px"},onMouseEnter:g=>{g.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:g=>{g.currentTarget.style.background=o.buttonPrimary},title:"Restore this backup",children:[l.jsx(xg,{size:14,stroke:1.5}),"Restore"]})]})]},x.backupPath||`backup-${y}`))})]})}function zg({detectedPaths:r,detecting:s,onDetect:u,onSelect:p,onView:d}){return r.length===0?null:l.jsxs("div",{style:{marginBottom:"8px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[l.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontWeight:"600",fontFamily:v.body},children:"Detected Configuration Files:"}),l.jsx("button",{type:"button",onClick:u,disabled:s,title:"Refresh detection",style:{padding:"4px 8px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:s?"not-allowed":"pointer",fontSize:"11px",borderRadius:"8px",opacity:s?.5:1,display:"flex",alignItems:"center",gap:"4px"},children:s?l.jsxs(l.Fragment,{children:[l.jsx(qo,{size:12,stroke:1.5,style:{animation:"spin 1s linear infinite"}}),l.jsx("span",{children:"Detecting..."})]}):l.jsxs(l.Fragment,{children:[l.jsx(qo,{size:12,stroke:1.5}),l.jsx("span",{children:"Refresh"})]})})]}),l.jsx("div",{"data-tour":"detected-editors",style:{display:"flex",flexDirection:"column",gap:"6px"},children:r.map((f,x)=>l.jsxs("button",{type:"button","data-tour":x===0?"first-detected-editor":void 0,onClick:()=>p(f.path),onDoubleClick:()=>{f.exists&&d(f.path)},style:{padding:"8px 12px",background:f.exists?`${o.accentBlue}20`:o.bgSecondary,border:`1px solid ${f.exists?o.accentBlue:o.borderMedium}`,color:o.textPrimary,cursor:"pointer",fontSize:"12px",borderRadius:"8px",textAlign:"left",display:"flex",justifyContent:"space-between",alignItems:"center",transition:"all 0.2s"},onMouseEnter:y=>{y.currentTarget.style.background=f.exists?`${o.accentBlue}30`:o.bgHover},onMouseLeave:y=>{y.currentTarget.style.background=f.exists?`${o.accentBlue}20`:o.bgSecondary},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("span",{style:{display:"inline-flex",alignItems:"center"},children:f.editor==="Cursor"?l.jsx(Gf,{size:14,stroke:1.5}):l.jsx(Yc,{size:14,stroke:1.5})}),l.jsxs("div",{children:[l.jsx("div",{style:{fontWeight:"500"},children:f.editor}),l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:f.displayPath})]})]}),l.jsx("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:f.exists&&l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{fontSize:"10px",padding:"2px 6px",background:o.success,color:o.textInverse,borderRadius:"6px",fontWeight:"500"},children:"Found"}),l.jsxs("button",{type:"button",onClick:y=>{y.stopPropagation(),d(f.path)},title:"View file content",style:{fontSize:"10px",padding:"2px 6px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,borderRadius:"6px",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px"},children:[l.jsx(fs,{size:10,stroke:1.5}),l.jsx("span",{children:"View"})]})]})})]},`${f.editor}-${f.path}-${x}`))})]})}function Eg({filePath:r,fileContent:s,updatePath:u,onFileSelect:p,onPathChange:d,onUpdatePathChange:f}){return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsxs("label",{"data-tour":"select-file",style:{padding:"8px 16px",background:o.buttonPrimary,border:`1px solid ${o.buttonPrimary}`,color:o.textInverse,cursor:"pointer",fontSize:"13px",borderRadius:"8px",fontWeight:"500",whiteSpace:"nowrap",transition:"background 0.2s"},onMouseEnter:x=>{x.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:x=>{x.currentTarget.style.background=o.buttonPrimary},children:[l.jsx(ig,{size:14,stroke:1.5,style:{marginRight:"6px",display:"inline-block"}}),"Select File",l.jsx("input",{type:"file",accept:".json",onChange:p,style:{display:"none"}})]}),l.jsx("span",{style:{color:o.textTertiary,fontSize:"13px",fontWeight:"500",fontFamily:v.body},children:"OR"}),l.jsx("input",{type:"text",placeholder:"Enter file path (e.g., ~/.cursor/mcp.json)",value:r,onChange:d,style:{flex:1,padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderMedium}`,color:o.textPrimary,fontSize:"13px",borderRadius:"8px"}})]}),s&&!r&&l.jsxs("div",{children:[l.jsx("label",{htmlFor:"update-path-input",style:{display:"block",fontSize:"12px",color:o.textSecondary,marginBottom:"6px"},children:"Optional: File Path to Update"}),l.jsx("input",{id:"update-path-input",type:"text",placeholder:"Enter file path to update (e.g., ~/.cursor/mcp.json)",value:u,onChange:f,style:{width:"100%",padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderMedium}`,color:o.textPrimary,fontSize:"13px",borderRadius:"8px"}}),l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,marginTop:"6px",fontFamily:v.body},children:"Provide the file path if you want to update the original config file (backup will be created)"})]}),s&&l.jsxs("div",{style:{marginTop:"8px"},children:[l.jsx("div",{style:{color:o.textSecondary,fontSize:"12px",marginBottom:"6px",fontWeight:"500"},children:"File Content Preview"}),l.jsx("pre",{style:{background:o.bgCard,padding:"12px",borderRadius:"8px",fontSize:"12px",fontFamily:"monospace",color:o.textPrimary,maxHeight:"200px",overflow:"auto",border:`1px solid ${o.borderLight}`,lineHeight:"1.5"},children:s})]})]})}function Rg({services:r,selectedServices:s,onSelectionChange:u}){return r.length===0?null:l.jsxs("div",{style:{marginTop:"16px"},children:[l.jsxs("div",{style:{marginBottom:"12px"},children:[l.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"8px",color:o.textPrimary,fontFamily:v.body},children:"Select Services"}),l.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,lineHeight:"1.5",fontFamily:v.body},children:"Choose which services to include in the MCP Shark server. Only selected services will be available."})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"12px",flexWrap:"wrap"},children:[l.jsx("button",{type:"button",onClick:()=>{u(new Set(r.map(p=>p.name)))},style:{padding:"4px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:"pointer",fontSize:"12px",borderRadius:"8px"},children:"Select All"}),l.jsx("button",{type:"button",onClick:()=>{u(new Set)},style:{padding:"4px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:"pointer",fontSize:"12px",borderRadius:"8px"},children:"Deselect All"}),l.jsxs("div",{style:{marginLeft:"auto",fontSize:"12px",color:o.textSecondary,display:"flex",alignItems:"center"},children:[s.size," of ",r.length," selected"]})]}),l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"300px",overflowY:"auto",padding:"8px",background:o.bgPrimary,borderRadius:"4px",border:`1px solid ${o.borderLight}`},children:r.map(p=>{const d=s.has(p.name);return l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px",background:d?o.bgSelected:"transparent",border:`1px solid ${d?o.accentBlue:o.borderMedium}`,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:f=>{d||(f.currentTarget.style.background=o.bgHover)},onMouseLeave:f=>{d||(f.currentTarget.style.background="transparent")},children:[l.jsx("input",{type:"checkbox",checked:d,onChange:f=>{const x=new Set(s);f.target.checked?x.add(p.name):x.delete(p.name),u(x)},style:{width:"18px",height:"18px",cursor:"pointer"}}),l.jsxs("div",{style:{flex:1},children:[l.jsx("div",{style:{fontWeight:"500",color:o.textPrimary,fontSize:"13px",marginBottom:"4px"},children:p.name}),l.jsxs("div",{style:{fontSize:"11px",color:o.textSecondary,display:"flex",gap:"12px",flexWrap:"wrap"},children:[l.jsx("span",{style:{padding:"2px 6px",background:p.type==="http"?"#0e639c":"#4a9e5f",color:o.textInverse,borderRadius:"6px",fontSize:"10px",fontWeight:"500"},children:p.type.toUpperCase()}),p.url&&l.jsx("span",{style:{fontFamily:"monospace",fontSize:"11px"},children:p.url}),p.command&&l.jsxs("span",{style:{fontFamily:"monospace",fontSize:"11px"},children:[p.command," ",p.args?.join(" ")||""]})]})]})]},p.name)})}),s.size===0&&l.jsx("div",{style:{marginTop:"8px",padding:"8px 12px",background:Xn(o.error,.15),border:`1px solid ${o.error}`,borderRadius:"8px",color:o.error,fontSize:"12px"},children:"⚠️ Please select at least one service to start the server"})]})}function Mg({detectedPaths:r,detecting:s,onDetect:u,onPathSelect:p,onViewConfig:d,filePath:f,fileContent:x,updatePath:y,onFileSelect:g,onPathChange:j,onUpdatePathChange:S,services:b,selectedServices:T,onSelectionChange:_}){return l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"20px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[l.jsxs("div",{style:{marginBottom:"16px"},children:[l.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"8px",color:o.textPrimary,fontFamily:v.body},children:"Configuration File"}),l.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,lineHeight:"1.5",fontFamily:v.body},children:"Select your MCP configuration file or provide a file path. The file will be converted to MCP Shark format and used to start the server."})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[l.jsx(zg,{detectedPaths:r,detecting:s,onDetect:u,onSelect:p,onView:d}),l.jsx(Eg,{filePath:f,fileContent:x,updatePath:y,onFileSelect:g,onPathChange:j,onUpdatePathChange:S}),l.jsx(Rg,{services:b,selectedServices:T,onSelectionChange:_})]})]})}function Fg({viewingConfig:r,configContent:s,loadingConfig:u,onClose:p,viewingBackup:d,backupContent:f,loadingBackup:x}){const y=d!==null;if(!(r!==null)&&!y)return null;const j=y?f:s,S=y?x:u,b=y?"Backup File":"MCP Configuration File";return l.jsx("dialog",{open:!0,"aria-modal":"true",style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,padding:"20px",border:"none",margin:0,width:"100%",height:"100%"},onClick:p,onKeyDown:T=>{T.key==="Escape"&&p()},children:l.jsxs("div",{role:"document",style:{background:o.bgPrimary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",width:"100%",maxWidth:"800px",maxHeight:"90vh",display:"flex",flexDirection:"column",overflow:"hidden"},onClick:T=>T.stopPropagation(),onKeyDown:T=>T.stopPropagation(),children:[l.jsxs("div",{style:{padding:"16px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{children:[l.jsx("h3",{style:{fontSize:"16px",fontWeight:"500",marginBottom:"4px",color:o.textPrimary},children:b}),j&&l.jsxs("div",{style:{fontSize:"12px",color:"#858585"},children:[j.displayPath,y&&j.createdAt&&l.jsxs("span",{style:{marginLeft:"12px",color:"#666"},children:["Created: ",new Date(j.createdAt).toLocaleString()]})]})]}),l.jsx("button",{type:"button",onClick:p,style:{background:"transparent",border:"none",color:o.textPrimary,cursor:"pointer",fontSize:"24px",padding:"0",width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center"},children:"×"})]}),l.jsx("div",{style:{flex:1,overflow:"auto",padding:"20px"},children:S?l.jsx("div",{style:{color:"#858585",textAlign:"center",padding:"40px"},children:"Loading..."}):j?l.jsx("pre",{style:{background:o.bgPrimary,padding:"16px",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",color:o.textPrimary,overflow:"auto",border:`1px solid ${o.borderLight}`,lineHeight:"1.6",margin:0},children:j.content}):l.jsx("div",{style:{color:"#f48771",textAlign:"center",padding:"40px"},children:"Failed to load file content"})})]})})}function Ig({message:r,error:s}){return!r&&!s?null:l.jsx("div",{style:{marginBottom:"20px",padding:"12px 16px",background:Xn(r?o.info:o.error,.15),border:`1px solid ${r?o.info:o.error}`,borderRadius:"8px",color:r?o.textPrimary:o.error,fontSize:"13px",lineHeight:"1.6",fontFamily:v.body,boxShadow:`0 2px 4px ${o.shadowSm}`},children:r||s})}function $g({status:r,loading:s,onStart:u,onStop:p,canStart:d}){return l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"20px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[l.jsx("div",{style:{marginBottom:"16px"},children:l.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"8px",color:o.textPrimary,fontFamily:v.body},children:"Server Control"})}),l.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center",flexWrap:"wrap"},children:[r.running?l.jsx("button",{type:"button",onClick:p,disabled:s,style:{padding:"10px 20px",background:o.buttonDanger,border:`1px solid ${o.buttonDanger}`,color:o.textInverse,cursor:s?"not-allowed":"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:"500",borderRadius:"8px",opacity:s?.5:1,transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`},onMouseEnter:f=>{s||(f.currentTarget.style.background=o.buttonDangerHover,f.currentTarget.style.transform="translateY(-1px)")},onMouseLeave:f=>{f.currentTarget.style.background=o.buttonDanger,f.currentTarget.style.transform="translateY(0)"},children:s?"Stopping...":"Stop MCP Shark"}):l.jsx("button",{type:"button","data-tour":"start-button",onClick:u,disabled:s||!d,style:{padding:"10px 20px",background:o.buttonPrimary,border:`1px solid ${o.buttonPrimary}`,color:o.textInverse,cursor:s||!d?"not-allowed":"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:"500",borderRadius:"8px",opacity:s||!d?.5:1,transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`},onMouseEnter:f=>{!s&&d&&(f.currentTarget.style.background=o.buttonPrimaryHover,f.currentTarget.style.transform="translateY(-1px)")},onMouseLeave:f=>{f.currentTarget.style.background=o.buttonPrimary,f.currentTarget.style.transform="translateY(0)"},children:s?"Processing...":"Start MCP Shark"}),l.jsxs("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"10px",padding:"8px 16px",background:o.bgPrimary,border:`1px solid ${o.borderLight}`,borderRadius:"8px"},children:[l.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:r.running?o.success:o.textTertiary,boxShadow:r.running?`0 0 8px ${o.success}80`:"none",transition:"all 0.3s"}}),l.jsx("span",{style:{color:o.textPrimary,fontSize:"13px",fontWeight:"500",fontFamily:v.body},children:r.running?r.pid?`Running (PID: ${r.pid})`:"Running":"Stopped"})]})]})]})}function Ng(){return l.jsxs("div",{style:{marginBottom:"24px"},children:[l.jsx("h2",{style:{fontSize:"24px",fontWeight:"700",marginBottom:"12px",color:o.textPrimary,fontFamily:v.body},children:"MCP Shark Server Setup"}),l.jsx("p",{style:{fontSize:"15px",color:o.textSecondary,lineHeight:"1.6",fontFamily:v.body},children:"Convert your MCP configuration file and start the MCP Shark server to aggregate multiple MCP servers into a single endpoint."})]})}function Og({filePath:r,updatePath:s}){return l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[l.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"12px",color:o.textPrimary,fontFamily:v.body},children:"What This Does"}),l.jsxs("ul",{style:{margin:0,paddingLeft:"20px",fontSize:"13px",color:o.textSecondary,lineHeight:"1.8",fontFamily:v.body},children:[l.jsxs("li",{children:["Converts your MCP config (",l.jsx("code",{style:{color:o.accentOrange,fontFamily:v.mono},children:"mcpServers"}),") to MCP Shark format (",l.jsx("code",{style:{color:o.accentOrange,fontFamily:v.mono},children:"servers"}),")"]}),l.jsxs("li",{children:["Starts the MCP Shark server on"," ",l.jsx("code",{style:{color:o.accentBlue,fontFamily:v.mono},children:"http://localhost:9851/mcp"})]}),l.jsx("li",{children:r||s?"Updates your original config file to point to the MCP Shark server (creates a backup first)":"Note: Provide a file path to update your original config file automatically"}),(r||s)&&l.jsx("li",{style:{color:o.success,marginTop:"4px",fontWeight:"500"},children:"✓ Original config will be automatically restored when you stop the server or close the UI"})]})]})}function Bg(){const[r,s]=L.useState([]),[u,p]=L.useState(!0),[d,f]=L.useState([]),[x,y]=L.useState(!1),[g,j]=L.useState(null),[S,b]=L.useState(null),[T,_]=L.useState(!1),[z,R]=L.useState(null),[P,I]=L.useState(null),[O,U]=L.useState(!1),W=L.useCallback(async()=>{p(!0);try{const Y=await(await fetch("/api/config/detect")).json();s(Y.detected||[])}catch(G){console.error("Failed to detect config paths:",G)}finally{p(!1)}},[]),$=L.useCallback(async()=>{y(!0);try{const Y=await(await fetch("/api/config/backups")).json();f(Y.backups||[])}catch(G){console.error("Failed to load backups:",G)}finally{y(!1)}},[]),H=async G=>{_(!0),j(G);try{const Y=await fetch(`/api/config/read?filePath=${encodeURIComponent(G)}`),ce=await Y.json();Y.ok?b(ce):b(null)}catch{b(null)}finally{_(!1)}},K=async G=>{U(!0),R(G);try{const Y=await fetch(`/api/config/backup/view?backupPath=${encodeURIComponent(G)}`),ce=await Y.json();Y.ok?I(ce):I(null)}catch{I(null)}finally{U(!1)}},V=async G=>{try{return(await fetch("/api/config/backup/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupPath:G})})).ok?(await $(),!0):!1}catch(Y){return console.error("Failed to delete backup:",Y),!1}};return L.useEffect(()=>{W(),$()},[W,$]),{detectedPaths:r,detecting:u,detectConfigPaths:W,backups:d,loadingBackups:x,loadBackups:$,viewingConfig:g,configContent:S,loadingConfig:T,handleViewConfig:H,setViewingConfig:j,setConfigContent:b,viewingBackup:z,backupContent:P,loadingBackup:O,handleViewBackup:K,handleDeleteBackup:V,setViewingBackup:R,setBackupContent:I}}function Dg(r,s){const[u,p]=L.useState([]),[d,f]=L.useState(new Set),[x,y]=L.useState(!1),g=L.useCallback(async()=>{if(!r&&!s){p([]),f(new Set);return}y(!0);try{const S=await fetch("/api/config/services",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r?{fileContent:r}:{filePath:s})}),b=await S.json();S.ok&&b.services?(p(b.services),f(new Set(b.services.map(T=>T.name)))):(p([]),f(new Set))}catch(j){console.error("Failed to extract services:",j),p([]),f(new Set)}finally{y(!1)}},[r,s]);return L.useEffect(()=>{r||s?g():(p([]),f(new Set))},[r,s,g]),{services:u,selectedServices:d,setSelectedServices:f,loadingServices:x}}function Wg(){const[r,s]=L.useState(""),[u,p]=L.useState(""),[d,f]=L.useState(""),[x,y]=L.useState({running:!1,pid:null}),[g,j]=L.useState(!1),[S,b]=L.useState(null),[T,_]=L.useState(null),{services:z,selectedServices:R,setSelectedServices:P}=Dg(r,u),{detectedPaths:I,detecting:O,detectConfigPaths:U,backups:W,loadingBackups:$,loadBackups:H,viewingConfig:K,configContent:V,loadingConfig:G,handleViewConfig:Y,setViewingConfig:ce,setConfigContent:Se,viewingBackup:ve,backupContent:Ee,loadingBackup:Ne,handleViewBackup:Re,handleDeleteBackup:xe,setViewingBackup:J,setBackupContent:ee}=Bg();L.useEffect(()=>{N();const Z=setInterval(N,2e3);return()=>clearInterval(Z)},[]);const X=async(Z,fe)=>{if(confirm("Are you sure you want to restore this backup? This will overwrite the current config file."))try{const Fe=await fetch("/api/config/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupPath:Z,originalPath:fe})}),tt=await Fe.json();Fe.ok?(b(tt.message||"Config restored successfully"),_(null),H(),U()):(_(tt.error||"Failed to restore backup"),b(null))}catch(Fe){_(Fe.message||"Failed to restore backup"),b(null)}},w=async Z=>{await xe(Z)?(b("Backup deleted successfully"),_(null)):(_("Failed to delete backup"),b(null))},N=async()=>{try{const fe=await(await fetch("/api/composite/status")).json();y(fe)}catch(Z){console.error("Failed to fetch status:",Z)}},le=Z=>{const fe=Z.target.files[0];if(fe){const Fe=new FileReader;Fe.onload=tt=>{s(tt.target.result)},Fe.readAsText(fe)}},de=Z=>{const fe=Z.target.value;p(fe),fe&&s("")},pe=Z=>{f(Z.target.value)},ye=async()=>{j(!0),_(null),b(null);try{const Z=r?{fileContent:r,filePath:d||null}:{filePath:u};R.size>0&&(Z.selectedServices=Array.from(R));const fe=await fetch("/api/composite/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Z)}),Fe=await fe.json();if(fe.ok){const tt=Fe.message||"MCP Shark server started successfully";b(Fe.backupPath?`${tt} (Backup saved to ${Fe.backupPath})`:tt),s(""),p(""),f(""),P(new Set),setTimeout(N,1e3)}else _(Fe.error||"Failed to setup MCP Shark server")}catch(Z){_(Z.message||"Failed to setup MCP Shark server")}finally{j(!1)}},je=async()=>{j(!0),_(null),b(null);try{const Z=await fetch("/api/composite/stop",{method:"POST"}),fe=await Z.json();if(Z.ok){const Fe=fe.message||"MCP Shark server stopped";b(fe.message?.includes("restored")?"MCP Shark server stopped and original config file restored":Fe),setTimeout(N,1e3)}else _(fe.error||"Failed to stop MCP Shark server")}catch(Z){_(Z.message||"Failed to stop MCP Shark server")}finally{j(!1)}},ke=(r||u)&&(z.length===0||R.size>0);return l.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",background:o.bgPrimary,overflow:"auto"},children:[l.jsxs("div",{style:{width:"100%",maxWidth:"1200px",margin:"0 auto",padding:"32px",minHeight:"100%",boxSizing:"border-box"},children:[l.jsx(Ng,{}),l.jsx(Mg,{detectedPaths:I,detecting:O,onDetect:U,onPathSelect:Z=>{p(Z),s(""),f(Z)},onViewConfig:Y,filePath:u,fileContent:r,updatePath:d,onFileSelect:le,onPathChange:de,onUpdatePathChange:pe,services:z,selectedServices:R,onSelectionChange:P}),l.jsx($g,{status:x,loading:g,onStart:ye,onStop:je,canStart:ke}),l.jsx(Ig,{message:S,error:T}),l.jsx(Lg,{backups:W,loadingBackups:$,onRefresh:H,onRestore:X,onView:Re,onDelete:w}),l.jsx(Og,{filePath:u,updatePath:d})]}),l.jsx(Fg,{viewingConfig:K,configContent:V,loadingConfig:G,viewingBackup:ve,backupContent:Ee,loadingBackup:Ne,onClose:()=>{ce(null),Se(null),J(null),ee(null)}})]})}function Ag({elementRect:r,_onClick:s}){if(!r)return l.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.8)"}});const u=8,p=3;return l.jsxs(l.Fragment,{children:[r.top>0&&l.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,height:`${r.top-u}px`,background:"rgba(0, 0, 0, 0.8)",zIndex:9999}}),r.bottom<window.innerHeight&&l.jsx("div",{style:{position:"fixed",bottom:0,left:0,right:0,height:`${window.innerHeight-r.bottom-u}px`,background:"rgba(0, 0, 0, 0.8)",zIndex:9999}}),r.left>0&&l.jsx("div",{style:{position:"fixed",top:`${Math.max(0,r.top-u)}px`,left:0,width:`${r.left-u}px`,height:`${r.height+u*2}px`,background:"rgba(0, 0, 0, 0.8)",zIndex:9999}}),r.right<window.innerWidth&&l.jsx("div",{style:{position:"fixed",top:`${Math.max(0,r.top-u)}px`,right:0,width:`${window.innerWidth-r.right-u}px`,height:`${r.height+u*2}px`,background:"rgba(0, 0, 0, 0.8)",zIndex:9999}}),l.jsx("div",{style:{position:"fixed",left:r.left-u-p,top:r.top-u-p,width:r.width+(u+p)*2,height:r.height+(u+p)*2,border:`${p}px solid #4ec9b0`,borderRadius:"8px",boxShadow:"0 0 0 2px rgba(78, 201, 176, 0.3), 0 0 20px rgba(78, 201, 176, 0.5), 0 0 40px rgba(78, 201, 176, 0.3), inset 0 0 20px rgba(78, 201, 176, 0.1)",zIndex:1e4,pointerEvents:"none",animation:"pulse 2s ease-in-out infinite"}}),l.jsx("style",{children:`
9
9
  @keyframes pulse {
10
10
  0%, 100% {
11
11
  box-shadow:
@@ -22,12 +22,12 @@ Error generating stack: `+c.message+`
22
22
  inset 0 0 30px rgba(78, 201, 176, 0.2);
23
23
  }
24
24
  }
25
- `})]})}const Hg=({size:r=16,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"Close icon",children:[l.jsx("title",{children:"Close icon"}),l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Ug=({size:r=16,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"Chevron right icon",children:[l.jsx("title",{children:"Chevron right icon"}),l.jsx("polyline",{points:"9 18 15 12 9 6"})]}),Vg=({size:r=16,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"Chevron left icon",children:[l.jsx("title",{children:"Chevron left icon"}),l.jsx("polyline",{points:"15 18 9 12 15 6"})]});function Qg({currentStep:r,totalSteps:s,onNext:u,onPrevious:p,onSkip:d}){return l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",pointerEvents:"none"},children:[l.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),d()},onMouseDown:f=>f.stopPropagation(),style:{background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,padding:"8px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",fontFamily:v.body,flex:1,pointerEvents:"auto"},onMouseEnter:f=>{f.currentTarget.style.background=o.bgHover,f.currentTarget.style.color=o.textPrimary,f.currentTarget.style.borderColor=o.borderMedium},onMouseLeave:f=>{f.currentTarget.style.background="transparent",f.currentTarget.style.color=o.textSecondary,f.currentTarget.style.borderColor=o.borderMedium},children:"Skip Tour"}),l.jsxs("div",{style:{display:"flex",gap:"8px",pointerEvents:"auto"},children:[r>0&&l.jsxs("button",{type:"button",onClick:f=>{f.stopPropagation(),p()},onMouseDown:f=>f.stopPropagation(),style:{background:o.buttonSecondary,border:`1px solid ${o.borderMedium}`,color:o.textPrimary,padding:"8px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",fontFamily:v.body,display:"flex",alignItems:"center",gap:"4px"},onMouseEnter:f=>{f.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:f=>{f.currentTarget.style.background=o.buttonSecondary},children:[l.jsx(Vg,{size:14}),"Previous"]}),l.jsxs("button",{type:"button",onClick:f=>{f.stopPropagation(),u()},onMouseDown:f=>f.stopPropagation(),style:{background:o.buttonPrimary,border:"none",color:o.textInverse,padding:"8px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",fontFamily:v.body,display:"flex",alignItems:"center",gap:"4px",fontWeight:"500"},onMouseEnter:f=>{f.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:f=>{f.currentTarget.style.background=o.buttonPrimary},children:[r===s-1?"Finish":"Next",r<s-1&&l.jsx(Ug,{size:14})]})]})]})}function Yg({step:r,currentStep:s,totalSteps:u,isDragging:p,onSkip:d}){return l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:"12px"},children:[l.jsxs("div",{style:{flex:1,pointerEvents:"none"},children:[l.jsx("h3",{style:{margin:0,color:o.accentBlue,fontSize:"16px",fontWeight:"600",fontFamily:v.body},children:r.title}),l.jsxs("p",{style:{margin:"4px 0 0 0",color:o.textTertiary,fontSize:"12px",fontFamily:v.body},children:["Step ",s+1," of ",u,p&&l.jsx("span",{style:{marginLeft:"8px",fontSize:"11px"},children:"• Dragging"})]})]}),l.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),d()},onMouseDown:f=>f.stopPropagation(),style:{background:"transparent",border:"none",color:o.textTertiary,cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",borderRadius:"8px",marginLeft:"12px",pointerEvents:"auto"},onMouseEnter:f=>{f.currentTarget.style.background=o.bgHover,f.currentTarget.style.color=o.textPrimary},onMouseLeave:f=>{f.currentTarget.style.background="transparent",f.currentTarget.style.color=o.textTertiary},title:"Skip tour",children:l.jsx(Hg,{size:18})})]})}function Jg(r,s,u){const[p,d]=L.useState({x:0,y:0}),[f,x]=L.useState(!1),[y,g]=L.useState({x:0,y:0});L.useEffect(()=>{d({x:0,y:0})},[]);const j=(b,T)=>{if(b.preventDefault(),b.stopPropagation(),T.current){const _=T.current.getBoundingClientRect();g({x:b.clientX-_.left,y:b.clientY-_.top}),x(!0)}};return L.useEffect(()=>{if(!f)return;const b=_=>{d({x:_.clientX-y.x,y:_.clientY-y.y})},T=()=>{x(!1)};return window.addEventListener("mousemove",b),window.addEventListener("mouseup",T),()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",T)}},[f,y]),{position:(()=>{if(!r)return{left:0,top:0,transform:"none"};const b=350,T=200,_=20;if(p.x!==0||p.y!==0){const U=Math.max(10,Math.min(p.x,window.innerWidth-b-10)),W=Math.max(10,Math.min(p.y,window.innerHeight-T-10));return{left:U,top:W,transform:"none"}}const z=s.position||"bottom",P=((U,W,$,H,K)=>{if(U==="left"){const Y=W.left-$-K;return{left:Y<10?W.right+K:Y,top:W.top+W.height/2,transform:"translateY(-50%)"}}if(U==="right"){const Y=W.right+K;return{left:Y+$>window.innerWidth-10?W.left-$-K:Y,top:W.top+W.height/2,transform:"translateY(-50%)"}}if(U==="top"){const Y=W.top-H-K,ce=Y<10?W.bottom+K:Y;return{left:W.left+W.width/2,top:ce,transform:"translate(-50%, 0)"}}const V=W.bottom+K,G=V+H>window.innerHeight-10?W.top-H-K:V;return{left:W.left+W.width/2,top:G,transform:"translate(-50%, 0)"}})(z,r,b,T,_),I=Math.max(10,Math.min(P.left,window.innerWidth-b-10)),O=Math.max(10,Math.min(P.top,window.innerHeight-T-10));return{left:I,top:O,transform:P.transform}})(),isDragging:f,handleMouseDown:j}}function Kg({elementRect:r,step:s,currentStep:u,totalSteps:p,onNext:d,onPrevious:f,onSkip:x}){const y=L.useRef(null),{position:g,isDragging:j,handleMouseDown:S}=Jg(r,s);return r?l.jsxs("button",{type:"button",ref:y,onMouseDown:b=>S(b,y),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),S(b,y))},"aria-label":"Draggable tooltip",style:{position:"fixed",left:`${g.left}px`,top:`${g.top}px`,transform:g.transform,background:o.bgCard,border:`2px solid ${o.accentBlue}`,borderRadius:"12px",padding:"20px",maxWidth:"350px",minWidth:"300px",boxShadow:`0 4px 20px ${o.shadowLg}`,zIndex:10001,pointerEvents:"auto",cursor:j?"grabbing":"grab",userSelect:"none"},onClick:b=>{const T=b.target;T.tagName!=="BUTTON"&&T.tagName!=="INPUT"&&!T.closest("button")&&b.stopPropagation()},children:[l.jsx(Yg,{step:s,currentStep:u,totalSteps:p,isDragging:j,onSkip:x}),l.jsx("div",{style:{color:o.textPrimary,fontSize:"14px",lineHeight:"1.6",marginBottom:"20px",pointerEvents:"none",fontFamily:v.body},children:s.content}),l.jsx(Qg,{currentStep:u,totalSteps:p,onNext:d,onPrevious:f,onSkip:x})]}):null}function Gg({steps:r,onComplete:s,onSkip:u,onStepChange:p}){const[d,f]=L.useState(0),[x,y]=L.useState(null),[g,j]=L.useState(null),S=L.useRef(null);L.useEffect(()=>{if(!x)return;const P=()=>{if(x){const O=x.getBoundingClientRect();j(O)}};P();const I={passive:!0,capture:!0};return window.addEventListener("scroll",P,I),window.addEventListener("resize",P,{passive:!0}),()=>{window.removeEventListener("scroll",P,I),window.removeEventListener("resize",P,{passive:!0})}},[x]),L.useEffect(()=>{if(r.length===0)return;const P=r[d];if(!P)return;p&&p(d);const I=setTimeout(()=>{const O=document.querySelector(P.target);O?(y(O),O.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),setTimeout(()=>{const U=O.getBoundingClientRect();j(U)},300)):(y(null),j(null))},200);return()=>clearTimeout(I)},[d,r,p]);const b=()=>{if(d<r.length-1){const P=d+1;f(P),p&&p(P)}else _()},T=()=>{if(d>0){const P=d-1;f(P),p&&p(P)}},_=async()=>{try{await fetch("/api/help/dismiss",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tourCompleted:!0})})}catch(P){console.error("Failed to save tour state:",P)}s()},z=()=>{_(),u&&u()};if(r.length===0||d>=r.length)return null;const R=r[d];return l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:S,role:"presentation",style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9998,pointerEvents:"auto"},onClick:z,onKeyDown:P=>{P.key==="Escape"&&z()},children:l.jsx(Ag,{elementRect:g})}),g&&l.jsx(Kg,{elementRect:g,step:R,currentStep:d,totalSteps:r.length,onNext:b,onPrevious:T,onSkip:z})]})}function Gn({title:r,count:s,children:u,defaultExpanded:p=!1}){const[d,f]=L.useState(p);return l.jsxs("div",{style:{background:o.bgTertiary,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden"},children:[l.jsxs("button",{type:"button",onClick:()=>f(!d),style:{width:"100%",padding:"8px 12px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"transparent",border:"none",cursor:"pointer",fontFamily:v.body,transition:"background 0.15s"},onMouseEnter:x=>{x.currentTarget.style.background=o.bgCard},onMouseLeave:x=>{x.currentTarget.style.background="transparent"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("span",{style:{fontSize:"12px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:r}),s!==void 0&&l.jsx("span",{style:{padding:"2px 6px",background:o.bgCard,borderRadius:"4px",fontSize:"10px",fontWeight:"500",color:o.textSecondary,border:`1px solid ${o.borderLight}`,fontFamily:v.body},children:s})]}),l.jsxs("svg",{style:{width:"14px",height:"14px",color:o.textSecondary,transform:d?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",role:"img","aria-label":"Chevron icon",children:[l.jsx("title",{children:"Chevron icon"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})]})]}),d&&l.jsx("div",{style:{padding:"12px",borderTop:`1px solid ${o.borderLight}`,background:o.bgCard},children:u})]})}function Wr(r){if(!r)return o.textTertiary;switch(r.toLowerCase()){case"none":return o.accentGreen;case"low":return o.accentBlue;case"medium":return o.accentOrange;case"high":return o.error;case"critical":return o.error;default:return o.textTertiary}}function ls({findings:r,type:s}){return l.jsx("div",{style:{overflowX:"auto"},children:l.jsxs("table",{style:{width:"100%",fontSize:"12px",fontFamily:v.body},children:[l.jsx("thead",{children:l.jsxs("tr",{style:{borderBottom:`1px solid ${o.borderLight}`,background:o.bgTertiary},children:[l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Name"}),l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Risk Level"}),l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Risk Score"}),l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Tags"}),l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Reasons"}),l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Safe Use Notes"}),s==="tool"&&l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Poisoned"})]})}),l.jsx("tbody",{children:r.map((u,p)=>l.jsxs("tr",{style:{borderBottom:`1px solid ${o.borderLight}`,transition:"background 0.15s"},onMouseEnter:d=>{d.currentTarget.style.background=o.bgTertiary},onMouseLeave:d=>{d.currentTarget.style.background="transparent"},children:[l.jsx("td",{style:{padding:"8px",fontSize:"12px",color:o.textPrimary,fontWeight:"500",fontFamily:v.body},children:u.name}),l.jsx("td",{style:{padding:"8px"},children:l.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",borderRadius:"4px",fontSize:"10px",fontWeight:"700",color:o.textInverse,background:Wr(u.risk_level),fontFamily:v.body},children:u.risk_level?.toUpperCase()})}),l.jsx("td",{style:{padding:"8px",fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:u.risk_score}),l.jsx("td",{style:{padding:"8px"},children:l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"2px"},children:u.risk_tags?.map((d,f)=>l.jsx("span",{style:{padding:"2px 6px",background:o.bgCard,borderRadius:"4px",fontSize:"10px",color:o.textSecondary,border:`1px solid ${o.borderLight}`,fontFamily:v.body},children:d},`tag-${String(d)}-${f}`))})}),l.jsx("td",{style:{padding:"8px",fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:l.jsx("ul",{style:{listStyle:"disc",listStylePosition:"inside",margin:0,padding:0},children:u.reasons?.map((d,f)=>l.jsx("li",{style:{fontSize:"10px",marginBottom:"2px"},children:d},`reason-${f}-${d.substring(0,20)}`))})}),l.jsx("td",{style:{padding:"8px",fontSize:"10px",color:o.textSecondary,maxWidth:"200px",fontFamily:v.body},children:u.safe_use_notes}),s==="tool"&&Object.prototype.hasOwnProperty.call(u,"is_potentially_poisoned")&&l.jsx("td",{style:{padding:"8px"},children:u.is_potentially_poisoned?l.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",fontSize:"10px",fontWeight:"500",borderRadius:"4px",background:`${o.error}20`,color:o.error,border:`1px solid ${o.error}40`,fontFamily:v.body},children:"Yes"}):l.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",fontSize:"10px",fontWeight:"500",borderRadius:"4px",background:`${o.accentGreen}20`,color:o.accentGreen,border:`1px solid ${o.accentGreen}40`,fontFamily:v.body},children:"No"})})]},`finding-${u.id||u.name||p}-${p}`))})]})})}function Xg({patterns:r}){return!r||r.length===0?null:l.jsx(Gn,{title:"Notable Patterns",count:r.length,defaultExpanded:!1,children:l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((s,u)=>l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"8px",background:`${o.accentOrange}10`,borderRadius:"6px",border:`1px solid ${o.accentOrange}20`,transition:"all 0.15s"},onMouseEnter:p=>{p.currentTarget.style.background=`${o.accentOrange}15`,p.currentTarget.style.borderColor=`${o.accentOrange}40`},onMouseLeave:p=>{p.currentTarget.style.background=`${o.accentOrange}10`,p.currentTarget.style.borderColor=`${o.accentOrange}20`},children:[l.jsx("div",{style:{flexShrink:0,marginTop:"2px",width:"16px",height:"16px",borderRadius:"50%",background:`${o.accentOrange}30`,border:`1px solid ${o.accentOrange}60`,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsxs("svg",{style:{width:"10px",height:"10px",color:o.accentOrange},fill:"currentColor",viewBox:"0 0 20 20",role:"img","aria-label":"Pattern icon",children:[l.jsx("title",{children:"Pattern icon"}),l.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})]})}),l.jsx("p",{style:{fontSize:"12px",color:o.textPrimary,lineHeight:"1.5",flex:1,margin:0,fontFamily:v.body},children:s})]},`pattern-${s.type||u}-${u}`))})})}function Zg(r){const s=r.includes(`
25
+ `})]})}const Hg=({size:r=16,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"Close icon",children:[l.jsx("title",{children:"Close icon"}),l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Ug=({size:r=16,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"Chevron right icon",children:[l.jsx("title",{children:"Chevron right icon"}),l.jsx("polyline",{points:"9 18 15 12 9 6"})]}),Vg=({size:r=16,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"Chevron left icon",children:[l.jsx("title",{children:"Chevron left icon"}),l.jsx("polyline",{points:"15 18 9 12 15 6"})]});function Qg({currentStep:r,totalSteps:s,onNext:u,onPrevious:p,onSkip:d}){return l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",pointerEvents:"none"},children:[l.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),d()},onMouseDown:f=>f.stopPropagation(),style:{background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,padding:"8px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",fontFamily:v.body,flex:1,pointerEvents:"auto"},onMouseEnter:f=>{f.currentTarget.style.background=o.bgHover,f.currentTarget.style.color=o.textPrimary,f.currentTarget.style.borderColor=o.borderMedium},onMouseLeave:f=>{f.currentTarget.style.background="transparent",f.currentTarget.style.color=o.textSecondary,f.currentTarget.style.borderColor=o.borderMedium},children:"Skip Tour"}),l.jsxs("div",{style:{display:"flex",gap:"8px",pointerEvents:"auto"},children:[r>0&&l.jsxs("button",{type:"button",onClick:f=>{f.stopPropagation(),p()},onMouseDown:f=>f.stopPropagation(),style:{background:o.buttonSecondary,border:`1px solid ${o.borderMedium}`,color:o.textPrimary,padding:"8px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",fontFamily:v.body,display:"flex",alignItems:"center",gap:"4px"},onMouseEnter:f=>{f.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:f=>{f.currentTarget.style.background=o.buttonSecondary},children:[l.jsx(Vg,{size:14}),"Previous"]}),l.jsxs("button",{type:"button",onClick:f=>{f.stopPropagation(),u()},onMouseDown:f=>f.stopPropagation(),style:{background:o.buttonPrimary,border:"none",color:o.textInverse,padding:"8px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",fontFamily:v.body,display:"flex",alignItems:"center",gap:"4px",fontWeight:"500"},onMouseEnter:f=>{f.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:f=>{f.currentTarget.style.background=o.buttonPrimary},children:[r===s-1?"Finish":"Next",r<s-1&&l.jsx(Ug,{size:14})]})]})]})}function Yg({step:r,currentStep:s,totalSteps:u,isDragging:p,onSkip:d}){return l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:"12px"},children:[l.jsxs("div",{style:{flex:1,pointerEvents:"none"},children:[l.jsx("h3",{style:{margin:0,color:o.accentBlue,fontSize:"16px",fontWeight:"600",fontFamily:v.body},children:r.title}),l.jsxs("p",{style:{margin:"4px 0 0 0",color:o.textTertiary,fontSize:"12px",fontFamily:v.body},children:["Step ",s+1," of ",u,p&&l.jsx("span",{style:{marginLeft:"8px",fontSize:"11px"},children:"• Dragging"})]})]}),l.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),d()},onMouseDown:f=>f.stopPropagation(),style:{background:"transparent",border:"none",color:o.textTertiary,cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",borderRadius:"8px",marginLeft:"12px",pointerEvents:"auto"},onMouseEnter:f=>{f.currentTarget.style.background=o.bgHover,f.currentTarget.style.color=o.textPrimary},onMouseLeave:f=>{f.currentTarget.style.background="transparent",f.currentTarget.style.color=o.textTertiary},title:"Skip tour",children:l.jsx(Hg,{size:18})})]})}function Jg(r,s,u){const[p,d]=L.useState({x:0,y:0}),[f,x]=L.useState(!1),[y,g]=L.useState({x:0,y:0});L.useEffect(()=>{d({x:0,y:0})},[]);const j=(b,T)=>{if(b.preventDefault(),b.stopPropagation(),T.current){const _=T.current.getBoundingClientRect();g({x:b.clientX-_.left,y:b.clientY-_.top}),x(!0)}};return L.useEffect(()=>{if(!f)return;const b=_=>{d({x:_.clientX-y.x,y:_.clientY-y.y})},T=()=>{x(!1)};return window.addEventListener("mousemove",b),window.addEventListener("mouseup",T),()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",T)}},[f,y]),{position:(()=>{if(!r)return{left:0,top:0,transform:"none"};const b=350,T=200,_=20;if(p.x!==0||p.y!==0){const U=Math.max(10,Math.min(p.x,window.innerWidth-b-10)),W=Math.max(10,Math.min(p.y,window.innerHeight-T-10));return{left:U,top:W,transform:"none"}}const z=s.position||"bottom",P=((U,W,$,H,K)=>{if(U==="left"){const Y=W.left-$-K;return{left:Y<10?W.right+K:Y,top:W.top+W.height/2,transform:"translateY(-50%)"}}if(U==="right"){const Y=W.right+K;return{left:Y+$>window.innerWidth-10?W.left-$-K:Y,top:W.top+W.height/2,transform:"translateY(-50%)"}}if(U==="top"){const Y=W.top-H-K,ce=Y<10?W.bottom+K:Y;return{left:W.left+W.width/2,top:ce,transform:"translate(-50%, 0)"}}const V=W.bottom+K,G=V+H>window.innerHeight-10?W.top-H-K:V;return{left:W.left+W.width/2,top:G,transform:"translate(-50%, 0)"}})(z,r,b,T,_),I=Math.max(10,Math.min(P.left,window.innerWidth-b-10)),O=Math.max(10,Math.min(P.top,window.innerHeight-T-10));return{left:I,top:O,transform:P.transform}})(),isDragging:f,handleMouseDown:j}}function Kg({elementRect:r,step:s,currentStep:u,totalSteps:p,onNext:d,onPrevious:f,onSkip:x}){const y=L.useRef(null),{position:g,isDragging:j,handleMouseDown:S}=Jg(r,s);return r?l.jsxs("button",{type:"button",ref:y,onMouseDown:b=>S(b,y),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),S(b,y))},"aria-label":"Draggable tooltip",style:{position:"fixed",left:`${g.left}px`,top:`${g.top}px`,transform:g.transform,background:o.bgCard,border:`2px solid ${o.accentBlue}`,borderRadius:"12px",padding:"20px",maxWidth:"350px",minWidth:"300px",boxShadow:`0 4px 20px ${o.shadowLg}`,zIndex:10001,pointerEvents:"auto",cursor:j?"grabbing":"grab",userSelect:"none"},onClick:b=>{const T=b.target;T.tagName!=="BUTTON"&&T.tagName!=="INPUT"&&!T.closest("button")&&b.stopPropagation()},children:[l.jsx(Yg,{step:s,currentStep:u,totalSteps:p,isDragging:j,onSkip:x}),l.jsx("div",{style:{color:o.textPrimary,fontSize:"14px",lineHeight:"1.6",marginBottom:"20px",pointerEvents:"none",fontFamily:v.body},children:s.content}),l.jsx(Qg,{currentStep:u,totalSteps:p,onNext:d,onPrevious:f,onSkip:x})]}):null}function Gg({steps:r,onComplete:s,onSkip:u,onStepChange:p}){const[d,f]=L.useState(0),[x,y]=L.useState(null),[g,j]=L.useState(null),S=L.useRef(null);L.useEffect(()=>{if(!x)return;const P=()=>{if(x){const O=x.getBoundingClientRect();j(O)}};P();const I={passive:!0,capture:!0};return window.addEventListener("scroll",P,I),window.addEventListener("resize",P,{passive:!0}),()=>{window.removeEventListener("scroll",P,I),window.removeEventListener("resize",P,{passive:!0})}},[x]),L.useEffect(()=>{if(r.length===0)return;const P=r[d];if(!P)return;p&&p(d);const I=setTimeout(()=>{const O=document.querySelector(P.target);O?(y(O),O.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),setTimeout(()=>{const U=O.getBoundingClientRect();j(U)},300)):(y(null),j(null))},200);return()=>clearTimeout(I)},[d,r,p]);const b=()=>{if(d<r.length-1){const P=d+1;f(P),p&&p(P)}else _()},T=()=>{if(d>0){const P=d-1;f(P),p&&p(P)}},_=async()=>{try{await fetch("/api/help/dismiss",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tourCompleted:!0})})}catch(P){console.error("Failed to save tour state:",P)}s()},z=()=>{_(),u&&u()};if(r.length===0||d>=r.length)return null;const R=r[d];return l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:S,role:"presentation",style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9998,pointerEvents:"auto"},onClick:z,onKeyDown:P=>{P.key==="Escape"&&z()},children:l.jsx(Ag,{elementRect:g})}),g&&l.jsx(Kg,{elementRect:g,step:R,currentStep:d,totalSteps:r.length,onNext:b,onPrevious:T,onSkip:z})]})}function Gn({title:r,count:s,children:u,defaultExpanded:p=!1}){const[d,f]=L.useState(p);return l.jsxs("div",{style:{background:o.bgTertiary,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden"},children:[l.jsxs("button",{type:"button",onClick:()=>f(!d),style:{width:"100%",padding:"8px 12px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"transparent",border:"none",cursor:"pointer",fontFamily:v.body,transition:"background 0.15s"},onMouseEnter:x=>{x.currentTarget.style.background=o.bgCard},onMouseLeave:x=>{x.currentTarget.style.background="transparent"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("span",{style:{fontSize:"12px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:r}),s!==void 0&&l.jsx("span",{style:{padding:"2px 6px",background:o.bgCard,borderRadius:"4px",fontSize:"10px",fontWeight:"500",color:o.textSecondary,border:`1px solid ${o.borderLight}`,fontFamily:v.body},children:s})]}),l.jsxs("svg",{style:{width:"14px",height:"14px",color:o.textSecondary,transform:d?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",role:"img","aria-label":"Chevron icon",children:[l.jsx("title",{children:"Chevron icon"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})]})]}),d&&l.jsx("div",{style:{padding:"12px",borderTop:`1px solid ${o.borderLight}`,background:o.bgCard},children:u})]})}function Wr(r){if(!r)return o.textTertiary;switch(r.toLowerCase()){case"none":return o.accentGreen;case"low":return o.accentBlue;case"medium":return o.accentOrange;case"high":return o.error;case"critical":return o.error;default:return o.textTertiary}}function ss({findings:r,type:s}){return l.jsx("div",{style:{overflowX:"auto"},children:l.jsxs("table",{style:{width:"100%",fontSize:"12px",fontFamily:v.body},children:[l.jsx("thead",{children:l.jsxs("tr",{style:{borderBottom:`1px solid ${o.borderLight}`,background:o.bgTertiary},children:[l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Name"}),l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Risk Level"}),l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Risk Score"}),l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Tags"}),l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Reasons"}),l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Safe Use Notes"}),s==="tool"&&l.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Poisoned"})]})}),l.jsx("tbody",{children:r.map((u,p)=>l.jsxs("tr",{style:{borderBottom:`1px solid ${o.borderLight}`,transition:"background 0.15s"},onMouseEnter:d=>{d.currentTarget.style.background=o.bgTertiary},onMouseLeave:d=>{d.currentTarget.style.background="transparent"},children:[l.jsx("td",{style:{padding:"8px",fontSize:"12px",color:o.textPrimary,fontWeight:"500",fontFamily:v.body},children:u.name}),l.jsx("td",{style:{padding:"8px"},children:l.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",borderRadius:"4px",fontSize:"10px",fontWeight:"700",color:o.textInverse,background:Wr(u.risk_level),fontFamily:v.body},children:u.risk_level?.toUpperCase()})}),l.jsx("td",{style:{padding:"8px",fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:u.risk_score}),l.jsx("td",{style:{padding:"8px"},children:l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"2px"},children:u.risk_tags?.map((d,f)=>l.jsx("span",{style:{padding:"2px 6px",background:o.bgCard,borderRadius:"4px",fontSize:"10px",color:o.textSecondary,border:`1px solid ${o.borderLight}`,fontFamily:v.body},children:d},`tag-${String(d)}-${f}`))})}),l.jsx("td",{style:{padding:"8px",fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:l.jsx("ul",{style:{listStyle:"disc",listStylePosition:"inside",margin:0,padding:0},children:u.reasons?.map((d,f)=>l.jsx("li",{style:{fontSize:"10px",marginBottom:"2px"},children:d},`reason-${f}-${d.substring(0,20)}`))})}),l.jsx("td",{style:{padding:"8px",fontSize:"10px",color:o.textSecondary,maxWidth:"200px",fontFamily:v.body},children:u.safe_use_notes}),s==="tool"&&Object.prototype.hasOwnProperty.call(u,"is_potentially_poisoned")&&l.jsx("td",{style:{padding:"8px"},children:u.is_potentially_poisoned?l.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",fontSize:"10px",fontWeight:"500",borderRadius:"4px",background:`${o.error}20`,color:o.error,border:`1px solid ${o.error}40`,fontFamily:v.body},children:"Yes"}):l.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",fontSize:"10px",fontWeight:"500",borderRadius:"4px",background:`${o.accentGreen}20`,color:o.accentGreen,border:`1px solid ${o.accentGreen}40`,fontFamily:v.body},children:"No"})})]},`finding-${u.id||u.name||p}-${p}`))})]})})}function Xg({patterns:r}){return!r||r.length===0?null:l.jsx(Gn,{title:"Notable Patterns",count:r.length,defaultExpanded:!1,children:l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((s,u)=>l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"8px",background:`${o.accentOrange}10`,borderRadius:"6px",border:`1px solid ${o.accentOrange}20`,transition:"all 0.15s"},onMouseEnter:p=>{p.currentTarget.style.background=`${o.accentOrange}15`,p.currentTarget.style.borderColor=`${o.accentOrange}40`},onMouseLeave:p=>{p.currentTarget.style.background=`${o.accentOrange}10`,p.currentTarget.style.borderColor=`${o.accentOrange}20`},children:[l.jsx("div",{style:{flexShrink:0,marginTop:"2px",width:"16px",height:"16px",borderRadius:"50%",background:`${o.accentOrange}30`,border:`1px solid ${o.accentOrange}60`,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsxs("svg",{style:{width:"10px",height:"10px",color:o.accentOrange},fill:"currentColor",viewBox:"0 0 20 20",role:"img","aria-label":"Pattern icon",children:[l.jsx("title",{children:"Pattern icon"}),l.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})]})}),l.jsx("p",{style:{fontSize:"12px",color:o.textPrimary,lineHeight:"1.5",flex:1,margin:0,fontFamily:v.body},children:s})]},`pattern-${s.type||u}-${u}`))})})}function Zg(r){const s=r.includes(`
26
26
  `)?`
27
- `:r.includes(" | ")?" | ":null;return s?l.jsx("ul",{style:{listStyle:"disc",listStylePosition:"inside",margin:0,paddingLeft:"8px"},children:r.split(s).map((u,p)=>l.jsx("li",{style:{fontSize:"12px",marginBottom:"2px"},children:u.trim()},`reason-${p}-${u.trim().substring(0,20)}`))}):l.jsx("p",{style:{fontSize:"12px"},children:r})}function qg({overallRiskLevel:r,overallReason:s}){return r?l.jsx(Gn,{title:"Overall Summary",count:s?1:0,defaultExpanded:!0,children:l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("span",{style:{fontSize:"12px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:"Overall Risk Level:"}),l.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"4px",fontSize:"10px",fontWeight:"700",color:o.textInverse,background:Wr(r),fontFamily:v.body},children:r.toUpperCase()})]}),s&&l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:Zg(s)})]})}):null}function eh({recommendations:r}){return!r||r.length===0?null:l.jsx(Gn,{title:"Recommendations",count:r.length,defaultExpanded:!1,children:l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((s,u)=>l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"8px",background:`${o.accentBlue}10`,borderRadius:"6px",border:`1px solid ${o.accentBlue}20`,transition:"all 0.15s"},onMouseEnter:p=>{p.currentTarget.style.background=`${o.accentBlue}15`,p.currentTarget.style.borderColor=`${o.accentBlue}40`},onMouseLeave:p=>{p.currentTarget.style.background=`${o.accentBlue}10`,p.currentTarget.style.borderColor=`${o.accentBlue}20`},children:[l.jsx("div",{style:{flexShrink:0,marginTop:"2px",width:"16px",height:"16px",borderRadius:"50%",background:`${o.accentBlue}30`,border:`1px solid ${o.accentBlue}60`,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx("span",{style:{fontSize:"10px",fontWeight:"600",color:o.accentBlue,fontFamily:v.body},children:u+1})}),l.jsx("p",{style:{fontSize:"12px",color:o.textPrimary,lineHeight:"1.5",flex:1,margin:0,fontFamily:v.body},children:s})]},`recommendation-${s.type||u}-${u}`))})})}function th({analysis:r}){if(!r)return l.jsx("div",{style:{padding:"12px",background:`${o.bgTertiary}80`,borderRadius:"6px",border:`1px solid ${o.borderLight}`,fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"No analysis data available."});const s=r.tool_findings||[],u=r.prompt_findings||[],p=r.resource_findings||[];return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[l.jsx(qg,{overallRiskLevel:r.overall_risk_level,overallReason:r.overall_reason}),s.length>0&&l.jsx(Gn,{title:"Tool Findings",count:s.length,defaultExpanded:!0,children:l.jsx(ls,{findings:s,type:"tool"})}),u.length>0&&l.jsx(Gn,{title:"Prompt Findings",count:u.length,defaultExpanded:!0,children:l.jsx(ls,{findings:u,type:"prompt"})}),p.length>0&&l.jsx(Gn,{title:"Resource Findings",count:p.length,defaultExpanded:!0,children:l.jsx(ls,{findings:p,type:"resource"})}),l.jsx(eh,{recommendations:r.recommendations}),l.jsx(Xg,{patterns:r.notable_patterns})]})}function nh({scan:r,scanId:s,serverName:u,analysisResult:p}){return l.jsxs("details",{style:{marginBottom:"16px"},children:[l.jsx("summary",{style:{cursor:"pointer",padding:"8px 12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontFamily:v.body,color:o.textSecondary,border:`1px solid ${o.borderLight}`,userSelect:"none"},onMouseEnter:d=>{d.currentTarget.style.background=o.bgSecondary,d.currentTarget.style.color=o.textPrimary},onMouseLeave:d=>{d.currentTarget.style.background=o.bgTertiary,d.currentTarget.style.color=o.textSecondary},children:"Debug Info (click to expand)"}),l.jsx("div",{style:{marginTop:"8px",padding:"12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontFamily:"monospace",border:`1px solid ${o.borderLight}`},children:l.jsxs("div",{style:{fontSize:"10px",color:o.textSecondary,lineHeight:"1.6"},children:[l.jsxs("div",{children:["scanId: ",s?`"${s}"`:"missing"]}),l.jsxs("div",{children:['serverName: "',u,'"']}),l.jsxs("div",{children:["analysisResult: ",p?"found":"missing"]}),l.jsxs("div",{children:["has scan.result: ",r.result?"yes":"no"]}),l.jsxs("div",{children:["has scan.data: ",r.data?"yes":"no"]}),l.jsxs("div",{children:["scan keys: ",Object.keys(r||{}).join(", ")]}),r.result&&l.jsxs("div",{children:["scan.result keys: ",Object.keys(r.result||{}).join(", ")]}),r.data&&l.jsxs("div",{children:["scan.data keys: ",Object.keys(r.data||{}).join(", ")]})]})})]})}function rh({scan:r}){return l.jsxs("div",{style:{marginBottom:"24px"},children:[l.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"12px",paddingBottom:"8px",borderBottom:`1px solid ${o.borderLight}`},children:"Raw Data"}),l.jsxs("details",{children:[l.jsx("summary",{style:{cursor:"pointer",padding:"8px",background:o.bgTertiary,borderRadius:"4px",fontSize:"11px",color:o.textSecondary,fontFamily:v.body,marginBottom:"8px"},children:"Click to view raw JSON data"}),l.jsx("pre",{style:{padding:"12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontFamily:"monospace",color:o.textPrimary,overflow:"auto",maxHeight:"400px",margin:0},children:JSON.stringify(r,null,2)})]})]})}function oh({scanId:r,serverName:s,onClose:u}){return l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[l.jsxs("div",{children:[l.jsx("h2",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,margin:0,marginBottom:"8px"},children:s}),r&&l.jsxs("div",{style:{fontSize:"12px",color:o.textTertiary,fontFamily:v.body},children:["ID: ",r]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[r&&l.jsxs("a",{href:`https://smart.mcpshark.sh/scan-results?id=${r}`,target:"_blank",rel:"noopener noreferrer",style:{padding:"6px 12px",background:o.buttonPrimary,border:"none",color:o.textInverse,borderRadius:"6px",fontSize:"12px",fontFamily:v.body,fontWeight:"500",textDecoration:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx(Kc,{size:14,stroke:1.5}),"View on Smart Scan"]}),l.jsx("button",{type:"button",onClick:u,style:{padding:"6px",background:"transparent",border:"none",color:o.textSecondary,cursor:"pointer",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:p=>{p.currentTarget.style.background=o.bgTertiary,p.currentTarget.style.color=o.textPrimary},onMouseLeave:p=>{p.currentTarget.style.background="transparent",p.currentTarget.style.color=o.textSecondary},children:l.jsx(qc,{size:20,stroke:1.5})})]})]})}function ih({status:r,overallRiskLevel:s,createdAt:u,updatedAt:p}){const d=f=>f?new Date(f).toLocaleString():"N/A";return l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"16px",padding:"16px",background:o.bgTertiary,borderRadius:"8px"},children:[r&&l.jsxs("div",{children:[l.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:v.body,marginBottom:"4px"},children:"Status"}),l.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontFamily:v.body,fontWeight:"500"},children:r})]}),s&&l.jsxs("div",{children:[l.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:v.body,marginBottom:"4px"},children:"Overall Risk Level"}),l.jsx("span",{style:{padding:"4px 10px",borderRadius:"6px",fontSize:"11px",fontWeight:"700",fontFamily:v.body,background:Wr(s),color:o.textInverse,display:"inline-block"},children:s.toLowerCase()})]}),u&&l.jsxs("div",{children:[l.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:v.body,marginBottom:"4px"},children:"Created At"}),l.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontFamily:v.body,fontWeight:"500"},children:d(u)})]}),p&&l.jsxs("div",{children:[l.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:v.body,marginBottom:"4px"},children:"Updated At"}),l.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontFamily:v.body,fontWeight:"500"},children:d(p)})]})]})}function lh({serverData:r}){return r?l.jsxs("div",{style:{marginBottom:"24px"},children:[l.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"12px",paddingBottom:"8px",borderBottom:`1px solid ${o.borderLight}`},children:"Server Information"}),l.jsxs("div",{style:{padding:"12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"12px",fontFamily:v.body},children:[l.jsxs("div",{style:{marginBottom:"8px"},children:[l.jsx("strong",{style:{color:o.textTertiary},children:"Name: "}),l.jsx("span",{style:{color:o.textPrimary},children:r.name||"N/A"})]}),r.description&&l.jsxs("div",{children:[l.jsx("strong",{style:{color:o.textTertiary},children:"Description: "}),l.jsx("span",{style:{color:o.textPrimary},children:r.description})]})]})]}):null}function me(r,s){return s.split(".").reduce((p,d)=>p&&typeof p=="object"&&d in p?p[d]:null,r)}function sh(r){const s=r.result||r.data||r,u=me(r,"result.id")||me(r,"id")||me(r,"scan_id")||me(r,"data.id")||me(r,"data.scan_id")||s?.id||s?.scan_id,p=r.serverName||r.server_name||me(r,"result.mcp_server_data.server.name")||me(r,"mcp_server_data.server.name")||me(r,"server.name")||me(r,"data.server.name")||me(r,"data.data.server.name")||r.server?.name||"Unknown Server",d=me(r,"result.status")||me(r,"status")||me(r,"data.status"),f=me(r,"result.overall_risk_level")||me(r,"overall_risk_level")||me(r,"data.overall_risk_level")||me(r,"data.data.overall_risk_level"),x=me(r,"result.created_at")||me(r,"created_at")||me(r,"data.created_at")||me(r,"data.data.created_at"),y=me(r,"result.updated_at")||me(r,"updated_at")||me(r,"data.updated_at")||me(r,"data.data.updated_at"),g=me(r,"result.analysis_result")||me(r,"analysis_result")||me(r,"data.analysis_result")||me(r,"data.data.analysis_result")||me(r,"data.data.data.analysis_result"),S=((T,_)=>{if(T)return T;if(_&&typeof _=="object"){if(_.tool_findings||_.prompt_findings||_.resource_findings)return _;if(_.analysis_result)return _.analysis_result}return null})(g,s),b=me(r,"result.mcp_server_data.server")||me(r,"mcp_server_data.server")||me(r,"server")||me(r,"data.server")||me(r,"data.data.server")||me(r,"mcp_server_data");return{scanId:u,serverName:p,status:d,overallRiskLevel:f,createdAt:x,updatedAt:y,analysisResult:S,serverData:b}}function ed({scan:r,loading:s,onClose:u}){if(s)return l.jsx("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"24px",textAlign:"center"},children:l.jsx("p",{style:{color:o.textSecondary,fontFamily:v.body},children:"Loading scan details..."})});if(!r)return l.jsx("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"24px",textAlign:"center"},children:l.jsx("p",{style:{color:o.textSecondary,fontFamily:v.body},children:"No scan data available"})});const{scanId:p,serverName:d,status:f,overallRiskLevel:x,createdAt:y,updatedAt:g,analysisResult:j,serverData:S}=sh(r);return l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"24px",boxShadow:`0 1px 3px ${o.shadowSm}`,position:"relative"},children:[l.jsx(oh,{scanId:p,serverName:d,onClose:u}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsx(nh,{scan:r,scanId:p,serverName:d,analysisResult:j}),l.jsx(ih,{status:f,overallRiskLevel:x,createdAt:y,updatedAt:g}),l.jsx(lh,{serverData:S}),j?l.jsxs("div",{style:{marginBottom:"24px"},children:[l.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"12px",paddingBottom:"8px",borderBottom:`1px solid ${o.borderLight}`},children:"Analysis Result"}),l.jsx(th,{analysis:j})]}):l.jsxs("div",{style:{marginBottom:"24px"},children:[l.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"12px",paddingBottom:"8px",borderBottom:`1px solid ${o.borderLight}`},children:"Analysis Result"}),l.jsx("div",{style:{padding:"12px",background:`${o.bgTertiary}80`,borderRadius:"6px",border:`1px solid ${o.borderLight}`,fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"No analysis result available for this scan. Check the Raw Data section below to see the scan structure."})]}),l.jsx(rh,{scan:r})]})]})}const td=({size:r=24,color:s="currentColor"})=>l.jsx(Zc,{size:r,stroke:1.5,color:s}),ri=({size:r=16,color:s="currentColor"})=>l.jsx(Kc,{size:r,stroke:1.5,color:s}),ah=({size:r=16,color:s="currentColor"})=>l.jsx(Df,{size:r,stroke:1.5,color:s}),Br=({size:r=16,color:s="currentColor"})=>l.jsx(Qf,{size:r,stroke:1.5,color:s}),nd=({size:r=16,color:s="currentColor"})=>l.jsx(Yc,{size:r,stroke:1.5,color:s}),ei=({size:r=16,color:s=o.accentBlue})=>l.jsx("div",{style:{width:r,height:r,border:`2px solid ${o.borderLight}`,borderTop:`2px solid ${s}`,borderRadius:"50%",animation:"spin 0.8s linear infinite"}});function uh({result:r,onViewScan:s}){const u=r.serverName||r.server_name||r.server?.name||"Unknown Server";return console.log("[BatchResultItem] Rendering with result:",{serverName:r.serverName,extractedServerName:u,hasServerName:!!r.serverName,resultKeys:Object.keys(r)}),l.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${r.success?o.borderLight:o.error}`,borderRadius:"8px",padding:"10px 16px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1,minWidth:0},children:[l.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:u}),r.success&&l.jsxs(l.Fragment,{children:[r.data?.data?.overall_risk_level&&l.jsxs("span",{style:{padding:"4px 10px",borderRadius:"6px",fontSize:"10px",fontWeight:"700",fontFamily:v.body,background:Wr(r.data.data.overall_risk_level),color:o.textInverse,whiteSpace:"nowrap"},children:[r.data.data.overall_risk_level.toLowerCase()," risk"]}),s&&r.data&&l.jsxs("button",{type:"button",onClick:()=>s(r.data),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 10px",borderRadius:"6px",background:o.buttonPrimary,border:"none",color:o.textInverse,cursor:"pointer",transition:"all 0.2s",fontSize:"11px",fontWeight:"500",fontFamily:v.body,whiteSpace:"nowrap"},onMouseEnter:p=>{p.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:p=>{p.currentTarget.style.background=o.buttonPrimary},children:[l.jsx(ps,{size:12,stroke:1.5}),l.jsx("span",{children:"View"})]}),r.data?.scan_id&&l.jsxs("a",{href:`https://smart.mcpshark.sh/scan-results?id=${r.data.scan_id}`,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 10px",borderRadius:"6px",background:o.bgSecondary,border:`1px solid ${o.borderLight}`,color:o.accentBlue,textDecoration:"none",cursor:"pointer",transition:"all 0.2s",fontSize:"11px",fontWeight:"500",fontFamily:v.body,whiteSpace:"nowrap"},onMouseEnter:p=>{p.currentTarget.style.background=o.bgTertiary,p.currentTarget.style.borderColor=o.accentBlue},onMouseLeave:p=>{p.currentTarget.style.background=o.bgSecondary,p.currentTarget.style.borderColor=o.borderLight},children:[l.jsx("span",{children:"open"}),l.jsx(ri,{size:12,color:o.accentBlue})]})]})]}),l.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:r.success?l.jsxs(l.Fragment,{children:[r.cached&&l.jsxs("span",{style:{padding:"4px 8px",borderRadius:"6px",fontSize:"10px",fontWeight:"600",fontFamily:v.body,background:o.bgSecondary,color:o.textSecondary,border:`1px solid ${o.borderLight}`,display:"inline-flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap"},title:"This result was retrieved from cache",children:[l.jsx(nd,{size:10,color:o.textSecondary}),l.jsx("span",{children:"Cached"})]}),l.jsxs("span",{style:{padding:"4px 8px",borderRadius:"6px",fontSize:"10px",fontWeight:"700",fontFamily:v.body,background:o.accentGreen,color:o.textInverse,display:"inline-flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap"},children:[l.jsx(Br,{size:10,color:o.textInverse}),l.jsx("span",{children:"Success"})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{padding:"4px 8px",borderRadius:"6px",fontSize:"10px",fontWeight:"700",fontFamily:v.body,background:o.error,color:o.textInverse,whiteSpace:"nowrap"},children:"✗ Failed"}),r.error&&l.jsx("span",{style:{fontSize:"11px",color:o.error,fontFamily:v.body,whiteSpace:"nowrap",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis"},title:r.error,children:r.error})]})})]})}function ch({scanResults:r}){const s=r.filter(d=>d.cached).length,u=r.filter(d=>d.success&&!d.cached).length,p=r.every(d=>d.cached);return l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[l.jsxs("div",{children:[l.jsxs("h2",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,margin:0,marginBottom:"4px"},children:["Scan Results (",r.length," server",r.length!==1?"s":"",")"]}),p&&l.jsx("p",{style:{fontSize:"12px",color:o.textTertiary,fontFamily:v.body,margin:0},children:"Showing cached results. Run a new scan to get the latest analysis."})]}),r.length>0&&l.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center",fontSize:"13px",color:o.textSecondary,fontFamily:v.body},children:[s>0&&l.jsxs("span",{style:{padding:"6px 10px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontWeight:"600",display:"inline-flex",alignItems:"center",gap:"4px",fontFamily:v.body},children:[l.jsx(nd,{size:12,color:o.textSecondary}),l.jsxs("span",{children:[s," cached"]})]}),u>0&&l.jsxs("span",{style:{padding:"6px 10px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontWeight:"600",display:"inline-flex",alignItems:"center",gap:"4px"},children:[l.jsx(Br,{size:12,color:o.accentGreen}),l.jsxs("span",{children:[u," scanned"]})]})]})]})}function dh({scanResults:r,onViewScan:s}){return r.length===0?null:l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"20px",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[l.jsx(ch,{scanResults:r}),l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((u,p)=>l.jsx(uh,{result:u,onViewScan:s},u.scanId||`batch-result-${p}`))})]})}function ph(){return l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"400px",textAlign:"center",padding:"40px"},children:[l.jsx("div",{style:{marginBottom:"24px",opacity:.6},children:l.jsxs("svg",{width:64,height:64,viewBox:"0 0 24 24",fill:"none",stroke:o.textTertiary,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:.5},role:"img","aria-label":"Empty state icon",children:[l.jsx("title",{children:"Empty state icon"}),l.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),l.jsx("path",{d:"M9 12l2 2 4-4"})]})}),l.jsx("h3",{style:{fontSize:"20px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"8px"},children:"Ready to Scan"}),l.jsx("p",{style:{fontSize:"14px",color:o.textSecondary,fontFamily:v.body,maxWidth:"400px",lineHeight:"1.6"},children:"Configure your API token and discover MCP servers to start security scanning. Results will appear here."})]})}function fh({error:r}){return r?l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.error}`,borderRadius:"12px",padding:"16px 20px",marginBottom:"24px",display:"flex",gap:"12px",alignItems:"flex-start"},children:[l.jsx(ah,{size:20,color:o.error,style:{flexShrink:0,marginTop:"2px"}}),l.jsxs("div",{style:{flex:1},children:[l.jsx("p",{style:{fontSize:"14px",color:o.error,fontFamily:v.body,margin:0,fontWeight:"600",marginBottom:"4px"},children:"Error"}),l.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,fontFamily:v.body,margin:0,lineHeight:"1.5"},children:r})]})]}):null}function gh({scanning:r,selectedServers:s}){return r?l.jsx("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"24px",boxShadow:`0 2px 8px ${o.shadowSm}`},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[l.jsx(ei,{size:20}),l.jsxs("div",{style:{flex:1},children:[l.jsxs("p",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,margin:0,marginBottom:"4px"},children:["Scanning ",s.size," server",s.size!==1?"s":"","..."]}),l.jsx("p",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body,margin:0},children:"Analyzing security vulnerabilities and risks"})]})]})}):null}function hh({scanResult:r}){return r?l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"20px",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[l.jsx("h2",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"16px"},children:"Scan Results"}),r.data?.overall_risk_level&&l.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"16px",marginBottom:"20px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"8px"},children:[l.jsx("span",{style:{padding:"4px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:"700",fontFamily:v.body,background:Wr(r.data.overall_risk_level),color:o.textInverse},children:r.data.overall_risk_level.toUpperCase()}),l.jsx("span",{style:{fontSize:"14px",color:o.textSecondary,fontFamily:v.body},children:"Overall Risk Level"})]}),r.data.overall_reason&&l.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,fontFamily:v.body,margin:0},children:r.data.overall_reason})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"12px",marginBottom:"20px"},children:[r.data?.tool_findings?.length>0&&l.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"12px"},children:[l.jsx("div",{style:{fontSize:"24px",fontWeight:"700",color:o.textPrimary,fontFamily:v.body},children:r.data.tool_findings.length}),l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"Tool Findings"})]}),r.data?.resource_findings?.length>0&&l.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"12px"},children:[l.jsx("div",{style:{fontSize:"24px",fontWeight:"700",color:o.textPrimary,fontFamily:v.body},children:r.data.resource_findings.length}),l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"Resource Findings"})]}),r.data?.prompt_findings?.length>0&&l.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"12px"},children:[l.jsx("div",{style:{fontSize:"24px",fontWeight:"700",color:o.textPrimary,fontFamily:v.body},children:r.data.prompt_findings.length}),l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"Prompt Findings"})]})]}),r.data?.recommendations?.length>0&&l.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"16px",marginBottom:"20px"},children:[l.jsx("h3",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"12px"},children:"Recommendations"}),l.jsx("ul",{style:{margin:0,paddingLeft:"20px",fontSize:"13px",color:o.textSecondary,fontFamily:v.body,lineHeight:"1.8"},children:r.data.recommendations.map((s,u)=>l.jsx("li",{children:s},`recommendation-${u}-${s.substring(0,30)}`))})]}),r.scan_id&&l.jsx("div",{style:{marginTop:"20px",paddingTop:"20px",borderTop:`1px solid ${o.borderLight}`},children:l.jsxs("a",{href:`https://smart.mcpshark.sh/scan-results?id=${r.scan_id}`,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"10px 20px",background:o.buttonSecondary,color:o.textPrimary,border:`1px solid ${o.borderMedium}`,borderRadius:"8px",textDecoration:"none",fontSize:"13px",fontWeight:"600",fontFamily:v.body,transition:"all 0.2s ease"},onMouseEnter:s=>{s.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:s=>{s.currentTarget.style.background=o.buttonSecondary},children:[l.jsx("span",{children:"View Full Results"}),l.jsx(ri,{size:14,color:o.textPrimary})]})})]}):null}function rd({error:r,scanning:s,selectedServers:u,scanResults:p,scanResult:d,onViewScan:f}){return l.jsxs("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"24px",background:o.bgPrimary},children:[!r&&p.length===0&&!d&&!s&&l.jsx(ph,{}),l.jsx(fh,{error:r}),l.jsx(gh,{scanning:s,selectedServers:u}),p.length>0&&l.jsx(dh,{scanResults:p,onViewScan:f}),d&&p.length===0&&l.jsx(hh,{scanResult:d})]})}function xh({error:r,loadingScans:s,selectedScan:u,loadingScanDetail:p,allScans:d,setSelectedScan:f,loadScanDetail:x,onViewScan:y}){return s?l.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",background:o.bgPrimary},children:l.jsx("p",{style:{color:o.textSecondary,fontFamily:v.body},children:"Loading cached scans..."})}):u?l.jsx(ed,{scan:u,loading:p,onClose:()=>{f(null),x(null)}}):l.jsxs(l.Fragment,{children:[r&&l.jsx("div",{style:{padding:"12px 16px",background:`${o.error}20`,border:`1px solid ${o.error}`,borderRadius:"8px",marginBottom:"16px",color:o.error,fontSize:"13px",fontFamily:v.body},children:r}),l.jsx(rd,{error:r,scanning:!1,selectedServers:[],scanResults:d,scanResult:null,onViewScan:y})]})}function yh({discoveredServers:r,selectedServers:s,setSelectedServers:u,runScan:p,scanning:d,apiToken:f}){const x=()=>{s.size===r.length?u(new Set):u(new Set(r.map(y=>y.name)))};return l.jsx("div",{style:{background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,padding:"12px 24px"},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px",flexWrap:"wrap"},children:[l.jsx("div",{style:{fontSize:"12px",fontWeight:"600",color:o.textSecondary,fontFamily:v.body,whiteSpace:"nowrap"},children:"Select servers to scan:"}),l.jsx("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap",flex:1},children:r.map((y,g)=>{const j=s.has(y.name);return l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:j?o.bgCard:o.bgTertiary,border:`1px solid ${j?o.accentBlue:o.borderLight}`,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s ease",fontSize:"12px",fontFamily:v.body,fontWeight:j?"600":"500",color:j?o.textPrimary:o.textSecondary},onMouseEnter:S=>{S.currentTarget.style.borderColor=o.accentBlue,S.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`},onMouseLeave:S=>{j||(S.currentTarget.style.borderColor=o.borderLight,S.currentTarget.style.boxShadow="none")},children:[l.jsx("input",{type:"checkbox",checked:j,onChange:S=>{const b=new Set(s);S.target.checked?b.add(y.name):b.delete(y.name),u(b)},style:{width:"16px",height:"16px",cursor:"pointer",accentColor:o.accentBlue}}),l.jsx("span",{children:y.name}),l.jsxs("span",{style:{fontSize:"10px",color:o.textTertiary,fontWeight:"400"},children:["(",y.tools?.length||0," tools, ",y.resources?.length||0," resources,"," ",y.prompts?.length||0," prompts)"]})]},y.name||`server-${g}`)})}),l.jsx("button",{type:"button",onClick:x,style:{padding:"6px 12px",background:o.buttonSecondary,color:o.textPrimary,border:`1px solid ${o.borderMedium}`,borderRadius:"6px",fontSize:"11px",fontWeight:"600",fontFamily:v.body,cursor:"pointer",transition:"all 0.2s ease",whiteSpace:"nowrap"},onMouseEnter:y=>{y.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:y=>{y.currentTarget.style.background=o.buttonSecondary},children:s.size===r.length?"Deselect All":"Select All"}),l.jsx("button",{type:"button",onClick:p,disabled:!f||s.size===0||d,style:{padding:"8px 16px",background:f&&s.size>0&&!d?o.buttonPrimary:o.buttonSecondary,color:f&&s.size>0&&!d?o.textInverse:o.textTertiary,border:"none",borderRadius:"6px",fontSize:"13px",fontWeight:"600",fontFamily:v.body,cursor:f&&s.size>0&&!d?"pointer":"not-allowed",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap"},onMouseEnter:y=>{f&&s.size>0&&!d&&(y.currentTarget.style.background=o.buttonPrimaryHover,y.currentTarget.style.transform="translateY(-1px)",y.currentTarget.style.boxShadow=`0 4px 12px ${o.shadowMd}`)},onMouseLeave:y=>{f&&s.size>0&&!d&&(y.currentTarget.style.background=o.buttonPrimary,y.currentTarget.style.transform="translateY(0)",y.currentTarget.style.boxShadow="none")},children:d?l.jsxs(l.Fragment,{children:[l.jsx(ei,{size:14,color:o.textInverse}),l.jsxs("span",{children:["Scanning ",s.size," server",s.size!==1?"s":"","..."]})]}):l.jsxs(l.Fragment,{children:[l.jsx(td,{size:14,color:f&&s.size>0?o.textInverse:o.textTertiary}),l.jsxs("span",{children:["Run Scan (",s.size,")"]})]})})]})})}function mh({discoveredServers:r,selectedServers:s,setSelectedServers:u,runScan:p,scanning:d,apiToken:f,error:x,scanResults:y,scanResult:g,selectedScan:j,loadingScanDetail:S,setSelectedScan:b,loadScanDetail:T,onViewScan:_}){return j?l.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"24px",background:o.bgPrimary},children:l.jsx(ed,{scan:j,loading:S,onClose:()=>{b(null),T(null)}})}):l.jsxs(l.Fragment,{children:[r.length>0&&l.jsx(yh,{discoveredServers:r,selectedServers:s,setSelectedServers:u,runScan:p,scanning:d,apiToken:f}),l.jsx(rd,{error:x,scanning:d,selectedServers:s,scanResults:y,scanResult:g,onViewScan:_})]})}function od({isOpen:r,onClose:s,onConfirm:u,title:p,message:d,confirmText:f="Confirm",cancelText:x="Cancel",danger:y=!1}){return r?l.jsx("dialog",{open:!0,"aria-modal":"true",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,border:"none",margin:0,width:"100%",height:"100%"},onClick:s,onKeyDown:g=>{g.key==="Escape"&&s()},children:l.jsxs("div",{role:"document",style:{background:o.bgCard,borderRadius:"12px",padding:"24px",maxWidth:"500px",width:"90%",boxShadow:`0 4px 20px ${o.shadowLg}`,fontFamily:v.body},onClick:g=>g.stopPropagation(),onKeyDown:g=>g.stopPropagation(),children:[l.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:"18px",fontWeight:"600",color:o.textPrimary},children:p}),l.jsx("p",{style:{margin:"0 0 24px 0",fontSize:"14px",color:o.textSecondary,lineHeight:"1.5"},children:d}),l.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:[l.jsx("button",{type:"button",onClick:s,style:{padding:"10px 20px",background:o.buttonSecondary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",color:o.textPrimary,fontSize:"14px",fontWeight:"500",fontFamily:v.body,cursor:"pointer",transition:"all 0.2s"},onMouseEnter:g=>{g.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:g=>{g.currentTarget.style.background=o.buttonSecondary},children:x}),l.jsx("button",{type:"button",onClick:()=>{u(),s()},style:{padding:"10px 20px",background:y?o.buttonDanger:o.buttonPrimary,border:"none",borderRadius:"8px",color:o.textInverse,fontSize:"14px",fontWeight:"500",fontFamily:v.body,cursor:"pointer",transition:"all 0.2s"},onMouseEnter:g=>{g.currentTarget.style.background=y?o.buttonDangerHover:o.buttonPrimaryHover},onMouseLeave:g=>{g.currentTarget.style.background=y?o.buttonDanger:o.buttonPrimary},children:f})]})]})}):null}function vh({apiToken:r,setApiToken:s,saveToken:u,loadingData:p,discoverMcpData:d,discoveredServers:f,_selectedServers:x,_setSelectedServers:y,scanning:g,clearCache:j,clearingCache:S,...b}){const{runScan:T}=b,_=L.useRef(null),[z,R]=L.useState(!1),P=I=>{s(I),_.current&&clearTimeout(_.current),I?_.current=setTimeout(()=>{u(I)},1e3):u("")};return l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"20px",flexWrap:"wrap",flex:1,justifyContent:"flex-end"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("label",{htmlFor:"api-token-input",style:{fontSize:"12px",fontWeight:"600",color:o.textSecondary,fontFamily:v.body,whiteSpace:"nowrap"},children:"API Token:"}),l.jsxs("div",{style:{position:"relative",width:"200px"},children:[l.jsx("input",{id:"api-token-input",type:"password",value:r,onChange:I=>P(I.target.value),placeholder:"sk_...",style:{width:"100%",padding:"8px 10px",paddingRight:r?"28px":"10px",border:`1px solid ${r?o.accentGreen:o.borderMedium}`,borderRadius:"8px",fontSize:"12px",fontFamily:v.body,background:o.bgCard,color:o.textPrimary,boxSizing:"border-box",transition:"all 0.2s ease"},onFocus:I=>{I.currentTarget.style.borderColor=o.accentBlue,I.currentTarget.style.boxShadow=`0 0 0 2px ${o.accentBlue}20`},onBlur:I=>{I.currentTarget.style.borderColor=r?o.accentGreen:o.borderMedium,I.currentTarget.style.boxShadow="none"}}),r&&l.jsx("div",{style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)"},children:l.jsx(Br,{size:12,color:o.accentGreen})})]}),l.jsxs("a",{href:"https://smart.mcpshark.sh/tokens",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",color:o.accentBlue,textDecoration:"none",fontFamily:v.body,fontWeight:"500",whiteSpace:"nowrap"},onMouseEnter:I=>{I.currentTarget.style.textDecoration="underline"},onMouseLeave:I=>{I.currentTarget.style.textDecoration="none"},children:[l.jsx("span",{children:"Get token"}),l.jsx(ri,{size:10,color:o.accentBlue})]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("label",{htmlFor:"servers-label",style:{fontSize:"12px",fontWeight:"600",color:o.textSecondary,fontFamily:v.body,whiteSpace:"nowrap"},children:"Servers:"}),l.jsx("button",{type:"button",onClick:d,disabled:p,style:{padding:"8px 14px",background:p?o.buttonSecondary:o.buttonPrimary,color:p?o.textTertiary:o.textInverse,border:"none",borderRadius:"6px",fontSize:"12px",fontWeight:"600",fontFamily:v.body,cursor:p?"not-allowed":"pointer",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",whiteSpace:"nowrap"},onMouseEnter:I=>{p||(I.currentTarget.style.background=o.buttonPrimaryHover,I.currentTarget.style.transform="translateY(-1px)")},onMouseLeave:I=>{p||(I.currentTarget.style.background=o.buttonPrimary,I.currentTarget.style.transform="translateY(0)")},children:p?l.jsxs(l.Fragment,{children:[l.jsx(ei,{size:12}),l.jsx("span",{children:"Discovering..."})]}):l.jsxs(l.Fragment,{children:[l.jsx(Br,{size:12,color:o.textInverse}),l.jsx("span",{children:"Discover"})]})}),f.length>0&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 10px",background:o.bgTertiary,borderRadius:"8px",fontSize:"11px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:[l.jsx(Br,{size:12,color:o.accentGreen}),l.jsxs("span",{children:[f.length," server",f.length!==1?"s":""]})]})]}),l.jsx("button",{type:"button",onClick:()=>R(!0),disabled:S,style:{padding:"8px 14px",background:o.buttonSecondary,border:`1px solid ${o.borderLight}`,color:o.textSecondary,cursor:S?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",fontFamily:v.body,borderRadius:"8px",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",whiteSpace:"nowrap",opacity:S?.5:1},onMouseEnter:I=>{S||(I.currentTarget.style.background=o.buttonSecondaryHover,I.currentTarget.style.color=o.textPrimary)},onMouseLeave:I=>{S||(I.currentTarget.style.background=o.buttonSecondary,I.currentTarget.style.color=o.textSecondary)},title:"Clear cached scan results",children:S?l.jsxs(l.Fragment,{children:[l.jsx(ei,{size:12}),l.jsx("span",{children:"Clearing..."})]}):l.jsxs(l.Fragment,{children:[l.jsx(IconTrash,{size:14,stroke:1.5}),l.jsx("span",{children:"Clear Cache"})]})}),l.jsx(od,{isOpen:z,onClose:()=>R(!1),onConfirm:async()=>{(await j()).success&&R(!1)},title:"Clear Scan Cache?",message:"Are you sure you want to clear all cached scan results? This will force fresh scans for all servers on the next scan.",confirmText:"Clear Cache",cancelText:"Cancel",danger:!1})]})}function Sh(){return l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginRight:"auto"},children:[l.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"10px",background:`linear-gradient(135deg, ${o.accentBlue}20, ${o.accentGreen}20)`,border:`2px solid ${o.accentBlue}40`,flexShrink:0},children:l.jsx(td,{size:20,color:o.accentBlue})}),l.jsxs("div",{children:[l.jsx("h1",{style:{fontSize:"18px",fontWeight:"700",color:o.textPrimary,fontFamily:v.body,margin:0,letterSpacing:"-0.2px"},children:l.jsxs("a",{href:"https://smart.mcpshark.sh/#get-started",target:"_blank",rel:"noopener noreferrer",style:{color:o.textPrimary,textDecoration:"none",display:"inline-flex",alignItems:"center",gap:"6px",transition:"color 0.2s ease"},onMouseEnter:r=>{r.currentTarget.style.color=o.accentBlue},onMouseLeave:r=>{r.currentTarget.style.color=o.textPrimary},children:["Smart Scan",l.jsx(ri,{size:12,color:"currentColor"})]})}),l.jsx("p",{style:{fontSize:"11px",color:o.textSecondary,fontFamily:v.body,margin:0,lineHeight:"1.3"},children:"AI-powered security analysis for Model Context Protocol (MCP) servers"})]})]})}function bh({viewMode:r,setViewMode:s,onSwitchToScan:u,onSwitchToList:p}){return l.jsxs("div",{style:{display:"flex",gap:"8px",border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"4px",background:o.bgSecondary},children:[l.jsx("button",{type:"button",onClick:()=>{s("scan"),u?.()},style:{padding:"6px 14px",background:r==="scan"?o.bgCard:"transparent",border:"none",color:r==="scan"?o.textPrimary:o.textSecondary,borderRadius:"6px",fontSize:"12px",fontFamily:v.body,fontWeight:r==="scan"?"600":"400",cursor:"pointer",transition:"all 0.2s"},children:"Scan Servers"}),l.jsx("button",{type:"button",onClick:()=>{s("list"),p?.()},style:{padding:"6px 14px",background:r==="list"?o.bgCard:"transparent",border:"none",color:r==="list"?o.textPrimary:o.textSecondary,borderRadius:"6px",fontSize:"12px",fontFamily:v.body,fontWeight:r==="list"?"600":"400",cursor:"pointer",transition:"all 0.2s"},children:"View All Scans"})]})}function kh(r,s,u){const[p,d]=L.useState(!1);return{clearingCache:p,clearCache:async()=>{d(!0),u(null);try{const x=await fetch("/api/smartscan/cache/clear",{method:"POST"}),y=await x.json();if(x.ok)return r.length>0&&await s(),{success:!0,message:y.message};throw new Error(y.error||"Failed to clear cache")}catch(x){return u(x.message||"Failed to clear cache"),{success:!1,error:x.message}}finally{d(!1)}}}}function wh(r){const[s,u]=L.useState(null),[p,d]=L.useState([]),[f,x]=L.useState(new Set),[y,g]=L.useState(!1),[j,S]=L.useState(null);return{mcpData:s,discoveredServers:p,selectedServers:f,setSelectedServers:x,loadingData:y,discoverMcpData:async()=>{g(!0),r(null),u(null),d([]);try{const _=await fetch("/api/smartscan/discover");if(!_.ok){const R=await _.json();throw new Error(R.message||"Failed to discover servers")}const z=await _.json();if(!z.success||!z.servers||z.servers.length===0)throw new Error("No MCP servers found in config. Please configure servers in the Setup tab.");if(d(z.servers),z.servers.length>0){x(new Set(z.servers.map(R=>R.name)));try{const R=await fetch("/api/smartscan/cached-results",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({servers:z.servers})});if(R.ok){const P=await R.json();P.success&&P.results&&P.results.filter(O=>O.success&&O.cached).length>0}}catch(R){console.debug("Could not load cached results:",R)}}if(z.servers.length>0){const R=z.servers[0];u({server:{name:R.name,description:"Discovered from MCP config"},tools:R.tools||[],resources:R.resources||[],prompts:R.prompts||[]})}}catch(_){r(_.message||"Failed to discover MCP server data")}finally{g(!1)}},makeMcpRequest:async(_,z={})=>{const R={"Content-Type":"application/json"};j&&(R["Mcp-Session-Id"]=j);const P=await fetch("/api/playground/proxy",{method:"POST",headers:R,body:JSON.stringify({method:_,params:z})}),I=await P.json(),O=P.headers.get("Mcp-Session-Id")||P.headers.get("mcp-session-id")||I._sessionId;if(O&&O!==j&&S(O),!P.ok)throw new Error(I.error?.message||I.message||"Request failed");return I.result||I}}}function jh(r,s){const[u,p]=L.useState([]),[d,f]=L.useState(!1),[x,y]=L.useState(null),[g,j]=L.useState(!1);return{allScans:u,loadingScans:d,loadAllScans:async()=>{f(!0),s(null);try{console.log("Loading cached scans from local storage...");const T=await fetch("/api/smartscan/scans?cache=true"),_=await T.json();if(console.log("Cache response:",{status:T.status,ok:T.ok,cacheData:_}),T.ok){const z=_.scans||[];console.log(`[useScanList] Loaded ${z.length} cached scans from API`),console.log("[useScanList] Full cacheData:",_),z.length>0&&console.log("[useScanList] First scan structure:",{keys:Object.keys(z[0]),serverName:z[0].serverName,server_name:z[0].server_name,server:z[0].server,fullScan:z[0]});const R=z.map((P,I)=>{console.log(`[useScanList] Transforming scan ${I}:`,{scanId:P.id||P.scan_id,serverName:P.serverName,server_name:P.server_name,server:P.server,hasServerName:!!P.serverName,hasServerNameAlt:!!P.server_name,hasServer:!!P.server});const O=P.serverName?.trim()||P.server_name?.trim()||P.server?.name?.trim()||"Unknown Server";console.log(`[useScanList] Extracted serverName for scan ${I}: "${O}"`),O==="Unknown Server"&&console.error("[useScanList] Could not find server name in scan:",{scanId:P.id||P.scan_id,hasServerName:!!P.serverName,hasServerNameAlt:!!P.server_name,hasServer:!!P.server,serverNameValue:P.serverName,serverNameAltValue:P.server_name,serverNameFromServer:P.server?.name,scanKeys:Object.keys(P),fullScanObject:P});const U=P.data||P.result||P,W=U?.data&&typeof U.data=="object"?U.data:U,$={serverName:O,success:!0,cached:!0,data:{scan_id:P.scan_id||P.id,data:W}};return console.log(`[useScanList] Transformed result ${I}:`,{serverName:$.serverName,scan_id:$.data.scan_id}),$});console.log("[useScanList] Final transformed scanResults:",R.map(P=>({serverName:P.serverName,scan_id:P.data.scan_id}))),console.log("[useScanList] Setting allScans state with:",R.length,"items"),console.log("[useScanList] First item serverName:",R[0]?.serverName),console.log("[useScanList] Second item serverName:",R[1]?.serverName),p(R),R.length===0&&s("No cached scans found. Please run a scan first to see results here.")}else s(_.error||_.message||"Failed to load cached scans")}catch(T){s(T.message||"Failed to load cached scans")}finally{f(!1)}},selectedScan:x,setSelectedScan:y,loadingScanDetail:g,loadScanDetail:async T=>{if(!T){y(null);return}const _=u.find(z=>z.data?.scan_id===T||z.data?.data?.id===T||z.data?.data?.scan_id===T);if(_?.cached&&_.data?.data){const z=_.data.data;y({...z,scan_id:_.data.scan_id||z.id||z.scan_id});return}if(!r){s("Please enter your API token to view scan details");return}j(!0),s(null);try{const z=await fetch(`/api/smartscan/scans/${T}`,{headers:{Authorization:`Bearer ${r}`}}),R=await z.json();z.ok?y(R.result||R):s(R.error||R.message||"Failed to load scan details")}catch(z){s(z.message||"Failed to load scan details")}finally{j(!1)}}}}function Ch(r,s,u,p){const[d,f]=L.useState(!1),[x,y]=L.useState(null),[g,j]=L.useState([]);return{scanning:d,scanResult:x,scanResults:g,runScan:async()=>{if(!r){p("Please enter your API token");return}if(!s||s.length===0){p("Please discover MCP servers first");return}if(u.size===0){p("Please select at least one server to scan");return}f(!0),p(null),y(null),j([]);const b=s.filter(T=>u.has(T.name));try{const T=await fetch("/api/smartscan/scans/batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiToken:r,servers:b})}),_=await T.json();if(!T.ok){const z=P=>Array.isArray(P)?`Validation failed: ${P.map(I=>typeof I=="string"?I:I.field&&I.message?`${I.field}: ${I.message}`:JSON.stringify(I)).join("; ")}`:null,R=T.status===400&&_.details?z(_.details)||_.error||_.message||`API error: ${T.status}`:_.error||_.message||`API error: ${T.status}`;p(R);return}if(_.results&&Array.isArray(_.results)){j(_.results);const z=_.results.find(R=>R.success);z&&y(z.data)}}catch(T){p(T.message||"Failed to run scan")}finally{f(!1)}}}}function Th(){const[r,s]=L.useState(null);L.useEffect(()=>{u();const p=setInterval(u,2e3);return()=>clearInterval(p)},[]);const u=async()=>{try{const p=await fetch("/api/composite/status");if(!p.ok)throw new Error("Server not available");const d=await p.json();s(d)}catch{s({running:!1})}};return{serverStatus:r}}function Ph(){const[r,s]=L.useState(""),u=L.useRef(null);L.useEffect(()=>(p(),()=>{u.current&&clearTimeout(u.current)}),[]);const p=async()=>{try{const f=await fetch("/api/smartscan/token");if(f.ok){const x=await f.json();x.token&&s(x.token)}}catch{console.debug("No stored token found")}};return{apiToken:r,setApiToken:s,saveToken:async f=>{try{(await fetch("/api/smartscan/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:f})})).ok||console.error("Failed to save token")}catch(x){console.error("Error saving token:",x)}},saveTokenTimeoutRef:u}}function _h(){const[r,s]=L.useState(null),{apiToken:u,setApiToken:p,saveToken:d,saveTokenTimeoutRef:f}=Ph(),{serverStatus:x}=Th(),{mcpData:y,discoveredServers:g,selectedServers:j,setSelectedServers:S,loadingData:b,discoverMcpData:T,makeMcpRequest:_}=wh(s),{scanning:z,scanResult:R,scanResults:P,runScan:I}=Ch(u,g,j,s),{allScans:O,loadingScans:U,loadAllScans:W,selectedScan:$,setSelectedScan:H,loadingScanDetail:K,loadScanDetail:V}=jh(u,s),{clearingCache:G,clearCache:Y}=kh(g,T,s);return{apiToken:u,setApiToken:p,serverStatus:x,mcpData:y,discoveredServers:g,selectedServers:j,setSelectedServers:S,loadingData:b,scanning:z,scanResult:R,scanResults:P,error:r,saveToken:d,discoverMcpData:T,runScan:I,clearCache:Y,clearingCache:G,saveTokenTimeoutRef:f,allScans:O,loadingScans:U,loadAllScans:W,selectedScan:$,setSelectedScan:H,loadingScanDetail:K,loadScanDetail:V,makeMcpRequest:_}}function Lh(){const[r,s]=L.useState("scan"),{apiToken:u,setApiToken:p,discoveredServers:d,selectedServers:f,setSelectedServers:x,loadingData:y,scanning:g,scanResult:j,scanResults:S,error:b,saveToken:T,discoverMcpData:_,runScan:z,clearCache:R,clearingCache:P,allScans:I,loadingScans:O,loadAllScans:U,selectedScan:W,setSelectedScan:$,loadingScanDetail:H,loadScanDetail:K}=_h();return l.jsxs("div",{"data-tab-content":!0,style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column",background:o.bgPrimary},children:[l.jsx("div",{style:{background:o.bgCard,borderBottom:`1px solid ${o.borderLight}`,padding:"16px 24px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"24px",flexWrap:"wrap"},children:[l.jsx(Sh,{}),l.jsx(bh,{viewMode:r,setViewMode:s,onSwitchToScan:()=>$(null),onSwitchToList:()=>{$(null),I.length===0&&U()}}),r==="scan"&&l.jsx(vh,{apiToken:u,setApiToken:p,saveToken:T,loadingData:y,discoverMcpData:_,discoveredServers:d,selectedServers:f,setSelectedServers:x,runScan:z,scanning:g,clearCache:R,clearingCache:P})]})}),r==="scan"?l.jsx(mh,{discoveredServers:d,selectedServers:f,setSelectedServers:x,runScan:z,scanning:g,apiToken:u,error:b,scanResults:S,scanResult:j,selectedScan:W,loadingScanDetail:H,setSelectedScan:$,loadScanDetail:K,onViewScan:V=>{if(console.log("onViewScan - scanData:",V),V.scan_id&&u)K(V.scan_id);else if(V.data&&typeof V.data=="object"){const G=V.data;$({...G,scan_id:V.scan_id||G.id||G.scan_id})}else $(V)}}):l.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"24px",background:o.bgPrimary},children:l.jsx(xh,{error:b,loadingScans:O,selectedScan:W,loadingScanDetail:H,allScans:I,setSelectedScan:$,loadScanDetail:K,onViewScan:V=>{console.log("onViewScan - scanData:",V);const G=V.scan_id||V.id||V.hash,ce=I.find(Se=>Se.data?.scan_id===G||Se.data?.data?.scan_id===G)?.serverName||V.serverName||"Unknown Server";if(V?.data&&typeof V.data=="object"){const Se=V.data;$({...Se,scan_id:G||Se.id||Se.scan_id||Se.hash,serverName:ce})}else V&&typeof V=="object"?$({...V,scan_id:G||V.id||V.hash,serverName:ce}):console.warn("Invalid scanData structure:",V)}})})]})}const zh=({size:r=32,className:s="",style:u={}})=>l.jsx("img",{src:"/og-image.png",alt:"MCP Shark Logo",width:r,height:r,className:s,style:{width:`${r}px`,height:`${r}px`,objectFit:"contain",...u},"aria-label":"MCP Shark Logo"});var id={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},gs={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},Eh=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],ti={CSS:{},springs:{}};function Et(r,s,u){return Math.min(Math.max(r,s),u)}function Dr(r,s){return r.indexOf(s)>-1}function ss(r,s){return r.apply(null,s)}var ie={arr:function(r){return Array.isArray(r)},obj:function(r){return Dr(Object.prototype.toString.call(r),"Object")},pth:function(r){return ie.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return r.nodeType||ie.svg(r)},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r>"u"},nil:function(r){return ie.und(r)||r===null},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return ie.hex(r)||ie.rgb(r)||ie.hsl(r)},key:function(r){return!id.hasOwnProperty(r)&&!gs.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function ld(r){var s=/\(([^)]+)\)/.exec(r);return s?s[1].split(",").map(function(u){return parseFloat(u)}):[]}function sd(r,s){var u=ld(r),p=Et(ie.und(u[0])?1:u[0],.1,100),d=Et(ie.und(u[1])?100:u[1],.1,100),f=Et(ie.und(u[2])?10:u[2],.1,100),x=Et(ie.und(u[3])?0:u[3],.1,100),y=Math.sqrt(d/p),g=f/(2*Math.sqrt(d*p)),j=g<1?y*Math.sqrt(1-g*g):0,S=1,b=g<1?(g*y+-x)/j:-x+y;function T(z){var R=s?s*z/1e3:z;return g<1?R=Math.exp(-R*g*y)*(S*Math.cos(j*R)+b*Math.sin(j*R)):R=(S+b*R)*Math.exp(-R*y),z===0||z===1?z:1-R}function _(){var z=ti.springs[r];if(z)return z;for(var R=1/6,P=0,I=0;;)if(P+=R,T(P)===1){if(I++,I>=16)break}else I=0;var O=P*R*1e3;return ti.springs[r]=O,O}return s?T:_}function Rh(r){return r===void 0&&(r=10),function(s){return Math.ceil(Et(s,1e-6,1)*r)*(1/r)}}var Mh=(function(){var r=11,s=1/(r-1);function u(S,b){return 1-3*b+3*S}function p(S,b){return 3*b-6*S}function d(S){return 3*S}function f(S,b,T){return((u(b,T)*S+p(b,T))*S+d(b))*S}function x(S,b,T){return 3*u(b,T)*S*S+2*p(b,T)*S+d(b)}function y(S,b,T,_,z){var R,P,I=0;do P=b+(T-b)/2,R=f(P,_,z)-S,R>0?T=P:b=P;while(Math.abs(R)>1e-7&&++I<10);return P}function g(S,b,T,_){for(var z=0;z<4;++z){var R=x(b,T,_);if(R===0)return b;var P=f(b,T,_)-S;b-=P/R}return b}function j(S,b,T,_){if(!(0<=S&&S<=1&&0<=T&&T<=1))return;var z=new Float32Array(r);if(S!==b||T!==_)for(var R=0;R<r;++R)z[R]=f(R*s,S,T);function P(I){for(var O=0,U=1,W=r-1;U!==W&&z[U]<=I;++U)O+=s;--U;var $=(I-z[U])/(z[U+1]-z[U]),H=O+$*s,K=x(H,S,T);return K>=.001?g(I,H,S,T):K===0?H:y(I,O,O+s,S,T)}return function(I){return S===b&&T===_||I===0||I===1?I:f(P(I),b,_)}}return j})(),ad=(function(){var r={linear:function(){return function(p){return p}}},s={Sine:function(){return function(p){return 1-Math.cos(p*Math.PI/2)}},Expo:function(){return function(p){return p?Math.pow(2,10*p-10):0}},Circ:function(){return function(p){return 1-Math.sqrt(1-p*p)}},Back:function(){return function(p){return p*p*(3*p-2)}},Bounce:function(){return function(p){for(var d,f=4;p<((d=Math.pow(2,--f))-1)/11;);return 1/Math.pow(4,3-f)-7.5625*Math.pow((d*3-2)/22-p,2)}},Elastic:function(p,d){p===void 0&&(p=1),d===void 0&&(d=.5);var f=Et(p,1,10),x=Et(d,.1,2);return function(y){return y===0||y===1?y:-f*Math.pow(2,10*(y-1))*Math.sin((y-1-x/(Math.PI*2)*Math.asin(1/f))*(Math.PI*2)/x)}}},u=["Quad","Cubic","Quart","Quint"];return u.forEach(function(p,d){s[p]=function(){return function(f){return Math.pow(f,d+2)}}}),Object.keys(s).forEach(function(p){var d=s[p];r["easeIn"+p]=d,r["easeOut"+p]=function(f,x){return function(y){return 1-d(f,x)(1-y)}},r["easeInOut"+p]=function(f,x){return function(y){return y<.5?d(f,x)(y*2)/2:1-d(f,x)(y*-2+2)/2}},r["easeOutIn"+p]=function(f,x){return function(y){return y<.5?(1-d(f,x)(1-y*2))/2:(d(f,x)(y*2-1)+1)/2}}}),r})();function hs(r,s){if(ie.fnc(r))return r;var u=r.split("(")[0],p=ad[u],d=ld(r);switch(u){case"spring":return sd(r,s);case"cubicBezier":return ss(Mh,d);case"steps":return ss(Rh,d);default:return ss(p,d)}}function ud(r){try{var s=document.querySelectorAll(r);return s}catch{return}}function oi(r,s){for(var u=r.length,p=arguments.length>=2?arguments[1]:void 0,d=[],f=0;f<u;f++)if(f in r){var x=r[f];s.call(p,x,f,r)&&d.push(x)}return d}function ii(r){return r.reduce(function(s,u){return s.concat(ie.arr(u)?ii(u):u)},[])}function Mc(r){return ie.arr(r)?r:(ie.str(r)&&(r=ud(r)||r),r instanceof NodeList||r instanceof HTMLCollection?[].slice.call(r):[r])}function xs(r,s){return r.some(function(u){return u===s})}function ys(r){var s={};for(var u in r)s[u]=r[u];return s}function as(r,s){var u=ys(r);for(var p in r)u[p]=s.hasOwnProperty(p)?s[p]:r[p];return u}function li(r,s){var u=ys(r);for(var p in s)u[p]=ie.und(r[p])?s[p]:r[p];return u}function Fh(r){var s=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(r);return s?"rgba("+s[1]+",1)":r}function Ih(r){var s=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,u=r.replace(s,function(y,g,j,S){return g+g+j+j+S+S}),p=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(u),d=parseInt(p[1],16),f=parseInt(p[2],16),x=parseInt(p[3],16);return"rgba("+d+","+f+","+x+",1)"}function $h(r){var s=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(r)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(r),u=parseInt(s[1],10)/360,p=parseInt(s[2],10)/100,d=parseInt(s[3],10)/100,f=s[4]||1;function x(T,_,z){return z<0&&(z+=1),z>1&&(z-=1),z<1/6?T+(_-T)*6*z:z<1/2?_:z<2/3?T+(_-T)*(2/3-z)*6:T}var y,g,j;if(p==0)y=g=j=d;else{var S=d<.5?d*(1+p):d+p-d*p,b=2*d-S;y=x(b,S,u+1/3),g=x(b,S,u),j=x(b,S,u-1/3)}return"rgba("+y*255+","+g*255+","+j*255+","+f+")"}function Nh(r){if(ie.rgb(r))return Fh(r);if(ie.hex(r))return Ih(r);if(ie.hsl(r))return $h(r)}function Wt(r){var s=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(s)return s[1]}function Oh(r){if(Dr(r,"translate")||r==="perspective")return"px";if(Dr(r,"rotate")||Dr(r,"skew"))return"deg"}function us(r,s){return ie.fnc(r)?r(s.target,s.id,s.total):r}function Rt(r,s){return r.getAttribute(s)}function ms(r,s,u){var p=Wt(s);if(xs([u,"deg","rad","turn"],p))return s;var d=ti.CSS[s+u];if(!ie.und(d))return d;var f=100,x=document.createElement(r.tagName),y=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;y.appendChild(x),x.style.position="absolute",x.style.width=f+u;var g=f/x.offsetWidth;y.removeChild(x);var j=g*parseFloat(s);return ti.CSS[s+u]=j,j}function cd(r,s,u){if(s in r.style){var p=s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),d=r.style[s]||getComputedStyle(r).getPropertyValue(p)||"0";return u?ms(r,d,u):d}}function vs(r,s){if(ie.dom(r)&&!ie.inp(r)&&(!ie.nil(Rt(r,s))||ie.svg(r)&&r[s]))return"attribute";if(ie.dom(r)&&xs(Eh,s))return"transform";if(ie.dom(r)&&s!=="transform"&&cd(r,s))return"css";if(r[s]!=null)return"object"}function dd(r){if(ie.dom(r)){for(var s=r.style.transform||"",u=/(\w+)\(([^)]*)\)/g,p=new Map,d;d=u.exec(s);)p.set(d[1],d[2]);return p}}function Bh(r,s,u,p){var d=Dr(s,"scale")?1:0+Oh(s),f=dd(r).get(s)||d;return u&&(u.transforms.list.set(s,f),u.transforms.last=s),p?ms(r,f,p):f}function Ss(r,s,u,p){switch(vs(r,s)){case"transform":return Bh(r,s,p,u);case"css":return cd(r,s,u);case"attribute":return Rt(r,s);default:return r[s]||0}}function bs(r,s){var u=/^(\*=|\+=|-=)/.exec(r);if(!u)return r;var p=Wt(r)||0,d=parseFloat(s),f=parseFloat(r.replace(u[0],""));switch(u[0][0]){case"+":return d+f+p;case"-":return d-f+p;case"*":return d*f+p}}function pd(r,s){if(ie.col(r))return Nh(r);if(/\s/g.test(r))return r;var u=Wt(r),p=u?r.substr(0,r.length-u.length):r;return s?p+s:p}function ks(r,s){return Math.sqrt(Math.pow(s.x-r.x,2)+Math.pow(s.y-r.y,2))}function Dh(r){return Math.PI*2*Rt(r,"r")}function Wh(r){return Rt(r,"width")*2+Rt(r,"height")*2}function Ah(r){return ks({x:Rt(r,"x1"),y:Rt(r,"y1")},{x:Rt(r,"x2"),y:Rt(r,"y2")})}function fd(r){for(var s=r.points,u=0,p,d=0;d<s.numberOfItems;d++){var f=s.getItem(d);d>0&&(u+=ks(p,f)),p=f}return u}function Hh(r){var s=r.points;return fd(r)+ks(s.getItem(s.numberOfItems-1),s.getItem(0))}function gd(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return Dh(r);case"rect":return Wh(r);case"line":return Ah(r);case"polyline":return fd(r);case"polygon":return Hh(r)}}function Uh(r){var s=gd(r);return r.setAttribute("stroke-dasharray",s),s}function Vh(r){for(var s=r.parentNode;ie.svg(s)&&ie.svg(s.parentNode);)s=s.parentNode;return s}function hd(r,s){var u=s||{},p=u.el||Vh(r),d=p.getBoundingClientRect(),f=Rt(p,"viewBox"),x=d.width,y=d.height,g=u.viewBox||(f?f.split(" "):[0,0,x,y]);return{el:p,viewBox:g,x:g[0]/1,y:g[1]/1,w:x,h:y,vW:g[2],vH:g[3]}}function Qh(r,s){var u=ie.str(r)?ud(r)[0]:r,p=s||100;return function(d){return{property:d,el:u,svg:hd(u),totalLength:gd(u)*(p/100)}}}function Yh(r,s,u){function p(S){S===void 0&&(S=0);var b=s+S>=1?s+S:0;return r.el.getPointAtLength(b)}var d=hd(r.el,r.svg),f=p(),x=p(-1),y=p(1),g=u?1:d.w/d.vW,j=u?1:d.h/d.vH;switch(r.property){case"x":return(f.x-d.x)*g;case"y":return(f.y-d.y)*j;case"angle":return Math.atan2(y.y-x.y,y.x-x.x)*180/Math.PI}}function Fc(r,s){var u=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,p=pd(ie.pth(r)?r.totalLength:r,s)+"";return{original:p,numbers:p.match(u)?p.match(u).map(Number):[0],strings:ie.str(r)||s?p.split(u):[]}}function ws(r){var s=r?ii(ie.arr(r)?r.map(Mc):Mc(r)):[];return oi(s,function(u,p,d){return d.indexOf(u)===p})}function xd(r){var s=ws(r);return s.map(function(u,p){return{target:u,id:p,total:s.length,transforms:{list:dd(u)}}})}function Jh(r,s){var u=ys(s);if(/^spring/.test(u.easing)&&(u.duration=sd(u.easing)),ie.arr(r)){var p=r.length,d=p===2&&!ie.obj(r[0]);d?r={value:r}:ie.fnc(s.duration)||(u.duration=s.duration/p)}var f=ie.arr(r)?r:[r];return f.map(function(x,y){var g=ie.obj(x)&&!ie.pth(x)?x:{value:x};return ie.und(g.delay)&&(g.delay=y?0:s.delay),ie.und(g.endDelay)&&(g.endDelay=y===f.length-1?s.endDelay:0),g}).map(function(x){return li(x,u)})}function Kh(r){for(var s=oi(ii(r.map(function(f){return Object.keys(f)})),function(f){return ie.key(f)}).reduce(function(f,x){return f.indexOf(x)<0&&f.push(x),f},[]),u={},p=function(f){var x=s[f];u[x]=r.map(function(y){var g={};for(var j in y)ie.key(j)?j==x&&(g.value=y[j]):g[j]=y[j];return g})},d=0;d<s.length;d++)p(d);return u}function Gh(r,s){var u=[],p=s.keyframes;p&&(s=li(Kh(p),s));for(var d in s)ie.key(d)&&u.push({name:d,tweens:Jh(s[d],r)});return u}function Xh(r,s){var u={};for(var p in r){var d=us(r[p],s);ie.arr(d)&&(d=d.map(function(f){return us(f,s)}),d.length===1&&(d=d[0])),u[p]=d}return u.duration=parseFloat(u.duration),u.delay=parseFloat(u.delay),u}function Zh(r,s){var u;return r.tweens.map(function(p){var d=Xh(p,s),f=d.value,x=ie.arr(f)?f[1]:f,y=Wt(x),g=Ss(s.target,r.name,y,s),j=u?u.to.original:g,S=ie.arr(f)?f[0]:j,b=Wt(S)||Wt(g),T=y||b;return ie.und(x)&&(x=j),d.from=Fc(S,T),d.to=Fc(bs(x,S),T),d.start=u?u.end:0,d.end=d.start+d.delay+d.duration+d.endDelay,d.easing=hs(d.easing,d.duration),d.isPath=ie.pth(f),d.isPathTargetInsideSVG=d.isPath&&ie.svg(s.target),d.isColor=ie.col(d.from.original),d.isColor&&(d.round=1),u=d,d})}var yd={css:function(r,s,u){return r.style[s]=u},attribute:function(r,s,u){return r.setAttribute(s,u)},object:function(r,s,u){return r[s]=u},transform:function(r,s,u,p,d){if(p.list.set(s,u),s===p.last||d){var f="";p.list.forEach(function(x,y){f+=y+"("+x+") "}),r.style.transform=f}}};function md(r,s){var u=xd(r);u.forEach(function(p){for(var d in s){var f=us(s[d],p),x=p.target,y=Wt(f),g=Ss(x,d,y,p),j=y||Wt(g),S=bs(pd(f,j),g),b=vs(x,d);yd[b](x,d,S,p.transforms,!0)}})}function qh(r,s){var u=vs(r.target,s.name);if(u){var p=Zh(s,r),d=p[p.length-1];return{type:u,property:s.name,animatable:r,tweens:p,duration:d.end,delay:p[0].delay,endDelay:d.endDelay}}}function ex(r,s){return oi(ii(r.map(function(u){return s.map(function(p){return qh(u,p)})})),function(u){return!ie.und(u)})}function vd(r,s){var u=r.length,p=function(f){return f.timelineOffset?f.timelineOffset:0},d={};return d.duration=u?Math.max.apply(Math,r.map(function(f){return p(f)+f.duration})):s.duration,d.delay=u?Math.min.apply(Math,r.map(function(f){return p(f)+f.delay})):s.delay,d.endDelay=u?d.duration-Math.max.apply(Math,r.map(function(f){return p(f)+f.duration-f.endDelay})):s.endDelay,d}var Ic=0;function tx(r){var s=as(id,r),u=as(gs,r),p=Gh(u,r),d=xd(r.targets),f=ex(d,p),x=vd(f,u),y=Ic;return Ic++,li(s,{id:y,children:[],animatables:d,animations:f,duration:x.duration,delay:x.delay,endDelay:x.endDelay})}var Ct=[],Sd=(function(){var r;function s(){!r&&(!$c()||!ge.suspendWhenDocumentHidden)&&Ct.length>0&&(r=requestAnimationFrame(u))}function u(d){for(var f=Ct.length,x=0;x<f;){var y=Ct[x];y.paused?(Ct.splice(x,1),f--):(y.tick(d),x++)}r=x>0?requestAnimationFrame(u):void 0}function p(){ge.suspendWhenDocumentHidden&&($c()?r=cancelAnimationFrame(r):(Ct.forEach(function(d){return d._onDocumentVisibility()}),Sd()))}return typeof document<"u"&&document.addEventListener("visibilitychange",p),s})();function $c(){return!!document&&document.hidden}function ge(r){r===void 0&&(r={});var s=0,u=0,p=0,d,f=0,x=null;function y(O){var U=window.Promise&&new Promise(function(W){return x=W});return O.finished=U,U}var g=tx(r);y(g);function j(){var O=g.direction;O!=="alternate"&&(g.direction=O!=="normal"?"normal":"reverse"),g.reversed=!g.reversed,d.forEach(function(U){return U.reversed=g.reversed})}function S(O){return g.reversed?g.duration-O:O}function b(){s=0,u=S(g.currentTime)*(1/ge.speed)}function T(O,U){U&&U.seek(O-U.timelineOffset)}function _(O){if(g.reversePlayback)for(var W=f;W--;)T(O,d[W]);else for(var U=0;U<f;U++)T(O,d[U])}function z(O){for(var U=0,W=g.animations,$=W.length;U<$;){var H=W[U],K=H.animatable,V=H.tweens,G=V.length-1,Y=V[G];G&&(Y=oi(V,function(ye){return O<ye.end})[0]||Y);for(var ce=Et(O-Y.start-Y.delay,0,Y.duration)/Y.duration,Se=isNaN(ce)?1:Y.easing(ce),ve=Y.to.strings,Ee=Y.round,Ne=[],Re=Y.to.numbers.length,xe=void 0,J=0;J<Re;J++){var ee=void 0,X=Y.to.numbers[J],w=Y.from.numbers[J]||0;Y.isPath?ee=Yh(Y.value,Se*X,Y.isPathTargetInsideSVG):ee=w+Se*(X-w),Ee&&(Y.isColor&&J>2||(ee=Math.round(ee*Ee)/Ee)),Ne.push(ee)}var N=ve.length;if(!N)xe=Ne[0];else{xe=ve[0];for(var le=0;le<N;le++){ve[le];var de=ve[le+1],pe=Ne[le];isNaN(pe)||(de?xe+=pe+de:xe+=pe+" ")}}yd[H.type](K.target,H.property,xe,K.transforms),H.currentValue=xe,U++}}function R(O){g[O]&&!g.passThrough&&g[O](g)}function P(){g.remaining&&g.remaining!==!0&&g.remaining--}function I(O){var U=g.duration,W=g.delay,$=U-g.endDelay,H=S(O);g.progress=Et(H/U*100,0,100),g.reversePlayback=H<g.currentTime,d&&_(H),!g.began&&g.currentTime>0&&(g.began=!0,R("begin")),!g.loopBegan&&g.currentTime>0&&(g.loopBegan=!0,R("loopBegin")),H<=W&&g.currentTime!==0&&z(0),(H>=$&&g.currentTime!==U||!U)&&z(U),H>W&&H<$?(g.changeBegan||(g.changeBegan=!0,g.changeCompleted=!1,R("changeBegin")),R("change"),z(H)):g.changeBegan&&(g.changeCompleted=!0,g.changeBegan=!1,R("changeComplete")),g.currentTime=Et(H,0,U),g.began&&R("update"),O>=U&&(u=0,P(),g.remaining?(s=p,R("loopComplete"),g.loopBegan=!1,g.direction==="alternate"&&j()):(g.paused=!0,g.completed||(g.completed=!0,R("loopComplete"),R("complete"),!g.passThrough&&"Promise"in window&&(x(),y(g)))))}return g.reset=function(){var O=g.direction;g.passThrough=!1,g.currentTime=0,g.progress=0,g.paused=!0,g.began=!1,g.loopBegan=!1,g.changeBegan=!1,g.completed=!1,g.changeCompleted=!1,g.reversePlayback=!1,g.reversed=O==="reverse",g.remaining=g.loop,d=g.children,f=d.length;for(var U=f;U--;)g.children[U].reset();(g.reversed&&g.loop!==!0||O==="alternate"&&g.loop===1)&&g.remaining++,z(g.reversed?g.duration:0)},g._onDocumentVisibility=b,g.set=function(O,U){return md(O,U),g},g.tick=function(O){p=O,s||(s=p),I((p+(u-s))*ge.speed)},g.seek=function(O){I(S(O))},g.pause=function(){g.paused=!0,b()},g.play=function(){g.paused&&(g.completed&&g.reset(),g.paused=!1,Ct.push(g),b(),Sd())},g.reverse=function(){j(),g.completed=!g.reversed,b()},g.restart=function(){g.reset(),g.play()},g.remove=function(O){var U=ws(O);bd(U,g)},g.reset(),g.autoplay&&g.play(),g}function Nc(r,s){for(var u=s.length;u--;)xs(r,s[u].animatable.target)&&s.splice(u,1)}function bd(r,s){var u=s.animations,p=s.children;Nc(r,u);for(var d=p.length;d--;){var f=p[d],x=f.animations;Nc(r,x),!x.length&&!f.children.length&&p.splice(d,1)}!u.length&&!p.length&&s.pause()}function nx(r){for(var s=ws(r),u=Ct.length;u--;){var p=Ct[u];bd(s,p)}}function rx(r,s){s===void 0&&(s={});var u=s.direction||"normal",p=s.easing?hs(s.easing):null,d=s.grid,f=s.axis,x=s.from||0,y=x==="first",g=x==="center",j=x==="last",S=ie.arr(r),b=parseFloat(S?r[0]:r),T=S?parseFloat(r[1]):0,_=Wt(S?r[1]:r)||0,z=s.start||0+(S?b:0),R=[],P=0;return function(I,O,U){if(y&&(x=0),g&&(x=(U-1)/2),j&&(x=U-1),!R.length){for(var W=0;W<U;W++){if(!d)R.push(Math.abs(x-W));else{var $=g?(d[0]-1)/2:x%d[0],H=g?(d[1]-1)/2:Math.floor(x/d[0]),K=W%d[0],V=Math.floor(W/d[0]),G=$-K,Y=H-V,ce=Math.sqrt(G*G+Y*Y);f==="x"&&(ce=-G),f==="y"&&(ce=-Y),R.push(ce)}P=Math.max.apply(Math,R)}p&&(R=R.map(function(ve){return p(ve/P)*P})),u==="reverse"&&(R=R.map(function(ve){return f?ve<0?ve*-1:-ve:Math.abs(P-ve)}))}var Se=S?(T-b)/P:b;return z+Se*(Math.round(R[O]*100)/100)+_}}function ox(r){r===void 0&&(r={});var s=ge(r);return s.duration=0,s.add=function(u,p){var d=Ct.indexOf(s),f=s.children;d>-1&&Ct.splice(d,1);function x(T){T.passThrough=!0}for(var y=0;y<f.length;y++)x(f[y]);var g=li(u,as(gs,r));g.targets=g.targets||r.targets;var j=s.duration;g.autoplay=!1,g.direction=s.direction,g.timelineOffset=ie.und(p)?j:bs(p,j),x(s),s.seek(g.timelineOffset);var S=ge(g);x(S),f.push(S);var b=vd(f,r);return s.delay=b.delay,s.endDelay=b.endDelay,s.duration=b.duration,s.seek(0),s.reset(),s.autoplay&&s.play(),s},s}ge.version="3.2.1";ge.speed=1;ge.suspendWhenDocumentHidden=!0;ge.running=Ct;ge.remove=nx;ge.get=Ss;ge.set=md;ge.convertPx=ms;ge.path=Qh;ge.setDashoffset=Uh;ge.stagger=rx;ge.timeline=ox;ge.easing=hs;ge.penner=ad;ge.random=function(r,s){return Math.floor(Math.random()*(s-r+1))+r};function ix({tabs:r,activeTab:s,onTabChange:u,tabRefs:p,indicatorRef:d}){return L.useEffect(()=>{const f=p.current[s];if(f&&d.current){const{offsetLeft:x,offsetWidth:y}=f;ge({targets:d.current,left:x,width:y,duration:400,easing:"easeOutExpo"})}},[s,p,d]),l.jsxs("div",{style:{position:"relative",display:"flex",flex:1},children:[r.map(f=>l.jsxs("button",{type:"button",ref:x=>{x&&(p.current[f.id]=x)},"data-tour":f.id==="traffic"?"traffic-tab":f.id==="logs"?"logs-tab":f.id==="setup"?"setup-tab":f.id==="playground"?"playground-tab":"smart-scan-tab",onClick:()=>u(f.id),style:{padding:"14px 24px",background:s===f.id?o.bgSecondary:"transparent",border:"none",borderBottom:"3px solid transparent",color:s===f.id?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:s===f.id?"600":"400",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",position:"relative",borderRadius:"8px 8px 0 0",zIndex:1},onMouseEnter:x=>{s!==f.id&&ge({targets:x.currentTarget,background:o.bgHover,color:o.textPrimary,duration:200,easing:"easeOutQuad"})},onMouseLeave:x=>{s!==f.id&&ge({targets:x.currentTarget,background:"transparent",color:o.textSecondary,duration:200,easing:"easeOutQuad"})},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("div",{style:{display:"flex",alignItems:"center",color:"currentColor"},children:l.jsx(f.icon,{size:16})}),l.jsx("span",{children:f.label})]}),l.jsx("div",{style:{fontSize:"11px",color:s===f.id?o.textSecondary:o.textTertiary,fontWeight:"400",fontFamily:v.body},children:f.description})]},f.id)),l.jsx("div",{ref:d,style:{position:"absolute",bottom:0,height:"3px",background:o.accentBlue,borderRadius:"3px 3px 0 0",zIndex:2,pointerEvents:"none"}})]})}const lx=({size:r=16,color:s="currentColor"})=>l.jsx(Gc,{size:r,stroke:1.5,color:s}),sx=({size:r=16,color:s="currentColor"})=>l.jsx(rg,{size:r,stroke:1.5,color:s}),ax=({size:r=16,color:s="currentColor"})=>l.jsx(vg,{size:r,stroke:1.5,color:s}),ux=({size:r=16,color:s="currentColor"})=>l.jsx(Uf,{size:r,stroke:1.5,color:s}),cx=({size:r=16,color:s="currentColor"})=>l.jsx(Zc,{size:r,stroke:1.5,color:s}),dx=({size:r=16,color:s="currentColor"})=>l.jsx(ug,{size:r,stroke:1.5,color:s}),px=({size:r=16,color:s="currentColor"})=>l.jsx(ds,{size:r,stroke:1.5,color:s});function fx({tabs:r,activeTab:s,onTabChange:u,isDropdownOpen:p,setIsDropdownOpen:d,dropdownRef:f}){return l.jsxs("div",{style:{position:"relative",flex:1,display:"flex",justifyContent:"flex-end"},ref:f,children:[l.jsxs("button",{type:"button",onClick:()=>d(!p),style:{display:"flex",alignItems:"center",gap:"8px",padding:"10px 16px",background:p?o.bgSecondary:"transparent",border:"none",borderRadius:"8px",color:o.textPrimary,cursor:"pointer",fontSize:"14px",fontFamily:v.body,fontWeight:"500"},onMouseEnter:x=>{p||(x.currentTarget.style.background=o.bgHover)},onMouseLeave:x=>{p||(x.currentTarget.style.background="transparent")},children:[l.jsx(dx,{size:18,color:o.textPrimary}),l.jsx("span",{children:r.find(x=>x.id===s)?.label||"Menu"}),l.jsx("div",{style:{transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",display:"flex",alignItems:"center"},children:l.jsx(px,{size:14,color:o.textPrimary})})]}),p&&l.jsx("div",{style:{position:"absolute",top:"100%",right:0,marginTop:"8px",background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",boxShadow:`0 4px 12px ${o.shadowSm}`,minWidth:"280px",zIndex:1e3,overflow:"hidden"},children:r.map(x=>{const y=x.icon;return l.jsxs("button",{type:"button",onClick:()=>{u(x.id),d(!1)},style:{width:"100%",padding:"14px 16px",background:s===x.id?o.bgSecondary:"transparent",border:"none",borderLeft:s===x.id?`3px solid ${o.accentBlue}`:"3px solid transparent",color:s===x.id?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:s===x.id?"600":"400",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",textAlign:"left",transition:"all 0.2s"},onMouseEnter:g=>{s!==x.id&&(g.currentTarget.style.background=o.bgHover,g.currentTarget.style.color=o.textPrimary)},onMouseLeave:g=>{s!==x.id&&(g.currentTarget.style.background="transparent",g.currentTarget.style.color=o.textSecondary)},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",width:"100%"},children:[l.jsx("div",{style:{display:"flex",alignItems:"center",color:"currentColor"},children:l.jsx(y,{size:16})}),l.jsx("span",{style:{flex:1},children:x.label})]}),l.jsx("div",{style:{fontSize:"11px",color:s===x.id?o.textSecondary:o.textTertiary,fontWeight:"400",fontFamily:v.body,marginLeft:"26px"},children:x.description})]},x.id)})})]})}function gx({activeTab:r,onTabChange:s}){const u=[{id:"traffic",label:"Traffic Capture",icon:lx,description:"Wireshark-like HTTP request/response analysis for forensic investigation"},{id:"logs",label:"MCP Shark Logs",icon:sx,description:"View MCP Shark server console output and debug logs"},{id:"setup",label:"MCP Server Setup",icon:ax,description:"Configure and manage MCP Shark server"},{id:"playground",label:"MCP Playground",icon:ux,description:"Test and interact with MCP tools, prompts, and resources"},{id:"smart-scan",label:"Smart Scan",icon:cx,description:"AI-powered security analysis for MCP servers"}],p=L.useRef({}),d=L.useRef(null),[f,x]=L.useState(!1),[y,g]=L.useState(!1),j=L.useRef(null);return L.useEffect(()=>{const S=()=>{x(window.innerWidth<1200)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]),L.useEffect(()=>{const S=b=>{j.current&&!j.current.contains(b.target)&&g(!1)};return y&&document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)}},[y]),l.jsx("div",{style:{borderBottom:`1px solid ${o.borderLight}`,background:o.bgCard,boxShadow:`0 1px 3px ${o.shadowSm}`},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 16px",gap:"12px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",paddingRight:"12px",borderRight:`1px solid ${o.borderLight}`},children:[l.jsx(zh,{size:24}),l.jsx("span",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:"MCP Shark"})]}),f?l.jsx(fx,{tabs:u,activeTab:r,onTabChange:s,isDropdownOpen:y,setIsDropdownOpen:g,dropdownRef:j}):l.jsx(ix,{tabs:u,activeTab:r,onTabChange:s,tabRefs:p,indicatorRef:d})]})})}const hx=({size:r=16,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"Tour icon",children:[l.jsx("title",{children:"Tour icon"}),l.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),l.jsx("path",{d:"M2 17l10 5 10-5"}),l.jsx("path",{d:"M2 12l10 5 10-5"})]});function xx({onClick:r}){return l.jsx("button",{type:"button",onClick:r,"data-tour":"help-button",style:{position:"fixed",bottom:"20px",right:"20px",background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"50%",width:"48px",height:"48px",padding:0,color:o.textSecondary,cursor:"pointer",fontFamily:v.body,boxShadow:`0 4px 12px ${o.shadowMd}`,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,transition:"all 0.2s ease"},onMouseEnter:s=>{s.currentTarget.style.background=o.bgHover,s.currentTarget.style.color=o.textPrimary,s.currentTarget.style.borderColor=o.borderMedium,s.currentTarget.style.transform="scale(1.1)",s.currentTarget.style.boxShadow=`0 6px 16px ${o.shadowLg}`},onMouseLeave:s=>{s.currentTarget.style.background=o.bgCard,s.currentTarget.style.color=o.textSecondary,s.currentTarget.style.borderColor=o.borderLight,s.currentTarget.style.transform="scale(1)",s.currentTarget.style.boxShadow=`0 4px 12px ${o.shadowMd}`},title:"Start tour",children:l.jsx(hx,{size:20})})}const yx=({size:r=12,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle",marginRight:"4px"},role:"img","aria-label":"Chevron icon",children:[l.jsx("title",{children:"Chevron icon"}),l.jsx("polyline",{points:"6 9 12 15 18 9"})]});function un({title:r,children:s,titleColor:u=o.accentBlue,defaultExpanded:p=!0}){const[d,f]=L.useState(p);return l.jsxs("div",{style:{marginBottom:"16px"},children:[l.jsxs("button",{type:"button",style:{color:u,fontWeight:"600",fontFamily:v.body,fontSize:"12px",marginBottom:"8px",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",gap:"6px",padding:"4px 0",transition:"color 0.15s ease",background:"transparent",border:"none",textAlign:"left",width:"100%"},onClick:()=>f(!d),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),f(!d))},onMouseEnter:x=>{x.currentTarget.style.color=u===o.accentBlue?o.accentBlueHover:u},onMouseLeave:x=>{x.currentTarget.style.color=u},children:[l.jsx("span",{style:{transform:d?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease",display:"inline-block"},children:l.jsx(yx,{size:12,color:u})}),r]}),d&&l.jsx("div",{style:{paddingLeft:"20px",color:o.textPrimary,fontFamily:v.body,fontSize:"12px",lineHeight:"1.6"},children:s})]})}function kd({body:r,title:s,titleColor:u}){return r?l.jsx(un,{title:s||"Body",titleColor:u,children:l.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:v.mono,maxHeight:"400px",border:`1px solid ${o.borderLight}`,color:o.textPrimary,lineHeight:"1.5"},children:typeof r=="object"?JSON.stringify(r,null,2):r})}):null}function wd({title:r,titleColor:s,children:u,defaultExpanded:p=!0}){const[d,f]=L.useState(p);return l.jsxs("div",{style:{background:o.bgCard,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden",marginBottom:"20px"},children:[l.jsx("button",{type:"button",onClick:()=>f(!d),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),f(!d))},"aria-label":`Toggle ${r} section`,style:{padding:"16px 20px",background:d?o.bgCard:o.bgSecondary,borderBottom:d?`1px solid ${o.borderLight}`:"none",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.15s ease",width:"100%",border:"none",textAlign:"left"},onMouseEnter:x=>{x.currentTarget.style.background=o.bgHover},onMouseLeave:x=>{x.currentTarget.style.background=d?o.bgCard:o.bgSecondary},children:l.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:s,textTransform:"uppercase",letterSpacing:"0.05em",fontFamily:v.body,display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(ds,{size:14,stroke:1.5,style:{transform:d?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease"}}),r]})}),d&&l.jsx("div",{style:{padding:"20px"},children:u})]})}function jd({headers:r,titleColor:s}){return!r||Object.keys(r).length===0?null:l.jsx(un,{title:"Headers",children:Object.entries(r).map(([u,p])=>l.jsxs("div",{style:{marginBottom:"6px",fontSize:"12px",fontFamily:v.body},children:[l.jsxs("span",{style:{color:s,fontWeight:"500",fontFamily:v.mono},children:[u,":"]})," ",l.jsx("span",{style:{color:o.textPrimary},children:String(p)})]},u))})}function Cd(r){const s=[],u=new Set,p=(d,f)=>{if(!(d.session_id===f.session_id))return!1;const y=ni(d),g=ni(f);return!y||!g?d.jsonrpc_id&&f.jsonrpc_id?d.jsonrpc_id===f.jsonrpc_id:!1:y===g?d.jsonrpc_id&&f.jsonrpc_id?d.jsonrpc_id===f.jsonrpc_id:!0:!1};return r.forEach(d=>{if(!u.has(d.frame_number))if(d.direction==="request"){const f=r.find(x=>x.direction==="response"&&!u.has(x.frame_number)&&p(d,x)&&x.frame_number>d.frame_number);f?(s.push({request:d,response:f,frame_number:d.frame_number}),u.add(d.frame_number),u.add(f.frame_number)):(s.push({request:d,response:null,frame_number:d.frame_number}),u.add(d.frame_number))}else d.direction==="response"&&(r.find(x=>x.direction==="request"&&!u.has(x.frame_number)&&p(x,d)&&x.frame_number<d.frame_number)||(s.push({request:null,response:d,frame_number:d.frame_number}),u.add(d.frame_number)))}),s.sort((d,f)=>f.frame_number-d.frame_number)}const Oc="LLM Server";function js(r,s){return s?((new Date(r)-new Date(s))/1e3).toFixed(6):"0.000000"}function Cs(r){if(!r)return"-";try{return new Date(r).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return r}}function Ts(r){return r.direction==="request"?{source:Oc,dest:r.remote_address||"Unknown MCP Client"}:{source:r.remote_address||"Unknown MCP Server",dest:Oc}}function si(r){if(r.direction==="request"){if(r.body_json)try{const s=typeof r.body_json=="string"?JSON.parse(r.body_json):r.body_json;if(s&&typeof s=="object"&&s.method)return s.method}catch{}if(r.body_raw)try{const s=typeof r.body_raw=="string"?JSON.parse(r.body_raw):r.body_raw;if(s&&typeof s=="object"&&s.method)return s.method}catch{}if(r.jsonrpc_method)return r.jsonrpc_method;if(r.url)try{const s=new URL(r.url);return s.pathname+(s.search||"")}catch{const u=r.url,p=u.match(/^https?:\/\/[^\/]+(\/.*)$/);return p?p[1]:u}}return"-"}function mx(r){if(r.direction==="request"){const p=si(r),d=r.method||"",f=r.url||"";return p&&p!=="-"?d&&f?`${d} ${p}`:d?`${d} ${p}`:p:d&&f?`${d} ${f}`:d||f||"Request"}const s=r.status_code||"",u=r.jsonrpc_method||ni(r);return s&&u?`${s} ${u}`:s?`Status: ${s}`:u||"Response"}function ni(r){if(r.jsonrpc_method)return r.jsonrpc_method;if(r.direction==="request"){if(r.body_json)try{const s=typeof r.body_json=="string"?JSON.parse(r.body_json):r.body_json;if(s&&typeof s=="object"&&s.method)return s.method}catch{}if(r.body_raw)try{const s=typeof r.body_raw=="string"?JSON.parse(r.body_raw):r.body_raw;if(s&&typeof s=="object"&&s.method)return s.method}catch{}}if(r.direction==="response"&&r.body_json)try{const s=typeof r.body_json=="string"?JSON.parse(r.body_json):r.body_json}catch{}return null}function Td({data:r,titleColor:s}){if(!r)return null;const u=mx(r);return l.jsx(un,{title:"Info",titleColor:s,defaultExpanded:!1,children:l.jsx("div",{style:{background:o.bgSecondary,padding:"12px 16px",borderRadius:"6px",border:`1px solid ${o.borderLight}`,fontFamily:v.mono,fontSize:"12px",color:s,wordBreak:"break-word"},children:u})})}function Pd({data:r,showUserAgent:s=!1}){return l.jsxs(un,{title:"Network Information",children:[l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Remote Address:"," ",l.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.remote_address||"N/A"})]}),l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Host:"," ",l.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.host||"N/A"})]}),s&&r.user_agent&&l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["User Agent:"," ",l.jsx("span",{style:{color:o.textSecondary,fontSize:"11px"},children:r.user_agent})]}),r.session_id&&l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Session ID:"," ",l.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.session_id})]})]})}function _d({data:r,titleColor:s}){return l.jsxs(un,{title:`${r.protocol||"HTTP"} Protocol`,children:[l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Direction: ",l.jsx("span",{style:{color:s,fontWeight:"500"},children:r.direction})]}),r.status_code&&l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Status Code:"," ",l.jsx("span",{style:{color:r.status_code>=400?o.error:r.status_code>=300?o.warning:o.success,fontFamily:v.mono,fontWeight:"600"},children:r.status_code})]}),r.jsonrpc_method&&l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["JSON-RPC Method:"," ",l.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.jsonrpc_method})]}),r.jsonrpc_id&&l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["JSON-RPC ID:"," ",l.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.jsonrpc_id})]})]})}function vx({request:r,requestHeaders:s,requestBody:u}){return r?l.jsxs(wd,{title:"Request",titleColor:o.accentBlue,defaultExpanded:!0,children:[l.jsx(Td,{data:r,titleColor:o.accentBlue}),l.jsx(Pd,{data:r,showUserAgent:!0}),l.jsx(_d,{data:r,titleColor:o.accentBlue}),l.jsx(jd,{headers:s,titleColor:o.accentBlue}),l.jsx(kd,{body:u,titleColor:o.accentBlue}),r.jsonrpc_params&&l.jsx(un,{title:"JSON-RPC Params",titleColor:o.accentBlue,children:l.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:"monospace",maxHeight:"400px",border:`1px solid ${o.borderLight}`,color:o.textPrimary,lineHeight:"1.5"},children:JSON.stringify(JSON.parse(r.jsonrpc_params),null,2)})})]}):null}function Sx({response:r,responseHeaders:s,responseBody:u}){return r?l.jsxs(wd,{title:"Response",titleColor:o.accentGreen,defaultExpanded:!0,children:[l.jsx(Td,{data:r,titleColor:o.accentGreen}),l.jsx(Pd,{data:r}),l.jsx(_d,{data:r,titleColor:o.accentGreen}),l.jsx(jd,{headers:s,titleColor:o.accentGreen}),l.jsx(kd,{body:u,titleColor:o.accentGreen}),r.jsonrpc_result&&l.jsx(un,{title:"JSON-RPC Result",titleColor:o.accentGreen,children:l.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:v.mono,maxHeight:"400px",border:`1px solid ${o.borderLight}`,color:o.textPrimary,lineHeight:"1.5"},children:JSON.stringify(JSON.parse(r.jsonrpc_result),null,2)})}),r.jsonrpc_error&&l.jsx(un,{title:"JSON-RPC Error",titleColor:o.error,children:l.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:v.mono,maxHeight:"400px",border:`1px solid ${o.borderLight}`,color:o.error,lineHeight:"1.5"},children:JSON.stringify(JSON.parse(r.jsonrpc_error),null,2)})})]}):null}function bx({request:r,response:s,requestHeaders:u,requestBody:p,responseHeaders:d,responseBody:f}){return l.jsx("div",{style:{padding:"20px",overflow:"auto",flex:1,background:o.bgPrimary},children:l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[l.jsx(vx,{request:r,requestHeaders:u,requestBody:p}),l.jsx(Sx,{response:s,responseHeaders:d,responseBody:f})]})})}const kx=({size:r=14,color:s="currentColor",rotated:u=!1})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle",transform:u?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s ease"},role:"img","aria-label":"Chevron down icon",children:[l.jsx("title",{children:"Chevron down icon"}),l.jsx("polyline",{points:"6 9 12 15 18 9"})]});function Bc({title:r,titleColor:s,children:u,defaultExpanded:p=!0}){const[d,f]=L.useState(p);return l.jsxs("div",{style:{background:o.bgCard,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden",marginBottom:"20px"},children:[l.jsx("button",{type:"button",onClick:()=>f(!d),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),f(!d))},style:{padding:"16px 20px",background:d?o.bgCard:o.bgSecondary,borderBottom:d?`1px solid ${o.borderLight}`:"none",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.15s ease",width:"100%",border:"none",textAlign:"left"},onMouseEnter:x=>{x.currentTarget.style.background=o.bgHover},onMouseLeave:x=>{x.currentTarget.style.background=d?o.bgCard:o.bgSecondary},children:l.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:s,textTransform:"uppercase",letterSpacing:"0.05em",fontFamily:v.body,display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(kx,{size:14,color:s,rotated:!d}),r]})}),d&&l.jsx("div",{style:{padding:"20px"},children:u})]})}function wx({requestHexLines:r,responseHexLines:s,hasRequest:u,hasResponse:p}){return l.jsx("div",{style:{padding:"20px",overflow:"auto",flex:1,background:o.bgPrimary},children:l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[u&&l.jsx(Bc,{title:"Request Hex Dump",titleColor:o.accentBlue,defaultExpanded:!0,children:l.jsx("div",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",border:`1px solid ${o.borderLight}`,maxHeight:"calc(100vh - 300px)",overflow:"auto"},children:r.length>0?r.map((d,f)=>l.jsxs("div",{style:{display:"flex",gap:"16px",padding:"4px 0",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",lineHeight:"1.5"},children:[l.jsx("span",{style:{color:o.textTertiary,minWidth:"80px"},children:d.offset}),l.jsx("span",{style:{minWidth:"400px",color:o.textPrimary},children:d.hex.padEnd(48)}),l.jsx("span",{style:{color:o.textSecondary},children:d.ascii})]},`request-${d.offset}-${f}`)):l.jsx("div",{style:{color:o.textTertiary,fontFamily:v.body,fontSize:"12px"},children:"(empty)"})})}),p&&l.jsx(Bc,{title:"Response Hex Dump",titleColor:o.accentGreen,defaultExpanded:!0,children:l.jsx("div",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",border:`1px solid ${o.borderLight}`,maxHeight:"calc(100vh - 300px)",overflow:"auto"},children:s.length>0?s.map((d,f)=>l.jsxs("div",{style:{display:"flex",gap:"16px",padding:"4px 0",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",lineHeight:"1.5"},children:[l.jsx("span",{style:{color:o.textTertiary,minWidth:"80px"},children:d.offset}),l.jsx("span",{style:{minWidth:"400px",color:o.textPrimary},children:d.hex.padEnd(48)}),l.jsx("span",{style:{color:o.textSecondary},children:d.ascii})]},`response-${d.offset}-${f}`)):l.jsx("div",{style:{color:o.textTertiary,fontFamily:v.body,fontSize:"12px"},children:"(empty)"})})})]})})}function jx({request:r,onClose:s,matchingPair:u}){const p=d=>d<1024?`${d} B`:d<1048576?`${(d/1024).toFixed(2)} KB`:`${(d/1048576).toFixed(2)} MB`;return l.jsxs("div",{style:{padding:"12px 16px",borderBottom:`1px solid ${o.borderLight}`,display:"flex",justifyContent:"space-between",alignItems:"center",background:o.bgCard,boxShadow:`0 1px 3px ${o.shadowSm}`},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[l.jsxs("h3",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,margin:0,fontFamily:v.body},children:["#",r.frame_number,":"," ",r.direction==="request"?"HTTP Request":"HTTP Response",u&&l.jsxs("span",{style:{fontSize:"11px",color:o.textTertiary,fontWeight:"400",marginLeft:"8px"},children:["(with #",u.frame_number,")"]})]}),l.jsxs("span",{style:{fontSize:"11px",color:o.textSecondary,padding:"4px 8px",background:o.bgSecondary,borderRadius:"8px",fontFamily:v.mono},children:[p(r.length)," bytes"]})]}),l.jsx("button",{type:"button",onClick:s,style:{background:"none",border:"none",color:o.textSecondary,cursor:"pointer",fontSize:"20px",padding:"4px 8px",borderRadius:"8px",transition:"all 0.2s"},onMouseEnter:d=>{d.currentTarget.style.background=o.bgHover,d.currentTarget.style.color=o.textPrimary},onMouseLeave:d=>{d.currentTarget.style.background="none",d.currentTarget.style.color=o.textSecondary},children:l.jsx(qc,{size:20,stroke:1.5})})]})}const Cx=({size:r=14,color:s="currentColor",rotated:u=!1})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle",transform:u?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s ease"},role:"img","aria-label":"Chevron down icon",children:[l.jsx("title",{children:"Chevron down icon"}),l.jsx("polyline",{points:"6 9 12 15 18 9"})]});function Dc({title:r,titleColor:s,children:u,defaultExpanded:p=!0}){const[d,f]=L.useState(p);return l.jsxs("div",{style:{background:o.bgCard,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden",marginBottom:"20px"},children:[l.jsx("button",{type:"button",onClick:()=>f(!d),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),f(!d))},style:{padding:"16px 20px",background:d?o.bgCard:o.bgSecondary,borderBottom:d?`1px solid ${o.borderLight}`:"none",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.15s ease",width:"100%",border:"none",textAlign:"left"},onMouseEnter:x=>{x.currentTarget.style.background=o.bgHover},onMouseLeave:x=>{x.currentTarget.style.background=d?o.bgCard:o.bgSecondary},children:l.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:s,textTransform:"uppercase",letterSpacing:"0.05em",fontFamily:v.body,display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(Cx,{size:14,color:s,rotated:!d}),r]})}),d&&l.jsx("div",{style:{padding:"20px"},children:u})]})}function Tx({requestFullText:r,responseFullText:s,hasRequest:u,hasResponse:p}){return l.jsx("div",{style:{padding:"20px",overflow:"auto",flex:1,background:o.bgPrimary},children:l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[u&&l.jsx(Dc,{title:"Raw Request Data",titleColor:o.accentBlue,defaultExpanded:!0,children:l.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:v.mono,color:o.textPrimary,border:`1px solid ${o.borderLight}`,whiteSpace:"pre-wrap",wordBreak:"break-all",lineHeight:"1.5",maxHeight:"calc(100vh - 300px)"},children:r||"(empty)"})}),p&&l.jsx(Dc,{title:"Raw Response Data",titleColor:o.accentGreen,defaultExpanded:!0,children:l.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:v.mono,color:o.textPrimary,border:`1px solid ${o.borderLight}`,whiteSpace:"pre-wrap",wordBreak:"break-all",lineHeight:"1.5",maxHeight:"calc(100vh - 300px)"},children:s||"(empty)"})})]})})}function Px({tabs:r,activeTab:s,onTabChange:u}){const p=L.useRef({}),d=L.useRef(null);return L.useEffect(()=>{const f=p.current[s];if(f&&d.current){const{offsetLeft:x,offsetWidth:y}=f;ge({targets:d.current,left:x,width:y,duration:300,easing:"easeOutExpo"})}},[s]),l.jsxs("div",{style:{display:"flex",borderBottom:`1px solid ${o.borderLight}`,background:`${o.bgCard}CC`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",position:"relative",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[r.map(f=>l.jsx("button",{type:"button",ref:x=>{x&&(p.current[f]=x)},onClick:()=>u(f),style:{padding:"10px 18px",background:s===f?o.bgSecondary:"transparent",border:"none",borderBottom:"2px solid transparent",color:s===f?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:s===f?"500":"400",textTransform:"capitalize",borderRadius:"8px 8px 0 0",transition:"all 0.2s",position:"relative",zIndex:1},onMouseEnter:x=>{s!==f&&ge({targets:x.currentTarget,background:o.bgHover,color:o.textPrimary,duration:200,easing:"easeOutQuad"})},onMouseLeave:x=>{s!==f&&ge({targets:x.currentTarget,background:"transparent",color:o.textSecondary,duration:200,easing:"easeOutQuad"})},children:f},f)),l.jsx("div",{ref:d,style:{position:"absolute",bottom:0,height:"2px",background:o.accentBlue,borderRadius:"2px 2px 0 0",zIndex:2}})]})}const Wc=(r,s={})=>ge({targets:r,opacity:[0,1],translateY:[20,0],duration:s.duration||400,delay:ge.stagger(s.delay||50),easing:s.easing||"easeOutExpo",...s}),Ps=(r,s={})=>ge({targets:r,opacity:[0,1],duration:s.duration||300,easing:s.easing||"easeOutQuad",...s}),_x=(r,s={})=>ge({targets:r,translateX:[s.width||600,0],opacity:[0,1],duration:s.duration||400,easing:s.easing||"easeOutExpo",...s});function Ac(r){if(!r)return[];const s=new TextEncoder().encode(r),u=[],p=16,d=Math.ceil(s.length/p);for(const f of Array.from({length:d},(x,y)=>y)){const x=f*p,y=s.slice(x,x+p),g=Array.from(y).map(b=>b.toString(16).padStart(2,"0")).join(" "),j=Array.from(y).map(b=>b>=32&&b<127?String.fromCharCode(b):".").join(""),S=x.toString(16).padStart(8,"0");u.push({offset:S,hex:g,ascii:j})}return u}function Hc(r,s){return Object.entries(r).map(([p,d])=>`${p}: ${d}`).join(`\r
27
+ `:r.includes(" | ")?" | ":null;return s?l.jsx("ul",{style:{listStyle:"disc",listStylePosition:"inside",margin:0,paddingLeft:"8px"},children:r.split(s).map((u,p)=>l.jsx("li",{style:{fontSize:"12px",marginBottom:"2px"},children:u.trim()},`reason-${p}-${u.trim().substring(0,20)}`))}):l.jsx("p",{style:{fontSize:"12px"},children:r})}function qg({overallRiskLevel:r,overallReason:s}){return r?l.jsx(Gn,{title:"Overall Summary",count:s?1:0,defaultExpanded:!0,children:l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("span",{style:{fontSize:"12px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:"Overall Risk Level:"}),l.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"4px",fontSize:"10px",fontWeight:"700",color:o.textInverse,background:Wr(r),fontFamily:v.body},children:r.toUpperCase()})]}),s&&l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:Zg(s)})]})}):null}function eh({recommendations:r}){return!r||r.length===0?null:l.jsx(Gn,{title:"Recommendations",count:r.length,defaultExpanded:!1,children:l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((s,u)=>l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"8px",background:`${o.accentBlue}10`,borderRadius:"6px",border:`1px solid ${o.accentBlue}20`,transition:"all 0.15s"},onMouseEnter:p=>{p.currentTarget.style.background=`${o.accentBlue}15`,p.currentTarget.style.borderColor=`${o.accentBlue}40`},onMouseLeave:p=>{p.currentTarget.style.background=`${o.accentBlue}10`,p.currentTarget.style.borderColor=`${o.accentBlue}20`},children:[l.jsx("div",{style:{flexShrink:0,marginTop:"2px",width:"16px",height:"16px",borderRadius:"50%",background:`${o.accentBlue}30`,border:`1px solid ${o.accentBlue}60`,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx("span",{style:{fontSize:"10px",fontWeight:"600",color:o.accentBlue,fontFamily:v.body},children:u+1})}),l.jsx("p",{style:{fontSize:"12px",color:o.textPrimary,lineHeight:"1.5",flex:1,margin:0,fontFamily:v.body},children:s})]},`recommendation-${s.type||u}-${u}`))})})}function th({analysis:r}){if(!r)return l.jsx("div",{style:{padding:"12px",background:`${o.bgTertiary}80`,borderRadius:"6px",border:`1px solid ${o.borderLight}`,fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"No analysis data available."});const s=r.tool_findings||[],u=r.prompt_findings||[],p=r.resource_findings||[];return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[l.jsx(qg,{overallRiskLevel:r.overall_risk_level,overallReason:r.overall_reason}),s.length>0&&l.jsx(Gn,{title:"Tool Findings",count:s.length,defaultExpanded:!0,children:l.jsx(ss,{findings:s,type:"tool"})}),u.length>0&&l.jsx(Gn,{title:"Prompt Findings",count:u.length,defaultExpanded:!0,children:l.jsx(ss,{findings:u,type:"prompt"})}),p.length>0&&l.jsx(Gn,{title:"Resource Findings",count:p.length,defaultExpanded:!0,children:l.jsx(ss,{findings:p,type:"resource"})}),l.jsx(eh,{recommendations:r.recommendations}),l.jsx(Xg,{patterns:r.notable_patterns})]})}function nh({scan:r,scanId:s,serverName:u,analysisResult:p}){return l.jsxs("details",{style:{marginBottom:"16px"},children:[l.jsx("summary",{style:{cursor:"pointer",padding:"8px 12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontFamily:v.body,color:o.textSecondary,border:`1px solid ${o.borderLight}`,userSelect:"none"},onMouseEnter:d=>{d.currentTarget.style.background=o.bgSecondary,d.currentTarget.style.color=o.textPrimary},onMouseLeave:d=>{d.currentTarget.style.background=o.bgTertiary,d.currentTarget.style.color=o.textSecondary},children:"Debug Info (click to expand)"}),l.jsx("div",{style:{marginTop:"8px",padding:"12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontFamily:"monospace",border:`1px solid ${o.borderLight}`},children:l.jsxs("div",{style:{fontSize:"10px",color:o.textSecondary,lineHeight:"1.6"},children:[l.jsxs("div",{children:["scanId: ",s?`"${s}"`:"missing"]}),l.jsxs("div",{children:['serverName: "',u,'"']}),l.jsxs("div",{children:["analysisResult: ",p?"found":"missing"]}),l.jsxs("div",{children:["has scan.result: ",r.result?"yes":"no"]}),l.jsxs("div",{children:["has scan.data: ",r.data?"yes":"no"]}),l.jsxs("div",{children:["scan keys: ",Object.keys(r||{}).join(", ")]}),r.result&&l.jsxs("div",{children:["scan.result keys: ",Object.keys(r.result||{}).join(", ")]}),r.data&&l.jsxs("div",{children:["scan.data keys: ",Object.keys(r.data||{}).join(", ")]})]})})]})}function rh({scan:r}){return l.jsxs("div",{style:{marginBottom:"24px"},children:[l.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"12px",paddingBottom:"8px",borderBottom:`1px solid ${o.borderLight}`},children:"Raw Data"}),l.jsxs("details",{children:[l.jsx("summary",{style:{cursor:"pointer",padding:"8px",background:o.bgTertiary,borderRadius:"4px",fontSize:"11px",color:o.textSecondary,fontFamily:v.body,marginBottom:"8px"},children:"Click to view raw JSON data"}),l.jsx("pre",{style:{padding:"12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontFamily:"monospace",color:o.textPrimary,overflow:"auto",maxHeight:"400px",margin:0},children:JSON.stringify(r,null,2)})]})]})}function oh({scanId:r,serverName:s,onClose:u}){return l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[l.jsxs("div",{children:[l.jsx("h2",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,margin:0,marginBottom:"8px"},children:s}),r&&l.jsxs("div",{style:{fontSize:"12px",color:o.textTertiary,fontFamily:v.body},children:["ID: ",r]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[r&&l.jsxs("a",{href:`https://smart.mcpshark.sh/scan-results?id=${r}`,target:"_blank",rel:"noopener noreferrer",style:{padding:"6px 12px",background:o.buttonPrimary,border:"none",color:o.textInverse,borderRadius:"6px",fontSize:"12px",fontFamily:v.body,fontWeight:"500",textDecoration:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx(Kc,{size:14,stroke:1.5}),"View on Smart Scan"]}),l.jsx("button",{type:"button",onClick:u,style:{padding:"6px",background:"transparent",border:"none",color:o.textSecondary,cursor:"pointer",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:p=>{p.currentTarget.style.background=o.bgTertiary,p.currentTarget.style.color=o.textPrimary},onMouseLeave:p=>{p.currentTarget.style.background="transparent",p.currentTarget.style.color=o.textSecondary},children:l.jsx(qc,{size:20,stroke:1.5})})]})]})}function ih({status:r,overallRiskLevel:s,createdAt:u,updatedAt:p}){const d=f=>f?new Date(f).toLocaleString():"N/A";return l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"16px",padding:"16px",background:o.bgTertiary,borderRadius:"8px"},children:[r&&l.jsxs("div",{children:[l.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:v.body,marginBottom:"4px"},children:"Status"}),l.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontFamily:v.body,fontWeight:"500"},children:r})]}),s&&l.jsxs("div",{children:[l.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:v.body,marginBottom:"4px"},children:"Overall Risk Level"}),l.jsx("span",{style:{padding:"4px 10px",borderRadius:"6px",fontSize:"11px",fontWeight:"700",fontFamily:v.body,background:Wr(s),color:o.textInverse,display:"inline-block"},children:s.toLowerCase()})]}),u&&l.jsxs("div",{children:[l.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:v.body,marginBottom:"4px"},children:"Created At"}),l.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontFamily:v.body,fontWeight:"500"},children:d(u)})]}),p&&l.jsxs("div",{children:[l.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:v.body,marginBottom:"4px"},children:"Updated At"}),l.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontFamily:v.body,fontWeight:"500"},children:d(p)})]})]})}function lh({serverData:r}){return r?l.jsxs("div",{style:{marginBottom:"24px"},children:[l.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"12px",paddingBottom:"8px",borderBottom:`1px solid ${o.borderLight}`},children:"Server Information"}),l.jsxs("div",{style:{padding:"12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"12px",fontFamily:v.body},children:[l.jsxs("div",{style:{marginBottom:"8px"},children:[l.jsx("strong",{style:{color:o.textTertiary},children:"Name: "}),l.jsx("span",{style:{color:o.textPrimary},children:r.name||"N/A"})]}),r.description&&l.jsxs("div",{children:[l.jsx("strong",{style:{color:o.textTertiary},children:"Description: "}),l.jsx("span",{style:{color:o.textPrimary},children:r.description})]})]})]}):null}function me(r,s){return s.split(".").reduce((p,d)=>p&&typeof p=="object"&&d in p?p[d]:null,r)}function sh(r){const s=r.result||r.data||r,u=me(r,"result.id")||me(r,"id")||me(r,"scan_id")||me(r,"data.id")||me(r,"data.scan_id")||s?.id||s?.scan_id,p=r.serverName||r.server_name||me(r,"result.mcp_server_data.server.name")||me(r,"mcp_server_data.server.name")||me(r,"server.name")||me(r,"data.server.name")||me(r,"data.data.server.name")||r.server?.name||"Unknown Server",d=me(r,"result.status")||me(r,"status")||me(r,"data.status"),f=me(r,"result.overall_risk_level")||me(r,"overall_risk_level")||me(r,"data.overall_risk_level")||me(r,"data.data.overall_risk_level"),x=me(r,"result.created_at")||me(r,"created_at")||me(r,"data.created_at")||me(r,"data.data.created_at"),y=me(r,"result.updated_at")||me(r,"updated_at")||me(r,"data.updated_at")||me(r,"data.data.updated_at"),g=me(r,"result.analysis_result")||me(r,"analysis_result")||me(r,"data.analysis_result")||me(r,"data.data.analysis_result")||me(r,"data.data.data.analysis_result"),S=((T,_)=>{if(T)return T;if(_&&typeof _=="object"){if(_.tool_findings||_.prompt_findings||_.resource_findings)return _;if(_.analysis_result)return _.analysis_result}return null})(g,s),b=me(r,"result.mcp_server_data.server")||me(r,"mcp_server_data.server")||me(r,"server")||me(r,"data.server")||me(r,"data.data.server")||me(r,"mcp_server_data");return{scanId:u,serverName:p,status:d,overallRiskLevel:f,createdAt:x,updatedAt:y,analysisResult:S,serverData:b}}function ed({scan:r,loading:s,onClose:u}){if(s)return l.jsx("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"24px",textAlign:"center"},children:l.jsx("p",{style:{color:o.textSecondary,fontFamily:v.body},children:"Loading scan details..."})});if(!r)return l.jsx("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"24px",textAlign:"center"},children:l.jsx("p",{style:{color:o.textSecondary,fontFamily:v.body},children:"No scan data available"})});const{scanId:p,serverName:d,status:f,overallRiskLevel:x,createdAt:y,updatedAt:g,analysisResult:j,serverData:S}=sh(r);return l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"24px",boxShadow:`0 1px 3px ${o.shadowSm}`,position:"relative"},children:[l.jsx(oh,{scanId:p,serverName:d,onClose:u}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsx(nh,{scan:r,scanId:p,serverName:d,analysisResult:j}),l.jsx(ih,{status:f,overallRiskLevel:x,createdAt:y,updatedAt:g}),l.jsx(lh,{serverData:S}),j?l.jsxs("div",{style:{marginBottom:"24px"},children:[l.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"12px",paddingBottom:"8px",borderBottom:`1px solid ${o.borderLight}`},children:"Analysis Result"}),l.jsx(th,{analysis:j})]}):l.jsxs("div",{style:{marginBottom:"24px"},children:[l.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"12px",paddingBottom:"8px",borderBottom:`1px solid ${o.borderLight}`},children:"Analysis Result"}),l.jsx("div",{style:{padding:"12px",background:`${o.bgTertiary}80`,borderRadius:"6px",border:`1px solid ${o.borderLight}`,fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"No analysis result available for this scan. Check the Raw Data section below to see the scan structure."})]}),l.jsx(rh,{scan:r})]})]})}const td=({size:r=24,color:s="currentColor"})=>l.jsx(Zc,{size:r,stroke:1.5,color:s}),oi=({size:r=16,color:s="currentColor"})=>l.jsx(Kc,{size:r,stroke:1.5,color:s}),ah=({size:r=16,color:s="currentColor"})=>l.jsx(Df,{size:r,stroke:1.5,color:s}),Br=({size:r=16,color:s="currentColor"})=>l.jsx(Qf,{size:r,stroke:1.5,color:s}),nd=({size:r=16,color:s="currentColor"})=>l.jsx(Yc,{size:r,stroke:1.5,color:s}),ei=({size:r=16,color:s=o.accentBlue})=>l.jsx("div",{style:{width:r,height:r,border:`2px solid ${o.borderLight}`,borderTop:`2px solid ${s}`,borderRadius:"50%",animation:"spin 0.8s linear infinite"}});function uh({result:r,onViewScan:s}){const u=r.serverName||r.server_name||r.server?.name||"Unknown Server";return console.log("[BatchResultItem] Rendering with result:",{serverName:r.serverName,extractedServerName:u,hasServerName:!!r.serverName,resultKeys:Object.keys(r)}),l.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${r.success?o.borderLight:o.error}`,borderRadius:"8px",padding:"10px 16px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1,minWidth:0},children:[l.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:u}),r.success&&l.jsxs(l.Fragment,{children:[r.data?.data?.overall_risk_level&&l.jsxs("span",{style:{padding:"4px 10px",borderRadius:"6px",fontSize:"10px",fontWeight:"700",fontFamily:v.body,background:Wr(r.data.data.overall_risk_level),color:o.textInverse,whiteSpace:"nowrap"},children:[r.data.data.overall_risk_level.toLowerCase()," risk"]}),s&&r.data&&l.jsxs("button",{type:"button",onClick:()=>s(r.data),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 10px",borderRadius:"6px",background:o.buttonPrimary,border:"none",color:o.textInverse,cursor:"pointer",transition:"all 0.2s",fontSize:"11px",fontWeight:"500",fontFamily:v.body,whiteSpace:"nowrap"},onMouseEnter:p=>{p.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:p=>{p.currentTarget.style.background=o.buttonPrimary},children:[l.jsx(fs,{size:12,stroke:1.5}),l.jsx("span",{children:"View"})]}),r.data?.scan_id&&l.jsxs("a",{href:`https://smart.mcpshark.sh/scan-results?id=${r.data.scan_id}`,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 10px",borderRadius:"6px",background:o.bgSecondary,border:`1px solid ${o.borderLight}`,color:o.accentBlue,textDecoration:"none",cursor:"pointer",transition:"all 0.2s",fontSize:"11px",fontWeight:"500",fontFamily:v.body,whiteSpace:"nowrap"},onMouseEnter:p=>{p.currentTarget.style.background=o.bgTertiary,p.currentTarget.style.borderColor=o.accentBlue},onMouseLeave:p=>{p.currentTarget.style.background=o.bgSecondary,p.currentTarget.style.borderColor=o.borderLight},children:[l.jsx("span",{children:"open"}),l.jsx(oi,{size:12,color:o.accentBlue})]})]})]}),l.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:r.success?l.jsxs(l.Fragment,{children:[r.cached&&l.jsxs("span",{style:{padding:"4px 8px",borderRadius:"6px",fontSize:"10px",fontWeight:"600",fontFamily:v.body,background:o.bgSecondary,color:o.textSecondary,border:`1px solid ${o.borderLight}`,display:"inline-flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap"},title:"This result was retrieved from cache",children:[l.jsx(nd,{size:10,color:o.textSecondary}),l.jsx("span",{children:"Cached"})]}),l.jsxs("span",{style:{padding:"4px 8px",borderRadius:"6px",fontSize:"10px",fontWeight:"700",fontFamily:v.body,background:o.accentGreen,color:o.textInverse,display:"inline-flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap"},children:[l.jsx(Br,{size:10,color:o.textInverse}),l.jsx("span",{children:"Success"})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{padding:"4px 8px",borderRadius:"6px",fontSize:"10px",fontWeight:"700",fontFamily:v.body,background:o.error,color:o.textInverse,whiteSpace:"nowrap"},children:"✗ Failed"}),r.error&&l.jsx("span",{style:{fontSize:"11px",color:o.error,fontFamily:v.body,whiteSpace:"nowrap",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis"},title:r.error,children:r.error})]})})]})}function ch({scanResults:r}){const s=r.filter(d=>d.cached).length,u=r.filter(d=>d.success&&!d.cached).length,p=r.every(d=>d.cached);return l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[l.jsxs("div",{children:[l.jsxs("h2",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,margin:0,marginBottom:"4px"},children:["Scan Results (",r.length," server",r.length!==1?"s":"",")"]}),p&&l.jsx("p",{style:{fontSize:"12px",color:o.textTertiary,fontFamily:v.body,margin:0},children:"Showing cached results. Run a new scan to get the latest analysis."})]}),r.length>0&&l.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center",fontSize:"13px",color:o.textSecondary,fontFamily:v.body},children:[s>0&&l.jsxs("span",{style:{padding:"6px 10px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontWeight:"600",display:"inline-flex",alignItems:"center",gap:"4px",fontFamily:v.body},children:[l.jsx(nd,{size:12,color:o.textSecondary}),l.jsxs("span",{children:[s," cached"]})]}),u>0&&l.jsxs("span",{style:{padding:"6px 10px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontWeight:"600",display:"inline-flex",alignItems:"center",gap:"4px"},children:[l.jsx(Br,{size:12,color:o.accentGreen}),l.jsxs("span",{children:[u," scanned"]})]})]})]})}function dh({scanResults:r,onViewScan:s}){return r.length===0?null:l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"20px",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[l.jsx(ch,{scanResults:r}),l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((u,p)=>l.jsx(uh,{result:u,onViewScan:s},u.scanId||`batch-result-${p}`))})]})}function ph(){return l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"400px",textAlign:"center",padding:"40px"},children:[l.jsx("div",{style:{marginBottom:"24px",opacity:.6},children:l.jsxs("svg",{width:64,height:64,viewBox:"0 0 24 24",fill:"none",stroke:o.textTertiary,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:.5},role:"img","aria-label":"Empty state icon",children:[l.jsx("title",{children:"Empty state icon"}),l.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),l.jsx("path",{d:"M9 12l2 2 4-4"})]})}),l.jsx("h3",{style:{fontSize:"20px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"8px"},children:"Ready to Scan"}),l.jsx("p",{style:{fontSize:"14px",color:o.textSecondary,fontFamily:v.body,maxWidth:"400px",lineHeight:"1.6"},children:"Configure your API token and discover MCP servers to start security scanning. Results will appear here."})]})}function fh({error:r}){return r?l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.error}`,borderRadius:"12px",padding:"16px 20px",marginBottom:"24px",display:"flex",gap:"12px",alignItems:"flex-start"},children:[l.jsx(ah,{size:20,color:o.error,style:{flexShrink:0,marginTop:"2px"}}),l.jsxs("div",{style:{flex:1},children:[l.jsx("p",{style:{fontSize:"14px",color:o.error,fontFamily:v.body,margin:0,fontWeight:"600",marginBottom:"4px"},children:"Error"}),l.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,fontFamily:v.body,margin:0,lineHeight:"1.5"},children:r})]})]}):null}function gh({scanning:r,selectedServers:s}){return r?l.jsx("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"24px",boxShadow:`0 2px 8px ${o.shadowSm}`},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[l.jsx(ei,{size:20}),l.jsxs("div",{style:{flex:1},children:[l.jsxs("p",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,margin:0,marginBottom:"4px"},children:["Scanning ",s.size," server",s.size!==1?"s":"","..."]}),l.jsx("p",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body,margin:0},children:"Analyzing security vulnerabilities and risks"})]})]})}):null}function hh({scanResult:r}){return r?l.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"20px",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[l.jsx("h2",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"16px"},children:"Scan Results"}),r.data?.overall_risk_level&&l.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"16px",marginBottom:"20px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"8px"},children:[l.jsx("span",{style:{padding:"4px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:"700",fontFamily:v.body,background:Wr(r.data.overall_risk_level),color:o.textInverse},children:r.data.overall_risk_level.toUpperCase()}),l.jsx("span",{style:{fontSize:"14px",color:o.textSecondary,fontFamily:v.body},children:"Overall Risk Level"})]}),r.data.overall_reason&&l.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,fontFamily:v.body,margin:0},children:r.data.overall_reason})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"12px",marginBottom:"20px"},children:[r.data?.tool_findings?.length>0&&l.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"12px"},children:[l.jsx("div",{style:{fontSize:"24px",fontWeight:"700",color:o.textPrimary,fontFamily:v.body},children:r.data.tool_findings.length}),l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"Tool Findings"})]}),r.data?.resource_findings?.length>0&&l.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"12px"},children:[l.jsx("div",{style:{fontSize:"24px",fontWeight:"700",color:o.textPrimary,fontFamily:v.body},children:r.data.resource_findings.length}),l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"Resource Findings"})]}),r.data?.prompt_findings?.length>0&&l.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"12px"},children:[l.jsx("div",{style:{fontSize:"24px",fontWeight:"700",color:o.textPrimary,fontFamily:v.body},children:r.data.prompt_findings.length}),l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"Prompt Findings"})]})]}),r.data?.recommendations?.length>0&&l.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"16px",marginBottom:"20px"},children:[l.jsx("h3",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"12px"},children:"Recommendations"}),l.jsx("ul",{style:{margin:0,paddingLeft:"20px",fontSize:"13px",color:o.textSecondary,fontFamily:v.body,lineHeight:"1.8"},children:r.data.recommendations.map((s,u)=>l.jsx("li",{children:s},`recommendation-${u}-${s.substring(0,30)}`))})]}),r.scan_id&&l.jsx("div",{style:{marginTop:"20px",paddingTop:"20px",borderTop:`1px solid ${o.borderLight}`},children:l.jsxs("a",{href:`https://smart.mcpshark.sh/scan-results?id=${r.scan_id}`,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"10px 20px",background:o.buttonSecondary,color:o.textPrimary,border:`1px solid ${o.borderMedium}`,borderRadius:"8px",textDecoration:"none",fontSize:"13px",fontWeight:"600",fontFamily:v.body,transition:"all 0.2s ease"},onMouseEnter:s=>{s.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:s=>{s.currentTarget.style.background=o.buttonSecondary},children:[l.jsx("span",{children:"View Full Results"}),l.jsx(oi,{size:14,color:o.textPrimary})]})})]}):null}function rd({error:r,scanning:s,selectedServers:u,scanResults:p,scanResult:d,onViewScan:f}){return l.jsxs("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"24px",background:o.bgPrimary},children:[!r&&p.length===0&&!d&&!s&&l.jsx(ph,{}),l.jsx(fh,{error:r}),l.jsx(gh,{scanning:s,selectedServers:u}),p.length>0&&l.jsx(dh,{scanResults:p,onViewScan:f}),d&&p.length===0&&l.jsx(hh,{scanResult:d})]})}function xh({error:r,loadingScans:s,selectedScan:u,loadingScanDetail:p,allScans:d,setSelectedScan:f,loadScanDetail:x,onViewScan:y}){return s?l.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",background:o.bgPrimary},children:l.jsx("p",{style:{color:o.textSecondary,fontFamily:v.body},children:"Loading cached scans..."})}):u?l.jsx(ed,{scan:u,loading:p,onClose:()=>{f(null),x(null)}}):l.jsxs(l.Fragment,{children:[r&&l.jsx("div",{style:{padding:"12px 16px",background:`${o.error}20`,border:`1px solid ${o.error}`,borderRadius:"8px",marginBottom:"16px",color:o.error,fontSize:"13px",fontFamily:v.body},children:r}),l.jsx(rd,{error:r,scanning:!1,selectedServers:[],scanResults:d,scanResult:null,onViewScan:y})]})}function yh({discoveredServers:r,selectedServers:s,setSelectedServers:u,runScan:p,scanning:d,apiToken:f}){const x=()=>{s.size===r.length?u(new Set):u(new Set(r.map(y=>y.name)))};return l.jsx("div",{style:{background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,padding:"12px 24px"},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px",flexWrap:"wrap"},children:[l.jsx("div",{style:{fontSize:"12px",fontWeight:"600",color:o.textSecondary,fontFamily:v.body,whiteSpace:"nowrap"},children:"Select servers to scan:"}),l.jsx("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap",flex:1},children:r.map((y,g)=>{const j=s.has(y.name);return l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:j?o.bgCard:o.bgTertiary,border:`1px solid ${j?o.accentBlue:o.borderLight}`,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s ease",fontSize:"12px",fontFamily:v.body,fontWeight:j?"600":"500",color:j?o.textPrimary:o.textSecondary},onMouseEnter:S=>{S.currentTarget.style.borderColor=o.accentBlue,S.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`},onMouseLeave:S=>{j||(S.currentTarget.style.borderColor=o.borderLight,S.currentTarget.style.boxShadow="none")},children:[l.jsx("input",{type:"checkbox",checked:j,onChange:S=>{const b=new Set(s);S.target.checked?b.add(y.name):b.delete(y.name),u(b)},style:{width:"16px",height:"16px",cursor:"pointer",accentColor:o.accentBlue}}),l.jsx("span",{children:y.name}),l.jsxs("span",{style:{fontSize:"10px",color:o.textTertiary,fontWeight:"400"},children:["(",y.tools?.length||0," tools, ",y.resources?.length||0," resources,"," ",y.prompts?.length||0," prompts)"]})]},y.name||`server-${g}`)})}),l.jsx("button",{type:"button",onClick:x,style:{padding:"6px 12px",background:o.buttonSecondary,color:o.textPrimary,border:`1px solid ${o.borderMedium}`,borderRadius:"6px",fontSize:"11px",fontWeight:"600",fontFamily:v.body,cursor:"pointer",transition:"all 0.2s ease",whiteSpace:"nowrap"},onMouseEnter:y=>{y.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:y=>{y.currentTarget.style.background=o.buttonSecondary},children:s.size===r.length?"Deselect All":"Select All"}),l.jsx("button",{type:"button",onClick:p,disabled:!f||s.size===0||d,style:{padding:"8px 16px",background:f&&s.size>0&&!d?o.buttonPrimary:o.buttonSecondary,color:f&&s.size>0&&!d?o.textInverse:o.textTertiary,border:"none",borderRadius:"6px",fontSize:"13px",fontWeight:"600",fontFamily:v.body,cursor:f&&s.size>0&&!d?"pointer":"not-allowed",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap"},onMouseEnter:y=>{f&&s.size>0&&!d&&(y.currentTarget.style.background=o.buttonPrimaryHover,y.currentTarget.style.transform="translateY(-1px)",y.currentTarget.style.boxShadow=`0 4px 12px ${o.shadowMd}`)},onMouseLeave:y=>{f&&s.size>0&&!d&&(y.currentTarget.style.background=o.buttonPrimary,y.currentTarget.style.transform="translateY(0)",y.currentTarget.style.boxShadow="none")},children:d?l.jsxs(l.Fragment,{children:[l.jsx(ei,{size:14,color:o.textInverse}),l.jsxs("span",{children:["Scanning ",s.size," server",s.size!==1?"s":"","..."]})]}):l.jsxs(l.Fragment,{children:[l.jsx(td,{size:14,color:f&&s.size>0?o.textInverse:o.textTertiary}),l.jsxs("span",{children:["Run Scan (",s.size,")"]})]})})]})})}function mh({discoveredServers:r,selectedServers:s,setSelectedServers:u,runScan:p,scanning:d,apiToken:f,error:x,scanResults:y,scanResult:g,selectedScan:j,loadingScanDetail:S,setSelectedScan:b,loadScanDetail:T,onViewScan:_}){return j?l.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"24px",background:o.bgPrimary},children:l.jsx(ed,{scan:j,loading:S,onClose:()=>{b(null),T(null)}})}):l.jsxs(l.Fragment,{children:[r.length>0&&l.jsx(yh,{discoveredServers:r,selectedServers:s,setSelectedServers:u,runScan:p,scanning:d,apiToken:f}),l.jsx(rd,{error:x,scanning:d,selectedServers:s,scanResults:y,scanResult:g,onViewScan:_})]})}function od({isOpen:r,onClose:s,onConfirm:u,title:p,message:d,confirmText:f="Confirm",cancelText:x="Cancel",danger:y=!1}){return r?l.jsx("dialog",{open:!0,"aria-modal":"true",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,border:"none",margin:0,width:"100%",height:"100%"},onClick:s,onKeyDown:g=>{g.key==="Escape"&&s()},children:l.jsxs("div",{role:"document",style:{background:o.bgCard,borderRadius:"12px",padding:"24px",maxWidth:"500px",width:"90%",boxShadow:`0 4px 20px ${o.shadowLg}`,fontFamily:v.body},onClick:g=>g.stopPropagation(),onKeyDown:g=>g.stopPropagation(),children:[l.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:"18px",fontWeight:"600",color:o.textPrimary},children:p}),l.jsx("p",{style:{margin:"0 0 24px 0",fontSize:"14px",color:o.textSecondary,lineHeight:"1.5"},children:d}),l.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:[l.jsx("button",{type:"button",onClick:s,style:{padding:"10px 20px",background:o.buttonSecondary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",color:o.textPrimary,fontSize:"14px",fontWeight:"500",fontFamily:v.body,cursor:"pointer",transition:"all 0.2s"},onMouseEnter:g=>{g.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:g=>{g.currentTarget.style.background=o.buttonSecondary},children:x}),l.jsx("button",{type:"button",onClick:()=>{u(),s()},style:{padding:"10px 20px",background:y?o.buttonDanger:o.buttonPrimary,border:"none",borderRadius:"8px",color:o.textInverse,fontSize:"14px",fontWeight:"500",fontFamily:v.body,cursor:"pointer",transition:"all 0.2s"},onMouseEnter:g=>{g.currentTarget.style.background=y?o.buttonDangerHover:o.buttonPrimaryHover},onMouseLeave:g=>{g.currentTarget.style.background=y?o.buttonDanger:o.buttonPrimary},children:f})]})]})}):null}function vh({apiToken:r,setApiToken:s,saveToken:u,loadingData:p,discoverMcpData:d,discoveredServers:f,_selectedServers:x,_setSelectedServers:y,scanning:g,clearCache:j,clearingCache:S,...b}){const{runScan:T}=b,_=L.useRef(null),[z,R]=L.useState(!1),P=I=>{s(I),_.current&&clearTimeout(_.current),I?_.current=setTimeout(()=>{u(I)},1e3):u("")};return l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"20px",flexWrap:"wrap",flex:1,justifyContent:"flex-end"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("label",{htmlFor:"api-token-input",style:{fontSize:"12px",fontWeight:"600",color:o.textSecondary,fontFamily:v.body,whiteSpace:"nowrap"},children:"API Token:"}),l.jsxs("div",{style:{position:"relative",width:"200px"},children:[l.jsx("input",{id:"api-token-input",type:"password",value:r,onChange:I=>P(I.target.value),placeholder:"sk_...",style:{width:"100%",padding:"8px 10px",paddingRight:r?"28px":"10px",border:`1px solid ${r?o.accentGreen:o.borderMedium}`,borderRadius:"8px",fontSize:"12px",fontFamily:v.body,background:o.bgCard,color:o.textPrimary,boxSizing:"border-box",transition:"all 0.2s ease"},onFocus:I=>{I.currentTarget.style.borderColor=o.accentBlue,I.currentTarget.style.boxShadow=`0 0 0 2px ${o.accentBlue}20`},onBlur:I=>{I.currentTarget.style.borderColor=r?o.accentGreen:o.borderMedium,I.currentTarget.style.boxShadow="none"}}),r&&l.jsx("div",{style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)"},children:l.jsx(Br,{size:12,color:o.accentGreen})})]}),l.jsxs("a",{href:"https://smart.mcpshark.sh/tokens",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",color:o.accentBlue,textDecoration:"none",fontFamily:v.body,fontWeight:"500",whiteSpace:"nowrap"},onMouseEnter:I=>{I.currentTarget.style.textDecoration="underline"},onMouseLeave:I=>{I.currentTarget.style.textDecoration="none"},children:[l.jsx("span",{children:"Get token"}),l.jsx(oi,{size:10,color:o.accentBlue})]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("label",{htmlFor:"servers-label",style:{fontSize:"12px",fontWeight:"600",color:o.textSecondary,fontFamily:v.body,whiteSpace:"nowrap"},children:"Servers:"}),l.jsx("button",{type:"button",onClick:d,disabled:p,style:{padding:"8px 14px",background:p?o.buttonSecondary:o.buttonPrimary,color:p?o.textTertiary:o.textInverse,border:"none",borderRadius:"6px",fontSize:"12px",fontWeight:"600",fontFamily:v.body,cursor:p?"not-allowed":"pointer",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",whiteSpace:"nowrap"},onMouseEnter:I=>{p||(I.currentTarget.style.background=o.buttonPrimaryHover,I.currentTarget.style.transform="translateY(-1px)")},onMouseLeave:I=>{p||(I.currentTarget.style.background=o.buttonPrimary,I.currentTarget.style.transform="translateY(0)")},children:p?l.jsxs(l.Fragment,{children:[l.jsx(ei,{size:12}),l.jsx("span",{children:"Discovering..."})]}):l.jsxs(l.Fragment,{children:[l.jsx(Br,{size:12,color:o.textInverse}),l.jsx("span",{children:"Discover"})]})}),f.length>0&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 10px",background:o.bgTertiary,borderRadius:"8px",fontSize:"11px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:[l.jsx(Br,{size:12,color:o.accentGreen}),l.jsxs("span",{children:[f.length," server",f.length!==1?"s":""]})]})]}),l.jsx("button",{type:"button",onClick:()=>R(!0),disabled:S,style:{padding:"8px 14px",background:o.buttonSecondary,border:`1px solid ${o.borderLight}`,color:o.textSecondary,cursor:S?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",fontFamily:v.body,borderRadius:"8px",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",whiteSpace:"nowrap",opacity:S?.5:1},onMouseEnter:I=>{S||(I.currentTarget.style.background=o.buttonSecondaryHover,I.currentTarget.style.color=o.textPrimary)},onMouseLeave:I=>{S||(I.currentTarget.style.background=o.buttonSecondary,I.currentTarget.style.color=o.textSecondary)},title:"Clear cached scan results",children:S?l.jsxs(l.Fragment,{children:[l.jsx(ei,{size:12}),l.jsx("span",{children:"Clearing..."})]}):l.jsxs(l.Fragment,{children:[l.jsx(ri,{size:14,stroke:1.5}),l.jsx("span",{children:"Clear Cache"})]})}),l.jsx(od,{isOpen:z,onClose:()=>R(!1),onConfirm:async()=>{(await j()).success&&R(!1)},title:"Clear Scan Cache?",message:"Are you sure you want to clear all cached scan results? This will force fresh scans for all servers on the next scan.",confirmText:"Clear Cache",cancelText:"Cancel",danger:!1})]})}function Sh(){return l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginRight:"auto"},children:[l.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"10px",background:`linear-gradient(135deg, ${o.accentBlue}20, ${o.accentGreen}20)`,border:`2px solid ${o.accentBlue}40`,flexShrink:0},children:l.jsx(td,{size:20,color:o.accentBlue})}),l.jsxs("div",{children:[l.jsx("h1",{style:{fontSize:"18px",fontWeight:"700",color:o.textPrimary,fontFamily:v.body,margin:0,letterSpacing:"-0.2px"},children:l.jsxs("a",{href:"https://smart.mcpshark.sh/#get-started",target:"_blank",rel:"noopener noreferrer",style:{color:o.textPrimary,textDecoration:"none",display:"inline-flex",alignItems:"center",gap:"6px",transition:"color 0.2s ease"},onMouseEnter:r=>{r.currentTarget.style.color=o.accentBlue},onMouseLeave:r=>{r.currentTarget.style.color=o.textPrimary},children:["Smart Scan",l.jsx(oi,{size:12,color:"currentColor"})]})}),l.jsx("p",{style:{fontSize:"11px",color:o.textSecondary,fontFamily:v.body,margin:0,lineHeight:"1.3"},children:"AI-powered security analysis for Model Context Protocol (MCP) servers"})]})]})}function bh({viewMode:r,setViewMode:s,onSwitchToScan:u,onSwitchToList:p}){return l.jsxs("div",{style:{display:"flex",gap:"8px",border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"4px",background:o.bgSecondary},children:[l.jsx("button",{type:"button",onClick:()=>{s("scan"),u?.()},style:{padding:"6px 14px",background:r==="scan"?o.bgCard:"transparent",border:"none",color:r==="scan"?o.textPrimary:o.textSecondary,borderRadius:"6px",fontSize:"12px",fontFamily:v.body,fontWeight:r==="scan"?"600":"400",cursor:"pointer",transition:"all 0.2s"},children:"Scan Servers"}),l.jsx("button",{type:"button",onClick:()=>{s("list"),p?.()},style:{padding:"6px 14px",background:r==="list"?o.bgCard:"transparent",border:"none",color:r==="list"?o.textPrimary:o.textSecondary,borderRadius:"6px",fontSize:"12px",fontFamily:v.body,fontWeight:r==="list"?"600":"400",cursor:"pointer",transition:"all 0.2s"},children:"View All Scans"})]})}function kh(r,s,u){const[p,d]=L.useState(!1);return{clearingCache:p,clearCache:async()=>{d(!0),u(null);try{const x=await fetch("/api/smartscan/cache/clear",{method:"POST"}),y=await x.json();if(x.ok)return r.length>0&&await s(),{success:!0,message:y.message};throw new Error(y.error||"Failed to clear cache")}catch(x){return u(x.message||"Failed to clear cache"),{success:!1,error:x.message}}finally{d(!1)}}}}function wh(r){const[s,u]=L.useState(null),[p,d]=L.useState([]),[f,x]=L.useState(new Set),[y,g]=L.useState(!1),[j,S]=L.useState(null);return{mcpData:s,discoveredServers:p,selectedServers:f,setSelectedServers:x,loadingData:y,discoverMcpData:async()=>{g(!0),r(null),u(null),d([]);try{const _=await fetch("/api/smartscan/discover");if(!_.ok){const R=await _.json();throw new Error(R.message||"Failed to discover servers")}const z=await _.json();if(!z.success||!z.servers||z.servers.length===0)throw new Error("No MCP servers found in config. Please configure servers in the Setup tab.");if(d(z.servers),z.servers.length>0){x(new Set(z.servers.map(R=>R.name)));try{const R=await fetch("/api/smartscan/cached-results",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({servers:z.servers})});if(R.ok){const P=await R.json();P.success&&P.results&&P.results.filter(O=>O.success&&O.cached).length>0}}catch(R){console.debug("Could not load cached results:",R)}}if(z.servers.length>0){const R=z.servers[0];u({server:{name:R.name,description:"Discovered from MCP config"},tools:R.tools||[],resources:R.resources||[],prompts:R.prompts||[]})}}catch(_){r(_.message||"Failed to discover MCP server data")}finally{g(!1)}},makeMcpRequest:async(_,z={})=>{const R={"Content-Type":"application/json"};j&&(R["Mcp-Session-Id"]=j);const P=await fetch("/api/playground/proxy",{method:"POST",headers:R,body:JSON.stringify({method:_,params:z})}),I=await P.json(),O=P.headers.get("Mcp-Session-Id")||P.headers.get("mcp-session-id")||I._sessionId;if(O&&O!==j&&S(O),!P.ok)throw new Error(I.error?.message||I.message||"Request failed");return I.result||I}}}function jh(r,s){const[u,p]=L.useState([]),[d,f]=L.useState(!1),[x,y]=L.useState(null),[g,j]=L.useState(!1);return{allScans:u,loadingScans:d,loadAllScans:async()=>{f(!0),s(null);try{console.log("Loading cached scans from local storage...");const T=await fetch("/api/smartscan/scans?cache=true"),_=await T.json();if(console.log("Cache response:",{status:T.status,ok:T.ok,cacheData:_}),T.ok){const z=_.scans||[];console.log(`[useScanList] Loaded ${z.length} cached scans from API`),console.log("[useScanList] Full cacheData:",_),z.length>0&&console.log("[useScanList] First scan structure:",{keys:Object.keys(z[0]),serverName:z[0].serverName,server_name:z[0].server_name,server:z[0].server,fullScan:z[0]});const R=z.map((P,I)=>{console.log(`[useScanList] Transforming scan ${I}:`,{scanId:P.id||P.scan_id,serverName:P.serverName,server_name:P.server_name,server:P.server,hasServerName:!!P.serverName,hasServerNameAlt:!!P.server_name,hasServer:!!P.server});const O=P.serverName?.trim()||P.server_name?.trim()||P.server?.name?.trim()||"Unknown Server";console.log(`[useScanList] Extracted serverName for scan ${I}: "${O}"`),O==="Unknown Server"&&console.error("[useScanList] Could not find server name in scan:",{scanId:P.id||P.scan_id,hasServerName:!!P.serverName,hasServerNameAlt:!!P.server_name,hasServer:!!P.server,serverNameValue:P.serverName,serverNameAltValue:P.server_name,serverNameFromServer:P.server?.name,scanKeys:Object.keys(P),fullScanObject:P});const U=P.data||P.result||P,W=U?.data&&typeof U.data=="object"?U.data:U,$={serverName:O,success:!0,cached:!0,data:{scan_id:P.scan_id||P.id,data:W}};return console.log(`[useScanList] Transformed result ${I}:`,{serverName:$.serverName,scan_id:$.data.scan_id}),$});console.log("[useScanList] Final transformed scanResults:",R.map(P=>({serverName:P.serverName,scan_id:P.data.scan_id}))),console.log("[useScanList] Setting allScans state with:",R.length,"items"),console.log("[useScanList] First item serverName:",R[0]?.serverName),console.log("[useScanList] Second item serverName:",R[1]?.serverName),p(R),R.length===0&&s("No cached scans found. Please run a scan first to see results here.")}else s(_.error||_.message||"Failed to load cached scans")}catch(T){s(T.message||"Failed to load cached scans")}finally{f(!1)}},selectedScan:x,setSelectedScan:y,loadingScanDetail:g,loadScanDetail:async T=>{if(!T){y(null);return}const _=u.find(z=>z.data?.scan_id===T||z.data?.data?.id===T||z.data?.data?.scan_id===T);if(_?.cached&&_.data?.data){const z=_.data.data;y({...z,scan_id:_.data.scan_id||z.id||z.scan_id});return}if(!r){s("Please enter your API token to view scan details");return}j(!0),s(null);try{const z=await fetch(`/api/smartscan/scans/${T}`,{headers:{Authorization:`Bearer ${r}`}}),R=await z.json();z.ok?y(R.result||R):s(R.error||R.message||"Failed to load scan details")}catch(z){s(z.message||"Failed to load scan details")}finally{j(!1)}}}}function Ch(r,s,u,p){const[d,f]=L.useState(!1),[x,y]=L.useState(null),[g,j]=L.useState([]);return{scanning:d,scanResult:x,scanResults:g,runScan:async()=>{if(!r){p("Please enter your API token");return}if(!s||s.length===0){p("Please discover MCP servers first");return}if(u.size===0){p("Please select at least one server to scan");return}f(!0),p(null),y(null),j([]);const b=s.filter(T=>u.has(T.name));try{const T=await fetch("/api/smartscan/scans/batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiToken:r,servers:b})}),_=await T.json();if(!T.ok){const z=P=>Array.isArray(P)?`Validation failed: ${P.map(I=>typeof I=="string"?I:I.field&&I.message?`${I.field}: ${I.message}`:JSON.stringify(I)).join("; ")}`:null,R=T.status===400&&_.details?z(_.details)||_.error||_.message||`API error: ${T.status}`:_.error||_.message||`API error: ${T.status}`;p(R);return}if(_.results&&Array.isArray(_.results)){j(_.results);const z=_.results.find(R=>R.success);z&&y(z.data)}}catch(T){p(T.message||"Failed to run scan")}finally{f(!1)}}}}function Th(){const[r,s]=L.useState(null);L.useEffect(()=>{u();const p=setInterval(u,2e3);return()=>clearInterval(p)},[]);const u=async()=>{try{const p=await fetch("/api/composite/status");if(!p.ok)throw new Error("Server not available");const d=await p.json();s(d)}catch{s({running:!1})}};return{serverStatus:r}}function Ph(){const[r,s]=L.useState(""),u=L.useRef(null);L.useEffect(()=>(p(),()=>{u.current&&clearTimeout(u.current)}),[]);const p=async()=>{try{const f=await fetch("/api/smartscan/token");if(f.ok){const x=await f.json();x.token&&s(x.token)}}catch{console.debug("No stored token found")}};return{apiToken:r,setApiToken:s,saveToken:async f=>{try{(await fetch("/api/smartscan/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:f})})).ok||console.error("Failed to save token")}catch(x){console.error("Error saving token:",x)}},saveTokenTimeoutRef:u}}function _h(){const[r,s]=L.useState(null),{apiToken:u,setApiToken:p,saveToken:d,saveTokenTimeoutRef:f}=Ph(),{serverStatus:x}=Th(),{mcpData:y,discoveredServers:g,selectedServers:j,setSelectedServers:S,loadingData:b,discoverMcpData:T,makeMcpRequest:_}=wh(s),{scanning:z,scanResult:R,scanResults:P,runScan:I}=Ch(u,g,j,s),{allScans:O,loadingScans:U,loadAllScans:W,selectedScan:$,setSelectedScan:H,loadingScanDetail:K,loadScanDetail:V}=jh(u,s),{clearingCache:G,clearCache:Y}=kh(g,T,s);return{apiToken:u,setApiToken:p,serverStatus:x,mcpData:y,discoveredServers:g,selectedServers:j,setSelectedServers:S,loadingData:b,scanning:z,scanResult:R,scanResults:P,error:r,saveToken:d,discoverMcpData:T,runScan:I,clearCache:Y,clearingCache:G,saveTokenTimeoutRef:f,allScans:O,loadingScans:U,loadAllScans:W,selectedScan:$,setSelectedScan:H,loadingScanDetail:K,loadScanDetail:V,makeMcpRequest:_}}function Lh(){const[r,s]=L.useState("scan"),{apiToken:u,setApiToken:p,discoveredServers:d,selectedServers:f,setSelectedServers:x,loadingData:y,scanning:g,scanResult:j,scanResults:S,error:b,saveToken:T,discoverMcpData:_,runScan:z,clearCache:R,clearingCache:P,allScans:I,loadingScans:O,loadAllScans:U,selectedScan:W,setSelectedScan:$,loadingScanDetail:H,loadScanDetail:K}=_h();return l.jsxs("div",{"data-tab-content":!0,style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column",background:o.bgPrimary},children:[l.jsx("div",{style:{background:o.bgCard,borderBottom:`1px solid ${o.borderLight}`,padding:"16px 24px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"24px",flexWrap:"wrap"},children:[l.jsx(Sh,{}),l.jsx(bh,{viewMode:r,setViewMode:s,onSwitchToScan:()=>$(null),onSwitchToList:()=>{$(null),I.length===0&&U()}}),r==="scan"&&l.jsx(vh,{apiToken:u,setApiToken:p,saveToken:T,loadingData:y,discoverMcpData:_,discoveredServers:d,selectedServers:f,setSelectedServers:x,runScan:z,scanning:g,clearCache:R,clearingCache:P})]})}),r==="scan"?l.jsx(mh,{discoveredServers:d,selectedServers:f,setSelectedServers:x,runScan:z,scanning:g,apiToken:u,error:b,scanResults:S,scanResult:j,selectedScan:W,loadingScanDetail:H,setSelectedScan:$,loadScanDetail:K,onViewScan:V=>{if(console.log("onViewScan - scanData:",V),V.scan_id&&u)K(V.scan_id);else if(V.data&&typeof V.data=="object"){const G=V.data;$({...G,scan_id:V.scan_id||G.id||G.scan_id})}else $(V)}}):l.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"24px",background:o.bgPrimary},children:l.jsx(xh,{error:b,loadingScans:O,selectedScan:W,loadingScanDetail:H,allScans:I,setSelectedScan:$,loadScanDetail:K,onViewScan:V=>{console.log("onViewScan - scanData:",V);const G=V.scan_id||V.id||V.hash,ce=I.find(Se=>Se.data?.scan_id===G||Se.data?.data?.scan_id===G)?.serverName||V.serverName||"Unknown Server";if(V?.data&&typeof V.data=="object"){const Se=V.data;$({...Se,scan_id:G||Se.id||Se.scan_id||Se.hash,serverName:ce})}else V&&typeof V=="object"?$({...V,scan_id:G||V.id||V.hash,serverName:ce}):console.warn("Invalid scanData structure:",V)}})})]})}const zh=({size:r=32,className:s="",style:u={}})=>l.jsx("img",{src:"/og-image.png",alt:"MCP Shark Logo",width:r,height:r,className:s,style:{width:`${r}px`,height:`${r}px`,objectFit:"contain",...u},"aria-label":"MCP Shark Logo"});var id={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},gs={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},Eh=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],ti={CSS:{},springs:{}};function Et(r,s,u){return Math.min(Math.max(r,s),u)}function Dr(r,s){return r.indexOf(s)>-1}function as(r,s){return r.apply(null,s)}var ie={arr:function(r){return Array.isArray(r)},obj:function(r){return Dr(Object.prototype.toString.call(r),"Object")},pth:function(r){return ie.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return r.nodeType||ie.svg(r)},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r>"u"},nil:function(r){return ie.und(r)||r===null},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return ie.hex(r)||ie.rgb(r)||ie.hsl(r)},key:function(r){return!id.hasOwnProperty(r)&&!gs.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function ld(r){var s=/\(([^)]+)\)/.exec(r);return s?s[1].split(",").map(function(u){return parseFloat(u)}):[]}function sd(r,s){var u=ld(r),p=Et(ie.und(u[0])?1:u[0],.1,100),d=Et(ie.und(u[1])?100:u[1],.1,100),f=Et(ie.und(u[2])?10:u[2],.1,100),x=Et(ie.und(u[3])?0:u[3],.1,100),y=Math.sqrt(d/p),g=f/(2*Math.sqrt(d*p)),j=g<1?y*Math.sqrt(1-g*g):0,S=1,b=g<1?(g*y+-x)/j:-x+y;function T(z){var R=s?s*z/1e3:z;return g<1?R=Math.exp(-R*g*y)*(S*Math.cos(j*R)+b*Math.sin(j*R)):R=(S+b*R)*Math.exp(-R*y),z===0||z===1?z:1-R}function _(){var z=ti.springs[r];if(z)return z;for(var R=1/6,P=0,I=0;;)if(P+=R,T(P)===1){if(I++,I>=16)break}else I=0;var O=P*R*1e3;return ti.springs[r]=O,O}return s?T:_}function Rh(r){return r===void 0&&(r=10),function(s){return Math.ceil(Et(s,1e-6,1)*r)*(1/r)}}var Mh=(function(){var r=11,s=1/(r-1);function u(S,b){return 1-3*b+3*S}function p(S,b){return 3*b-6*S}function d(S){return 3*S}function f(S,b,T){return((u(b,T)*S+p(b,T))*S+d(b))*S}function x(S,b,T){return 3*u(b,T)*S*S+2*p(b,T)*S+d(b)}function y(S,b,T,_,z){var R,P,I=0;do P=b+(T-b)/2,R=f(P,_,z)-S,R>0?T=P:b=P;while(Math.abs(R)>1e-7&&++I<10);return P}function g(S,b,T,_){for(var z=0;z<4;++z){var R=x(b,T,_);if(R===0)return b;var P=f(b,T,_)-S;b-=P/R}return b}function j(S,b,T,_){if(!(0<=S&&S<=1&&0<=T&&T<=1))return;var z=new Float32Array(r);if(S!==b||T!==_)for(var R=0;R<r;++R)z[R]=f(R*s,S,T);function P(I){for(var O=0,U=1,W=r-1;U!==W&&z[U]<=I;++U)O+=s;--U;var $=(I-z[U])/(z[U+1]-z[U]),H=O+$*s,K=x(H,S,T);return K>=.001?g(I,H,S,T):K===0?H:y(I,O,O+s,S,T)}return function(I){return S===b&&T===_||I===0||I===1?I:f(P(I),b,_)}}return j})(),ad=(function(){var r={linear:function(){return function(p){return p}}},s={Sine:function(){return function(p){return 1-Math.cos(p*Math.PI/2)}},Expo:function(){return function(p){return p?Math.pow(2,10*p-10):0}},Circ:function(){return function(p){return 1-Math.sqrt(1-p*p)}},Back:function(){return function(p){return p*p*(3*p-2)}},Bounce:function(){return function(p){for(var d,f=4;p<((d=Math.pow(2,--f))-1)/11;);return 1/Math.pow(4,3-f)-7.5625*Math.pow((d*3-2)/22-p,2)}},Elastic:function(p,d){p===void 0&&(p=1),d===void 0&&(d=.5);var f=Et(p,1,10),x=Et(d,.1,2);return function(y){return y===0||y===1?y:-f*Math.pow(2,10*(y-1))*Math.sin((y-1-x/(Math.PI*2)*Math.asin(1/f))*(Math.PI*2)/x)}}},u=["Quad","Cubic","Quart","Quint"];return u.forEach(function(p,d){s[p]=function(){return function(f){return Math.pow(f,d+2)}}}),Object.keys(s).forEach(function(p){var d=s[p];r["easeIn"+p]=d,r["easeOut"+p]=function(f,x){return function(y){return 1-d(f,x)(1-y)}},r["easeInOut"+p]=function(f,x){return function(y){return y<.5?d(f,x)(y*2)/2:1-d(f,x)(y*-2+2)/2}},r["easeOutIn"+p]=function(f,x){return function(y){return y<.5?(1-d(f,x)(1-y*2))/2:(d(f,x)(y*2-1)+1)/2}}}),r})();function hs(r,s){if(ie.fnc(r))return r;var u=r.split("(")[0],p=ad[u],d=ld(r);switch(u){case"spring":return sd(r,s);case"cubicBezier":return as(Mh,d);case"steps":return as(Rh,d);default:return as(p,d)}}function ud(r){try{var s=document.querySelectorAll(r);return s}catch{return}}function ii(r,s){for(var u=r.length,p=arguments.length>=2?arguments[1]:void 0,d=[],f=0;f<u;f++)if(f in r){var x=r[f];s.call(p,x,f,r)&&d.push(x)}return d}function li(r){return r.reduce(function(s,u){return s.concat(ie.arr(u)?li(u):u)},[])}function Mc(r){return ie.arr(r)?r:(ie.str(r)&&(r=ud(r)||r),r instanceof NodeList||r instanceof HTMLCollection?[].slice.call(r):[r])}function xs(r,s){return r.some(function(u){return u===s})}function ys(r){var s={};for(var u in r)s[u]=r[u];return s}function us(r,s){var u=ys(r);for(var p in r)u[p]=s.hasOwnProperty(p)?s[p]:r[p];return u}function si(r,s){var u=ys(r);for(var p in s)u[p]=ie.und(r[p])?s[p]:r[p];return u}function Fh(r){var s=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(r);return s?"rgba("+s[1]+",1)":r}function Ih(r){var s=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,u=r.replace(s,function(y,g,j,S){return g+g+j+j+S+S}),p=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(u),d=parseInt(p[1],16),f=parseInt(p[2],16),x=parseInt(p[3],16);return"rgba("+d+","+f+","+x+",1)"}function $h(r){var s=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(r)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(r),u=parseInt(s[1],10)/360,p=parseInt(s[2],10)/100,d=parseInt(s[3],10)/100,f=s[4]||1;function x(T,_,z){return z<0&&(z+=1),z>1&&(z-=1),z<1/6?T+(_-T)*6*z:z<1/2?_:z<2/3?T+(_-T)*(2/3-z)*6:T}var y,g,j;if(p==0)y=g=j=d;else{var S=d<.5?d*(1+p):d+p-d*p,b=2*d-S;y=x(b,S,u+1/3),g=x(b,S,u),j=x(b,S,u-1/3)}return"rgba("+y*255+","+g*255+","+j*255+","+f+")"}function Nh(r){if(ie.rgb(r))return Fh(r);if(ie.hex(r))return Ih(r);if(ie.hsl(r))return $h(r)}function Wt(r){var s=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(s)return s[1]}function Oh(r){if(Dr(r,"translate")||r==="perspective")return"px";if(Dr(r,"rotate")||Dr(r,"skew"))return"deg"}function cs(r,s){return ie.fnc(r)?r(s.target,s.id,s.total):r}function Rt(r,s){return r.getAttribute(s)}function ms(r,s,u){var p=Wt(s);if(xs([u,"deg","rad","turn"],p))return s;var d=ti.CSS[s+u];if(!ie.und(d))return d;var f=100,x=document.createElement(r.tagName),y=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;y.appendChild(x),x.style.position="absolute",x.style.width=f+u;var g=f/x.offsetWidth;y.removeChild(x);var j=g*parseFloat(s);return ti.CSS[s+u]=j,j}function cd(r,s,u){if(s in r.style){var p=s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),d=r.style[s]||getComputedStyle(r).getPropertyValue(p)||"0";return u?ms(r,d,u):d}}function vs(r,s){if(ie.dom(r)&&!ie.inp(r)&&(!ie.nil(Rt(r,s))||ie.svg(r)&&r[s]))return"attribute";if(ie.dom(r)&&xs(Eh,s))return"transform";if(ie.dom(r)&&s!=="transform"&&cd(r,s))return"css";if(r[s]!=null)return"object"}function dd(r){if(ie.dom(r)){for(var s=r.style.transform||"",u=/(\w+)\(([^)]*)\)/g,p=new Map,d;d=u.exec(s);)p.set(d[1],d[2]);return p}}function Bh(r,s,u,p){var d=Dr(s,"scale")?1:0+Oh(s),f=dd(r).get(s)||d;return u&&(u.transforms.list.set(s,f),u.transforms.last=s),p?ms(r,f,p):f}function Ss(r,s,u,p){switch(vs(r,s)){case"transform":return Bh(r,s,p,u);case"css":return cd(r,s,u);case"attribute":return Rt(r,s);default:return r[s]||0}}function bs(r,s){var u=/^(\*=|\+=|-=)/.exec(r);if(!u)return r;var p=Wt(r)||0,d=parseFloat(s),f=parseFloat(r.replace(u[0],""));switch(u[0][0]){case"+":return d+f+p;case"-":return d-f+p;case"*":return d*f+p}}function pd(r,s){if(ie.col(r))return Nh(r);if(/\s/g.test(r))return r;var u=Wt(r),p=u?r.substr(0,r.length-u.length):r;return s?p+s:p}function ks(r,s){return Math.sqrt(Math.pow(s.x-r.x,2)+Math.pow(s.y-r.y,2))}function Dh(r){return Math.PI*2*Rt(r,"r")}function Wh(r){return Rt(r,"width")*2+Rt(r,"height")*2}function Ah(r){return ks({x:Rt(r,"x1"),y:Rt(r,"y1")},{x:Rt(r,"x2"),y:Rt(r,"y2")})}function fd(r){for(var s=r.points,u=0,p,d=0;d<s.numberOfItems;d++){var f=s.getItem(d);d>0&&(u+=ks(p,f)),p=f}return u}function Hh(r){var s=r.points;return fd(r)+ks(s.getItem(s.numberOfItems-1),s.getItem(0))}function gd(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return Dh(r);case"rect":return Wh(r);case"line":return Ah(r);case"polyline":return fd(r);case"polygon":return Hh(r)}}function Uh(r){var s=gd(r);return r.setAttribute("stroke-dasharray",s),s}function Vh(r){for(var s=r.parentNode;ie.svg(s)&&ie.svg(s.parentNode);)s=s.parentNode;return s}function hd(r,s){var u=s||{},p=u.el||Vh(r),d=p.getBoundingClientRect(),f=Rt(p,"viewBox"),x=d.width,y=d.height,g=u.viewBox||(f?f.split(" "):[0,0,x,y]);return{el:p,viewBox:g,x:g[0]/1,y:g[1]/1,w:x,h:y,vW:g[2],vH:g[3]}}function Qh(r,s){var u=ie.str(r)?ud(r)[0]:r,p=s||100;return function(d){return{property:d,el:u,svg:hd(u),totalLength:gd(u)*(p/100)}}}function Yh(r,s,u){function p(S){S===void 0&&(S=0);var b=s+S>=1?s+S:0;return r.el.getPointAtLength(b)}var d=hd(r.el,r.svg),f=p(),x=p(-1),y=p(1),g=u?1:d.w/d.vW,j=u?1:d.h/d.vH;switch(r.property){case"x":return(f.x-d.x)*g;case"y":return(f.y-d.y)*j;case"angle":return Math.atan2(y.y-x.y,y.x-x.x)*180/Math.PI}}function Fc(r,s){var u=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,p=pd(ie.pth(r)?r.totalLength:r,s)+"";return{original:p,numbers:p.match(u)?p.match(u).map(Number):[0],strings:ie.str(r)||s?p.split(u):[]}}function ws(r){var s=r?li(ie.arr(r)?r.map(Mc):Mc(r)):[];return ii(s,function(u,p,d){return d.indexOf(u)===p})}function xd(r){var s=ws(r);return s.map(function(u,p){return{target:u,id:p,total:s.length,transforms:{list:dd(u)}}})}function Jh(r,s){var u=ys(s);if(/^spring/.test(u.easing)&&(u.duration=sd(u.easing)),ie.arr(r)){var p=r.length,d=p===2&&!ie.obj(r[0]);d?r={value:r}:ie.fnc(s.duration)||(u.duration=s.duration/p)}var f=ie.arr(r)?r:[r];return f.map(function(x,y){var g=ie.obj(x)&&!ie.pth(x)?x:{value:x};return ie.und(g.delay)&&(g.delay=y?0:s.delay),ie.und(g.endDelay)&&(g.endDelay=y===f.length-1?s.endDelay:0),g}).map(function(x){return si(x,u)})}function Kh(r){for(var s=ii(li(r.map(function(f){return Object.keys(f)})),function(f){return ie.key(f)}).reduce(function(f,x){return f.indexOf(x)<0&&f.push(x),f},[]),u={},p=function(f){var x=s[f];u[x]=r.map(function(y){var g={};for(var j in y)ie.key(j)?j==x&&(g.value=y[j]):g[j]=y[j];return g})},d=0;d<s.length;d++)p(d);return u}function Gh(r,s){var u=[],p=s.keyframes;p&&(s=si(Kh(p),s));for(var d in s)ie.key(d)&&u.push({name:d,tweens:Jh(s[d],r)});return u}function Xh(r,s){var u={};for(var p in r){var d=cs(r[p],s);ie.arr(d)&&(d=d.map(function(f){return cs(f,s)}),d.length===1&&(d=d[0])),u[p]=d}return u.duration=parseFloat(u.duration),u.delay=parseFloat(u.delay),u}function Zh(r,s){var u;return r.tweens.map(function(p){var d=Xh(p,s),f=d.value,x=ie.arr(f)?f[1]:f,y=Wt(x),g=Ss(s.target,r.name,y,s),j=u?u.to.original:g,S=ie.arr(f)?f[0]:j,b=Wt(S)||Wt(g),T=y||b;return ie.und(x)&&(x=j),d.from=Fc(S,T),d.to=Fc(bs(x,S),T),d.start=u?u.end:0,d.end=d.start+d.delay+d.duration+d.endDelay,d.easing=hs(d.easing,d.duration),d.isPath=ie.pth(f),d.isPathTargetInsideSVG=d.isPath&&ie.svg(s.target),d.isColor=ie.col(d.from.original),d.isColor&&(d.round=1),u=d,d})}var yd={css:function(r,s,u){return r.style[s]=u},attribute:function(r,s,u){return r.setAttribute(s,u)},object:function(r,s,u){return r[s]=u},transform:function(r,s,u,p,d){if(p.list.set(s,u),s===p.last||d){var f="";p.list.forEach(function(x,y){f+=y+"("+x+") "}),r.style.transform=f}}};function md(r,s){var u=xd(r);u.forEach(function(p){for(var d in s){var f=cs(s[d],p),x=p.target,y=Wt(f),g=Ss(x,d,y,p),j=y||Wt(g),S=bs(pd(f,j),g),b=vs(x,d);yd[b](x,d,S,p.transforms,!0)}})}function qh(r,s){var u=vs(r.target,s.name);if(u){var p=Zh(s,r),d=p[p.length-1];return{type:u,property:s.name,animatable:r,tweens:p,duration:d.end,delay:p[0].delay,endDelay:d.endDelay}}}function ex(r,s){return ii(li(r.map(function(u){return s.map(function(p){return qh(u,p)})})),function(u){return!ie.und(u)})}function vd(r,s){var u=r.length,p=function(f){return f.timelineOffset?f.timelineOffset:0},d={};return d.duration=u?Math.max.apply(Math,r.map(function(f){return p(f)+f.duration})):s.duration,d.delay=u?Math.min.apply(Math,r.map(function(f){return p(f)+f.delay})):s.delay,d.endDelay=u?d.duration-Math.max.apply(Math,r.map(function(f){return p(f)+f.duration-f.endDelay})):s.endDelay,d}var Ic=0;function tx(r){var s=us(id,r),u=us(gs,r),p=Gh(u,r),d=xd(r.targets),f=ex(d,p),x=vd(f,u),y=Ic;return Ic++,si(s,{id:y,children:[],animatables:d,animations:f,duration:x.duration,delay:x.delay,endDelay:x.endDelay})}var Ct=[],Sd=(function(){var r;function s(){!r&&(!$c()||!ge.suspendWhenDocumentHidden)&&Ct.length>0&&(r=requestAnimationFrame(u))}function u(d){for(var f=Ct.length,x=0;x<f;){var y=Ct[x];y.paused?(Ct.splice(x,1),f--):(y.tick(d),x++)}r=x>0?requestAnimationFrame(u):void 0}function p(){ge.suspendWhenDocumentHidden&&($c()?r=cancelAnimationFrame(r):(Ct.forEach(function(d){return d._onDocumentVisibility()}),Sd()))}return typeof document<"u"&&document.addEventListener("visibilitychange",p),s})();function $c(){return!!document&&document.hidden}function ge(r){r===void 0&&(r={});var s=0,u=0,p=0,d,f=0,x=null;function y(O){var U=window.Promise&&new Promise(function(W){return x=W});return O.finished=U,U}var g=tx(r);y(g);function j(){var O=g.direction;O!=="alternate"&&(g.direction=O!=="normal"?"normal":"reverse"),g.reversed=!g.reversed,d.forEach(function(U){return U.reversed=g.reversed})}function S(O){return g.reversed?g.duration-O:O}function b(){s=0,u=S(g.currentTime)*(1/ge.speed)}function T(O,U){U&&U.seek(O-U.timelineOffset)}function _(O){if(g.reversePlayback)for(var W=f;W--;)T(O,d[W]);else for(var U=0;U<f;U++)T(O,d[U])}function z(O){for(var U=0,W=g.animations,$=W.length;U<$;){var H=W[U],K=H.animatable,V=H.tweens,G=V.length-1,Y=V[G];G&&(Y=ii(V,function(ye){return O<ye.end})[0]||Y);for(var ce=Et(O-Y.start-Y.delay,0,Y.duration)/Y.duration,Se=isNaN(ce)?1:Y.easing(ce),ve=Y.to.strings,Ee=Y.round,Ne=[],Re=Y.to.numbers.length,xe=void 0,J=0;J<Re;J++){var ee=void 0,X=Y.to.numbers[J],w=Y.from.numbers[J]||0;Y.isPath?ee=Yh(Y.value,Se*X,Y.isPathTargetInsideSVG):ee=w+Se*(X-w),Ee&&(Y.isColor&&J>2||(ee=Math.round(ee*Ee)/Ee)),Ne.push(ee)}var N=ve.length;if(!N)xe=Ne[0];else{xe=ve[0];for(var le=0;le<N;le++){ve[le];var de=ve[le+1],pe=Ne[le];isNaN(pe)||(de?xe+=pe+de:xe+=pe+" ")}}yd[H.type](K.target,H.property,xe,K.transforms),H.currentValue=xe,U++}}function R(O){g[O]&&!g.passThrough&&g[O](g)}function P(){g.remaining&&g.remaining!==!0&&g.remaining--}function I(O){var U=g.duration,W=g.delay,$=U-g.endDelay,H=S(O);g.progress=Et(H/U*100,0,100),g.reversePlayback=H<g.currentTime,d&&_(H),!g.began&&g.currentTime>0&&(g.began=!0,R("begin")),!g.loopBegan&&g.currentTime>0&&(g.loopBegan=!0,R("loopBegin")),H<=W&&g.currentTime!==0&&z(0),(H>=$&&g.currentTime!==U||!U)&&z(U),H>W&&H<$?(g.changeBegan||(g.changeBegan=!0,g.changeCompleted=!1,R("changeBegin")),R("change"),z(H)):g.changeBegan&&(g.changeCompleted=!0,g.changeBegan=!1,R("changeComplete")),g.currentTime=Et(H,0,U),g.began&&R("update"),O>=U&&(u=0,P(),g.remaining?(s=p,R("loopComplete"),g.loopBegan=!1,g.direction==="alternate"&&j()):(g.paused=!0,g.completed||(g.completed=!0,R("loopComplete"),R("complete"),!g.passThrough&&"Promise"in window&&(x(),y(g)))))}return g.reset=function(){var O=g.direction;g.passThrough=!1,g.currentTime=0,g.progress=0,g.paused=!0,g.began=!1,g.loopBegan=!1,g.changeBegan=!1,g.completed=!1,g.changeCompleted=!1,g.reversePlayback=!1,g.reversed=O==="reverse",g.remaining=g.loop,d=g.children,f=d.length;for(var U=f;U--;)g.children[U].reset();(g.reversed&&g.loop!==!0||O==="alternate"&&g.loop===1)&&g.remaining++,z(g.reversed?g.duration:0)},g._onDocumentVisibility=b,g.set=function(O,U){return md(O,U),g},g.tick=function(O){p=O,s||(s=p),I((p+(u-s))*ge.speed)},g.seek=function(O){I(S(O))},g.pause=function(){g.paused=!0,b()},g.play=function(){g.paused&&(g.completed&&g.reset(),g.paused=!1,Ct.push(g),b(),Sd())},g.reverse=function(){j(),g.completed=!g.reversed,b()},g.restart=function(){g.reset(),g.play()},g.remove=function(O){var U=ws(O);bd(U,g)},g.reset(),g.autoplay&&g.play(),g}function Nc(r,s){for(var u=s.length;u--;)xs(r,s[u].animatable.target)&&s.splice(u,1)}function bd(r,s){var u=s.animations,p=s.children;Nc(r,u);for(var d=p.length;d--;){var f=p[d],x=f.animations;Nc(r,x),!x.length&&!f.children.length&&p.splice(d,1)}!u.length&&!p.length&&s.pause()}function nx(r){for(var s=ws(r),u=Ct.length;u--;){var p=Ct[u];bd(s,p)}}function rx(r,s){s===void 0&&(s={});var u=s.direction||"normal",p=s.easing?hs(s.easing):null,d=s.grid,f=s.axis,x=s.from||0,y=x==="first",g=x==="center",j=x==="last",S=ie.arr(r),b=parseFloat(S?r[0]:r),T=S?parseFloat(r[1]):0,_=Wt(S?r[1]:r)||0,z=s.start||0+(S?b:0),R=[],P=0;return function(I,O,U){if(y&&(x=0),g&&(x=(U-1)/2),j&&(x=U-1),!R.length){for(var W=0;W<U;W++){if(!d)R.push(Math.abs(x-W));else{var $=g?(d[0]-1)/2:x%d[0],H=g?(d[1]-1)/2:Math.floor(x/d[0]),K=W%d[0],V=Math.floor(W/d[0]),G=$-K,Y=H-V,ce=Math.sqrt(G*G+Y*Y);f==="x"&&(ce=-G),f==="y"&&(ce=-Y),R.push(ce)}P=Math.max.apply(Math,R)}p&&(R=R.map(function(ve){return p(ve/P)*P})),u==="reverse"&&(R=R.map(function(ve){return f?ve<0?ve*-1:-ve:Math.abs(P-ve)}))}var Se=S?(T-b)/P:b;return z+Se*(Math.round(R[O]*100)/100)+_}}function ox(r){r===void 0&&(r={});var s=ge(r);return s.duration=0,s.add=function(u,p){var d=Ct.indexOf(s),f=s.children;d>-1&&Ct.splice(d,1);function x(T){T.passThrough=!0}for(var y=0;y<f.length;y++)x(f[y]);var g=si(u,us(gs,r));g.targets=g.targets||r.targets;var j=s.duration;g.autoplay=!1,g.direction=s.direction,g.timelineOffset=ie.und(p)?j:bs(p,j),x(s),s.seek(g.timelineOffset);var S=ge(g);x(S),f.push(S);var b=vd(f,r);return s.delay=b.delay,s.endDelay=b.endDelay,s.duration=b.duration,s.seek(0),s.reset(),s.autoplay&&s.play(),s},s}ge.version="3.2.1";ge.speed=1;ge.suspendWhenDocumentHidden=!0;ge.running=Ct;ge.remove=nx;ge.get=Ss;ge.set=md;ge.convertPx=ms;ge.path=Qh;ge.setDashoffset=Uh;ge.stagger=rx;ge.timeline=ox;ge.easing=hs;ge.penner=ad;ge.random=function(r,s){return Math.floor(Math.random()*(s-r+1))+r};function ix({tabs:r,activeTab:s,onTabChange:u,tabRefs:p,indicatorRef:d}){return L.useEffect(()=>{const f=p.current[s];if(f&&d.current){const{offsetLeft:x,offsetWidth:y}=f;ge({targets:d.current,left:x,width:y,duration:400,easing:"easeOutExpo"})}},[s,p,d]),l.jsxs("div",{style:{position:"relative",display:"flex",flex:1},children:[r.map(f=>l.jsxs("button",{type:"button",ref:x=>{x&&(p.current[f.id]=x)},"data-tour":f.id==="traffic"?"traffic-tab":f.id==="logs"?"logs-tab":f.id==="setup"?"setup-tab":f.id==="playground"?"playground-tab":"smart-scan-tab",onClick:()=>u(f.id),style:{padding:"14px 24px",background:s===f.id?o.bgSecondary:"transparent",border:"none",borderBottom:"3px solid transparent",color:s===f.id?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:s===f.id?"600":"400",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",position:"relative",borderRadius:"8px 8px 0 0",zIndex:1},onMouseEnter:x=>{s!==f.id&&ge({targets:x.currentTarget,background:o.bgHover,color:o.textPrimary,duration:200,easing:"easeOutQuad"})},onMouseLeave:x=>{s!==f.id&&ge({targets:x.currentTarget,background:"transparent",color:o.textSecondary,duration:200,easing:"easeOutQuad"})},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("div",{style:{display:"flex",alignItems:"center",color:"currentColor"},children:l.jsx(f.icon,{size:16})}),l.jsx("span",{children:f.label})]}),l.jsx("div",{style:{fontSize:"11px",color:s===f.id?o.textSecondary:o.textTertiary,fontWeight:"400",fontFamily:v.body},children:f.description})]},f.id)),l.jsx("div",{ref:d,style:{position:"absolute",bottom:0,height:"3px",background:o.accentBlue,borderRadius:"3px 3px 0 0",zIndex:2,pointerEvents:"none"}})]})}const lx=({size:r=16,color:s="currentColor"})=>l.jsx(Gc,{size:r,stroke:1.5,color:s}),sx=({size:r=16,color:s="currentColor"})=>l.jsx(rg,{size:r,stroke:1.5,color:s}),ax=({size:r=16,color:s="currentColor"})=>l.jsx(vg,{size:r,stroke:1.5,color:s}),ux=({size:r=16,color:s="currentColor"})=>l.jsx(Uf,{size:r,stroke:1.5,color:s}),cx=({size:r=16,color:s="currentColor"})=>l.jsx(Zc,{size:r,stroke:1.5,color:s}),dx=({size:r=16,color:s="currentColor"})=>l.jsx(ug,{size:r,stroke:1.5,color:s}),px=({size:r=16,color:s="currentColor"})=>l.jsx(ps,{size:r,stroke:1.5,color:s});function fx({tabs:r,activeTab:s,onTabChange:u,isDropdownOpen:p,setIsDropdownOpen:d,dropdownRef:f}){return l.jsxs("div",{style:{position:"relative",flex:1,display:"flex",justifyContent:"flex-end"},ref:f,children:[l.jsxs("button",{type:"button",onClick:()=>d(!p),style:{display:"flex",alignItems:"center",gap:"8px",padding:"10px 16px",background:p?o.bgSecondary:"transparent",border:"none",borderRadius:"8px",color:o.textPrimary,cursor:"pointer",fontSize:"14px",fontFamily:v.body,fontWeight:"500"},onMouseEnter:x=>{p||(x.currentTarget.style.background=o.bgHover)},onMouseLeave:x=>{p||(x.currentTarget.style.background="transparent")},children:[l.jsx(dx,{size:18,color:o.textPrimary}),l.jsx("span",{children:r.find(x=>x.id===s)?.label||"Menu"}),l.jsx("div",{style:{transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",display:"flex",alignItems:"center"},children:l.jsx(px,{size:14,color:o.textPrimary})})]}),p&&l.jsx("div",{style:{position:"absolute",top:"100%",right:0,marginTop:"8px",background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",boxShadow:`0 4px 12px ${o.shadowSm}`,minWidth:"280px",zIndex:1e3,overflow:"hidden"},children:r.map(x=>{const y=x.icon;return l.jsxs("button",{type:"button",onClick:()=>{u(x.id),d(!1)},style:{width:"100%",padding:"14px 16px",background:s===x.id?o.bgSecondary:"transparent",border:"none",borderLeft:s===x.id?`3px solid ${o.accentBlue}`:"3px solid transparent",color:s===x.id?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:s===x.id?"600":"400",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",textAlign:"left",transition:"all 0.2s"},onMouseEnter:g=>{s!==x.id&&(g.currentTarget.style.background=o.bgHover,g.currentTarget.style.color=o.textPrimary)},onMouseLeave:g=>{s!==x.id&&(g.currentTarget.style.background="transparent",g.currentTarget.style.color=o.textSecondary)},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",width:"100%"},children:[l.jsx("div",{style:{display:"flex",alignItems:"center",color:"currentColor"},children:l.jsx(y,{size:16})}),l.jsx("span",{style:{flex:1},children:x.label})]}),l.jsx("div",{style:{fontSize:"11px",color:s===x.id?o.textSecondary:o.textTertiary,fontWeight:"400",fontFamily:v.body,marginLeft:"26px"},children:x.description})]},x.id)})})]})}function gx({activeTab:r,onTabChange:s}){const u=[{id:"traffic",label:"Traffic Capture",icon:lx,description:"Wireshark-like HTTP request/response analysis for forensic investigation"},{id:"logs",label:"MCP Shark Logs",icon:sx,description:"View MCP Shark server console output and debug logs"},{id:"setup",label:"MCP Server Setup",icon:ax,description:"Configure and manage MCP Shark server"},{id:"playground",label:"MCP Playground",icon:ux,description:"Test and interact with MCP tools, prompts, and resources"},{id:"smart-scan",label:"Smart Scan",icon:cx,description:"AI-powered security analysis for MCP servers"}],p=L.useRef({}),d=L.useRef(null),[f,x]=L.useState(!1),[y,g]=L.useState(!1),j=L.useRef(null);return L.useEffect(()=>{const S=()=>{x(window.innerWidth<1200)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]),L.useEffect(()=>{const S=b=>{j.current&&!j.current.contains(b.target)&&g(!1)};return y&&document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)}},[y]),l.jsx("div",{style:{borderBottom:`1px solid ${o.borderLight}`,background:o.bgCard,boxShadow:`0 1px 3px ${o.shadowSm}`},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 16px",gap:"12px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",paddingRight:"12px",borderRight:`1px solid ${o.borderLight}`},children:[l.jsx(zh,{size:24}),l.jsx("span",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:"MCP Shark"})]}),f?l.jsx(fx,{tabs:u,activeTab:r,onTabChange:s,isDropdownOpen:y,setIsDropdownOpen:g,dropdownRef:j}):l.jsx(ix,{tabs:u,activeTab:r,onTabChange:s,tabRefs:p,indicatorRef:d})]})})}const hx=({size:r=16,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"Tour icon",children:[l.jsx("title",{children:"Tour icon"}),l.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),l.jsx("path",{d:"M2 17l10 5 10-5"}),l.jsx("path",{d:"M2 12l10 5 10-5"})]});function xx({onClick:r}){return l.jsx("button",{type:"button",onClick:r,"data-tour":"help-button",style:{position:"fixed",bottom:"20px",right:"20px",background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"50%",width:"48px",height:"48px",padding:0,color:o.textSecondary,cursor:"pointer",fontFamily:v.body,boxShadow:`0 4px 12px ${o.shadowMd}`,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,transition:"all 0.2s ease"},onMouseEnter:s=>{s.currentTarget.style.background=o.bgHover,s.currentTarget.style.color=o.textPrimary,s.currentTarget.style.borderColor=o.borderMedium,s.currentTarget.style.transform="scale(1.1)",s.currentTarget.style.boxShadow=`0 6px 16px ${o.shadowLg}`},onMouseLeave:s=>{s.currentTarget.style.background=o.bgCard,s.currentTarget.style.color=o.textSecondary,s.currentTarget.style.borderColor=o.borderLight,s.currentTarget.style.transform="scale(1)",s.currentTarget.style.boxShadow=`0 4px 12px ${o.shadowMd}`},title:"Start tour",children:l.jsx(hx,{size:20})})}const yx=({size:r=12,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle",marginRight:"4px"},role:"img","aria-label":"Chevron icon",children:[l.jsx("title",{children:"Chevron icon"}),l.jsx("polyline",{points:"6 9 12 15 18 9"})]});function un({title:r,children:s,titleColor:u=o.accentBlue,defaultExpanded:p=!0}){const[d,f]=L.useState(p);return l.jsxs("div",{style:{marginBottom:"16px"},children:[l.jsxs("button",{type:"button",style:{color:u,fontWeight:"600",fontFamily:v.body,fontSize:"12px",marginBottom:"8px",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",gap:"6px",padding:"4px 0",transition:"color 0.15s ease",background:"transparent",border:"none",textAlign:"left",width:"100%"},onClick:()=>f(!d),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),f(!d))},onMouseEnter:x=>{x.currentTarget.style.color=u===o.accentBlue?o.accentBlueHover:u},onMouseLeave:x=>{x.currentTarget.style.color=u},children:[l.jsx("span",{style:{transform:d?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease",display:"inline-block"},children:l.jsx(yx,{size:12,color:u})}),r]}),d&&l.jsx("div",{style:{paddingLeft:"20px",color:o.textPrimary,fontFamily:v.body,fontSize:"12px",lineHeight:"1.6"},children:s})]})}function kd({body:r,title:s,titleColor:u}){return r?l.jsx(un,{title:s||"Body",titleColor:u,children:l.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:v.mono,maxHeight:"400px",border:`1px solid ${o.borderLight}`,color:o.textPrimary,lineHeight:"1.5"},children:typeof r=="object"?JSON.stringify(r,null,2):r})}):null}function wd({title:r,titleColor:s,children:u,defaultExpanded:p=!0}){const[d,f]=L.useState(p);return l.jsxs("div",{style:{background:o.bgCard,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden",marginBottom:"20px"},children:[l.jsx("button",{type:"button",onClick:()=>f(!d),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),f(!d))},"aria-label":`Toggle ${r} section`,style:{padding:"16px 20px",background:d?o.bgCard:o.bgSecondary,borderBottom:d?`1px solid ${o.borderLight}`:"none",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.15s ease",width:"100%",border:"none",textAlign:"left"},onMouseEnter:x=>{x.currentTarget.style.background=o.bgHover},onMouseLeave:x=>{x.currentTarget.style.background=d?o.bgCard:o.bgSecondary},children:l.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:s,textTransform:"uppercase",letterSpacing:"0.05em",fontFamily:v.body,display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(ps,{size:14,stroke:1.5,style:{transform:d?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease"}}),r]})}),d&&l.jsx("div",{style:{padding:"20px"},children:u})]})}function jd({headers:r,titleColor:s}){return!r||Object.keys(r).length===0?null:l.jsx(un,{title:"Headers",children:Object.entries(r).map(([u,p])=>l.jsxs("div",{style:{marginBottom:"6px",fontSize:"12px",fontFamily:v.body},children:[l.jsxs("span",{style:{color:s,fontWeight:"500",fontFamily:v.mono},children:[u,":"]})," ",l.jsx("span",{style:{color:o.textPrimary},children:String(p)})]},u))})}function Cd(r){const s=[],u=new Set,p=(d,f)=>{if(!(d.session_id===f.session_id))return!1;const y=ni(d),g=ni(f);return!y||!g?d.jsonrpc_id&&f.jsonrpc_id?d.jsonrpc_id===f.jsonrpc_id:!1:y===g?d.jsonrpc_id&&f.jsonrpc_id?d.jsonrpc_id===f.jsonrpc_id:!0:!1};return r.forEach(d=>{if(!u.has(d.frame_number))if(d.direction==="request"){const f=r.find(x=>x.direction==="response"&&!u.has(x.frame_number)&&p(d,x)&&x.frame_number>d.frame_number);f?(s.push({request:d,response:f,frame_number:d.frame_number}),u.add(d.frame_number),u.add(f.frame_number)):(s.push({request:d,response:null,frame_number:d.frame_number}),u.add(d.frame_number))}else d.direction==="response"&&(r.find(x=>x.direction==="request"&&!u.has(x.frame_number)&&p(x,d)&&x.frame_number<d.frame_number)||(s.push({request:null,response:d,frame_number:d.frame_number}),u.add(d.frame_number)))}),s.sort((d,f)=>f.frame_number-d.frame_number)}const Oc="LLM Server";function js(r,s){return s?((new Date(r)-new Date(s))/1e3).toFixed(6):"0.000000"}function Cs(r){if(!r)return"-";try{return new Date(r).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return r}}function Ts(r){return r.direction==="request"?{source:Oc,dest:r.remote_address||"Unknown MCP Client"}:{source:r.remote_address||"Unknown MCP Server",dest:Oc}}function ai(r){if(r.direction==="request"){if(r.body_json)try{const s=typeof r.body_json=="string"?JSON.parse(r.body_json):r.body_json;if(s&&typeof s=="object"&&s.method)return s.method}catch{}if(r.body_raw)try{const s=typeof r.body_raw=="string"?JSON.parse(r.body_raw):r.body_raw;if(s&&typeof s=="object"&&s.method)return s.method}catch{}if(r.jsonrpc_method)return r.jsonrpc_method;if(r.url)try{const s=new URL(r.url);return s.pathname+(s.search||"")}catch{const u=r.url,p=u.match(/^https?:\/\/[^\/]+(\/.*)$/);return p?p[1]:u}}return"-"}function mx(r){if(r.direction==="request"){const p=ai(r),d=r.method||"",f=r.url||"";return p&&p!=="-"?d&&f?`${d} ${p}`:d?`${d} ${p}`:p:d&&f?`${d} ${f}`:d||f||"Request"}const s=r.status_code||"",u=r.jsonrpc_method||ni(r);return s&&u?`${s} ${u}`:s?`Status: ${s}`:u||"Response"}function ni(r){if(r.jsonrpc_method)return r.jsonrpc_method;if(r.direction==="request"){if(r.body_json)try{const s=typeof r.body_json=="string"?JSON.parse(r.body_json):r.body_json;if(s&&typeof s=="object"&&s.method)return s.method}catch{}if(r.body_raw)try{const s=typeof r.body_raw=="string"?JSON.parse(r.body_raw):r.body_raw;if(s&&typeof s=="object"&&s.method)return s.method}catch{}}if(r.direction==="response"&&r.body_json)try{const s=typeof r.body_json=="string"?JSON.parse(r.body_json):r.body_json}catch{}return null}function Td({data:r,titleColor:s}){if(!r)return null;const u=mx(r);return l.jsx(un,{title:"Info",titleColor:s,defaultExpanded:!1,children:l.jsx("div",{style:{background:o.bgSecondary,padding:"12px 16px",borderRadius:"6px",border:`1px solid ${o.borderLight}`,fontFamily:v.mono,fontSize:"12px",color:s,wordBreak:"break-word"},children:u})})}function Pd({data:r,showUserAgent:s=!1}){return l.jsxs(un,{title:"Network Information",children:[l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Remote Address:"," ",l.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.remote_address||"N/A"})]}),l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Host:"," ",l.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.host||"N/A"})]}),s&&r.user_agent&&l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["User Agent:"," ",l.jsx("span",{style:{color:o.textSecondary,fontSize:"11px"},children:r.user_agent})]}),r.session_id&&l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Session ID:"," ",l.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.session_id})]})]})}function _d({data:r,titleColor:s}){return l.jsxs(un,{title:`${r.protocol||"HTTP"} Protocol`,children:[l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Direction: ",l.jsx("span",{style:{color:s,fontWeight:"500"},children:r.direction})]}),r.status_code&&l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Status Code:"," ",l.jsx("span",{style:{color:r.status_code>=400?o.error:r.status_code>=300?o.warning:o.success,fontFamily:v.mono,fontWeight:"600"},children:r.status_code})]}),r.jsonrpc_method&&l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["JSON-RPC Method:"," ",l.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.jsonrpc_method})]}),r.jsonrpc_id&&l.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["JSON-RPC ID:"," ",l.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.jsonrpc_id})]})]})}function vx({request:r,requestHeaders:s,requestBody:u}){return r?l.jsxs(wd,{title:"Request",titleColor:o.accentBlue,defaultExpanded:!0,children:[l.jsx(Td,{data:r,titleColor:o.accentBlue}),l.jsx(Pd,{data:r,showUserAgent:!0}),l.jsx(_d,{data:r,titleColor:o.accentBlue}),l.jsx(jd,{headers:s,titleColor:o.accentBlue}),l.jsx(kd,{body:u,titleColor:o.accentBlue}),r.jsonrpc_params&&l.jsx(un,{title:"JSON-RPC Params",titleColor:o.accentBlue,children:l.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:"monospace",maxHeight:"400px",border:`1px solid ${o.borderLight}`,color:o.textPrimary,lineHeight:"1.5"},children:JSON.stringify(JSON.parse(r.jsonrpc_params),null,2)})})]}):null}function Sx({response:r,responseHeaders:s,responseBody:u}){return r?l.jsxs(wd,{title:"Response",titleColor:o.accentGreen,defaultExpanded:!0,children:[l.jsx(Td,{data:r,titleColor:o.accentGreen}),l.jsx(Pd,{data:r}),l.jsx(_d,{data:r,titleColor:o.accentGreen}),l.jsx(jd,{headers:s,titleColor:o.accentGreen}),l.jsx(kd,{body:u,titleColor:o.accentGreen}),r.jsonrpc_result&&l.jsx(un,{title:"JSON-RPC Result",titleColor:o.accentGreen,children:l.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:v.mono,maxHeight:"400px",border:`1px solid ${o.borderLight}`,color:o.textPrimary,lineHeight:"1.5"},children:JSON.stringify(JSON.parse(r.jsonrpc_result),null,2)})}),r.jsonrpc_error&&l.jsx(un,{title:"JSON-RPC Error",titleColor:o.error,children:l.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:v.mono,maxHeight:"400px",border:`1px solid ${o.borderLight}`,color:o.error,lineHeight:"1.5"},children:JSON.stringify(JSON.parse(r.jsonrpc_error),null,2)})})]}):null}function bx({request:r,response:s,requestHeaders:u,requestBody:p,responseHeaders:d,responseBody:f}){return l.jsx("div",{style:{padding:"20px",overflow:"auto",flex:1,background:o.bgPrimary},children:l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[l.jsx(vx,{request:r,requestHeaders:u,requestBody:p}),l.jsx(Sx,{response:s,responseHeaders:d,responseBody:f})]})})}const kx=({size:r=14,color:s="currentColor",rotated:u=!1})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle",transform:u?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s ease"},role:"img","aria-label":"Chevron down icon",children:[l.jsx("title",{children:"Chevron down icon"}),l.jsx("polyline",{points:"6 9 12 15 18 9"})]});function Bc({title:r,titleColor:s,children:u,defaultExpanded:p=!0}){const[d,f]=L.useState(p);return l.jsxs("div",{style:{background:o.bgCard,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden",marginBottom:"20px"},children:[l.jsx("button",{type:"button",onClick:()=>f(!d),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),f(!d))},style:{padding:"16px 20px",background:d?o.bgCard:o.bgSecondary,borderBottom:d?`1px solid ${o.borderLight}`:"none",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.15s ease",width:"100%",border:"none",textAlign:"left"},onMouseEnter:x=>{x.currentTarget.style.background=o.bgHover},onMouseLeave:x=>{x.currentTarget.style.background=d?o.bgCard:o.bgSecondary},children:l.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:s,textTransform:"uppercase",letterSpacing:"0.05em",fontFamily:v.body,display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(kx,{size:14,color:s,rotated:!d}),r]})}),d&&l.jsx("div",{style:{padding:"20px"},children:u})]})}function wx({requestHexLines:r,responseHexLines:s,hasRequest:u,hasResponse:p}){return l.jsx("div",{style:{padding:"20px",overflow:"auto",flex:1,background:o.bgPrimary},children:l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[u&&l.jsx(Bc,{title:"Request Hex Dump",titleColor:o.accentBlue,defaultExpanded:!0,children:l.jsx("div",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",border:`1px solid ${o.borderLight}`,maxHeight:"calc(100vh - 300px)",overflow:"auto"},children:r.length>0?r.map((d,f)=>l.jsxs("div",{style:{display:"flex",gap:"16px",padding:"4px 0",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",lineHeight:"1.5"},children:[l.jsx("span",{style:{color:o.textTertiary,minWidth:"80px"},children:d.offset}),l.jsx("span",{style:{minWidth:"400px",color:o.textPrimary},children:d.hex.padEnd(48)}),l.jsx("span",{style:{color:o.textSecondary},children:d.ascii})]},`request-${d.offset}-${f}`)):l.jsx("div",{style:{color:o.textTertiary,fontFamily:v.body,fontSize:"12px"},children:"(empty)"})})}),p&&l.jsx(Bc,{title:"Response Hex Dump",titleColor:o.accentGreen,defaultExpanded:!0,children:l.jsx("div",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",border:`1px solid ${o.borderLight}`,maxHeight:"calc(100vh - 300px)",overflow:"auto"},children:s.length>0?s.map((d,f)=>l.jsxs("div",{style:{display:"flex",gap:"16px",padding:"4px 0",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",lineHeight:"1.5"},children:[l.jsx("span",{style:{color:o.textTertiary,minWidth:"80px"},children:d.offset}),l.jsx("span",{style:{minWidth:"400px",color:o.textPrimary},children:d.hex.padEnd(48)}),l.jsx("span",{style:{color:o.textSecondary},children:d.ascii})]},`response-${d.offset}-${f}`)):l.jsx("div",{style:{color:o.textTertiary,fontFamily:v.body,fontSize:"12px"},children:"(empty)"})})})]})})}function jx({request:r,onClose:s,matchingPair:u}){const p=d=>d<1024?`${d} B`:d<1048576?`${(d/1024).toFixed(2)} KB`:`${(d/1048576).toFixed(2)} MB`;return l.jsxs("div",{style:{padding:"12px 16px",borderBottom:`1px solid ${o.borderLight}`,display:"flex",justifyContent:"space-between",alignItems:"center",background:o.bgCard,boxShadow:`0 1px 3px ${o.shadowSm}`},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[l.jsxs("h3",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,margin:0,fontFamily:v.body},children:["#",r.frame_number,":"," ",r.direction==="request"?"HTTP Request":"HTTP Response",u&&l.jsxs("span",{style:{fontSize:"11px",color:o.textTertiary,fontWeight:"400",marginLeft:"8px"},children:["(with #",u.frame_number,")"]})]}),l.jsxs("span",{style:{fontSize:"11px",color:o.textSecondary,padding:"4px 8px",background:o.bgSecondary,borderRadius:"8px",fontFamily:v.mono},children:[p(r.length)," bytes"]})]}),l.jsx("button",{type:"button",onClick:s,style:{background:"none",border:"none",color:o.textSecondary,cursor:"pointer",fontSize:"20px",padding:"4px 8px",borderRadius:"8px",transition:"all 0.2s"},onMouseEnter:d=>{d.currentTarget.style.background=o.bgHover,d.currentTarget.style.color=o.textPrimary},onMouseLeave:d=>{d.currentTarget.style.background="none",d.currentTarget.style.color=o.textSecondary},children:l.jsx(qc,{size:20,stroke:1.5})})]})}const Cx=({size:r=14,color:s="currentColor",rotated:u=!1})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle",transform:u?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s ease"},role:"img","aria-label":"Chevron down icon",children:[l.jsx("title",{children:"Chevron down icon"}),l.jsx("polyline",{points:"6 9 12 15 18 9"})]});function Dc({title:r,titleColor:s,children:u,defaultExpanded:p=!0}){const[d,f]=L.useState(p);return l.jsxs("div",{style:{background:o.bgCard,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden",marginBottom:"20px"},children:[l.jsx("button",{type:"button",onClick:()=>f(!d),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),f(!d))},style:{padding:"16px 20px",background:d?o.bgCard:o.bgSecondary,borderBottom:d?`1px solid ${o.borderLight}`:"none",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.15s ease",width:"100%",border:"none",textAlign:"left"},onMouseEnter:x=>{x.currentTarget.style.background=o.bgHover},onMouseLeave:x=>{x.currentTarget.style.background=d?o.bgCard:o.bgSecondary},children:l.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:s,textTransform:"uppercase",letterSpacing:"0.05em",fontFamily:v.body,display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(Cx,{size:14,color:s,rotated:!d}),r]})}),d&&l.jsx("div",{style:{padding:"20px"},children:u})]})}function Tx({requestFullText:r,responseFullText:s,hasRequest:u,hasResponse:p}){return l.jsx("div",{style:{padding:"20px",overflow:"auto",flex:1,background:o.bgPrimary},children:l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[u&&l.jsx(Dc,{title:"Raw Request Data",titleColor:o.accentBlue,defaultExpanded:!0,children:l.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:v.mono,color:o.textPrimary,border:`1px solid ${o.borderLight}`,whiteSpace:"pre-wrap",wordBreak:"break-all",lineHeight:"1.5",maxHeight:"calc(100vh - 300px)"},children:r||"(empty)"})}),p&&l.jsx(Dc,{title:"Raw Response Data",titleColor:o.accentGreen,defaultExpanded:!0,children:l.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:v.mono,color:o.textPrimary,border:`1px solid ${o.borderLight}`,whiteSpace:"pre-wrap",wordBreak:"break-all",lineHeight:"1.5",maxHeight:"calc(100vh - 300px)"},children:s||"(empty)"})})]})})}function Px({tabs:r,activeTab:s,onTabChange:u}){const p=L.useRef({}),d=L.useRef(null);return L.useEffect(()=>{const f=p.current[s];if(f&&d.current){const{offsetLeft:x,offsetWidth:y}=f;ge({targets:d.current,left:x,width:y,duration:300,easing:"easeOutExpo"})}},[s]),l.jsxs("div",{style:{display:"flex",borderBottom:`1px solid ${o.borderLight}`,background:`${o.bgCard}CC`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",position:"relative",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[r.map(f=>l.jsx("button",{type:"button",ref:x=>{x&&(p.current[f]=x)},onClick:()=>u(f),style:{padding:"10px 18px",background:s===f?o.bgSecondary:"transparent",border:"none",borderBottom:"2px solid transparent",color:s===f?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:s===f?"500":"400",textTransform:"capitalize",borderRadius:"8px 8px 0 0",transition:"all 0.2s",position:"relative",zIndex:1},onMouseEnter:x=>{s!==f&&ge({targets:x.currentTarget,background:o.bgHover,color:o.textPrimary,duration:200,easing:"easeOutQuad"})},onMouseLeave:x=>{s!==f&&ge({targets:x.currentTarget,background:"transparent",color:o.textSecondary,duration:200,easing:"easeOutQuad"})},children:f},f)),l.jsx("div",{ref:d,style:{position:"absolute",bottom:0,height:"2px",background:o.accentBlue,borderRadius:"2px 2px 0 0",zIndex:2}})]})}const Wc=(r,s={})=>ge({targets:r,opacity:[0,1],translateY:[20,0],duration:s.duration||400,delay:ge.stagger(s.delay||50),easing:s.easing||"easeOutExpo",...s}),Ps=(r,s={})=>ge({targets:r,opacity:[0,1],duration:s.duration||300,easing:s.easing||"easeOutQuad",...s}),_x=(r,s={})=>ge({targets:r,translateX:[s.width||600,0],opacity:[0,1],duration:s.duration||400,easing:s.easing||"easeOutExpo",...s});function Ac(r){if(!r)return[];const s=new TextEncoder().encode(r),u=[],p=16,d=Math.ceil(s.length/p);for(const f of Array.from({length:d},(x,y)=>y)){const x=f*p,y=s.slice(x,x+p),g=Array.from(y).map(b=>b.toString(16).padStart(2,"0")).join(" "),j=Array.from(y).map(b=>b>=32&&b<127?String.fromCharCode(b):".").join(""),S=x.toString(16).padStart(8,"0");u.push({offset:S,hex:g,ascii:j})}return u}function Hc(r,s){return Object.entries(r).map(([p,d])=>`${p}: ${d}`).join(`\r
28
28
  `)+(s?`\r
29
29
  \r
30
- ${s}`:"")}function Lx({request:r,onClose:s,requests:u=[]}){const[p,d]=L.useState("details"),f=L.useRef(null),x=L.useRef(p);if(L.useEffect(()=>{x.current!==p&&f.current&&(Ps(f.current,{duration:300}),x.current=p)},[p]),!r)return null;const y=W=>{if(W.jsonrpc_method)return W.jsonrpc_method;if(W.direction==="request"){if(W.body_json)try{const $=typeof W.body_json=="string"?JSON.parse(W.body_json):W.body_json;if($&&typeof $=="object"&&$.method)return $.method}catch{}if(W.body_raw)try{const $=typeof W.body_raw=="string"?JSON.parse(W.body_raw):W.body_raw;if($&&typeof $=="object"&&$.method)return $.method}catch{}}return null},j=(()=>{const W=($,H)=>{if($.session_id!==H.session_id)return!1;const K=y($),V=y(H);return!K||!V?$.jsonrpc_id&&H.jsonrpc_id?$.jsonrpc_id===H.jsonrpc_id:!1:K!==V?!1:$.jsonrpc_id&&H.jsonrpc_id?$.jsonrpc_id===H.jsonrpc_id:!0};return r.direction==="request"?u.find($=>$.direction==="response"&&W(r,$)&&$.frame_number>r.frame_number):u.find($=>$.direction==="request"&&W($,r)&&$.frame_number<r.frame_number)})(),S=r.direction==="request"?r:j||r,b=r.direction==="response"?r:j,T=S?.headers_json?JSON.parse(S.headers_json):{},_=S?.body_json?JSON.parse(S.body_json):S?.body_raw,z=S?Hc(T,S.body_raw):"",R=S?Ac(z):[],P=b?.headers_json?JSON.parse(b.headers_json):{},I=b?.body_json?JSON.parse(b.body_json):b?.body_raw,O=b?Hc(P,b.body_raw):"",U=b?Ac(O):[];return l.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",background:o.bgPrimary},children:[l.jsx(jx,{request:r,onClose:s,matchingPair:j}),l.jsx(Px,{tabs:["details","hex","raw"],activeTab:p,onTabChange:d}),l.jsxs("div",{ref:f,style:{flex:1,overflow:"auto",background:o.bgPrimary},children:[p==="details"&&l.jsx(bx,{request:S,response:b,requestHeaders:T,requestBody:_,responseHeaders:P,responseBody:I}),p==="hex"&&l.jsx(wx,{requestHexLines:R,responseHexLines:U,hasRequest:!!S,hasResponse:!!b}),p==="raw"&&l.jsx(Tx,{requestFullText:z,responseFullText:O,hasRequest:!!S,hasResponse:!!b})]})]})}function zx({stats:r,onExport:s}){return l.jsxs("div",{style:{display:"flex",gap:"16px",alignItems:"center",marginLeft:"auto"},children:[r&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Total:"," ",l.jsx("span",{style:{color:o.textPrimary,fontWeight:"500"},children:r.total_packets||0})]}),l.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Requests:"," ",l.jsx("span",{style:{color:o.accentBlue,fontWeight:"500"},children:r.total_requests||0})]}),l.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Responses:"," ",l.jsx("span",{style:{color:o.accentGreen,fontWeight:"500"},children:r.total_responses||0})]}),l.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Errors:"," ",l.jsx("span",{style:{color:o.error,fontWeight:"500"},children:r.total_errors||0})]}),l.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Sessions:"," ",l.jsx("span",{style:{color:o.textPrimary,fontWeight:"500"},children:r.unique_sessions||0})]})]}),l.jsxs("div",{style:{display:"flex",gap:"6px",alignItems:"center",marginLeft:"12px",paddingLeft:"12px",borderLeft:`1px solid ${o.borderLight}`},children:[l.jsxs("button",{type:"button",onClick:()=>s("json"),style:{padding:"8px 14px",background:o.buttonPrimary,border:"none",color:o.textInverse,fontSize:"12px",fontFamily:v.body,fontWeight:"500",borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`},onMouseEnter:u=>{ge({targets:u.currentTarget,background:o.buttonPrimaryHover,translateY:-1,boxShadow:[`0 2px 4px ${o.shadowSm}`,`0 4px 8px ${o.shadowMd}`],duration:200,easing:"easeOutQuad"})},onMouseLeave:u=>{ge({targets:u.currentTarget,background:o.buttonPrimary,translateY:0,boxShadow:[`0 4px 8px ${o.shadowMd}`,`0 2px 4px ${o.shadowSm}`],duration:200,easing:"easeOutQuad"})},title:"Export as JSON",children:[l.jsx(Jc,{size:14,stroke:1.5}),"Export"]}),l.jsxs("select",{onChange:u=>s(u.target.value),value:"",style:{padding:"8px 10px",background:o.bgCard,border:`1px solid ${o.borderLight}`,color:o.textPrimary,fontSize:"11px",fontFamily:v.body,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s"},onFocus:u=>{u.currentTarget.style.borderColor=o.accentBlue},onBlur:u=>{u.currentTarget.style.borderColor=o.borderLight},children:[l.jsx("option",{value:"",disabled:!0,children:"Format"}),l.jsx("option",{value:"json",children:"JSON"}),l.jsx("option",{value:"csv",children:"CSV"}),l.jsx("option",{value:"txt",children:"TXT"})]})]})]})}function wn({type:r="text",placeholder:s,value:u,onChange:p,style:d={},...f}){const x={padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderLight}`,color:o.textPrimary,fontSize:"13px",fontFamily:r==="number"||s?.includes("JSON-RPC")||s?.includes("HTTP")?v.mono:v.body,borderRadius:"8px",transition:"all 0.2s",...d},y=j=>{ge({targets:j.currentTarget,borderColor:o.accentBlue,boxShadow:[`0 0 0 0px ${o.accentBlue}20`,`0 0 0 3px ${o.accentBlue}20`],duration:200,easing:"easeOutQuad"})},g=j=>{ge({targets:j.currentTarget,borderColor:o.borderLight,boxShadow:"none",duration:200,easing:"easeOutQuad"})};return l.jsx("input",{type:r,placeholder:s,value:u||"",onChange:p,style:x,onFocus:y,onBlur:g,...f})}function Ex({filters:r,onFilterChange:s,stats:u,onClear:p}){const d=L.useRef(null),[f,x]=L.useState(!1);L.useEffect(()=>{d.current&&Ps(d.current,{duration:400})},[]);const y=async(g="json")=>{try{const j=new URLSearchParams;r.search&&j.append("search",r.search),r.serverName&&j.append("serverName",r.serverName),r.sessionId&&j.append("sessionId",r.sessionId),r.method&&j.append("method",r.method),r.jsonrpcMethod&&j.append("jsonrpcMethod",r.jsonrpcMethod),r.statusCode&&j.append("statusCode",r.statusCode),r.jsonrpcId&&j.append("jsonrpcId",r.jsonrpcId),j.append("format",g);const b=await(await fetch(`/api/requests/export?${j}`)).blob(),T=window.URL.createObjectURL(b),_=document.createElement("a");_.href=T;const z=g==="csv"?"csv":g==="txt"?"txt":"json";_.download=`mcp-shark-traffic-${new Date().toISOString().replace(/[:.]/g,"-")}.${z}`,document.body.appendChild(_),_.click(),window.URL.revokeObjectURL(T),document.body.removeChild(_)}catch(j){console.error("Failed to export traffic:",j),alert("Failed to export traffic. Please try again.")}};return l.jsxs("div",{ref:d,"data-tour":"filters",style:{padding:"12px 16px",borderBottom:`1px solid ${o.borderLight}`,background:o.bgSecondary,display:"flex",gap:"10px",alignItems:"center",flexWrap:"wrap",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[l.jsxs("div",{style:{position:"relative",width:"300px"},children:[l.jsx(Xc,{size:16,stroke:1.5,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:o.textTertiary,pointerEvents:"none",zIndex:1}}),l.jsx(wn,{type:"text",placeholder:"Search everything (partial match)...",value:r.search||"",onChange:g=>s({...r,search:g.target.value||null}),style:{width:"100%",fontWeight:r.search?"500":"400",paddingLeft:"36px"}})]}),l.jsx(wn,{type:"text",placeholder:"MCP Server Name...",value:r.serverName||"",onChange:g=>s({...r,serverName:g.target.value||null}),style:{width:"200px"}}),l.jsx(wn,{type:"text",placeholder:"Session ID...",value:r.sessionId||"",onChange:g=>s({...r,sessionId:g.target.value||null}),style:{width:"200px"}}),l.jsx(wn,{type:"text",placeholder:"HTTP Method...",value:r.method||"",onChange:g=>s({...r,method:g.target.value||null}),style:{width:"150px"}}),l.jsx(wn,{type:"text",placeholder:"JSON-RPC Method...",value:r.jsonrpcMethod||"",onChange:g=>s({...r,jsonrpcMethod:g.target.value||null}),style:{width:"200px"}}),l.jsx(wn,{type:"number",placeholder:"Status Code...",value:r.statusCode||"",onChange:g=>s({...r,statusCode:g.target.value?Number.parseInt(g.target.value):null}),style:{width:"120px"}}),l.jsx(wn,{type:"text",placeholder:"JSON-RPC ID...",value:r.jsonrpcId||"",onChange:g=>s({...r,jsonrpcId:g.target.value||null}),style:{width:"150px"}}),l.jsx(zx,{stats:u,onExport:y}),l.jsxs("button",{type:"button",onClick:()=>x(!0),style:{padding:"8px 14px",background:o.buttonDanger,border:"none",color:o.textInverse,fontSize:"12px",fontFamily:v.body,fontWeight:"500",borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`,marginLeft:"12px"},onMouseEnter:g=>{ge({targets:g.currentTarget,background:o.buttonDangerHover,translateY:-1,boxShadow:[`0 2px 4px ${o.shadowSm}`,`0 4px 8px ${o.shadowMd}`],duration:200,easing:"easeOutQuad"})},onMouseLeave:g=>{ge({targets:g.currentTarget,background:o.buttonDanger,translateY:0,boxShadow:[`0 4px 8px ${o.shadowMd}`,`0 2px 4px ${o.shadowSm}`],duration:200,easing:"easeOutQuad"})},title:"Clear all captured traffic",children:[l.jsx(fs,{size:14,stroke:1.5}),"Clear"]}),l.jsx(od,{isOpen:f,onClose:()=>x(!1),onConfirm:async()=>{try{const g=await fetch("/api/requests/clear",{method:"POST"});if(g.ok)p&&p();else{const j=await g.json();alert(`Failed to clear traffic: ${j.error||"Unknown error"}`)}}catch(g){console.error("Failed to clear traffic:",g),alert("Failed to clear traffic. Please try again.")}},title:"Clear All Captured Traffic",message:"Are you sure you want to delete all captured traffic? This action cannot be undone and will permanently remove all requests and responses from the database.",confirmText:"Clear All",cancelText:"Cancel",danger:!0})]})}const Te={LIFECYCLE:"lifecycle",TOOLS:"tools",RESOURCES:"resources",PROMPTS:"prompts",NOTIFICATIONS:"notifications",CLIENT_FEATURES:"client-features",OTHER:"other"};function Rx(r){return r?r==="initialize"||r==="notifications/initialized"?Te.LIFECYCLE:r.startsWith("tools/")?Te.TOOLS:r.startsWith("resources/")?Te.RESOURCES:r.startsWith("prompts/")?Te.PROMPTS:r.startsWith("notifications/")?Te.NOTIFICATIONS:r.startsWith("elicitation/")||r.startsWith("sampling/")||r.startsWith("logging/")?Te.CLIENT_FEATURES:Te.OTHER:Te.OTHER}function Mx(r){return{[Te.LIFECYCLE]:"Lifecycle",[Te.TOOLS]:"Tools",[Te.RESOURCES]:"Resources",[Te.PROMPTS]:"Prompts",[Te.NOTIFICATIONS]:"Notifications",[Te.CLIENT_FEATURES]:"Client Features",[Te.OTHER]:"Other"}[r]||"Unknown"}function Fx(r){return{[Te.LIFECYCLE]:qo,[Te.TOOLS]:kg,[Te.RESOURCES]:Zf,[Te.PROMPTS]:dg,[Te.NOTIFICATIONS]:Af,[Te.CLIENT_FEATURES]:Cg,[Te.OTHER]:Rc}[r]||Rc}function Ix(r){const s=Cd(r),u=new Map;return s.forEach(p=>{const d=p.request||p.response;if(!d)return;const f=d.session_id||"__NO_SESSION__",x=ni(d),y=Rx(x||"");u.has(f)||u.set(f,{sessionId:f==="__NO_SESSION__"?null:f,categories:new Map,firstTimestamp:d.timestamp_iso});const g=u.get(f);g.categories.has(y)||g.categories.set(y,[]),g.categories.get(y).push(p),new Date(d.timestamp_iso)<new Date(g.firstTimestamp)&&(g.firstTimestamp=d.timestamp_iso)}),Array.from(u.entries()).map(([p,d])=>({sessionId:d.sessionId,firstTimestamp:d.firstTimestamp,categories:Array.from(d.categories.entries()).map(([f,x])=>({category:f,label:Mx(f),pairs:x.sort((y,g)=>{const j=(y.request||y.response)?.timestamp_iso||"",S=(g.request||g.response)?.timestamp_iso||"";return new Date(j)-new Date(S)})})).sort((f,x)=>{const y=[Te.LIFECYCLE,Te.TOOLS,Te.RESOURCES,Te.PROMPTS,Te.NOTIFICATIONS,Te.CLIENT_FEATURES,Te.OTHER],g=y.indexOf(f.category),j=y.indexOf(x.category);return g-j})})).sort((p,d)=>new Date(d.firstTimestamp)-new Date(p.firstTimestamp))}const $x=({size:r=12,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle"},role:"img","aria-label":"Chevron down icon",children:[l.jsx("title",{children:"Chevron down icon"}),l.jsx("polyline",{points:"6 9 12 15 18 9"})]}),Nx=({size:r=12,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle"},role:"img","aria-label":"Chevron right icon",children:[l.jsx("title",{children:"Chevron right icon"}),l.jsx("polyline",{points:"9 18 15 12 9 6"})]});function Uc({children:r,onClick:s,isExpanded:u,indent:p=0}){return l.jsx("tr",{onClick:s,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),s())},tabIndex:0,"aria-label":`Toggle group ${r}`,style:{cursor:"pointer",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,borderTop:`1px solid ${o.borderLight}`},onMouseEnter:d=>{d.currentTarget.style.background=o.bgCard},onMouseLeave:d=>{d.currentTarget.style.background=o.bgSecondary},children:l.jsxs("td",{colSpan:11,style:{padding:p>0?"12px 16px 12px 40px":"12px 16px",color:o.textPrimary,fontFamily:v.body,fontWeight:"600",fontSize:p>0?"11px":"12px"},children:[l.jsx("span",{style:{marginRight:"8px",userSelect:"none",display:"inline-flex",alignItems:"center"},children:u?l.jsx($x,{size:12}):l.jsx(Nx,{size:12})}),r]})})}function Ox({response:r,selected:s,firstRequestTime:u,onSelect:p}){const d=s?.frame_number===r.frame_number,{source:f,dest:x}=Ts(r),y=js(r.timestamp_iso,u);return l.jsxs("tr",{onClick:()=>p(r),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p(r))},tabIndex:0,"aria-label":`Select orphaned response ${r.frame_number}`,style:{cursor:"pointer",background:d?o.bgSelected:o.bgUnpaired,borderBottom:`1px solid ${o.borderLight}`,fontFamily:v.body,transition:"background-color 0.15s ease",opacity:.85},onMouseEnter:g=>{d||(g.currentTarget.style.background=Xn(o.accentOrange,.1))},onMouseLeave:g=>{d||(g.currentTarget.style.background=o.bgUnpaired)},children:[l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,textAlign:"right",fontFamily:v.mono,fontSize:"12px"},children:l.jsxs("span",{style:{color:o.accentOrange,fontWeight:"500"},children:["#",r.frame_number," (orphaned)"]})}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:y}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.body,fontSize:"12px"},children:Cs(r.timestamp_iso)}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentOrange,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:f}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentOrange,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:x}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:r.protocol||"HTTP"}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textSecondary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:"-"}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:l.jsx("div",{style:{color:r.status_code>=400?o.error:r.status_code>=300?o.warning:o.success,fontWeight:"600"},children:r.status_code||"-"})}),l.jsx("td",{style:{padding:"16px",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:si(r)})]})}const Bx=({size:r=12,rotated:s=!1})=>l.jsx(ds,{size:r,stroke:1.5,style:{display:"inline-block",verticalAlign:"middle",transform:s?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s ease"}});function Dx({request:r,response:s,selected:u,firstRequestTime:p,onSelect:d,isExpanded:f,onToggleExpand:x,isUnpaired:y}){const g=u?.frame_number===r.frame_number,{source:j,dest:S}=Ts(r),b=js(r.timestamp_iso,p),T=!!s;return l.jsx(l.Fragment,{children:l.jsxs("tr",{onClick:()=>d(r),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),d(r))},tabIndex:0,"aria-label":`Select request ${r.frame_number}`,style:{cursor:"pointer",background:g?o.bgSelected:y?o.bgUnpaired:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontFamily:v.body,transition:"background-color 0.15s ease",opacity:y?.85:1},onMouseEnter:_=>{g||(_.currentTarget.style.background=y?Xn(o.accentOrange,.1):o.bgCard)},onMouseLeave:_=>{g||(_.currentTarget.style.background=y?o.bgUnpaired:o.bgSecondary)},children:[l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,textAlign:"right",fontFamily:v.mono,fontSize:"12px"},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"flex-end"},children:[T&&l.jsx("button",{type:"button",onClick:_=>{_.stopPropagation(),x()},style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",color:o.textSecondary},onMouseEnter:_=>{_.currentTarget.style.color=o.textPrimary},onMouseLeave:_=>{_.currentTarget.style.color=o.textSecondary},children:l.jsx(Bx,{size:14,rotated:!f})}),l.jsxs("span",{style:{color:y?o.accentOrange:o.accentBlue,fontWeight:"500"},children:["#",r.frame_number,y&&l.jsx("span",{style:{fontSize:"10px",color:o.textSecondary,marginLeft:"4px",fontStyle:"italic"},children:"(no response)"})]})]})}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:b}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.body,fontSize:"12px"},children:Cs(r.timestamp_iso)}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentBlue,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:j}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentBlue,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:S}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:r.protocol||"HTTP"}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:l.jsx("div",{style:{color:o.accentBlue},children:r.method||"REQ"})}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:T&&l.jsx("div",{style:{color:s.status_code>=400?o.error:s.status_code>=300?o.warning:o.success,fontWeight:"600"},children:s.status_code||"-"})}),l.jsx("td",{style:{padding:"16px",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:si(r)})]})})}function Wx({response:r,selected:s,firstRequestTime:u,onSelect:p}){const d=s?.frame_number===r.frame_number,{source:f,dest:x}=Ts(r),y=js(r.timestamp_iso,u);return l.jsxs("tr",{onClick:()=>p(r),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p(r))},tabIndex:0,"aria-label":`Select response ${r.frame_number}`,style:{cursor:"pointer",background:d&&s?.frame_number===r.frame_number?o.bgSelected:o.bgTertiary,borderBottom:`1px solid ${o.borderLight}`,fontFamily:v.body,transition:"background-color 0.15s ease"},onMouseEnter:g=>{d&&s?.frame_number===r.frame_number||(g.currentTarget.style.background=o.bgSecondary)},onMouseLeave:g=>{d&&s?.frame_number===r.frame_number||(g.currentTarget.style.background=o.bgTertiary)},children:[l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,textAlign:"right",fontFamily:v.mono,fontSize:"12px",paddingLeft:"40px"},children:l.jsxs("span",{style:{color:o.accentGreen,fontWeight:"500"},children:["#",r.frame_number]})}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:y}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.body,fontSize:"12px"},children:Cs(r.timestamp_iso)}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentGreen,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:f}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentGreen,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:x}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:r.protocol||"HTTP"}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textSecondary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:"-"}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:l.jsx("div",{style:{color:r.status_code>=400?o.error:r.status_code>=300?o.warning:o.success,fontWeight:"600"},children:r.status_code||"-"})}),l.jsx("td",{style:{padding:"16px",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:si(r)})]})}function Ld({pair:r,request:s,selected:u,firstRequestTime:p,onSelect:d,isExpanded:f=!1,onToggleExpand:x=()=>{}}){const g=((_,z)=>_?{request:_.request,response:_.response}:z?{request:z,response:null}:null)(r,s);if(!g)return null;const{request:j,response:S}=g,b=!j||!S;if(!j&&S)return l.jsx(Ox,{response:S,selected:u,firstRequestTime:p,onSelect:d});if(!j)return null;const T=!!S;return l.jsxs(l.Fragment,{children:[l.jsx(Dx,{request:j,response:S,selected:u,firstRequestTime:p,onSelect:d,isExpanded:f,onToggleExpand:x,isUnpaired:b}),T&&f&&l.jsx(Wx,{response:S,selected:u,firstRequestTime:p,onSelect:d,request:j})]})}function Ax({groupedData:r,selected:s,firstRequestTime:u,onSelect:p,expandedSessions:d,expandedCategories:f,onToggleSession:x,onToggleCategory:y}){return l.jsx("tbody",{children:r.map(g=>{const j=g.sessionId||"__NO_SESSION__",S=d.has(j);return l.jsxs(Zo.Fragment,{children:[l.jsxs(Uc,{onClick:()=>x(j),isExpanded:S,indent:0,children:[l.jsxs("span",{style:{color:o.accentBlue,marginRight:"8px"},children:["Session: ",g.sessionId||"No Session"]}),l.jsxs("span",{style:{color:o.textTertiary,fontSize:"11px",fontWeight:"400"},children:["(",g.categories.reduce((b,T)=>b+T.pairs.length,0)," ","operations)"]})]}),S&&g.categories.map(b=>{const T=`${j}::${b.category}`,_=f.has(T);return l.jsxs(Zo.Fragment,{children:[l.jsxs(Uc,{onClick:()=>y(T),isExpanded:_,indent:1,children:[l.jsx("span",{style:{marginRight:"8px",display:"inline-flex",alignItems:"center"},children:Zo.createElement(Fx(b.category),{size:16,stroke:1.5,color:o.accentBlue})}),l.jsx("span",{style:{color:o.textPrimary},children:b.label}),l.jsxs("span",{style:{color:o.textTertiary,fontSize:"11px",fontWeight:"400",marginLeft:"8px"},children:["(",b.pairs.length," ",b.pairs.length===1?"operation":"operations",")"]})]}),_&&b.pairs.map(z=>l.jsx(Ld,{pair:z,selected:s,firstRequestTime:u,onSelect:p,isExpanded:!1,onToggleExpand:()=>{}},z.frame_number))]},T)})]},j)})})}function Hx({columnWidths:r}){return l.jsx("thead",{style:{position:"sticky",top:0,background:o.bgSecondary,zIndex:10,boxShadow:`0 2px 4px ${o.shadowSm}`},children:l.jsxs("tr",{children:[l.jsx("th",{style:{padding:"12px 16px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.frame}px`,minWidth:`${r.frame}px`,color:o.textSecondary,fontWeight:"600",fontFamily:v.body,fontSize:"11px",textTransform:"uppercase",letterSpacing:"0.05em",background:o.bgSecondary},children:"No."}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.time}px`,minWidth:`${r.time}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Time"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.datetime}px`,minWidth:`${r.datetime}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Date/Time"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.source}px`,minWidth:`${r.source}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Source"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.destination}px`,minWidth:`${r.destination}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Destination"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.protocol}px`,minWidth:`${r.protocol}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Protocol"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.method}px`,minWidth:`${r.method}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Method"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.status}px`,minWidth:`${r.status}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Status"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Endpoint"})]})})}function Ux({viewMode:r,onViewModeChange:s}){return l.jsxs("div",{"data-tour":"view-modes",style:{display:"flex",borderBottom:`1px solid ${o.borderLight}`,background:o.bgSecondary,padding:"0 12px",boxShadow:`0 1px 3px ${o.shadowSm}`,flexShrink:0},children:[l.jsxs("button",{type:"button",onClick:()=>s("general"),style:{padding:"10px 18px",background:r==="general"?o.bgCard:"transparent",fontFamily:v.body,border:"none",borderBottom:r==="general"?`2px solid ${o.accentBlue}`:"2px solid transparent",color:r==="general"?o.textPrimary:o.textSecondary,borderRadius:"8px 8px 0 0",cursor:"pointer",fontSize:"12px",fontWeight:r==="general"?"500":"normal",display:"flex",alignItems:"center",gap:"6px"},onMouseEnter:u=>{r!=="general"&&(u.currentTarget.style.background=o.bgHover,u.currentTarget.style.color=o.textPrimary)},onMouseLeave:u=>{r!=="general"&&(u.currentTarget.style.background="transparent",u.currentTarget.style.color=o.textSecondary)},children:[l.jsx(sg,{size:16,stroke:1.5}),"General List"]}),l.jsxs("button",{type:"button",onClick:()=>s("groupedByMcp"),style:{padding:"10px 18px",background:r==="groupedByMcp"?o.bgCard:"transparent",fontFamily:v.body,border:"none",borderBottom:r==="groupedByMcp"?`2px solid ${o.accentBlue}`:"2px solid transparent",color:r==="groupedByMcp"?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"12px",fontWeight:r==="groupedByMcp"?"500":"normal",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",gap:"6px"},onMouseEnter:u=>{r!=="groupedByMcp"&&(u.currentTarget.style.background=o.bgHover,u.currentTarget.style.color=o.textPrimary)},onMouseLeave:u=>{r!=="groupedByMcp"&&(u.currentTarget.style.background="transparent",u.currentTarget.style.color=o.textSecondary)},children:[l.jsx(Gc,{size:16,stroke:1.5}),"MCP Protocol View"]})]})}function Vx({requests:r,selected:s,onSelect:u,firstRequestTime:p}){const[d,f]=L.useState("general"),[x]=L.useState({frame:90,time:120,datetime:180,source:200,destination:200,protocol:90,method:90,status:80,endpoint:500}),[y,g]=L.useState(new Set),[j,S]=L.useState(new Set),[b,T]=L.useState(new Set),_=L.useRef(null),z=L.useRef(0),R=L.useMemo(()=>Ix(r),[r]);L.useEffect(()=>{if(_.current&&r.length>0){const $=_.current.querySelectorAll("tr");if($.length>0){if(r.length>z.current){const H=Array.from($).slice(z.current);H.length>0&&Wc(H,{delay:30,duration:300})}else Wc($,{delay:20,duration:300});z.current=r.length}}},[r]),L.useEffect(()=>{if(d==="groupedByMcp"){const $=new Set(R.map(H=>H.sessionId||"__NO_SESSION__"));S(H=>{const K=new Set(H);return $.forEach(V=>K.add(V)),K}),T(H=>{const K=new Set(H);return R.forEach(V=>{const G=V.sessionId||"__NO_SESSION__";V.categories.forEach(Y=>{K.add(`${G}::${Y.category}`)})}),K})}},[R,d]);const P=$=>{S(H=>{const K=new Set(H);return K.has($)?K.delete($):K.add($),K})},I=$=>{T(H=>{const K=new Set(H);return K.has($)?K.delete($):K.add($),K})},O=L.useMemo(()=>Cd(r),[r]),U=$=>{g(H=>{const K=new Set(H);return K.has($)?K.delete($):K.add($),K})},W=()=>l.jsx("tbody",{ref:_,children:O.map($=>l.jsx(Ld,{pair:$,selected:s,firstRequestTime:p,onSelect:u,isExpanded:y.has($.frame_number),onToggleExpand:()=>U($.frame_number)},$.frame_number))});return l.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",background:o.bgPrimary,minHeight:0,overflow:"hidden"},children:[l.jsx(Ux,{viewMode:d,onViewModeChange:f}),l.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"auto",minHeight:0,WebkitOverflowScrolling:"touch"},children:l.jsxs("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0,fontSize:"12px",fontFamily:v.body,background:o.bgPrimary},children:[l.jsx(Hx,{columnWidths:x}),d==="general"?W():l.jsx(Ax,{groupedData:R,expandedSessions:j,expandedCategories:b,onToggleSession:P,onToggleCategory:I,selected:s,firstRequestTime:p,onSelect:u})]})})]})}function Qx({requests:r,selected:s,onSelect:u,filters:p,onFilterChange:d,stats:f,firstRequestTime:x,onClear:y}){const g=L.useRef(null);return L.useEffect(()=>{s&&g.current&&setTimeout(()=>{g.current&&(g.current.style.opacity="0",g.current.style.transform="translateX(600px)",_x(g.current,{width:600}))},10)},[s]),l.jsxs("div",{"data-tab-content":!0,style:{display:"flex",flex:1,overflow:"hidden",minHeight:0},children:[l.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,minHeight:0},children:[l.jsx(Ex,{filters:p,onFilterChange:d,stats:f,onExport:()=>{},onClear:y}),l.jsx(Vx,{requests:r,selected:s,onSelect:u,firstRequestTime:x})]}),s&&l.jsx("div",{ref:g,style:{width:"40%",minWidth:"500px",maxWidth:"700px",borderLeft:`1px solid ${o.borderLight}`,overflow:"hidden",display:"flex",flexDirection:"column",background:o.bgCard,flexShrink:0},children:l.jsx(Lx,{request:s,onClose:()=>u(null),requests:r})})]})}function an(r,s){s.search&&r.append("search",s.search),s.serverName&&r.append("serverName",s.serverName),s.sessionId&&r.append("sessionId",s.sessionId),s.method&&r.append("method",s.method),s.jsonrpcMethod&&r.append("jsonrpcMethod",s.jsonrpcMethod),s.statusCode&&r.append("statusCode",s.statusCode),s.jsonrpcId&&r.append("jsonrpcId",s.jsonrpcId)}function Yx(){const[r,s]=L.useState("traffic"),[u,p]=L.useState([]),[d,f]=L.useState(null),[x,y]=L.useState({}),[g,j]=L.useState(null),[S,b]=L.useState(null),[T,_]=L.useState(!1),[z,R]=L.useState(!0),P=L.useRef(null),I=L.useRef(r),O=L.useRef(x),U=async()=>{try{const $=new URLSearchParams;an($,x);const K=await(await fetch(`/api/statistics?${$}`)).json();j(K)}catch($){console.error("Failed to load statistics:",$)}},W=async()=>{try{const $=new URLSearchParams;an($,x),$.append("limit","5000");const K=await(await fetch(`/api/requests?${$}`)).json();if(p(K),K.length>0){const V=K[K.length-1]?.timestamp_iso;V&&b(V)}await U()}catch($){console.error("Failed to load requests:",$)}};return L.useEffect(()=>{const $=async()=>{try{const G=await(await fetch("/api/help/state")).json();R(G.dismissed||G.tourCompleted),!G.dismissed&&!G.tourCompleted&&setTimeout(()=>{_(!0)},500)}catch(V){console.error("Failed to load tour state:",V),setTimeout(()=>{_(!0)},500),R(!1)}},H=async()=>{try{const V=new URLSearchParams;an(V,x),V.append("limit","5000");const Y=await(await fetch(`/api/requests?${V}`)).json();if(p(Y),Y.length>0){const Ee=Y[Y.length-1]?.timestamp_iso;Ee&&b(Ee)}const ce=new URLSearchParams;an(ce,x);const ve=await(await fetch(`/api/statistics?${ce}`)).json();j(ve)}catch(V){console.error("Failed to load requests:",V)}};$(),H();const K=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;try{const V=new WebSocket(K);P.current=V,V.onmessage=async G=>{const Y=JSON.parse(G.data);if(Y.type==="update"){if(p(Y.data),Y.data.length>0){const ce=Y.data[Y.data.length-1]?.timestamp_iso;ce&&b(ce)}try{const ce=new URLSearchParams;an(ce,x);const ve=await(await fetch(`/api/statistics?${ce}`)).json();j(ve)}catch(ce){console.error("Failed to load statistics:",ce)}}},V.onerror=()=>{},V.onclose=()=>{}}catch{}return()=>{P.current&&P.current.readyState===WebSocket.OPEN&&P.current.close()}},[x]),L.useEffect(()=>{(async()=>{try{const H=new URLSearchParams;an(H,x),H.append("limit","5000");const V=await(await fetch(`/api/requests?${H}`)).json();if(p(V),V.length>0){const Se=V[V.length-1]?.timestamp_iso;Se&&b(Se)}const G=new URLSearchParams;an(G,x);const ce=await(await fetch(`/api/statistics?${G}`)).json();j(ce)}catch(H){console.error("Failed to load requests:",H)}})()},[x]),L.useEffect(()=>{O.current=x},[x]),L.useEffect(()=>{if(r!=="traffic")return;const $=setInterval(async()=>{try{const H=new URLSearchParams;an(H,O.current);const V=await(await fetch(`/api/statistics?${H}`)).json();j(V)}catch(H){console.error("Failed to load statistics:",H)}},2e3);return()=>clearInterval($)},[r]),{activeTab:r,setActiveTab:s,requests:u,selected:d,setSelected:f,filters:x,setFilters:y,stats:g,firstRequestTime:S,showTour:T,setShowTour:_,tourDismissed:z,prevTabRef:I,wsRef:P,loadRequests:W}}function Jx({show:r}){const s=L.useRef(null),u=L.useRef([]);return L.useEffect(()=>{r&&s.current?(ge({targets:s.current,opacity:[0,1],scale:[.9,1],duration:400,easing:"easeOutExpo"}),u.current.length>0&&ge({targets:u.current,translateY:[0,-10,0],duration:1200,delay:ge.stagger(200),loop:!0,easing:"easeInOutQuad"})):!r&&s.current&&ge({targets:s.current,opacity:[1,0],scale:[1,.9],duration:300,easing:"easeInExpo",complete:()=>{s.current&&(s.current.style.display="none")}})},[r]),r?l.jsx("div",{ref:s,style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(245, 243, 240, 0.9)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,borderRadius:"8px",backdropFilter:"blur(2px)"},children:l.jsxs("div",{style:{background:o.bgCard,borderRadius:"16px",padding:"32px",boxShadow:`0 8px 32px ${o.shadowMd}`,maxWidth:"320px",width:"90%",textAlign:"center"},children:[l.jsx("h3",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"20px"},children:"Waiting for MCP server to start"}),l.jsx("div",{style:{display:"flex",justifyContent:"center",gap:"8px"},children:[0,1,2].map(p=>l.jsx("div",{ref:d=>{d&&(u.current[p]=d)},style:{width:"12px",height:"12px",borderRadius:"50%",background:o.accentBlue}},p))})]})}):null}function Kx({prompt:r,promptArgs:s,onPromptArgsChange:u,promptResult:p,onGetPrompt:d,loading:f}){return l.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsxs("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:["Get Prompt: ",r.name]}),l.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"prompt-args-textarea",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Arguments (JSON)"}),l.jsx("textarea",{id:"prompt-args-textarea",value:s,onChange:x=>u(x.target.value),style:{width:"100%",minHeight:"150px",padding:"10px",border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontFamily:v.mono,fontSize:"12px",background:o.bgCard,color:o.textPrimary,resize:"vertical"}})]}),l.jsx("button",{type:"button",onClick:d,disabled:f,style:{padding:"10px 20px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:f?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:f?.6:1},children:f?"Getting...":"Get Prompt"}),p&&l.jsxs("div",{children:[l.jsx("label",{htmlFor:"prompt-result-pre",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Result"}),l.jsx("pre",{id:"prompt-result-pre",style:{padding:"12px",background:o.bgSecondary,border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontSize:"12px",fontFamily:v.mono,color:p.error?o.error:o.textPrimary,overflow:"auto",maxHeight:"300px",margin:0},children:JSON.stringify(p,null,2)})]})]})]})}function _s({message:r}){return l.jsx("div",{style:{padding:"40px",textAlign:"center",color:o.textSecondary,fontFamily:v.body,fontSize:"13px"},children:r})}function Ls({message:r}){return l.jsx("div",{style:{padding:"40px",textAlign:"center",color:o.error,fontFamily:v.body,fontSize:"13px"},children:r})}function Zn({message:r}){return l.jsx("div",{style:{padding:"40px",textAlign:"center",color:o.textSecondary,fontFamily:v.body,fontSize:"13px"},children:r})}function Gx({prompt:r,isSelected:s,onClick:u}){return l.jsx("button",{type:"button",onClick:u,"aria-label":`Select prompt ${r.name}`,style:{padding:"16px 20px",margin:"4px 8px",borderRadius:"8px",cursor:"pointer",background:s?o.bgSelected:o.bgCard,border:s?`2px solid ${o.accentBlue}`:`1px solid ${o.borderLight}`,boxShadow:s?`0 2px 4px ${o.shadowSm}`:"none",transition:"all 0.2s ease",position:"relative",width:"100%",textAlign:"left"},onMouseEnter:p=>{s||(p.currentTarget.style.background=o.bgHover,p.currentTarget.style.borderColor=o.borderMedium,p.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:p=>{s||(p.currentTarget.style.background=o.bgCard,p.currentTarget.style.borderColor=o.borderLight,p.currentTarget.style.boxShadow="none")},children:l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[l.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:s?o.accentBlue:o.textTertiary,marginTop:"6px",flexShrink:0,transition:"background 0.2s"}}),l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsx("div",{style:{fontWeight:s?"600":"500",fontSize:"14px",color:o.textPrimary,marginBottom:r.description?"6px":"0",lineHeight:"1.4"},children:r.name}),r.description&&l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,lineHeight:"1.5",marginTop:"4px"},children:r.description})]})]})})}function Xx({serverStatus:r,promptsLoading:s,promptsLoaded:u,error:p,prompts:d,selectedPrompt:f,onSelectPrompt:x}){return l.jsx("div",{style:{flex:1,overflow:"auto",background:o.bgCard,position:"relative"},children:r?.running?s||!u?l.jsx(Zn,{message:"Loading prompts..."}):p?.includes("prompts:")?l.jsx(Ls,{message:`Error loading prompts: ${p.replace("prompts: ","")}`}):d.length===0?l.jsx(_s,{message:"No prompts available."}):l.jsx("div",{style:{padding:"8px 0"},children:d.map((y,g)=>l.jsx(Gx,{prompt:y,isSelected:f?.name===y.name,onClick:()=>x(y)},y.name||`prompt-${g}`))}):l.jsx(Zn,{message:"Waiting for MCP server to start..."})})}function Zx({prompts:r,selectedPrompt:s,onSelectPrompt:u,promptArgs:p,onPromptArgsChange:d,promptResult:f,onGetPrompt:x,loading:y,promptsLoading:g,promptsLoaded:j,serverStatus:S,error:b,onRefresh:T}){const _=z=>{u(z);const R=z.arguments?z.arguments.reduce((P,I)=>(P[I.name]=I.default!==void 0?I.default:"",P),{}):{};d(JSON.stringify(R,null,2))};return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("button",{type:"button",onClick:T,disabled:y||g,style:{padding:"8px 16px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:y||g?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:y||g?.6:1},children:g?"Loading...":"Refresh Prompts"}),l.jsx("span",{style:{color:o.textSecondary,fontSize:"13px"},children:g?"Loading prompts...":`${r.length} prompt${r.length!==1?"s":""} available`})]}),l.jsxs("div",{style:{display:"flex",gap:"16px",flex:1,minHeight:0},children:[l.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsx("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:"Available Prompts"}),l.jsx(Xx,{serverStatus:S,promptsLoading:g,promptsLoaded:j,error:b,prompts:r,selectedPrompt:s,onSelectPrompt:_})]}),s&&l.jsx(Kx,{prompt:s,promptArgs:p,onPromptArgsChange:d,promptResult:f,onGetPrompt:x,loading:y})]})]})}function qx({resource:r,resourceResult:s,onReadResource:u,loading:p}){return l.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsxs("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:["Read Resource: ",r.uri]}),l.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[l.jsx("button",{type:"button",onClick:u,disabled:p,style:{padding:"10px 20px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:p?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:p?.6:1},children:p?"Reading...":"Read Resource"}),s&&l.jsxs("div",{children:[l.jsx("label",{htmlFor:"resource-result-pre",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Result"}),l.jsx("pre",{id:"resource-result-pre",style:{padding:"12px",background:o.bgSecondary,border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontSize:"12px",fontFamily:v.mono,color:s.error?o.error:o.textPrimary,overflow:"auto",maxHeight:"400px",margin:0},children:JSON.stringify(s,null,2)})]})]})]})}function ey({resource:r,isSelected:s,onClick:u}){return l.jsx("button",{type:"button",onClick:u,"aria-label":`Select resource ${r.uri}`,style:{padding:"16px 20px",margin:"4px 8px",borderRadius:"8px",cursor:"pointer",background:s?o.bgSelected:o.bgCard,border:s?`2px solid ${o.accentBlue}`:`1px solid ${o.borderLight}`,boxShadow:s?`0 2px 4px ${o.shadowSm}`:"none",transition:"all 0.2s ease",position:"relative",width:"100%",textAlign:"left"},onMouseEnter:p=>{s||(p.currentTarget.style.background=o.bgHover,p.currentTarget.style.borderColor=o.borderMedium,p.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:p=>{s||(p.currentTarget.style.background=o.bgCard,p.currentTarget.style.borderColor=o.borderLight,p.currentTarget.style.boxShadow="none")},children:l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[l.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:s?o.accentBlue:o.textTertiary,marginTop:"6px",flexShrink:0,transition:"background 0.2s"}}),l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsx("div",{style:{fontWeight:s?"600":"500",fontSize:"14px",color:o.textPrimary,marginBottom:r.name||r.description?"6px":"0",lineHeight:"1.4",wordBreak:"break-word"},children:r.uri}),r.name&&l.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontWeight:"500",lineHeight:"1.5",marginTop:"4px"},children:r.name}),r.description&&l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,lineHeight:"1.5",marginTop:r.name?"2px":"4px"},children:r.description})]})]})})}function ty({serverStatus:r,resourcesLoading:s,resourcesLoaded:u,error:p,resources:d,selectedResource:f,onSelectResource:x}){return l.jsx("div",{style:{flex:1,overflow:"auto",background:o.bgCard,position:"relative"},children:r?.running?s||!u?l.jsx(Zn,{message:"Loading resources..."}):p?.includes("resources:")?l.jsx(Ls,{message:`Error loading resources: ${p.replace("resources: ","")}`}):d.length===0?l.jsx(_s,{message:"No resources available."}):l.jsx("div",{style:{padding:"8px 0"},children:d.map((y,g)=>l.jsx(ey,{resource:y,isSelected:f?.uri===y.uri,onClick:()=>x(y)},y.uri||`resource-${g}`))}):l.jsx(Zn,{message:"Waiting for MCP server to start..."})})}function ny({resources:r,selectedResource:s,onSelectResource:u,resourceResult:p,onReadResource:d,loading:f,resourcesLoading:x,resourcesLoaded:y,serverStatus:g,error:j,onRefresh:S}){return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("button",{type:"button",onClick:S,disabled:f||x,style:{padding:"8px 16px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:f||x?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:f||x?.6:1},children:x?"Loading...":"Refresh Resources"}),l.jsx("span",{style:{color:o.textSecondary,fontSize:"13px"},children:x?"Loading resources...":`${r.length} resource${r.length!==1?"s":""} available`})]}),l.jsxs("div",{style:{display:"flex",gap:"16px",flex:1,minHeight:0},children:[l.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsx("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:"Available Resources"}),l.jsx(ty,{serverStatus:g,resourcesLoading:x,resourcesLoaded:y,error:j,resources:r,selectedResource:s,onSelectResource:u})]}),s&&l.jsx(qx,{resource:s,resourceResult:p,onReadResource:d,loading:f})]})]})}function ry({tool:r,toolArgs:s,onToolArgsChange:u,toolResult:p,onCallTool:d,loading:f}){return l.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsxs("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:["Call Tool: ",r.name]}),l.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"tool-args-textarea",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Arguments (JSON)"}),l.jsx("textarea",{id:"tool-args-textarea",value:s,onChange:x=>u(x.target.value),style:{width:"100%",minHeight:"150px",padding:"10px",border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontFamily:v.mono,fontSize:"12px",background:o.bgCard,color:o.textPrimary,resize:"vertical"}})]}),l.jsx("button",{type:"button",onClick:d,disabled:f,style:{padding:"10px 20px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:f?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:f?.6:1},children:f?"Calling...":"Call Tool"}),p&&l.jsxs("div",{children:[l.jsx("label",{htmlFor:"tool-result-pre",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Result"}),l.jsx("pre",{id:"tool-result-pre",style:{padding:"12px",background:o.bgSecondary,border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontSize:"12px",fontFamily:v.mono,color:p.error?o.error:o.textPrimary,overflow:"auto",maxHeight:"300px",margin:0},children:JSON.stringify(p,null,2)})]})]})]})}function oy({tool:r,isSelected:s,onClick:u}){return l.jsx("button",{type:"button",onClick:u,"aria-label":`Select tool ${r.name}`,style:{padding:"16px 20px",margin:"4px 8px",borderRadius:"8px",cursor:"pointer",background:s?o.bgSelected:o.bgCard,border:s?`2px solid ${o.accentBlue}`:`1px solid ${o.borderLight}`,boxShadow:s?`0 2px 4px ${o.shadowSm}`:"none",transition:"all 0.2s ease",position:"relative",width:"100%",textAlign:"left"},onMouseEnter:p=>{s||(p.currentTarget.style.background=o.bgHover,p.currentTarget.style.borderColor=o.borderMedium,p.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:p=>{s||(p.currentTarget.style.background=o.bgCard,p.currentTarget.style.borderColor=o.borderLight,p.currentTarget.style.boxShadow="none")},children:l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[l.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:s?o.accentBlue:o.textTertiary,marginTop:"6px",flexShrink:0,transition:"background 0.2s"}}),l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsx("div",{style:{fontWeight:s?"600":"500",fontSize:"14px",color:o.textPrimary,marginBottom:r.description?"6px":"0",lineHeight:"1.4"},children:r.name}),r.description&&l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,lineHeight:"1.5",marginTop:"4px"},children:r.description})]})]})})}function iy({serverStatus:r,toolsLoading:s,toolsLoaded:u,error:p,tools:d,selectedTool:f,onSelectTool:x}){return l.jsx("div",{style:{flex:1,overflow:"auto",background:o.bgCard,position:"relative"},children:r?.running?s||!u?l.jsx(Zn,{message:"Loading tools..."}):p?.includes("tools:")?l.jsx(Ls,{message:`Error loading tools: ${p.replace("tools: ","")}`}):d.length===0?l.jsx(_s,{message:"No tools available."}):l.jsx("div",{style:{padding:"8px 0"},children:d.map((y,g)=>l.jsx(oy,{tool:y,isSelected:f?.name===y.name,onClick:()=>x(y)},y.name||`tool-${g}`))}):l.jsx(Zn,{message:"Waiting for MCP server to start..."})})}function ly({tools:r,selectedTool:s,onSelectTool:u,toolArgs:p,onToolArgsChange:d,toolResult:f,onCallTool:x,loading:y,toolsLoading:g,toolsLoaded:j,serverStatus:S,error:b,onRefresh:T}){const _=z=>{u(z);const R=z.inputSchema?.properties?Object.keys(z.inputSchema.properties).reduce((P,I)=>{const O=z.inputSchema.properties[I];return P[I]=O.default!==void 0?O.default:"",P},{}):{};d(JSON.stringify(R,null,2))};return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("button",{type:"button",onClick:T,disabled:y||g,style:{padding:"8px 16px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:y||g?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:y||g?.6:1},children:g?"Loading...":"Refresh Tools"}),l.jsx("span",{style:{color:o.textSecondary,fontSize:"13px"},children:g?"Loading tools...":`${r.length} tool${r.length!==1?"s":""} available`})]}),l.jsxs("div",{style:{display:"flex",gap:"16px",flex:1,minHeight:0},children:[l.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsx("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:"Available Tools"}),l.jsx(iy,{serverStatus:S,toolsLoading:g,toolsLoaded:j,error:b,tools:r,selectedTool:s,onSelectTool:_})]}),s&&l.jsx(ry,{tool:s,toolArgs:p,onToolArgsChange:d,toolResult:f,onCallTool:x,loading:y})]})]})}function sy(r,s,u){const[p,d]=L.useState([]),[f,x]=L.useState([]),[y,g]=L.useState([]),[j,S]=L.useState(!1),[b,T]=L.useState(!1),[_,z]=L.useState(!1),[R,P]=L.useState(!1),[I,O]=L.useState(!1),[U,W]=L.useState(!1),$=L.useCallback(async()=>{if(!s){u("tools: No server selected"),P(!0);return}S(!0),u(null);try{const G=await r("tools/list");d(G?.tools||[]),P(!0)}catch(G){const Y=G.message||"Failed to load tools";u(`tools: ${Y}`),P(!0),console.error("Failed to load tools:",G)}finally{S(!1)}},[s,r,u]),H=L.useCallback(async()=>{if(!s){u("prompts: No server selected"),O(!0);return}T(!0),u(null);try{const G=await r("prompts/list");x(G?.prompts||[]),O(!0)}catch(G){const Y=G.message||"Failed to load prompts";u(`prompts: ${Y}`),O(!0),console.error("Failed to load prompts:",G)}finally{T(!1)}},[s,r,u]),K=L.useCallback(async()=>{if(!s){u("resources: No server selected"),W(!0);return}z(!0),u(null);try{const G=await r("resources/list");g(G?.resources||[]),W(!0)}catch(G){const Y=G.message||"Failed to load resources";u(`resources: ${Y}`),W(!0),console.error("Failed to load resources:",G)}finally{z(!1)}},[s,r,u]),V=L.useCallback(()=>{P(!1),O(!1),W(!1),d([]),x([]),g([])},[]);return{tools:p,prompts:f,resources:y,toolsLoading:j,promptsLoading:b,resourcesLoading:_,toolsLoaded:R,promptsLoaded:I,resourcesLoaded:U,loadTools:$,loadPrompts:H,loadResources:K,resetData:V}}function ay(r){const[s,u]=L.useState(!1),[p,d]=L.useState(null),[f,x]=L.useState(null),y=L.useRef(f);y.current=f;const g=L.useCallback(async(S,b={})=>{if(!r)throw new Error("No server selected");d(null),u(!0);try{const T={"Content-Type":"application/json"},_=y.current;_&&(T["Mcp-Session-Id"]=_);const z=await fetch("/api/playground/proxy",{method:"POST",headers:T,body:JSON.stringify({method:S,params:b,serverName:r})}),R=await z.json(),P=z.headers.get("Mcp-Session-Id")||z.headers.get("mcp-session-id")||R._sessionId;if(P&&P!==_&&x(P),!z.ok)throw new Error(R.error?.message||R.message||"Request failed");return R.result||R}catch(T){throw d(T.message),T}finally{u(!1)}},[r]),j=L.useCallback(()=>{x(null)},[]);return{makeMcpRequest:g,loading:s,error:p,setError:d,resetSession:j}}function uy(){const[r,s]=L.useState(null),[u,p]=L.useState(!1),[d,f]=L.useState([]),[x,y]=L.useState(null),g=L.useCallback(async()=>{try{const S=await fetch("/api/composite/status");if(!S.ok)throw new Error("Server not available");const b=await S.json();s(T=>{const _=T?.running;return b.running?p(z=>z&&!1):p(z=>!z||_?!0:z),b})}catch{s({running:!1}),p(b=>b||!0)}},[]),j=L.useCallback(async()=>{try{const S=await fetch("/api/composite/servers");if(S.ok){const b=await S.json();f(b.servers||[]),y(T=>!T&&b.servers&&b.servers.length>0?b.servers[0]:T)}}catch(S){console.error("Failed to load servers:",S)}},[]);return L.useEffect(()=>{j()},[j]),L.useEffect(()=>{g();const S=setInterval(g,2e3);return()=>clearInterval(S)},[g]),L.useEffect(()=>{d.length>0&&!x&&y(d[0])},[d,x]),{serverStatus:r,showLoadingModal:u,availableServers:d,selectedServer:x,setSelectedServer:y,checkServerStatus:g}}function cy(){const[r,s]=L.useState("tools"),[u,p]=L.useState(null),[d,f]=L.useState("{}"),[x,y]=L.useState(null),[g,j]=L.useState(null),[S,b]=L.useState("{}"),[T,_]=L.useState(null),[z,R]=L.useState(null),[P,I]=L.useState(null),{serverStatus:O,showLoadingModal:U,availableServers:W,selectedServer:$,setSelectedServer:H}=uy(),{makeMcpRequest:K,loading:V,error:G,setError:Y,resetSession:ce}=ay($),{tools:Se,prompts:ve,resources:Ee,toolsLoading:Ne,promptsLoading:Re,resourcesLoading:xe,toolsLoaded:J,promptsLoaded:ee,resourcesLoaded:X,loadTools:w,loadPrompts:N,loadResources:le,resetData:de}=sy(K,$,Y),pe=L.useRef(r);return pe.current=r,L.useEffect(()=>{if(!$||!O?.running)return;de(),p(null),j(null),R(null),y(null),_(null),I(null),f("{}"),b("{}"),ce(),Y(null);const Z=setTimeout(()=>{const fe=pe.current;fe==="tools"?w():fe==="prompts"?N():fe==="resources"&&le()},100);return()=>clearTimeout(Z)},[$,O?.running,de,w,N,le,ce,Y]),L.useEffect(()=>{if(!(!O?.running||!$)){if(r==="tools"&&!J&&!Ne){const Z=setTimeout(()=>{w()},100);return()=>clearTimeout(Z)}if(r==="prompts"&&!ee&&!Re){const Z=setTimeout(()=>{N()},100);return()=>clearTimeout(Z)}if(r==="resources"&&!X&&!xe){const Z=setTimeout(()=>{le()},100);return()=>clearTimeout(Z)}}},[r,O?.running,$,J,Ne,ee,Re,X,xe,w,N,le]),{activeSection:r,setActiveSection:s,tools:Se,prompts:ve,resources:Ee,loading:V,error:G,selectedTool:u,setSelectedTool:p,toolArgs:d,setToolArgs:f,toolResult:x,selectedPrompt:g,setSelectedPrompt:j,promptArgs:S,setPromptArgs:b,promptResult:T,selectedResource:z,setSelectedResource:R,resourceResult:P,serverStatus:O,showLoadingModal:U,toolsLoading:Ne,promptsLoading:Re,resourcesLoading:xe,toolsLoaded:J,promptsLoaded:ee,resourcesLoaded:X,loadTools:w,loadPrompts:N,loadResources:le,handleCallTool:async()=>{if(u)try{const fe=(tt=>{try{return JSON.parse(tt)}catch{return null}})(d);if(fe===null){Y("Invalid JSON in arguments");return}const Fe=await K("tools/call",{name:u.name,arguments:fe});y(Fe)}catch(Z){y({error:Z.message})}},handleGetPrompt:async()=>{if(g)try{const fe=(tt=>{try{return JSON.parse(tt)}catch{return null}})(S);if(fe===null){Y("Invalid JSON in arguments");return}const Fe=await K("prompts/get",{name:g.name,arguments:fe});_(Fe)}catch(Z){_({error:Z.message})}},handleReadResource:async()=>{if(z)try{const Z=await K("resources/read",{uri:z.uri});I(Z)}catch(Z){I({error:Z.message})}},availableServers:W,selectedServer:$,setSelectedServer:H}}function dy(){const{activeSection:r,setActiveSection:s,tools:u,prompts:p,resources:d,loading:f,error:x,selectedTool:y,setSelectedTool:g,toolArgs:j,setToolArgs:S,toolResult:b,selectedPrompt:T,setSelectedPrompt:_,promptArgs:z,setPromptArgs:R,promptResult:P,selectedResource:I,setSelectedResource:O,resourceResult:U,serverStatus:W,showLoadingModal:$,toolsLoading:H,promptsLoading:K,resourcesLoading:V,toolsLoaded:G,promptsLoaded:Y,resourcesLoaded:ce,loadTools:Se,loadPrompts:ve,loadResources:Ee,handleCallTool:Ne,handleGetPrompt:Re,handleReadResource:xe,availableServers:J,selectedServer:ee,setSelectedServer:X}=cy();return l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
30
+ ${s}`:"")}function Lx({request:r,onClose:s,requests:u=[]}){const[p,d]=L.useState("details"),f=L.useRef(null),x=L.useRef(p);if(L.useEffect(()=>{x.current!==p&&f.current&&(Ps(f.current,{duration:300}),x.current=p)},[p]),!r)return null;const y=W=>{if(W.jsonrpc_method)return W.jsonrpc_method;if(W.direction==="request"){if(W.body_json)try{const $=typeof W.body_json=="string"?JSON.parse(W.body_json):W.body_json;if($&&typeof $=="object"&&$.method)return $.method}catch{}if(W.body_raw)try{const $=typeof W.body_raw=="string"?JSON.parse(W.body_raw):W.body_raw;if($&&typeof $=="object"&&$.method)return $.method}catch{}}return null},j=(()=>{const W=($,H)=>{if($.session_id!==H.session_id)return!1;const K=y($),V=y(H);return!K||!V?$.jsonrpc_id&&H.jsonrpc_id?$.jsonrpc_id===H.jsonrpc_id:!1:K!==V?!1:$.jsonrpc_id&&H.jsonrpc_id?$.jsonrpc_id===H.jsonrpc_id:!0};return r.direction==="request"?u.find($=>$.direction==="response"&&W(r,$)&&$.frame_number>r.frame_number):u.find($=>$.direction==="request"&&W($,r)&&$.frame_number<r.frame_number)})(),S=r.direction==="request"?r:j||r,b=r.direction==="response"?r:j,T=S?.headers_json?JSON.parse(S.headers_json):{},_=S?.body_json?JSON.parse(S.body_json):S?.body_raw,z=S?Hc(T,S.body_raw):"",R=S?Ac(z):[],P=b?.headers_json?JSON.parse(b.headers_json):{},I=b?.body_json?JSON.parse(b.body_json):b?.body_raw,O=b?Hc(P,b.body_raw):"",U=b?Ac(O):[];return l.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",background:o.bgPrimary},children:[l.jsx(jx,{request:r,onClose:s,matchingPair:j}),l.jsx(Px,{tabs:["details","hex","raw"],activeTab:p,onTabChange:d}),l.jsxs("div",{ref:f,style:{flex:1,overflow:"auto",background:o.bgPrimary},children:[p==="details"&&l.jsx(bx,{request:S,response:b,requestHeaders:T,requestBody:_,responseHeaders:P,responseBody:I}),p==="hex"&&l.jsx(wx,{requestHexLines:R,responseHexLines:U,hasRequest:!!S,hasResponse:!!b}),p==="raw"&&l.jsx(Tx,{requestFullText:z,responseFullText:O,hasRequest:!!S,hasResponse:!!b})]})]})}function zx({stats:r,onExport:s}){return l.jsxs("div",{style:{display:"flex",gap:"16px",alignItems:"center",marginLeft:"auto"},children:[r&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Total:"," ",l.jsx("span",{style:{color:o.textPrimary,fontWeight:"500"},children:r.total_packets||0})]}),l.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Requests:"," ",l.jsx("span",{style:{color:o.accentBlue,fontWeight:"500"},children:r.total_requests||0})]}),l.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Responses:"," ",l.jsx("span",{style:{color:o.accentGreen,fontWeight:"500"},children:r.total_responses||0})]}),l.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Errors:"," ",l.jsx("span",{style:{color:o.error,fontWeight:"500"},children:r.total_errors||0})]}),l.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Sessions:"," ",l.jsx("span",{style:{color:o.textPrimary,fontWeight:"500"},children:r.unique_sessions||0})]})]}),l.jsxs("div",{style:{display:"flex",gap:"6px",alignItems:"center",marginLeft:"12px",paddingLeft:"12px",borderLeft:`1px solid ${o.borderLight}`},children:[l.jsxs("button",{type:"button",onClick:()=>s("json"),style:{padding:"8px 14px",background:o.buttonPrimary,border:"none",color:o.textInverse,fontSize:"12px",fontFamily:v.body,fontWeight:"500",borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`},onMouseEnter:u=>{ge({targets:u.currentTarget,background:o.buttonPrimaryHover,translateY:-1,boxShadow:[`0 2px 4px ${o.shadowSm}`,`0 4px 8px ${o.shadowMd}`],duration:200,easing:"easeOutQuad"})},onMouseLeave:u=>{ge({targets:u.currentTarget,background:o.buttonPrimary,translateY:0,boxShadow:[`0 4px 8px ${o.shadowMd}`,`0 2px 4px ${o.shadowSm}`],duration:200,easing:"easeOutQuad"})},title:"Export as JSON",children:[l.jsx(Jc,{size:14,stroke:1.5}),"Export"]}),l.jsxs("select",{onChange:u=>s(u.target.value),value:"",style:{padding:"8px 10px",background:o.bgCard,border:`1px solid ${o.borderLight}`,color:o.textPrimary,fontSize:"11px",fontFamily:v.body,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s"},onFocus:u=>{u.currentTarget.style.borderColor=o.accentBlue},onBlur:u=>{u.currentTarget.style.borderColor=o.borderLight},children:[l.jsx("option",{value:"",disabled:!0,children:"Format"}),l.jsx("option",{value:"json",children:"JSON"}),l.jsx("option",{value:"csv",children:"CSV"}),l.jsx("option",{value:"txt",children:"TXT"})]})]})]})}function wn({type:r="text",placeholder:s,value:u,onChange:p,style:d={},...f}){const x={padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderLight}`,color:o.textPrimary,fontSize:"13px",fontFamily:r==="number"||s?.includes("JSON-RPC")||s?.includes("HTTP")?v.mono:v.body,borderRadius:"8px",transition:"all 0.2s",...d},y=j=>{ge({targets:j.currentTarget,borderColor:o.accentBlue,boxShadow:[`0 0 0 0px ${o.accentBlue}20`,`0 0 0 3px ${o.accentBlue}20`],duration:200,easing:"easeOutQuad"})},g=j=>{ge({targets:j.currentTarget,borderColor:o.borderLight,boxShadow:"none",duration:200,easing:"easeOutQuad"})};return l.jsx("input",{type:r,placeholder:s,value:u||"",onChange:p,style:x,onFocus:y,onBlur:g,...f})}function Ex({filters:r,onFilterChange:s,stats:u,onClear:p}){const d=L.useRef(null),[f,x]=L.useState(!1);L.useEffect(()=>{d.current&&Ps(d.current,{duration:400})},[]);const y=async(g="json")=>{try{const j=new URLSearchParams;r.search&&j.append("search",r.search),r.serverName&&j.append("serverName",r.serverName),r.sessionId&&j.append("sessionId",r.sessionId),r.method&&j.append("method",r.method),r.jsonrpcMethod&&j.append("jsonrpcMethod",r.jsonrpcMethod),r.statusCode&&j.append("statusCode",r.statusCode),r.jsonrpcId&&j.append("jsonrpcId",r.jsonrpcId),j.append("format",g);const b=await(await fetch(`/api/requests/export?${j}`)).blob(),T=window.URL.createObjectURL(b),_=document.createElement("a");_.href=T;const z=g==="csv"?"csv":g==="txt"?"txt":"json";_.download=`mcp-shark-traffic-${new Date().toISOString().replace(/[:.]/g,"-")}.${z}`,document.body.appendChild(_),_.click(),window.URL.revokeObjectURL(T),document.body.removeChild(_)}catch(j){console.error("Failed to export traffic:",j),alert("Failed to export traffic. Please try again.")}};return l.jsxs("div",{ref:d,"data-tour":"filters",style:{padding:"12px 16px",borderBottom:`1px solid ${o.borderLight}`,background:o.bgSecondary,display:"flex",gap:"10px",alignItems:"center",flexWrap:"wrap",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[l.jsxs("div",{style:{position:"relative",width:"300px"},children:[l.jsx(Xc,{size:16,stroke:1.5,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:o.textTertiary,pointerEvents:"none",zIndex:1}}),l.jsx(wn,{type:"text",placeholder:"Search everything (partial match)...",value:r.search||"",onChange:g=>s({...r,search:g.target.value||null}),style:{width:"100%",fontWeight:r.search?"500":"400",paddingLeft:"36px"}})]}),l.jsx(wn,{type:"text",placeholder:"MCP Server Name...",value:r.serverName||"",onChange:g=>s({...r,serverName:g.target.value||null}),style:{width:"200px"}}),l.jsx(wn,{type:"text",placeholder:"Session ID...",value:r.sessionId||"",onChange:g=>s({...r,sessionId:g.target.value||null}),style:{width:"200px"}}),l.jsx(wn,{type:"text",placeholder:"HTTP Method...",value:r.method||"",onChange:g=>s({...r,method:g.target.value||null}),style:{width:"150px"}}),l.jsx(wn,{type:"text",placeholder:"JSON-RPC Method...",value:r.jsonrpcMethod||"",onChange:g=>s({...r,jsonrpcMethod:g.target.value||null}),style:{width:"200px"}}),l.jsx(wn,{type:"number",placeholder:"Status Code...",value:r.statusCode||"",onChange:g=>s({...r,statusCode:g.target.value?Number.parseInt(g.target.value):null}),style:{width:"120px"}}),l.jsx(wn,{type:"text",placeholder:"JSON-RPC ID...",value:r.jsonrpcId||"",onChange:g=>s({...r,jsonrpcId:g.target.value||null}),style:{width:"150px"}}),l.jsx(zx,{stats:u,onExport:y}),l.jsxs("button",{type:"button",onClick:()=>x(!0),style:{padding:"8px 14px",background:o.buttonDanger,border:"none",color:o.textInverse,fontSize:"12px",fontFamily:v.body,fontWeight:"500",borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`,marginLeft:"12px"},onMouseEnter:g=>{ge({targets:g.currentTarget,background:o.buttonDangerHover,translateY:-1,boxShadow:[`0 2px 4px ${o.shadowSm}`,`0 4px 8px ${o.shadowMd}`],duration:200,easing:"easeOutQuad"})},onMouseLeave:g=>{ge({targets:g.currentTarget,background:o.buttonDanger,translateY:0,boxShadow:[`0 4px 8px ${o.shadowMd}`,`0 2px 4px ${o.shadowSm}`],duration:200,easing:"easeOutQuad"})},title:"Clear all captured traffic",children:[l.jsx(ri,{size:14,stroke:1.5}),"Clear"]}),l.jsx(od,{isOpen:f,onClose:()=>x(!1),onConfirm:async()=>{try{const g=await fetch("/api/requests/clear",{method:"POST"});if(g.ok)p&&p();else{const j=await g.json();alert(`Failed to clear traffic: ${j.error||"Unknown error"}`)}}catch(g){console.error("Failed to clear traffic:",g),alert("Failed to clear traffic. Please try again.")}},title:"Clear All Captured Traffic",message:"Are you sure you want to delete all captured traffic? This action cannot be undone and will permanently remove all requests and responses from the database.",confirmText:"Clear All",cancelText:"Cancel",danger:!0})]})}const Te={LIFECYCLE:"lifecycle",TOOLS:"tools",RESOURCES:"resources",PROMPTS:"prompts",NOTIFICATIONS:"notifications",CLIENT_FEATURES:"client-features",OTHER:"other"};function Rx(r){return r?r==="initialize"||r==="notifications/initialized"?Te.LIFECYCLE:r.startsWith("tools/")?Te.TOOLS:r.startsWith("resources/")?Te.RESOURCES:r.startsWith("prompts/")?Te.PROMPTS:r.startsWith("notifications/")?Te.NOTIFICATIONS:r.startsWith("elicitation/")||r.startsWith("sampling/")||r.startsWith("logging/")?Te.CLIENT_FEATURES:Te.OTHER:Te.OTHER}function Mx(r){return{[Te.LIFECYCLE]:"Lifecycle",[Te.TOOLS]:"Tools",[Te.RESOURCES]:"Resources",[Te.PROMPTS]:"Prompts",[Te.NOTIFICATIONS]:"Notifications",[Te.CLIENT_FEATURES]:"Client Features",[Te.OTHER]:"Other"}[r]||"Unknown"}function Fx(r){return{[Te.LIFECYCLE]:qo,[Te.TOOLS]:kg,[Te.RESOURCES]:Zf,[Te.PROMPTS]:dg,[Te.NOTIFICATIONS]:Af,[Te.CLIENT_FEATURES]:Cg,[Te.OTHER]:Rc}[r]||Rc}function Ix(r){const s=Cd(r),u=new Map;return s.forEach(p=>{const d=p.request||p.response;if(!d)return;const f=d.session_id||"__NO_SESSION__",x=ni(d),y=Rx(x||"");u.has(f)||u.set(f,{sessionId:f==="__NO_SESSION__"?null:f,categories:new Map,firstTimestamp:d.timestamp_iso});const g=u.get(f);g.categories.has(y)||g.categories.set(y,[]),g.categories.get(y).push(p),new Date(d.timestamp_iso)<new Date(g.firstTimestamp)&&(g.firstTimestamp=d.timestamp_iso)}),Array.from(u.entries()).map(([p,d])=>({sessionId:d.sessionId,firstTimestamp:d.firstTimestamp,categories:Array.from(d.categories.entries()).map(([f,x])=>({category:f,label:Mx(f),pairs:x.sort((y,g)=>{const j=(y.request||y.response)?.timestamp_iso||"",S=(g.request||g.response)?.timestamp_iso||"";return new Date(j)-new Date(S)})})).sort((f,x)=>{const y=[Te.LIFECYCLE,Te.TOOLS,Te.RESOURCES,Te.PROMPTS,Te.NOTIFICATIONS,Te.CLIENT_FEATURES,Te.OTHER],g=y.indexOf(f.category),j=y.indexOf(x.category);return g-j})})).sort((p,d)=>new Date(d.firstTimestamp)-new Date(p.firstTimestamp))}const $x=({size:r=12,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle"},role:"img","aria-label":"Chevron down icon",children:[l.jsx("title",{children:"Chevron down icon"}),l.jsx("polyline",{points:"6 9 12 15 18 9"})]}),Nx=({size:r=12,color:s="currentColor"})=>l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle"},role:"img","aria-label":"Chevron right icon",children:[l.jsx("title",{children:"Chevron right icon"}),l.jsx("polyline",{points:"9 18 15 12 9 6"})]});function Uc({children:r,onClick:s,isExpanded:u,indent:p=0}){return l.jsx("tr",{onClick:s,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),s())},tabIndex:0,"aria-label":`Toggle group ${r}`,style:{cursor:"pointer",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,borderTop:`1px solid ${o.borderLight}`},onMouseEnter:d=>{d.currentTarget.style.background=o.bgCard},onMouseLeave:d=>{d.currentTarget.style.background=o.bgSecondary},children:l.jsxs("td",{colSpan:11,style:{padding:p>0?"12px 16px 12px 40px":"12px 16px",color:o.textPrimary,fontFamily:v.body,fontWeight:"600",fontSize:p>0?"11px":"12px"},children:[l.jsx("span",{style:{marginRight:"8px",userSelect:"none",display:"inline-flex",alignItems:"center"},children:u?l.jsx($x,{size:12}):l.jsx(Nx,{size:12})}),r]})})}function Ox({response:r,selected:s,firstRequestTime:u,onSelect:p}){const d=s?.frame_number===r.frame_number,{source:f,dest:x}=Ts(r),y=js(r.timestamp_iso,u);return l.jsxs("tr",{onClick:()=>p(r),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p(r))},tabIndex:0,"aria-label":`Select orphaned response ${r.frame_number}`,style:{cursor:"pointer",background:d?o.bgSelected:o.bgUnpaired,borderBottom:`1px solid ${o.borderLight}`,fontFamily:v.body,transition:"background-color 0.15s ease",opacity:.85},onMouseEnter:g=>{d||(g.currentTarget.style.background=Xn(o.accentOrange,.1))},onMouseLeave:g=>{d||(g.currentTarget.style.background=o.bgUnpaired)},children:[l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,textAlign:"right",fontFamily:v.mono,fontSize:"12px"},children:l.jsxs("span",{style:{color:o.accentOrange,fontWeight:"500"},children:["#",r.frame_number," (orphaned)"]})}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:y}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.body,fontSize:"12px"},children:Cs(r.timestamp_iso)}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentOrange,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:f}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentOrange,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:x}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:r.protocol||"HTTP"}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textSecondary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:"-"}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:l.jsx("div",{style:{color:r.status_code>=400?o.error:r.status_code>=300?o.warning:o.success,fontWeight:"600"},children:r.status_code||"-"})}),l.jsx("td",{style:{padding:"16px",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:ai(r)})]})}const Bx=({size:r=12,rotated:s=!1})=>l.jsx(ps,{size:r,stroke:1.5,style:{display:"inline-block",verticalAlign:"middle",transform:s?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s ease"}});function Dx({request:r,response:s,selected:u,firstRequestTime:p,onSelect:d,isExpanded:f,onToggleExpand:x,isUnpaired:y}){const g=u?.frame_number===r.frame_number,{source:j,dest:S}=Ts(r),b=js(r.timestamp_iso,p),T=!!s;return l.jsx(l.Fragment,{children:l.jsxs("tr",{onClick:()=>d(r),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),d(r))},tabIndex:0,"aria-label":`Select request ${r.frame_number}`,style:{cursor:"pointer",background:g?o.bgSelected:y?o.bgUnpaired:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontFamily:v.body,transition:"background-color 0.15s ease",opacity:y?.85:1},onMouseEnter:_=>{g||(_.currentTarget.style.background=y?Xn(o.accentOrange,.1):o.bgCard)},onMouseLeave:_=>{g||(_.currentTarget.style.background=y?o.bgUnpaired:o.bgSecondary)},children:[l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,textAlign:"right",fontFamily:v.mono,fontSize:"12px"},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"flex-end"},children:[T&&l.jsx("button",{type:"button",onClick:_=>{_.stopPropagation(),x()},style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",color:o.textSecondary},onMouseEnter:_=>{_.currentTarget.style.color=o.textPrimary},onMouseLeave:_=>{_.currentTarget.style.color=o.textSecondary},children:l.jsx(Bx,{size:14,rotated:!f})}),l.jsxs("span",{style:{color:y?o.accentOrange:o.accentBlue,fontWeight:"500"},children:["#",r.frame_number,y&&l.jsx("span",{style:{fontSize:"10px",color:o.textSecondary,marginLeft:"4px",fontStyle:"italic"},children:"(no response)"})]})]})}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:b}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.body,fontSize:"12px"},children:Cs(r.timestamp_iso)}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentBlue,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:j}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentBlue,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:S}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:r.protocol||"HTTP"}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:l.jsx("div",{style:{color:o.accentBlue},children:r.method||"REQ"})}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:T&&l.jsx("div",{style:{color:s.status_code>=400?o.error:s.status_code>=300?o.warning:o.success,fontWeight:"600"},children:s.status_code||"-"})}),l.jsx("td",{style:{padding:"16px",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:ai(r)})]})})}function Wx({response:r,selected:s,firstRequestTime:u,onSelect:p}){const d=s?.frame_number===r.frame_number,{source:f,dest:x}=Ts(r),y=js(r.timestamp_iso,u);return l.jsxs("tr",{onClick:()=>p(r),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p(r))},tabIndex:0,"aria-label":`Select response ${r.frame_number}`,style:{cursor:"pointer",background:d&&s?.frame_number===r.frame_number?o.bgSelected:o.bgTertiary,borderBottom:`1px solid ${o.borderLight}`,fontFamily:v.body,transition:"background-color 0.15s ease"},onMouseEnter:g=>{d&&s?.frame_number===r.frame_number||(g.currentTarget.style.background=o.bgSecondary)},onMouseLeave:g=>{d&&s?.frame_number===r.frame_number||(g.currentTarget.style.background=o.bgTertiary)},children:[l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,textAlign:"right",fontFamily:v.mono,fontSize:"12px",paddingLeft:"40px"},children:l.jsxs("span",{style:{color:o.accentGreen,fontWeight:"500"},children:["#",r.frame_number]})}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:y}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.body,fontSize:"12px"},children:Cs(r.timestamp_iso)}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentGreen,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:f}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentGreen,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:x}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:r.protocol||"HTTP"}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textSecondary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:"-"}),l.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:l.jsx("div",{style:{color:r.status_code>=400?o.error:r.status_code>=300?o.warning:o.success,fontWeight:"600"},children:r.status_code||"-"})}),l.jsx("td",{style:{padding:"16px",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:ai(r)})]})}function Ld({pair:r,request:s,selected:u,firstRequestTime:p,onSelect:d,isExpanded:f=!1,onToggleExpand:x=()=>{}}){const g=((_,z)=>_?{request:_.request,response:_.response}:z?{request:z,response:null}:null)(r,s);if(!g)return null;const{request:j,response:S}=g,b=!j||!S;if(!j&&S)return l.jsx(Ox,{response:S,selected:u,firstRequestTime:p,onSelect:d});if(!j)return null;const T=!!S;return l.jsxs(l.Fragment,{children:[l.jsx(Dx,{request:j,response:S,selected:u,firstRequestTime:p,onSelect:d,isExpanded:f,onToggleExpand:x,isUnpaired:b}),T&&f&&l.jsx(Wx,{response:S,selected:u,firstRequestTime:p,onSelect:d,request:j})]})}function Ax({groupedData:r,selected:s,firstRequestTime:u,onSelect:p,expandedSessions:d,expandedCategories:f,onToggleSession:x,onToggleCategory:y}){return l.jsx("tbody",{children:r.map(g=>{const j=g.sessionId||"__NO_SESSION__",S=d.has(j);return l.jsxs(Zo.Fragment,{children:[l.jsxs(Uc,{onClick:()=>x(j),isExpanded:S,indent:0,children:[l.jsxs("span",{style:{color:o.accentBlue,marginRight:"8px"},children:["Session: ",g.sessionId||"No Session"]}),l.jsxs("span",{style:{color:o.textTertiary,fontSize:"11px",fontWeight:"400"},children:["(",g.categories.reduce((b,T)=>b+T.pairs.length,0)," ","operations)"]})]}),S&&g.categories.map(b=>{const T=`${j}::${b.category}`,_=f.has(T);return l.jsxs(Zo.Fragment,{children:[l.jsxs(Uc,{onClick:()=>y(T),isExpanded:_,indent:1,children:[l.jsx("span",{style:{marginRight:"8px",display:"inline-flex",alignItems:"center"},children:Zo.createElement(Fx(b.category),{size:16,stroke:1.5,color:o.accentBlue})}),l.jsx("span",{style:{color:o.textPrimary},children:b.label}),l.jsxs("span",{style:{color:o.textTertiary,fontSize:"11px",fontWeight:"400",marginLeft:"8px"},children:["(",b.pairs.length," ",b.pairs.length===1?"operation":"operations",")"]})]}),_&&b.pairs.map(z=>l.jsx(Ld,{pair:z,selected:s,firstRequestTime:u,onSelect:p,isExpanded:!1,onToggleExpand:()=>{}},z.frame_number))]},T)})]},j)})})}function Hx({columnWidths:r}){return l.jsx("thead",{style:{position:"sticky",top:0,background:o.bgSecondary,zIndex:10,boxShadow:`0 2px 4px ${o.shadowSm}`},children:l.jsxs("tr",{children:[l.jsx("th",{style:{padding:"12px 16px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.frame}px`,minWidth:`${r.frame}px`,color:o.textSecondary,fontWeight:"600",fontFamily:v.body,fontSize:"11px",textTransform:"uppercase",letterSpacing:"0.05em",background:o.bgSecondary},children:"No."}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.time}px`,minWidth:`${r.time}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Time"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.datetime}px`,minWidth:`${r.datetime}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Date/Time"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.source}px`,minWidth:`${r.source}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Source"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.destination}px`,minWidth:`${r.destination}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Destination"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.protocol}px`,minWidth:`${r.protocol}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Protocol"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.method}px`,minWidth:`${r.method}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Method"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.status}px`,minWidth:`${r.status}px`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Status"}),l.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,color:o.textPrimary,fontWeight:"600",fontFamily:v.body,fontSize:"11px"},children:"Endpoint"})]})})}function Ux({viewMode:r,onViewModeChange:s}){return l.jsxs("div",{"data-tour":"view-modes",style:{display:"flex",borderBottom:`1px solid ${o.borderLight}`,background:o.bgSecondary,padding:"0 12px",boxShadow:`0 1px 3px ${o.shadowSm}`,flexShrink:0},children:[l.jsxs("button",{type:"button",onClick:()=>s("general"),style:{padding:"10px 18px",background:r==="general"?o.bgCard:"transparent",fontFamily:v.body,border:"none",borderBottom:r==="general"?`2px solid ${o.accentBlue}`:"2px solid transparent",color:r==="general"?o.textPrimary:o.textSecondary,borderRadius:"8px 8px 0 0",cursor:"pointer",fontSize:"12px",fontWeight:r==="general"?"500":"normal",display:"flex",alignItems:"center",gap:"6px"},onMouseEnter:u=>{r!=="general"&&(u.currentTarget.style.background=o.bgHover,u.currentTarget.style.color=o.textPrimary)},onMouseLeave:u=>{r!=="general"&&(u.currentTarget.style.background="transparent",u.currentTarget.style.color=o.textSecondary)},children:[l.jsx(sg,{size:16,stroke:1.5}),"General List"]}),l.jsxs("button",{type:"button",onClick:()=>s("groupedByMcp"),style:{padding:"10px 18px",background:r==="groupedByMcp"?o.bgCard:"transparent",fontFamily:v.body,border:"none",borderBottom:r==="groupedByMcp"?`2px solid ${o.accentBlue}`:"2px solid transparent",color:r==="groupedByMcp"?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"12px",fontWeight:r==="groupedByMcp"?"500":"normal",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",gap:"6px"},onMouseEnter:u=>{r!=="groupedByMcp"&&(u.currentTarget.style.background=o.bgHover,u.currentTarget.style.color=o.textPrimary)},onMouseLeave:u=>{r!=="groupedByMcp"&&(u.currentTarget.style.background="transparent",u.currentTarget.style.color=o.textSecondary)},children:[l.jsx(Gc,{size:16,stroke:1.5}),"MCP Protocol View"]})]})}function Vx({requests:r,selected:s,onSelect:u,firstRequestTime:p}){const[d,f]=L.useState("general"),[x]=L.useState({frame:90,time:120,datetime:180,source:200,destination:200,protocol:90,method:90,status:80,endpoint:500}),[y,g]=L.useState(new Set),[j,S]=L.useState(new Set),[b,T]=L.useState(new Set),_=L.useRef(null),z=L.useRef(0),R=L.useMemo(()=>Ix(r),[r]);L.useEffect(()=>{if(_.current&&r.length>0){const $=_.current.querySelectorAll("tr");if($.length>0){if(r.length>z.current){const H=Array.from($).slice(z.current);H.length>0&&Wc(H,{delay:30,duration:300})}else Wc($,{delay:20,duration:300});z.current=r.length}}},[r]),L.useEffect(()=>{if(d==="groupedByMcp"){const $=new Set(R.map(H=>H.sessionId||"__NO_SESSION__"));S(H=>{const K=new Set(H);return $.forEach(V=>K.add(V)),K}),T(H=>{const K=new Set(H);return R.forEach(V=>{const G=V.sessionId||"__NO_SESSION__";V.categories.forEach(Y=>{K.add(`${G}::${Y.category}`)})}),K})}},[R,d]);const P=$=>{S(H=>{const K=new Set(H);return K.has($)?K.delete($):K.add($),K})},I=$=>{T(H=>{const K=new Set(H);return K.has($)?K.delete($):K.add($),K})},O=L.useMemo(()=>Cd(r),[r]),U=$=>{g(H=>{const K=new Set(H);return K.has($)?K.delete($):K.add($),K})},W=()=>l.jsx("tbody",{ref:_,children:O.map($=>l.jsx(Ld,{pair:$,selected:s,firstRequestTime:p,onSelect:u,isExpanded:y.has($.frame_number),onToggleExpand:()=>U($.frame_number)},$.frame_number))});return l.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",background:o.bgPrimary,minHeight:0,overflow:"hidden"},children:[l.jsx(Ux,{viewMode:d,onViewModeChange:f}),l.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"auto",minHeight:0,WebkitOverflowScrolling:"touch"},children:l.jsxs("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0,fontSize:"12px",fontFamily:v.body,background:o.bgPrimary},children:[l.jsx(Hx,{columnWidths:x}),d==="general"?W():l.jsx(Ax,{groupedData:R,expandedSessions:j,expandedCategories:b,onToggleSession:P,onToggleCategory:I,selected:s,firstRequestTime:p,onSelect:u})]})})]})}function Qx({requests:r,selected:s,onSelect:u,filters:p,onFilterChange:d,stats:f,firstRequestTime:x,onClear:y}){const g=L.useRef(null);return L.useEffect(()=>{s&&g.current&&setTimeout(()=>{g.current&&(g.current.style.opacity="0",g.current.style.transform="translateX(600px)",_x(g.current,{width:600}))},10)},[s]),l.jsxs("div",{"data-tab-content":!0,style:{display:"flex",flex:1,overflow:"hidden",minHeight:0},children:[l.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,minHeight:0},children:[l.jsx(Ex,{filters:p,onFilterChange:d,stats:f,onExport:()=>{},onClear:y}),l.jsx(Vx,{requests:r,selected:s,onSelect:u,firstRequestTime:x})]}),s&&l.jsx("div",{ref:g,style:{width:"40%",minWidth:"500px",maxWidth:"700px",borderLeft:`1px solid ${o.borderLight}`,overflow:"hidden",display:"flex",flexDirection:"column",background:o.bgCard,flexShrink:0},children:l.jsx(Lx,{request:s,onClose:()=>u(null),requests:r})})]})}function an(r,s){s.search&&r.append("search",s.search),s.serverName&&r.append("serverName",s.serverName),s.sessionId&&r.append("sessionId",s.sessionId),s.method&&r.append("method",s.method),s.jsonrpcMethod&&r.append("jsonrpcMethod",s.jsonrpcMethod),s.statusCode&&r.append("statusCode",s.statusCode),s.jsonrpcId&&r.append("jsonrpcId",s.jsonrpcId)}function Yx(){const[r,s]=L.useState("traffic"),[u,p]=L.useState([]),[d,f]=L.useState(null),[x,y]=L.useState({}),[g,j]=L.useState(null),[S,b]=L.useState(null),[T,_]=L.useState(!1),[z,R]=L.useState(!0),P=L.useRef(null),I=L.useRef(r),O=L.useRef(x),U=async()=>{try{const $=new URLSearchParams;an($,x);const K=await(await fetch(`/api/statistics?${$}`)).json();j(K)}catch($){console.error("Failed to load statistics:",$)}},W=async()=>{try{const $=new URLSearchParams;an($,x),$.append("limit","5000");const K=await(await fetch(`/api/requests?${$}`)).json();if(p(K),K.length>0){const V=K[K.length-1]?.timestamp_iso;V&&b(V)}await U()}catch($){console.error("Failed to load requests:",$)}};return L.useEffect(()=>{const $=async()=>{try{const G=await(await fetch("/api/help/state")).json();R(G.dismissed||G.tourCompleted),!G.dismissed&&!G.tourCompleted&&setTimeout(()=>{_(!0)},500)}catch(V){console.error("Failed to load tour state:",V),setTimeout(()=>{_(!0)},500),R(!1)}},H=async()=>{try{const V=new URLSearchParams;an(V,x),V.append("limit","5000");const Y=await(await fetch(`/api/requests?${V}`)).json();if(p(Y),Y.length>0){const Ee=Y[Y.length-1]?.timestamp_iso;Ee&&b(Ee)}const ce=new URLSearchParams;an(ce,x);const ve=await(await fetch(`/api/statistics?${ce}`)).json();j(ve)}catch(V){console.error("Failed to load requests:",V)}};$(),H();const K=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;try{const V=new WebSocket(K);P.current=V,V.onmessage=async G=>{const Y=JSON.parse(G.data);if(Y.type==="update"){if(p(Y.data),Y.data.length>0){const ce=Y.data[Y.data.length-1]?.timestamp_iso;ce&&b(ce)}try{const ce=new URLSearchParams;an(ce,x);const ve=await(await fetch(`/api/statistics?${ce}`)).json();j(ve)}catch(ce){console.error("Failed to load statistics:",ce)}}},V.onerror=()=>{},V.onclose=()=>{}}catch{}return()=>{P.current&&P.current.readyState===WebSocket.OPEN&&P.current.close()}},[x]),L.useEffect(()=>{(async()=>{try{const H=new URLSearchParams;an(H,x),H.append("limit","5000");const V=await(await fetch(`/api/requests?${H}`)).json();if(p(V),V.length>0){const Se=V[V.length-1]?.timestamp_iso;Se&&b(Se)}const G=new URLSearchParams;an(G,x);const ce=await(await fetch(`/api/statistics?${G}`)).json();j(ce)}catch(H){console.error("Failed to load requests:",H)}})()},[x]),L.useEffect(()=>{O.current=x},[x]),L.useEffect(()=>{if(r!=="traffic")return;const $=setInterval(async()=>{try{const H=new URLSearchParams;an(H,O.current);const V=await(await fetch(`/api/statistics?${H}`)).json();j(V)}catch(H){console.error("Failed to load statistics:",H)}},2e3);return()=>clearInterval($)},[r]),{activeTab:r,setActiveTab:s,requests:u,selected:d,setSelected:f,filters:x,setFilters:y,stats:g,firstRequestTime:S,showTour:T,setShowTour:_,tourDismissed:z,prevTabRef:I,wsRef:P,loadRequests:W}}function Jx({show:r}){const s=L.useRef(null),u=L.useRef([]);return L.useEffect(()=>{r&&s.current?(ge({targets:s.current,opacity:[0,1],scale:[.9,1],duration:400,easing:"easeOutExpo"}),u.current.length>0&&ge({targets:u.current,translateY:[0,-10,0],duration:1200,delay:ge.stagger(200),loop:!0,easing:"easeInOutQuad"})):!r&&s.current&&ge({targets:s.current,opacity:[1,0],scale:[1,.9],duration:300,easing:"easeInExpo",complete:()=>{s.current&&(s.current.style.display="none")}})},[r]),r?l.jsx("div",{ref:s,style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(245, 243, 240, 0.9)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,borderRadius:"8px",backdropFilter:"blur(2px)"},children:l.jsxs("div",{style:{background:o.bgCard,borderRadius:"16px",padding:"32px",boxShadow:`0 8px 32px ${o.shadowMd}`,maxWidth:"320px",width:"90%",textAlign:"center"},children:[l.jsx("h3",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"20px"},children:"Waiting for MCP server to start"}),l.jsx("div",{style:{display:"flex",justifyContent:"center",gap:"8px"},children:[0,1,2].map(p=>l.jsx("div",{ref:d=>{d&&(u.current[p]=d)},style:{width:"12px",height:"12px",borderRadius:"50%",background:o.accentBlue}},p))})]})}):null}function Kx({prompt:r,promptArgs:s,onPromptArgsChange:u,promptResult:p,onGetPrompt:d,loading:f}){return l.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsxs("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:["Get Prompt: ",r.name]}),l.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"prompt-args-textarea",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Arguments (JSON)"}),l.jsx("textarea",{id:"prompt-args-textarea",value:s,onChange:x=>u(x.target.value),style:{width:"100%",minHeight:"150px",padding:"10px",border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontFamily:v.mono,fontSize:"12px",background:o.bgCard,color:o.textPrimary,resize:"vertical"}})]}),l.jsx("button",{type:"button",onClick:d,disabled:f,style:{padding:"10px 20px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:f?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:f?.6:1},children:f?"Getting...":"Get Prompt"}),p&&l.jsxs("div",{children:[l.jsx("label",{htmlFor:"prompt-result-pre",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Result"}),l.jsx("pre",{id:"prompt-result-pre",style:{padding:"12px",background:o.bgSecondary,border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontSize:"12px",fontFamily:v.mono,color:p.error?o.error:o.textPrimary,overflow:"auto",maxHeight:"300px",margin:0},children:JSON.stringify(p,null,2)})]})]})]})}function _s({message:r}){return l.jsx("div",{style:{padding:"40px",textAlign:"center",color:o.textSecondary,fontFamily:v.body,fontSize:"13px"},children:r})}function Ls({message:r}){return l.jsx("div",{style:{padding:"40px",textAlign:"center",color:o.error,fontFamily:v.body,fontSize:"13px"},children:r})}function Zn({message:r}){return l.jsx("div",{style:{padding:"40px",textAlign:"center",color:o.textSecondary,fontFamily:v.body,fontSize:"13px"},children:r})}function Gx({prompt:r,isSelected:s,onClick:u}){return l.jsx("button",{type:"button",onClick:u,"aria-label":`Select prompt ${r.name}`,style:{padding:"16px 20px",margin:"4px 8px",borderRadius:"8px",cursor:"pointer",background:s?o.bgSelected:o.bgCard,border:s?`2px solid ${o.accentBlue}`:`1px solid ${o.borderLight}`,boxShadow:s?`0 2px 4px ${o.shadowSm}`:"none",transition:"all 0.2s ease",position:"relative",width:"100%",textAlign:"left"},onMouseEnter:p=>{s||(p.currentTarget.style.background=o.bgHover,p.currentTarget.style.borderColor=o.borderMedium,p.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:p=>{s||(p.currentTarget.style.background=o.bgCard,p.currentTarget.style.borderColor=o.borderLight,p.currentTarget.style.boxShadow="none")},children:l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[l.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:s?o.accentBlue:o.textTertiary,marginTop:"6px",flexShrink:0,transition:"background 0.2s"}}),l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsx("div",{style:{fontWeight:s?"600":"500",fontSize:"14px",color:o.textPrimary,marginBottom:r.description?"6px":"0",lineHeight:"1.4"},children:r.name}),r.description&&l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,lineHeight:"1.5",marginTop:"4px"},children:r.description})]})]})})}function Xx({serverStatus:r,promptsLoading:s,promptsLoaded:u,error:p,prompts:d,selectedPrompt:f,onSelectPrompt:x}){return l.jsx("div",{style:{flex:1,overflow:"auto",background:o.bgCard,position:"relative"},children:r?.running?s||!u?l.jsx(Zn,{message:"Loading prompts..."}):p?.includes("prompts:")?l.jsx(Ls,{message:`Error loading prompts: ${p.replace("prompts: ","")}`}):d.length===0?l.jsx(_s,{message:"No prompts available."}):l.jsx("div",{style:{padding:"8px 0"},children:d.map((y,g)=>l.jsx(Gx,{prompt:y,isSelected:f?.name===y.name,onClick:()=>x(y)},y.name||`prompt-${g}`))}):l.jsx(Zn,{message:"Waiting for MCP server to start..."})})}function Zx({prompts:r,selectedPrompt:s,onSelectPrompt:u,promptArgs:p,onPromptArgsChange:d,promptResult:f,onGetPrompt:x,loading:y,promptsLoading:g,promptsLoaded:j,serverStatus:S,error:b,onRefresh:T}){const _=z=>{u(z);const R=z.arguments?z.arguments.reduce((P,I)=>(P[I.name]=I.default!==void 0?I.default:"",P),{}):{};d(JSON.stringify(R,null,2))};return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("button",{type:"button",onClick:T,disabled:y||g,style:{padding:"8px 16px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:y||g?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:y||g?.6:1},children:g?"Loading...":"Refresh Prompts"}),l.jsx("span",{style:{color:o.textSecondary,fontSize:"13px"},children:g?"Loading prompts...":`${r.length} prompt${r.length!==1?"s":""} available`})]}),l.jsxs("div",{style:{display:"flex",gap:"16px",flex:1,minHeight:0},children:[l.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsx("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:"Available Prompts"}),l.jsx(Xx,{serverStatus:S,promptsLoading:g,promptsLoaded:j,error:b,prompts:r,selectedPrompt:s,onSelectPrompt:_})]}),s&&l.jsx(Kx,{prompt:s,promptArgs:p,onPromptArgsChange:d,promptResult:f,onGetPrompt:x,loading:y})]})]})}function qx({resource:r,resourceResult:s,onReadResource:u,loading:p}){return l.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsxs("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:["Read Resource: ",r.uri]}),l.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[l.jsx("button",{type:"button",onClick:u,disabled:p,style:{padding:"10px 20px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:p?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:p?.6:1},children:p?"Reading...":"Read Resource"}),s&&l.jsxs("div",{children:[l.jsx("label",{htmlFor:"resource-result-pre",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Result"}),l.jsx("pre",{id:"resource-result-pre",style:{padding:"12px",background:o.bgSecondary,border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontSize:"12px",fontFamily:v.mono,color:s.error?o.error:o.textPrimary,overflow:"auto",maxHeight:"400px",margin:0},children:JSON.stringify(s,null,2)})]})]})]})}function ey({resource:r,isSelected:s,onClick:u}){return l.jsx("button",{type:"button",onClick:u,"aria-label":`Select resource ${r.uri}`,style:{padding:"16px 20px",margin:"4px 8px",borderRadius:"8px",cursor:"pointer",background:s?o.bgSelected:o.bgCard,border:s?`2px solid ${o.accentBlue}`:`1px solid ${o.borderLight}`,boxShadow:s?`0 2px 4px ${o.shadowSm}`:"none",transition:"all 0.2s ease",position:"relative",width:"100%",textAlign:"left"},onMouseEnter:p=>{s||(p.currentTarget.style.background=o.bgHover,p.currentTarget.style.borderColor=o.borderMedium,p.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:p=>{s||(p.currentTarget.style.background=o.bgCard,p.currentTarget.style.borderColor=o.borderLight,p.currentTarget.style.boxShadow="none")},children:l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[l.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:s?o.accentBlue:o.textTertiary,marginTop:"6px",flexShrink:0,transition:"background 0.2s"}}),l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsx("div",{style:{fontWeight:s?"600":"500",fontSize:"14px",color:o.textPrimary,marginBottom:r.name||r.description?"6px":"0",lineHeight:"1.4",wordBreak:"break-word"},children:r.uri}),r.name&&l.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontWeight:"500",lineHeight:"1.5",marginTop:"4px"},children:r.name}),r.description&&l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,lineHeight:"1.5",marginTop:r.name?"2px":"4px"},children:r.description})]})]})})}function ty({serverStatus:r,resourcesLoading:s,resourcesLoaded:u,error:p,resources:d,selectedResource:f,onSelectResource:x}){return l.jsx("div",{style:{flex:1,overflow:"auto",background:o.bgCard,position:"relative"},children:r?.running?s||!u?l.jsx(Zn,{message:"Loading resources..."}):p?.includes("resources:")?l.jsx(Ls,{message:`Error loading resources: ${p.replace("resources: ","")}`}):d.length===0?l.jsx(_s,{message:"No resources available."}):l.jsx("div",{style:{padding:"8px 0"},children:d.map((y,g)=>l.jsx(ey,{resource:y,isSelected:f?.uri===y.uri,onClick:()=>x(y)},y.uri||`resource-${g}`))}):l.jsx(Zn,{message:"Waiting for MCP server to start..."})})}function ny({resources:r,selectedResource:s,onSelectResource:u,resourceResult:p,onReadResource:d,loading:f,resourcesLoading:x,resourcesLoaded:y,serverStatus:g,error:j,onRefresh:S}){return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("button",{type:"button",onClick:S,disabled:f||x,style:{padding:"8px 16px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:f||x?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:f||x?.6:1},children:x?"Loading...":"Refresh Resources"}),l.jsx("span",{style:{color:o.textSecondary,fontSize:"13px"},children:x?"Loading resources...":`${r.length} resource${r.length!==1?"s":""} available`})]}),l.jsxs("div",{style:{display:"flex",gap:"16px",flex:1,minHeight:0},children:[l.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsx("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:"Available Resources"}),l.jsx(ty,{serverStatus:g,resourcesLoading:x,resourcesLoaded:y,error:j,resources:r,selectedResource:s,onSelectResource:u})]}),s&&l.jsx(qx,{resource:s,resourceResult:p,onReadResource:d,loading:f})]})]})}function ry({tool:r,toolArgs:s,onToolArgsChange:u,toolResult:p,onCallTool:d,loading:f}){return l.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsxs("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:["Call Tool: ",r.name]}),l.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"tool-args-textarea",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Arguments (JSON)"}),l.jsx("textarea",{id:"tool-args-textarea",value:s,onChange:x=>u(x.target.value),style:{width:"100%",minHeight:"150px",padding:"10px",border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontFamily:v.mono,fontSize:"12px",background:o.bgCard,color:o.textPrimary,resize:"vertical"}})]}),l.jsx("button",{type:"button",onClick:d,disabled:f,style:{padding:"10px 20px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:f?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:f?.6:1},children:f?"Calling...":"Call Tool"}),p&&l.jsxs("div",{children:[l.jsx("label",{htmlFor:"tool-result-pre",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Result"}),l.jsx("pre",{id:"tool-result-pre",style:{padding:"12px",background:o.bgSecondary,border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontSize:"12px",fontFamily:v.mono,color:p.error?o.error:o.textPrimary,overflow:"auto",maxHeight:"300px",margin:0},children:JSON.stringify(p,null,2)})]})]})]})}function oy({tool:r,isSelected:s,onClick:u}){return l.jsx("button",{type:"button",onClick:u,"aria-label":`Select tool ${r.name}`,style:{padding:"16px 20px",margin:"4px 8px",borderRadius:"8px",cursor:"pointer",background:s?o.bgSelected:o.bgCard,border:s?`2px solid ${o.accentBlue}`:`1px solid ${o.borderLight}`,boxShadow:s?`0 2px 4px ${o.shadowSm}`:"none",transition:"all 0.2s ease",position:"relative",width:"100%",textAlign:"left"},onMouseEnter:p=>{s||(p.currentTarget.style.background=o.bgHover,p.currentTarget.style.borderColor=o.borderMedium,p.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:p=>{s||(p.currentTarget.style.background=o.bgCard,p.currentTarget.style.borderColor=o.borderLight,p.currentTarget.style.boxShadow="none")},children:l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[l.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:s?o.accentBlue:o.textTertiary,marginTop:"6px",flexShrink:0,transition:"background 0.2s"}}),l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsx("div",{style:{fontWeight:s?"600":"500",fontSize:"14px",color:o.textPrimary,marginBottom:r.description?"6px":"0",lineHeight:"1.4"},children:r.name}),r.description&&l.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,lineHeight:"1.5",marginTop:"4px"},children:r.description})]})]})})}function iy({serverStatus:r,toolsLoading:s,toolsLoaded:u,error:p,tools:d,selectedTool:f,onSelectTool:x}){return l.jsx("div",{style:{flex:1,overflow:"auto",background:o.bgCard,position:"relative"},children:r?.running?s||!u?l.jsx(Zn,{message:"Loading tools..."}):p?.includes("tools:")?l.jsx(Ls,{message:`Error loading tools: ${p.replace("tools: ","")}`}):d.length===0?l.jsx(_s,{message:"No tools available."}):l.jsx("div",{style:{padding:"8px 0"},children:d.map((y,g)=>l.jsx(oy,{tool:y,isSelected:f?.name===y.name,onClick:()=>x(y)},y.name||`tool-${g}`))}):l.jsx(Zn,{message:"Waiting for MCP server to start..."})})}function ly({tools:r,selectedTool:s,onSelectTool:u,toolArgs:p,onToolArgsChange:d,toolResult:f,onCallTool:x,loading:y,toolsLoading:g,toolsLoaded:j,serverStatus:S,error:b,onRefresh:T}){const _=z=>{u(z);const R=z.inputSchema?.properties?Object.keys(z.inputSchema.properties).reduce((P,I)=>{const O=z.inputSchema.properties[I];return P[I]=O.default!==void 0?O.default:"",P},{}):{};d(JSON.stringify(R,null,2))};return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("button",{type:"button",onClick:T,disabled:y||g,style:{padding:"8px 16px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:y||g?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:y||g?.6:1},children:g?"Loading...":"Refresh Tools"}),l.jsx("span",{style:{color:o.textSecondary,fontSize:"13px"},children:g?"Loading tools...":`${r.length} tool${r.length!==1?"s":""} available`})]}),l.jsxs("div",{style:{display:"flex",gap:"16px",flex:1,minHeight:0},children:[l.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsx("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:"Available Tools"}),l.jsx(iy,{serverStatus:S,toolsLoading:g,toolsLoaded:j,error:b,tools:r,selectedTool:s,onSelectTool:_})]}),s&&l.jsx(ry,{tool:s,toolArgs:p,onToolArgsChange:d,toolResult:f,onCallTool:x,loading:y})]})]})}function sy(r,s,u){const[p,d]=L.useState([]),[f,x]=L.useState([]),[y,g]=L.useState([]),[j,S]=L.useState(!1),[b,T]=L.useState(!1),[_,z]=L.useState(!1),[R,P]=L.useState(!1),[I,O]=L.useState(!1),[U,W]=L.useState(!1),$=L.useCallback(async()=>{if(!s){u("tools: No server selected"),P(!0);return}S(!0),u(null);try{const G=await r("tools/list");d(G?.tools||[]),P(!0)}catch(G){const Y=G.message||"Failed to load tools";u(`tools: ${Y}`),P(!0),console.error("Failed to load tools:",G)}finally{S(!1)}},[s,r,u]),H=L.useCallback(async()=>{if(!s){u("prompts: No server selected"),O(!0);return}T(!0),u(null);try{const G=await r("prompts/list");x(G?.prompts||[]),O(!0)}catch(G){const Y=G.message||"Failed to load prompts";u(`prompts: ${Y}`),O(!0),console.error("Failed to load prompts:",G)}finally{T(!1)}},[s,r,u]),K=L.useCallback(async()=>{if(!s){u("resources: No server selected"),W(!0);return}z(!0),u(null);try{const G=await r("resources/list");g(G?.resources||[]),W(!0)}catch(G){const Y=G.message||"Failed to load resources";u(`resources: ${Y}`),W(!0),console.error("Failed to load resources:",G)}finally{z(!1)}},[s,r,u]),V=L.useCallback(()=>{P(!1),O(!1),W(!1),d([]),x([]),g([])},[]);return{tools:p,prompts:f,resources:y,toolsLoading:j,promptsLoading:b,resourcesLoading:_,toolsLoaded:R,promptsLoaded:I,resourcesLoaded:U,loadTools:$,loadPrompts:H,loadResources:K,resetData:V}}function ay(r){const[s,u]=L.useState(!1),[p,d]=L.useState(null),[f,x]=L.useState(null),y=L.useRef(f);y.current=f;const g=L.useCallback(async(S,b={})=>{if(!r)throw new Error("No server selected");d(null),u(!0);try{const T={"Content-Type":"application/json"},_=y.current;_&&(T["Mcp-Session-Id"]=_);const z=await fetch("/api/playground/proxy",{method:"POST",headers:T,body:JSON.stringify({method:S,params:b,serverName:r})}),R=await z.json(),P=z.headers.get("Mcp-Session-Id")||z.headers.get("mcp-session-id")||R._sessionId;if(P&&P!==_&&x(P),!z.ok)throw new Error(R.error?.message||R.message||"Request failed");return R.result||R}catch(T){throw d(T.message),T}finally{u(!1)}},[r]),j=L.useCallback(()=>{x(null)},[]);return{makeMcpRequest:g,loading:s,error:p,setError:d,resetSession:j}}function uy(){const[r,s]=L.useState(null),[u,p]=L.useState(!1),[d,f]=L.useState([]),[x,y]=L.useState(null),g=L.useCallback(async()=>{try{const S=await fetch("/api/composite/status");if(!S.ok)throw new Error("Server not available");const b=await S.json();s(T=>{const _=T?.running;return b.running?p(z=>z&&!1):p(z=>!z||_?!0:z),b})}catch{s({running:!1}),p(b=>b||!0)}},[]),j=L.useCallback(async()=>{try{const S=await fetch("/api/composite/servers");if(S.ok){const b=await S.json();f(b.servers||[]),y(T=>!T&&b.servers&&b.servers.length>0?b.servers[0]:T)}}catch(S){console.error("Failed to load servers:",S)}},[]);return L.useEffect(()=>{j()},[j]),L.useEffect(()=>{g();const S=setInterval(g,2e3);return()=>clearInterval(S)},[g]),L.useEffect(()=>{d.length>0&&!x&&y(d[0])},[d,x]),{serverStatus:r,showLoadingModal:u,availableServers:d,selectedServer:x,setSelectedServer:y,checkServerStatus:g}}function cy(){const[r,s]=L.useState("tools"),[u,p]=L.useState(null),[d,f]=L.useState("{}"),[x,y]=L.useState(null),[g,j]=L.useState(null),[S,b]=L.useState("{}"),[T,_]=L.useState(null),[z,R]=L.useState(null),[P,I]=L.useState(null),{serverStatus:O,showLoadingModal:U,availableServers:W,selectedServer:$,setSelectedServer:H}=uy(),{makeMcpRequest:K,loading:V,error:G,setError:Y,resetSession:ce}=ay($),{tools:Se,prompts:ve,resources:Ee,toolsLoading:Ne,promptsLoading:Re,resourcesLoading:xe,toolsLoaded:J,promptsLoaded:ee,resourcesLoaded:X,loadTools:w,loadPrompts:N,loadResources:le,resetData:de}=sy(K,$,Y),pe=L.useRef(r);return pe.current=r,L.useEffect(()=>{if(!$||!O?.running)return;de(),p(null),j(null),R(null),y(null),_(null),I(null),f("{}"),b("{}"),ce(),Y(null);const Z=setTimeout(()=>{const fe=pe.current;fe==="tools"?w():fe==="prompts"?N():fe==="resources"&&le()},100);return()=>clearTimeout(Z)},[$,O?.running,de,w,N,le,ce,Y]),L.useEffect(()=>{if(!(!O?.running||!$)){if(r==="tools"&&!J&&!Ne){const Z=setTimeout(()=>{w()},100);return()=>clearTimeout(Z)}if(r==="prompts"&&!ee&&!Re){const Z=setTimeout(()=>{N()},100);return()=>clearTimeout(Z)}if(r==="resources"&&!X&&!xe){const Z=setTimeout(()=>{le()},100);return()=>clearTimeout(Z)}}},[r,O?.running,$,J,Ne,ee,Re,X,xe,w,N,le]),{activeSection:r,setActiveSection:s,tools:Se,prompts:ve,resources:Ee,loading:V,error:G,selectedTool:u,setSelectedTool:p,toolArgs:d,setToolArgs:f,toolResult:x,selectedPrompt:g,setSelectedPrompt:j,promptArgs:S,setPromptArgs:b,promptResult:T,selectedResource:z,setSelectedResource:R,resourceResult:P,serverStatus:O,showLoadingModal:U,toolsLoading:Ne,promptsLoading:Re,resourcesLoading:xe,toolsLoaded:J,promptsLoaded:ee,resourcesLoaded:X,loadTools:w,loadPrompts:N,loadResources:le,handleCallTool:async()=>{if(u)try{const fe=(tt=>{try{return JSON.parse(tt)}catch{return null}})(d);if(fe===null){Y("Invalid JSON in arguments");return}const Fe=await K("tools/call",{name:u.name,arguments:fe});y(Fe)}catch(Z){y({error:Z.message})}},handleGetPrompt:async()=>{if(g)try{const fe=(tt=>{try{return JSON.parse(tt)}catch{return null}})(S);if(fe===null){Y("Invalid JSON in arguments");return}const Fe=await K("prompts/get",{name:g.name,arguments:fe});_(Fe)}catch(Z){_({error:Z.message})}},handleReadResource:async()=>{if(z)try{const Z=await K("resources/read",{uri:z.uri});I(Z)}catch(Z){I({error:Z.message})}},availableServers:W,selectedServer:$,setSelectedServer:H}}function dy(){const{activeSection:r,setActiveSection:s,tools:u,prompts:p,resources:d,loading:f,error:x,selectedTool:y,setSelectedTool:g,toolArgs:j,setToolArgs:S,toolResult:b,selectedPrompt:T,setSelectedPrompt:_,promptArgs:z,setPromptArgs:R,promptResult:P,selectedResource:I,setSelectedResource:O,resourceResult:U,serverStatus:W,showLoadingModal:$,toolsLoading:H,promptsLoading:K,resourcesLoading:V,toolsLoaded:G,promptsLoaded:Y,resourcesLoaded:ce,loadTools:Se,loadPrompts:ve,loadResources:Ee,handleCallTool:Ne,handleGetPrompt:Re,handleReadResource:xe,availableServers:J,selectedServer:ee,setSelectedServer:X}=cy();return l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
31
31
  @keyframes spin {
32
32
  from { transform: rotate(0deg); }
33
33
  to { transform: rotate(360deg); }