@mcp-shark/mcp-shark 1.5.4 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -96
- package/bin/mcp-shark.js +1 -1
- package/core/configs/codex.js +68 -0
- package/core/configs/environment.js +51 -0
- package/{lib/common → core}/configs/index.js +16 -1
- package/core/constants/Defaults.js +15 -0
- package/core/constants/HttpStatus.js +14 -0
- package/core/constants/Server.js +20 -0
- package/core/constants/StatusCodes.js +25 -0
- package/core/constants/index.js +7 -0
- package/core/container/DependencyContainer.js +179 -0
- package/core/db/init.js +33 -0
- package/core/index.js +10 -0
- package/{mcp-server/lib/common/error.js → core/libraries/ErrorLibrary.js} +4 -0
- package/core/libraries/LoggerLibrary.js +91 -0
- package/core/libraries/SerializationLibrary.js +32 -0
- package/core/libraries/bootstrap-logger.js +19 -0
- package/core/libraries/errors/ApplicationError.js +97 -0
- package/core/libraries/index.js +17 -0
- package/{mcp-server/lib → core/mcp-server}/auditor/audit.js +77 -53
- package/core/mcp-server/index.js +192 -0
- package/{mcp-server/lib → core/mcp-server}/server/external/all.js +1 -1
- package/core/mcp-server/server/external/config.js +75 -0
- package/{mcp-server/lib → core/mcp-server}/server/external/single/client.js +1 -1
- package/{mcp-server/lib → core/mcp-server}/server/external/single/request.js +1 -1
- package/{mcp-server/lib → core/mcp-server}/server/external/single/run.js +20 -11
- package/{mcp-server/lib → core/mcp-server}/server/external/single/transport.js +1 -1
- package/{mcp-server/lib → core/mcp-server}/server/internal/handlers/error.js +1 -1
- package/core/mcp-server/server/internal/handlers/prompts-get.js +28 -0
- package/core/mcp-server/server/internal/handlers/prompts-list.js +21 -0
- package/core/mcp-server/server/internal/handlers/resources-list.js +21 -0
- package/core/mcp-server/server/internal/handlers/resources-read.js +28 -0
- package/core/mcp-server/server/internal/handlers/tools-call.js +44 -0
- package/core/mcp-server/server/internal/handlers/tools-list.js +23 -0
- package/core/mcp-server/server/internal/run.js +53 -0
- package/{mcp-server/lib → core/mcp-server}/server/internal/server.js +11 -1
- package/core/models/ConversationFilters.js +31 -0
- package/core/models/ExportFormat.js +8 -0
- package/core/models/RequestFilters.js +43 -0
- package/core/models/SessionFilters.js +23 -0
- package/core/models/index.js +8 -0
- package/core/repositories/AuditRepository.js +233 -0
- package/core/repositories/ConversationRepository.js +182 -0
- package/core/repositories/PacketRepository.js +237 -0
- package/core/repositories/SchemaRepository.js +107 -0
- package/core/repositories/SessionRepository.js +59 -0
- package/core/repositories/StatisticsRepository.js +54 -0
- package/core/repositories/index.js +10 -0
- package/core/services/AuditService.js +144 -0
- package/core/services/BackupService.js +222 -0
- package/core/services/ConfigDetectionService.js +89 -0
- package/core/services/ConfigFileService.js +210 -0
- package/core/services/ConfigPatchingService.js +137 -0
- package/core/services/ConfigService.js +250 -0
- package/core/services/ConfigTransformService.js +178 -0
- package/core/services/ConversationService.js +19 -0
- package/core/services/ExportService.js +117 -0
- package/core/services/LogService.js +64 -0
- package/core/services/McpClientService.js +235 -0
- package/core/services/McpDiscoveryService.js +107 -0
- package/core/services/RequestService.js +56 -0
- package/core/services/ScanCacheService.js +242 -0
- package/core/services/ScanService.js +167 -0
- package/core/services/ServerManagementService.js +206 -0
- package/core/services/SessionService.js +34 -0
- package/core/services/SettingsService.js +163 -0
- package/core/services/StatisticsService.js +64 -0
- package/core/services/TokenService.js +94 -0
- package/core/services/index.js +25 -0
- package/core/services/parsers/ConfigParserFactory.js +113 -0
- package/core/services/parsers/JsonConfigParser.js +66 -0
- package/core/services/parsers/LegacyJsonConfigParser.js +71 -0
- package/core/services/parsers/TomlConfigParser.js +87 -0
- package/core/services/parsers/index.js +4 -0
- package/{ui/server → core}/utils/scan-cache/directory.js +1 -1
- package/core/utils/validation.js +77 -0
- package/package.json +14 -11
- package/ui/dist/assets/index-CArYxKxS.js +35 -0
- package/ui/dist/index.html +1 -1
- package/ui/server/controllers/BackupController.js +129 -0
- package/ui/server/controllers/ConfigController.js +92 -0
- package/ui/server/controllers/ConversationController.js +41 -0
- package/ui/server/controllers/LogController.js +44 -0
- package/ui/server/controllers/McpClientController.js +60 -0
- package/ui/server/controllers/McpDiscoveryController.js +44 -0
- package/ui/server/controllers/RequestController.js +129 -0
- package/ui/server/controllers/ScanController.js +122 -0
- package/ui/server/controllers/ServerManagementController.js +134 -0
- package/ui/server/controllers/SessionController.js +57 -0
- package/ui/server/controllers/SettingsController.js +24 -0
- package/ui/server/controllers/StatisticsController.js +54 -0
- package/ui/server/controllers/TokenController.js +58 -0
- package/ui/server/controllers/index.js +17 -0
- package/ui/server/routes/backups/index.js +15 -9
- package/ui/server/routes/composite/index.js +62 -32
- package/ui/server/routes/composite/servers.js +20 -15
- package/ui/server/routes/config.js +13 -172
- package/ui/server/routes/conversations.js +9 -19
- package/ui/server/routes/help.js +4 -3
- package/ui/server/routes/logs.js +14 -26
- package/ui/server/routes/playground.js +11 -174
- package/ui/server/routes/requests.js +12 -232
- package/ui/server/routes/sessions.js +10 -21
- package/ui/server/routes/settings.js +10 -192
- package/ui/server/routes/smartscan.js +26 -15
- package/ui/server/routes/statistics.js +8 -79
- package/ui/server/setup.js +162 -0
- package/ui/server/swagger/paths/backups.js +151 -0
- package/ui/server/swagger/paths/components.js +76 -0
- package/ui/server/swagger/paths/config.js +117 -0
- package/ui/server/swagger/paths/conversations.js +29 -0
- package/ui/server/swagger/paths/help.js +82 -0
- package/ui/server/swagger/paths/logs.js +87 -0
- package/ui/server/swagger/paths/playground.js +49 -0
- package/ui/server/swagger/paths/requests.js +178 -0
- package/ui/server/swagger/paths/serverManagement.js +169 -0
- package/ui/server/swagger/paths/sessions.js +61 -0
- package/ui/server/swagger/paths/settings.js +31 -0
- package/ui/server/swagger/paths/smartScan/discovery.js +97 -0
- package/ui/server/swagger/paths/smartScan/index.js +13 -0
- package/ui/server/swagger/paths/smartScan/scans.js +151 -0
- package/ui/server/swagger/paths/smartScan/token.js +71 -0
- package/ui/server/swagger/paths/statistics.js +40 -0
- package/ui/server/swagger/paths.js +38 -0
- package/ui/server/swagger/swagger.js +37 -0
- package/ui/server/utils/cleanup.js +99 -0
- package/ui/server/utils/config.js +18 -96
- package/ui/server/utils/errorHandler.js +43 -0
- package/ui/server/utils/logger.js +2 -2
- package/ui/server/utils/paths.js +27 -30
- package/ui/server/utils/port.js +21 -21
- package/ui/server/utils/process.js +18 -10
- package/ui/server/utils/processState.js +17 -0
- package/ui/server/utils/signals.js +34 -0
- package/ui/server/websocket/broadcast.js +33 -0
- package/ui/server/websocket/handler.js +52 -0
- package/ui/server.js +51 -230
- package/ui/src/App.jsx +2 -0
- package/ui/src/CompositeSetup.jsx +23 -9
- package/ui/src/PacketFilters.jsx +17 -3
- package/ui/src/components/AlertModal.jsx +116 -0
- package/ui/src/components/App/ApiDocsButton.jsx +57 -0
- package/ui/src/components/App/useAppState.js +43 -1
- package/ui/src/components/BackupList.jsx +27 -3
- package/ui/src/utils/requestPairing.js +35 -36
- package/ui/src/utils/requestUtils.js +1 -0
- package/lib/common/db/init.js +0 -132
- package/lib/common/db/logger.js +0 -349
- package/lib/common/db/query.js +0 -403
- package/lib/common/logger.js +0 -90
- package/mcp-server/index.js +0 -138
- package/mcp-server/lib/server/external/config.js +0 -57
- package/mcp-server/lib/server/internal/handlers/prompts-get.js +0 -20
- package/mcp-server/lib/server/internal/handlers/prompts-list.js +0 -13
- package/mcp-server/lib/server/internal/handlers/resources-list.js +0 -13
- package/mcp-server/lib/server/internal/handlers/resources-read.js +0 -20
- package/mcp-server/lib/server/internal/handlers/tools-call.js +0 -35
- package/mcp-server/lib/server/internal/handlers/tools-list.js +0 -15
- package/mcp-server/lib/server/internal/run.js +0 -37
- package/mcp-server/mcp-shark.js +0 -22
- package/ui/dist/assets/index-CFHeMNwd.js +0 -35
- package/ui/server/routes/backups/deleteBackup.js +0 -54
- package/ui/server/routes/backups/listBackups.js +0 -75
- package/ui/server/routes/backups/restoreBackup.js +0 -83
- package/ui/server/routes/backups/viewBackup.js +0 -47
- package/ui/server/routes/composite/setup.js +0 -129
- package/ui/server/routes/composite/status.js +0 -7
- package/ui/server/routes/composite/stop.js +0 -39
- package/ui/server/routes/composite/utils.js +0 -45
- package/ui/server/routes/smartscan/discover.js +0 -118
- package/ui/server/routes/smartscan/scans/clearCache.js +0 -23
- package/ui/server/routes/smartscan/scans/createBatchScans.js +0 -124
- package/ui/server/routes/smartscan/scans/createScan.js +0 -43
- package/ui/server/routes/smartscan/scans/getCachedResults.js +0 -52
- package/ui/server/routes/smartscan/scans/getScan.js +0 -42
- package/ui/server/routes/smartscan/scans/listScans.js +0 -25
- package/ui/server/routes/smartscan/scans.js +0 -13
- package/ui/server/routes/smartscan/token.js +0 -57
- package/ui/server/utils/config-update.js +0 -240
- package/ui/server/utils/scan-cache/all-results.js +0 -197
- package/ui/server/utils/scan-cache/file-operations.js +0 -107
- package/ui/server/utils/scan-cache/hash.js +0 -47
- package/ui/server/utils/scan-cache/server-operations.js +0 -85
- package/ui/server/utils/scan-cache.js +0 -12
- package/ui/server/utils/smartscan-token.js +0 -43
- /package/{mcp-server/lib → core/mcp-server}/server/external/kv.js +0 -0
- /package/{mcp-server/lib → core/mcp-server}/server/internal/handlers/common.js +0 -0
- /package/{mcp-server/lib → core/mcp-server}/server/internal/session.js +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))d(p);new MutationObserver(p=>{for(const f of p)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&d(h)}).observe(document,{childList:!0,subtree:!0});function u(p){const f={};return p.integrity&&(f.integrity=p.integrity),p.referrerPolicy&&(f.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?f.credentials="include":p.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function d(p){if(p.ep)return;p.ep=!0;const f=u(p);fetch(p.href,f)}})();function Gc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var is={exports:{}},Ar={},ls={exports:{}},ge={};var Cc;function zf(){if(Cc)return ge;Cc=1;var r=Symbol.for("react.element"),s=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),h=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),T=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),k=Symbol.iterator;function b(j){return j===null||typeof j!="object"?null:(j=k&&j[k]||j["@@iterator"],typeof j=="function"?j:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,R={};function L(j,N,ie){this.props=j,this.context=N,this.refs=R,this.updater=ie||_}L.prototype.isReactComponent={},L.prototype.setState=function(j,N){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,N,"setState")},L.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function I(){}I.prototype=L.prototype;function D(j,N,ie){this.props=j,this.context=N,this.refs=R,this.updater=ie||_}var U=D.prototype=new I;U.constructor=D,z(U,L.prototype),U.isPureReactComponent=!0;var W=Array.isArray,$=Object.prototype.hasOwnProperty,A={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function V(j,N,ie){var ce,pe={},xe=null,ke=null;if(N!=null)for(ce in N.ref!==void 0&&(ke=N.ref),N.key!==void 0&&(xe=""+N.key),N)$.call(N,ce)&&!K.hasOwnProperty(ce)&&(pe[ce]=N[ce]);var we=arguments.length-2;if(we===1)pe.children=ie;else if(1<we){for(var de=Array(we),Le=0;Le<we;Le++)de[Le]=arguments[Le+2];pe.children=de}if(j&&j.defaultProps)for(ce in we=j.defaultProps,we)pe[ce]===void 0&&(pe[ce]=we[ce]);return{$$typeof:r,type:j,key:xe,ref:ke,props:pe,_owner:A.current}}function G(j,N){return{$$typeof:r,type:j.type,key:N,ref:j.ref,props:j.props,_owner:j._owner}}function Y(j){return typeof j=="object"&&j!==null&&j.$$typeof===r}function ue(j){var N={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ie){return N[ie]})}var ve=/\/+/g;function me(j,N){return typeof j=="object"&&j!==null&&j.key!=null?ue(""+j.key):N.toString(36)}function Re(j,N,ie,ce,pe){var xe=typeof j;(xe==="undefined"||xe==="boolean")&&(j=null);var ke=!1;if(j===null)ke=!0;else switch(xe){case"string":case"number":ke=!0;break;case"object":switch(j.$$typeof){case r:case s:ke=!0}}if(ke)return ke=j,pe=pe(ke),j=ce===""?"."+me(ke,0):ce,W(pe)?(ie="",j!=null&&(ie=j.replace(ve,"$&/")+"/"),Re(pe,N,ie,"",function(Le){return Le})):pe!=null&&(Y(pe)&&(pe=G(pe,ie+(!pe.key||ke&&ke.key===pe.key?"":(""+pe.key).replace(ve,"$&/")+"/")+j)),N.push(pe)),1;if(ke=0,ce=ce===""?".":ce+":",W(j))for(var we=0;we<j.length;we++){xe=j[we];var de=ce+me(xe,we);ke+=Re(xe,N,ie,de,pe)}else if(de=b(j),typeof de=="function")for(j=de.call(j),we=0;!(xe=j.next()).done;)xe=xe.value,de=ce+me(xe,we++),ke+=Re(xe,N,ie,de,pe);else if(xe==="object")throw N=String(j),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.");return ke}function Ne(j,N,ie){if(j==null)return j;var ce=[],pe=0;return Re(j,ce,"","",function(xe){return N.call(ie,xe,pe++)}),ce}function Me(j){if(j._status===-1){var N=j._result;N=N(),N.then(function(ie){(j._status===0||j._status===-1)&&(j._status=1,j._result=ie)},function(ie){(j._status===0||j._status===-1)&&(j._status=2,j._result=ie)}),j._status===-1&&(j._status=0,j._result=N)}if(j._status===1)return j._result.default;throw j._result}var he={current:null},J={transition:null},q={ReactCurrentDispatcher:he,ReactCurrentBatchConfig:J,ReactCurrentOwner:A};function X(){throw Error("act(...) is not supported in production builds of React.")}return ge.Children={map:Ne,forEach:function(j,N,ie){Ne(j,function(){N.apply(this,arguments)},ie)},count:function(j){var N=0;return Ne(j,function(){N++}),N},toArray:function(j){return Ne(j,function(N){return N})||[]},only:function(j){if(!Y(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},ge.Component=L,ge.Fragment=u,ge.Profiler=p,ge.PureComponent=D,ge.StrictMode=d,ge.Suspense=x,ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,ge.act=X,ge.cloneElement=function(j,N,ie){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var ce=z({},j.props),pe=j.key,xe=j.ref,ke=j._owner;if(N!=null){if(N.ref!==void 0&&(xe=N.ref,ke=A.current),N.key!==void 0&&(pe=""+N.key),j.type&&j.type.defaultProps)var we=j.type.defaultProps;for(de in N)$.call(N,de)&&!K.hasOwnProperty(de)&&(ce[de]=N[de]===void 0&&we!==void 0?we[de]:N[de])}var de=arguments.length-2;if(de===1)ce.children=ie;else if(1<de){we=Array(de);for(var Le=0;Le<de;Le++)we[Le]=arguments[Le+2];ce.children=we}return{$$typeof:r,type:j.type,key:pe,ref:xe,props:ce,_owner:ke}},ge.createContext=function(j){return j={$$typeof:h,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:f,_context:j},j.Consumer=j},ge.createElement=V,ge.createFactory=function(j){var N=V.bind(null,j);return N.type=j,N},ge.createRef=function(){return{current:null}},ge.forwardRef=function(j){return{$$typeof:y,render:j}},ge.isValidElement=Y,ge.lazy=function(j){return{$$typeof:S,_payload:{_status:-1,_result:j},_init:Me}},ge.memo=function(j,N){return{$$typeof:T,type:j,compare:N===void 0?null:N}},ge.startTransition=function(j){var N=J.transition;J.transition={};try{j()}finally{J.transition=N}},ge.unstable_act=X,ge.useCallback=function(j,N){return he.current.useCallback(j,N)},ge.useContext=function(j){return he.current.useContext(j)},ge.useDebugValue=function(){},ge.useDeferredValue=function(j){return he.current.useDeferredValue(j)},ge.useEffect=function(j,N){return he.current.useEffect(j,N)},ge.useId=function(){return he.current.useId()},ge.useImperativeHandle=function(j,N,ie){return he.current.useImperativeHandle(j,N,ie)},ge.useInsertionEffect=function(j,N){return he.current.useInsertionEffect(j,N)},ge.useLayoutEffect=function(j,N){return he.current.useLayoutEffect(j,N)},ge.useMemo=function(j,N){return he.current.useMemo(j,N)},ge.useReducer=function(j,N,ie){return he.current.useReducer(j,N,ie)},ge.useRef=function(j){return he.current.useRef(j)},ge.useState=function(j){return he.current.useState(j)},ge.useSyncExternalStore=function(j,N,ie){return he.current.useSyncExternalStore(j,N,ie)},ge.useTransition=function(){return he.current.useTransition()},ge.version="18.3.1",ge}var Tc;function hs(){return Tc||(Tc=1,ls.exports=zf()),ls.exports}var Pc;function Ef(){if(Pc)return Ar;Pc=1;var r=hs(),s=Symbol.for("react.element"),u=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,p=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function h(y,x,T){var S,k={},b=null,_=null;T!==void 0&&(b=""+T),x.key!==void 0&&(b=""+x.key),x.ref!==void 0&&(_=x.ref);for(S in x)d.call(x,S)&&!f.hasOwnProperty(S)&&(k[S]=x[S]);if(y&&y.defaultProps)for(S in x=y.defaultProps,x)k[S]===void 0&&(k[S]=x[S]);return{$$typeof:s,type:y,key:b,ref:_,props:k,_owner:p.current}}return Ar.Fragment=u,Ar.jsx=h,Ar.jsxs=h,Ar}var _c;function Rf(){return _c||(_c=1,is.exports=Ef()),is.exports}var i=Rf(),P=hs();const ni=Gc(P);var ti={},ss={exports:{}},at={},as={exports:{}},us={};var Lc;function Mf(){return Lc||(Lc=1,(function(r){function s(J,q){var X=J.length;J.push(q);e:for(;0<X;){var j=X-1>>>1,N=J[j];if(0<p(N,q))J[j]=q,J[X]=N,X=j;else break e}}function u(J){return J.length===0?null:J[0]}function d(J){if(J.length===0)return null;var q=J[0],X=J.pop();if(X!==q){J[0]=X;e:for(var j=0,N=J.length,ie=N>>>1;j<ie;){var ce=2*(j+1)-1,pe=J[ce],xe=ce+1,ke=J[xe];if(0>p(pe,X))xe<N&&0>p(ke,pe)?(J[j]=ke,J[xe]=X,j=xe):(J[j]=pe,J[ce]=X,j=ce);else if(xe<N&&0>p(ke,X))J[j]=ke,J[xe]=X,j=xe;else break e}}return q}function p(J,q){var X=J.sortIndex-q.sortIndex;return X!==0?X:J.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var h=Date,y=h.now();r.unstable_now=function(){return h.now()-y}}var x=[],T=[],S=1,k=null,b=3,_=!1,z=!1,R=!1,L=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,D=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 q=u(T);q!==null;){if(q.callback===null)d(T);else if(q.startTime<=J)d(T),q.sortIndex=q.expirationTime,s(x,q);else break;q=u(T)}}function W(J){if(R=!1,U(J),!z)if(u(x)!==null)z=!0,Me($);else{var q=u(T);q!==null&&he(W,q.startTime-J)}}function $(J,q){z=!1,R&&(R=!1,I(V),V=-1),_=!0;var X=b;try{for(U(q),k=u(x);k!==null&&(!(k.expirationTime>q)||J&&!ue());){var j=k.callback;if(typeof j=="function"){k.callback=null,b=k.priorityLevel;var N=j(k.expirationTime<=q);q=r.unstable_now(),typeof N=="function"?k.callback=N:k===u(x)&&d(x),U(q)}else d(x);k=u(x)}if(k!==null)var ie=!0;else{var ce=u(T);ce!==null&&he(W,ce.startTime-q),ie=!1}return ie}finally{k=null,b=X,_=!1}}var A=!1,K=null,V=-1,G=5,Y=-1;function ue(){return!(r.unstable_now()-Y<G)}function ve(){if(K!==null){var J=r.unstable_now();Y=J;var q=!0;try{q=K(!0,J)}finally{q?me():(A=!1,K=null)}}else A=!1}var me;if(typeof D=="function")me=function(){D(ve)};else if(typeof MessageChannel<"u"){var Re=new MessageChannel,Ne=Re.port2;Re.port1.onmessage=ve,me=function(){Ne.postMessage(null)}}else me=function(){L(ve,0)};function Me(J){K=J,A||(A=!0,me())}function he(J,q){V=L(function(){J(r.unstable_now())},q)}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,Me($))},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 b},r.unstable_getFirstCallbackNode=function(){return u(x)},r.unstable_next=function(J){switch(b){case 1:case 2:case 3:var q=3;break;default:q=b}var X=b;b=q;try{return J()}finally{b=X}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(J,q){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var X=b;b=J;try{return q()}finally{b=X}},r.unstable_scheduleCallback=function(J,q,X){var j=r.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?j+X:j):X=j,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:q,priorityLevel:J,startTime:X,expirationTime:N,sortIndex:-1},X>j?(J.sortIndex=X,s(T,J),u(x)===null&&J===u(T)&&(R?(I(V),V=-1):R=!0,he(W,X-j))):(J.sortIndex=N,s(x,J),z||_||(z=!0,Me($))),J},r.unstable_shouldYield=ue,r.unstable_wrapCallback=function(J){var q=b;return function(){var X=b;b=q;try{return J.apply(this,arguments)}finally{b=X}}}})(us)),us}var zc;function Ff(){return zc||(zc=1,as.exports=Mf()),as.exports}var Ec;function If(){if(Ec)return at;Ec=1;var r=hs(),s=Ff();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 d=new Set,p={};function f(e,t){h(e,t),h(e+"Capture",t)}function h(e,t){for(p[e]=t,e=0;e<t.length;e++)d.add(t[e])}var y=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x=Object.prototype.hasOwnProperty,T=/^[: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={},k={};function b(e){return x.call(k,e)?!0:x.call(S,e)?!1:T.test(e)?k[e]=!0:(S[e]=!0,!1)}function _(e,t,n,l){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function z(e,t,n,l){if(t===null||typeof t>"u"||_(e,t,n,l))return!0;if(l)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,l,a,c,g){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=g}var L={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){L[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];L[t]=new R(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){L[e]=new R(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){L[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){L[e]=new R(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){L[e]=new R(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){L[e]=new R(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){L[e]=new R(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){L[e]=new R(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function D(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,D);L[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,D);L[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,D);L[t]=new R(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){L[e]=new R(e,1,!1,e.toLowerCase(),null,!1,!1)}),L.xlinkHref=new R("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){L[e]=new R(e,1,!1,e.toLowerCase(),null,!0,!0)});function U(e,t,n,l){var a=L.hasOwnProperty(t)?L[t]:null;(a!==null?a.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(z(t,n,a,l)&&(n=null),l||a===null?b(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,l=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,l?e.setAttributeNS(l,t,n):e.setAttribute(t,n))))}var W=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$=Symbol.for("react.element"),A=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"),ue=Symbol.for("react.context"),ve=Symbol.for("react.forward_ref"),me=Symbol.for("react.suspense"),Re=Symbol.for("react.suspense_list"),Ne=Symbol.for("react.memo"),Me=Symbol.for("react.lazy"),he=Symbol.for("react.offscreen"),J=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var X=Object.assign,j;function N(e){if(j===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);j=t&&t[1]||""}return`
|
|
2
|
+
`+j+e}var ie=!1;function ce(e,t){if(!e||ie)return"";ie=!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 l=F}Reflect.construct(e,[],t)}else{try{t.call()}catch(F){l=F}e.call(t.prototype)}else{try{throw Error()}catch(F){l=F}e()}}catch(F){if(F&&l&&typeof F.stack=="string"){for(var a=F.stack.split(`
|
|
3
|
+
`),c=l.stack.split(`
|
|
4
|
+
`),g=a.length-1,m=c.length-1;1<=g&&0<=m&&a[g]!==c[m];)m--;for(;1<=g&&0<=m;g--,m--)if(a[g]!==c[m]){if(g!==1||m!==1)do if(g--,m--,0>m||a[g]!==c[m]){var w=`
|
|
5
|
+
`+a[g].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),w}while(1<=g&&0<=m);break}}}finally{ie=!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=ce(e.type,!1),e;case 11:return e=ce(e.type.render,!1),e;case 1:return e=ce(e.type,!0),e;default:return""}}function xe(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 A:return"Portal";case G:return"Profiler";case V:return"StrictMode";case me:return"Suspense";case Re:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ue:return(e.displayName||"Context")+".Consumer";case Y:return(e._context.displayName||"Context")+".Provider";case ve: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:xe(e.type)||"Memo";case Me:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}function ke(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 xe(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 we(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function de(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Le(e){var t=de(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+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(g){l=""+g,c.call(this,g)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(g){l=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _t(e){e._valueTracker||(e._valueTracker=Le(e))}function Vt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=de(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Qt(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 Se(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function De(e,t){var n=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;n=we(t.value!=null?t.value:n),e._wrapperState={initialChecked:l,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Je(e,t){t=t.checked,t!=null&&U(e,"checked",t,!1)}function vt(e,t){Je(e,t);var n=we(t.value),l=t.type;if(n!=null)l==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?gi(e,t.type,n):t.hasOwnProperty("defaultValue")&&gi(e,t.type,we(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Fs(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="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 gi(e,t,n){(t!=="number"||Qt(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var rr=Array.isArray;function Ln(e,t,n,l){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&&l&&(e[n].defaultSelected=!0)}else{for(n=""+we(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function hi(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(u(91));return X({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Is(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(rr(n)){if(1<n.length)throw Error(u(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:we(n)}}function $s(e,t){var n=we(t.value),l=we(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),l!=null&&(e.defaultValue=""+l)}function Ns(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ds(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 xi(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ds(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Qr,Os=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,l,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,l,a)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Qr=Qr||document.createElement("div"),Qr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Qr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function or(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ir={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},Md=["Webkit","ms","Moz","O"];Object.keys(ir).forEach(function(e){Md.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ir[t]=ir[e]})});function Bs(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ir.hasOwnProperty(e)&&ir[e]?(""+t).trim():t+"px"}function Ws(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var l=n.indexOf("--")===0,a=Bs(n,t[n],l);n==="float"&&(n="cssFloat"),l?e.setProperty(n,a):e[n]=a}}var Fd=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 yi(e,t){if(t){if(Fd[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 mi(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 vi=null;function Si(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bi=null,zn=null,En=null;function As(e){if(e=Pr(e)){if(typeof bi!="function")throw Error(u(280));var t=e.stateNode;t&&(t=xo(t),bi(e.stateNode,e.type,t))}}function Hs(e){zn?En?En.push(e):En=[e]:zn=e}function Us(){if(zn){var e=zn,t=En;if(En=zn=null,As(e),t)for(e=0;e<t.length;e++)As(t[e])}}function Vs(e,t){return e(t)}function Qs(){}var ki=!1;function Ys(e,t,n){if(ki)return e(t,n);ki=!0;try{return Vs(e,t,n)}finally{ki=!1,(zn!==null||En!==null)&&(Qs(),Us())}}function lr(e,t){var n=e.stateNode;if(n===null)return null;var l=xo(n);if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var wi=!1;if(y)try{var sr={};Object.defineProperty(sr,"passive",{get:function(){wi=!0}}),window.addEventListener("test",sr,sr),window.removeEventListener("test",sr,sr)}catch{wi=!1}function Id(e,t,n,l,a,c,g,m,w){var F=Array.prototype.slice.call(arguments,3);try{t.apply(n,F)}catch(B){this.onError(B)}}var ar=!1,Yr=null,Jr=!1,ji=null,$d={onError:function(e){ar=!0,Yr=e}};function Nd(e,t,n,l,a,c,g,m,w){ar=!1,Yr=null,Id.apply($d,arguments)}function Dd(e,t,n,l,a,c,g,m,w){if(Nd.apply(this,arguments),ar){if(ar){var F=Yr;ar=!1,Yr=null}else throw Error(u(198));Jr||(Jr=!0,ji=F)}}function hn(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 Js(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 Ks(e){if(hn(e)!==e)throw Error(u(188))}function Od(e){var t=e.alternate;if(!t){if(t=hn(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var c=a.alternate;if(c===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===c.child){for(c=a.child;c;){if(c===n)return Ks(a),e;if(c===l)return Ks(a),t;c=c.sibling}throw Error(u(188))}if(n.return!==l.return)n=a,l=c;else{for(var g=!1,m=a.child;m;){if(m===n){g=!0,n=a,l=c;break}if(m===l){g=!0,l=a,n=c;break}m=m.sibling}if(!g){for(m=c.child;m;){if(m===n){g=!0,n=c,l=a;break}if(m===l){g=!0,l=c,n=a;break}m=m.sibling}if(!g)throw Error(u(189))}}if(n.alternate!==l)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function Gs(e){return e=Od(e),e!==null?Xs(e):null}function Xs(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Xs(e);if(t!==null)return t;e=e.sibling}return null}var Zs=s.unstable_scheduleCallback,qs=s.unstable_cancelCallback,Bd=s.unstable_shouldYield,Wd=s.unstable_requestPaint,Be=s.unstable_now,Ad=s.unstable_getCurrentPriorityLevel,Ci=s.unstable_ImmediatePriority,ea=s.unstable_UserBlockingPriority,Kr=s.unstable_NormalPriority,Hd=s.unstable_LowPriority,ta=s.unstable_IdlePriority,Gr=null,Lt=null;function Ud(e){if(Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(Gr,e,void 0,(e.current.flags&128)===128)}catch{}}var St=Math.clz32?Math.clz32:Yd,Vd=Math.log,Qd=Math.LN2;function Yd(e){return e>>>=0,e===0?32:31-(Vd(e)/Qd|0)|0}var Xr=64,Zr=4194304;function ur(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 qr(e,t){var n=e.pendingLanes;if(n===0)return 0;var l=0,a=e.suspendedLanes,c=e.pingedLanes,g=n&268435455;if(g!==0){var m=g&~a;m!==0?l=ur(m):(c&=g,c!==0&&(l=ur(c)))}else g=n&~a,g!==0?l=ur(g):c!==0&&(l=ur(c));if(l===0)return 0;if(t!==0&&t!==l&&(t&a)===0&&(a=l&-l,c=t&-t,a>=c||a===16&&(c&4194240)!==0))return t;if((l&4)!==0&&(l|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)n=31-St(t),a=1<<n,l|=e[n],t&=~a;return l}function Jd(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 Kd(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,c=e.pendingLanes;0<c;){var g=31-St(c),m=1<<g,w=a[g];w===-1?((m&n)===0||(m&l)!==0)&&(a[g]=Jd(m,t)):w<=t&&(e.expiredLanes|=m),c&=~m}}function Ti(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function na(){var e=Xr;return Xr<<=1,(Xr&4194240)===0&&(Xr=64),e}function Pi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function cr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=n}function Gd(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 l=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-St(n),c=1<<a;t[a]=0,l[a]=-1,e[a]=-1,n&=~c}}function _i(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-St(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}var Ce=0;function ra(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var oa,Li,ia,la,sa,zi=!1,eo=[],Yt=null,Jt=null,Kt=null,dr=new Map,pr=new Map,Gt=[],Xd="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 aa(e,t){switch(e){case"focusin":case"focusout":Yt=null;break;case"dragenter":case"dragleave":Jt=null;break;case"mouseover":case"mouseout":Kt=null;break;case"pointerover":case"pointerout":dr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pr.delete(t.pointerId)}}function fr(e,t,n,l,a,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:c,targetContainers:[a]},t!==null&&(t=Pr(t),t!==null&&Li(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Zd(e,t,n,l,a){switch(t){case"focusin":return Yt=fr(Yt,e,t,n,l,a),!0;case"dragenter":return Jt=fr(Jt,e,t,n,l,a),!0;case"mouseover":return Kt=fr(Kt,e,t,n,l,a),!0;case"pointerover":var c=a.pointerId;return dr.set(c,fr(dr.get(c)||null,e,t,n,l,a)),!0;case"gotpointercapture":return c=a.pointerId,pr.set(c,fr(pr.get(c)||null,e,t,n,l,a)),!0}return!1}function ua(e){var t=xn(e.target);if(t!==null){var n=hn(t);if(n!==null){if(t=n.tag,t===13){if(t=Js(n),t!==null){e.blockedOn=t,sa(e.priority,function(){ia(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 to(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ri(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);vi=l,n.target.dispatchEvent(l),vi=null}else return t=Pr(n),t!==null&&Li(t),e.blockedOn=n,!1;t.shift()}return!0}function ca(e,t,n){to(e)&&n.delete(t)}function qd(){zi=!1,Yt!==null&&to(Yt)&&(Yt=null),Jt!==null&&to(Jt)&&(Jt=null),Kt!==null&&to(Kt)&&(Kt=null),dr.forEach(ca),pr.forEach(ca)}function gr(e,t){e.blockedOn===t&&(e.blockedOn=null,zi||(zi=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,qd)))}function hr(e){function t(a){return gr(a,e)}if(0<eo.length){gr(eo[0],e);for(var n=1;n<eo.length;n++){var l=eo[n];l.blockedOn===e&&(l.blockedOn=null)}}for(Yt!==null&&gr(Yt,e),Jt!==null&&gr(Jt,e),Kt!==null&&gr(Kt,e),dr.forEach(t),pr.forEach(t),n=0;n<Gt.length;n++)l=Gt[n],l.blockedOn===e&&(l.blockedOn=null);for(;0<Gt.length&&(n=Gt[0],n.blockedOn===null);)ua(n),n.blockedOn===null&&Gt.shift()}var Rn=W.ReactCurrentBatchConfig,no=!0;function ep(e,t,n,l){var a=Ce,c=Rn.transition;Rn.transition=null;try{Ce=1,Ei(e,t,n,l)}finally{Ce=a,Rn.transition=c}}function tp(e,t,n,l){var a=Ce,c=Rn.transition;Rn.transition=null;try{Ce=4,Ei(e,t,n,l)}finally{Ce=a,Rn.transition=c}}function Ei(e,t,n,l){if(no){var a=Ri(e,t,n,l);if(a===null)Ki(e,t,l,ro,n),aa(e,l);else if(Zd(a,e,t,n,l))l.stopPropagation();else if(aa(e,l),t&4&&-1<Xd.indexOf(e)){for(;a!==null;){var c=Pr(a);if(c!==null&&oa(c),c=Ri(e,t,n,l),c===null&&Ki(e,t,l,ro,n),c===a)break;a=c}a!==null&&l.stopPropagation()}else Ki(e,t,l,null,n)}}var ro=null;function Ri(e,t,n,l){if(ro=null,e=Si(l),e=xn(e),e!==null)if(t=hn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Js(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 ro=e,null}function da(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(Ad()){case Ci:return 1;case ea:return 4;case Kr:case Hd:return 16;case ta:return 536870912;default:return 16}default:return 16}}var Xt=null,Mi=null,oo=null;function pa(){if(oo)return oo;var e,t=Mi,n=t.length,l,a="value"in Xt?Xt.value:Xt.textContent,c=a.length;for(e=0;e<n&&t[e]===a[e];e++);var g=n-e;for(l=1;l<=g&&t[n-l]===a[c-l];l++);return oo=a.slice(e,1<l?1-l:void 0)}function io(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 lo(){return!0}function fa(){return!1}function ut(e){function t(n,l,a,c,g){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=c,this.target=g,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)?lo:fa,this.isPropagationStopped=fa,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=lo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=lo)},persist:function(){},isPersistent:lo}),t}var Mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fi=ut(Mn),xr=X({},Mn,{view:0,detail:0}),np=ut(xr),Ii,$i,yr,so=X({},xr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Di,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!==yr&&(yr&&e.type==="mousemove"?(Ii=e.screenX-yr.screenX,$i=e.screenY-yr.screenY):$i=Ii=0,yr=e),Ii)},movementY:function(e){return"movementY"in e?e.movementY:$i}}),ga=ut(so),rp=X({},so,{dataTransfer:0}),op=ut(rp),ip=X({},xr,{relatedTarget:0}),Ni=ut(ip),lp=X({},Mn,{animationName:0,elapsedTime:0,pseudoElement:0}),sp=ut(lp),ap=X({},Mn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),up=ut(ap),cp=X({},Mn,{data:0}),ha=ut(cp),dp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pp={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"},fp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fp[e])?!!t[e]:!1}function Di(){return gp}var hp=X({},xr,{key:function(e){if(e.key){var t=dp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=io(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?pp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Di,charCode:function(e){return e.type==="keypress"?io(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?io(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),xp=ut(hp),yp=X({},so,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xa=ut(yp),mp=X({},xr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Di}),vp=ut(mp),Sp=X({},Mn,{propertyName:0,elapsedTime:0,pseudoElement:0}),bp=ut(Sp),kp=X({},so,{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}),wp=ut(kp),jp=[9,13,27,32],Oi=y&&"CompositionEvent"in window,mr=null;y&&"documentMode"in document&&(mr=document.documentMode);var Cp=y&&"TextEvent"in window&&!mr,ya=y&&(!Oi||mr&&8<mr&&11>=mr),ma=" ",va=!1;function Sa(e,t){switch(e){case"keyup":return jp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ba(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fn=!1;function Tp(e,t){switch(e){case"compositionend":return ba(t);case"keypress":return t.which!==32?null:(va=!0,ma);case"textInput":return e=t.data,e===ma&&va?null:e;default:return null}}function Pp(e,t){if(Fn)return e==="compositionend"||!Oi&&Sa(e,t)?(e=pa(),oo=Mi=Xt=null,Fn=!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 ya&&t.locale!=="ko"?null:t.data;default:return null}}var _p={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 ka(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_p[e.type]:t==="textarea"}function wa(e,t,n,l){Hs(l),t=fo(t,"onChange"),0<t.length&&(n=new Fi("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var vr=null,Sr=null;function Lp(e){Wa(e,0)}function ao(e){var t=On(e);if(Vt(t))return e}function zp(e,t){if(e==="change")return t}var ja=!1;if(y){var Bi;if(y){var Wi="oninput"in document;if(!Wi){var Ca=document.createElement("div");Ca.setAttribute("oninput","return;"),Wi=typeof Ca.oninput=="function"}Bi=Wi}else Bi=!1;ja=Bi&&(!document.documentMode||9<document.documentMode)}function Ta(){vr&&(vr.detachEvent("onpropertychange",Pa),Sr=vr=null)}function Pa(e){if(e.propertyName==="value"&&ao(Sr)){var t=[];wa(t,Sr,e,Si(e)),Ys(Lp,t)}}function Ep(e,t,n){e==="focusin"?(Ta(),vr=t,Sr=n,vr.attachEvent("onpropertychange",Pa)):e==="focusout"&&Ta()}function Rp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ao(Sr)}function Mp(e,t){if(e==="click")return ao(t)}function Fp(e,t){if(e==="input"||e==="change")return ao(t)}function Ip(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bt=typeof Object.is=="function"?Object.is:Ip;function br(e,t){if(bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!x.call(t,a)||!bt(e[a],t[a]))return!1}return!0}function _a(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function La(e,t){var n=_a(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_a(n)}}function za(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?za(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ea(){for(var e=window,t=Qt();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qt(e.document)}return t}function Ai(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 $p(e){var t=Ea(),n=e.focusedElem,l=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&za(n.ownerDocument.documentElement,n)){if(l!==null&&Ai(n)){if(t=l.start,e=l.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(l.start,a);l=l.end===void 0?c:Math.min(l.end,a),!e.extend&&c>l&&(a=l,l=c,c=a),a=La(n,c);var g=La(n,l);a&&g&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==g.node||e.focusOffset!==g.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),c>l?(e.addRange(t),e.extend(g.node,g.offset)):(t.setEnd(g.node,g.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 Np=y&&"documentMode"in document&&11>=document.documentMode,In=null,Hi=null,kr=null,Ui=!1;function Ra(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ui||In==null||In!==Qt(l)||(l=In,"selectionStart"in l&&Ai(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),kr&&br(kr,l)||(kr=l,l=fo(Hi,"onSelect"),0<l.length&&(t=new Fi("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=In)))}function uo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $n={animationend:uo("Animation","AnimationEnd"),animationiteration:uo("Animation","AnimationIteration"),animationstart:uo("Animation","AnimationStart"),transitionend:uo("Transition","TransitionEnd")},Vi={},Ma={};y&&(Ma=document.createElement("div").style,"AnimationEvent"in window||(delete $n.animationend.animation,delete $n.animationiteration.animation,delete $n.animationstart.animation),"TransitionEvent"in window||delete $n.transitionend.transition);function co(e){if(Vi[e])return Vi[e];if(!$n[e])return e;var t=$n[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ma)return Vi[e]=t[n];return e}var Fa=co("animationend"),Ia=co("animationiteration"),$a=co("animationstart"),Na=co("transitionend"),Da=new Map,Oa="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 Zt(e,t){Da.set(e,t),f(t,[e])}for(var Qi=0;Qi<Oa.length;Qi++){var Yi=Oa[Qi],Dp=Yi.toLowerCase(),Op=Yi[0].toUpperCase()+Yi.slice(1);Zt(Dp,"on"+Op)}Zt(Fa,"onAnimationEnd"),Zt(Ia,"onAnimationIteration"),Zt($a,"onAnimationStart"),Zt("dblclick","onDoubleClick"),Zt("focusin","onFocus"),Zt("focusout","onBlur"),Zt(Na,"onTransitionEnd"),h("onMouseEnter",["mouseout","mouseover"]),h("onMouseLeave",["mouseout","mouseover"]),h("onPointerEnter",["pointerout","pointerover"]),h("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 wr="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(" "),Bp=new Set("cancel close invalid load scroll toggle".split(" ").concat(wr));function Ba(e,t,n){var l=e.type||"unknown-event";e.currentTarget=n,Dd(l,t,void 0,e),e.currentTarget=null}function Wa(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var g=l.length-1;0<=g;g--){var m=l[g],w=m.instance,F=m.currentTarget;if(m=m.listener,w!==c&&a.isPropagationStopped())break e;Ba(a,m,F),c=w}else for(g=0;g<l.length;g++){if(m=l[g],w=m.instance,F=m.currentTarget,m=m.listener,w!==c&&a.isPropagationStopped())break e;Ba(a,m,F),c=w}}}if(Jr)throw e=ji,Jr=!1,ji=null,e}function ze(e,t){var n=t[tl];n===void 0&&(n=t[tl]=new Set);var l=e+"__bubble";n.has(l)||(Aa(t,e,2,!1),n.add(l))}function Ji(e,t,n){var l=0;t&&(l|=4),Aa(n,e,l,t)}var po="_reactListening"+Math.random().toString(36).slice(2);function jr(e){if(!e[po]){e[po]=!0,d.forEach(function(n){n!=="selectionchange"&&(Bp.has(n)||Ji(n,!1,e),Ji(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[po]||(t[po]=!0,Ji("selectionchange",!1,t))}}function Aa(e,t,n,l){switch(da(t)){case 1:var a=ep;break;case 4:a=tp;break;default:a=Ei}n=a.bind(null,t,n,e),a=void 0,!wi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?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 Ki(e,t,n,l,a){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var g=l.tag;if(g===3||g===4){var m=l.stateNode.containerInfo;if(m===a||m.nodeType===8&&m.parentNode===a)break;if(g===4)for(g=l.return;g!==null;){var w=g.tag;if((w===3||w===4)&&(w=g.stateNode.containerInfo,w===a||w.nodeType===8&&w.parentNode===a))return;g=g.return}for(;m!==null;){if(g=xn(m),g===null)return;if(w=g.tag,w===5||w===6){l=c=g;continue e}m=m.parentNode}}l=l.return}Ys(function(){var F=c,B=Si(n),H=[];e:{var O=Da.get(e);if(O!==void 0){var Z=Fi,te=e;switch(e){case"keypress":if(io(n)===0)break e;case"keydown":case"keyup":Z=xp;break;case"focusin":te="focus",Z=Ni;break;case"focusout":te="blur",Z=Ni;break;case"beforeblur":case"afterblur":Z=Ni;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=ga;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=op;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=vp;break;case Fa:case Ia:case $a:Z=sp;break;case Na:Z=bp;break;case"scroll":Z=np;break;case"wheel":Z=wp;break;case"copy":case"cut":case"paste":Z=up;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=xa}var ne=(t&4)!==0,We=!ne&&e==="scroll",E=ne?O!==null?O+"Capture":null:O;ne=[];for(var C=F,M;C!==null;){M=C;var Q=M.stateNode;if(M.tag===5&&Q!==null&&(M=Q,E!==null&&(Q=lr(C,E),Q!=null&&ne.push(Cr(C,Q,M)))),We)break;C=C.return}0<ne.length&&(O=new Z(O,te,null,n,B),H.push({event:O,listeners:ne}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",Z=e==="mouseout"||e==="pointerout",O&&n!==vi&&(te=n.relatedTarget||n.fromElement)&&(xn(te)||te[$t]))break e;if((Z||O)&&(O=B.window===B?B:(O=B.ownerDocument)?O.defaultView||O.parentWindow:window,Z?(te=n.relatedTarget||n.toElement,Z=F,te=te?xn(te):null,te!==null&&(We=hn(te),te!==We||te.tag!==5&&te.tag!==6)&&(te=null)):(Z=null,te=F),Z!==te)){if(ne=ga,Q="onMouseLeave",E="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(ne=xa,Q="onPointerLeave",E="onPointerEnter",C="pointer"),We=Z==null?O:On(Z),M=te==null?O:On(te),O=new ne(Q,C+"leave",Z,n,B),O.target=We,O.relatedTarget=M,Q=null,xn(B)===F&&(ne=new ne(E,C+"enter",te,n,B),ne.target=M,ne.relatedTarget=We,Q=ne),We=Q,Z&&te)t:{for(ne=Z,E=te,C=0,M=ne;M;M=Nn(M))C++;for(M=0,Q=E;Q;Q=Nn(Q))M++;for(;0<C-M;)ne=Nn(ne),C--;for(;0<M-C;)E=Nn(E),M--;for(;C--;){if(ne===E||E!==null&&ne===E.alternate)break t;ne=Nn(ne),E=Nn(E)}ne=null}else ne=null;Z!==null&&Ha(H,O,Z,ne,!1),te!==null&&We!==null&&Ha(H,We,te,ne,!0)}}e:{if(O=F?On(F):window,Z=O.nodeName&&O.nodeName.toLowerCase(),Z==="select"||Z==="input"&&O.type==="file")var re=zp;else if(ka(O))if(ja)re=Fp;else{re=Rp;var le=Ep}else(Z=O.nodeName)&&Z.toLowerCase()==="input"&&(O.type==="checkbox"||O.type==="radio")&&(re=Mp);if(re&&(re=re(e,F))){wa(H,re,n,B);break e}le&&le(e,O,F),e==="focusout"&&(le=O._wrapperState)&&le.controlled&&O.type==="number"&&gi(O,"number",O.value)}switch(le=F?On(F):window,e){case"focusin":(ka(le)||le.contentEditable==="true")&&(In=le,Hi=F,kr=null);break;case"focusout":kr=Hi=In=null;break;case"mousedown":Ui=!0;break;case"contextmenu":case"mouseup":case"dragend":Ui=!1,Ra(H,n,B);break;case"selectionchange":if(Np)break;case"keydown":case"keyup":Ra(H,n,B)}var se;if(Oi)e:{switch(e){case"compositionstart":var ae="onCompositionStart";break e;case"compositionend":ae="onCompositionEnd";break e;case"compositionupdate":ae="onCompositionUpdate";break e}ae=void 0}else Fn?Sa(e,n)&&(ae="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ae="onCompositionStart");ae&&(ya&&n.locale!=="ko"&&(Fn||ae!=="onCompositionStart"?ae==="onCompositionEnd"&&Fn&&(se=pa()):(Xt=B,Mi="value"in Xt?Xt.value:Xt.textContent,Fn=!0)),le=fo(F,ae),0<le.length&&(ae=new ha(ae,e,null,n,B),H.push({event:ae,listeners:le}),se?ae.data=se:(se=ba(n),se!==null&&(ae.data=se)))),(se=Cp?Tp(e,n):Pp(e,n))&&(F=fo(F,"onBeforeInput"),0<F.length&&(B=new ha("onBeforeInput","beforeinput",null,n,B),H.push({event:B,listeners:F}),B.data=se))}Wa(H,t)})}function Cr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fo(e,t){for(var n=t+"Capture",l=[];e!==null;){var a=e,c=a.stateNode;a.tag===5&&c!==null&&(a=c,c=lr(e,n),c!=null&&l.unshift(Cr(e,c,a)),c=lr(e,t),c!=null&&l.push(Cr(e,c,a))),e=e.return}return l}function Nn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ha(e,t,n,l,a){for(var c=t._reactName,g=[];n!==null&&n!==l;){var m=n,w=m.alternate,F=m.stateNode;if(w!==null&&w===l)break;m.tag===5&&F!==null&&(m=F,a?(w=lr(n,c),w!=null&&g.unshift(Cr(n,w,m))):a||(w=lr(n,c),w!=null&&g.push(Cr(n,w,m)))),n=n.return}g.length!==0&&e.push({event:t,listeners:g})}var Wp=/\r\n?/g,Ap=/\u0000|\uFFFD/g;function Ua(e){return(typeof e=="string"?e:""+e).replace(Wp,`
|
|
6
|
+
`).replace(Ap,"")}function go(e,t,n){if(t=Ua(t),Ua(e)!==t&&n)throw Error(u(425))}function ho(){}var Gi=null,Xi=null;function Zi(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 qi=typeof setTimeout=="function"?setTimeout:void 0,Hp=typeof clearTimeout=="function"?clearTimeout:void 0,Va=typeof Promise=="function"?Promise:void 0,Up=typeof queueMicrotask=="function"?queueMicrotask:typeof Va<"u"?function(e){return Va.resolve(null).then(e).catch(Vp)}:qi;function Vp(e){setTimeout(function(){throw e})}function el(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(l===0){e.removeChild(a),hr(t);return}l--}else n!=="$"&&n!=="$?"&&n!=="$!"||l++;n=a}while(n);hr(t)}function qt(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 Qa(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 Dn=Math.random().toString(36).slice(2),zt="__reactFiber$"+Dn,Tr="__reactProps$"+Dn,$t="__reactContainer$"+Dn,tl="__reactEvents$"+Dn,Qp="__reactListeners$"+Dn,Yp="__reactHandles$"+Dn;function xn(e){var t=e[zt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[$t]||n[zt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qa(e);e!==null;){if(n=e[zt])return n;e=Qa(e)}return t}e=n,n=e.parentNode}return null}function Pr(e){return e=e[zt]||e[$t],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function On(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(u(33))}function xo(e){return e[Tr]||null}var nl=[],Bn=-1;function en(e){return{current:e}}function Ee(e){0>Bn||(e.current=nl[Bn],nl[Bn]=null,Bn--)}function _e(e,t){Bn++,nl[Bn]=e.current,e.current=t}var tn={},Xe=en(tn),rt=en(!1),yn=tn;function Wn(e,t){var n=e.type.contextTypes;if(!n)return tn;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var a={},c;for(c in n)a[c]=t[c];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function ot(e){return e=e.childContextTypes,e!=null}function yo(){Ee(rt),Ee(Xe)}function Ya(e,t,n){if(Xe.current!==tn)throw Error(u(168));_e(Xe,t),_e(rt,n)}function Ja(e,t,n){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return n;l=l.getChildContext();for(var a in l)if(!(a in t))throw Error(u(108,ke(e)||"Unknown",a));return X({},n,l)}function mo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tn,yn=Xe.current,_e(Xe,e),_e(rt,rt.current),!0}function Ka(e,t,n){var l=e.stateNode;if(!l)throw Error(u(169));n?(e=Ja(e,t,yn),l.__reactInternalMemoizedMergedChildContext=e,Ee(rt),Ee(Xe),_e(Xe,e)):Ee(rt),_e(rt,n)}var Nt=null,vo=!1,rl=!1;function Ga(e){Nt===null?Nt=[e]:Nt.push(e)}function Jp(e){vo=!0,Ga(e)}function nn(){if(!rl&&Nt!==null){rl=!0;var e=0,t=Ce;try{var n=Nt;for(Ce=1;e<n.length;e++){var l=n[e];do l=l(!0);while(l!==null)}Nt=null,vo=!1}catch(a){throw Nt!==null&&(Nt=Nt.slice(e+1)),Zs(Ci,nn),a}finally{Ce=t,rl=!1}}return null}var An=[],Hn=0,So=null,bo=0,ft=[],gt=0,mn=null,Dt=1,Ot="";function vn(e,t){An[Hn++]=bo,An[Hn++]=So,So=e,bo=t}function Xa(e,t,n){ft[gt++]=Dt,ft[gt++]=Ot,ft[gt++]=mn,mn=e;var l=Dt;e=Ot;var a=32-St(l)-1;l&=~(1<<a),n+=1;var c=32-St(t)+a;if(30<c){var g=a-a%5;c=(l&(1<<g)-1).toString(32),l>>=g,a-=g,Dt=1<<32-St(t)+a|n<<a|l,Ot=c+e}else Dt=1<<c|n<<a|l,Ot=e}function ol(e){e.return!==null&&(vn(e,1),Xa(e,1,0))}function il(e){for(;e===So;)So=An[--Hn],An[Hn]=null,bo=An[--Hn],An[Hn]=null;for(;e===mn;)mn=ft[--gt],ft[gt]=null,Ot=ft[--gt],ft[gt]=null,Dt=ft[--gt],ft[gt]=null}var ct=null,dt=null,Fe=!1,kt=null;function Za(e,t){var n=mt(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 qa(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,ct=e,dt=qt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ct=e,dt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=mn!==null?{id:Dt,overflow:Ot}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=mt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ct=e,dt=null,!0):!1;default:return!1}}function ll(e){return(e.mode&1)!==0&&(e.flags&128)===0}function sl(e){if(Fe){var t=dt;if(t){var n=t;if(!qa(e,t)){if(ll(e))throw Error(u(418));t=qt(n.nextSibling);var l=ct;t&&qa(e,t)?Za(l,n):(e.flags=e.flags&-4097|2,Fe=!1,ct=e)}}else{if(ll(e))throw Error(u(418));e.flags=e.flags&-4097|2,Fe=!1,ct=e}}}function eu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ct=e}function ko(e){if(e!==ct)return!1;if(!Fe)return eu(e),Fe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Zi(e.type,e.memoizedProps)),t&&(t=dt)){if(ll(e))throw tu(),Error(u(418));for(;t;)Za(e,t),t=qt(t.nextSibling)}if(eu(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){dt=qt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}dt=null}}else dt=ct?qt(e.stateNode.nextSibling):null;return!0}function tu(){for(var e=dt;e;)e=qt(e.nextSibling)}function Un(){dt=ct=null,Fe=!1}function al(e){kt===null?kt=[e]:kt.push(e)}var Kp=W.ReactCurrentBatchConfig;function _r(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 l=n.stateNode}if(!l)throw Error(u(147,e));var a=l,c=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===c?t.ref:(t=function(g){var m=a.refs;g===null?delete m[c]:m[c]=g},t._stringRef=c,t)}if(typeof e!="string")throw Error(u(284));if(!n._owner)throw Error(u(290,e))}return e}function wo(e,t){throw e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function nu(e){var t=e._init;return t(e._payload)}function ru(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 l(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=dn(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 g(E){return e&&E.alternate===null&&(E.flags|=2),E}function m(E,C,M,Q){return C===null||C.tag!==6?(C=ql(M,E.mode,Q),C.return=E,C):(C=a(C,M),C.return=E,C)}function w(E,C,M,Q){var re=M.type;return re===K?B(E,C,M.props.children,Q,M.key):C!==null&&(C.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===Me&&nu(re)===C.type)?(Q=a(C,M.props),Q.ref=_r(E,C,M),Q.return=E,Q):(Q=Yo(M.type,M.key,M.props,null,E.mode,Q),Q.ref=_r(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=es(M,E.mode,Q),C.return=E,C):(C=a(C,M.children||[]),C.return=E,C)}function B(E,C,M,Q,re){return C===null||C.tag!==7?(C=Pn(M,E.mode,Q,re),C.return=E,C):(C=a(C,M),C.return=E,C)}function H(E,C,M){if(typeof C=="string"&&C!==""||typeof C=="number")return C=ql(""+C,E.mode,M),C.return=E,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case $:return M=Yo(C.type,C.key,C.props,null,E.mode,M),M.ref=_r(E,null,C),M.return=E,M;case A:return C=es(C,E.mode,M),C.return=E,C;case Me:var Q=C._init;return H(E,Q(C._payload),M)}if(rr(C)||q(C))return C=Pn(C,E.mode,M,null),C.return=E,C;wo(E,C)}return null}function O(E,C,M,Q){var re=C!==null?C.key:null;if(typeof M=="string"&&M!==""||typeof M=="number")return re!==null?null:m(E,C,""+M,Q);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case $:return M.key===re?w(E,C,M,Q):null;case A:return M.key===re?F(E,C,M,Q):null;case Me:return re=M._init,O(E,C,re(M._payload),Q)}if(rr(M)||q(M))return re!==null?null:B(E,C,M,Q,null);wo(E,M)}return null}function Z(E,C,M,Q,re){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return E=E.get(M)||null,m(C,E,""+Q,re);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case $:return E=E.get(Q.key===null?M:Q.key)||null,w(C,E,Q,re);case A:return E=E.get(Q.key===null?M:Q.key)||null,F(C,E,Q,re);case Me:var le=Q._init;return Z(E,C,M,le(Q._payload),re)}if(rr(Q)||q(Q))return E=E.get(M)||null,B(C,E,Q,re,null);wo(C,Q)}return null}function te(E,C,M,Q){for(var re=null,le=null,se=C,ae=C=0,Ye=null;se!==null&&ae<M.length;ae++){se.index>ae?(Ye=se,se=null):Ye=se.sibling;var je=O(E,se,M[ae],Q);if(je===null){se===null&&(se=Ye);break}e&&se&&je.alternate===null&&t(E,se),C=c(je,C,ae),le===null?re=je:le.sibling=je,le=je,se=Ye}if(ae===M.length)return n(E,se),Fe&&vn(E,ae),re;if(se===null){for(;ae<M.length;ae++)se=H(E,M[ae],Q),se!==null&&(C=c(se,C,ae),le===null?re=se:le.sibling=se,le=se);return Fe&&vn(E,ae),re}for(se=l(E,se);ae<M.length;ae++)Ye=Z(se,E,ae,M[ae],Q),Ye!==null&&(e&&Ye.alternate!==null&&se.delete(Ye.key===null?ae:Ye.key),C=c(Ye,C,ae),le===null?re=Ye:le.sibling=Ye,le=Ye);return e&&se.forEach(function(pn){return t(E,pn)}),Fe&&vn(E,ae),re}function ne(E,C,M,Q){var re=q(M);if(typeof re!="function")throw Error(u(150));if(M=re.call(M),M==null)throw Error(u(151));for(var le=re=null,se=C,ae=C=0,Ye=null,je=M.next();se!==null&&!je.done;ae++,je=M.next()){se.index>ae?(Ye=se,se=null):Ye=se.sibling;var pn=O(E,se,je.value,Q);if(pn===null){se===null&&(se=Ye);break}e&&se&&pn.alternate===null&&t(E,se),C=c(pn,C,ae),le===null?re=pn:le.sibling=pn,le=pn,se=Ye}if(je.done)return n(E,se),Fe&&vn(E,ae),re;if(se===null){for(;!je.done;ae++,je=M.next())je=H(E,je.value,Q),je!==null&&(C=c(je,C,ae),le===null?re=je:le.sibling=je,le=je);return Fe&&vn(E,ae),re}for(se=l(E,se);!je.done;ae++,je=M.next())je=Z(se,E,ae,je.value,Q),je!==null&&(e&&je.alternate!==null&&se.delete(je.key===null?ae:je.key),C=c(je,C,ae),le===null?re=je:le.sibling=je,le=je);return e&&se.forEach(function(Lf){return t(E,Lf)}),Fe&&vn(E,ae),re}function We(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 re=M.key,le=C;le!==null;){if(le.key===re){if(re=M.type,re===K){if(le.tag===7){n(E,le.sibling),C=a(le,M.props.children),C.return=E,E=C;break e}}else if(le.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===Me&&nu(re)===le.type){n(E,le.sibling),C=a(le,M.props),C.ref=_r(E,le,M),C.return=E,E=C;break e}n(E,le);break}else t(E,le);le=le.sibling}M.type===K?(C=Pn(M.props.children,E.mode,Q,M.key),C.return=E,E=C):(Q=Yo(M.type,M.key,M.props,null,E.mode,Q),Q.ref=_r(E,C,M),Q.return=E,E=Q)}return g(E);case A:e:{for(le=M.key;C!==null;){if(C.key===le)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=es(M,E.mode,Q),C.return=E,E=C}return g(E);case Me:return le=M._init,We(E,C,le(M._payload),Q)}if(rr(M))return te(E,C,M,Q);if(q(M))return ne(E,C,M,Q);wo(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=ql(M,E.mode,Q),C.return=E,E=C),g(E)):n(E,C)}return We}var Vn=ru(!0),ou=ru(!1),jo=en(null),Co=null,Qn=null,ul=null;function cl(){ul=Qn=Co=null}function dl(e){var t=jo.current;Ee(jo),e._currentValue=t}function pl(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function Yn(e,t){Co=e,ul=Qn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(it=!0),e.firstContext=null)}function ht(e){var t=e._currentValue;if(ul!==e)if(e={context:e,memoizedValue:t,next:null},Qn===null){if(Co===null)throw Error(u(308));Qn=e,Co.dependencies={lanes:0,firstContext:e}}else Qn=Qn.next=e;return t}var Sn=null;function fl(e){Sn===null?Sn=[e]:Sn.push(e)}function iu(e,t,n,l){var a=t.interleaved;return a===null?(n.next=n,fl(t)):(n.next=a.next,a.next=n),t.interleaved=n,Bt(e,l)}function Bt(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 rn=!1;function gl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lu(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 Wt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function on(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(be&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,Bt(e,n)}return a=l.interleaved,a===null?(t.next=t,fl(l)):(t.next=a.next,a.next=t),l.interleaved=t,Bt(e,n)}function To(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,_i(e,n)}}function su(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var g={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};c===null?a=c=g:c=c.next=g,n=n.next}while(n!==null);c===null?a=c=t:c=c.next=t}else a=c=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:c,shared:l.shared,effects:l.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Po(e,t,n,l){var a=e.updateQueue;rn=!1;var c=a.firstBaseUpdate,g=a.lastBaseUpdate,m=a.shared.pending;if(m!==null){a.shared.pending=null;var w=m,F=w.next;w.next=null,g===null?c=F:g.next=F,g=w;var B=e.alternate;B!==null&&(B=B.updateQueue,m=B.lastBaseUpdate,m!==g&&(m===null?B.firstBaseUpdate=F:m.next=F,B.lastBaseUpdate=w))}if(c!==null){var H=a.baseState;g=0,B=F=w=null,m=c;do{var O=m.lane,Z=m.eventTime;if((l&O)===O){B!==null&&(B=B.next={eventTime:Z,lane:0,tag:m.tag,payload:m.payload,callback:m.callback,next:null});e:{var te=e,ne=m;switch(O=t,Z=n,ne.tag){case 1:if(te=ne.payload,typeof te=="function"){H=te.call(Z,H,O);break e}H=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=ne.payload,O=typeof te=="function"?te.call(Z,H,O):te,O==null)break e;H=X({},H,O);break e;case 2:rn=!0}}m.callback!==null&&m.lane!==0&&(e.flags|=64,O=a.effects,O===null?a.effects=[m]:O.push(m))}else Z={eventTime:Z,lane:O,tag:m.tag,payload:m.payload,callback:m.callback,next:null},B===null?(F=B=Z,w=H):B=B.next=Z,g|=O;if(m=m.next,m===null){if(m=a.shared.pending,m===null)break;O=m,m=O.next,O.next=null,a.lastBaseUpdate=O,a.shared.pending=null}}while(!0);if(B===null&&(w=H),a.baseState=w,a.firstBaseUpdate=F,a.lastBaseUpdate=B,t=a.shared.interleaved,t!==null){a=t;do g|=a.lane,a=a.next;while(a!==t)}else c===null&&(a.shared.lanes=0);wn|=g,e.lanes=g,e.memoizedState=H}}function au(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],a=l.callback;if(a!==null){if(l.callback=null,l=n,typeof a!="function")throw Error(u(191,a));a.call(l)}}}var Lr={},Et=en(Lr),zr=en(Lr),Er=en(Lr);function bn(e){if(e===Lr)throw Error(u(174));return e}function hl(e,t){switch(_e(Er,t),_e(zr,e),_e(Et,Lr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:xi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=xi(t,e)}Ee(Et),_e(Et,t)}function Jn(){Ee(Et),Ee(zr),Ee(Er)}function uu(e){bn(Er.current);var t=bn(Et.current),n=xi(t,e.type);t!==n&&(_e(zr,e),_e(Et,n))}function xl(e){zr.current===e&&(Ee(Et),Ee(zr))}var Ie=en(0);function _o(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 yl=[];function ml(){for(var e=0;e<yl.length;e++)yl[e]._workInProgressVersionPrimary=null;yl.length=0}var Lo=W.ReactCurrentDispatcher,vl=W.ReactCurrentBatchConfig,kn=0,$e=null,He=null,Ve=null,zo=!1,Rr=!1,Mr=0,Gp=0;function Ze(){throw Error(u(321))}function Sl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!bt(e[n],t[n]))return!1;return!0}function bl(e,t,n,l,a,c){if(kn=c,$e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Lo.current=e===null||e.memoizedState===null?ef:tf,e=n(l,a),Rr){c=0;do{if(Rr=!1,Mr=0,25<=c)throw Error(u(301));c+=1,Ve=He=null,t.updateQueue=null,Lo.current=nf,e=n(l,a)}while(Rr)}if(Lo.current=Mo,t=He!==null&&He.next!==null,kn=0,Ve=He=$e=null,zo=!1,t)throw Error(u(300));return e}function kl(){var e=Mr!==0;return Mr=0,e}function Rt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ve===null?$e.memoizedState=Ve=e:Ve=Ve.next=e,Ve}function xt(){if(He===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=Ve===null?$e.memoizedState:Ve.next;if(t!==null)Ve=t,He=e;else{if(e===null)throw Error(u(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},Ve===null?$e.memoizedState=Ve=e:Ve=Ve.next=e}return Ve}function Fr(e,t){return typeof t=="function"?t(e):t}function wl(e){var t=xt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var l=He,a=l.baseQueue,c=n.pending;if(c!==null){if(a!==null){var g=a.next;a.next=c.next,c.next=g}l.baseQueue=a=c,n.pending=null}if(a!==null){c=a.next,l=l.baseState;var m=g=null,w=null,F=c;do{var B=F.lane;if((kn&B)===B)w!==null&&(w=w.next={lane:0,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),l=F.hasEagerState?F.eagerState:e(l,F.action);else{var H={lane:B,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null};w===null?(m=w=H,g=l):w=w.next=H,$e.lanes|=B,wn|=B}F=F.next}while(F!==null&&F!==c);w===null?g=l:w.next=m,bt(l,t.memoizedState)||(it=!0),t.memoizedState=l,t.baseState=g,t.baseQueue=w,n.lastRenderedState=l}if(e=n.interleaved,e!==null){a=e;do c=a.lane,$e.lanes|=c,wn|=c,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function jl(e){var t=xt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,c=t.memoizedState;if(a!==null){n.pending=null;var g=a=a.next;do c=e(c,g.action),g=g.next;while(g!==a);bt(c,t.memoizedState)||(it=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,l]}function cu(){}function du(e,t){var n=$e,l=xt(),a=t(),c=!bt(l.memoizedState,a);if(c&&(l.memoizedState=a,it=!0),l=l.queue,Cl(gu.bind(null,n,l,e),[e]),l.getSnapshot!==t||c||Ve!==null&&Ve.memoizedState.tag&1){if(n.flags|=2048,Ir(9,fu.bind(null,n,l,a,t),void 0,null),Qe===null)throw Error(u(349));(kn&30)!==0||pu(n,t,a)}return a}function pu(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 fu(e,t,n,l){t.value=n,t.getSnapshot=l,hu(t)&&xu(e)}function gu(e,t,n){return n(function(){hu(t)&&xu(e)})}function hu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bt(e,n)}catch{return!0}}function xu(e){var t=Bt(e,1);t!==null&&Tt(t,e,1,-1)}function yu(e){var t=Rt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:e},t.queue=e,e=e.dispatch=qp.bind(null,$e,e),[t.memoizedState,e]}function Ir(e,t,n,l){return e={tag:e,create:t,destroy:n,deps:l,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:(l=n.next,n.next=e,e.next=l,t.lastEffect=e)),e}function mu(){return xt().memoizedState}function Eo(e,t,n,l){var a=Rt();$e.flags|=e,a.memoizedState=Ir(1|t,n,void 0,l===void 0?null:l)}function Ro(e,t,n,l){var a=xt();l=l===void 0?null:l;var c=void 0;if(He!==null){var g=He.memoizedState;if(c=g.destroy,l!==null&&Sl(l,g.deps)){a.memoizedState=Ir(t,n,c,l);return}}$e.flags|=e,a.memoizedState=Ir(1|t,n,c,l)}function vu(e,t){return Eo(8390656,8,e,t)}function Cl(e,t){return Ro(2048,8,e,t)}function Su(e,t){return Ro(4,2,e,t)}function bu(e,t){return Ro(4,4,e,t)}function ku(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 wu(e,t,n){return n=n!=null?n.concat([e]):null,Ro(4,4,ku.bind(null,t,e),n)}function Tl(){}function ju(e,t){var n=xt();t=t===void 0?null:t;var l=n.memoizedState;return l!==null&&t!==null&&Sl(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Cu(e,t){var n=xt();t=t===void 0?null:t;var l=n.memoizedState;return l!==null&&t!==null&&Sl(t,l[1])?l[0]:(e=e(),n.memoizedState=[e,t],e)}function Tu(e,t,n){return(kn&21)===0?(e.baseState&&(e.baseState=!1,it=!0),e.memoizedState=n):(bt(n,t)||(n=na(),$e.lanes|=n,wn|=n,e.baseState=!0),t)}function Xp(e,t){var n=Ce;Ce=n!==0&&4>n?n:4,e(!0);var l=vl.transition;vl.transition={};try{e(!1),t()}finally{Ce=n,vl.transition=l}}function Pu(){return xt().memoizedState}function Zp(e,t,n){var l=un(e);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},_u(e))Lu(t,n);else if(n=iu(e,t,n,l),n!==null){var a=nt();Tt(n,e,l,a),zu(n,t,l)}}function qp(e,t,n){var l=un(e),a={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(_u(e))Lu(t,a);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var g=t.lastRenderedState,m=c(g,n);if(a.hasEagerState=!0,a.eagerState=m,bt(m,g)){var w=t.interleaved;w===null?(a.next=a,fl(t)):(a.next=w.next,w.next=a),t.interleaved=a;return}}catch{}n=iu(e,t,a,l),n!==null&&(a=nt(),Tt(n,e,l,a),zu(n,t,l))}}function _u(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function Lu(e,t){Rr=zo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zu(e,t,n){if((n&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,_i(e,n)}}var Mo={readContext:ht,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useInsertionEffect:Ze,useLayoutEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useMutableSource:Ze,useSyncExternalStore:Ze,useId:Ze,unstable_isNewReconciler:!1},ef={readContext:ht,useCallback:function(e,t){return Rt().memoizedState=[e,t===void 0?null:t],e},useContext:ht,useEffect:vu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Eo(4194308,4,ku.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Eo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Eo(4,2,e,t)},useMemo:function(e,t){var n=Rt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var l=Rt();return t=n!==void 0?n(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Zp.bind(null,$e,e),[l.memoizedState,e]},useRef:function(e){var t=Rt();return e={current:e},t.memoizedState=e},useState:yu,useDebugValue:Tl,useDeferredValue:function(e){return Rt().memoizedState=e},useTransition:function(){var e=yu(!1),t=e[0];return e=Xp.bind(null,e[1]),Rt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var l=$e,a=Rt();if(Fe){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Qe===null)throw Error(u(349));(kn&30)!==0||pu(l,t,n)}a.memoizedState=n;var c={value:n,getSnapshot:t};return a.queue=c,vu(gu.bind(null,l,c,e),[e]),l.flags|=2048,Ir(9,fu.bind(null,l,c,n,t),void 0,null),n},useId:function(){var e=Rt(),t=Qe.identifierPrefix;if(Fe){var n=Ot,l=Dt;n=(l&~(1<<32-St(l)-1)).toString(32)+n,t=":"+t+"R"+n,n=Mr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Gp++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tf={readContext:ht,useCallback:ju,useContext:ht,useEffect:Cl,useImperativeHandle:wu,useInsertionEffect:Su,useLayoutEffect:bu,useMemo:Cu,useReducer:wl,useRef:mu,useState:function(){return wl(Fr)},useDebugValue:Tl,useDeferredValue:function(e){var t=xt();return Tu(t,He.memoizedState,e)},useTransition:function(){var e=wl(Fr)[0],t=xt().memoizedState;return[e,t]},useMutableSource:cu,useSyncExternalStore:du,useId:Pu,unstable_isNewReconciler:!1},nf={readContext:ht,useCallback:ju,useContext:ht,useEffect:Cl,useImperativeHandle:wu,useInsertionEffect:Su,useLayoutEffect:bu,useMemo:Cu,useReducer:jl,useRef:mu,useState:function(){return jl(Fr)},useDebugValue:Tl,useDeferredValue:function(e){var t=xt();return He===null?t.memoizedState=e:Tu(t,He.memoizedState,e)},useTransition:function(){var e=jl(Fr)[0],t=xt().memoizedState;return[e,t]},useMutableSource:cu,useSyncExternalStore:du,useId:Pu,unstable_isNewReconciler:!1};function wt(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 Pl(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:X({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Fo={isMounted:function(e){return(e=e._reactInternals)?hn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var l=nt(),a=un(e),c=Wt(l,a);c.payload=t,n!=null&&(c.callback=n),t=on(e,c,a),t!==null&&(Tt(t,e,a,l),To(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=nt(),a=un(e),c=Wt(l,a);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=on(e,c,a),t!==null&&(Tt(t,e,a,l),To(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=nt(),l=un(e),a=Wt(n,l);a.tag=2,t!=null&&(a.callback=t),t=on(e,a,l),t!==null&&(Tt(t,e,l,n),To(t,e,l))}};function Eu(e,t,n,l,a,c,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,g):t.prototype&&t.prototype.isPureReactComponent?!br(n,l)||!br(a,c):!0}function Ru(e,t,n){var l=!1,a=tn,c=t.contextType;return typeof c=="object"&&c!==null?c=ht(c):(a=ot(t)?yn:Xe.current,l=t.contextTypes,c=(l=l!=null)?Wn(e,a):tn),t=new t(n,c),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Fo,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=c),t}function Mu(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Fo.enqueueReplaceState(t,t.state,null)}function _l(e,t,n,l){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},gl(e);var c=t.contextType;typeof c=="object"&&c!==null?a.context=ht(c):(c=ot(t)?yn:Xe.current,a.context=Wn(e,c)),a.state=e.memoizedState,c=t.getDerivedStateFromProps,typeof c=="function"&&(Pl(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&&Fo.enqueueReplaceState(a,a.state,null),Po(e,n,a,l),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Kn(e,t){try{var n="",l=t;do n+=pe(l),l=l.return;while(l);var a=n}catch(c){a=`
|
|
7
|
+
Error generating stack: `+c.message+`
|
|
8
|
+
`+c.stack}return{value:e,source:t,stack:a,digest:null}}function Ll(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function zl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var rf=typeof WeakMap=="function"?WeakMap:Map;function Fu(e,t,n){n=Wt(-1,n),n.tag=3,n.payload={element:null};var l=t.value;return n.callback=function(){Wo||(Wo=!0,Vl=l),zl(e,t)},n}function Iu(e,t,n){n=Wt(-1,n),n.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var a=t.value;n.payload=function(){return l(a)},n.callback=function(){zl(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(n.callback=function(){zl(e,t),typeof l!="function"&&(sn===null?sn=new Set([this]):sn.add(this));var g=t.stack;this.componentDidCatch(t.value,{componentStack:g!==null?g:""})}),n}function $u(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new rf;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(a.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function Nu(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 Du(e,t,n,l,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=Wt(-1,1),t.tag=2,on(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}var of=W.ReactCurrentOwner,it=!1;function tt(e,t,n,l){t.child=e===null?ou(t,null,n,l):Vn(t,e.child,n,l)}function Ou(e,t,n,l,a){n=n.render;var c=t.ref;return Yn(t,a),l=bl(e,t,n,l,c,a),n=kl(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,At(e,t,a)):(Fe&&n&&ol(t),t.flags|=1,tt(e,t,l,a),t.child)}function Bu(e,t,n,l,a){if(e===null){var c=n.type;return typeof c=="function"&&!Zl(c)&&c.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=c,Wu(e,t,c,l,a)):(e=Yo(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&a)===0){var g=c.memoizedProps;if(n=n.compare,n=n!==null?n:br,n(g,l)&&e.ref===t.ref)return At(e,t,a)}return t.flags|=1,e=dn(c,l),e.ref=t.ref,e.return=t,t.child=e}function Wu(e,t,n,l,a){if(e!==null){var c=e.memoizedProps;if(br(c,l)&&e.ref===t.ref)if(it=!1,t.pendingProps=l=c,(e.lanes&a)!==0)(e.flags&131072)!==0&&(it=!0);else return t.lanes=e.lanes,At(e,t,a)}return El(e,t,n,l,a)}function Au(e,t,n){var l=t.pendingProps,a=l.children,c=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_e(Xn,pt),pt|=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(Xn,pt),pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=c!==null?c.baseLanes:n,_e(Xn,pt),pt|=l}else c!==null?(l=c.baseLanes|n,t.memoizedState=null):l=n,_e(Xn,pt),pt|=l;return tt(e,t,a,n),t.child}function Hu(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function El(e,t,n,l,a){var c=ot(n)?yn:Xe.current;return c=Wn(t,c),Yn(t,a),n=bl(e,t,n,l,c,a),l=kl(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,At(e,t,a)):(Fe&&l&&ol(t),t.flags|=1,tt(e,t,n,a),t.child)}function Uu(e,t,n,l,a){if(ot(n)){var c=!0;mo(t)}else c=!1;if(Yn(t,a),t.stateNode===null)$o(e,t),Ru(t,n,l),_l(t,n,l,a),l=!0;else if(e===null){var g=t.stateNode,m=t.memoizedProps;g.props=m;var w=g.context,F=n.contextType;typeof F=="object"&&F!==null?F=ht(F):(F=ot(n)?yn:Xe.current,F=Wn(t,F));var B=n.getDerivedStateFromProps,H=typeof B=="function"||typeof g.getSnapshotBeforeUpdate=="function";H||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(m!==l||w!==F)&&Mu(t,g,l,F),rn=!1;var O=t.memoizedState;g.state=O,Po(t,l,g,a),w=t.memoizedState,m!==l||O!==w||rt.current||rn?(typeof B=="function"&&(Pl(t,n,B,l),w=t.memoizedState),(m=rn||Eu(t,n,m,l,O,w,F))?(H||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(t.flags|=4194308)):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=w),g.props=l,g.state=w,g.context=F,l=m):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{g=t.stateNode,lu(e,t),m=t.memoizedProps,F=t.type===t.elementType?m:wt(t.type,m),g.props=F,H=t.pendingProps,O=g.context,w=n.contextType,typeof w=="object"&&w!==null?w=ht(w):(w=ot(n)?yn:Xe.current,w=Wn(t,w));var Z=n.getDerivedStateFromProps;(B=typeof Z=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(m!==H||O!==w)&&Mu(t,g,l,w),rn=!1,O=t.memoizedState,g.state=O,Po(t,l,g,a);var te=t.memoizedState;m!==H||O!==te||rt.current||rn?(typeof Z=="function"&&(Pl(t,n,Z,l),te=t.memoizedState),(F=rn||Eu(t,n,F,l,O,te,w)||!1)?(B||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,te,w),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,te,w)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||m===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=te),g.props=l,g.state=te,g.context=w,l=F):(typeof g.componentDidUpdate!="function"||m===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),l=!1)}return Rl(e,t,n,l,c,a)}function Rl(e,t,n,l,a,c){Hu(e,t);var g=(t.flags&128)!==0;if(!l&&!g)return a&&Ka(t,n,!1),At(e,t,c);l=t.stateNode,of.current=t;var m=g&&typeof n.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&g?(t.child=Vn(t,e.child,null,c),t.child=Vn(t,null,m,c)):tt(e,t,m,c),t.memoizedState=l.state,a&&Ka(t,n,!0),t.child}function Vu(e){var t=e.stateNode;t.pendingContext?Ya(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ya(e,t.context,!1),hl(e,t.containerInfo)}function Qu(e,t,n,l,a){return Un(),al(a),t.flags|=256,tt(e,t,n,l),t.child}var Ml={dehydrated:null,treeContext:null,retryLane:0};function Fl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Yu(e,t,n){var l=t.pendingProps,a=Ie.current,c=!1,g=(t.flags&128)!==0,m;if((m=g)||(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 sl(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):(g=l.children,e=l.fallback,c?(l=t.mode,c=t.child,g={mode:"hidden",children:g},(l&1)===0&&c!==null?(c.childLanes=0,c.pendingProps=g):c=Jo(g,l,0,null),e=Pn(e,l,n,null),c.return=t,e.return=t,c.sibling=e,t.child=c,t.child.memoizedState=Fl(n),t.memoizedState=Ml,e):Il(t,g));if(a=e.memoizedState,a!==null&&(m=a.dehydrated,m!==null))return lf(e,t,g,l,m,a,n);if(c){c=l.fallback,g=t.mode,a=e.child,m=a.sibling;var w={mode:"hidden",children:l.children};return(g&1)===0&&t.child!==a?(l=t.child,l.childLanes=0,l.pendingProps=w,t.deletions=null):(l=dn(a,w),l.subtreeFlags=a.subtreeFlags&14680064),m!==null?c=dn(m,c):(c=Pn(c,g,n,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,l=c,c=t.child,g=e.child.memoizedState,g=g===null?Fl(n):{baseLanes:g.baseLanes|n,cachePool:null,transitions:g.transitions},c.memoizedState=g,c.childLanes=e.childLanes&~n,t.memoizedState=Ml,l}return c=e.child,e=c.sibling,l=dn(c,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=n),l.return=t,l.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=l,t.memoizedState=null,l}function Il(e,t){return t=Jo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Io(e,t,n,l){return l!==null&&al(l),Vn(t,e.child,null,n),e=Il(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lf(e,t,n,l,a,c,g){if(n)return t.flags&256?(t.flags&=-257,l=Ll(Error(u(422))),Io(e,t,g,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(c=l.fallback,a=t.mode,l=Jo({mode:"visible",children:l.children},a,0,null),c=Pn(c,a,g,null),c.flags|=2,l.return=t,c.return=t,l.sibling=c,t.child=l,(t.mode&1)!==0&&Vn(t,e.child,null,g),t.child.memoizedState=Fl(g),t.memoizedState=Ml,c);if((t.mode&1)===0)return Io(e,t,g,null);if(a.data==="$!"){if(l=a.nextSibling&&a.nextSibling.dataset,l)var m=l.dgst;return l=m,c=Error(u(419)),l=Ll(c,l,void 0),Io(e,t,g,l)}if(m=(g&e.childLanes)!==0,it||m){if(l=Qe,l!==null){switch(g&-g){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&(l.suspendedLanes|g))!==0?0:a,a!==0&&a!==c.retryLane&&(c.retryLane=a,Bt(e,a),Tt(l,e,a,-1))}return Xl(),l=Ll(Error(u(421))),Io(e,t,g,l)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=vf.bind(null,e),a._reactRetry=t,null):(e=c.treeContext,dt=qt(a.nextSibling),ct=t,Fe=!0,kt=null,e!==null&&(ft[gt++]=Dt,ft[gt++]=Ot,ft[gt++]=mn,Dt=e.id,Ot=e.overflow,mn=t),t=Il(t,l.children),t.flags|=4096,t)}function Ju(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),pl(e.return,t,n)}function $l(e,t,n,l,a){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=l,c.tail=n,c.tailMode=a)}function Ku(e,t,n){var l=t.pendingProps,a=l.revealOrder,c=l.tail;if(tt(e,t,l.children,n),l=Ie.current,(l&2)!==0)l=l&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&&Ju(e,n,t);else if(e.tag===19)Ju(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}l&=1}if(_e(Ie,l),(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&&_o(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),$l(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&&_o(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}$l(t,!0,n,null,c);break;case"together":$l(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $o(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function At(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),wn|=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=dn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=dn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sf(e,t,n){switch(t.tag){case 3:Vu(t),Un();break;case 5:uu(t);break;case 1:ot(t.type)&&mo(t);break;case 4:hl(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,a=t.memoizedProps.value;_e(jo,l._currentValue),l._currentValue=a;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(_e(Ie,Ie.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Yu(e,t,n):(_e(Ie,Ie.current&1),e=At(e,t,n),e!==null?e.sibling:null);_e(Ie,Ie.current&1);break;case 19:if(l=(n&t.childLanes)!==0,(e.flags&128)!==0){if(l)return Ku(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),l)break;return null;case 22:case 23:return t.lanes=0,Au(e,t,n)}return At(e,t,n)}var Gu,Nl,Xu,Zu;Gu=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}},Nl=function(){},Xu=function(e,t,n,l){var a=e.memoizedProps;if(a!==l){e=t.stateNode,bn(Et.current);var c=null;switch(n){case"input":a=Se(e,a),l=Se(e,l),c=[];break;case"select":a=X({},a,{value:void 0}),l=X({},l,{value:void 0}),c=[];break;case"textarea":a=hi(e,a),l=hi(e,l),c=[];break;default:typeof a.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=ho)}yi(n,l);var g;n=null;for(F in a)if(!l.hasOwnProperty(F)&&a.hasOwnProperty(F)&&a[F]!=null)if(F==="style"){var m=a[F];for(g in m)m.hasOwnProperty(g)&&(n||(n={}),n[g]="")}else F!=="dangerouslySetInnerHTML"&&F!=="children"&&F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&F!=="autoFocus"&&(p.hasOwnProperty(F)?c||(c=[]):(c=c||[]).push(F,null));for(F in l){var w=l[F];if(m=a?.[F],l.hasOwnProperty(F)&&w!==m&&(w!=null||m!=null))if(F==="style")if(m){for(g in m)!m.hasOwnProperty(g)||w&&w.hasOwnProperty(g)||(n||(n={}),n[g]="");for(g in w)w.hasOwnProperty(g)&&m[g]!==w[g]&&(n||(n={}),n[g]=w[g])}else n||(c||(c=[]),c.push(F,n)),n=w;else F==="dangerouslySetInnerHTML"?(w=w?w.__html:void 0,m=m?m.__html:void 0,w!=null&&m!==w&&(c=c||[]).push(F,w)):F==="children"?typeof w!="string"&&typeof w!="number"||(c=c||[]).push(F,""+w):F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&(p.hasOwnProperty(F)?(w!=null&&F==="onScroll"&&ze("scroll",e),c||m===w||(c=[])):(c=c||[]).push(F,w))}n&&(c=c||[]).push("style",n);var F=c;(t.updateQueue=F)&&(t.flags|=4)}},Zu=function(e,t,n,l){n!==l&&(t.flags|=4)};function $r(e,t){if(!Fe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&14680064,l|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function af(e,t,n){var l=t.pendingProps;switch(il(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return ot(t.type)&&yo(),qe(t),null;case 3:return l=t.stateNode,Jn(),Ee(rt),Ee(Xe),ml(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ko(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,kt!==null&&(Jl(kt),kt=null))),Nl(e,t),qe(t),null;case 5:xl(t);var a=bn(Er.current);if(n=t.type,e!==null&&t.stateNode!=null)Xu(e,t,n,l,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(u(166));return qe(t),null}if(e=bn(Et.current),ko(t)){l=t.stateNode,n=t.type;var c=t.memoizedProps;switch(l[zt]=t,l[Tr]=c,e=(t.mode&1)!==0,n){case"dialog":ze("cancel",l),ze("close",l);break;case"iframe":case"object":case"embed":ze("load",l);break;case"video":case"audio":for(a=0;a<wr.length;a++)ze(wr[a],l);break;case"source":ze("error",l);break;case"img":case"image":case"link":ze("error",l),ze("load",l);break;case"details":ze("toggle",l);break;case"input":De(l,c),ze("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!c.multiple},ze("invalid",l);break;case"textarea":Is(l,c),ze("invalid",l)}yi(n,c),a=null;for(var g in c)if(c.hasOwnProperty(g)){var m=c[g];g==="children"?typeof m=="string"?l.textContent!==m&&(c.suppressHydrationWarning!==!0&&go(l.textContent,m,e),a=["children",m]):typeof m=="number"&&l.textContent!==""+m&&(c.suppressHydrationWarning!==!0&&go(l.textContent,m,e),a=["children",""+m]):p.hasOwnProperty(g)&&m!=null&&g==="onScroll"&&ze("scroll",l)}switch(n){case"input":_t(l),Fs(l,c,!0);break;case"textarea":_t(l),Ns(l);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(l.onclick=ho)}l=a,t.updateQueue=l,l!==null&&(t.flags|=4)}else{g=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ds(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=g.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=g.createElement(n,{is:l.is}):(e=g.createElement(n),n==="select"&&(g=e,l.multiple?g.multiple=!0:l.size&&(g.size=l.size))):e=g.createElementNS(e,n),e[zt]=t,e[Tr]=l,Gu(e,t,!1,!1),t.stateNode=e;e:{switch(g=mi(n,l),n){case"dialog":ze("cancel",e),ze("close",e),a=l;break;case"iframe":case"object":case"embed":ze("load",e),a=l;break;case"video":case"audio":for(a=0;a<wr.length;a++)ze(wr[a],e);a=l;break;case"source":ze("error",e),a=l;break;case"img":case"image":case"link":ze("error",e),ze("load",e),a=l;break;case"details":ze("toggle",e),a=l;break;case"input":De(e,l),a=Se(e,l),ze("invalid",e);break;case"option":a=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},a=X({},l,{value:void 0}),ze("invalid",e);break;case"textarea":Is(e,l),a=hi(e,l),ze("invalid",e);break;default:a=l}yi(n,a),m=a;for(c in m)if(m.hasOwnProperty(c)){var w=m[c];c==="style"?Ws(e,w):c==="dangerouslySetInnerHTML"?(w=w?w.__html:void 0,w!=null&&Os(e,w)):c==="children"?typeof w=="string"?(n!=="textarea"||w!=="")&&or(e,w):typeof w=="number"&&or(e,""+w):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(p.hasOwnProperty(c)?w!=null&&c==="onScroll"&&ze("scroll",e):w!=null&&U(e,c,w,g))}switch(n){case"input":_t(e),Fs(e,l,!1);break;case"textarea":_t(e),Ns(e);break;case"option":l.value!=null&&e.setAttribute("value",""+we(l.value));break;case"select":e.multiple=!!l.multiple,c=l.value,c!=null?Ln(e,!!l.multiple,c,!1):l.defaultValue!=null&&Ln(e,!!l.multiple,l.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=ho)}switch(n){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return qe(t),null;case 6:if(e&&t.stateNode!=null)Zu(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(u(166));if(n=bn(Er.current),bn(Et.current),ko(t)){if(l=t.stateNode,n=t.memoizedProps,l[zt]=t,(c=l.nodeValue!==n)&&(e=ct,e!==null))switch(e.tag){case 3:go(l.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&go(l.nodeValue,n,(e.mode&1)!==0)}c&&(t.flags|=4)}else l=(n.nodeType===9?n:n.ownerDocument).createTextNode(l),l[zt]=t,t.stateNode=l}return qe(t),null;case 13:if(Ee(Ie),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Fe&&dt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)tu(),Un(),t.flags|=98560,c=!1;else if(c=ko(t),l!==null&&l.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[zt]=t}else Un(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),c=!1}else kt!==null&&(Jl(kt),kt=null),c=!0;if(!c)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ie.current&1)!==0?Ue===0&&(Ue=3):Xl())),t.updateQueue!==null&&(t.flags|=4),qe(t),null);case 4:return Jn(),Nl(e,t),e===null&&jr(t.stateNode.containerInfo),qe(t),null;case 10:return dl(t.type._context),qe(t),null;case 17:return ot(t.type)&&yo(),qe(t),null;case 19:if(Ee(Ie),c=t.memoizedState,c===null)return qe(t),null;if(l=(t.flags&128)!==0,g=c.rendering,g===null)if(l)$r(c,!1);else{if(Ue!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(g=_o(e),g!==null){for(t.flags|=128,$r(c,!1),l=g.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=n,n=t.child;n!==null;)c=n,e=l,c.flags&=14680066,g=c.alternate,g===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=g.childLanes,c.lanes=g.lanes,c.child=g.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=g.memoizedProps,c.memoizedState=g.memoizedState,c.updateQueue=g.updateQueue,c.type=g.type,e=g.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()>Zn&&(t.flags|=128,l=!0,$r(c,!1),t.lanes=4194304)}else{if(!l)if(e=_o(g),e!==null){if(t.flags|=128,l=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),$r(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Fe)return qe(t),null}else 2*Be()-c.renderingStartTime>Zn&&n!==1073741824&&(t.flags|=128,l=!0,$r(c,!1),t.lanes=4194304);c.isBackwards?(g.sibling=t.child,t.child=g):(n=c.last,n!==null?n.sibling=g:t.child=g,c.last=g)}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,l?n&1|2:n&1),t):(qe(t),null);case 22:case 23:return Gl(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(pt&1073741824)!==0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),null;case 24:return null;case 25:return null}throw Error(u(156,t.tag))}function uf(e,t){switch(il(t),t.tag){case 1:return ot(t.type)&&yo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jn(),Ee(rt),Ee(Xe),ml(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return xl(t),null;case 13:if(Ee(Ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Un()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ee(Ie),null;case 4:return Jn(),null;case 10:return dl(t.type._context),null;case 22:case 23:return Gl(),null;case 24:return null;default:return null}}var No=!1,et=!1,cf=typeof WeakSet=="function"?WeakSet:Set,ee=null;function Gn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(l){Oe(e,t,l)}else n.current=null}function Dl(e,t,n){try{n()}catch(l){Oe(e,t,l)}}var qu=!1;function df(e,t){if(Gi=no,e=Ea(),Ai(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var g=0,m=-1,w=-1,F=0,B=0,H=e,O=null;t:for(;;){for(var Z;H!==n||a!==0&&H.nodeType!==3||(m=g+a),H!==c||l!==0&&H.nodeType!==3||(w=g+l),H.nodeType===3&&(g+=H.nodeValue.length),(Z=H.firstChild)!==null;)O=H,H=Z;for(;;){if(H===e)break t;if(O===n&&++F===a&&(m=g),O===c&&++B===l&&(w=g),(Z=H.nextSibling)!==null)break;H=O,O=H.parentNode}H=Z}n=m===-1||w===-1?null:{start:m,end:w}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xi={focusedElem:e,selectionRange:n},no=!1,ee=t;ee!==null;)if(t=ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ee=e;else for(;ee!==null;){t=ee;try{var te=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(te!==null){var ne=te.memoizedProps,We=te.memoizedState,E=t.stateNode,C=E.getSnapshotBeforeUpdate(t.elementType===t.type?ne:wt(t.type,ne),We);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,ee=e;break}ee=t.return}return te=qu,qu=!1,te}function Nr(e,t,n){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var a=l=l.next;do{if((a.tag&e)===e){var c=a.destroy;a.destroy=void 0,c!==void 0&&Dl(t,n,c)}a=a.next}while(a!==l)}}function Do(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 l=n.create;n.destroy=l()}n=n.next}while(n!==t)}}function Ol(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 ec(e){var t=e.alternate;t!==null&&(e.alternate=null,ec(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zt],delete t[Tr],delete t[tl],delete t[Qp],delete t[Yp])),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 tc(e){return e.tag===5||e.tag===3||e.tag===4}function nc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tc(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 Bl(e,t,n){var l=e.tag;if(l===5||l===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=ho));else if(l!==4&&(e=e.child,e!==null))for(Bl(e,t,n),e=e.sibling;e!==null;)Bl(e,t,n),e=e.sibling}function Wl(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Wl(e,t,n),e=e.sibling;e!==null;)Wl(e,t,n),e=e.sibling}var Ke=null,jt=!1;function ln(e,t,n){for(n=n.child;n!==null;)rc(e,t,n),n=n.sibling}function rc(e,t,n){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(Gr,n)}catch{}switch(n.tag){case 5:et||Gn(n,t);case 6:var l=Ke,a=jt;Ke=null,ln(e,t,n),Ke=l,jt=a,Ke!==null&&(jt?(e=Ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ke.removeChild(n.stateNode));break;case 18:Ke!==null&&(jt?(e=Ke,n=n.stateNode,e.nodeType===8?el(e.parentNode,n):e.nodeType===1&&el(e,n),hr(e)):el(Ke,n.stateNode));break;case 4:l=Ke,a=jt,Ke=n.stateNode.containerInfo,jt=!0,ln(e,t,n),Ke=l,jt=a;break;case 0:case 11:case 14:case 15:if(!et&&(l=n.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){a=l=l.next;do{var c=a,g=c.destroy;c=c.tag,g!==void 0&&((c&2)!==0||(c&4)!==0)&&Dl(n,t,g),a=a.next}while(a!==l)}ln(e,t,n);break;case 1:if(!et&&(Gn(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=n.memoizedProps,l.state=n.memoizedState,l.componentWillUnmount()}catch(m){Oe(n,t,m)}ln(e,t,n);break;case 21:ln(e,t,n);break;case 22:n.mode&1?(et=(l=et)||n.memoizedState!==null,ln(e,t,n),et=l):ln(e,t,n);break;default:ln(e,t,n)}}function oc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new cf),t.forEach(function(l){var a=Sf.bind(null,e,l);n.has(l)||(n.add(l),l.then(a,a))})}}function Ct(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l];try{var c=e,g=t,m=g;e:for(;m!==null;){switch(m.tag){case 5:Ke=m.stateNode,jt=!1;break e;case 3:Ke=m.stateNode.containerInfo,jt=!0;break e;case 4:Ke=m.stateNode.containerInfo,jt=!0;break e}m=m.return}if(Ke===null)throw Error(u(160));rc(c,g,a),Ke=null,jt=!1;var w=a.alternate;w!==null&&(w.return=null),a.return=null}catch(F){Oe(a,t,F)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ic(t,e),t=t.sibling}function ic(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ct(t,e),Mt(e),l&4){try{Nr(3,e,e.return),Do(3,e)}catch(ne){Oe(e,e.return,ne)}try{Nr(5,e,e.return)}catch(ne){Oe(e,e.return,ne)}}break;case 1:Ct(t,e),Mt(e),l&512&&n!==null&&Gn(n,n.return);break;case 5:if(Ct(t,e),Mt(e),l&512&&n!==null&&Gn(n,n.return),e.flags&32){var a=e.stateNode;try{or(a,"")}catch(ne){Oe(e,e.return,ne)}}if(l&4&&(a=e.stateNode,a!=null)){var c=e.memoizedProps,g=n!==null?n.memoizedProps:c,m=e.type,w=e.updateQueue;if(e.updateQueue=null,w!==null)try{m==="input"&&c.type==="radio"&&c.name!=null&&Je(a,c),mi(m,g);var F=mi(m,c);for(g=0;g<w.length;g+=2){var B=w[g],H=w[g+1];B==="style"?Ws(a,H):B==="dangerouslySetInnerHTML"?Os(a,H):B==="children"?or(a,H):U(a,B,H,F)}switch(m){case"input":vt(a,c);break;case"textarea":$s(a,c);break;case"select":var O=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!c.multiple;var Z=c.value;Z!=null?Ln(a,!!c.multiple,Z,!1):O!==!!c.multiple&&(c.defaultValue!=null?Ln(a,!!c.multiple,c.defaultValue,!0):Ln(a,!!c.multiple,c.multiple?[]:"",!1))}a[Tr]=c}catch(ne){Oe(e,e.return,ne)}}break;case 6:if(Ct(t,e),Mt(e),l&4){if(e.stateNode===null)throw Error(u(162));a=e.stateNode,c=e.memoizedProps;try{a.nodeValue=c}catch(ne){Oe(e,e.return,ne)}}break;case 3:if(Ct(t,e),Mt(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{hr(t.containerInfo)}catch(ne){Oe(e,e.return,ne)}break;case 4:Ct(t,e),Mt(e);break;case 13:Ct(t,e),Mt(e),a=e.child,a.flags&8192&&(c=a.memoizedState!==null,a.stateNode.isHidden=c,!c||a.alternate!==null&&a.alternate.memoizedState!==null||(Ul=Be())),l&4&&oc(e);break;case 22:if(B=n!==null&&n.memoizedState!==null,e.mode&1?(et=(F=et)||B,Ct(t,e),et=F):Ct(t,e),Mt(e),l&8192){if(F=e.memoizedState!==null,(e.stateNode.isHidden=F)&&!B&&(e.mode&1)!==0)for(ee=e,B=e.child;B!==null;){for(H=ee=B;ee!==null;){switch(O=ee,Z=O.child,O.tag){case 0:case 11:case 14:case 15:Nr(4,O,O.return);break;case 1:Gn(O,O.return);var te=O.stateNode;if(typeof te.componentWillUnmount=="function"){l=O,n=O.return;try{t=l,te.props=t.memoizedProps,te.state=t.memoizedState,te.componentWillUnmount()}catch(ne){Oe(l,n,ne)}}break;case 5:Gn(O,O.return);break;case 22:if(O.memoizedState!==null){ac(H);continue}}Z!==null?(Z.return=O,ee=Z):ac(H)}B=B.sibling}e:for(B=null,H=e;;){if(H.tag===5){if(B===null){B=H;try{a=H.stateNode,F?(c=a.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(m=H.stateNode,w=H.memoizedProps.style,g=w!=null&&w.hasOwnProperty("display")?w.display:null,m.style.display=Bs("display",g))}catch(ne){Oe(e,e.return,ne)}}}else if(H.tag===6){if(B===null)try{H.stateNode.nodeValue=F?"":H.memoizedProps}catch(ne){Oe(e,e.return,ne)}}else if((H.tag!==22&&H.tag!==23||H.memoizedState===null||H===e)&&H.child!==null){H.child.return=H,H=H.child;continue}if(H===e)break e;for(;H.sibling===null;){if(H.return===null||H.return===e)break e;B===H&&(B=null),H=H.return}B===H&&(B=null),H.sibling.return=H.return,H=H.sibling}}break;case 19:Ct(t,e),Mt(e),l&4&&oc(e);break;case 21:break;default:Ct(t,e),Mt(e)}}function Mt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(tc(n)){var l=n;break e}n=n.return}throw Error(u(160))}switch(l.tag){case 5:var a=l.stateNode;l.flags&32&&(or(a,""),l.flags&=-33);var c=nc(e);Wl(e,c,a);break;case 3:case 4:var g=l.stateNode.containerInfo,m=nc(e);Bl(e,m,g);break;default:throw Error(u(161))}}catch(w){Oe(e,e.return,w)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pf(e,t,n){ee=e,lc(e)}function lc(e,t,n){for(var l=(e.mode&1)!==0;ee!==null;){var a=ee,c=a.child;if(a.tag===22&&l){var g=a.memoizedState!==null||No;if(!g){var m=a.alternate,w=m!==null&&m.memoizedState!==null||et;m=No;var F=et;if(No=g,(et=w)&&!F)for(ee=a;ee!==null;)g=ee,w=g.child,g.tag===22&&g.memoizedState!==null?uc(a):w!==null?(w.return=g,ee=w):uc(a);for(;c!==null;)ee=c,lc(c),c=c.sibling;ee=a,No=m,et=F}sc(e)}else(a.subtreeFlags&8772)!==0&&c!==null?(c.return=a,ee=c):sc(e)}}function sc(e){for(;ee!==null;){var t=ee;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:et||Do(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!et)if(n===null)l.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:wt(t.type,n.memoizedProps);l.componentDidUpdate(a,n.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var c=t.updateQueue;c!==null&&au(t,c,l);break;case 3:var g=t.updateQueue;if(g!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}au(t,g,n)}break;case 5:var m=t.stateNode;if(n===null&&t.flags&4){n=m;var w=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":w.autoFocus&&n.focus();break;case"img":w.src&&(n.src=w.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 B=F.memoizedState;if(B!==null){var H=B.dehydrated;H!==null&&hr(H)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(u(163))}et||t.flags&512&&Ol(t)}catch(O){Oe(t,t.return,O)}}if(t===e){ee=null;break}if(n=t.sibling,n!==null){n.return=t.return,ee=n;break}ee=t.return}}function ac(e){for(;ee!==null;){var t=ee;if(t===e){ee=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ee=n;break}ee=t.return}}function uc(e){for(;ee!==null;){var t=ee;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Do(4,t)}catch(w){Oe(t,n,w)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var a=t.return;try{l.componentDidMount()}catch(w){Oe(t,a,w)}}var c=t.return;try{Ol(t)}catch(w){Oe(t,c,w)}break;case 5:var g=t.return;try{Ol(t)}catch(w){Oe(t,g,w)}}}catch(w){Oe(t,t.return,w)}if(t===e){ee=null;break}var m=t.sibling;if(m!==null){m.return=t.return,ee=m;break}ee=t.return}}var ff=Math.ceil,Oo=W.ReactCurrentDispatcher,Al=W.ReactCurrentOwner,yt=W.ReactCurrentBatchConfig,be=0,Qe=null,Ae=null,Ge=0,pt=0,Xn=en(0),Ue=0,Dr=null,wn=0,Bo=0,Hl=0,Or=null,lt=null,Ul=0,Zn=1/0,Ht=null,Wo=!1,Vl=null,sn=null,Ao=!1,an=null,Ho=0,Br=0,Ql=null,Uo=-1,Vo=0;function nt(){return(be&6)!==0?Be():Uo!==-1?Uo:Uo=Be()}function un(e){return(e.mode&1)===0?1:(be&2)!==0&&Ge!==0?Ge&-Ge:Kp.transition!==null?(Vo===0&&(Vo=na()),Vo):(e=Ce,e!==0||(e=window.event,e=e===void 0?16:da(e.type)),e)}function Tt(e,t,n,l){if(50<Br)throw Br=0,Ql=null,Error(u(185));cr(e,n,l),((be&2)===0||e!==Qe)&&(e===Qe&&((be&2)===0&&(Bo|=n),Ue===4&&cn(e,Ge)),st(e,l),n===1&&be===0&&(t.mode&1)===0&&(Zn=Be()+500,vo&&nn()))}function st(e,t){var n=e.callbackNode;Kd(e,t);var l=qr(e,e===Qe?Ge:0);if(l===0)n!==null&&qs(n),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(n!=null&&qs(n),t===1)e.tag===0?Jp(dc.bind(null,e)):Ga(dc.bind(null,e)),Up(function(){(be&6)===0&&nn()}),n=null;else{switch(ra(l)){case 1:n=Ci;break;case 4:n=ea;break;case 16:n=Kr;break;case 536870912:n=ta;break;default:n=Kr}n=vc(n,cc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function cc(e,t){if(Uo=-1,Vo=0,(be&6)!==0)throw Error(u(327));var n=e.callbackNode;if(qn()&&e.callbackNode!==n)return null;var l=qr(e,e===Qe?Ge:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=Qo(e,l);else{t=l;var a=be;be|=2;var c=fc();(Qe!==e||Ge!==t)&&(Ht=null,Zn=Be()+500,Cn(e,t));do try{xf();break}catch(m){pc(e,m)}while(!0);cl(),Oo.current=c,be=a,Ae!==null?t=0:(Qe=null,Ge=0,t=Ue)}if(t!==0){if(t===2&&(a=Ti(e),a!==0&&(l=a,t=Yl(e,a))),t===1)throw n=Dr,Cn(e,0),cn(e,l),st(e,Be()),n;if(t===6)cn(e,l);else{if(a=e.current.alternate,(l&30)===0&&!gf(a)&&(t=Qo(e,l),t===2&&(c=Ti(e),c!==0&&(l=c,t=Yl(e,c))),t===1))throw n=Dr,Cn(e,0),cn(e,l),st(e,Be()),n;switch(e.finishedWork=a,e.finishedLanes=l,t){case 0:case 1:throw Error(u(345));case 2:Tn(e,lt,Ht);break;case 3:if(cn(e,l),(l&130023424)===l&&(t=Ul+500-Be(),10<t)){if(qr(e,0)!==0)break;if(a=e.suspendedLanes,(a&l)!==l){nt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=qi(Tn.bind(null,e,lt,Ht),t);break}Tn(e,lt,Ht);break;case 4:if(cn(e,l),(l&4194240)===l)break;for(t=e.eventTimes,a=-1;0<l;){var g=31-St(l);c=1<<g,g=t[g],g>a&&(a=g),l&=~c}if(l=a,l=Be()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*ff(l/1960))-l,10<l){e.timeoutHandle=qi(Tn.bind(null,e,lt,Ht),l);break}Tn(e,lt,Ht);break;case 5:Tn(e,lt,Ht);break;default:throw Error(u(329))}}}return st(e,Be()),e.callbackNode===n?cc.bind(null,e):null}function Yl(e,t){var n=Or;return e.current.memoizedState.isDehydrated&&(Cn(e,t).flags|=256),e=Qo(e,t),e!==2&&(t=lt,lt=n,t!==null&&Jl(t)),e}function Jl(e){lt===null?lt=e:lt.push.apply(lt,e)}function gf(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var l=0;l<n.length;l++){var a=n[l],c=a.getSnapshot;a=a.value;try{if(!bt(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 cn(e,t){for(t&=~Hl,t&=~Bo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-St(t),l=1<<n;e[n]=-1,t&=~l}}function dc(e){if((be&6)!==0)throw Error(u(327));qn();var t=qr(e,0);if((t&1)===0)return st(e,Be()),null;var n=Qo(e,t);if(e.tag!==0&&n===2){var l=Ti(e);l!==0&&(t=l,n=Yl(e,l))}if(n===1)throw n=Dr,Cn(e,0),cn(e,t),st(e,Be()),n;if(n===6)throw Error(u(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Tn(e,lt,Ht),st(e,Be()),null}function Kl(e,t){var n=be;be|=1;try{return e(t)}finally{be=n,be===0&&(Zn=Be()+500,vo&&nn())}}function jn(e){an!==null&&an.tag===0&&(be&6)===0&&qn();var t=be;be|=1;var n=yt.transition,l=Ce;try{if(yt.transition=null,Ce=1,e)return e()}finally{Ce=l,yt.transition=n,be=t,(be&6)===0&&nn()}}function Gl(){pt=Xn.current,Ee(Xn)}function Cn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Hp(n)),Ae!==null)for(n=Ae.return;n!==null;){var l=n;switch(il(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&yo();break;case 3:Jn(),Ee(rt),Ee(Xe),ml();break;case 5:xl(l);break;case 4:Jn();break;case 13:Ee(Ie);break;case 19:Ee(Ie);break;case 10:dl(l.type._context);break;case 22:case 23:Gl()}n=n.return}if(Qe=e,Ae=e=dn(e.current,null),Ge=pt=t,Ue=0,Dr=null,Hl=Bo=wn=0,lt=Or=null,Sn!==null){for(t=0;t<Sn.length;t++)if(n=Sn[t],l=n.interleaved,l!==null){n.interleaved=null;var a=l.next,c=n.pending;if(c!==null){var g=c.next;c.next=a,l.next=g}n.pending=l}Sn=null}return e}function pc(e,t){do{var n=Ae;try{if(cl(),Lo.current=Mo,zo){for(var l=$e.memoizedState;l!==null;){var a=l.queue;a!==null&&(a.pending=null),l=l.next}zo=!1}if(kn=0,Ve=He=$e=null,Rr=!1,Mr=0,Al.current=null,n===null||n.return===null){Ue=1,Dr=t,Ae=null;break}e:{var c=e,g=n.return,m=n,w=t;if(t=Ge,m.flags|=32768,w!==null&&typeof w=="object"&&typeof w.then=="function"){var F=w,B=m,H=B.tag;if((B.mode&1)===0&&(H===0||H===11||H===15)){var O=B.alternate;O?(B.updateQueue=O.updateQueue,B.memoizedState=O.memoizedState,B.lanes=O.lanes):(B.updateQueue=null,B.memoizedState=null)}var Z=Nu(g);if(Z!==null){Z.flags&=-257,Du(Z,g,m,c,t),Z.mode&1&&$u(c,F,t),t=Z,w=F;var te=t.updateQueue;if(te===null){var ne=new Set;ne.add(w),t.updateQueue=ne}else te.add(w);break e}else{if((t&1)===0){$u(c,F,t),Xl();break e}w=Error(u(426))}}else if(Fe&&m.mode&1){var We=Nu(g);if(We!==null){(We.flags&65536)===0&&(We.flags|=256),Du(We,g,m,c,t),al(Kn(w,m));break e}}c=w=Kn(w,m),Ue!==4&&(Ue=2),Or===null?Or=[c]:Or.push(c),c=g;do{switch(c.tag){case 3:c.flags|=65536,t&=-t,c.lanes|=t;var E=Fu(c,w,t);su(c,E);break e;case 1:m=w;var C=c.type,M=c.stateNode;if((c.flags&128)===0&&(typeof C.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&(sn===null||!sn.has(M)))){c.flags|=65536,t&=-t,c.lanes|=t;var Q=Iu(c,m,t);su(c,Q);break e}}c=c.return}while(c!==null)}hc(n)}catch(re){t=re,Ae===n&&n!==null&&(Ae=n=n.return);continue}break}while(!0)}function fc(){var e=Oo.current;return Oo.current=Mo,e===null?Mo:e}function Xl(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),Qe===null||(wn&268435455)===0&&(Bo&268435455)===0||cn(Qe,Ge)}function Qo(e,t){var n=be;be|=2;var l=fc();(Qe!==e||Ge!==t)&&(Ht=null,Cn(e,t));do try{hf();break}catch(a){pc(e,a)}while(!0);if(cl(),be=n,Oo.current=l,Ae!==null)throw Error(u(261));return Qe=null,Ge=0,Ue}function hf(){for(;Ae!==null;)gc(Ae)}function xf(){for(;Ae!==null&&!Bd();)gc(Ae)}function gc(e){var t=mc(e.alternate,e,pt);e.memoizedProps=e.pendingProps,t===null?hc(e):Ae=t,Al.current=null}function hc(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=af(n,t,pt),n!==null){Ae=n;return}}else{if(n=uf(n,t),n!==null){n.flags&=32767,Ae=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ue=6,Ae=null;return}}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);Ue===0&&(Ue=5)}function Tn(e,t,n){var l=Ce,a=yt.transition;try{yt.transition=null,Ce=1,yf(e,t,n,l)}finally{yt.transition=a,Ce=l}return null}function yf(e,t,n,l){do qn();while(an!==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(Gd(e,c),e===Qe&&(Ae=Qe=null,Ge=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Ao||(Ao=!0,vc(Kr,function(){return qn(),null})),c=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||c){c=yt.transition,yt.transition=null;var g=Ce;Ce=1;var m=be;be|=4,Al.current=null,df(e,n),ic(n,e),$p(Xi),no=!!Gi,Xi=Gi=null,e.current=n,pf(n),Wd(),be=m,Ce=g,yt.transition=c}else e.current=n;if(Ao&&(Ao=!1,an=e,Ho=a),c=e.pendingLanes,c===0&&(sn=null),Ud(n.stateNode),st(e,Be()),t!==null)for(l=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],l(a.value,{componentStack:a.stack,digest:a.digest});if(Wo)throw Wo=!1,e=Vl,Vl=null,e;return(Ho&1)!==0&&e.tag!==0&&qn(),c=e.pendingLanes,(c&1)!==0?e===Ql?Br++:(Br=0,Ql=e):Br=0,nn(),null}function qn(){if(an!==null){var e=ra(Ho),t=yt.transition,n=Ce;try{if(yt.transition=null,Ce=16>e?16:e,an===null)var l=!1;else{if(e=an,an=null,Ho=0,(be&6)!==0)throw Error(u(331));var a=be;for(be|=4,ee=e.current;ee!==null;){var c=ee,g=c.child;if((ee.flags&16)!==0){var m=c.deletions;if(m!==null){for(var w=0;w<m.length;w++){var F=m[w];for(ee=F;ee!==null;){var B=ee;switch(B.tag){case 0:case 11:case 15:Nr(8,B,c)}var H=B.child;if(H!==null)H.return=B,ee=H;else for(;ee!==null;){B=ee;var O=B.sibling,Z=B.return;if(ec(B),B===F){ee=null;break}if(O!==null){O.return=Z,ee=O;break}ee=Z}}}var te=c.alternate;if(te!==null){var ne=te.child;if(ne!==null){te.child=null;do{var We=ne.sibling;ne.sibling=null,ne=We}while(ne!==null)}}ee=c}}if((c.subtreeFlags&2064)!==0&&g!==null)g.return=c,ee=g;else e:for(;ee!==null;){if(c=ee,(c.flags&2048)!==0)switch(c.tag){case 0:case 11:case 15:Nr(9,c,c.return)}var E=c.sibling;if(E!==null){E.return=c.return,ee=E;break e}ee=c.return}}var C=e.current;for(ee=C;ee!==null;){g=ee;var M=g.child;if((g.subtreeFlags&2064)!==0&&M!==null)M.return=g,ee=M;else e:for(g=C;ee!==null;){if(m=ee,(m.flags&2048)!==0)try{switch(m.tag){case 0:case 11:case 15:Do(9,m)}}catch(re){Oe(m,m.return,re)}if(m===g){ee=null;break e}var Q=m.sibling;if(Q!==null){Q.return=m.return,ee=Q;break e}ee=m.return}}if(be=a,nn(),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(Gr,e)}catch{}l=!0}return l}finally{Ce=n,yt.transition=t}}return!1}function xc(e,t,n){t=Kn(n,t),t=Fu(e,t,1),e=on(e,t,1),t=nt(),e!==null&&(cr(e,1,t),st(e,t))}function Oe(e,t,n){if(e.tag===3)xc(e,e,n);else for(;t!==null;){if(t.tag===3){xc(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(sn===null||!sn.has(l))){e=Kn(n,e),e=Iu(t,e,1),t=on(t,e,1),e=nt(),t!==null&&(cr(t,1,e),st(t,e));break}}t=t.return}}function mf(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),t=nt(),e.pingedLanes|=e.suspendedLanes&n,Qe===e&&(Ge&n)===n&&(Ue===4||Ue===3&&(Ge&130023424)===Ge&&500>Be()-Ul?Cn(e,0):Hl|=n),st(e,t)}function yc(e,t){t===0&&((e.mode&1)===0?t=1:(t=Zr,Zr<<=1,(Zr&130023424)===0&&(Zr=4194304)));var n=nt();e=Bt(e,t),e!==null&&(cr(e,t,n),st(e,n))}function vf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),yc(e,n)}function Sf(e,t){var n=0;switch(e.tag){case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(u(314))}l!==null&&l.delete(t),yc(e,n)}var mc;mc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rt.current)it=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return it=!1,sf(e,t,n);it=(e.flags&131072)!==0}else it=!1,Fe&&(t.flags&1048576)!==0&&Xa(t,bo,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;$o(e,t),e=t.pendingProps;var a=Wn(t,Xe.current);Yn(t,n),a=bl(null,t,l,e,a,n);var c=kl();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,ot(l)?(c=!0,mo(t)):c=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,gl(t),a.updater=Fo,t.stateNode=a,a._reactInternals=t,_l(t,l,e,n),t=Rl(null,t,l,!0,c,n)):(t.tag=0,Fe&&c&&ol(t),tt(null,t,a,n),t=t.child),t;case 16:l=t.elementType;e:{switch($o(e,t),e=t.pendingProps,a=l._init,l=a(l._payload),t.type=l,a=t.tag=kf(l),e=wt(l,e),a){case 0:t=El(null,t,l,e,n);break e;case 1:t=Uu(null,t,l,e,n);break e;case 11:t=Ou(null,t,l,e,n);break e;case 14:t=Bu(null,t,l,wt(l.type,e),n);break e}throw Error(u(306,l,""))}return t;case 0:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:wt(l,a),El(e,t,l,a,n);case 1:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:wt(l,a),Uu(e,t,l,a,n);case 3:e:{if(Vu(t),e===null)throw Error(u(387));l=t.pendingProps,c=t.memoizedState,a=c.element,lu(e,t),Po(t,l,null,n);var g=t.memoizedState;if(l=g.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){a=Kn(Error(u(423)),t),t=Qu(e,t,l,n,a);break e}else if(l!==a){a=Kn(Error(u(424)),t),t=Qu(e,t,l,n,a);break e}else for(dt=qt(t.stateNode.containerInfo.firstChild),ct=t,Fe=!0,kt=null,n=ou(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Un(),l===a){t=At(e,t,n);break e}tt(e,t,l,n)}t=t.child}return t;case 5:return uu(t),e===null&&sl(t),l=t.type,a=t.pendingProps,c=e!==null?e.memoizedProps:null,g=a.children,Zi(l,a)?g=null:c!==null&&Zi(l,c)&&(t.flags|=32),Hu(e,t),tt(e,t,g,n),t.child;case 6:return e===null&&sl(t),null;case 13:return Yu(e,t,n);case 4:return hl(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Vn(t,null,l,n):tt(e,t,l,n),t.child;case 11:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:wt(l,a),Ou(e,t,l,a,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(l=t.type._context,a=t.pendingProps,c=t.memoizedProps,g=a.value,_e(jo,l._currentValue),l._currentValue=g,c!==null)if(bt(c.value,g)){if(c.children===a.children&&!rt.current){t=At(e,t,n);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var m=c.dependencies;if(m!==null){g=c.child;for(var w=m.firstContext;w!==null;){if(w.context===l){if(c.tag===1){w=Wt(-1,n&-n),w.tag=2;var F=c.updateQueue;if(F!==null){F=F.shared;var B=F.pending;B===null?w.next=w:(w.next=B.next,B.next=w),F.pending=w}}c.lanes|=n,w=c.alternate,w!==null&&(w.lanes|=n),pl(c.return,n,t),m.lanes|=n;break}w=w.next}}else if(c.tag===10)g=c.type===t.type?null:c.child;else if(c.tag===18){if(g=c.return,g===null)throw Error(u(341));g.lanes|=n,m=g.alternate,m!==null&&(m.lanes|=n),pl(g,n,t),g=c.sibling}else g=c.child;if(g!==null)g.return=c;else for(g=c;g!==null;){if(g===t){g=null;break}if(c=g.sibling,c!==null){c.return=g.return,g=c;break}g=g.return}c=g}tt(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,l=t.pendingProps.children,Yn(t,n),a=ht(a),l=l(a),t.flags|=1,tt(e,t,l,n),t.child;case 14:return l=t.type,a=wt(l,t.pendingProps),a=wt(l.type,a),Bu(e,t,l,a,n);case 15:return Wu(e,t,t.type,t.pendingProps,n);case 17:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:wt(l,a),$o(e,t),t.tag=1,ot(l)?(e=!0,mo(t)):e=!1,Yn(t,n),Ru(t,l,a),_l(t,l,a,n),Rl(null,t,l,!0,e,n);case 19:return Ku(e,t,n);case 22:return Au(e,t,n)}throw Error(u(156,t.tag))};function vc(e,t){return Zs(e,t)}function bf(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mt(e,t,n,l){return new bf(e,t,n,l)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function kf(e){if(typeof e=="function")return Zl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ve)return 11;if(e===Ne)return 14}return 2}function dn(e,t){var n=e.alternate;return n===null?(n=mt(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 Yo(e,t,n,l,a,c){var g=2;if(l=e,typeof e=="function")Zl(e)&&(g=1);else if(typeof e=="string")g=5;else e:switch(e){case K:return Pn(n.children,a,c,t);case V:g=8,a|=8;break;case G:return e=mt(12,n,t,a|2),e.elementType=G,e.lanes=c,e;case me:return e=mt(13,n,t,a),e.elementType=me,e.lanes=c,e;case Re:return e=mt(19,n,t,a),e.elementType=Re,e.lanes=c,e;case he:return Jo(n,a,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:g=10;break e;case ue:g=9;break e;case ve:g=11;break e;case Ne:g=14;break e;case Me:g=16,l=null;break e}throw Error(u(130,e==null?e:typeof e,""))}return t=mt(g,n,t,a),t.elementType=e,t.type=l,t.lanes=c,t}function Pn(e,t,n,l){return e=mt(7,e,l,t),e.lanes=n,e}function Jo(e,t,n,l){return e=mt(22,e,l,t),e.elementType=he,e.lanes=n,e.stateNode={isHidden:!1},e}function ql(e,t,n){return e=mt(6,e,null,t),e.lanes=n,e}function es(e,t,n){return t=mt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function wf(e,t,n,l,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=Pi(0),this.expirationTimes=Pi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pi(0),this.identifierPrefix=l,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function ts(e,t,n,l,a,c,g,m,w){return e=new wf(e,t,n,m,w),t===1?(t=1,c===!0&&(t|=8)):t=0,c=mt(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:l,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},gl(c),e}function jf(e,t,n){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:l==null?null:""+l,children:e,containerInfo:t,implementation:n}}function Sc(e){if(!e)return tn;e=e._reactInternals;e:{if(hn(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(ot(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(ot(n))return Ja(e,n,t)}return t}function bc(e,t,n,l,a,c,g,m,w){return e=ts(n,l,!0,e,a,c,g,m,w),e.context=Sc(null),n=e.current,l=nt(),a=un(n),c=Wt(l,a),c.callback=t??null,on(n,c,a),e.current.lanes=a,cr(e,a,l),st(e,l),e}function Ko(e,t,n,l){var a=t.current,c=nt(),g=un(a);return n=Sc(n),t.context===null?t.context=n:t.pendingContext=n,t=Wt(c,g),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=on(a,t,g),e!==null&&(Tt(e,a,g,c),To(e,a,g)),g}function Go(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 kc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ns(e,t){kc(e,t),(e=e.alternate)&&kc(e,t)}function Cf(){return null}var wc=typeof reportError=="function"?reportError:function(e){console.error(e)};function rs(e){this._internalRoot=e}Xo.prototype.render=rs.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));Ko(e,t,null,null)},Xo.prototype.unmount=rs.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jn(function(){Ko(null,e,null,null)}),t[$t]=null}};function Xo(e){this._internalRoot=e}Xo.prototype.unstable_scheduleHydration=function(e){if(e){var t=la();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Gt.length&&t!==0&&t<Gt[n].priority;n++);Gt.splice(n,0,e),n===0&&ua(e)}};function os(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Zo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function jc(){}function Tf(e,t,n,l,a){if(a){if(typeof l=="function"){var c=l;l=function(){var F=Go(g);c.call(F)}}var g=bc(t,l,e,0,null,!1,!1,"",jc);return e._reactRootContainer=g,e[$t]=g.current,jr(e.nodeType===8?e.parentNode:e),jn(),g}for(;a=e.lastChild;)e.removeChild(a);if(typeof l=="function"){var m=l;l=function(){var F=Go(w);m.call(F)}}var w=ts(e,0,!1,null,null,!1,!1,"",jc);return e._reactRootContainer=w,e[$t]=w.current,jr(e.nodeType===8?e.parentNode:e),jn(function(){Ko(t,w,n,l)}),w}function qo(e,t,n,l,a){var c=n._reactRootContainer;if(c){var g=c;if(typeof a=="function"){var m=a;a=function(){var w=Go(g);m.call(w)}}Ko(t,g,e,a)}else g=Tf(n,t,e,a,l);return Go(g)}oa=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ur(t.pendingLanes);n!==0&&(_i(t,n|1),st(t,Be()),(be&6)===0&&(Zn=Be()+500,nn()))}break;case 13:jn(function(){var l=Bt(e,1);if(l!==null){var a=nt();Tt(l,e,1,a)}}),ns(e,1)}},Li=function(e){if(e.tag===13){var t=Bt(e,134217728);if(t!==null){var n=nt();Tt(t,e,134217728,n)}ns(e,134217728)}},ia=function(e){if(e.tag===13){var t=un(e),n=Bt(e,t);if(n!==null){var l=nt();Tt(n,e,t,l)}ns(e,t)}},la=function(){return Ce},sa=function(e,t){var n=Ce;try{return Ce=e,t()}finally{Ce=n}},bi=function(e,t,n){switch(t){case"input":if(vt(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 l=n[t];if(l!==e&&l.form===e.form){var a=xo(l);if(!a)throw Error(u(90));Vt(l),vt(l,a)}}}break;case"textarea":$s(e,n);break;case"select":t=n.value,t!=null&&Ln(e,!!n.multiple,t,!1)}},Vs=Kl,Qs=jn;var Pf={usingClientEntryPoint:!1,Events:[Pr,On,xo,Hs,Us,Kl]},Wr={findFiberByHostInstance:xn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},_f={bundleType:Wr.bundleType,version:Wr.version,rendererPackageName:Wr.rendererPackageName,rendererConfig:Wr.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=Gs(e),e===null?null:e.stateNode},findFiberByHostInstance:Wr.findFiberByHostInstance||Cf,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 ei=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ei.isDisabled&&ei.supportsFiber)try{Gr=ei.inject(_f),Lt=ei}catch{}}return at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Pf,at.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!os(t))throw Error(u(200));return jf(e,t,null,n)},at.createRoot=function(e,t){if(!os(e))throw Error(u(299));var n=!1,l="",a=wc;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=ts(e,1,!1,null,null,n,!1,l,a),e[$t]=t.current,jr(e.nodeType===8?e.parentNode:e),new rs(t)},at.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=Gs(t),e=e===null?null:e.stateNode,e},at.flushSync=function(e){return jn(e)},at.hydrate=function(e,t,n){if(!Zo(t))throw Error(u(200));return qo(null,e,t,!0,n)},at.hydrateRoot=function(e,t,n){if(!os(e))throw Error(u(405));var l=n!=null&&n.hydratedSources||null,a=!1,c="",g=wc;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onRecoverableError!==void 0&&(g=n.onRecoverableError)),t=bc(t,null,e,1,n??null,a,!1,c,g),e[$t]=t.current,jr(e),l)for(e=0;e<l.length;e++)n=l[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Xo(t)},at.render=function(e,t,n){if(!Zo(t))throw Error(u(200));return qo(null,e,t,!1,n)},at.unmountComponentAtNode=function(e){if(!Zo(e))throw Error(u(40));return e._reactRootContainer?(jn(function(){qo(null,null,e,!1,function(){e._reactRootContainer=null,e[$t]=null})}),!0):!1},at.unstable_batchedUpdates=Kl,at.unstable_renderSubtreeIntoContainer=function(e,t,n,l){if(!Zo(n))throw Error(u(200));if(e==null||e._reactInternals===void 0)throw Error(u(38));return qo(e,t,n,!1,l)},at.version="18.3.1-next-f1338f8080-20240426",at}var Rc;function $f(){if(Rc)return ss.exports;Rc=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(),ss.exports=If(),ss.exports}var Mc;function Nf(){if(Mc)return ti;Mc=1;var r=$f();return ti.createRoot=r.createRoot,ti.hydrateRoot=r.hydrateRoot,ti}var Df=Nf();const Of=Gc(Df),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 tr(r,s){const u=r.replace("#",""),d=Number.parseInt(u.substring(0,2),16),p=Number.parseInt(u.substring(2,4),16),f=Number.parseInt(u.substring(4,6),16);return`rgba(${d}, ${p}, ${f}, ${s})`}const v={body:"'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",mono:"'Roboto Mono', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace"};function Bf({logs:r,filteredLogs:s,logEndRef:u,getLogColor:d}){return i.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px",fontFamily:v.mono,fontSize:"12px",background:o.bgCard},children:s.length===0?i.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."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{ref:u}),s.map((p,f)=>i.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:h=>{h.currentTarget.style.background=o.bgHover},onMouseLeave:h=>{h.currentTarget.style.background=o.bgCard},children:[i.jsx("span",{style:{color:o.textTertiary,minWidth:"140px",flexShrink:0,fontFamily:v.mono,fontSize:"11px"},children:new Date(p.timestamp).toLocaleTimeString()}),i.jsx("span",{style:{color:o.textTertiary,minWidth:"70px",flexShrink:0,textTransform:"uppercase",fontFamily:v.body,fontSize:"10px",fontWeight:"600",letterSpacing:"0.05em"},children:p.type}),i.jsx("span",{style:{color:d(p.type),whiteSpace:"pre-wrap",wordBreak:"break-word",flex:1,fontFamily:v.mono,fontSize:"12px",lineHeight:"1.5"},children:p.line})]},`${p.timestamp}-${f}`))]})})}var Wf={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,d)=>{const p=P.forwardRef(({color:f="currentColor",size:h=24,stroke:y=2,title:x,className:T,children:S,...k},b)=>P.createElement("svg",{ref:b,...Wf[r],width:h,height:h,className:["tabler-icon",`tabler-icon-${s}`,T].join(" "),strokeWidth:y,stroke:f,...k},[x&&P.createElement("title",{key:"svg-title"},x),...d.map(([_,z])=>P.createElement(_,z)),...Array.isArray(S)?S:[S]]));return p.displayName=`${u}`,p};const Af=[["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"}]],Hf=Pe("outline","alert-triangle","AlertTriangle",Af);const Uf=[["path",{d:"M4 13h5",key:"svg-0"}],["path",{d:"M12 16v-8h3a2 2 0 0 1 2 2v1a2 2 0 0 1 -2 2h-3",key:"svg-1"}],["path",{d:"M20 8v8",key:"svg-2"}],["path",{d:"M9 16v-5.5a2.5 2.5 0 0 0 -5 0v5.5",key:"svg-3"}]],Vf=Pe("outline","api","Api",Uf);const Qf=[["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"}]],Yf=Pe("outline","bell","Bell",Qf);const Jf=[["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"}]],Kf=Pe("outline","brand-stackoverflow","BrandStackoverflow",Jf);const Gf=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],Xf=Pe("outline","check","Check",Gf);const Zf=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],xs=Pe("outline","chevron-down","ChevronDown",Zf);const qf=[["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"}]],Xc=Pe("outline","clock","Clock",qf);const eg=[["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"}]],tg=Pe("outline","code","Code",eg);const ng=[["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"}]],rg=Pe("outline","database","Database",ng);const og=[["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"}]],Zc=Pe("outline","download","Download",og);const ig=[["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"}]],qc=Pe("outline","external-link","ExternalLink",ig);const lg=[["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"}]],ys=Pe("outline","eye","Eye",lg);const sg=[["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"}]],ag=Pe("outline","file-text","FileText",sg);const ug=[["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"}]],cg=Pe("outline","file-upload","FileUpload",ug);const dg=[["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"}]],pg=Pe("outline","list","List",dg);const fg=[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l16 0",key:"svg-2"}]],gg=Pe("outline","menu-2","Menu2",fg);const hg=[["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"}]],xg=Pe("outline","message","Message",hg);const yg=[["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"}]],ed=Pe("outline","network","Network",yg);const mg=[["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"}]],Fc=Pe("outline","package","Package",mg);const vg=[["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"}]],ri=Pe("outline","refresh","Refresh",vg);const Sg=[["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"}]],bg=Pe("outline","restore","Restore",Sg);const kg=[["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"}]],td=Pe("outline","search","Search",kg);const wg=[["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"}]],jg=Pe("outline","settings","Settings",wg);const Cg=[["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"}]],nd=Pe("outline","shield","Shield",Cg);const Tg=[["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"}]],Pg=Pe("outline","tool","Tool",Tg);const _g=[["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"}]],si=Pe("outline","trash","Trash",_g);const Lg=[["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"}]],zg=Pe("outline","user","User",Lg);const Eg=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],rd=Pe("outline","x","X",Eg);function Rg({filter:r,setFilter:s,logType:u,setLogType:d,autoScroll:p,setAutoScroll:f,onClearLogs:h,onExportLogs:y,filteredCount:x,totalCount:T}){return i.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:[i.jsxs("div",{style:{position:"relative",width:"300px"},children:[i.jsx(td,{size:16,stroke:1.5,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:o.textTertiary,pointerEvents:"none"}}),i.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"}})]}),i.jsxs("select",{value:u,onChange:S=>d(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:[i.jsx("option",{value:"all",children:"All Types"}),i.jsx("option",{value:"stdout",children:"Stdout"}),i.jsx("option",{value:"stderr",children:"Stderr"}),i.jsx("option",{value:"error",children:"Errors"}),i.jsx("option",{value:"exit",children:"Exit"})]}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",color:o.textPrimary,fontSize:"13px",fontFamily:v.body,cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:p,onChange:S=>f(S.target.checked),style:{cursor:"pointer"}}),"Auto-scroll"]}),i.jsxs("button",{type:"button",onClick:h,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:[i.jsx(si,{size:14,stroke:1.5}),"Clear Logs"]}),i.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:[i.jsx(Zc,{size:14,stroke:1.5}),"Export Logs"]}),i.jsxs("div",{style:{marginLeft:"auto",color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:[x," / ",T," lines"]})]})}function Mg(){const[r,s]=P.useState([]),[u,d]=P.useState(!0),[p,f]=P.useState(""),[h,y]=P.useState("all"),x=P.useRef(null),T=P.useRef(null);P.useEffect(()=>{u&&x.current&&x.current.scrollIntoView({behavior:"smooth",block:"start"})},[u]),P.useEffect(()=>{(async()=>{try{const D=await(await fetch("/api/composite/logs?limit=5000")).json();s(D)}catch(I){console.error("Failed to load logs:",I)}})();const R=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,L=new WebSocket(R);return T.current=L,L.onopen=()=>{console.log("WebSocket connected for logs")},L.onerror=I=>{console.error("WebSocket error:",I)},L.onmessage=I=>{try{const D=JSON.parse(I.data);D.type==="log"&&s(U=>[D.data,...U].slice(0,5e3))}catch(D){console.error("Failed to parse WebSocket message:",D)}},L.onclose=()=>{console.log("WebSocket closed, attempting to reconnect..."),setTimeout(()=>{T.current?.readyState===WebSocket.CLOSED&&console.log("WebSocket reconnection needed")},3e3)},()=>{(L.readyState===WebSocket.OPEN||L.readyState===WebSocket.CONNECTING)&&L.close()}},[]);const S=async()=>{try{await fetch("/api/composite/logs/clear",{method:"POST"}),s([])}catch(z){console.error("Failed to clear logs:",z)}},k=z=>{switch(z){case"stderr":case"error":return o.error;case"stdout":return o.textPrimary;case"exit":return o.accentOrange;default:return o.textSecondary}},b=r.filter(z=>!(h!=="all"&&z.type!==h||p&&!z.line.toLowerCase().includes(p.toLowerCase()))),_=async()=>{try{const R=await(await fetch("/api/composite/logs/export")).blob(),L=window.URL.createObjectURL(R),I=document.createElement("a");I.href=L,I.download=`mcp-shark-logs-${new Date().toISOString().replace(/[:.]/g,"-")}.txt`,document.body.appendChild(I),I.click(),window.URL.revokeObjectURL(L),document.body.removeChild(I)}catch(z){console.error("Failed to export logs:",z)}};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",background:o.bgPrimary,overflow:"hidden"},children:[i.jsx(Rg,{filter:p,setFilter:f,logType:h,setLogType:y,autoScroll:u,setAutoScroll:d,onClearLogs:S,onExportLogs:_,filteredCount:b.length,totalCount:r.length}),i.jsx(Bf,{logs:r,filteredLogs:b,logEndRef:x,getLogColor:k})]})}function ai({isOpen:r,onClose:s,onConfirm:u,title:d,message:p,confirmText:f="Confirm",cancelText:h="Cancel",danger:y=!1}){return r?i.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:x=>{x.key==="Escape"&&s()},children:i.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:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),children:[i.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:"18px",fontWeight:"600",color:o.textPrimary},children:d}),i.jsx("p",{style:{margin:"0 0 24px 0",fontSize:"14px",color:o.textSecondary,lineHeight:"1.5"},children:p}),i.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:[i.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:x=>{x.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:x=>{x.currentTarget.style.background=o.buttonSecondary},children:h}),i.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:x=>{x.currentTarget.style.background=y?o.buttonDangerHover:o.buttonPrimaryHover},onMouseLeave:x=>{x.currentTarget.style.background=y?o.buttonDanger:o.buttonPrimary},children:f})]})]})}):null}function Fg({backups:r,loadingBackups:s,onRefresh:u,onRestore:d,onView:p,onDelete:f}){const[h,y]=P.useState(!1),[x,T]=P.useState(null);return r.length===0?null:i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"20px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[i.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:"Backup Files"}),i.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:[i.jsx(ri,{size:14,stroke:1.5,style:{marginRight:"4px"}}),s?"Loading...":"Refresh"]})]}),i.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."}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((S,k)=>i.jsxs("div",{style:{padding:"12px",background:o.bgPrimary,border:`1px solid ${o.borderMedium}`,borderRadius:"8px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[i.jsxs("div",{style:{flex:1},children:[i.jsx("div",{style:{color:o.textPrimary,fontSize:"12px",fontWeight:"500",marginBottom:"4px"},children:S.displayPath}),i.jsxs("div",{style:{color:o.textTertiary,fontSize:"11px",fontFamily:v.body},children:["Created: ",new Date(S.modifiedAt||S.createdAt).toLocaleString()," • Size:"," ",(S.size/1024).toFixed(2)," KB"]})]}),i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.jsxs("button",{type:"button",onClick:()=>p(S.backupPath),style:{padding:"6px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:"pointer",fontSize:"12px",borderRadius:"8px",fontWeight:"500"},onMouseEnter:b=>{b.currentTarget.style.background=o.bgCard,b.currentTarget.style.borderColor=o.borderLight},onMouseLeave:b=>{b.currentTarget.style.background="transparent",b.currentTarget.style.borderColor=o.borderMedium},title:"View backup content",children:[i.jsx(ys,{size:14,stroke:1.5,style:{marginRight:"4px"}}),"View"]}),i.jsxs("button",{type:"button",onClick:()=>{T(S.backupPath),y(!0)},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:b=>{b.currentTarget.style.background=tr(o.error,.15),b.currentTarget.style.borderColor=o.error},onMouseLeave:b=>{b.currentTarget.style.background="transparent",b.currentTarget.style.borderColor=o.borderMedium},title:"Delete backup",children:[i.jsx(si,{size:14,stroke:1.5}),"Delete"]}),i.jsxs("button",{type:"button",onClick:()=>d(S.backupPath,S.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:b=>{b.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:b=>{b.currentTarget.style.background=o.buttonPrimary},title:"Restore this backup",children:[i.jsx(bg,{size:14,stroke:1.5}),"Restore"]})]})]},S.backupPath||`backup-${k}`))}),i.jsx(ai,{isOpen:h,onClose:()=>{y(!1),T(null)},onConfirm:()=>{x&&f(x),y(!1),T(null)},title:"Delete Backup",message:"Are you sure you want to delete this backup? This action cannot be undone.",confirmText:"Delete",cancelText:"Cancel",danger:!0})]})}function Ig({detectedPaths:r,detecting:s,onDetect:u,onSelect:d,onView:p}){return r.length===0?null:i.jsxs("div",{style:{marginBottom:"8px"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[i.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontWeight:"600",fontFamily:v.body},children:"Detected Configuration Files:"}),i.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?i.jsxs(i.Fragment,{children:[i.jsx(ri,{size:12,stroke:1.5,style:{animation:"spin 1s linear infinite"}}),i.jsx("span",{children:"Detecting..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(ri,{size:12,stroke:1.5}),i.jsx("span",{children:"Refresh"})]})})]}),i.jsx("div",{"data-tour":"detected-editors",style:{display:"flex",flexDirection:"column",gap:"6px"},children:r.map((f,h)=>i.jsxs("button",{type:"button","data-tour":h===0?"first-detected-editor":void 0,onClick:()=>d(f.path),onDoubleClick:()=>{f.exists&&p(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:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("span",{style:{display:"inline-flex",alignItems:"center"},children:f.editor==="Cursor"?i.jsx(tg,{size:14,stroke:1.5}):i.jsx(Xc,{size:14,stroke:1.5})}),i.jsxs("div",{children:[i.jsx("div",{style:{fontWeight:"500"},children:f.editor}),i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:f.displayPath})]})]}),i.jsx("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:f.exists&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{fontSize:"10px",padding:"2px 6px",background:o.success,color:o.textInverse,borderRadius:"6px",fontWeight:"500"},children:"Found"}),i.jsxs("button",{type:"button",onClick:y=>{y.stopPropagation(),p(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:[i.jsx(ys,{size:10,stroke:1.5}),i.jsx("span",{children:"View"})]})]})})]},`${f.editor}-${f.path}-${h}`))})]})}function $g({filePath:r,fileContent:s,updatePath:u,onFileSelect:d,onPathChange:p,onUpdatePathChange:f}){return i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.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:h=>{h.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:h=>{h.currentTarget.style.background=o.buttonPrimary},children:[i.jsx(cg,{size:14,stroke:1.5,style:{marginRight:"6px",display:"inline-block"}}),"Select File",i.jsx("input",{type:"file",accept:".json",onChange:d,style:{display:"none"}})]}),i.jsx("span",{style:{color:o.textTertiary,fontSize:"13px",fontWeight:"500",fontFamily:v.body},children:"OR"}),i.jsx("input",{type:"text",placeholder:"Enter file path (e.g., ~/.cursor/mcp.json)",value:r,onChange:p,style:{flex:1,padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderMedium}`,color:o.textPrimary,fontSize:"13px",borderRadius:"8px"}})]}),s&&!r&&i.jsxs("div",{children:[i.jsx("label",{htmlFor:"update-path-input",style:{display:"block",fontSize:"12px",color:o.textSecondary,marginBottom:"6px"},children:"Optional: File Path to Update"}),i.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"}}),i.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&&i.jsxs("div",{style:{marginTop:"8px"},children:[i.jsx("div",{style:{color:o.textSecondary,fontSize:"12px",marginBottom:"6px",fontWeight:"500"},children:"File Content Preview"}),i.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 Ng({services:r,selectedServices:s,onSelectionChange:u}){return r.length===0?null:i.jsxs("div",{style:{marginTop:"16px"},children:[i.jsxs("div",{style:{marginBottom:"12px"},children:[i.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"8px",color:o.textPrimary,fontFamily:v.body},children:"Select Services"}),i.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."})]}),i.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"12px",flexWrap:"wrap"},children:[i.jsx("button",{type:"button",onClick:()=>{u(new Set(r.map(d=>d.name)))},style:{padding:"4px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:"pointer",fontSize:"12px",borderRadius:"8px"},children:"Select All"}),i.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"}),i.jsxs("div",{style:{marginLeft:"auto",fontSize:"12px",color:o.textSecondary,display:"flex",alignItems:"center"},children:[s.size," of ",r.length," selected"]})]}),i.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(d=>{const p=s.has(d.name);return i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px",background:p?o.bgSelected:"transparent",border:`1px solid ${p?o.accentBlue:o.borderMedium}`,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:f=>{p||(f.currentTarget.style.background=o.bgHover)},onMouseLeave:f=>{p||(f.currentTarget.style.background="transparent")},children:[i.jsx("input",{type:"checkbox",checked:p,onChange:f=>{const h=new Set(s);f.target.checked?h.add(d.name):h.delete(d.name),u(h)},style:{width:"18px",height:"18px",cursor:"pointer"}}),i.jsxs("div",{style:{flex:1},children:[i.jsx("div",{style:{fontWeight:"500",color:o.textPrimary,fontSize:"13px",marginBottom:"4px"},children:d.name}),i.jsxs("div",{style:{fontSize:"11px",color:o.textSecondary,display:"flex",gap:"12px",flexWrap:"wrap"},children:[i.jsx("span",{style:{padding:"2px 6px",background:d.type==="http"?"#0e639c":"#4a9e5f",color:o.textInverse,borderRadius:"6px",fontSize:"10px",fontWeight:"500"},children:d.type.toUpperCase()}),d.url&&i.jsx("span",{style:{fontFamily:"monospace",fontSize:"11px"},children:d.url}),d.command&&i.jsxs("span",{style:{fontFamily:"monospace",fontSize:"11px"},children:[d.command," ",d.args?.join(" ")||""]})]})]})]},d.name)})}),s.size===0&&i.jsx("div",{style:{marginTop:"8px",padding:"8px 12px",background:tr(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 Dg({detectedPaths:r,detecting:s,onDetect:u,onPathSelect:d,onViewConfig:p,filePath:f,fileContent:h,updatePath:y,onFileSelect:x,onPathChange:T,onUpdatePathChange:S,services:k,selectedServices:b,onSelectionChange:_}){return i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"20px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[i.jsxs("div",{style:{marginBottom:"16px"},children:[i.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"8px",color:o.textPrimary,fontFamily:v.body},children:"Configuration File"}),i.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."})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsx(Ig,{detectedPaths:r,detecting:s,onDetect:u,onSelect:d,onView:p}),i.jsx($g,{filePath:f,fileContent:h,updatePath:y,onFileSelect:x,onPathChange:T,onUpdatePathChange:S}),i.jsx(Ng,{services:k,selectedServices:b,onSelectionChange:_})]})]})}function Og({viewingConfig:r,configContent:s,loadingConfig:u,onClose:d,viewingBackup:p,backupContent:f,loadingBackup:h}){const y=p!==null;if(!(r!==null)&&!y)return null;const T=y?f:s,S=y?h:u,k=y?"Backup File":"MCP Configuration File";return i.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:d,onKeyDown:b=>{b.key==="Escape"&&d()},children:i.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:b=>b.stopPropagation(),onKeyDown:b=>b.stopPropagation(),children:[i.jsxs("div",{style:{padding:"16px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[i.jsxs("div",{children:[i.jsx("h3",{style:{fontSize:"16px",fontWeight:"500",marginBottom:"4px",color:o.textPrimary},children:k}),T&&i.jsxs("div",{style:{fontSize:"12px",color:"#858585"},children:[T.displayPath,y&&T.createdAt&&i.jsxs("span",{style:{marginLeft:"12px",color:"#666"},children:["Created: ",new Date(T.createdAt).toLocaleString()]})]})]}),i.jsx("button",{type:"button",onClick:d,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:"×"})]}),i.jsx("div",{style:{flex:1,overflow:"auto",padding:"20px"},children:S?i.jsx("div",{style:{color:"#858585",textAlign:"center",padding:"40px"},children:"Loading..."}):T?i.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:T.content}):i.jsx("div",{style:{color:"#f48771",textAlign:"center",padding:"40px"},children:"Failed to load file content"})})]})})}function Bg({message:r,error:s}){return!r&&!s?null:i.jsx("div",{style:{marginBottom:"20px",padding:"12px 16px",background:tr(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 Wg({status:r,loading:s,onStart:u,onStop:d,canStart:p}){return i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"20px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[i.jsx("div",{style:{marginBottom:"16px"},children:i.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"8px",color:o.textPrimary,fontFamily:v.body},children:"Server Control"})}),i.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center",flexWrap:"wrap"},children:[r.running?i.jsx("button",{type:"button",onClick:d,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"}):i.jsx("button",{type:"button","data-tour":"start-button",onClick:u,disabled:s||!p,style:{padding:"10px 20px",background:o.buttonPrimary,border:`1px solid ${o.buttonPrimary}`,color:o.textInverse,cursor:s||!p?"not-allowed":"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:"500",borderRadius:"8px",opacity:s||!p?.5:1,transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`},onMouseEnter:f=>{!s&&p&&(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"}),i.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:[i.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"}}),i.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 Ag(){return i.jsxs("div",{style:{marginBottom:"24px"},children:[i.jsx("h2",{style:{fontSize:"24px",fontWeight:"700",marginBottom:"12px",color:o.textPrimary,fontFamily:v.body},children:"MCP Shark Server Setup"}),i.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 Hg({filePath:r,updatePath:s}){return i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[i.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"12px",color:o.textPrimary,fontFamily:v.body},children:"What This Does"}),i.jsxs("ul",{style:{margin:0,paddingLeft:"20px",fontSize:"13px",color:o.textSecondary,lineHeight:"1.8",fontFamily:v.body},children:[i.jsxs("li",{children:["Converts your MCP config (",i.jsx("code",{style:{color:o.accentOrange,fontFamily:v.mono},children:"mcpServers"}),") to MCP Shark format (",i.jsx("code",{style:{color:o.accentOrange,fontFamily:v.mono},children:"servers"}),")"]}),i.jsxs("li",{children:["Starts the MCP Shark server on"," ",i.jsx("code",{style:{color:o.accentBlue,fontFamily:v.mono},children:"http://localhost:9851/mcp"})]}),i.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)&&i.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 Ug(){const[r,s]=P.useState([]),[u,d]=P.useState(!0),[p,f]=P.useState([]),[h,y]=P.useState(!1),[x,T]=P.useState(null),[S,k]=P.useState(null),[b,_]=P.useState(!1),[z,R]=P.useState(null),[L,I]=P.useState(null),[D,U]=P.useState(!1),W=P.useCallback(async()=>{d(!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{d(!1)}},[]),$=P.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)}},[]),A=async G=>{_(!0),T(G);try{const Y=await fetch(`/api/config/read?filePath=${encodeURIComponent(G)}`),ue=await Y.json();Y.ok?k(ue):k(null)}catch{k(null)}finally{_(!1)}},K=async G=>{U(!0),R(G);try{const Y=await fetch(`/api/config/backup/view?backupPath=${encodeURIComponent(G)}`),ue=await Y.json();Y.ok?I(ue):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 P.useEffect(()=>{W(),$()},[W,$]),{detectedPaths:r,detecting:u,detectConfigPaths:W,backups:p,loadingBackups:h,loadBackups:$,viewingConfig:x,configContent:S,loadingConfig:b,handleViewConfig:A,setViewingConfig:T,setConfigContent:k,viewingBackup:z,backupContent:L,loadingBackup:D,handleViewBackup:K,handleDeleteBackup:V,setViewingBackup:R,setBackupContent:I}}function Vg(r,s){const[u,d]=P.useState([]),[p,f]=P.useState(new Set),[h,y]=P.useState(!1),x=P.useCallback(async()=>{if(!r&&!s){d([]),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})}),k=await S.json();S.ok&&k.services?(d(k.services),f(new Set(k.services.map(b=>b.name)))):(d([]),f(new Set))}catch(T){console.error("Failed to extract services:",T),d([]),f(new Set)}finally{y(!1)}},[r,s]);return P.useEffect(()=>{r||s?x():(d([]),f(new Set))},[r,s,x]),{services:u,selectedServices:p,setSelectedServices:f,loadingServices:h}}function Qg(){const[r,s]=P.useState(""),[u,d]=P.useState(""),[p,f]=P.useState(""),[h,y]=P.useState({running:!1,pid:null}),[x,T]=P.useState(!1),[S,k]=P.useState(null),[b,_]=P.useState(null),[z,R]=P.useState(!1),[L,I]=P.useState({backupPath:null,originalPath:null}),{services:D,selectedServices:U,setSelectedServices:W}=Vg(r,u),{detectedPaths:$,detecting:A,detectConfigPaths:K,backups:V,loadingBackups:G,loadBackups:Y,viewingConfig:ue,configContent:ve,loadingConfig:me,handleViewConfig:Re,setViewingConfig:Ne,setConfigContent:Me,viewingBackup:he,backupContent:J,loadingBackup:q,handleViewBackup:X,handleDeleteBackup:j,setViewingBackup:N,setBackupContent:ie}=Ug();P.useEffect(()=>{ke();const Se=setInterval(ke,2e3);return()=>clearInterval(Se)},[]);const ce=(Se,De)=>{I({backupPath:Se,originalPath:De}),R(!0)},pe=async()=>{const{backupPath:Se,originalPath:De}=L;R(!1);try{const Je=await fetch("/api/config/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupPath:Se,originalPath:De})}),vt=await Je.json();Je.ok?(k(vt.message||"Config restored successfully"),_(null),Y(),K()):(_(vt.error||"Failed to restore backup"),k(null))}catch(Je){_(Je.message||"Failed to restore backup"),k(null)}},xe=async Se=>{await j(Se)?(k("Backup deleted successfully"),_(null)):(_("Failed to delete backup"),k(null))},ke=async()=>{try{const De=await(await fetch("/api/composite/status")).json();y(De)}catch(Se){console.error("Failed to fetch status:",Se)}},we=Se=>{const De=Se.target.files[0];if(De){const Je=new FileReader;Je.onload=vt=>{s(vt.target.result)},Je.readAsText(De)}},de=Se=>{const De=Se.target.value;d(De),De&&s("")},Le=Se=>{f(Se.target.value)},_t=async()=>{T(!0),_(null),k(null);try{const Se=r?{fileContent:r,filePath:p||null}:{filePath:u};U.size>0&&(Se.selectedServices=Array.from(U));const De=await fetch("/api/composite/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Se)}),Je=await De.json();if(De.ok){const vt=Je.message||"MCP Shark server started successfully";k(Je.backupPath?`${vt} (Backup saved to ${Je.backupPath})`:vt),s(""),d(""),f(""),W(new Set),setTimeout(ke,1e3)}else _(Je.error||"Failed to setup MCP Shark server")}catch(Se){_(Se.message||"Failed to setup MCP Shark server")}finally{T(!1)}},Vt=async()=>{T(!0),_(null),k(null);try{const Se=await fetch("/api/composite/stop",{method:"POST"}),De=await Se.json();if(Se.ok){const Je=De.message||"MCP Shark server stopped";k(De.message?.includes("restored")?"MCP Shark server stopped and original config file restored":Je),setTimeout(ke,1e3)}else _(De.error||"Failed to stop MCP Shark server")}catch(Se){_(Se.message||"Failed to stop MCP Shark server")}finally{T(!1)}},Qt=(r||u)&&(D.length===0||U.size>0);return i.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",background:o.bgPrimary,overflow:"auto"},children:[i.jsxs("div",{style:{width:"100%",maxWidth:"1200px",margin:"0 auto",padding:"32px",minHeight:"100%",boxSizing:"border-box"},children:[i.jsx(Ag,{}),i.jsx(Dg,{detectedPaths:$,detecting:A,onDetect:K,onPathSelect:Se=>{d(Se),s(""),f(Se)},onViewConfig:Re,filePath:u,fileContent:r,updatePath:p,onFileSelect:we,onPathChange:de,onUpdatePathChange:Le,services:D,selectedServices:U,onSelectionChange:W}),i.jsx(Wg,{status:h,loading:x,onStart:_t,onStop:Vt,canStart:Qt}),i.jsx(Bg,{message:S,error:b}),i.jsx(Fg,{backups:V,loadingBackups:G,onRefresh:Y,onRestore:ce,onView:X,onDelete:xe}),i.jsx(Hg,{filePath:u,updatePath:p})]}),i.jsx(ai,{isOpen:z,onClose:()=>R(!1),onConfirm:pe,title:"Restore Backup",message:"Are you sure you want to restore this backup? This will overwrite the current config file.",confirmText:"Restore",cancelText:"Cancel",danger:!1}),i.jsx(Og,{viewingConfig:ue,configContent:ve,loadingConfig:me,viewingBackup:he,backupContent:J,loadingBackup:q,onClose:()=>{Ne(null),Me(null),N(null),ie(null)}})]})}function Yg({elementRect:r,_onClick:s}){if(!r)return i.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.8)"}});const u=8,d=3;return i.jsxs(i.Fragment,{children:[r.top>0&&i.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&&i.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&&i.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&&i.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}}),i.jsx("div",{style:{position:"fixed",left:r.left-u-d,top:r.top-u-d,width:r.width+(u+d)*2,height:r.height+(u+d)*2,border:`${d}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"}}),i.jsx("style",{children:`
|
|
9
|
+
@keyframes pulse {
|
|
10
|
+
0%, 100% {
|
|
11
|
+
box-shadow:
|
|
12
|
+
0 0 0 2px rgba(78, 201, 176, 0.3),
|
|
13
|
+
0 0 20px rgba(78, 201, 176, 0.5),
|
|
14
|
+
0 0 40px rgba(78, 201, 176, 0.3),
|
|
15
|
+
inset 0 0 20px rgba(78, 201, 176, 0.1);
|
|
16
|
+
}
|
|
17
|
+
50% {
|
|
18
|
+
box-shadow:
|
|
19
|
+
0 0 0 3px rgba(78, 201, 176, 0.4),
|
|
20
|
+
0 0 30px rgba(78, 201, 176, 0.7),
|
|
21
|
+
0 0 60px rgba(78, 201, 176, 0.5),
|
|
22
|
+
inset 0 0 30px rgba(78, 201, 176, 0.2);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`})]})}const Jg=({size:r=16,color:s="currentColor"})=>i.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:[i.jsx("title",{children:"Close icon"}),i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Kg=({size:r=16,color:s="currentColor"})=>i.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:[i.jsx("title",{children:"Chevron right icon"}),i.jsx("polyline",{points:"9 18 15 12 9 6"})]}),Gg=({size:r=16,color:s="currentColor"})=>i.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:[i.jsx("title",{children:"Chevron left icon"}),i.jsx("polyline",{points:"15 18 9 12 15 6"})]});function Xg({currentStep:r,totalSteps:s,onNext:u,onPrevious:d,onSkip:p}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",pointerEvents:"none"},children:[i.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),p()},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"}),i.jsxs("div",{style:{display:"flex",gap:"8px",pointerEvents:"auto"},children:[r>0&&i.jsxs("button",{type:"button",onClick:f=>{f.stopPropagation(),d()},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:[i.jsx(Gg,{size:14}),"Previous"]}),i.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&&i.jsx(Kg,{size:14})]})]})]})}function Zg({step:r,currentStep:s,totalSteps:u,isDragging:d,onSkip:p}){return i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:"12px"},children:[i.jsxs("div",{style:{flex:1,pointerEvents:"none"},children:[i.jsx("h3",{style:{margin:0,color:o.accentBlue,fontSize:"16px",fontWeight:"600",fontFamily:v.body},children:r.title}),i.jsxs("p",{style:{margin:"4px 0 0 0",color:o.textTertiary,fontSize:"12px",fontFamily:v.body},children:["Step ",s+1," of ",u,d&&i.jsx("span",{style:{marginLeft:"8px",fontSize:"11px"},children:"• Dragging"})]})]}),i.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),p()},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:i.jsx(Jg,{size:18})})]})}function qg(r,s,u){const[d,p]=P.useState({x:0,y:0}),[f,h]=P.useState(!1),[y,x]=P.useState({x:0,y:0});P.useEffect(()=>{p({x:0,y:0})},[]);const T=(k,b)=>{if(k.preventDefault(),k.stopPropagation(),b.current){const _=b.current.getBoundingClientRect();x({x:k.clientX-_.left,y:k.clientY-_.top}),h(!0)}};return P.useEffect(()=>{if(!f)return;const k=_=>{p({x:_.clientX-y.x,y:_.clientY-y.y})},b=()=>{h(!1)};return window.addEventListener("mousemove",k),window.addEventListener("mouseup",b),()=>{window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",b)}},[f,y]),{position:(()=>{if(!r)return{left:0,top:0,transform:"none"};const k=350,b=200,_=20;if(d.x!==0||d.y!==0){const U=Math.max(10,Math.min(d.x,window.innerWidth-k-10)),W=Math.max(10,Math.min(d.y,window.innerHeight-b-10));return{left:U,top:W,transform:"none"}}const z=s.position||"bottom",L=((U,W,$,A,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-A-K,ue=Y<10?W.bottom+K:Y;return{left:W.left+W.width/2,top:ue,transform:"translate(-50%, 0)"}}const V=W.bottom+K,G=V+A>window.innerHeight-10?W.top-A-K:V;return{left:W.left+W.width/2,top:G,transform:"translate(-50%, 0)"}})(z,r,k,b,_),I=Math.max(10,Math.min(L.left,window.innerWidth-k-10)),D=Math.max(10,Math.min(L.top,window.innerHeight-b-10));return{left:I,top:D,transform:L.transform}})(),isDragging:f,handleMouseDown:T}}function eh({elementRect:r,step:s,currentStep:u,totalSteps:d,onNext:p,onPrevious:f,onSkip:h}){const y=P.useRef(null),{position:x,isDragging:T,handleMouseDown:S}=qg(r,s);return r?i.jsxs("button",{type:"button",ref:y,onMouseDown:k=>S(k,y),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),S(k,y))},"aria-label":"Draggable tooltip",style:{position:"fixed",left:`${x.left}px`,top:`${x.top}px`,transform:x.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:T?"grabbing":"grab",userSelect:"none"},onClick:k=>{const b=k.target;b.tagName!=="BUTTON"&&b.tagName!=="INPUT"&&!b.closest("button")&&k.stopPropagation()},children:[i.jsx(Zg,{step:s,currentStep:u,totalSteps:d,isDragging:T,onSkip:h}),i.jsx("div",{style:{color:o.textPrimary,fontSize:"14px",lineHeight:"1.6",marginBottom:"20px",pointerEvents:"none",fontFamily:v.body},children:s.content}),i.jsx(Xg,{currentStep:u,totalSteps:d,onNext:p,onPrevious:f,onSkip:h})]}):null}function th({steps:r,onComplete:s,onSkip:u,onStepChange:d}){const[p,f]=P.useState(0),[h,y]=P.useState(null),[x,T]=P.useState(null),S=P.useRef(null);P.useEffect(()=>{if(!h)return;const L=()=>{if(h){const D=h.getBoundingClientRect();T(D)}};L();const I={passive:!0,capture:!0};return window.addEventListener("scroll",L,I),window.addEventListener("resize",L,{passive:!0}),()=>{window.removeEventListener("scroll",L,I),window.removeEventListener("resize",L,{passive:!0})}},[h]),P.useEffect(()=>{if(r.length===0)return;const L=r[p];if(!L)return;d&&d(p);const I=setTimeout(()=>{const D=document.querySelector(L.target);D?(y(D),D.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),setTimeout(()=>{const U=D.getBoundingClientRect();T(U)},300)):(y(null),T(null))},200);return()=>clearTimeout(I)},[p,r,d]);const k=()=>{if(p<r.length-1){const L=p+1;f(L),d&&d(L)}else _()},b=()=>{if(p>0){const L=p-1;f(L),d&&d(L)}},_=async()=>{try{await fetch("/api/help/dismiss",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tourCompleted:!0})})}catch(L){console.error("Failed to save tour state:",L)}s()},z=()=>{_(),u&&u()};if(r.length===0||p>=r.length)return null;const R=r[p];return i.jsxs(i.Fragment,{children:[i.jsx("div",{ref:S,role:"presentation",style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9998,pointerEvents:"auto"},onClick:z,onKeyDown:L=>{L.key==="Escape"&&z()},children:i.jsx(Yg,{elementRect:x})}),x&&i.jsx(eh,{elementRect:x,step:R,currentStep:p,totalSteps:r.length,onNext:k,onPrevious:b,onSkip:z})]})}function er({title:r,count:s,children:u,defaultExpanded:d=!1}){const[p,f]=P.useState(d);return i.jsxs("div",{style:{background:o.bgTertiary,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden"},children:[i.jsxs("button",{type:"button",onClick:()=>f(!p),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:h=>{h.currentTarget.style.background=o.bgCard},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"12px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:r}),s!==void 0&&i.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})]}),i.jsxs("svg",{style:{width:"14px",height:"14px",color:o.textSecondary,transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",role:"img","aria-label":"Chevron icon",children:[i.jsx("title",{children:"Chevron icon"}),i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})]})]}),p&&i.jsx("div",{style:{padding:"12px",borderTop:`1px solid ${o.borderLight}`,background:o.bgCard},children:u})]})}function Vr(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 cs({findings:r,type:s}){return i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",fontSize:"12px",fontFamily:v.body},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:`1px solid ${o.borderLight}`,background:o.bgTertiary},children:[i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Name"}),i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Risk Level"}),i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Risk Score"}),i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Tags"}),i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Reasons"}),i.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"&&i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Poisoned"})]})}),i.jsx("tbody",{children:r.map((u,d)=>i.jsxs("tr",{style:{borderBottom:`1px solid ${o.borderLight}`,transition:"background 0.15s"},onMouseEnter:p=>{p.currentTarget.style.background=o.bgTertiary},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:[i.jsx("td",{style:{padding:"8px",fontSize:"12px",color:o.textPrimary,fontWeight:"500",fontFamily:v.body},children:u.name}),i.jsx("td",{style:{padding:"8px"},children:i.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",borderRadius:"4px",fontSize:"10px",fontWeight:"700",color:o.textInverse,background:Vr(u.risk_level),fontFamily:v.body},children:u.risk_level?.toUpperCase()})}),i.jsx("td",{style:{padding:"8px",fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:u.risk_score}),i.jsx("td",{style:{padding:"8px"},children:i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"2px"},children:u.risk_tags?.map((p,f)=>i.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:p},`tag-${String(p)}-${f}`))})}),i.jsx("td",{style:{padding:"8px",fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:i.jsx("ul",{style:{listStyle:"disc",listStylePosition:"inside",margin:0,padding:0},children:u.reasons?.map((p,f)=>i.jsx("li",{style:{fontSize:"10px",marginBottom:"2px"},children:p},`reason-${f}-${p.substring(0,20)}`))})}),i.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")&&i.jsx("td",{style:{padding:"8px"},children:u.is_potentially_poisoned?i.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"}):i.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||d}-${d}`))})]})})}function nh({patterns:r}){return!r||r.length===0?null:i.jsx(er,{title:"Notable Patterns",count:r.length,defaultExpanded:!1,children:i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((s,u)=>i.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:d=>{d.currentTarget.style.background=`${o.accentOrange}15`,d.currentTarget.style.borderColor=`${o.accentOrange}40`},onMouseLeave:d=>{d.currentTarget.style.background=`${o.accentOrange}10`,d.currentTarget.style.borderColor=`${o.accentOrange}20`},children:[i.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:i.jsxs("svg",{style:{width:"10px",height:"10px",color:o.accentOrange},fill:"currentColor",viewBox:"0 0 20 20",role:"img","aria-label":"Pattern icon",children:[i.jsx("title",{children:"Pattern icon"}),i.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"})]})}),i.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 rh(r){const s=r.includes(`
|
|
26
|
+
`)?`
|
|
27
|
+
`:r.includes(" | ")?" | ":null;return s?i.jsx("ul",{style:{listStyle:"disc",listStylePosition:"inside",margin:0,paddingLeft:"8px"},children:r.split(s).map((u,d)=>i.jsx("li",{style:{fontSize:"12px",marginBottom:"2px"},children:u.trim()},`reason-${d}-${u.trim().substring(0,20)}`))}):i.jsx("p",{style:{fontSize:"12px"},children:r})}function oh({overallRiskLevel:r,overallReason:s}){return r?i.jsx(er,{title:"Overall Summary",count:s?1:0,defaultExpanded:!0,children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"12px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:"Overall Risk Level:"}),i.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"4px",fontSize:"10px",fontWeight:"700",color:o.textInverse,background:Vr(r),fontFamily:v.body},children:r.toUpperCase()})]}),s&&i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:rh(s)})]})}):null}function ih({recommendations:r}){return!r||r.length===0?null:i.jsx(er,{title:"Recommendations",count:r.length,defaultExpanded:!1,children:i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((s,u)=>i.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:d=>{d.currentTarget.style.background=`${o.accentBlue}15`,d.currentTarget.style.borderColor=`${o.accentBlue}40`},onMouseLeave:d=>{d.currentTarget.style.background=`${o.accentBlue}10`,d.currentTarget.style.borderColor=`${o.accentBlue}20`},children:[i.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:i.jsx("span",{style:{fontSize:"10px",fontWeight:"600",color:o.accentBlue,fontFamily:v.body},children:u+1})}),i.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 lh({analysis:r}){if(!r)return i.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||[],d=r.resource_findings||[];return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsx(oh,{overallRiskLevel:r.overall_risk_level,overallReason:r.overall_reason}),s.length>0&&i.jsx(er,{title:"Tool Findings",count:s.length,defaultExpanded:!0,children:i.jsx(cs,{findings:s,type:"tool"})}),u.length>0&&i.jsx(er,{title:"Prompt Findings",count:u.length,defaultExpanded:!0,children:i.jsx(cs,{findings:u,type:"prompt"})}),d.length>0&&i.jsx(er,{title:"Resource Findings",count:d.length,defaultExpanded:!0,children:i.jsx(cs,{findings:d,type:"resource"})}),i.jsx(ih,{recommendations:r.recommendations}),i.jsx(nh,{patterns:r.notable_patterns})]})}function sh({scan:r,scanId:s,serverName:u,analysisResult:d}){return i.jsxs("details",{style:{marginBottom:"16px"},children:[i.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:p=>{p.currentTarget.style.background=o.bgSecondary,p.currentTarget.style.color=o.textPrimary},onMouseLeave:p=>{p.currentTarget.style.background=o.bgTertiary,p.currentTarget.style.color=o.textSecondary},children:"Debug Info (click to expand)"}),i.jsx("div",{style:{marginTop:"8px",padding:"12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontFamily:"monospace",border:`1px solid ${o.borderLight}`},children:i.jsxs("div",{style:{fontSize:"10px",color:o.textSecondary,lineHeight:"1.6"},children:[i.jsxs("div",{children:["scanId: ",s?`"${s}"`:"missing"]}),i.jsxs("div",{children:['serverName: "',u,'"']}),i.jsxs("div",{children:["analysisResult: ",d?"found":"missing"]}),i.jsxs("div",{children:["has scan.result: ",r.result?"yes":"no"]}),i.jsxs("div",{children:["has scan.data: ",r.data?"yes":"no"]}),i.jsxs("div",{children:["scan keys: ",Object.keys(r||{}).join(", ")]}),r.result&&i.jsxs("div",{children:["scan.result keys: ",Object.keys(r.result||{}).join(", ")]}),r.data&&i.jsxs("div",{children:["scan.data keys: ",Object.keys(r.data||{}).join(", ")]})]})})]})}function ah({scan:r}){return i.jsxs("div",{style:{marginBottom:"24px"},children:[i.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"}),i.jsxs("details",{children:[i.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"}),i.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 uh({scanId:r,serverName:s,onClose:u}){return i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[i.jsxs("div",{children:[i.jsx("h2",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,margin:0,marginBottom:"8px"},children:s}),r&&i.jsxs("div",{style:{fontSize:"12px",color:o.textTertiary,fontFamily:v.body},children:["ID: ",r]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[r&&i.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:[i.jsx(qc,{size:14,stroke:1.5}),"View on Smart Scan"]}),i.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:d=>{d.currentTarget.style.background=o.bgTertiary,d.currentTarget.style.color=o.textPrimary},onMouseLeave:d=>{d.currentTarget.style.background="transparent",d.currentTarget.style.color=o.textSecondary},children:i.jsx(rd,{size:20,stroke:1.5})})]})]})}function ch({status:r,overallRiskLevel:s,createdAt:u,updatedAt:d}){const p=f=>f?new Date(f).toLocaleString():"N/A";return i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"16px",padding:"16px",background:o.bgTertiary,borderRadius:"8px"},children:[r&&i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:v.body,marginBottom:"4px"},children:"Status"}),i.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontFamily:v.body,fontWeight:"500"},children:r})]}),s&&i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:v.body,marginBottom:"4px"},children:"Overall Risk Level"}),i.jsx("span",{style:{padding:"4px 10px",borderRadius:"6px",fontSize:"11px",fontWeight:"700",fontFamily:v.body,background:Vr(s),color:o.textInverse,display:"inline-block"},children:s.toLowerCase()})]}),u&&i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:v.body,marginBottom:"4px"},children:"Created At"}),i.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontFamily:v.body,fontWeight:"500"},children:p(u)})]}),d&&i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:v.body,marginBottom:"4px"},children:"Updated At"}),i.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontFamily:v.body,fontWeight:"500"},children:p(d)})]})]})}function dh({serverData:r}){return r?i.jsxs("div",{style:{marginBottom:"24px"},children:[i.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"}),i.jsxs("div",{style:{padding:"12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"12px",fontFamily:v.body},children:[i.jsxs("div",{style:{marginBottom:"8px"},children:[i.jsx("strong",{style:{color:o.textTertiary},children:"Name: "}),i.jsx("span",{style:{color:o.textPrimary},children:r.name||"N/A"})]}),r.description&&i.jsxs("div",{children:[i.jsx("strong",{style:{color:o.textTertiary},children:"Description: "}),i.jsx("span",{style:{color:o.textPrimary},children:r.description})]})]})]}):null}function ye(r,s){return s.split(".").reduce((d,p)=>d&&typeof d=="object"&&p in d?d[p]:null,r)}function ph(r){const s=r.result||r.data||r,u=ye(r,"result.id")||ye(r,"id")||ye(r,"scan_id")||ye(r,"data.id")||ye(r,"data.scan_id")||s?.id||s?.scan_id,d=r.serverName||r.server_name||ye(r,"result.mcp_server_data.server.name")||ye(r,"mcp_server_data.server.name")||ye(r,"server.name")||ye(r,"data.server.name")||ye(r,"data.data.server.name")||r.server?.name||"Unknown Server",p=ye(r,"result.status")||ye(r,"status")||ye(r,"data.status"),f=ye(r,"result.overall_risk_level")||ye(r,"overall_risk_level")||ye(r,"data.overall_risk_level")||ye(r,"data.data.overall_risk_level"),h=ye(r,"result.created_at")||ye(r,"created_at")||ye(r,"data.created_at")||ye(r,"data.data.created_at"),y=ye(r,"result.updated_at")||ye(r,"updated_at")||ye(r,"data.updated_at")||ye(r,"data.data.updated_at"),x=ye(r,"result.analysis_result")||ye(r,"analysis_result")||ye(r,"data.analysis_result")||ye(r,"data.data.analysis_result")||ye(r,"data.data.data.analysis_result"),S=((b,_)=>{if(b)return b;if(_&&typeof _=="object"){if(_.tool_findings||_.prompt_findings||_.resource_findings)return _;if(_.analysis_result)return _.analysis_result}return null})(x,s),k=ye(r,"result.mcp_server_data.server")||ye(r,"mcp_server_data.server")||ye(r,"server")||ye(r,"data.server")||ye(r,"data.data.server")||ye(r,"mcp_server_data");return{scanId:u,serverName:d,status:p,overallRiskLevel:f,createdAt:h,updatedAt:y,analysisResult:S,serverData:k}}function od({scan:r,loading:s,onClose:u}){if(s)return i.jsx("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"24px",textAlign:"center"},children:i.jsx("p",{style:{color:o.textSecondary,fontFamily:v.body},children:"Loading scan details..."})});if(!r)return i.jsx("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"24px",textAlign:"center"},children:i.jsx("p",{style:{color:o.textSecondary,fontFamily:v.body},children:"No scan data available"})});const{scanId:d,serverName:p,status:f,overallRiskLevel:h,createdAt:y,updatedAt:x,analysisResult:T,serverData:S}=ph(r);return i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"24px",boxShadow:`0 1px 3px ${o.shadowSm}`,position:"relative"},children:[i.jsx(uh,{scanId:d,serverName:p,onClose:u}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[i.jsx(sh,{scan:r,scanId:d,serverName:p,analysisResult:T}),i.jsx(ch,{status:f,overallRiskLevel:h,createdAt:y,updatedAt:x}),i.jsx(dh,{serverData:S}),T?i.jsxs("div",{style:{marginBottom:"24px"},children:[i.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"}),i.jsx(lh,{analysis:T})]}):i.jsxs("div",{style:{marginBottom:"24px"},children:[i.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"}),i.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."})]}),i.jsx(ah,{scan:r})]})]})}const id=({size:r=24,color:s="currentColor"})=>i.jsx(nd,{size:r,stroke:1.5,color:s}),ui=({size:r=16,color:s="currentColor"})=>i.jsx(qc,{size:r,stroke:1.5,color:s}),fh=({size:r=16,color:s="currentColor"})=>i.jsx(Hf,{size:r,stroke:1.5,color:s}),Hr=({size:r=16,color:s="currentColor"})=>i.jsx(Xf,{size:r,stroke:1.5,color:s}),ld=({size:r=16,color:s="currentColor"})=>i.jsx(Xc,{size:r,stroke:1.5,color:s}),oi=({size:r=16,color:s=o.accentBlue})=>i.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 gh({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)}),i.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:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1,minWidth:0},children:[i.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&&i.jsxs(i.Fragment,{children:[r.data?.data?.overall_risk_level&&i.jsxs("span",{style:{padding:"4px 10px",borderRadius:"6px",fontSize:"10px",fontWeight:"700",fontFamily:v.body,background:Vr(r.data.data.overall_risk_level),color:o.textInverse,whiteSpace:"nowrap"},children:[r.data.data.overall_risk_level.toLowerCase()," risk"]}),s&&r.data&&i.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:d=>{d.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:d=>{d.currentTarget.style.background=o.buttonPrimary},children:[i.jsx(ys,{size:12,stroke:1.5}),i.jsx("span",{children:"View"})]}),r.data?.scan_id&&i.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:d=>{d.currentTarget.style.background=o.bgTertiary,d.currentTarget.style.borderColor=o.accentBlue},onMouseLeave:d=>{d.currentTarget.style.background=o.bgSecondary,d.currentTarget.style.borderColor=o.borderLight},children:[i.jsx("span",{children:"open"}),i.jsx(ui,{size:12,color:o.accentBlue})]})]})]}),i.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:r.success?i.jsxs(i.Fragment,{children:[r.cached&&i.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:[i.jsx(ld,{size:10,color:o.textSecondary}),i.jsx("span",{children:"Cached"})]}),i.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:[i.jsx(Hr,{size:10,color:o.textInverse}),i.jsx("span",{children:"Success"})]})]}):i.jsxs(i.Fragment,{children:[i.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&&i.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 hh({scanResults:r}){const s=r.filter(p=>p.cached).length,u=r.filter(p=>p.success&&!p.cached).length,d=r.every(p=>p.cached);return i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[i.jsxs("div",{children:[i.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":"",")"]}),d&&i.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&&i.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center",fontSize:"13px",color:o.textSecondary,fontFamily:v.body},children:[s>0&&i.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:[i.jsx(ld,{size:12,color:o.textSecondary}),i.jsxs("span",{children:[s," cached"]})]}),u>0&&i.jsxs("span",{style:{padding:"6px 10px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontWeight:"600",display:"inline-flex",alignItems:"center",gap:"4px"},children:[i.jsx(Hr,{size:12,color:o.accentGreen}),i.jsxs("span",{children:[u," scanned"]})]})]})]})}function xh({scanResults:r,onViewScan:s}){return r.length===0?null:i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"20px",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[i.jsx(hh,{scanResults:r}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((u,d)=>i.jsx(gh,{result:u,onViewScan:s},u.scanId||`batch-result-${d}`))})]})}function yh(){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"400px",textAlign:"center",padding:"40px"},children:[i.jsx("div",{style:{marginBottom:"24px",opacity:.6},children:i.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:[i.jsx("title",{children:"Empty state icon"}),i.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),i.jsx("path",{d:"M9 12l2 2 4-4"})]})}),i.jsx("h3",{style:{fontSize:"20px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"8px"},children:"Ready to Scan"}),i.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 mh({error:r}){return r?i.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:[i.jsx(fh,{size:20,color:o.error,style:{flexShrink:0,marginTop:"2px"}}),i.jsxs("div",{style:{flex:1},children:[i.jsx("p",{style:{fontSize:"14px",color:o.error,fontFamily:v.body,margin:0,fontWeight:"600",marginBottom:"4px"},children:"Error"}),i.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,fontFamily:v.body,margin:0,lineHeight:"1.5"},children:r})]})]}):null}function vh({scanning:r,selectedServers:s}){return r?i.jsx("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"24px",boxShadow:`0 2px 8px ${o.shadowSm}`},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[i.jsx(oi,{size:20}),i.jsxs("div",{style:{flex:1},children:[i.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":"","..."]}),i.jsx("p",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body,margin:0},children:"Analyzing security vulnerabilities and risks"})]})]})}):null}function Sh({scanResult:r}){return r?i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"20px",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[i.jsx("h2",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"16px"},children:"Scan Results"}),r.data?.overall_risk_level&&i.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"16px",marginBottom:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"8px"},children:[i.jsx("span",{style:{padding:"4px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:"700",fontFamily:v.body,background:Vr(r.data.overall_risk_level),color:o.textInverse},children:r.data.overall_risk_level.toUpperCase()}),i.jsx("span",{style:{fontSize:"14px",color:o.textSecondary,fontFamily:v.body},children:"Overall Risk Level"})]}),r.data.overall_reason&&i.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,fontFamily:v.body,margin:0},children:r.data.overall_reason})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"12px",marginBottom:"20px"},children:[r.data?.tool_findings?.length>0&&i.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"12px"},children:[i.jsx("div",{style:{fontSize:"24px",fontWeight:"700",color:o.textPrimary,fontFamily:v.body},children:r.data.tool_findings.length}),i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"Tool Findings"})]}),r.data?.resource_findings?.length>0&&i.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"12px"},children:[i.jsx("div",{style:{fontSize:"24px",fontWeight:"700",color:o.textPrimary,fontFamily:v.body},children:r.data.resource_findings.length}),i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"Resource Findings"})]}),r.data?.prompt_findings?.length>0&&i.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"12px"},children:[i.jsx("div",{style:{fontSize:"24px",fontWeight:"700",color:o.textPrimary,fontFamily:v.body},children:r.data.prompt_findings.length}),i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:v.body},children:"Prompt Findings"})]})]}),r.data?.recommendations?.length>0&&i.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"16px",marginBottom:"20px"},children:[i.jsx("h3",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"12px"},children:"Recommendations"}),i.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)=>i.jsx("li",{children:s},`recommendation-${u}-${s.substring(0,30)}`))})]}),r.scan_id&&i.jsx("div",{style:{marginTop:"20px",paddingTop:"20px",borderTop:`1px solid ${o.borderLight}`},children:i.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:[i.jsx("span",{children:"View Full Results"}),i.jsx(ui,{size:14,color:o.textPrimary})]})})]}):null}function sd({error:r,scanning:s,selectedServers:u,scanResults:d,scanResult:p,onViewScan:f}){return i.jsxs("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"24px",background:o.bgPrimary},children:[!r&&d.length===0&&!p&&!s&&i.jsx(yh,{}),i.jsx(mh,{error:r}),i.jsx(vh,{scanning:s,selectedServers:u}),d.length>0&&i.jsx(xh,{scanResults:d,onViewScan:f}),p&&d.length===0&&i.jsx(Sh,{scanResult:p})]})}function bh({error:r,loadingScans:s,selectedScan:u,loadingScanDetail:d,allScans:p,setSelectedScan:f,loadScanDetail:h,onViewScan:y}){return s?i.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",background:o.bgPrimary},children:i.jsx("p",{style:{color:o.textSecondary,fontFamily:v.body},children:"Loading cached scans..."})}):u?i.jsx(od,{scan:u,loading:d,onClose:()=>{f(null),h(null)}}):i.jsxs(i.Fragment,{children:[r&&i.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}),i.jsx(sd,{error:r,scanning:!1,selectedServers:[],scanResults:p,scanResult:null,onViewScan:y})]})}function kh({discoveredServers:r,selectedServers:s,setSelectedServers:u,runScan:d,scanning:p,apiToken:f}){const h=()=>{s.size===r.length?u(new Set):u(new Set(r.map(y=>y.name)))};return i.jsx("div",{style:{background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,padding:"12px 24px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px",flexWrap:"wrap"},children:[i.jsx("div",{style:{fontSize:"12px",fontWeight:"600",color:o.textSecondary,fontFamily:v.body,whiteSpace:"nowrap"},children:"Select servers to scan:"}),i.jsx("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap",flex:1},children:r.map((y,x)=>{const T=s.has(y.name);return i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:T?o.bgCard:o.bgTertiary,border:`1px solid ${T?o.accentBlue:o.borderLight}`,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s ease",fontSize:"12px",fontFamily:v.body,fontWeight:T?"600":"500",color:T?o.textPrimary:o.textSecondary},onMouseEnter:S=>{S.currentTarget.style.borderColor=o.accentBlue,S.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`},onMouseLeave:S=>{T||(S.currentTarget.style.borderColor=o.borderLight,S.currentTarget.style.boxShadow="none")},children:[i.jsx("input",{type:"checkbox",checked:T,onChange:S=>{const k=new Set(s);S.target.checked?k.add(y.name):k.delete(y.name),u(k)},style:{width:"16px",height:"16px",cursor:"pointer",accentColor:o.accentBlue}}),i.jsx("span",{children:y.name}),i.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-${x}`)})}),i.jsx("button",{type:"button",onClick:h,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"}),i.jsx("button",{type:"button",onClick:d,disabled:!f||s.size===0||p,style:{padding:"8px 16px",background:f&&s.size>0&&!p?o.buttonPrimary:o.buttonSecondary,color:f&&s.size>0&&!p?o.textInverse:o.textTertiary,border:"none",borderRadius:"6px",fontSize:"13px",fontWeight:"600",fontFamily:v.body,cursor:f&&s.size>0&&!p?"pointer":"not-allowed",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap"},onMouseEnter:y=>{f&&s.size>0&&!p&&(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&&!p&&(y.currentTarget.style.background=o.buttonPrimary,y.currentTarget.style.transform="translateY(0)",y.currentTarget.style.boxShadow="none")},children:p?i.jsxs(i.Fragment,{children:[i.jsx(oi,{size:14,color:o.textInverse}),i.jsxs("span",{children:["Scanning ",s.size," server",s.size!==1?"s":"","..."]})]}):i.jsxs(i.Fragment,{children:[i.jsx(id,{size:14,color:f&&s.size>0?o.textInverse:o.textTertiary}),i.jsxs("span",{children:["Run Scan (",s.size,")"]})]})})]})})}function wh({discoveredServers:r,selectedServers:s,setSelectedServers:u,runScan:d,scanning:p,apiToken:f,error:h,scanResults:y,scanResult:x,selectedScan:T,loadingScanDetail:S,setSelectedScan:k,loadScanDetail:b,onViewScan:_}){return T?i.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"24px",background:o.bgPrimary},children:i.jsx(od,{scan:T,loading:S,onClose:()=>{k(null),b(null)}})}):i.jsxs(i.Fragment,{children:[r.length>0&&i.jsx(kh,{discoveredServers:r,selectedServers:s,setSelectedServers:u,runScan:d,scanning:p,apiToken:f}),i.jsx(sd,{error:h,scanning:p,selectedServers:s,scanResults:y,scanResult:x,onViewScan:_})]})}function jh({apiToken:r,setApiToken:s,saveToken:u,loadingData:d,discoverMcpData:p,discoveredServers:f,_selectedServers:h,_setSelectedServers:y,scanning:x,clearCache:T,clearingCache:S,...k}){const{runScan:b}=k,_=P.useRef(null),[z,R]=P.useState(!1),L=I=>{s(I),_.current&&clearTimeout(_.current),I?_.current=setTimeout(()=>{u(I)},1e3):u("")};return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"20px",flexWrap:"wrap",flex:1,justifyContent:"flex-end"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("label",{htmlFor:"api-token-input",style:{fontSize:"12px",fontWeight:"600",color:o.textSecondary,fontFamily:v.body,whiteSpace:"nowrap"},children:"API Token:"}),i.jsxs("div",{style:{position:"relative",width:"200px"},children:[i.jsx("input",{id:"api-token-input",type:"password",value:r,onChange:I=>L(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&&i.jsx("div",{style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)"},children:i.jsx(Hr,{size:12,color:o.accentGreen})})]}),i.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:[i.jsx("span",{children:"Get token"}),i.jsx(ui,{size:10,color:o.accentBlue})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("label",{htmlFor:"servers-label",style:{fontSize:"12px",fontWeight:"600",color:o.textSecondary,fontFamily:v.body,whiteSpace:"nowrap"},children:"Servers:"}),i.jsx("button",{type:"button",onClick:p,disabled:d,style:{padding:"8px 14px",background:d?o.buttonSecondary:o.buttonPrimary,color:d?o.textTertiary:o.textInverse,border:"none",borderRadius:"6px",fontSize:"12px",fontWeight:"600",fontFamily:v.body,cursor:d?"not-allowed":"pointer",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",whiteSpace:"nowrap"},onMouseEnter:I=>{d||(I.currentTarget.style.background=o.buttonPrimaryHover,I.currentTarget.style.transform="translateY(-1px)")},onMouseLeave:I=>{d||(I.currentTarget.style.background=o.buttonPrimary,I.currentTarget.style.transform="translateY(0)")},children:d?i.jsxs(i.Fragment,{children:[i.jsx(oi,{size:12}),i.jsx("span",{children:"Discovering..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(Hr,{size:12,color:o.textInverse}),i.jsx("span",{children:"Discover"})]})}),f.length>0&&i.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:[i.jsx(Hr,{size:12,color:o.accentGreen}),i.jsxs("span",{children:[f.length," server",f.length!==1?"s":""]})]})]}),i.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?i.jsxs(i.Fragment,{children:[i.jsx(oi,{size:12}),i.jsx("span",{children:"Clearing..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(si,{size:14,stroke:1.5}),i.jsx("span",{children:"Clear Cache"})]})}),i.jsx(ai,{isOpen:z,onClose:()=>R(!1),onConfirm:async()=>{(await T()).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 Ch(){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginRight:"auto"},children:[i.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:i.jsx(id,{size:20,color:o.accentBlue})}),i.jsxs("div",{children:[i.jsx("h1",{style:{fontSize:"18px",fontWeight:"700",color:o.textPrimary,fontFamily:v.body,margin:0,letterSpacing:"-0.2px"},children:i.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",i.jsx(ui,{size:12,color:"currentColor"})]})}),i.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 Th({viewMode:r,setViewMode:s,onSwitchToScan:u,onSwitchToList:d}){return i.jsxs("div",{style:{display:"flex",gap:"8px",border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"4px",background:o.bgSecondary},children:[i.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"}),i.jsx("button",{type:"button",onClick:()=>{s("list"),d?.()},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 Ph(r,s,u){const[d,p]=P.useState(!1);return{clearingCache:d,clearCache:async()=>{p(!0),u(null);try{const h=await fetch("/api/smartscan/cache/clear",{method:"POST"}),y=await h.json();if(h.ok)return r.length>0&&await s(),{success:!0,message:y.message};throw new Error(y.error||"Failed to clear cache")}catch(h){return u(h.message||"Failed to clear cache"),{success:!1,error:h.message}}finally{p(!1)}}}}function _h(r){const[s,u]=P.useState(null),[d,p]=P.useState([]),[f,h]=P.useState(new Set),[y,x]=P.useState(!1),[T,S]=P.useState(null);return{mcpData:s,discoveredServers:d,selectedServers:f,setSelectedServers:h,loadingData:y,discoverMcpData:async()=>{x(!0),r(null),u(null),p([]);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(p(z.servers),z.servers.length>0){h(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 L=await R.json();L.success&&L.results&&L.results.filter(D=>D.success&&D.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{x(!1)}},makeMcpRequest:async(_,z={})=>{const R={"Content-Type":"application/json"};T&&(R["Mcp-Session-Id"]=T);const L=await fetch("/api/playground/proxy",{method:"POST",headers:R,body:JSON.stringify({method:_,params:z})}),I=await L.json(),D=L.headers.get("Mcp-Session-Id")||L.headers.get("mcp-session-id")||I._sessionId;if(D&&D!==T&&S(D),!L.ok)throw new Error(I.error?.message||I.message||"Request failed");return I.result||I}}}function Lh(r,s){const[u,d]=P.useState([]),[p,f]=P.useState(!1),[h,y]=P.useState(null),[x,T]=P.useState(!1);return{allScans:u,loadingScans:p,loadAllScans:async()=>{f(!0),s(null);try{console.log("Loading cached scans from local storage...");const b=await fetch("/api/smartscan/scans?cache=true"),_=await b.json();if(console.log("Cache response:",{status:b.status,ok:b.ok,cacheData:_}),b.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((L,I)=>{console.log(`[useScanList] Transforming scan ${I}:`,{scanId:L.id||L.scan_id,serverName:L.serverName,server_name:L.server_name,server:L.server,hasServerName:!!L.serverName,hasServerNameAlt:!!L.server_name,hasServer:!!L.server});const D=L.serverName?.trim()||L.server_name?.trim()||L.server?.name?.trim()||"Unknown Server";console.log(`[useScanList] Extracted serverName for scan ${I}: "${D}"`),D==="Unknown Server"&&console.error("[useScanList] Could not find server name in scan:",{scanId:L.id||L.scan_id,hasServerName:!!L.serverName,hasServerNameAlt:!!L.server_name,hasServer:!!L.server,serverNameValue:L.serverName,serverNameAltValue:L.server_name,serverNameFromServer:L.server?.name,scanKeys:Object.keys(L),fullScanObject:L});const U=L.data||L.result||L,W=U?.data&&typeof U.data=="object"?U.data:U,$={serverName:D,success:!0,cached:!0,data:{scan_id:L.scan_id||L.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(L=>({serverName:L.serverName,scan_id:L.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),d(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(b){s(b.message||"Failed to load cached scans")}finally{f(!1)}},selectedScan:h,setSelectedScan:y,loadingScanDetail:x,loadScanDetail:async b=>{if(!b){y(null);return}const _=u.find(z=>z.data?.scan_id===b||z.data?.data?.id===b||z.data?.data?.scan_id===b);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}T(!0),s(null);try{const z=await fetch(`/api/smartscan/scans/${b}`,{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{T(!1)}}}}function zh(r,s,u,d){const[p,f]=P.useState(!1),[h,y]=P.useState(null),[x,T]=P.useState([]);return{scanning:p,scanResult:h,scanResults:x,runScan:async()=>{if(!r){d("Please enter your API token");return}if(!s||s.length===0){d("Please discover MCP servers first");return}if(u.size===0){d("Please select at least one server to scan");return}f(!0),d(null),y(null),T([]);const k=s.filter(b=>u.has(b.name));try{const b=await fetch("/api/smartscan/scans/batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiToken:r,servers:k})}),_=await b.json();if(!b.ok){const z=L=>Array.isArray(L)?`Validation failed: ${L.map(I=>typeof I=="string"?I:I.field&&I.message?`${I.field}: ${I.message}`:JSON.stringify(I)).join("; ")}`:null,R=b.status===400&&_.details?z(_.details)||_.error||_.message||`API error: ${b.status}`:_.error||_.message||`API error: ${b.status}`;d(R);return}if(_.results&&Array.isArray(_.results)){T(_.results);const z=_.results.find(R=>R.success);z&&y(z.data)}}catch(b){d(b.message||"Failed to run scan")}finally{f(!1)}}}}function Eh(){const[r,s]=P.useState(null);P.useEffect(()=>{u();const d=setInterval(u,2e3);return()=>clearInterval(d)},[]);const u=async()=>{try{const d=await fetch("/api/composite/status");if(!d.ok)throw new Error("Server not available");const p=await d.json();s(p)}catch{s({running:!1})}};return{serverStatus:r}}function Rh(){const[r,s]=P.useState(""),u=P.useRef(null);P.useEffect(()=>(d(),()=>{u.current&&clearTimeout(u.current)}),[]);const d=async()=>{try{const f=await fetch("/api/smartscan/token");if(f.ok){const h=await f.json();h.token&&s(h.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(h){console.error("Error saving token:",h)}},saveTokenTimeoutRef:u}}function Mh(){const[r,s]=P.useState(null),{apiToken:u,setApiToken:d,saveToken:p,saveTokenTimeoutRef:f}=Rh(),{serverStatus:h}=Eh(),{mcpData:y,discoveredServers:x,selectedServers:T,setSelectedServers:S,loadingData:k,discoverMcpData:b,makeMcpRequest:_}=_h(s),{scanning:z,scanResult:R,scanResults:L,runScan:I}=zh(u,x,T,s),{allScans:D,loadingScans:U,loadAllScans:W,selectedScan:$,setSelectedScan:A,loadingScanDetail:K,loadScanDetail:V}=Lh(u,s),{clearingCache:G,clearCache:Y}=Ph(x,b,s);return{apiToken:u,setApiToken:d,serverStatus:h,mcpData:y,discoveredServers:x,selectedServers:T,setSelectedServers:S,loadingData:k,scanning:z,scanResult:R,scanResults:L,error:r,saveToken:p,discoverMcpData:b,runScan:I,clearCache:Y,clearingCache:G,saveTokenTimeoutRef:f,allScans:D,loadingScans:U,loadAllScans:W,selectedScan:$,setSelectedScan:A,loadingScanDetail:K,loadScanDetail:V,makeMcpRequest:_}}function Fh(){const[r,s]=P.useState("scan"),{apiToken:u,setApiToken:d,discoveredServers:p,selectedServers:f,setSelectedServers:h,loadingData:y,scanning:x,scanResult:T,scanResults:S,error:k,saveToken:b,discoverMcpData:_,runScan:z,clearCache:R,clearingCache:L,allScans:I,loadingScans:D,loadAllScans:U,selectedScan:W,setSelectedScan:$,loadingScanDetail:A,loadScanDetail:K}=Mh();return i.jsxs("div",{"data-tab-content":!0,style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column",background:o.bgPrimary},children:[i.jsx("div",{style:{background:o.bgCard,borderBottom:`1px solid ${o.borderLight}`,padding:"16px 24px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"24px",flexWrap:"wrap"},children:[i.jsx(Ch,{}),i.jsx(Th,{viewMode:r,setViewMode:s,onSwitchToScan:()=>$(null),onSwitchToList:()=>{$(null),I.length===0&&U()}}),r==="scan"&&i.jsx(jh,{apiToken:u,setApiToken:d,saveToken:b,loadingData:y,discoverMcpData:_,discoveredServers:p,selectedServers:f,setSelectedServers:h,runScan:z,scanning:x,clearCache:R,clearingCache:L})]})}),r==="scan"?i.jsx(wh,{discoveredServers:p,selectedServers:f,setSelectedServers:h,runScan:z,scanning:x,apiToken:u,error:k,scanResults:S,scanResult:T,selectedScan:W,loadingScanDetail:A,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)}}):i.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"24px",background:o.bgPrimary},children:i.jsx(bh,{error:k,loadingScans:D,selectedScan:W,loadingScanDetail:A,allScans:I,setSelectedScan:$,loadScanDetail:K,onViewScan:V=>{console.log("onViewScan - scanData:",V);const G=V.scan_id||V.id||V.hash,ue=I.find(ve=>ve.data?.scan_id===G||ve.data?.data?.scan_id===G)?.serverName||V.serverName||"Unknown Server";if(V?.data&&typeof V.data=="object"){const ve=V.data;$({...ve,scan_id:G||ve.id||ve.scan_id||ve.hash,serverName:ue})}else V&&typeof V=="object"?$({...V,scan_id:G||V.id||V.hash,serverName:ue}):console.warn("Invalid scanData structure:",V)}})})]})}const Ih=({size:r=32,className:s="",style:u={}})=>i.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 ad={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},ms={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},$h=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],ii={CSS:{},springs:{}};function Ft(r,s,u){return Math.min(Math.max(r,s),u)}function Ur(r,s){return r.indexOf(s)>-1}function ds(r,s){return r.apply(null,s)}var oe={arr:function(r){return Array.isArray(r)},obj:function(r){return Ur(Object.prototype.toString.call(r),"Object")},pth:function(r){return oe.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||oe.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 oe.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 oe.hex(r)||oe.rgb(r)||oe.hsl(r)},key:function(r){return!ad.hasOwnProperty(r)&&!ms.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function ud(r){var s=/\(([^)]+)\)/.exec(r);return s?s[1].split(",").map(function(u){return parseFloat(u)}):[]}function cd(r,s){var u=ud(r),d=Ft(oe.und(u[0])?1:u[0],.1,100),p=Ft(oe.und(u[1])?100:u[1],.1,100),f=Ft(oe.und(u[2])?10:u[2],.1,100),h=Ft(oe.und(u[3])?0:u[3],.1,100),y=Math.sqrt(p/d),x=f/(2*Math.sqrt(p*d)),T=x<1?y*Math.sqrt(1-x*x):0,S=1,k=x<1?(x*y+-h)/T:-h+y;function b(z){var R=s?s*z/1e3:z;return x<1?R=Math.exp(-R*x*y)*(S*Math.cos(T*R)+k*Math.sin(T*R)):R=(S+k*R)*Math.exp(-R*y),z===0||z===1?z:1-R}function _(){var z=ii.springs[r];if(z)return z;for(var R=1/6,L=0,I=0;;)if(L+=R,b(L)===1){if(I++,I>=16)break}else I=0;var D=L*R*1e3;return ii.springs[r]=D,D}return s?b:_}function Nh(r){return r===void 0&&(r=10),function(s){return Math.ceil(Ft(s,1e-6,1)*r)*(1/r)}}var Dh=(function(){var r=11,s=1/(r-1);function u(S,k){return 1-3*k+3*S}function d(S,k){return 3*k-6*S}function p(S){return 3*S}function f(S,k,b){return((u(k,b)*S+d(k,b))*S+p(k))*S}function h(S,k,b){return 3*u(k,b)*S*S+2*d(k,b)*S+p(k)}function y(S,k,b,_,z){var R,L,I=0;do L=k+(b-k)/2,R=f(L,_,z)-S,R>0?b=L:k=L;while(Math.abs(R)>1e-7&&++I<10);return L}function x(S,k,b,_){for(var z=0;z<4;++z){var R=h(k,b,_);if(R===0)return k;var L=f(k,b,_)-S;k-=L/R}return k}function T(S,k,b,_){if(!(0<=S&&S<=1&&0<=b&&b<=1))return;var z=new Float32Array(r);if(S!==k||b!==_)for(var R=0;R<r;++R)z[R]=f(R*s,S,b);function L(I){for(var D=0,U=1,W=r-1;U!==W&&z[U]<=I;++U)D+=s;--U;var $=(I-z[U])/(z[U+1]-z[U]),A=D+$*s,K=h(A,S,b);return K>=.001?x(I,A,S,b):K===0?A:y(I,D,D+s,S,b)}return function(I){return S===k&&b===_||I===0||I===1?I:f(L(I),k,_)}}return T})(),dd=(function(){var r={linear:function(){return function(d){return d}}},s={Sine:function(){return function(d){return 1-Math.cos(d*Math.PI/2)}},Expo:function(){return function(d){return d?Math.pow(2,10*d-10):0}},Circ:function(){return function(d){return 1-Math.sqrt(1-d*d)}},Back:function(){return function(d){return d*d*(3*d-2)}},Bounce:function(){return function(d){for(var p,f=4;d<((p=Math.pow(2,--f))-1)/11;);return 1/Math.pow(4,3-f)-7.5625*Math.pow((p*3-2)/22-d,2)}},Elastic:function(d,p){d===void 0&&(d=1),p===void 0&&(p=.5);var f=Ft(d,1,10),h=Ft(p,.1,2);return function(y){return y===0||y===1?y:-f*Math.pow(2,10*(y-1))*Math.sin((y-1-h/(Math.PI*2)*Math.asin(1/f))*(Math.PI*2)/h)}}},u=["Quad","Cubic","Quart","Quint"];return u.forEach(function(d,p){s[d]=function(){return function(f){return Math.pow(f,p+2)}}}),Object.keys(s).forEach(function(d){var p=s[d];r["easeIn"+d]=p,r["easeOut"+d]=function(f,h){return function(y){return 1-p(f,h)(1-y)}},r["easeInOut"+d]=function(f,h){return function(y){return y<.5?p(f,h)(y*2)/2:1-p(f,h)(y*-2+2)/2}},r["easeOutIn"+d]=function(f,h){return function(y){return y<.5?(1-p(f,h)(1-y*2))/2:(p(f,h)(y*2-1)+1)/2}}}),r})();function vs(r,s){if(oe.fnc(r))return r;var u=r.split("(")[0],d=dd[u],p=ud(r);switch(u){case"spring":return cd(r,s);case"cubicBezier":return ds(Dh,p);case"steps":return ds(Nh,p);default:return ds(d,p)}}function pd(r){try{var s=document.querySelectorAll(r);return s}catch{return}}function ci(r,s){for(var u=r.length,d=arguments.length>=2?arguments[1]:void 0,p=[],f=0;f<u;f++)if(f in r){var h=r[f];s.call(d,h,f,r)&&p.push(h)}return p}function di(r){return r.reduce(function(s,u){return s.concat(oe.arr(u)?di(u):u)},[])}function Ic(r){return oe.arr(r)?r:(oe.str(r)&&(r=pd(r)||r),r instanceof NodeList||r instanceof HTMLCollection?[].slice.call(r):[r])}function Ss(r,s){return r.some(function(u){return u===s})}function bs(r){var s={};for(var u in r)s[u]=r[u];return s}function fs(r,s){var u=bs(r);for(var d in r)u[d]=s.hasOwnProperty(d)?s[d]:r[d];return u}function pi(r,s){var u=bs(r);for(var d in s)u[d]=oe.und(r[d])?s[d]:r[d];return u}function Oh(r){var s=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(r);return s?"rgba("+s[1]+",1)":r}function Bh(r){var s=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,u=r.replace(s,function(y,x,T,S){return x+x+T+T+S+S}),d=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(u),p=parseInt(d[1],16),f=parseInt(d[2],16),h=parseInt(d[3],16);return"rgba("+p+","+f+","+h+",1)"}function Wh(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,d=parseInt(s[2],10)/100,p=parseInt(s[3],10)/100,f=s[4]||1;function h(b,_,z){return z<0&&(z+=1),z>1&&(z-=1),z<1/6?b+(_-b)*6*z:z<1/2?_:z<2/3?b+(_-b)*(2/3-z)*6:b}var y,x,T;if(d==0)y=x=T=p;else{var S=p<.5?p*(1+d):p+d-p*d,k=2*p-S;y=h(k,S,u+1/3),x=h(k,S,u),T=h(k,S,u-1/3)}return"rgba("+y*255+","+x*255+","+T*255+","+f+")"}function Ah(r){if(oe.rgb(r))return Oh(r);if(oe.hex(r))return Bh(r);if(oe.hsl(r))return Wh(r)}function Ut(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 Hh(r){if(Ur(r,"translate")||r==="perspective")return"px";if(Ur(r,"rotate")||Ur(r,"skew"))return"deg"}function gs(r,s){return oe.fnc(r)?r(s.target,s.id,s.total):r}function It(r,s){return r.getAttribute(s)}function ks(r,s,u){var d=Ut(s);if(Ss([u,"deg","rad","turn"],d))return s;var p=ii.CSS[s+u];if(!oe.und(p))return p;var f=100,h=document.createElement(r.tagName),y=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;y.appendChild(h),h.style.position="absolute",h.style.width=f+u;var x=f/h.offsetWidth;y.removeChild(h);var T=x*parseFloat(s);return ii.CSS[s+u]=T,T}function fd(r,s,u){if(s in r.style){var d=s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),p=r.style[s]||getComputedStyle(r).getPropertyValue(d)||"0";return u?ks(r,p,u):p}}function ws(r,s){if(oe.dom(r)&&!oe.inp(r)&&(!oe.nil(It(r,s))||oe.svg(r)&&r[s]))return"attribute";if(oe.dom(r)&&Ss($h,s))return"transform";if(oe.dom(r)&&s!=="transform"&&fd(r,s))return"css";if(r[s]!=null)return"object"}function gd(r){if(oe.dom(r)){for(var s=r.style.transform||"",u=/(\w+)\(([^)]*)\)/g,d=new Map,p;p=u.exec(s);)d.set(p[1],p[2]);return d}}function Uh(r,s,u,d){var p=Ur(s,"scale")?1:0+Hh(s),f=gd(r).get(s)||p;return u&&(u.transforms.list.set(s,f),u.transforms.last=s),d?ks(r,f,d):f}function js(r,s,u,d){switch(ws(r,s)){case"transform":return Uh(r,s,d,u);case"css":return fd(r,s,u);case"attribute":return It(r,s);default:return r[s]||0}}function Cs(r,s){var u=/^(\*=|\+=|-=)/.exec(r);if(!u)return r;var d=Ut(r)||0,p=parseFloat(s),f=parseFloat(r.replace(u[0],""));switch(u[0][0]){case"+":return p+f+d;case"-":return p-f+d;case"*":return p*f+d}}function hd(r,s){if(oe.col(r))return Ah(r);if(/\s/g.test(r))return r;var u=Ut(r),d=u?r.substr(0,r.length-u.length):r;return s?d+s:d}function Ts(r,s){return Math.sqrt(Math.pow(s.x-r.x,2)+Math.pow(s.y-r.y,2))}function Vh(r){return Math.PI*2*It(r,"r")}function Qh(r){return It(r,"width")*2+It(r,"height")*2}function Yh(r){return Ts({x:It(r,"x1"),y:It(r,"y1")},{x:It(r,"x2"),y:It(r,"y2")})}function xd(r){for(var s=r.points,u=0,d,p=0;p<s.numberOfItems;p++){var f=s.getItem(p);p>0&&(u+=Ts(d,f)),d=f}return u}function Jh(r){var s=r.points;return xd(r)+Ts(s.getItem(s.numberOfItems-1),s.getItem(0))}function yd(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return Vh(r);case"rect":return Qh(r);case"line":return Yh(r);case"polyline":return xd(r);case"polygon":return Jh(r)}}function Kh(r){var s=yd(r);return r.setAttribute("stroke-dasharray",s),s}function Gh(r){for(var s=r.parentNode;oe.svg(s)&&oe.svg(s.parentNode);)s=s.parentNode;return s}function md(r,s){var u=s||{},d=u.el||Gh(r),p=d.getBoundingClientRect(),f=It(d,"viewBox"),h=p.width,y=p.height,x=u.viewBox||(f?f.split(" "):[0,0,h,y]);return{el:d,viewBox:x,x:x[0]/1,y:x[1]/1,w:h,h:y,vW:x[2],vH:x[3]}}function Xh(r,s){var u=oe.str(r)?pd(r)[0]:r,d=s||100;return function(p){return{property:p,el:u,svg:md(u),totalLength:yd(u)*(d/100)}}}function Zh(r,s,u){function d(S){S===void 0&&(S=0);var k=s+S>=1?s+S:0;return r.el.getPointAtLength(k)}var p=md(r.el,r.svg),f=d(),h=d(-1),y=d(1),x=u?1:p.w/p.vW,T=u?1:p.h/p.vH;switch(r.property){case"x":return(f.x-p.x)*x;case"y":return(f.y-p.y)*T;case"angle":return Math.atan2(y.y-h.y,y.x-h.x)*180/Math.PI}}function $c(r,s){var u=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,d=hd(oe.pth(r)?r.totalLength:r,s)+"";return{original:d,numbers:d.match(u)?d.match(u).map(Number):[0],strings:oe.str(r)||s?d.split(u):[]}}function Ps(r){var s=r?di(oe.arr(r)?r.map(Ic):Ic(r)):[];return ci(s,function(u,d,p){return p.indexOf(u)===d})}function vd(r){var s=Ps(r);return s.map(function(u,d){return{target:u,id:d,total:s.length,transforms:{list:gd(u)}}})}function qh(r,s){var u=bs(s);if(/^spring/.test(u.easing)&&(u.duration=cd(u.easing)),oe.arr(r)){var d=r.length,p=d===2&&!oe.obj(r[0]);p?r={value:r}:oe.fnc(s.duration)||(u.duration=s.duration/d)}var f=oe.arr(r)?r:[r];return f.map(function(h,y){var x=oe.obj(h)&&!oe.pth(h)?h:{value:h};return oe.und(x.delay)&&(x.delay=y?0:s.delay),oe.und(x.endDelay)&&(x.endDelay=y===f.length-1?s.endDelay:0),x}).map(function(h){return pi(h,u)})}function ex(r){for(var s=ci(di(r.map(function(f){return Object.keys(f)})),function(f){return oe.key(f)}).reduce(function(f,h){return f.indexOf(h)<0&&f.push(h),f},[]),u={},d=function(f){var h=s[f];u[h]=r.map(function(y){var x={};for(var T in y)oe.key(T)?T==h&&(x.value=y[T]):x[T]=y[T];return x})},p=0;p<s.length;p++)d(p);return u}function tx(r,s){var u=[],d=s.keyframes;d&&(s=pi(ex(d),s));for(var p in s)oe.key(p)&&u.push({name:p,tweens:qh(s[p],r)});return u}function nx(r,s){var u={};for(var d in r){var p=gs(r[d],s);oe.arr(p)&&(p=p.map(function(f){return gs(f,s)}),p.length===1&&(p=p[0])),u[d]=p}return u.duration=parseFloat(u.duration),u.delay=parseFloat(u.delay),u}function rx(r,s){var u;return r.tweens.map(function(d){var p=nx(d,s),f=p.value,h=oe.arr(f)?f[1]:f,y=Ut(h),x=js(s.target,r.name,y,s),T=u?u.to.original:x,S=oe.arr(f)?f[0]:T,k=Ut(S)||Ut(x),b=y||k;return oe.und(h)&&(h=T),p.from=$c(S,b),p.to=$c(Cs(h,S),b),p.start=u?u.end:0,p.end=p.start+p.delay+p.duration+p.endDelay,p.easing=vs(p.easing,p.duration),p.isPath=oe.pth(f),p.isPathTargetInsideSVG=p.isPath&&oe.svg(s.target),p.isColor=oe.col(p.from.original),p.isColor&&(p.round=1),u=p,p})}var Sd={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,d,p){if(d.list.set(s,u),s===d.last||p){var f="";d.list.forEach(function(h,y){f+=y+"("+h+") "}),r.style.transform=f}}};function bd(r,s){var u=vd(r);u.forEach(function(d){for(var p in s){var f=gs(s[p],d),h=d.target,y=Ut(f),x=js(h,p,y,d),T=y||Ut(x),S=Cs(hd(f,T),x),k=ws(h,p);Sd[k](h,p,S,d.transforms,!0)}})}function ox(r,s){var u=ws(r.target,s.name);if(u){var d=rx(s,r),p=d[d.length-1];return{type:u,property:s.name,animatable:r,tweens:d,duration:p.end,delay:d[0].delay,endDelay:p.endDelay}}}function ix(r,s){return ci(di(r.map(function(u){return s.map(function(d){return ox(u,d)})})),function(u){return!oe.und(u)})}function kd(r,s){var u=r.length,d=function(f){return f.timelineOffset?f.timelineOffset:0},p={};return p.duration=u?Math.max.apply(Math,r.map(function(f){return d(f)+f.duration})):s.duration,p.delay=u?Math.min.apply(Math,r.map(function(f){return d(f)+f.delay})):s.delay,p.endDelay=u?p.duration-Math.max.apply(Math,r.map(function(f){return d(f)+f.duration-f.endDelay})):s.endDelay,p}var Nc=0;function lx(r){var s=fs(ad,r),u=fs(ms,r),d=tx(u,r),p=vd(r.targets),f=ix(p,d),h=kd(f,u),y=Nc;return Nc++,pi(s,{id:y,children:[],animatables:p,animations:f,duration:h.duration,delay:h.delay,endDelay:h.endDelay})}var Pt=[],wd=(function(){var r;function s(){!r&&(!Dc()||!fe.suspendWhenDocumentHidden)&&Pt.length>0&&(r=requestAnimationFrame(u))}function u(p){for(var f=Pt.length,h=0;h<f;){var y=Pt[h];y.paused?(Pt.splice(h,1),f--):(y.tick(p),h++)}r=h>0?requestAnimationFrame(u):void 0}function d(){fe.suspendWhenDocumentHidden&&(Dc()?r=cancelAnimationFrame(r):(Pt.forEach(function(p){return p._onDocumentVisibility()}),wd()))}return typeof document<"u"&&document.addEventListener("visibilitychange",d),s})();function Dc(){return!!document&&document.hidden}function fe(r){r===void 0&&(r={});var s=0,u=0,d=0,p,f=0,h=null;function y(D){var U=window.Promise&&new Promise(function(W){return h=W});return D.finished=U,U}var x=lx(r);y(x);function T(){var D=x.direction;D!=="alternate"&&(x.direction=D!=="normal"?"normal":"reverse"),x.reversed=!x.reversed,p.forEach(function(U){return U.reversed=x.reversed})}function S(D){return x.reversed?x.duration-D:D}function k(){s=0,u=S(x.currentTime)*(1/fe.speed)}function b(D,U){U&&U.seek(D-U.timelineOffset)}function _(D){if(x.reversePlayback)for(var W=f;W--;)b(D,p[W]);else for(var U=0;U<f;U++)b(D,p[U])}function z(D){for(var U=0,W=x.animations,$=W.length;U<$;){var A=W[U],K=A.animatable,V=A.tweens,G=V.length-1,Y=V[G];G&&(Y=ci(V,function(xe){return D<xe.end})[0]||Y);for(var ue=Ft(D-Y.start-Y.delay,0,Y.duration)/Y.duration,ve=isNaN(ue)?1:Y.easing(ue),me=Y.to.strings,Re=Y.round,Ne=[],Me=Y.to.numbers.length,he=void 0,J=0;J<Me;J++){var q=void 0,X=Y.to.numbers[J],j=Y.from.numbers[J]||0;Y.isPath?q=Zh(Y.value,ve*X,Y.isPathTargetInsideSVG):q=j+ve*(X-j),Re&&(Y.isColor&&J>2||(q=Math.round(q*Re)/Re)),Ne.push(q)}var N=me.length;if(!N)he=Ne[0];else{he=me[0];for(var ie=0;ie<N;ie++){me[ie];var ce=me[ie+1],pe=Ne[ie];isNaN(pe)||(ce?he+=pe+ce:he+=pe+" ")}}Sd[A.type](K.target,A.property,he,K.transforms),A.currentValue=he,U++}}function R(D){x[D]&&!x.passThrough&&x[D](x)}function L(){x.remaining&&x.remaining!==!0&&x.remaining--}function I(D){var U=x.duration,W=x.delay,$=U-x.endDelay,A=S(D);x.progress=Ft(A/U*100,0,100),x.reversePlayback=A<x.currentTime,p&&_(A),!x.began&&x.currentTime>0&&(x.began=!0,R("begin")),!x.loopBegan&&x.currentTime>0&&(x.loopBegan=!0,R("loopBegin")),A<=W&&x.currentTime!==0&&z(0),(A>=$&&x.currentTime!==U||!U)&&z(U),A>W&&A<$?(x.changeBegan||(x.changeBegan=!0,x.changeCompleted=!1,R("changeBegin")),R("change"),z(A)):x.changeBegan&&(x.changeCompleted=!0,x.changeBegan=!1,R("changeComplete")),x.currentTime=Ft(A,0,U),x.began&&R("update"),D>=U&&(u=0,L(),x.remaining?(s=d,R("loopComplete"),x.loopBegan=!1,x.direction==="alternate"&&T()):(x.paused=!0,x.completed||(x.completed=!0,R("loopComplete"),R("complete"),!x.passThrough&&"Promise"in window&&(h(),y(x)))))}return x.reset=function(){var D=x.direction;x.passThrough=!1,x.currentTime=0,x.progress=0,x.paused=!0,x.began=!1,x.loopBegan=!1,x.changeBegan=!1,x.completed=!1,x.changeCompleted=!1,x.reversePlayback=!1,x.reversed=D==="reverse",x.remaining=x.loop,p=x.children,f=p.length;for(var U=f;U--;)x.children[U].reset();(x.reversed&&x.loop!==!0||D==="alternate"&&x.loop===1)&&x.remaining++,z(x.reversed?x.duration:0)},x._onDocumentVisibility=k,x.set=function(D,U){return bd(D,U),x},x.tick=function(D){d=D,s||(s=d),I((d+(u-s))*fe.speed)},x.seek=function(D){I(S(D))},x.pause=function(){x.paused=!0,k()},x.play=function(){x.paused&&(x.completed&&x.reset(),x.paused=!1,Pt.push(x),k(),wd())},x.reverse=function(){T(),x.completed=!x.reversed,k()},x.restart=function(){x.reset(),x.play()},x.remove=function(D){var U=Ps(D);jd(U,x)},x.reset(),x.autoplay&&x.play(),x}function Oc(r,s){for(var u=s.length;u--;)Ss(r,s[u].animatable.target)&&s.splice(u,1)}function jd(r,s){var u=s.animations,d=s.children;Oc(r,u);for(var p=d.length;p--;){var f=d[p],h=f.animations;Oc(r,h),!h.length&&!f.children.length&&d.splice(p,1)}!u.length&&!d.length&&s.pause()}function sx(r){for(var s=Ps(r),u=Pt.length;u--;){var d=Pt[u];jd(s,d)}}function ax(r,s){s===void 0&&(s={});var u=s.direction||"normal",d=s.easing?vs(s.easing):null,p=s.grid,f=s.axis,h=s.from||0,y=h==="first",x=h==="center",T=h==="last",S=oe.arr(r),k=parseFloat(S?r[0]:r),b=S?parseFloat(r[1]):0,_=Ut(S?r[1]:r)||0,z=s.start||0+(S?k:0),R=[],L=0;return function(I,D,U){if(y&&(h=0),x&&(h=(U-1)/2),T&&(h=U-1),!R.length){for(var W=0;W<U;W++){if(!p)R.push(Math.abs(h-W));else{var $=x?(p[0]-1)/2:h%p[0],A=x?(p[1]-1)/2:Math.floor(h/p[0]),K=W%p[0],V=Math.floor(W/p[0]),G=$-K,Y=A-V,ue=Math.sqrt(G*G+Y*Y);f==="x"&&(ue=-G),f==="y"&&(ue=-Y),R.push(ue)}L=Math.max.apply(Math,R)}d&&(R=R.map(function(me){return d(me/L)*L})),u==="reverse"&&(R=R.map(function(me){return f?me<0?me*-1:-me:Math.abs(L-me)}))}var ve=S?(b-k)/L:k;return z+ve*(Math.round(R[D]*100)/100)+_}}function ux(r){r===void 0&&(r={});var s=fe(r);return s.duration=0,s.add=function(u,d){var p=Pt.indexOf(s),f=s.children;p>-1&&Pt.splice(p,1);function h(b){b.passThrough=!0}for(var y=0;y<f.length;y++)h(f[y]);var x=pi(u,fs(ms,r));x.targets=x.targets||r.targets;var T=s.duration;x.autoplay=!1,x.direction=s.direction,x.timelineOffset=oe.und(d)?T:Cs(d,T),h(s),s.seek(x.timelineOffset);var S=fe(x);h(S),f.push(S);var k=kd(f,r);return s.delay=k.delay,s.endDelay=k.endDelay,s.duration=k.duration,s.seek(0),s.reset(),s.autoplay&&s.play(),s},s}fe.version="3.2.1";fe.speed=1;fe.suspendWhenDocumentHidden=!0;fe.running=Pt;fe.remove=sx;fe.get=js;fe.set=bd;fe.convertPx=ks;fe.path=Xh;fe.setDashoffset=Kh;fe.stagger=ax;fe.timeline=ux;fe.easing=vs;fe.penner=dd;fe.random=function(r,s){return Math.floor(Math.random()*(s-r+1))+r};function cx({tabs:r,activeTab:s,onTabChange:u,tabRefs:d,indicatorRef:p}){return P.useEffect(()=>{const f=d.current[s];if(f&&p.current){const{offsetLeft:h,offsetWidth:y}=f;fe({targets:p.current,left:h,width:y,duration:400,easing:"easeOutExpo"})}},[s,d,p]),i.jsxs("div",{style:{position:"relative",display:"flex",flex:1},children:[r.map(f=>i.jsxs("button",{type:"button",ref:h=>{h&&(d.current[f.id]=h)},"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:h=>{s!==f.id&&fe({targets:h.currentTarget,background:o.bgHover,color:o.textPrimary,duration:200,easing:"easeOutQuad"})},onMouseLeave:h=>{s!==f.id&&fe({targets:h.currentTarget,background:"transparent",color:o.textSecondary,duration:200,easing:"easeOutQuad"})},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("div",{style:{display:"flex",alignItems:"center",color:"currentColor"},children:i.jsx(f.icon,{size:16})}),i.jsx("span",{children:f.label})]}),i.jsx("div",{style:{fontSize:"11px",color:s===f.id?o.textSecondary:o.textTertiary,fontWeight:"400",fontFamily:v.body},children:f.description})]},f.id)),i.jsx("div",{ref:p,style:{position:"absolute",bottom:0,height:"3px",background:o.accentBlue,borderRadius:"3px 3px 0 0",zIndex:2,pointerEvents:"none"}})]})}const dx=({size:r=16,color:s="currentColor"})=>i.jsx(ed,{size:r,stroke:1.5,color:s}),px=({size:r=16,color:s="currentColor"})=>i.jsx(ag,{size:r,stroke:1.5,color:s}),fx=({size:r=16,color:s="currentColor"})=>i.jsx(jg,{size:r,stroke:1.5,color:s}),gx=({size:r=16,color:s="currentColor"})=>i.jsx(Kf,{size:r,stroke:1.5,color:s}),hx=({size:r=16,color:s="currentColor"})=>i.jsx(nd,{size:r,stroke:1.5,color:s}),xx=({size:r=16,color:s="currentColor"})=>i.jsx(gg,{size:r,stroke:1.5,color:s}),yx=({size:r=16,color:s="currentColor"})=>i.jsx(xs,{size:r,stroke:1.5,color:s});function mx({tabs:r,activeTab:s,onTabChange:u,isDropdownOpen:d,setIsDropdownOpen:p,dropdownRef:f}){return i.jsxs("div",{style:{position:"relative",flex:1,display:"flex",justifyContent:"flex-end"},ref:f,children:[i.jsxs("button",{type:"button",onClick:()=>p(!d),style:{display:"flex",alignItems:"center",gap:"8px",padding:"10px 16px",background:d?o.bgSecondary:"transparent",border:"none",borderRadius:"8px",color:o.textPrimary,cursor:"pointer",fontSize:"14px",fontFamily:v.body,fontWeight:"500"},onMouseEnter:h=>{d||(h.currentTarget.style.background=o.bgHover)},onMouseLeave:h=>{d||(h.currentTarget.style.background="transparent")},children:[i.jsx(xx,{size:18,color:o.textPrimary}),i.jsx("span",{children:r.find(h=>h.id===s)?.label||"Menu"}),i.jsx("div",{style:{transform:d?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",display:"flex",alignItems:"center"},children:i.jsx(yx,{size:14,color:o.textPrimary})})]}),d&&i.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(h=>{const y=h.icon;return i.jsxs("button",{type:"button",onClick:()=>{u(h.id),p(!1)},style:{width:"100%",padding:"14px 16px",background:s===h.id?o.bgSecondary:"transparent",border:"none",borderLeft:s===h.id?`3px solid ${o.accentBlue}`:"3px solid transparent",color:s===h.id?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:s===h.id?"600":"400",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",textAlign:"left",transition:"all 0.2s"},onMouseEnter:x=>{s!==h.id&&(x.currentTarget.style.background=o.bgHover,x.currentTarget.style.color=o.textPrimary)},onMouseLeave:x=>{s!==h.id&&(x.currentTarget.style.background="transparent",x.currentTarget.style.color=o.textSecondary)},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",width:"100%"},children:[i.jsx("div",{style:{display:"flex",alignItems:"center",color:"currentColor"},children:i.jsx(y,{size:16})}),i.jsx("span",{style:{flex:1},children:h.label})]}),i.jsx("div",{style:{fontSize:"11px",color:s===h.id?o.textSecondary:o.textTertiary,fontWeight:"400",fontFamily:v.body,marginLeft:"26px"},children:h.description})]},h.id)})})]})}function vx({activeTab:r,onTabChange:s}){const u=[{id:"traffic",label:"Traffic Capture",icon:dx,description:"Wireshark-like HTTP request/response analysis for forensic investigation"},{id:"logs",label:"MCP Shark Logs",icon:px,description:"View MCP Shark server console output and debug logs"},{id:"setup",label:"MCP Server Setup",icon:fx,description:"Configure and manage MCP Shark server"},{id:"playground",label:"MCP Playground",icon:gx,description:"Test and interact with MCP tools, prompts, and resources"},{id:"smart-scan",label:"Smart Scan",icon:hx,description:"AI-powered security analysis for MCP servers"}],d=P.useRef({}),p=P.useRef(null),[f,h]=P.useState(!1),[y,x]=P.useState(!1),T=P.useRef(null);return P.useEffect(()=>{const S=()=>{h(window.innerWidth<1200)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]),P.useEffect(()=>{const S=k=>{T.current&&!T.current.contains(k.target)&&x(!1)};return y&&document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)}},[y]),i.jsx("div",{style:{borderBottom:`1px solid ${o.borderLight}`,background:o.bgCard,boxShadow:`0 1px 3px ${o.shadowSm}`},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 16px",gap:"12px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",paddingRight:"12px",borderRight:`1px solid ${o.borderLight}`},children:[i.jsx(Ih,{size:24}),i.jsx("span",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body},children:"MCP Shark"})]}),f?i.jsx(mx,{tabs:u,activeTab:r,onTabChange:s,isDropdownOpen:y,setIsDropdownOpen:x,dropdownRef:T}):i.jsx(cx,{tabs:u,activeTab:r,onTabChange:s,tabRefs:d,indicatorRef:p})]})})}function Sx(){const r=()=>{window.open("/api-docs","_blank")};return i.jsx("button",{type:"button",onClick:r,"data-tour":"api-docs-button",style:{position:"fixed",bottom:"20px",right:"80px",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:"View API Documentation",children:i.jsx(Vf,{size:20,stroke:1.5})})}const bx=({size:r=16,color:s="currentColor"})=>i.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:[i.jsx("title",{children:"Tour icon"}),i.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),i.jsx("path",{d:"M2 17l10 5 10-5"}),i.jsx("path",{d:"M2 12l10 5 10-5"})]});function kx({onClick:r}){return i.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:i.jsx(bx,{size:20})})}const wx=({size:r=12,color:s="currentColor"})=>i.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:[i.jsx("title",{children:"Chevron icon"}),i.jsx("polyline",{points:"6 9 12 15 18 9"})]});function gn({title:r,children:s,titleColor:u=o.accentBlue,defaultExpanded:d=!0}){const[p,f]=P.useState(d);return i.jsxs("div",{style:{marginBottom:"16px"},children:[i.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(!p),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f(!p))},onMouseEnter:h=>{h.currentTarget.style.color=u===o.accentBlue?o.accentBlueHover:u},onMouseLeave:h=>{h.currentTarget.style.color=u},children:[i.jsx("span",{style:{transform:p?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease",display:"inline-block"},children:i.jsx(wx,{size:12,color:u})}),r]}),p&&i.jsx("div",{style:{paddingLeft:"20px",color:o.textPrimary,fontFamily:v.body,fontSize:"12px",lineHeight:"1.6"},children:s})]})}function Cd({body:r,title:s,titleColor:u}){return r?i.jsx(gn,{title:s||"Body",titleColor:u,children:i.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 Td({title:r,titleColor:s,children:u,defaultExpanded:d=!0}){const[p,f]=P.useState(d);return i.jsxs("div",{style:{background:o.bgCard,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden",marginBottom:"20px"},children:[i.jsx("button",{type:"button",onClick:()=>f(!p),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f(!p))},"aria-label":`Toggle ${r} section`,style:{padding:"16px 20px",background:p?o.bgCard:o.bgSecondary,borderBottom:p?`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:h=>{h.currentTarget.style.background=o.bgHover},onMouseLeave:h=>{h.currentTarget.style.background=p?o.bgCard:o.bgSecondary},children:i.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:s,textTransform:"uppercase",letterSpacing:"0.05em",fontFamily:v.body,display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx(xs,{size:14,stroke:1.5,style:{transform:p?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease"}}),r]})}),p&&i.jsx("div",{style:{padding:"20px"},children:u})]})}function Pd({headers:r,titleColor:s}){return!r||Object.keys(r).length===0?null:i.jsx(gn,{title:"Headers",children:Object.entries(r).map(([u,d])=>i.jsxs("div",{style:{marginBottom:"6px",fontSize:"12px",fontFamily:v.body},children:[i.jsxs("span",{style:{color:s,fontWeight:"500",fontFamily:v.mono},children:[u,":"]})," ",i.jsx("span",{style:{color:o.textPrimary},children:String(d)})]},u))})}function Bc(r,s){if(!(r.session_id===s.session_id))return!1;const d=li(r),p=li(s);return!d||!p?r.jsonrpc_id&&s.jsonrpc_id?r.jsonrpc_id===s.jsonrpc_id:!1:d===p?r.jsonrpc_id&&s.jsonrpc_id?r.jsonrpc_id===s.jsonrpc_id:!0:!1}function _d(r){const s=[],u=new Set;return r.forEach(d=>{if(!u.has(d.frame_number))if(d.direction==="request"){const p=r.find(f=>f.direction==="response"&&!u.has(f.frame_number)&&Bc(d,f)&&f.frame_number>d.frame_number);p?(s.push({request:d,response:p,frame_number:d.frame_number}),u.add(d.frame_number),u.add(p.frame_number)):(s.push({request:d,response:null,frame_number:d.frame_number}),u.add(d.frame_number))}else d.direction==="response"&&(r.find(f=>f.direction==="request"&&!u.has(f.frame_number)&&Bc(f,d)&&f.frame_number<d.frame_number)||(s.push({request:null,response:d,frame_number:d.frame_number}),u.add(d.frame_number)))}),s.sort((d,p)=>p.frame_number-d.frame_number)}const Wc="LLM Server";function _s(r,s){return s?((new Date(r)-new Date(s))/1e3).toFixed(6):"0.000000"}function Ls(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 zs(r){return r.direction==="request"?{source:Wc,dest:r.remote_address||"Unknown MCP Client"}:{source:r.remote_address||"Unknown MCP Server",dest:Wc}}function fi(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,d=u.match(/^https?:\/\/[^\/]+(\/.*)$/);return d?d[1]:u}}return"-"}function jx(r){if(r.direction==="request"){const d=fi(r),p=r.method||"",f=r.url||"";return d&&d!=="-"?p&&f?`${p} ${d}`:p?`${p} ${d}`:d:p&&f?`${p} ${f}`:p||f||"Request"}const s=r.status_code||"",u=r.jsonrpc_method||li(r);return s&&u?`${s} ${u}`:s?`Status: ${s}`:u||"Response"}function li(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 Ld({data:r,titleColor:s}){if(!r)return null;const u=jx(r);return i.jsx(gn,{title:"Info",titleColor:s,defaultExpanded:!1,children:i.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 zd({data:r,showUserAgent:s=!1}){return i.jsxs(gn,{title:"Network Information",children:[i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Remote Address:"," ",i.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.remote_address||"N/A"})]}),i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Host:"," ",i.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.host||"N/A"})]}),s&&r.user_agent&&i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["User Agent:"," ",i.jsx("span",{style:{color:o.textSecondary,fontSize:"11px"},children:r.user_agent})]}),r.session_id&&i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Session ID:"," ",i.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.session_id})]})]})}function Ed({data:r,titleColor:s}){return i.jsxs(gn,{title:`${r.protocol||"HTTP"} Protocol`,children:[i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Direction: ",i.jsx("span",{style:{color:s,fontWeight:"500"},children:r.direction})]}),r.status_code&&i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["Status Code:"," ",i.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&&i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["JSON-RPC Method:"," ",i.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.jsonrpc_method})]}),r.jsonrpc_id&&i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:v.body,marginBottom:"4px"},children:["JSON-RPC ID:"," ",i.jsx("span",{style:{color:o.textSecondary,fontFamily:v.mono},children:r.jsonrpc_id})]})]})}function Cx({request:r,requestHeaders:s,requestBody:u}){return r?i.jsxs(Td,{title:"Request",titleColor:o.accentBlue,defaultExpanded:!0,children:[i.jsx(Ld,{data:r,titleColor:o.accentBlue}),i.jsx(zd,{data:r,showUserAgent:!0}),i.jsx(Ed,{data:r,titleColor:o.accentBlue}),i.jsx(Pd,{headers:s,titleColor:o.accentBlue}),i.jsx(Cd,{body:u,titleColor:o.accentBlue}),r.jsonrpc_params&&i.jsx(gn,{title:"JSON-RPC Params",titleColor:o.accentBlue,children:i.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 Tx({response:r,responseHeaders:s,responseBody:u}){return r?i.jsxs(Td,{title:"Response",titleColor:o.accentGreen,defaultExpanded:!0,children:[i.jsx(Ld,{data:r,titleColor:o.accentGreen}),i.jsx(zd,{data:r}),i.jsx(Ed,{data:r,titleColor:o.accentGreen}),i.jsx(Pd,{headers:s,titleColor:o.accentGreen}),i.jsx(Cd,{body:u,titleColor:o.accentGreen}),r.jsonrpc_result&&i.jsx(gn,{title:"JSON-RPC Result",titleColor:o.accentGreen,children:i.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&&i.jsx(gn,{title:"JSON-RPC Error",titleColor:o.error,children:i.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 Px({request:r,response:s,requestHeaders:u,requestBody:d,responseHeaders:p,responseBody:f}){return i.jsx("div",{style:{padding:"20px",overflow:"auto",flex:1,background:o.bgPrimary},children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[i.jsx(Cx,{request:r,requestHeaders:u,requestBody:d}),i.jsx(Tx,{response:s,responseHeaders:p,responseBody:f})]})})}const _x=({size:r=14,color:s="currentColor",rotated:u=!1})=>i.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:[i.jsx("title",{children:"Chevron down icon"}),i.jsx("polyline",{points:"6 9 12 15 18 9"})]});function Ac({title:r,titleColor:s,children:u,defaultExpanded:d=!0}){const[p,f]=P.useState(d);return i.jsxs("div",{style:{background:o.bgCard,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden",marginBottom:"20px"},children:[i.jsx("button",{type:"button",onClick:()=>f(!p),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f(!p))},style:{padding:"16px 20px",background:p?o.bgCard:o.bgSecondary,borderBottom:p?`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:h=>{h.currentTarget.style.background=o.bgHover},onMouseLeave:h=>{h.currentTarget.style.background=p?o.bgCard:o.bgSecondary},children:i.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:s,textTransform:"uppercase",letterSpacing:"0.05em",fontFamily:v.body,display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx(_x,{size:14,color:s,rotated:!p}),r]})}),p&&i.jsx("div",{style:{padding:"20px"},children:u})]})}function Lx({requestHexLines:r,responseHexLines:s,hasRequest:u,hasResponse:d}){return i.jsx("div",{style:{padding:"20px",overflow:"auto",flex:1,background:o.bgPrimary},children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[u&&i.jsx(Ac,{title:"Request Hex Dump",titleColor:o.accentBlue,defaultExpanded:!0,children:i.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((p,f)=>i.jsxs("div",{style:{display:"flex",gap:"16px",padding:"4px 0",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",lineHeight:"1.5"},children:[i.jsx("span",{style:{color:o.textTertiary,minWidth:"80px"},children:p.offset}),i.jsx("span",{style:{minWidth:"400px",color:o.textPrimary},children:p.hex.padEnd(48)}),i.jsx("span",{style:{color:o.textSecondary},children:p.ascii})]},`request-${p.offset}-${f}`)):i.jsx("div",{style:{color:o.textTertiary,fontFamily:v.body,fontSize:"12px"},children:"(empty)"})})}),d&&i.jsx(Ac,{title:"Response Hex Dump",titleColor:o.accentGreen,defaultExpanded:!0,children:i.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((p,f)=>i.jsxs("div",{style:{display:"flex",gap:"16px",padding:"4px 0",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",lineHeight:"1.5"},children:[i.jsx("span",{style:{color:o.textTertiary,minWidth:"80px"},children:p.offset}),i.jsx("span",{style:{minWidth:"400px",color:o.textPrimary},children:p.hex.padEnd(48)}),i.jsx("span",{style:{color:o.textSecondary},children:p.ascii})]},`response-${p.offset}-${f}`)):i.jsx("div",{style:{color:o.textTertiary,fontFamily:v.body,fontSize:"12px"},children:"(empty)"})})})]})})}function zx({request:r,onClose:s,matchingPair:u}){const d=p=>p<1024?`${p} B`:p<1048576?`${(p/1024).toFixed(2)} KB`:`${(p/1048576).toFixed(2)} MB`;return i.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:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[i.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&&i.jsxs("span",{style:{fontSize:"11px",color:o.textTertiary,fontWeight:"400",marginLeft:"8px"},children:["(with #",u.frame_number,")"]})]}),i.jsxs("span",{style:{fontSize:"11px",color:o.textSecondary,padding:"4px 8px",background:o.bgSecondary,borderRadius:"8px",fontFamily:v.mono},children:[d(r.length)," bytes"]})]}),i.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:p=>{p.currentTarget.style.background=o.bgHover,p.currentTarget.style.color=o.textPrimary},onMouseLeave:p=>{p.currentTarget.style.background="none",p.currentTarget.style.color=o.textSecondary},children:i.jsx(rd,{size:20,stroke:1.5})})]})}const Ex=({size:r=14,color:s="currentColor",rotated:u=!1})=>i.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:[i.jsx("title",{children:"Chevron down icon"}),i.jsx("polyline",{points:"6 9 12 15 18 9"})]});function Hc({title:r,titleColor:s,children:u,defaultExpanded:d=!0}){const[p,f]=P.useState(d);return i.jsxs("div",{style:{background:o.bgCard,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden",marginBottom:"20px"},children:[i.jsx("button",{type:"button",onClick:()=>f(!p),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f(!p))},style:{padding:"16px 20px",background:p?o.bgCard:o.bgSecondary,borderBottom:p?`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:h=>{h.currentTarget.style.background=o.bgHover},onMouseLeave:h=>{h.currentTarget.style.background=p?o.bgCard:o.bgSecondary},children:i.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:s,textTransform:"uppercase",letterSpacing:"0.05em",fontFamily:v.body,display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx(Ex,{size:14,color:s,rotated:!p}),r]})}),p&&i.jsx("div",{style:{padding:"20px"},children:u})]})}function Rx({requestFullText:r,responseFullText:s,hasRequest:u,hasResponse:d}){return i.jsx("div",{style:{padding:"20px",overflow:"auto",flex:1,background:o.bgPrimary},children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[u&&i.jsx(Hc,{title:"Raw Request Data",titleColor:o.accentBlue,defaultExpanded:!0,children:i.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)"})}),d&&i.jsx(Hc,{title:"Raw Response Data",titleColor:o.accentGreen,defaultExpanded:!0,children:i.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 Mx({tabs:r,activeTab:s,onTabChange:u}){const d=P.useRef({}),p=P.useRef(null);return P.useEffect(()=>{const f=d.current[s];if(f&&p.current){const{offsetLeft:h,offsetWidth:y}=f;fe({targets:p.current,left:h,width:y,duration:300,easing:"easeOutExpo"})}},[s]),i.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=>i.jsx("button",{type:"button",ref:h=>{h&&(d.current[f]=h)},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:h=>{s!==f&&fe({targets:h.currentTarget,background:o.bgHover,color:o.textPrimary,duration:200,easing:"easeOutQuad"})},onMouseLeave:h=>{s!==f&&fe({targets:h.currentTarget,background:"transparent",color:o.textSecondary,duration:200,easing:"easeOutQuad"})},children:f},f)),i.jsx("div",{ref:p,style:{position:"absolute",bottom:0,height:"2px",background:o.accentBlue,borderRadius:"2px 2px 0 0",zIndex:2}})]})}const Uc=(r,s={})=>fe({targets:r,opacity:[0,1],translateY:[20,0],duration:s.duration||400,delay:fe.stagger(s.delay||50),easing:s.easing||"easeOutExpo",...s}),Es=(r,s={})=>fe({targets:r,opacity:[0,1],duration:s.duration||300,easing:s.easing||"easeOutQuad",...s}),Fx=(r,s={})=>fe({targets:r,translateX:[s.width||600,0],opacity:[0,1],duration:s.duration||400,easing:s.easing||"easeOutExpo",...s});function Vc(r){if(!r)return[];const s=new TextEncoder().encode(r),u=[],d=16,p=Math.ceil(s.length/d);for(const f of Array.from({length:p},(h,y)=>y)){const h=f*d,y=s.slice(h,h+d),x=Array.from(y).map(k=>k.toString(16).padStart(2,"0")).join(" "),T=Array.from(y).map(k=>k>=32&&k<127?String.fromCharCode(k):".").join(""),S=h.toString(16).padStart(8,"0");u.push({offset:S,hex:x,ascii:T})}return u}function Qc(r,s){return Object.entries(r).map(([d,p])=>`${d}: ${p}`).join(`\r
|
|
28
|
+
`)+(s?`\r
|
|
29
|
+
\r
|
|
30
|
+
${s}`:"")}function Ix({request:r,onClose:s,requests:u=[]}){const[d,p]=P.useState("details"),f=P.useRef(null),h=P.useRef(d);if(P.useEffect(()=>{h.current!==d&&f.current&&(Es(f.current,{duration:300}),h.current=d)},[d]),!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},T=(()=>{const W=($,A)=>{if($.session_id!==A.session_id)return!1;const K=y($),V=y(A);return!K||!V?$.jsonrpc_id&&A.jsonrpc_id?$.jsonrpc_id===A.jsonrpc_id:!1:K!==V?!1:$.jsonrpc_id&&A.jsonrpc_id?$.jsonrpc_id===A.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:T||r,k=r.direction==="response"?r:T,b=S?.headers_json?JSON.parse(S.headers_json):{},_=S?.body_json?JSON.parse(S.body_json):S?.body_raw,z=S?Qc(b,S.body_raw):"",R=S?Vc(z):[],L=k?.headers_json?JSON.parse(k.headers_json):{},I=k?.body_json?JSON.parse(k.body_json):k?.body_raw,D=k?Qc(L,k.body_raw):"",U=k?Vc(D):[];return i.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",background:o.bgPrimary},children:[i.jsx(zx,{request:r,onClose:s,matchingPair:T}),i.jsx(Mx,{tabs:["details","hex","raw"],activeTab:d,onTabChange:p}),i.jsxs("div",{ref:f,style:{flex:1,overflow:"auto",background:o.bgPrimary},children:[d==="details"&&i.jsx(Px,{request:S,response:k,requestHeaders:b,requestBody:_,responseHeaders:L,responseBody:I}),d==="hex"&&i.jsx(Lx,{requestHexLines:R,responseHexLines:U,hasRequest:!!S,hasResponse:!!k}),d==="raw"&&i.jsx(Rx,{requestFullText:z,responseFullText:D,hasRequest:!!S,hasResponse:!!k})]})]})}function $x({isOpen:r,onClose:s,title:u,message:d,type:p="error"}){if(!r)return null;const f=p==="error";return i.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:h=>{(h.key==="Escape"||h.key==="Enter")&&s()},children:i.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:h=>h.stopPropagation(),onKeyDown:h=>h.stopPropagation(),children:[i.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:"18px",fontWeight:"600",color:f?o.error:o.textPrimary},children:u||(f?"Error":"Information")}),i.jsx("p",{style:{margin:"0 0 24px 0",fontSize:"14px",color:o.textSecondary,lineHeight:"1.5"},children:d}),i.jsx("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:i.jsx("button",{type:"button",onClick:s,style:{padding:"10px 20px",background:f?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:h=>{h.currentTarget.style.background=f?o.buttonDangerHover:o.buttonPrimaryHover},onMouseLeave:h=>{h.currentTarget.style.background=f?o.buttonDanger:o.buttonPrimary},children:"OK"})})]})})}function Nx({stats:r,onExport:s}){return i.jsxs("div",{style:{display:"flex",gap:"16px",alignItems:"center",marginLeft:"auto"},children:[r&&i.jsxs(i.Fragment,{children:[i.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Total:"," ",i.jsx("span",{style:{color:o.textPrimary,fontWeight:"500"},children:r.total_packets||0})]}),i.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Requests:"," ",i.jsx("span",{style:{color:o.accentBlue,fontWeight:"500"},children:r.total_requests||0})]}),i.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Responses:"," ",i.jsx("span",{style:{color:o.accentGreen,fontWeight:"500"},children:r.total_responses||0})]}),i.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Errors:"," ",i.jsx("span",{style:{color:o.error,fontWeight:"500"},children:r.total_errors||0})]}),i.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:v.body},children:["Sessions:"," ",i.jsx("span",{style:{color:o.textPrimary,fontWeight:"500"},children:r.unique_sessions||0})]})]}),i.jsxs("div",{style:{display:"flex",gap:"6px",alignItems:"center",marginLeft:"12px",paddingLeft:"12px",borderLeft:`1px solid ${o.borderLight}`},children:[i.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=>{fe({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=>{fe({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:[i.jsx(Zc,{size:14,stroke:1.5}),"Export"]}),i.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:[i.jsx("option",{value:"",disabled:!0,children:"Format"}),i.jsx("option",{value:"json",children:"JSON"}),i.jsx("option",{value:"csv",children:"CSV"}),i.jsx("option",{value:"txt",children:"TXT"})]})]})]})}function _n({type:r="text",placeholder:s,value:u,onChange:d,style:p={},...f}){const h={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",...p},y=T=>{fe({targets:T.currentTarget,borderColor:o.accentBlue,boxShadow:[`0 0 0 0px ${o.accentBlue}20`,`0 0 0 3px ${o.accentBlue}20`],duration:200,easing:"easeOutQuad"})},x=T=>{fe({targets:T.currentTarget,borderColor:o.borderLight,boxShadow:"none",duration:200,easing:"easeOutQuad"})};return i.jsx("input",{type:r,placeholder:s,value:u||"",onChange:d,style:h,onFocus:y,onBlur:x,...f})}function Dx({filters:r,onFilterChange:s,stats:u,onClear:d}){const p=P.useRef(null),[f,h]=P.useState(!1),[y,x]=P.useState(!1),[T,S]=P.useState("");P.useEffect(()=>{p.current&&Es(p.current,{duration:400})},[]);const k=async(b="json")=>{try{const _=new URLSearchParams;r.search&&_.append("search",r.search),r.serverName&&_.append("serverName",r.serverName),r.sessionId&&_.append("sessionId",r.sessionId),r.method&&_.append("method",r.method),r.jsonrpcMethod&&_.append("jsonrpcMethod",r.jsonrpcMethod),r.statusCode&&_.append("statusCode",r.statusCode),r.jsonrpcId&&_.append("jsonrpcId",r.jsonrpcId),_.append("format",b);const R=await(await fetch(`/api/requests/export?${_}`)).blob(),L=window.URL.createObjectURL(R),I=document.createElement("a");I.href=L;const D=b==="csv"?"csv":b==="txt"?"txt":"json";I.download=`mcp-shark-traffic-${new Date().toISOString().replace(/[:.]/g,"-")}.${D}`,document.body.appendChild(I),I.click(),window.URL.revokeObjectURL(L),document.body.removeChild(I)}catch(_){console.error("Failed to export traffic:",_),S("Failed to export traffic. Please try again."),x(!0)}};return i.jsxs("div",{ref:p,"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:[i.jsxs("div",{style:{position:"relative",width:"300px"},children:[i.jsx(td,{size:16,stroke:1.5,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:o.textTertiary,pointerEvents:"none",zIndex:1}}),i.jsx(_n,{type:"text",placeholder:"Search everything (partial match)...",value:r.search||"",onChange:b=>s({...r,search:b.target.value||null}),style:{width:"100%",fontWeight:r.search?"500":"400",paddingLeft:"36px"}})]}),i.jsx(_n,{type:"text",placeholder:"MCP Server Name...",value:r.serverName||"",onChange:b=>s({...r,serverName:b.target.value||null}),style:{width:"200px"}}),i.jsx(_n,{type:"text",placeholder:"Session ID...",value:r.sessionId||"",onChange:b=>s({...r,sessionId:b.target.value||null}),style:{width:"200px"}}),i.jsx(_n,{type:"text",placeholder:"HTTP Method...",value:r.method||"",onChange:b=>s({...r,method:b.target.value||null}),style:{width:"150px"}}),i.jsx(_n,{type:"text",placeholder:"JSON-RPC Method...",value:r.jsonrpcMethod||"",onChange:b=>s({...r,jsonrpcMethod:b.target.value||null}),style:{width:"200px"}}),i.jsx(_n,{type:"number",placeholder:"Status Code...",value:r.statusCode||"",onChange:b=>s({...r,statusCode:b.target.value?Number.parseInt(b.target.value):null}),style:{width:"120px"}}),i.jsx(_n,{type:"text",placeholder:"JSON-RPC ID...",value:r.jsonrpcId||"",onChange:b=>s({...r,jsonrpcId:b.target.value||null}),style:{width:"150px"}}),i.jsx(Nx,{stats:u,onExport:k}),i.jsxs("button",{type:"button",onClick:()=>h(!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:b=>{fe({targets:b.currentTarget,background:o.buttonDangerHover,translateY:-1,boxShadow:[`0 2px 4px ${o.shadowSm}`,`0 4px 8px ${o.shadowMd}`],duration:200,easing:"easeOutQuad"})},onMouseLeave:b=>{fe({targets:b.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:[i.jsx(si,{size:14,stroke:1.5}),"Clear"]}),i.jsx(ai,{isOpen:f,onClose:()=>h(!1),onConfirm:async()=>{try{const b=await fetch("/api/requests/clear",{method:"POST"});if(b.ok)d&&d();else{const _=await b.json();S(`Failed to clear traffic: ${_.error||"Unknown error"}`),x(!0)}}catch(b){console.error("Failed to clear traffic:",b),S("Failed to clear traffic. Please try again."),x(!0)}},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}),i.jsx($x,{isOpen:y,onClose:()=>x(!1),title:"Error",message:T,type:"error"})]})}const Te={LIFECYCLE:"lifecycle",TOOLS:"tools",RESOURCES:"resources",PROMPTS:"prompts",NOTIFICATIONS:"notifications",CLIENT_FEATURES:"client-features",OTHER:"other"};function Ox(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 Bx(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 Wx(r){return{[Te.LIFECYCLE]:ri,[Te.TOOLS]:Pg,[Te.RESOURCES]:rg,[Te.PROMPTS]:xg,[Te.NOTIFICATIONS]:Yf,[Te.CLIENT_FEATURES]:zg,[Te.OTHER]:Fc}[r]||Fc}function Ax(r){const s=_d(r),u=new Map;return s.forEach(d=>{const p=d.request||d.response;if(!p)return;const f=p.session_id||"__NO_SESSION__",h=li(p),y=Ox(h||"");u.has(f)||u.set(f,{sessionId:f==="__NO_SESSION__"?null:f,categories:new Map,firstTimestamp:p.timestamp_iso});const x=u.get(f);x.categories.has(y)||x.categories.set(y,[]),x.categories.get(y).push(d),new Date(p.timestamp_iso)<new Date(x.firstTimestamp)&&(x.firstTimestamp=p.timestamp_iso)}),Array.from(u.entries()).map(([d,p])=>({sessionId:p.sessionId,firstTimestamp:p.firstTimestamp,categories:Array.from(p.categories.entries()).map(([f,h])=>({category:f,label:Bx(f),pairs:h.sort((y,x)=>{const T=(y.request||y.response)?.timestamp_iso||"",S=(x.request||x.response)?.timestamp_iso||"";return new Date(T)-new Date(S)})})).sort((f,h)=>{const y=[Te.LIFECYCLE,Te.TOOLS,Te.RESOURCES,Te.PROMPTS,Te.NOTIFICATIONS,Te.CLIENT_FEATURES,Te.OTHER],x=y.indexOf(f.category),T=y.indexOf(h.category);return x-T})})).sort((d,p)=>new Date(p.firstTimestamp)-new Date(d.firstTimestamp))}const Hx=({size:r=12,color:s="currentColor"})=>i.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:[i.jsx("title",{children:"Chevron down icon"}),i.jsx("polyline",{points:"6 9 12 15 18 9"})]}),Ux=({size:r=12,color:s="currentColor"})=>i.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:[i.jsx("title",{children:"Chevron right icon"}),i.jsx("polyline",{points:"9 18 15 12 9 6"})]});function Yc({children:r,onClick:s,isExpanded:u,indent:d=0}){return i.jsx("tr",{onClick:s,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.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:p=>{p.currentTarget.style.background=o.bgCard},onMouseLeave:p=>{p.currentTarget.style.background=o.bgSecondary},children:i.jsxs("td",{colSpan:11,style:{padding:d>0?"12px 16px 12px 40px":"12px 16px",color:o.textPrimary,fontFamily:v.body,fontWeight:"600",fontSize:d>0?"11px":"12px"},children:[i.jsx("span",{style:{marginRight:"8px",userSelect:"none",display:"inline-flex",alignItems:"center"},children:u?i.jsx(Hx,{size:12}):i.jsx(Ux,{size:12})}),r]})})}function Vx({response:r,selected:s,firstRequestTime:u,onSelect:d}){const p=s?.frame_number===r.frame_number,{source:f,dest:h}=zs(r),y=_s(r.timestamp_iso,u);return i.jsxs("tr",{onClick:()=>d(r),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),d(r))},tabIndex:0,"aria-label":`Select orphaned response ${r.frame_number}`,style:{cursor:"pointer",background:p?o.bgSelected:o.bgUnpaired,borderBottom:`1px solid ${o.borderLight}`,fontFamily:v.body,transition:"background-color 0.15s ease",opacity:.85},onMouseEnter:x=>{p||(x.currentTarget.style.background=tr(o.accentOrange,.1))},onMouseLeave:x=>{p||(x.currentTarget.style.background=o.bgUnpaired)},children:[i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,textAlign:"right",fontFamily:v.mono,fontSize:"12px"},children:i.jsxs("span",{style:{color:o.accentOrange,fontWeight:"500"},children:["#",r.frame_number," (orphaned)"]})}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:y}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.body,fontSize:"12px"},children:Ls(r.timestamp_iso)}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentOrange,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:f}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentOrange,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:h}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:r.protocol||"HTTP"}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textSecondary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:"-"}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:i.jsx("div",{style:{color:r.status_code>=400?o.error:r.status_code>=300?o.warning:o.success,fontWeight:"600"},children:r.status_code||"-"})}),i.jsx("td",{style:{padding:"16px",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:fi(r)})]})}const Qx=({size:r=12,rotated:s=!1})=>i.jsx(xs,{size:r,stroke:1.5,style:{display:"inline-block",verticalAlign:"middle",transform:s?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s ease"}});function Yx({request:r,response:s,selected:u,firstRequestTime:d,onSelect:p,isExpanded:f,onToggleExpand:h,isUnpaired:y}){const x=u?.frame_number===r.frame_number,{source:T,dest:S}=zs(r),k=_s(r.timestamp_iso,d),b=!!s;return i.jsx(i.Fragment,{children:i.jsxs("tr",{onClick:()=>p(r),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),p(r))},tabIndex:0,"aria-label":`Select request ${r.frame_number}`,style:{cursor:"pointer",background:x?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:_=>{x||(_.currentTarget.style.background=y?tr(o.accentOrange,.1):o.bgCard)},onMouseLeave:_=>{x||(_.currentTarget.style.background=y?o.bgUnpaired:o.bgSecondary)},children:[i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,textAlign:"right",fontFamily:v.mono,fontSize:"12px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"flex-end"},children:[b&&i.jsx("button",{type:"button",onClick:_=>{_.stopPropagation(),h()},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:i.jsx(Qx,{size:14,rotated:!f})}),i.jsxs("span",{style:{color:y?o.accentOrange:o.accentBlue,fontWeight:"500"},children:["#",r.frame_number,y&&i.jsx("span",{style:{fontSize:"10px",color:o.textSecondary,marginLeft:"4px",fontStyle:"italic"},children:"(no response)"})]})]})}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:k}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.body,fontSize:"12px"},children:Ls(r.timestamp_iso)}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentBlue,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:T}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentBlue,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:S}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:r.protocol||"HTTP"}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:i.jsx("div",{style:{color:o.accentBlue},children:r.method||"REQ"})}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:b&&i.jsx("div",{style:{color:s.status_code>=400?o.error:s.status_code>=300?o.warning:o.success,fontWeight:"600"},children:s.status_code||"-"})}),i.jsx("td",{style:{padding:"16px",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:fi(r)})]})})}function Jx({response:r,selected:s,firstRequestTime:u,onSelect:d}){const p=s?.frame_number===r.frame_number,{source:f,dest:h}=zs(r),y=_s(r.timestamp_iso,u);return i.jsxs("tr",{onClick:()=>d(r),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),d(r))},tabIndex:0,"aria-label":`Select response ${r.frame_number}`,style:{cursor:"pointer",background:p&&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:x=>{p&&s?.frame_number===r.frame_number||(x.currentTarget.style.background=o.bgSecondary)},onMouseLeave:x=>{p&&s?.frame_number===r.frame_number||(x.currentTarget.style.background=o.bgTertiary)},children:[i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,textAlign:"right",fontFamily:v.mono,fontSize:"12px",paddingLeft:"40px"},children:i.jsxs("span",{style:{color:o.accentGreen,fontWeight:"500"},children:["#",r.frame_number]})}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:y}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.body,fontSize:"12px"},children:Ls(r.timestamp_iso)}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentGreen,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:f}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentGreen,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:h}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:r.protocol||"HTTP"}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textSecondary,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:"-"}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,fontFamily:v.mono,fontSize:"12px",fontWeight:"500"},children:i.jsx("div",{style:{color:r.status_code>=400?o.error:r.status_code>=300?o.warning:o.success,fontWeight:"600"},children:r.status_code||"-"})}),i.jsx("td",{style:{padding:"16px",color:o.textPrimary,fontFamily:v.mono,fontSize:"12px"},children:fi(r)})]})}function Rd({pair:r,request:s,selected:u,firstRequestTime:d,onSelect:p,isExpanded:f=!1,onToggleExpand:h=()=>{}}){const x=((_,z)=>_?{request:_.request,response:_.response}:z?{request:z,response:null}:null)(r,s);if(!x)return null;const{request:T,response:S}=x,k=!T||!S;if(!T&&S)return i.jsx(Vx,{response:S,selected:u,firstRequestTime:d,onSelect:p});if(!T)return null;const b=!!S;return i.jsxs(i.Fragment,{children:[i.jsx(Yx,{request:T,response:S,selected:u,firstRequestTime:d,onSelect:p,isExpanded:f,onToggleExpand:h,isUnpaired:k}),b&&f&&i.jsx(Jx,{response:S,selected:u,firstRequestTime:d,onSelect:p,request:T})]})}function Kx({groupedData:r,selected:s,firstRequestTime:u,onSelect:d,expandedSessions:p,expandedCategories:f,onToggleSession:h,onToggleCategory:y}){return i.jsx("tbody",{children:r.map(x=>{const T=x.sessionId||"__NO_SESSION__",S=p.has(T);return i.jsxs(ni.Fragment,{children:[i.jsxs(Yc,{onClick:()=>h(T),isExpanded:S,indent:0,children:[i.jsxs("span",{style:{color:o.accentBlue,marginRight:"8px"},children:["Session: ",x.sessionId||"No Session"]}),i.jsxs("span",{style:{color:o.textTertiary,fontSize:"11px",fontWeight:"400"},children:["(",x.categories.reduce((k,b)=>k+b.pairs.length,0)," ","operations)"]})]}),S&&x.categories.map(k=>{const b=`${T}::${k.category}`,_=f.has(b);return i.jsxs(ni.Fragment,{children:[i.jsxs(Yc,{onClick:()=>y(b),isExpanded:_,indent:1,children:[i.jsx("span",{style:{marginRight:"8px",display:"inline-flex",alignItems:"center"},children:ni.createElement(Wx(k.category),{size:16,stroke:1.5,color:o.accentBlue})}),i.jsx("span",{style:{color:o.textPrimary},children:k.label}),i.jsxs("span",{style:{color:o.textTertiary,fontSize:"11px",fontWeight:"400",marginLeft:"8px"},children:["(",k.pairs.length," ",k.pairs.length===1?"operation":"operations",")"]})]}),_&&k.pairs.map(z=>i.jsx(Rd,{pair:z,selected:s,firstRequestTime:u,onSelect:d,isExpanded:!1,onToggleExpand:()=>{}},z.frame_number))]},b)})]},T)})})}function Gx({columnWidths:r}){return i.jsx("thead",{style:{position:"sticky",top:0,background:o.bgSecondary,zIndex:10,boxShadow:`0 2px 4px ${o.shadowSm}`},children:i.jsxs("tr",{children:[i.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."}),i.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"}),i.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"}),i.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"}),i.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"}),i.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"}),i.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"}),i.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"}),i.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 Xx({viewMode:r,onViewModeChange:s}){return i.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:[i.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:[i.jsx(pg,{size:16,stroke:1.5}),"General List"]}),i.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:[i.jsx(ed,{size:16,stroke:1.5}),"MCP Protocol View"]})]})}function Zx({requests:r,selected:s,onSelect:u,firstRequestTime:d}){const[p,f]=P.useState("general"),[h]=P.useState({frame:90,time:120,datetime:180,source:200,destination:200,protocol:90,method:90,status:80,endpoint:500}),[y,x]=P.useState(new Set),[T,S]=P.useState(new Set),[k,b]=P.useState(new Set),_=P.useRef(null),z=P.useRef(0),R=P.useMemo(()=>Ax(r),[r]);P.useEffect(()=>{if(_.current&&r.length>0){const $=_.current.querySelectorAll("tr");if($.length>0){if(r.length>z.current){const A=Array.from($).slice(z.current);A.length>0&&Uc(A,{delay:30,duration:300})}else Uc($,{delay:20,duration:300});z.current=r.length}}},[r]),P.useEffect(()=>{if(p==="groupedByMcp"){const $=new Set(R.map(A=>A.sessionId||"__NO_SESSION__"));S(A=>{const K=new Set(A);return $.forEach(V=>K.add(V)),K}),b(A=>{const K=new Set(A);return R.forEach(V=>{const G=V.sessionId||"__NO_SESSION__";V.categories.forEach(Y=>{K.add(`${G}::${Y.category}`)})}),K})}},[R,p]);const L=$=>{S(A=>{const K=new Set(A);return K.has($)?K.delete($):K.add($),K})},I=$=>{b(A=>{const K=new Set(A);return K.has($)?K.delete($):K.add($),K})},D=P.useMemo(()=>_d(r),[r]),U=$=>{x(A=>{const K=new Set(A);return K.has($)?K.delete($):K.add($),K})},W=()=>i.jsx("tbody",{ref:_,children:D.map($=>i.jsx(Rd,{pair:$,selected:s,firstRequestTime:d,onSelect:u,isExpanded:y.has($.frame_number),onToggleExpand:()=>U($.frame_number)},$.frame_number))});return i.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",background:o.bgPrimary,minHeight:0,overflow:"hidden"},children:[i.jsx(Xx,{viewMode:p,onViewModeChange:f}),i.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"auto",minHeight:0,WebkitOverflowScrolling:"touch"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0,fontSize:"12px",fontFamily:v.body,background:o.bgPrimary},children:[i.jsx(Gx,{columnWidths:h}),p==="general"?W():i.jsx(Kx,{groupedData:R,expandedSessions:T,expandedCategories:k,onToggleSession:L,onToggleCategory:I,selected:s,firstRequestTime:d,onSelect:u})]})})]})}function qx({requests:r,selected:s,onSelect:u,filters:d,onFilterChange:p,stats:f,firstRequestTime:h,onClear:y}){const x=P.useRef(null);return P.useEffect(()=>{s&&x.current&&setTimeout(()=>{x.current&&(x.current.style.opacity="0",x.current.style.transform="translateX(600px)",Fx(x.current,{width:600}))},10)},[s]),i.jsxs("div",{"data-tab-content":!0,style:{display:"flex",flex:1,overflow:"hidden",minHeight:0},children:[i.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,minHeight:0},children:[i.jsx(Dx,{filters:d,onFilterChange:p,stats:f,onExport:()=>{},onClear:y}),i.jsx(Zx,{requests:r,selected:s,onSelect:u,firstRequestTime:h})]}),s&&i.jsx("div",{ref:x,style:{width:"40%",minWidth:"500px",maxWidth:"700px",borderLeft:`1px solid ${o.borderLight}`,overflow:"hidden",display:"flex",flexDirection:"column",background:o.bgCard,flexShrink:0},children:i.jsx(Ix,{request:s,onClose:()=>u(null),requests:r})})]})}function fn(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)}const ey=["traffic","logs","setup","playground","smart-scan"],ty="traffic";function ps(){const r=window.location.hash.slice(1),s=r.startsWith("/")?r.slice(1):r;return ey.includes(s)?s:ty}function Jc(r){const s=`#/${r}`;window.location.hash!==s&&window.history.replaceState(null,"",s)}function ny(){const[r,s]=P.useState(()=>ps()),[u,d]=P.useState([]),[p,f]=P.useState(null),[h,y]=P.useState({}),[x,T]=P.useState(null),[S,k]=P.useState(null),[b,_]=P.useState(!1),[z,R]=P.useState(!0),L=P.useRef(null),I=P.useRef(r),D=P.useRef(h);P.useEffect(()=>{if(!window.location.hash||window.location.hash==="#"){const $=ps();Jc($)}},[]),P.useEffect(()=>{Jc(r)},[r]),P.useEffect(()=>{const $=()=>{const A=ps();A!==r&&s(A)};return window.addEventListener("hashchange",$),()=>window.removeEventListener("hashchange",$)},[r]);const U=async()=>{try{const $=new URLSearchParams;fn($,h);const K=await(await fetch(`/api/statistics?${$}`)).json();T(K)}catch($){console.error("Failed to load statistics:",$)}},W=async()=>{try{const $=new URLSearchParams;fn($,h),$.append("limit","5000");const K=await(await fetch(`/api/requests?${$}`)).json();if(d(K),K.length>0){const V=K[K.length-1]?.timestamp_iso;V&&k(V)}await U()}catch($){console.error("Failed to load requests:",$)}};return P.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)}},A=async()=>{try{const V=new URLSearchParams;fn(V,h),V.append("limit","5000");const Y=await(await fetch(`/api/requests?${V}`)).json();if(d(Y),Y.length>0){const Re=Y[Y.length-1]?.timestamp_iso;Re&&k(Re)}const ue=new URLSearchParams;fn(ue,h);const me=await(await fetch(`/api/statistics?${ue}`)).json();T(me)}catch(V){console.error("Failed to load requests:",V)}};$(),A();const K=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;try{const V=new WebSocket(K);L.current=V,V.onmessage=async G=>{const Y=JSON.parse(G.data);if(Y.type==="update"){if(d(Y.data),Y.data.length>0){const ue=Y.data[Y.data.length-1]?.timestamp_iso;ue&&k(ue)}try{const ue=new URLSearchParams;fn(ue,h);const me=await(await fetch(`/api/statistics?${ue}`)).json();T(me)}catch(ue){console.error("Failed to load statistics:",ue)}}},V.onerror=()=>{},V.onclose=()=>{}}catch{}return()=>{L.current&&L.current.readyState===WebSocket.OPEN&&L.current.close()}},[h]),P.useEffect(()=>{(async()=>{try{const A=new URLSearchParams;fn(A,h),A.append("limit","5000");const V=await(await fetch(`/api/requests?${A}`)).json();if(d(V),V.length>0){const ve=V[V.length-1]?.timestamp_iso;ve&&k(ve)}const G=new URLSearchParams;fn(G,h);const ue=await(await fetch(`/api/statistics?${G}`)).json();T(ue)}catch(A){console.error("Failed to load requests:",A)}})()},[h]),P.useEffect(()=>{D.current=h},[h]),P.useEffect(()=>{if(r!=="traffic")return;const $=setInterval(async()=>{try{const A=new URLSearchParams;fn(A,D.current);const V=await(await fetch(`/api/statistics?${A}`)).json();T(V)}catch(A){console.error("Failed to load statistics:",A)}},2e3);return()=>clearInterval($)},[r]),{activeTab:r,setActiveTab:s,requests:u,selected:p,setSelected:f,filters:h,setFilters:y,stats:x,firstRequestTime:S,showTour:b,setShowTour:_,tourDismissed:z,prevTabRef:I,wsRef:L,loadRequests:W}}function ry({show:r}){const s=P.useRef(null),u=P.useRef([]);return P.useEffect(()=>{r&&s.current?(fe({targets:s.current,opacity:[0,1],scale:[.9,1],duration:400,easing:"easeOutExpo"}),u.current.length>0&&fe({targets:u.current,translateY:[0,-10,0],duration:1200,delay:fe.stagger(200),loop:!0,easing:"easeInOutQuad"})):!r&&s.current&&fe({targets:s.current,opacity:[1,0],scale:[1,.9],duration:300,easing:"easeInExpo",complete:()=>{s.current&&(s.current.style.display="none")}})},[r]),r?i.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:i.jsxs("div",{style:{background:o.bgCard,borderRadius:"16px",padding:"32px",boxShadow:`0 8px 32px ${o.shadowMd}`,maxWidth:"320px",width:"90%",textAlign:"center"},children:[i.jsx("h3",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:v.body,marginBottom:"20px"},children:"Waiting for MCP server to start"}),i.jsx("div",{style:{display:"flex",justifyContent:"center",gap:"8px"},children:[0,1,2].map(d=>i.jsx("div",{ref:p=>{p&&(u.current[d]=p)},style:{width:"12px",height:"12px",borderRadius:"50%",background:o.accentBlue}},d))})]})}):null}function oy({prompt:r,promptArgs:s,onPromptArgsChange:u,promptResult:d,onGetPrompt:p,loading:f}){return i.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.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]}),i.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"prompt-args-textarea",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Arguments (JSON)"}),i.jsx("textarea",{id:"prompt-args-textarea",value:s,onChange:h=>u(h.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"}})]}),i.jsx("button",{type:"button",onClick:p,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"}),d&&i.jsxs("div",{children:[i.jsx("label",{htmlFor:"prompt-result-pre",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Result"}),i.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:d.error?o.error:o.textPrimary,overflow:"auto",maxHeight:"300px",margin:0},children:JSON.stringify(d,null,2)})]})]})]})}function Rs({message:r}){return i.jsx("div",{style:{padding:"40px",textAlign:"center",color:o.textSecondary,fontFamily:v.body,fontSize:"13px"},children:r})}function Ms({message:r}){return i.jsx("div",{style:{padding:"40px",textAlign:"center",color:o.error,fontFamily:v.body,fontSize:"13px"},children:r})}function nr({message:r}){return i.jsx("div",{style:{padding:"40px",textAlign:"center",color:o.textSecondary,fontFamily:v.body,fontSize:"13px"},children:r})}function iy({prompt:r,isSelected:s,onClick:u}){return i.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:d=>{s||(d.currentTarget.style.background=o.bgHover,d.currentTarget.style.borderColor=o.borderMedium,d.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:d=>{s||(d.currentTarget.style.background=o.bgCard,d.currentTarget.style.borderColor=o.borderLight,d.currentTarget.style.boxShadow="none")},children:i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[i.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:s?o.accentBlue:o.textTertiary,marginTop:"6px",flexShrink:0,transition:"background 0.2s"}}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.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&&i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,lineHeight:"1.5",marginTop:"4px"},children:r.description})]})]})})}function ly({serverStatus:r,promptsLoading:s,promptsLoaded:u,error:d,prompts:p,selectedPrompt:f,onSelectPrompt:h}){return i.jsx("div",{style:{flex:1,overflow:"auto",background:o.bgCard,position:"relative"},children:r?.running?s||!u?i.jsx(nr,{message:"Loading prompts..."}):d?.includes("prompts:")?i.jsx(Ms,{message:`Error loading prompts: ${d.replace("prompts: ","")}`}):p.length===0?i.jsx(Rs,{message:"No prompts available."}):i.jsx("div",{style:{padding:"8px 0"},children:p.map((y,x)=>i.jsx(iy,{prompt:y,isSelected:f?.name===y.name,onClick:()=>h(y)},y.name||`prompt-${x}`))}):i.jsx(nr,{message:"Waiting for MCP server to start..."})})}function sy({prompts:r,selectedPrompt:s,onSelectPrompt:u,promptArgs:d,onPromptArgsChange:p,promptResult:f,onGetPrompt:h,loading:y,promptsLoading:x,promptsLoaded:T,serverStatus:S,error:k,onRefresh:b}){const _=z=>{u(z);const R=z.arguments?z.arguments.reduce((L,I)=>(L[I.name]=I.default!==void 0?I.default:"",L),{}):{};p(JSON.stringify(R,null,2))};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.jsx("button",{type:"button",onClick:b,disabled:y||x,style:{padding:"8px 16px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:y||x?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:y||x?.6:1},children:x?"Loading...":"Refresh Prompts"}),i.jsx("span",{style:{color:o.textSecondary,fontSize:"13px"},children:x?"Loading prompts...":`${r.length} prompt${r.length!==1?"s":""} available`})]}),i.jsxs("div",{style:{display:"flex",gap:"16px",flex:1,minHeight:0},children:[i.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.jsx("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:"Available Prompts"}),i.jsx(ly,{serverStatus:S,promptsLoading:x,promptsLoaded:T,error:k,prompts:r,selectedPrompt:s,onSelectPrompt:_})]}),s&&i.jsx(oy,{prompt:s,promptArgs:d,onPromptArgsChange:p,promptResult:f,onGetPrompt:h,loading:y})]})]})}function ay({resource:r,resourceResult:s,onReadResource:u,loading:d}){return i.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.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]}),i.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsx("button",{type:"button",onClick:u,disabled:d,style:{padding:"10px 20px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:d?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:d?.6:1},children:d?"Reading...":"Read Resource"}),s&&i.jsxs("div",{children:[i.jsx("label",{htmlFor:"resource-result-pre",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Result"}),i.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 uy({resource:r,isSelected:s,onClick:u}){return i.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:d=>{s||(d.currentTarget.style.background=o.bgHover,d.currentTarget.style.borderColor=o.borderMedium,d.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:d=>{s||(d.currentTarget.style.background=o.bgCard,d.currentTarget.style.borderColor=o.borderLight,d.currentTarget.style.boxShadow="none")},children:i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[i.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:s?o.accentBlue:o.textTertiary,marginTop:"6px",flexShrink:0,transition:"background 0.2s"}}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.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&&i.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontWeight:"500",lineHeight:"1.5",marginTop:"4px"},children:r.name}),r.description&&i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,lineHeight:"1.5",marginTop:r.name?"2px":"4px"},children:r.description})]})]})})}function cy({serverStatus:r,resourcesLoading:s,resourcesLoaded:u,error:d,resources:p,selectedResource:f,onSelectResource:h}){return i.jsx("div",{style:{flex:1,overflow:"auto",background:o.bgCard,position:"relative"},children:r?.running?s||!u?i.jsx(nr,{message:"Loading resources..."}):d?.includes("resources:")?i.jsx(Ms,{message:`Error loading resources: ${d.replace("resources: ","")}`}):p.length===0?i.jsx(Rs,{message:"No resources available."}):i.jsx("div",{style:{padding:"8px 0"},children:p.map((y,x)=>i.jsx(uy,{resource:y,isSelected:f?.uri===y.uri,onClick:()=>h(y)},y.uri||`resource-${x}`))}):i.jsx(nr,{message:"Waiting for MCP server to start..."})})}function dy({resources:r,selectedResource:s,onSelectResource:u,resourceResult:d,onReadResource:p,loading:f,resourcesLoading:h,resourcesLoaded:y,serverStatus:x,error:T,onRefresh:S}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.jsx("button",{type:"button",onClick:S,disabled:f||h,style:{padding:"8px 16px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:f||h?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:f||h?.6:1},children:h?"Loading...":"Refresh Resources"}),i.jsx("span",{style:{color:o.textSecondary,fontSize:"13px"},children:h?"Loading resources...":`${r.length} resource${r.length!==1?"s":""} available`})]}),i.jsxs("div",{style:{display:"flex",gap:"16px",flex:1,minHeight:0},children:[i.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.jsx("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:"Available Resources"}),i.jsx(cy,{serverStatus:x,resourcesLoading:h,resourcesLoaded:y,error:T,resources:r,selectedResource:s,onSelectResource:u})]}),s&&i.jsx(ay,{resource:s,resourceResult:d,onReadResource:p,loading:f})]})]})}function py({tool:r,toolArgs:s,onToolArgsChange:u,toolResult:d,onCallTool:p,loading:f}){return i.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.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]}),i.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"tool-args-textarea",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Arguments (JSON)"}),i.jsx("textarea",{id:"tool-args-textarea",value:s,onChange:h=>u(h.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"}})]}),i.jsx("button",{type:"button",onClick:p,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"}),d&&i.jsxs("div",{children:[i.jsx("label",{htmlFor:"tool-result-pre",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Result"}),i.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:d.error?o.error:o.textPrimary,overflow:"auto",maxHeight:"300px",margin:0},children:JSON.stringify(d,null,2)})]})]})]})}function fy({tool:r,isSelected:s,onClick:u}){return i.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:d=>{s||(d.currentTarget.style.background=o.bgHover,d.currentTarget.style.borderColor=o.borderMedium,d.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:d=>{s||(d.currentTarget.style.background=o.bgCard,d.currentTarget.style.borderColor=o.borderLight,d.currentTarget.style.boxShadow="none")},children:i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[i.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:s?o.accentBlue:o.textTertiary,marginTop:"6px",flexShrink:0,transition:"background 0.2s"}}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.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&&i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,lineHeight:"1.5",marginTop:"4px"},children:r.description})]})]})})}function gy({serverStatus:r,toolsLoading:s,toolsLoaded:u,error:d,tools:p,selectedTool:f,onSelectTool:h}){return i.jsx("div",{style:{flex:1,overflow:"auto",background:o.bgCard,position:"relative"},children:r?.running?s||!u?i.jsx(nr,{message:"Loading tools..."}):d?.includes("tools:")?i.jsx(Ms,{message:`Error loading tools: ${d.replace("tools: ","")}`}):p.length===0?i.jsx(Rs,{message:"No tools available."}):i.jsx("div",{style:{padding:"8px 0"},children:p.map((y,x)=>i.jsx(fy,{tool:y,isSelected:f?.name===y.name,onClick:()=>h(y)},y.name||`tool-${x}`))}):i.jsx(nr,{message:"Waiting for MCP server to start..."})})}function hy({tools:r,selectedTool:s,onSelectTool:u,toolArgs:d,onToolArgsChange:p,toolResult:f,onCallTool:h,loading:y,toolsLoading:x,toolsLoaded:T,serverStatus:S,error:k,onRefresh:b}){const _=z=>{u(z);const R=z.inputSchema?.properties?Object.keys(z.inputSchema.properties).reduce((L,I)=>{const D=z.inputSchema.properties[I];return L[I]=D.default!==void 0?D.default:"",L},{}):{};p(JSON.stringify(R,null,2))};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.jsx("button",{type:"button",onClick:b,disabled:y||x,style:{padding:"8px 16px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:y||x?"not-allowed":"pointer",fontFamily:v.body,fontSize:"13px",fontWeight:"500",opacity:y||x?.6:1},children:x?"Loading...":"Refresh Tools"}),i.jsx("span",{style:{color:o.textSecondary,fontSize:"13px"},children:x?"Loading tools...":`${r.length} tool${r.length!==1?"s":""} available`})]}),i.jsxs("div",{style:{display:"flex",gap:"16px",flex:1,minHeight:0},children:[i.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.jsx("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:"Available Tools"}),i.jsx(gy,{serverStatus:S,toolsLoading:x,toolsLoaded:T,error:k,tools:r,selectedTool:s,onSelectTool:_})]}),s&&i.jsx(py,{tool:s,toolArgs:d,onToolArgsChange:p,toolResult:f,onCallTool:h,loading:y})]})]})}function xy(r,s,u){const[d,p]=P.useState([]),[f,h]=P.useState([]),[y,x]=P.useState([]),[T,S]=P.useState(!1),[k,b]=P.useState(!1),[_,z]=P.useState(!1),[R,L]=P.useState(!1),[I,D]=P.useState(!1),[U,W]=P.useState(!1),$=P.useCallback(async()=>{if(!s){u("tools: No server selected"),L(!0);return}S(!0),u(null);try{const G=await r("tools/list");p(G?.tools||[]),L(!0)}catch(G){const Y=G.message||"Failed to load tools";u(`tools: ${Y}`),L(!0),console.error("Failed to load tools:",G)}finally{S(!1)}},[s,r,u]),A=P.useCallback(async()=>{if(!s){u("prompts: No server selected"),D(!0);return}b(!0),u(null);try{const G=await r("prompts/list");h(G?.prompts||[]),D(!0)}catch(G){const Y=G.message||"Failed to load prompts";u(`prompts: ${Y}`),D(!0),console.error("Failed to load prompts:",G)}finally{b(!1)}},[s,r,u]),K=P.useCallback(async()=>{if(!s){u("resources: No server selected"),W(!0);return}z(!0),u(null);try{const G=await r("resources/list");x(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=P.useCallback(()=>{L(!1),D(!1),W(!1),p([]),h([]),x([])},[]);return{tools:d,prompts:f,resources:y,toolsLoading:T,promptsLoading:k,resourcesLoading:_,toolsLoaded:R,promptsLoaded:I,resourcesLoaded:U,loadTools:$,loadPrompts:A,loadResources:K,resetData:V}}function yy(r){const[s,u]=P.useState(!1),[d,p]=P.useState(null),[f,h]=P.useState(null),y=P.useRef(f);y.current=f;const x=P.useCallback(async(S,k={})=>{if(!r)throw new Error("No server selected");p(null),u(!0);try{const b={"Content-Type":"application/json"},_=y.current;_&&(b["Mcp-Session-Id"]=_);const z=await fetch("/api/playground/proxy",{method:"POST",headers:b,body:JSON.stringify({method:S,params:k,serverName:r})}),R=await z.json(),L=z.headers.get("Mcp-Session-Id")||z.headers.get("mcp-session-id")||R._sessionId;if(L&&L!==_&&h(L),!z.ok)throw new Error(R.error?.message||R.message||"Request failed");return R.result||R}catch(b){throw p(b.message),b}finally{u(!1)}},[r]),T=P.useCallback(()=>{h(null)},[]);return{makeMcpRequest:x,loading:s,error:d,setError:p,resetSession:T}}function my(){const[r,s]=P.useState(null),[u,d]=P.useState(!1),[p,f]=P.useState([]),[h,y]=P.useState(null),x=P.useCallback(async()=>{try{const S=await fetch("/api/composite/status");if(!S.ok)throw new Error("Server not available");const k=await S.json();s(b=>{const _=b?.running;return k.running?d(z=>z&&!1):d(z=>!z||_?!0:z),k})}catch{s({running:!1}),d(k=>k||!0)}},[]),T=P.useCallback(async()=>{try{const S=await fetch("/api/composite/servers");if(S.ok){const k=await S.json();f(k.servers||[]),y(b=>!b&&k.servers&&k.servers.length>0?k.servers[0]:b)}}catch(S){console.error("Failed to load servers:",S)}},[]);return P.useEffect(()=>{T()},[T]),P.useEffect(()=>{x();const S=setInterval(x,2e3);return()=>clearInterval(S)},[x]),P.useEffect(()=>{p.length>0&&!h&&y(p[0])},[p,h]),{serverStatus:r,showLoadingModal:u,availableServers:p,selectedServer:h,setSelectedServer:y,checkServerStatus:x}}function vy(){const[r,s]=P.useState("tools"),[u,d]=P.useState(null),[p,f]=P.useState("{}"),[h,y]=P.useState(null),[x,T]=P.useState(null),[S,k]=P.useState("{}"),[b,_]=P.useState(null),[z,R]=P.useState(null),[L,I]=P.useState(null),{serverStatus:D,showLoadingModal:U,availableServers:W,selectedServer:$,setSelectedServer:A}=my(),{makeMcpRequest:K,loading:V,error:G,setError:Y,resetSession:ue}=yy($),{tools:ve,prompts:me,resources:Re,toolsLoading:Ne,promptsLoading:Me,resourcesLoading:he,toolsLoaded:J,promptsLoaded:q,resourcesLoaded:X,loadTools:j,loadPrompts:N,loadResources:ie,resetData:ce}=xy(K,$,Y),pe=P.useRef(r);return pe.current=r,P.useEffect(()=>{if(!$||!D?.running)return;ce(),d(null),T(null),R(null),y(null),_(null),I(null),f("{}"),k("{}"),ue(),Y(null);const de=setTimeout(()=>{const Le=pe.current;Le==="tools"?j():Le==="prompts"?N():Le==="resources"&&ie()},100);return()=>clearTimeout(de)},[$,D?.running,ce,j,N,ie,ue,Y]),P.useEffect(()=>{if(!(!D?.running||!$)){if(r==="tools"&&!J&&!Ne){const de=setTimeout(()=>{j()},100);return()=>clearTimeout(de)}if(r==="prompts"&&!q&&!Me){const de=setTimeout(()=>{N()},100);return()=>clearTimeout(de)}if(r==="resources"&&!X&&!he){const de=setTimeout(()=>{ie()},100);return()=>clearTimeout(de)}}},[r,D?.running,$,J,Ne,q,Me,X,he,j,N,ie]),{activeSection:r,setActiveSection:s,tools:ve,prompts:me,resources:Re,loading:V,error:G,selectedTool:u,setSelectedTool:d,toolArgs:p,setToolArgs:f,toolResult:h,selectedPrompt:x,setSelectedPrompt:T,promptArgs:S,setPromptArgs:k,promptResult:b,selectedResource:z,setSelectedResource:R,resourceResult:L,serverStatus:D,showLoadingModal:U,toolsLoading:Ne,promptsLoading:Me,resourcesLoading:he,toolsLoaded:J,promptsLoaded:q,resourcesLoaded:X,loadTools:j,loadPrompts:N,loadResources:ie,handleCallTool:async()=>{if(u)try{const Le=(Vt=>{try{return JSON.parse(Vt)}catch{return null}})(p);if(Le===null){Y("Invalid JSON in arguments");return}const _t=await K("tools/call",{name:u.name,arguments:Le});y(_t)}catch(de){y({error:de.message})}},handleGetPrompt:async()=>{if(x)try{const Le=(Vt=>{try{return JSON.parse(Vt)}catch{return null}})(S);if(Le===null){Y("Invalid JSON in arguments");return}const _t=await K("prompts/get",{name:x.name,arguments:Le});_(_t)}catch(de){_({error:de.message})}},handleReadResource:async()=>{if(z)try{const de=await K("resources/read",{uri:z.uri});I(de)}catch(de){I({error:de.message})}},availableServers:W,selectedServer:$,setSelectedServer:A}}function Sy(){const{activeSection:r,setActiveSection:s,tools:u,prompts:d,resources:p,loading:f,error:h,selectedTool:y,setSelectedTool:x,toolArgs:T,setToolArgs:S,toolResult:k,selectedPrompt:b,setSelectedPrompt:_,promptArgs:z,setPromptArgs:R,promptResult:L,selectedResource:I,setSelectedResource:D,resourceResult:U,serverStatus:W,showLoadingModal:$,toolsLoading:A,promptsLoading:K,resourcesLoading:V,toolsLoaded:G,promptsLoaded:Y,resourcesLoaded:ue,loadTools:ve,loadPrompts:me,loadResources:Re,handleCallTool:Ne,handleGetPrompt:Me,handleReadResource:he,availableServers:J,selectedServer:q,setSelectedServer:X}=vy();return i.jsxs(i.Fragment,{children:[i.jsx("style",{children:`
|
|
31
|
+
@keyframes spin {
|
|
32
|
+
from { transform: rotate(0deg); }
|
|
33
|
+
to { transform: rotate(360deg); }
|
|
34
|
+
}
|
|
35
|
+
`}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:o.bgPrimary,padding:"20px",gap:"16px",position:"relative"},children:[i.jsx(ry,{show:$}),h&&!h.includes(":")&&i.jsxs("div",{style:{padding:"12px 16px",background:o.error,color:o.textInverse,borderRadius:"6px",fontSize:"13px",fontFamily:v.body},children:["Error: ",h]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[J.length>0&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[i.jsx("label",{htmlFor:"mcp-server-select",style:{fontSize:"13px",fontFamily:v.body,color:o.textSecondary,fontWeight:"500"},children:"Server:"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:J.map(j=>i.jsx("button",{type:"button",onClick:()=>X(j),style:{padding:"10px 18px",background:q===j?o.accentBlue:o.bgSecondary,border:q===j?`2px solid ${o.accentBlue}`:`1px solid ${o.borderLight}`,borderRadius:"8px",color:q===j?o.textInverse:o.textPrimary,fontSize:"13px",fontFamily:v.body,fontWeight:q===j?"600":"500",cursor:"pointer",transition:"all 0.2s ease",boxShadow:q===j?`0 2px 4px ${o.shadowSm}`:"none"},onMouseEnter:N=>{q!==j&&(N.currentTarget.style.background=o.bgHover,N.currentTarget.style.borderColor=o.borderMedium,N.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:N=>{q!==j&&(N.currentTarget.style.background=o.bgSecondary,N.currentTarget.style.borderColor=o.borderLight,N.currentTarget.style.boxShadow="none")},children:j},j))})]}),i.jsx("div",{style:{display:"flex",gap:"8px",borderBottom:`1px solid ${o.borderLight}`},children:["tools","prompts","resources"].map(j=>i.jsx("button",{type:"button",onClick:()=>s(j),style:{padding:"10px 18px",background:r===j?o.bgSecondary:"transparent",border:"none",borderBottom:`2px solid ${r===j?o.accentBlue:"transparent"}`,color:r===j?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"13px",fontFamily:v.body,fontWeight:r===j?"500":"400",textTransform:"capitalize",borderRadius:"6px 6px 0 0",transition:"all 0.2s"},children:j},j))})]}),i.jsxs("div",{style:{flex:1,overflow:"hidden",minHeight:0},children:[r==="tools"&&i.jsx(hy,{tools:u,selectedTool:y,onSelectTool:x,toolArgs:T,onToolArgsChange:S,toolResult:k,onCallTool:Ne,loading:f,toolsLoading:A,toolsLoaded:G,serverStatus:W,error:h,onRefresh:ve}),r==="prompts"&&i.jsx(sy,{prompts:d,selectedPrompt:b,onSelectPrompt:_,promptArgs:z,onPromptArgsChange:R,promptResult:L,onGetPrompt:Me,loading:f,promptsLoading:K,promptsLoaded:Y,serverStatus:W,error:h,onRefresh:me}),r==="resources"&&i.jsx(dy,{resources:p,selectedResource:I,onSelectResource:D,resourceResult:U,onReadResource:he,loading:f,resourcesLoading:V,resourcesLoaded:ue,serverStatus:W,error:h,onRefresh:Re})]})]})]})}const Kc=[{target:'[data-tour="tabs"]',title:"Welcome to MCP Shark!",content:i.jsxs("div",{children:[i.jsx("p",{style:{margin:"0 0 12px 0"},children:"MCP Shark is a powerful tool for monitoring and analyzing Model Context Protocol (MCP) communications. Let's get you started!"}),i.jsxs("p",{style:{margin:0},children:["First, you'll need to set up the MCP Shark server. Click on the"," ",i.jsx("strong",{children:"MCP Server Setup"})," tab to begin."]})]}),position:"bottom"},{target:'[data-tour="setup-tab"]',title:"Step 1: Open MCP Server Setup",content:i.jsxs("div",{children:[i.jsxs("p",{style:{margin:"0 0 8px 0"},children:["Click on the ",i.jsx("strong",{children:"MCP Server Setup"})," tab to configure and start the MCP Shark server."]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"This is where you'll configure your MCP servers and start monitoring."})]}),position:"bottom"},{target:'[data-tour="detected-editors"]',title:"Step 2: Select Your Configuration",content:i.jsxs("div",{children:[i.jsx("p",{style:{margin:"0 0 8px 0"},children:"MCP Shark automatically detects your IDE's MCP configuration files. You have two options:"}),i.jsxs("ul",{style:{margin:"0 0 8px 0",paddingLeft:"20px",fontSize:"13px"},children:[i.jsxs("li",{children:["Click on any ",i.jsx("strong",{children:"detected editor"})," (like Cursor or Windsurf) to use its config"]}),i.jsxs("li",{children:["Or click ",i.jsx("strong",{children:'"Select File"'})," to upload your own config file"]})]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"When you click a detected editor, the file path will automatically populate in the text box."})]}),position:"bottom"},{target:'[data-tour="select-file"]',title:"Alternative: Upload Your Config",content:i.jsxs("div",{children:[i.jsxs("p",{style:{margin:"0 0 8px 0"},children:["If you prefer, you can click ",i.jsx("strong",{children:'"Select File"'})," to upload your MCP configuration file directly."]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"Or manually enter the file path in the text box next to it."})]}),position:"bottom"},{target:'[data-tour="start-button"]',title:"Step 3: Start MCP Shark",content:i.jsxs("div",{children:[i.jsxs("p",{style:{margin:"0 0 8px 0"},children:["Once you've selected a configuration file (either from detected editors or uploaded), click ",i.jsx("strong",{children:'"Start MCP Shark"'})," to begin monitoring."]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"The server will start and begin capturing all MCP traffic between your IDE and servers."})]}),position:"top"},{target:'[data-tour="traffic-tab"]',title:"View Your Traffic",content:i.jsxs("div",{children:[i.jsxs("p",{style:{margin:"0 0 8px 0"},children:["After starting the server, switch to the ",i.jsx("strong",{children:"Traffic Capture"})," tab to see all HTTP requests and responses in real-time."]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"You can view traffic as a flat list, grouped by session, or grouped by server."})]}),position:"bottom"},{target:'[data-tour="smart-scan-tab"]',title:"Smart Scan - Security Analysis",content:i.jsxs("div",{children:[i.jsxs("p",{style:{margin:"0 0 8px 0"},children:["The ",i.jsx("strong",{children:"Smart Scan"})," tab provides AI-powered security analysis for your MCP servers. Discover servers, run security scans, and get detailed vulnerability reports."]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"Scan results are cached automatically, so you won't waste API calls on unchanged servers."})]}),position:"bottom"},{target:'[data-tour="help-button"]',title:"Need Help?",content:i.jsxs("div",{children:[i.jsxs("p",{style:{margin:"0 0 8px 0"},children:["Click the ",i.jsx("strong",{children:"Start Tour"})," button anytime to restart this guide or get help."]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"You're all set! Start by configuring your MCP server, then watch the traffic flow."})]}),position:"left"}];function by(){const{activeTab:r,setActiveTab:s,requests:u,selected:d,setSelected:p,filters:f,setFilters:h,stats:y,firstRequestTime:x,showTour:T,setShowTour:S,prevTabRef:k,loadRequests:b}=ny(),[_,z]=P.useState(0);return P.useEffect(()=>{if(k.current!==r){const R=document.querySelector("[data-tab-content]");R&&Es(R,{duration:300}),k.current=r}},[r,k]),i.jsxs("div",{style:{display:"flex",height:"100vh",flexDirection:"column",background:o.bgPrimary},children:[T&&i.jsx(th,{steps:Kc,onComplete:()=>S(!1),onSkip:()=>S(!1),onStepChange:R=>{const L=Kc[R];L&&(L.target==='[data-tour="setup-tab"]'||L.target==='[data-tour="detected-editors"]'||L.target==='[data-tour="select-file"]'||L.target==='[data-tour="start-button"]'?r!=="setup"&&s("setup"):L.target==='[data-tour="traffic-tab"]'?r!=="traffic"&&s("traffic"):L.target==='[data-tour="smart-scan-tab"]'&&r!=="smart-scan"&&s("smart-scan"))}},_),i.jsx("div",{style:{position:"relative"},"data-tour":"tabs",children:i.jsx(vx,{activeTab:r,onTabChange:s})}),i.jsx(Sx,{}),i.jsx(kx,{onClick:()=>{T?(S(!1),z(R=>R+1),setTimeout(()=>{S(!0)},100)):(z(R=>R+1),S(!0))}}),r==="traffic"&&i.jsx(qx,{requests:u,selected:d,onSelect:p,filters:f,onFilterChange:h,stats:y,firstRequestTime:x,onClear:()=>{p(null),b()}}),r==="logs"&&i.jsx("div",{"data-tab-content":!0,style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:i.jsx(Mg,{})}),r==="setup"&&i.jsx("div",{"data-tab-content":!0,style:{flex:1,overflow:"hidden",width:"100%",height:"100%"},children:i.jsx(Qg,{})}),r==="playground"&&i.jsx("div",{"data-tab-content":!0,style:{flex:1,overflow:"hidden",width:"100%",height:"100%"},children:i.jsx(Sy,{})}),r==="smart-scan"&&i.jsx("div",{"data-tab-content":!0,style:{flex:1,overflow:"auto",width:"100%",height:"100%"},children:i.jsx(Fh,{})})]})}Of.createRoot(document.getElementById("root")).render(i.jsx(ni.StrictMode,{children:i.jsx(by,{})}));
|