mirror of
https://github.com/CyberSecurityUP/NeuroSploit.git
synced 2026-02-12 14:02:45 +00:00
642 lines
483 KiB
JavaScript
642 lines
483 KiB
JavaScript
var H0=Object.defineProperty;var W0=(e,t,n)=>t in e?H0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Hn=(e,t,n)=>W0(e,typeof t!="symbol"?t+"":t,n);function q0(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const l=Object.getOwnPropertyDescriptor(r,a);l&&Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const i of l.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function Iu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mu={exports:{}},pl={},Du={exports:{}},fe={};/**
|
||
* @license React
|
||
* react.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Br=Symbol.for("react.element"),K0=Symbol.for("react.portal"),Q0=Symbol.for("react.fragment"),J0=Symbol.for("react.strict_mode"),G0=Symbol.for("react.profiler"),X0=Symbol.for("react.provider"),Y0=Symbol.for("react.context"),Z0=Symbol.for("react.forward_ref"),ef=Symbol.for("react.suspense"),tf=Symbol.for("react.memo"),nf=Symbol.for("react.lazy"),Pc=Symbol.iterator;function sf(e){return e===null||typeof e!="object"?null:(e=Pc&&e[Pc]||e["@@iterator"],typeof e=="function"?e:null)}var zu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Fu=Object.assign,Uu={};function Bs(e,t,n){this.props=e,this.context=t,this.refs=Uu,this.updater=n||zu}Bs.prototype.isReactComponent={};Bs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Bs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Bu(){}Bu.prototype=Bs.prototype;function So(e,t,n){this.props=e,this.context=t,this.refs=Uu,this.updater=n||zu}var _o=So.prototype=new Bu;_o.constructor=So;Fu(_o,Bs.prototype);_o.isPureReactComponent=!0;var Lc=Array.isArray,Vu=Object.prototype.hasOwnProperty,Co={current:null},Hu={key:!0,ref:!0,__self:!0,__source:!0};function Wu(e,t,n){var r,a={},l=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(l=""+t.key),t)Vu.call(t,r)&&!Hu.hasOwnProperty(r)&&(a[r]=t[r]);var o=arguments.length-2;if(o===1)a.children=n;else if(1<o){for(var c=Array(o),d=0;d<o;d++)c[d]=arguments[d+2];a.children=c}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)a[r]===void 0&&(a[r]=o[r]);return{$$typeof:Br,type:e,key:l,ref:i,props:a,_owner:Co.current}}function rf(e,t){return{$$typeof:Br,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Eo(e){return typeof e=="object"&&e!==null&&e.$$typeof===Br}function af(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ac=/\/+/g;function Il(e,t){return typeof e=="object"&&e!==null&&e.key!=null?af(""+e.key):t.toString(36)}function ja(e,t,n,r,a){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(l){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Br:case K0:i=!0}}if(i)return i=e,a=a(i),e=r===""?"."+Il(i,0):r,Lc(a)?(n="",e!=null&&(n=e.replace(Ac,"$&/")+"/"),ja(a,t,n,"",function(d){return d})):a!=null&&(Eo(a)&&(a=rf(a,n+(!a.key||i&&i.key===a.key?"":(""+a.key).replace(Ac,"$&/")+"/")+e)),t.push(a)),1;if(i=0,r=r===""?".":r+":",Lc(e))for(var o=0;o<e.length;o++){l=e[o];var c=r+Il(l,o);i+=ja(l,t,n,c,a)}else if(c=sf(e),typeof c=="function")for(e=c.call(e),o=0;!(l=e.next()).done;)l=l.value,c=r+Il(l,o++),i+=ja(l,t,n,c,a);else if(l==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function na(e,t,n){if(e==null)return e;var r=[],a=0;return ja(e,r,"","",function(l){return t.call(n,l,a++)}),r}function lf(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var at={current:null},ka={transition:null},of={ReactCurrentDispatcher:at,ReactCurrentBatchConfig:ka,ReactCurrentOwner:Co};function qu(){throw Error("act(...) is not supported in production builds of React.")}fe.Children={map:na,forEach:function(e,t,n){na(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return na(e,function(){t++}),t},toArray:function(e){return na(e,function(t){return t})||[]},only:function(e){if(!Eo(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};fe.Component=Bs;fe.Fragment=Q0;fe.Profiler=G0;fe.PureComponent=So;fe.StrictMode=J0;fe.Suspense=ef;fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=of;fe.act=qu;fe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Fu({},e.props),a=e.key,l=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,i=Co.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)Vu.call(t,c)&&!Hu.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){o=Array(c);for(var d=0;d<c;d++)o[d]=arguments[d+2];r.children=o}return{$$typeof:Br,type:e.type,key:a,ref:l,props:r,_owner:i}};fe.createContext=function(e){return e={$$typeof:Y0,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:X0,_context:e},e.Consumer=e};fe.createElement=Wu;fe.createFactory=function(e){var t=Wu.bind(null,e);return t.type=e,t};fe.createRef=function(){return{current:null}};fe.forwardRef=function(e){return{$$typeof:Z0,render:e}};fe.isValidElement=Eo;fe.lazy=function(e){return{$$typeof:nf,_payload:{_status:-1,_result:e},_init:lf}};fe.memo=function(e,t){return{$$typeof:tf,type:e,compare:t===void 0?null:t}};fe.startTransition=function(e){var t=ka.transition;ka.transition={};try{e()}finally{ka.transition=t}};fe.unstable_act=qu;fe.useCallback=function(e,t){return at.current.useCallback(e,t)};fe.useContext=function(e){return at.current.useContext(e)};fe.useDebugValue=function(){};fe.useDeferredValue=function(e){return at.current.useDeferredValue(e)};fe.useEffect=function(e,t){return at.current.useEffect(e,t)};fe.useId=function(){return at.current.useId()};fe.useImperativeHandle=function(e,t,n){return at.current.useImperativeHandle(e,t,n)};fe.useInsertionEffect=function(e,t){return at.current.useInsertionEffect(e,t)};fe.useLayoutEffect=function(e,t){return at.current.useLayoutEffect(e,t)};fe.useMemo=function(e,t){return at.current.useMemo(e,t)};fe.useReducer=function(e,t,n){return at.current.useReducer(e,t,n)};fe.useRef=function(e){return at.current.useRef(e)};fe.useState=function(e){return at.current.useState(e)};fe.useSyncExternalStore=function(e,t,n){return at.current.useSyncExternalStore(e,t,n)};fe.useTransition=function(){return at.current.useTransition()};fe.version="18.3.1";Du.exports=fe;var x=Du.exports;const Ro=Iu(x),cf=q0({__proto__:null,default:Ro},[x]);/**
|
||
* @license React
|
||
* react-jsx-runtime.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var df=x,uf=Symbol.for("react.element"),pf=Symbol.for("react.fragment"),mf=Object.prototype.hasOwnProperty,ff=df.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,xf={key:!0,ref:!0,__self:!0,__source:!0};function Ku(e,t,n){var r,a={},l=null,i=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)mf.call(t,r)&&!xf.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:uf,type:e,key:l,ref:i,props:a,_owner:ff.current}}pl.Fragment=pf;pl.jsx=Ku;pl.jsxs=Ku;Mu.exports=pl;var s=Mu.exports,ji={},Qu={exports:{}},wt={},Ju={exports:{}},Gu={};/**
|
||
* @license React
|
||
* scheduler.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/(function(e){function t(z,Y){var se=z.length;z.push(Y);e:for(;0<se;){var V=se-1>>>1,G=z[V];if(0<a(G,Y))z[V]=Y,z[se]=G,se=V;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var Y=z[0],se=z.pop();if(se!==Y){z[0]=se;e:for(var V=0,G=z.length,ge=G>>>1;V<ge;){var he=2*(V+1)-1,ke=z[he],P=he+1,X=z[P];if(0>a(ke,se))P<G&&0>a(X,ke)?(z[V]=X,z[P]=se,V=P):(z[V]=ke,z[he]=se,V=he);else if(P<G&&0>a(X,se))z[V]=X,z[P]=se,V=P;else break e}}return Y}function a(z,Y){var se=z.sortIndex-Y.sortIndex;return se!==0?se:z.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],d=[],m=1,f=null,p=3,N=!1,v=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,u=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(z){for(var Y=n(d);Y!==null;){if(Y.callback===null)r(d);else if(Y.startTime<=z)r(d),Y.sortIndex=Y.expirationTime,t(c,Y);else break;Y=n(d)}}function _(z){if(w=!1,g(z),!v)if(n(c)!==null)v=!0,ce(L);else{var Y=n(d);Y!==null&&xe(_,Y.startTime-z)}}function L(z,Y){v=!1,w&&(w=!1,y(E),E=-1),N=!0;var se=p;try{for(g(Y),f=n(c);f!==null&&(!(f.expirationTime>Y)||z&&!A());){var V=f.callback;if(typeof V=="function"){f.callback=null,p=f.priorityLevel;var G=V(f.expirationTime<=Y);Y=e.unstable_now(),typeof G=="function"?f.callback=G:f===n(c)&&r(c),g(Y)}else r(c);f=n(c)}if(f!==null)var ge=!0;else{var he=n(d);he!==null&&xe(_,he.startTime-Y),ge=!1}return ge}finally{f=null,p=se,N=!1}}var D=!1,R=null,E=-1,U=5,q=-1;function A(){return!(e.unstable_now()-q<U)}function te(){if(R!==null){var z=e.unstable_now();q=z;var Y=!0;try{Y=R(!0,z)}finally{Y?Q():(D=!1,R=null)}}else D=!1}var Q;if(typeof u=="function")Q=function(){u(te)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,ae=ne.port2;ne.port1.onmessage=te,Q=function(){ae.postMessage(null)}}else Q=function(){k(te,0)};function ce(z){R=z,D||(D=!0,Q())}function xe(z,Y){E=k(function(){z(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_continueExecution=function(){v||N||(v=!0,ce(L))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(z){switch(p){case 1:case 2:case 3:var Y=3;break;default:Y=p}var se=p;p=Y;try{return z()}finally{p=se}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,Y){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var se=p;p=z;try{return Y()}finally{p=se}},e.unstable_scheduleCallback=function(z,Y,se){var V=e.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?V+se:V):se=V,z){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=se+G,z={id:m++,callback:Y,priorityLevel:z,startTime:se,expirationTime:G,sortIndex:-1},se>V?(z.sortIndex=se,t(d,z),n(c)===null&&z===n(d)&&(w?(y(E),E=-1):w=!0,xe(_,se-V))):(z.sortIndex=G,t(c,z),v||N||(v=!0,ce(L))),z},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(z){var Y=p;return function(){var se=p;p=Y;try{return z.apply(this,arguments)}finally{p=se}}}})(Gu);Ju.exports=Gu;var hf=Ju.exports;/**
|
||
* @license React
|
||
* react-dom.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var gf=x,vt=hf;function B(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 Xu=new Set,wr={};function ds(e,t){As(e,t),As(e+"Capture",t)}function As(e,t){for(wr[e]=t,e=0;e<t.length;e++)Xu.add(t[e])}var on=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ki=Object.prototype.hasOwnProperty,yf=/^[: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]*$/,$c={},Oc={};function vf(e){return ki.call(Oc,e)?!0:ki.call($c,e)?!1:yf.test(e)?Oc[e]=!0:($c[e]=!0,!1)}function wf(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function jf(e,t,n,r){if(t===null||typeof t>"u"||wf(e,t,n,r))return!0;if(r)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 lt(e,t,n,r,a,l,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=i}var Qe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qe[e]=new lt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qe[t]=new lt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qe[e]=new lt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qe[e]=new lt(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){Qe[e]=new lt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qe[e]=new lt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qe[e]=new lt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qe[e]=new lt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qe[e]=new lt(e,5,!1,e.toLowerCase(),null,!1,!1)});var To=/[\-:]([a-z])/g;function Po(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(To,Po);Qe[t]=new lt(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(To,Po);Qe[t]=new lt(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(To,Po);Qe[t]=new lt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qe[e]=new lt(e,1,!1,e.toLowerCase(),null,!1,!1)});Qe.xlinkHref=new lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qe[e]=new lt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Lo(e,t,n,r){var a=Qe.hasOwnProperty(t)?Qe[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(jf(t,n,a,r)&&(n=null),r||a===null?vf(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,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var mn=gf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,sa=Symbol.for("react.element"),xs=Symbol.for("react.portal"),hs=Symbol.for("react.fragment"),Ao=Symbol.for("react.strict_mode"),bi=Symbol.for("react.profiler"),Yu=Symbol.for("react.provider"),Zu=Symbol.for("react.context"),$o=Symbol.for("react.forward_ref"),Ni=Symbol.for("react.suspense"),Si=Symbol.for("react.suspense_list"),Oo=Symbol.for("react.memo"),gn=Symbol.for("react.lazy"),ep=Symbol.for("react.offscreen"),Ic=Symbol.iterator;function Qs(e){return e===null||typeof e!="object"?null:(e=Ic&&e[Ic]||e["@@iterator"],typeof e=="function"?e:null)}var Ae=Object.assign,Ml;function ar(e){if(Ml===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ml=t&&t[1]||""}return`
|
||
`+Ml+e}var Dl=!1;function zl(e,t){if(!e||Dl)return"";Dl=!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(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var a=d.stack.split(`
|
||
`),l=r.stack.split(`
|
||
`),i=a.length-1,o=l.length-1;1<=i&&0<=o&&a[i]!==l[o];)o--;for(;1<=i&&0<=o;i--,o--)if(a[i]!==l[o]){if(i!==1||o!==1)do if(i--,o--,0>o||a[i]!==l[o]){var c=`
|
||
`+a[i].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=i&&0<=o);break}}}finally{Dl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ar(e):""}function kf(e){switch(e.tag){case 5:return ar(e.type);case 16:return ar("Lazy");case 13:return ar("Suspense");case 19:return ar("SuspenseList");case 0:case 2:case 15:return e=zl(e.type,!1),e;case 11:return e=zl(e.type.render,!1),e;case 1:return e=zl(e.type,!0),e;default:return""}}function _i(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 hs:return"Fragment";case xs:return"Portal";case bi:return"Profiler";case Ao:return"StrictMode";case Ni:return"Suspense";case Si:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Zu:return(e.displayName||"Context")+".Consumer";case Yu:return(e._context.displayName||"Context")+".Provider";case $o:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Oo:return t=e.displayName||null,t!==null?t:_i(e.type)||"Memo";case gn:t=e._payload,e=e._init;try{return _i(e(t))}catch{}}return null}function bf(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 _i(t);case 8:return t===Ao?"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 $n(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Nf(e){var t=tp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(i){r=""+i,l.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ra(e){e._valueTracker||(e._valueTracker=Nf(e))}function np(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=tp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ia(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 Ci(e,t){var n=t.checked;return Ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Mc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=$n(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function sp(e,t){t=t.checked,t!=null&&Lo(e,"checked",t,!1)}function Ei(e,t){sp(e,t);var n=$n(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ri(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ri(e,t.type,$n(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Dc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="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 Ri(e,t,n){(t!=="number"||Ia(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var lr=Array.isArray;function Cs(e,t,n,r){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&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$n(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Ti(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return Ae({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function zc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(lr(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:$n(n)}}function rp(e,t){var n=$n(t.value),r=$n(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Fc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ap(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Pi(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ap(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var aa,lp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(aa=aa||document.createElement("div"),aa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=aa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function jr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dr={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},Sf=["Webkit","ms","Moz","O"];Object.keys(dr).forEach(function(e){Sf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),dr[t]=dr[e]})});function ip(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||dr.hasOwnProperty(e)&&dr[e]?(""+t).trim():t+"px"}function op(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=ip(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var _f=Ae({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 Li(e,t){if(t){if(_f[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function Ai(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 $i=null;function Io(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Oi=null,Es=null,Rs=null;function Uc(e){if(e=Wr(e)){if(typeof Oi!="function")throw Error(B(280));var t=e.stateNode;t&&(t=gl(t),Oi(e.stateNode,e.type,t))}}function cp(e){Es?Rs?Rs.push(e):Rs=[e]:Es=e}function dp(){if(Es){var e=Es,t=Rs;if(Rs=Es=null,Uc(e),t)for(e=0;e<t.length;e++)Uc(t[e])}}function up(e,t){return e(t)}function pp(){}var Fl=!1;function mp(e,t,n){if(Fl)return e(t,n);Fl=!0;try{return up(e,t,n)}finally{Fl=!1,(Es!==null||Rs!==null)&&(pp(),dp())}}function kr(e,t){var n=e.stateNode;if(n===null)return null;var r=gl(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(B(231,t,typeof n));return n}var Ii=!1;if(on)try{var Js={};Object.defineProperty(Js,"passive",{get:function(){Ii=!0}}),window.addEventListener("test",Js,Js),window.removeEventListener("test",Js,Js)}catch{Ii=!1}function Cf(e,t,n,r,a,l,i,o,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(m){this.onError(m)}}var ur=!1,Ma=null,Da=!1,Mi=null,Ef={onError:function(e){ur=!0,Ma=e}};function Rf(e,t,n,r,a,l,i,o,c){ur=!1,Ma=null,Cf.apply(Ef,arguments)}function Tf(e,t,n,r,a,l,i,o,c){if(Rf.apply(this,arguments),ur){if(ur){var d=Ma;ur=!1,Ma=null}else throw Error(B(198));Da||(Da=!0,Mi=d)}}function us(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function fp(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 Bc(e){if(us(e)!==e)throw Error(B(188))}function Pf(e){var t=e.alternate;if(!t){if(t=us(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var l=a.alternate;if(l===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===l.child){for(l=a.child;l;){if(l===n)return Bc(a),e;if(l===r)return Bc(a),t;l=l.sibling}throw Error(B(188))}if(n.return!==r.return)n=a,r=l;else{for(var i=!1,o=a.child;o;){if(o===n){i=!0,n=a,r=l;break}if(o===r){i=!0,r=a,n=l;break}o=o.sibling}if(!i){for(o=l.child;o;){if(o===n){i=!0,n=l,r=a;break}if(o===r){i=!0,r=l,n=a;break}o=o.sibling}if(!i)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function xp(e){return e=Pf(e),e!==null?hp(e):null}function hp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=hp(e);if(t!==null)return t;e=e.sibling}return null}var gp=vt.unstable_scheduleCallback,Vc=vt.unstable_cancelCallback,Lf=vt.unstable_shouldYield,Af=vt.unstable_requestPaint,Ie=vt.unstable_now,$f=vt.unstable_getCurrentPriorityLevel,Mo=vt.unstable_ImmediatePriority,yp=vt.unstable_UserBlockingPriority,za=vt.unstable_NormalPriority,Of=vt.unstable_LowPriority,vp=vt.unstable_IdlePriority,ml=null,Qt=null;function If(e){if(Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(ml,e,void 0,(e.current.flags&128)===128)}catch{}}var Dt=Math.clz32?Math.clz32:zf,Mf=Math.log,Df=Math.LN2;function zf(e){return e>>>=0,e===0?32:31-(Mf(e)/Df|0)|0}var la=64,ia=4194304;function ir(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,l=e.pingedLanes,i=n&268435455;if(i!==0){var o=i&~a;o!==0?r=ir(o):(l&=i,l!==0&&(r=ir(l)))}else i=n&~a,i!==0?r=ir(i):l!==0&&(r=ir(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,l=t&-t,a>=l||a===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Dt(t),a=1<<n,r|=e[n],t&=~a;return r}function Ff(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 Uf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,l=e.pendingLanes;0<l;){var i=31-Dt(l),o=1<<i,c=a[i];c===-1?(!(o&n)||o&r)&&(a[i]=Ff(o,t)):c<=t&&(e.expiredLanes|=o),l&=~o}}function Di(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function wp(){var e=la;return la<<=1,!(la&4194240)&&(la=64),e}function Ul(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Vr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dt(t),e[t]=n}function Bf(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 r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-Dt(n),l=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~l}}function Do(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Dt(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var be=0;function jp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var kp,zo,bp,Np,Sp,zi=!1,oa=[],Nn=null,Sn=null,_n=null,br=new Map,Nr=new Map,vn=[],Vf="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 Hc(e,t){switch(e){case"focusin":case"focusout":Nn=null;break;case"dragenter":case"dragleave":Sn=null;break;case"mouseover":case"mouseout":_n=null;break;case"pointerover":case"pointerout":br.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nr.delete(t.pointerId)}}function Gs(e,t,n,r,a,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[a]},t!==null&&(t=Wr(t),t!==null&&zo(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Hf(e,t,n,r,a){switch(t){case"focusin":return Nn=Gs(Nn,e,t,n,r,a),!0;case"dragenter":return Sn=Gs(Sn,e,t,n,r,a),!0;case"mouseover":return _n=Gs(_n,e,t,n,r,a),!0;case"pointerover":var l=a.pointerId;return br.set(l,Gs(br.get(l)||null,e,t,n,r,a)),!0;case"gotpointercapture":return l=a.pointerId,Nr.set(l,Gs(Nr.get(l)||null,e,t,n,r,a)),!0}return!1}function _p(e){var t=Kn(e.target);if(t!==null){var n=us(t);if(n!==null){if(t=n.tag,t===13){if(t=fp(n),t!==null){e.blockedOn=t,Sp(e.priority,function(){bp(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 ba(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Fi(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);$i=r,n.target.dispatchEvent(r),$i=null}else return t=Wr(n),t!==null&&zo(t),e.blockedOn=n,!1;t.shift()}return!0}function Wc(e,t,n){ba(e)&&n.delete(t)}function Wf(){zi=!1,Nn!==null&&ba(Nn)&&(Nn=null),Sn!==null&&ba(Sn)&&(Sn=null),_n!==null&&ba(_n)&&(_n=null),br.forEach(Wc),Nr.forEach(Wc)}function Xs(e,t){e.blockedOn===t&&(e.blockedOn=null,zi||(zi=!0,vt.unstable_scheduleCallback(vt.unstable_NormalPriority,Wf)))}function Sr(e){function t(a){return Xs(a,e)}if(0<oa.length){Xs(oa[0],e);for(var n=1;n<oa.length;n++){var r=oa[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Nn!==null&&Xs(Nn,e),Sn!==null&&Xs(Sn,e),_n!==null&&Xs(_n,e),br.forEach(t),Nr.forEach(t),n=0;n<vn.length;n++)r=vn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<vn.length&&(n=vn[0],n.blockedOn===null);)_p(n),n.blockedOn===null&&vn.shift()}var Ts=mn.ReactCurrentBatchConfig,Ua=!0;function qf(e,t,n,r){var a=be,l=Ts.transition;Ts.transition=null;try{be=1,Fo(e,t,n,r)}finally{be=a,Ts.transition=l}}function Kf(e,t,n,r){var a=be,l=Ts.transition;Ts.transition=null;try{be=4,Fo(e,t,n,r)}finally{be=a,Ts.transition=l}}function Fo(e,t,n,r){if(Ua){var a=Fi(e,t,n,r);if(a===null)Xl(e,t,r,Ba,n),Hc(e,r);else if(Hf(a,e,t,n,r))r.stopPropagation();else if(Hc(e,r),t&4&&-1<Vf.indexOf(e)){for(;a!==null;){var l=Wr(a);if(l!==null&&kp(l),l=Fi(e,t,n,r),l===null&&Xl(e,t,r,Ba,n),l===a)break;a=l}a!==null&&r.stopPropagation()}else Xl(e,t,r,null,n)}}var Ba=null;function Fi(e,t,n,r){if(Ba=null,e=Io(r),e=Kn(e),e!==null)if(t=us(e),t===null)e=null;else if(n=t.tag,n===13){if(e=fp(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 Ba=e,null}function Cp(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($f()){case Mo:return 1;case yp:return 4;case za:case Of:return 16;case vp:return 536870912;default:return 16}default:return 16}}var jn=null,Uo=null,Na=null;function Ep(){if(Na)return Na;var e,t=Uo,n=t.length,r,a="value"in jn?jn.value:jn.textContent,l=a.length;for(e=0;e<n&&t[e]===a[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===a[l-r];r++);return Na=a.slice(e,1<r?1-r:void 0)}function Sa(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 ca(){return!0}function qc(){return!1}function jt(e){function t(n,r,a,l,i){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=l,this.target=i,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(l):l[o]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?ca:qc,this.isPropagationStopped=qc,this}return Ae(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=ca)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ca)},persist:function(){},isPersistent:ca}),t}var Vs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bo=jt(Vs),Hr=Ae({},Vs,{view:0,detail:0}),Qf=jt(Hr),Bl,Vl,Ys,fl=Ae({},Hr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vo,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!==Ys&&(Ys&&e.type==="mousemove"?(Bl=e.screenX-Ys.screenX,Vl=e.screenY-Ys.screenY):Vl=Bl=0,Ys=e),Bl)},movementY:function(e){return"movementY"in e?e.movementY:Vl}}),Kc=jt(fl),Jf=Ae({},fl,{dataTransfer:0}),Gf=jt(Jf),Xf=Ae({},Hr,{relatedTarget:0}),Hl=jt(Xf),Yf=Ae({},Vs,{animationName:0,elapsedTime:0,pseudoElement:0}),Zf=jt(Yf),ex=Ae({},Vs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tx=jt(ex),nx=Ae({},Vs,{data:0}),Qc=jt(nx),sx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ax={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ax[e])?!!t[e]:!1}function Vo(){return lx}var ix=Ae({},Hr,{key:function(e){if(e.key){var t=sx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Sa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?rx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vo,charCode:function(e){return e.type==="keypress"?Sa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Sa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ox=jt(ix),cx=Ae({},fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jc=jt(cx),dx=Ae({},Hr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vo}),ux=jt(dx),px=Ae({},Vs,{propertyName:0,elapsedTime:0,pseudoElement:0}),mx=jt(px),fx=Ae({},fl,{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}),xx=jt(fx),hx=[9,13,27,32],Ho=on&&"CompositionEvent"in window,pr=null;on&&"documentMode"in document&&(pr=document.documentMode);var gx=on&&"TextEvent"in window&&!pr,Rp=on&&(!Ho||pr&&8<pr&&11>=pr),Gc=" ",Xc=!1;function Tp(e,t){switch(e){case"keyup":return hx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gs=!1;function yx(e,t){switch(e){case"compositionend":return Pp(t);case"keypress":return t.which!==32?null:(Xc=!0,Gc);case"textInput":return e=t.data,e===Gc&&Xc?null:e;default:return null}}function vx(e,t){if(gs)return e==="compositionend"||!Ho&&Tp(e,t)?(e=Ep(),Na=Uo=jn=null,gs=!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 Rp&&t.locale!=="ko"?null:t.data;default:return null}}var wx={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 Yc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!wx[e.type]:t==="textarea"}function Lp(e,t,n,r){cp(r),t=Va(t,"onChange"),0<t.length&&(n=new Bo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var mr=null,_r=null;function jx(e){Vp(e,0)}function xl(e){var t=ws(e);if(np(t))return e}function kx(e,t){if(e==="change")return t}var Ap=!1;if(on){var Wl;if(on){var ql="oninput"in document;if(!ql){var Zc=document.createElement("div");Zc.setAttribute("oninput","return;"),ql=typeof Zc.oninput=="function"}Wl=ql}else Wl=!1;Ap=Wl&&(!document.documentMode||9<document.documentMode)}function ed(){mr&&(mr.detachEvent("onpropertychange",$p),_r=mr=null)}function $p(e){if(e.propertyName==="value"&&xl(_r)){var t=[];Lp(t,_r,e,Io(e)),mp(jx,t)}}function bx(e,t,n){e==="focusin"?(ed(),mr=t,_r=n,mr.attachEvent("onpropertychange",$p)):e==="focusout"&&ed()}function Nx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return xl(_r)}function Sx(e,t){if(e==="click")return xl(t)}function _x(e,t){if(e==="input"||e==="change")return xl(t)}function Cx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ft=typeof Object.is=="function"?Object.is:Cx;function Cr(e,t){if(Ft(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!ki.call(t,a)||!Ft(e[a],t[a]))return!1}return!0}function td(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nd(e,t){var n=td(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=td(n)}}function Op(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Op(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ip(){for(var e=window,t=Ia();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ia(e.document)}return t}function Wo(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 Ex(e){var t=Ip(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Op(n.ownerDocument.documentElement,n)){if(r!==null&&Wo(n)){if(t=r.start,e=r.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,l=Math.min(r.start,a);r=r.end===void 0?l:Math.min(r.end,a),!e.extend&&l>r&&(a=r,r=l,l=a),a=nd(n,l);var i=nd(n,r);a&&i&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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 Rx=on&&"documentMode"in document&&11>=document.documentMode,ys=null,Ui=null,fr=null,Bi=!1;function sd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bi||ys==null||ys!==Ia(r)||(r=ys,"selectionStart"in r&&Wo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),fr&&Cr(fr,r)||(fr=r,r=Va(Ui,"onSelect"),0<r.length&&(t=new Bo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ys)))}function da(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var vs={animationend:da("Animation","AnimationEnd"),animationiteration:da("Animation","AnimationIteration"),animationstart:da("Animation","AnimationStart"),transitionend:da("Transition","TransitionEnd")},Kl={},Mp={};on&&(Mp=document.createElement("div").style,"AnimationEvent"in window||(delete vs.animationend.animation,delete vs.animationiteration.animation,delete vs.animationstart.animation),"TransitionEvent"in window||delete vs.transitionend.transition);function hl(e){if(Kl[e])return Kl[e];if(!vs[e])return e;var t=vs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mp)return Kl[e]=t[n];return e}var Dp=hl("animationend"),zp=hl("animationiteration"),Fp=hl("animationstart"),Up=hl("transitionend"),Bp=new Map,rd="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 Dn(e,t){Bp.set(e,t),ds(t,[e])}for(var Ql=0;Ql<rd.length;Ql++){var Jl=rd[Ql],Tx=Jl.toLowerCase(),Px=Jl[0].toUpperCase()+Jl.slice(1);Dn(Tx,"on"+Px)}Dn(Dp,"onAnimationEnd");Dn(zp,"onAnimationIteration");Dn(Fp,"onAnimationStart");Dn("dblclick","onDoubleClick");Dn("focusin","onFocus");Dn("focusout","onBlur");Dn(Up,"onTransitionEnd");As("onMouseEnter",["mouseout","mouseover"]);As("onMouseLeave",["mouseout","mouseover"]);As("onPointerEnter",["pointerout","pointerover"]);As("onPointerLeave",["pointerout","pointerover"]);ds("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ds("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ds("onBeforeInput",["compositionend","keypress","textInput","paste"]);ds("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ds("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ds("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var or="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(" "),Lx=new Set("cancel close invalid load scroll toggle".split(" ").concat(or));function ad(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Tf(r,t,void 0,e),e.currentTarget=null}function Vp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var i=r.length-1;0<=i;i--){var o=r[i],c=o.instance,d=o.currentTarget;if(o=o.listener,c!==l&&a.isPropagationStopped())break e;ad(a,o,d),l=c}else for(i=0;i<r.length;i++){if(o=r[i],c=o.instance,d=o.currentTarget,o=o.listener,c!==l&&a.isPropagationStopped())break e;ad(a,o,d),l=c}}}if(Da)throw e=Mi,Da=!1,Mi=null,e}function _e(e,t){var n=t[Ki];n===void 0&&(n=t[Ki]=new Set);var r=e+"__bubble";n.has(r)||(Hp(t,e,2,!1),n.add(r))}function Gl(e,t,n){var r=0;t&&(r|=4),Hp(n,e,r,t)}var ua="_reactListening"+Math.random().toString(36).slice(2);function Er(e){if(!e[ua]){e[ua]=!0,Xu.forEach(function(n){n!=="selectionchange"&&(Lx.has(n)||Gl(n,!1,e),Gl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ua]||(t[ua]=!0,Gl("selectionchange",!1,t))}}function Hp(e,t,n,r){switch(Cp(t)){case 1:var a=qf;break;case 4:a=Kf;break;default:a=Fo}n=a.bind(null,t,n,e),a=void 0,!Ii||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?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 Xl(e,t,n,r,a){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var o=r.stateNode.containerInfo;if(o===a||o.nodeType===8&&o.parentNode===a)break;if(i===4)for(i=r.return;i!==null;){var c=i.tag;if((c===3||c===4)&&(c=i.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;i=i.return}for(;o!==null;){if(i=Kn(o),i===null)return;if(c=i.tag,c===5||c===6){r=l=i;continue e}o=o.parentNode}}r=r.return}mp(function(){var d=l,m=Io(n),f=[];e:{var p=Bp.get(e);if(p!==void 0){var N=Bo,v=e;switch(e){case"keypress":if(Sa(n)===0)break e;case"keydown":case"keyup":N=ox;break;case"focusin":v="focus",N=Hl;break;case"focusout":v="blur",N=Hl;break;case"beforeblur":case"afterblur":N=Hl;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":N=Kc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":N=Gf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":N=ux;break;case Dp:case zp:case Fp:N=Zf;break;case Up:N=mx;break;case"scroll":N=Qf;break;case"wheel":N=xx;break;case"copy":case"cut":case"paste":N=tx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":N=Jc}var w=(t&4)!==0,k=!w&&e==="scroll",y=w?p!==null?p+"Capture":null:p;w=[];for(var u=d,g;u!==null;){g=u;var _=g.stateNode;if(g.tag===5&&_!==null&&(g=_,y!==null&&(_=kr(u,y),_!=null&&w.push(Rr(u,_,g)))),k)break;u=u.return}0<w.length&&(p=new N(p,v,null,n,m),f.push({event:p,listeners:w}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",N=e==="mouseout"||e==="pointerout",p&&n!==$i&&(v=n.relatedTarget||n.fromElement)&&(Kn(v)||v[cn]))break e;if((N||p)&&(p=m.window===m?m:(p=m.ownerDocument)?p.defaultView||p.parentWindow:window,N?(v=n.relatedTarget||n.toElement,N=d,v=v?Kn(v):null,v!==null&&(k=us(v),v!==k||v.tag!==5&&v.tag!==6)&&(v=null)):(N=null,v=d),N!==v)){if(w=Kc,_="onMouseLeave",y="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(w=Jc,_="onPointerLeave",y="onPointerEnter",u="pointer"),k=N==null?p:ws(N),g=v==null?p:ws(v),p=new w(_,u+"leave",N,n,m),p.target=k,p.relatedTarget=g,_=null,Kn(m)===d&&(w=new w(y,u+"enter",v,n,m),w.target=g,w.relatedTarget=k,_=w),k=_,N&&v)t:{for(w=N,y=v,u=0,g=w;g;g=ms(g))u++;for(g=0,_=y;_;_=ms(_))g++;for(;0<u-g;)w=ms(w),u--;for(;0<g-u;)y=ms(y),g--;for(;u--;){if(w===y||y!==null&&w===y.alternate)break t;w=ms(w),y=ms(y)}w=null}else w=null;N!==null&&ld(f,p,N,w,!1),v!==null&&k!==null&&ld(f,k,v,w,!0)}}e:{if(p=d?ws(d):window,N=p.nodeName&&p.nodeName.toLowerCase(),N==="select"||N==="input"&&p.type==="file")var L=kx;else if(Yc(p))if(Ap)L=_x;else{L=Nx;var D=bx}else(N=p.nodeName)&&N.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(L=Sx);if(L&&(L=L(e,d))){Lp(f,L,n,m);break e}D&&D(e,p,d),e==="focusout"&&(D=p._wrapperState)&&D.controlled&&p.type==="number"&&Ri(p,"number",p.value)}switch(D=d?ws(d):window,e){case"focusin":(Yc(D)||D.contentEditable==="true")&&(ys=D,Ui=d,fr=null);break;case"focusout":fr=Ui=ys=null;break;case"mousedown":Bi=!0;break;case"contextmenu":case"mouseup":case"dragend":Bi=!1,sd(f,n,m);break;case"selectionchange":if(Rx)break;case"keydown":case"keyup":sd(f,n,m)}var R;if(Ho)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else gs?Tp(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Rp&&n.locale!=="ko"&&(gs||E!=="onCompositionStart"?E==="onCompositionEnd"&&gs&&(R=Ep()):(jn=m,Uo="value"in jn?jn.value:jn.textContent,gs=!0)),D=Va(d,E),0<D.length&&(E=new Qc(E,e,null,n,m),f.push({event:E,listeners:D}),R?E.data=R:(R=Pp(n),R!==null&&(E.data=R)))),(R=gx?yx(e,n):vx(e,n))&&(d=Va(d,"onBeforeInput"),0<d.length&&(m=new Qc("onBeforeInput","beforeinput",null,n,m),f.push({event:m,listeners:d}),m.data=R))}Vp(f,t)})}function Rr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Va(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,l=a.stateNode;a.tag===5&&l!==null&&(a=l,l=kr(e,n),l!=null&&r.unshift(Rr(e,l,a)),l=kr(e,t),l!=null&&r.push(Rr(e,l,a))),e=e.return}return r}function ms(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ld(e,t,n,r,a){for(var l=t._reactName,i=[];n!==null&&n!==r;){var o=n,c=o.alternate,d=o.stateNode;if(c!==null&&c===r)break;o.tag===5&&d!==null&&(o=d,a?(c=kr(n,l),c!=null&&i.unshift(Rr(n,c,o))):a||(c=kr(n,l),c!=null&&i.push(Rr(n,c,o)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var Ax=/\r\n?/g,$x=/\u0000|\uFFFD/g;function id(e){return(typeof e=="string"?e:""+e).replace(Ax,`
|
||
`).replace($x,"")}function pa(e,t,n){if(t=id(t),id(e)!==t&&n)throw Error(B(425))}function Ha(){}var Vi=null,Hi=null;function Wi(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,Ox=typeof clearTimeout=="function"?clearTimeout:void 0,od=typeof Promise=="function"?Promise:void 0,Ix=typeof queueMicrotask=="function"?queueMicrotask:typeof od<"u"?function(e){return od.resolve(null).then(e).catch(Mx)}:qi;function Mx(e){setTimeout(function(){throw e})}function Yl(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),Sr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);Sr(t)}function Cn(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 cd(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 Hs=Math.random().toString(36).slice(2),Ht="__reactFiber$"+Hs,Tr="__reactProps$"+Hs,cn="__reactContainer$"+Hs,Ki="__reactEvents$"+Hs,Dx="__reactListeners$"+Hs,zx="__reactHandles$"+Hs;function Kn(e){var t=e[Ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[cn]||n[Ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=cd(e);e!==null;){if(n=e[Ht])return n;e=cd(e)}return t}e=n,n=e.parentNode}return null}function Wr(e){return e=e[Ht]||e[cn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ws(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function gl(e){return e[Tr]||null}var Qi=[],js=-1;function zn(e){return{current:e}}function Ce(e){0>js||(e.current=Qi[js],Qi[js]=null,js--)}function Ne(e,t){js++,Qi[js]=e.current,e.current=t}var On={},et=zn(On),ct=zn(!1),ss=On;function $s(e,t){var n=e.type.contextTypes;if(!n)return On;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},l;for(l in n)a[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function dt(e){return e=e.childContextTypes,e!=null}function Wa(){Ce(ct),Ce(et)}function dd(e,t,n){if(et.current!==On)throw Error(B(168));Ne(et,t),Ne(ct,n)}function Wp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(B(108,bf(e)||"Unknown",a));return Ae({},n,r)}function qa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||On,ss=et.current,Ne(et,e),Ne(ct,ct.current),!0}function ud(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=Wp(e,t,ss),r.__reactInternalMemoizedMergedChildContext=e,Ce(ct),Ce(et),Ne(et,e)):Ce(ct),Ne(ct,n)}var tn=null,yl=!1,Zl=!1;function qp(e){tn===null?tn=[e]:tn.push(e)}function Fx(e){yl=!0,qp(e)}function Fn(){if(!Zl&&tn!==null){Zl=!0;var e=0,t=be;try{var n=tn;for(be=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}tn=null,yl=!1}catch(a){throw tn!==null&&(tn=tn.slice(e+1)),gp(Mo,Fn),a}finally{be=t,Zl=!1}}return null}var ks=[],bs=0,Ka=null,Qa=0,Nt=[],St=0,rs=null,sn=1,rn="";function Wn(e,t){ks[bs++]=Qa,ks[bs++]=Ka,Ka=e,Qa=t}function Kp(e,t,n){Nt[St++]=sn,Nt[St++]=rn,Nt[St++]=rs,rs=e;var r=sn;e=rn;var a=32-Dt(r)-1;r&=~(1<<a),n+=1;var l=32-Dt(t)+a;if(30<l){var i=a-a%5;l=(r&(1<<i)-1).toString(32),r>>=i,a-=i,sn=1<<32-Dt(t)+a|n<<a|r,rn=l+e}else sn=1<<l|n<<a|r,rn=e}function qo(e){e.return!==null&&(Wn(e,1),Kp(e,1,0))}function Ko(e){for(;e===Ka;)Ka=ks[--bs],ks[bs]=null,Qa=ks[--bs],ks[bs]=null;for(;e===rs;)rs=Nt[--St],Nt[St]=null,rn=Nt[--St],Nt[St]=null,sn=Nt[--St],Nt[St]=null}var gt=null,ht=null,Re=!1,It=null;function Qp(e,t){var n=_t(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 pd(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,gt=e,ht=Cn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,gt=e,ht=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=rs!==null?{id:sn,overflow:rn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=_t(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,gt=e,ht=null,!0):!1;default:return!1}}function Ji(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gi(e){if(Re){var t=ht;if(t){var n=t;if(!pd(e,t)){if(Ji(e))throw Error(B(418));t=Cn(n.nextSibling);var r=gt;t&&pd(e,t)?Qp(r,n):(e.flags=e.flags&-4097|2,Re=!1,gt=e)}}else{if(Ji(e))throw Error(B(418));e.flags=e.flags&-4097|2,Re=!1,gt=e}}}function md(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;gt=e}function ma(e){if(e!==gt)return!1;if(!Re)return md(e),Re=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Wi(e.type,e.memoizedProps)),t&&(t=ht)){if(Ji(e))throw Jp(),Error(B(418));for(;t;)Qp(e,t),t=Cn(t.nextSibling)}if(md(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ht=Cn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ht=null}}else ht=gt?Cn(e.stateNode.nextSibling):null;return!0}function Jp(){for(var e=ht;e;)e=Cn(e.nextSibling)}function Os(){ht=gt=null,Re=!1}function Qo(e){It===null?It=[e]:It.push(e)}var Ux=mn.ReactCurrentBatchConfig;function Zs(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(B(309));var r=n.stateNode}if(!r)throw Error(B(147,e));var a=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(i){var o=a.refs;i===null?delete o[l]:o[l]=i},t._stringRef=l,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function fa(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function fd(e){var t=e._init;return t(e._payload)}function Gp(e){function t(y,u){if(e){var g=y.deletions;g===null?(y.deletions=[u],y.flags|=16):g.push(u)}}function n(y,u){if(!e)return null;for(;u!==null;)t(y,u),u=u.sibling;return null}function r(y,u){for(y=new Map;u!==null;)u.key!==null?y.set(u.key,u):y.set(u.index,u),u=u.sibling;return y}function a(y,u){return y=Pn(y,u),y.index=0,y.sibling=null,y}function l(y,u,g){return y.index=g,e?(g=y.alternate,g!==null?(g=g.index,g<u?(y.flags|=2,u):g):(y.flags|=2,u)):(y.flags|=1048576,u)}function i(y){return e&&y.alternate===null&&(y.flags|=2),y}function o(y,u,g,_){return u===null||u.tag!==6?(u=li(g,y.mode,_),u.return=y,u):(u=a(u,g),u.return=y,u)}function c(y,u,g,_){var L=g.type;return L===hs?m(y,u,g.props.children,_,g.key):u!==null&&(u.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===gn&&fd(L)===u.type)?(_=a(u,g.props),_.ref=Zs(y,u,g),_.return=y,_):(_=La(g.type,g.key,g.props,null,y.mode,_),_.ref=Zs(y,u,g),_.return=y,_)}function d(y,u,g,_){return u===null||u.tag!==4||u.stateNode.containerInfo!==g.containerInfo||u.stateNode.implementation!==g.implementation?(u=ii(g,y.mode,_),u.return=y,u):(u=a(u,g.children||[]),u.return=y,u)}function m(y,u,g,_,L){return u===null||u.tag!==7?(u=Yn(g,y.mode,_,L),u.return=y,u):(u=a(u,g),u.return=y,u)}function f(y,u,g){if(typeof u=="string"&&u!==""||typeof u=="number")return u=li(""+u,y.mode,g),u.return=y,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case sa:return g=La(u.type,u.key,u.props,null,y.mode,g),g.ref=Zs(y,null,u),g.return=y,g;case xs:return u=ii(u,y.mode,g),u.return=y,u;case gn:var _=u._init;return f(y,_(u._payload),g)}if(lr(u)||Qs(u))return u=Yn(u,y.mode,g,null),u.return=y,u;fa(y,u)}return null}function p(y,u,g,_){var L=u!==null?u.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return L!==null?null:o(y,u,""+g,_);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case sa:return g.key===L?c(y,u,g,_):null;case xs:return g.key===L?d(y,u,g,_):null;case gn:return L=g._init,p(y,u,L(g._payload),_)}if(lr(g)||Qs(g))return L!==null?null:m(y,u,g,_,null);fa(y,g)}return null}function N(y,u,g,_,L){if(typeof _=="string"&&_!==""||typeof _=="number")return y=y.get(g)||null,o(u,y,""+_,L);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case sa:return y=y.get(_.key===null?g:_.key)||null,c(u,y,_,L);case xs:return y=y.get(_.key===null?g:_.key)||null,d(u,y,_,L);case gn:var D=_._init;return N(y,u,g,D(_._payload),L)}if(lr(_)||Qs(_))return y=y.get(g)||null,m(u,y,_,L,null);fa(u,_)}return null}function v(y,u,g,_){for(var L=null,D=null,R=u,E=u=0,U=null;R!==null&&E<g.length;E++){R.index>E?(U=R,R=null):U=R.sibling;var q=p(y,R,g[E],_);if(q===null){R===null&&(R=U);break}e&&R&&q.alternate===null&&t(y,R),u=l(q,u,E),D===null?L=q:D.sibling=q,D=q,R=U}if(E===g.length)return n(y,R),Re&&Wn(y,E),L;if(R===null){for(;E<g.length;E++)R=f(y,g[E],_),R!==null&&(u=l(R,u,E),D===null?L=R:D.sibling=R,D=R);return Re&&Wn(y,E),L}for(R=r(y,R);E<g.length;E++)U=N(R,y,E,g[E],_),U!==null&&(e&&U.alternate!==null&&R.delete(U.key===null?E:U.key),u=l(U,u,E),D===null?L=U:D.sibling=U,D=U);return e&&R.forEach(function(A){return t(y,A)}),Re&&Wn(y,E),L}function w(y,u,g,_){var L=Qs(g);if(typeof L!="function")throw Error(B(150));if(g=L.call(g),g==null)throw Error(B(151));for(var D=L=null,R=u,E=u=0,U=null,q=g.next();R!==null&&!q.done;E++,q=g.next()){R.index>E?(U=R,R=null):U=R.sibling;var A=p(y,R,q.value,_);if(A===null){R===null&&(R=U);break}e&&R&&A.alternate===null&&t(y,R),u=l(A,u,E),D===null?L=A:D.sibling=A,D=A,R=U}if(q.done)return n(y,R),Re&&Wn(y,E),L;if(R===null){for(;!q.done;E++,q=g.next())q=f(y,q.value,_),q!==null&&(u=l(q,u,E),D===null?L=q:D.sibling=q,D=q);return Re&&Wn(y,E),L}for(R=r(y,R);!q.done;E++,q=g.next())q=N(R,y,E,q.value,_),q!==null&&(e&&q.alternate!==null&&R.delete(q.key===null?E:q.key),u=l(q,u,E),D===null?L=q:D.sibling=q,D=q);return e&&R.forEach(function(te){return t(y,te)}),Re&&Wn(y,E),L}function k(y,u,g,_){if(typeof g=="object"&&g!==null&&g.type===hs&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case sa:e:{for(var L=g.key,D=u;D!==null;){if(D.key===L){if(L=g.type,L===hs){if(D.tag===7){n(y,D.sibling),u=a(D,g.props.children),u.return=y,y=u;break e}}else if(D.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===gn&&fd(L)===D.type){n(y,D.sibling),u=a(D,g.props),u.ref=Zs(y,D,g),u.return=y,y=u;break e}n(y,D);break}else t(y,D);D=D.sibling}g.type===hs?(u=Yn(g.props.children,y.mode,_,g.key),u.return=y,y=u):(_=La(g.type,g.key,g.props,null,y.mode,_),_.ref=Zs(y,u,g),_.return=y,y=_)}return i(y);case xs:e:{for(D=g.key;u!==null;){if(u.key===D)if(u.tag===4&&u.stateNode.containerInfo===g.containerInfo&&u.stateNode.implementation===g.implementation){n(y,u.sibling),u=a(u,g.children||[]),u.return=y,y=u;break e}else{n(y,u);break}else t(y,u);u=u.sibling}u=ii(g,y.mode,_),u.return=y,y=u}return i(y);case gn:return D=g._init,k(y,u,D(g._payload),_)}if(lr(g))return v(y,u,g,_);if(Qs(g))return w(y,u,g,_);fa(y,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,u!==null&&u.tag===6?(n(y,u.sibling),u=a(u,g),u.return=y,y=u):(n(y,u),u=li(g,y.mode,_),u.return=y,y=u),i(y)):n(y,u)}return k}var Is=Gp(!0),Xp=Gp(!1),Ja=zn(null),Ga=null,Ns=null,Jo=null;function Go(){Jo=Ns=Ga=null}function Xo(e){var t=Ja.current;Ce(Ja),e._currentValue=t}function Xi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ps(e,t){Ga=e,Jo=Ns=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ot=!0),e.firstContext=null)}function Rt(e){var t=e._currentValue;if(Jo!==e)if(e={context:e,memoizedValue:t,next:null},Ns===null){if(Ga===null)throw Error(B(308));Ns=e,Ga.dependencies={lanes:0,firstContext:e}}else Ns=Ns.next=e;return t}var Qn=null;function Yo(e){Qn===null?Qn=[e]:Qn.push(e)}function Yp(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,Yo(t)):(n.next=a.next,a.next=n),t.interleaved=n,dn(e,r)}function dn(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 yn=!1;function Zo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zp(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 an(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function En(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,je&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,dn(e,n)}return a=r.interleaved,a===null?(t.next=t,Yo(r)):(t.next=a.next,a.next=t),r.interleaved=t,dn(e,n)}function _a(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Do(e,n)}}function xd(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?a=l=i:l=l.next=i,n=n.next}while(n!==null);l===null?a=l=t:l=l.next=t}else a=l=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Xa(e,t,n,r){var a=e.updateQueue;yn=!1;var l=a.firstBaseUpdate,i=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,d=c.next;c.next=null,i===null?l=d:i.next=d,i=c;var m=e.alternate;m!==null&&(m=m.updateQueue,o=m.lastBaseUpdate,o!==i&&(o===null?m.firstBaseUpdate=d:o.next=d,m.lastBaseUpdate=c))}if(l!==null){var f=a.baseState;i=0,m=d=c=null,o=l;do{var p=o.lane,N=o.eventTime;if((r&p)===p){m!==null&&(m=m.next={eventTime:N,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var v=e,w=o;switch(p=t,N=n,w.tag){case 1:if(v=w.payload,typeof v=="function"){f=v.call(N,f,p);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,p=typeof v=="function"?v.call(N,f,p):v,p==null)break e;f=Ae({},f,p);break e;case 2:yn=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[o]:p.push(o))}else N={eventTime:N,lane:p,tag:o.tag,payload:o.payload,callback:o.callback,next:null},m===null?(d=m=N,c=f):m=m.next=N,i|=p;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;p=o,o=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);if(m===null&&(c=f),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=m,t=a.shared.interleaved,t!==null){a=t;do i|=a.lane,a=a.next;while(a!==t)}else l===null&&(a.shared.lanes=0);ls|=i,e.lanes=i,e.memoizedState=f}}function hd(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(B(191,a));a.call(r)}}}var qr={},Jt=zn(qr),Pr=zn(qr),Lr=zn(qr);function Jn(e){if(e===qr)throw Error(B(174));return e}function ec(e,t){switch(Ne(Lr,t),Ne(Pr,e),Ne(Jt,qr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Pi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Pi(t,e)}Ce(Jt),Ne(Jt,t)}function Ms(){Ce(Jt),Ce(Pr),Ce(Lr)}function em(e){Jn(Lr.current);var t=Jn(Jt.current),n=Pi(t,e.type);t!==n&&(Ne(Pr,e),Ne(Jt,n))}function tc(e){Pr.current===e&&(Ce(Jt),Ce(Pr))}var Pe=zn(0);function Ya(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)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 ei=[];function nc(){for(var e=0;e<ei.length;e++)ei[e]._workInProgressVersionPrimary=null;ei.length=0}var Ca=mn.ReactCurrentDispatcher,ti=mn.ReactCurrentBatchConfig,as=0,Le=null,Fe=null,Be=null,Za=!1,xr=!1,Ar=0,Bx=0;function Je(){throw Error(B(321))}function sc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ft(e[n],t[n]))return!1;return!0}function rc(e,t,n,r,a,l){if(as=l,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ca.current=e===null||e.memoizedState===null?qx:Kx,e=n(r,a),xr){l=0;do{if(xr=!1,Ar=0,25<=l)throw Error(B(301));l+=1,Be=Fe=null,t.updateQueue=null,Ca.current=Qx,e=n(r,a)}while(xr)}if(Ca.current=el,t=Fe!==null&&Fe.next!==null,as=0,Be=Fe=Le=null,Za=!1,t)throw Error(B(300));return e}function ac(){var e=Ar!==0;return Ar=0,e}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Be===null?Le.memoizedState=Be=e:Be=Be.next=e,Be}function Tt(){if(Fe===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=Be===null?Le.memoizedState:Be.next;if(t!==null)Be=t,Fe=e;else{if(e===null)throw Error(B(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},Be===null?Le.memoizedState=Be=e:Be=Be.next=e}return Be}function $r(e,t){return typeof t=="function"?t(e):t}function ni(e){var t=Tt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=Fe,a=r.baseQueue,l=n.pending;if(l!==null){if(a!==null){var i=a.next;a.next=l.next,l.next=i}r.baseQueue=a=l,n.pending=null}if(a!==null){l=a.next,r=r.baseState;var o=i=null,c=null,d=l;do{var m=d.lane;if((as&m)===m)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var f={lane:m,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(o=c=f,i=r):c=c.next=f,Le.lanes|=m,ls|=m}d=d.next}while(d!==null&&d!==l);c===null?i=r:c.next=o,Ft(r,t.memoizedState)||(ot=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do l=a.lane,Le.lanes|=l,ls|=l,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function si(e){var t=Tt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,l=t.memoizedState;if(a!==null){n.pending=null;var i=a=a.next;do l=e(l,i.action),i=i.next;while(i!==a);Ft(l,t.memoizedState)||(ot=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function tm(){}function nm(e,t){var n=Le,r=Tt(),a=t(),l=!Ft(r.memoizedState,a);if(l&&(r.memoizedState=a,ot=!0),r=r.queue,lc(am.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||Be!==null&&Be.memoizedState.tag&1){if(n.flags|=2048,Or(9,rm.bind(null,n,r,a,t),void 0,null),Ve===null)throw Error(B(349));as&30||sm(n,t,a)}return a}function sm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Le.updateQueue,t===null?(t={lastEffect:null,stores:null},Le.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function rm(e,t,n,r){t.value=n,t.getSnapshot=r,lm(t)&&im(e)}function am(e,t,n){return n(function(){lm(t)&&im(e)})}function lm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ft(e,n)}catch{return!0}}function im(e){var t=dn(e,1);t!==null&&zt(t,e,1,-1)}function gd(e){var t=Vt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$r,lastRenderedState:e},t.queue=e,e=e.dispatch=Wx.bind(null,Le,e),[t.memoizedState,e]}function Or(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Le.updateQueue,t===null?(t={lastEffect:null,stores:null},Le.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function om(){return Tt().memoizedState}function Ea(e,t,n,r){var a=Vt();Le.flags|=e,a.memoizedState=Or(1|t,n,void 0,r===void 0?null:r)}function vl(e,t,n,r){var a=Tt();r=r===void 0?null:r;var l=void 0;if(Fe!==null){var i=Fe.memoizedState;if(l=i.destroy,r!==null&&sc(r,i.deps)){a.memoizedState=Or(t,n,l,r);return}}Le.flags|=e,a.memoizedState=Or(1|t,n,l,r)}function yd(e,t){return Ea(8390656,8,e,t)}function lc(e,t){return vl(2048,8,e,t)}function cm(e,t){return vl(4,2,e,t)}function dm(e,t){return vl(4,4,e,t)}function um(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 pm(e,t,n){return n=n!=null?n.concat([e]):null,vl(4,4,um.bind(null,t,e),n)}function ic(){}function mm(e,t){var n=Tt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&sc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fm(e,t){var n=Tt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&sc(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function xm(e,t,n){return as&21?(Ft(n,t)||(n=wp(),Le.lanes|=n,ls|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ot=!0),e.memoizedState=n)}function Vx(e,t){var n=be;be=n!==0&&4>n?n:4,e(!0);var r=ti.transition;ti.transition={};try{e(!1),t()}finally{be=n,ti.transition=r}}function hm(){return Tt().memoizedState}function Hx(e,t,n){var r=Tn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},gm(e))ym(t,n);else if(n=Yp(e,t,n,r),n!==null){var a=rt();zt(n,e,r,a),vm(n,t,r)}}function Wx(e,t,n){var r=Tn(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(gm(e))ym(t,a);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var i=t.lastRenderedState,o=l(i,n);if(a.hasEagerState=!0,a.eagerState=o,Ft(o,i)){var c=t.interleaved;c===null?(a.next=a,Yo(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=Yp(e,t,a,r),n!==null&&(a=rt(),zt(n,e,r,a),vm(n,t,r))}}function gm(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function ym(e,t){xr=Za=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Do(e,n)}}var el={readContext:Rt,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useInsertionEffect:Je,useLayoutEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useMutableSource:Je,useSyncExternalStore:Je,useId:Je,unstable_isNewReconciler:!1},qx={readContext:Rt,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:yd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ea(4194308,4,um.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ea(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ea(4,2,e,t)},useMemo:function(e,t){var n=Vt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Hx.bind(null,Le,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:gd,useDebugValue:ic,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=gd(!1),t=e[0];return e=Vx.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Le,a=Vt();if(Re){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Ve===null)throw Error(B(349));as&30||sm(r,t,n)}a.memoizedState=n;var l={value:n,getSnapshot:t};return a.queue=l,yd(am.bind(null,r,l,e),[e]),r.flags|=2048,Or(9,rm.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Vt(),t=Ve.identifierPrefix;if(Re){var n=rn,r=sn;n=(r&~(1<<32-Dt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ar++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Bx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Kx={readContext:Rt,useCallback:mm,useContext:Rt,useEffect:lc,useImperativeHandle:pm,useInsertionEffect:cm,useLayoutEffect:dm,useMemo:fm,useReducer:ni,useRef:om,useState:function(){return ni($r)},useDebugValue:ic,useDeferredValue:function(e){var t=Tt();return xm(t,Fe.memoizedState,e)},useTransition:function(){var e=ni($r)[0],t=Tt().memoizedState;return[e,t]},useMutableSource:tm,useSyncExternalStore:nm,useId:hm,unstable_isNewReconciler:!1},Qx={readContext:Rt,useCallback:mm,useContext:Rt,useEffect:lc,useImperativeHandle:pm,useInsertionEffect:cm,useLayoutEffect:dm,useMemo:fm,useReducer:si,useRef:om,useState:function(){return si($r)},useDebugValue:ic,useDeferredValue:function(e){var t=Tt();return Fe===null?t.memoizedState=e:xm(t,Fe.memoizedState,e)},useTransition:function(){var e=si($r)[0],t=Tt().memoizedState;return[e,t]},useMutableSource:tm,useSyncExternalStore:nm,useId:hm,unstable_isNewReconciler:!1};function $t(e,t){if(e&&e.defaultProps){t=Ae({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Yi(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ae({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var wl={isMounted:function(e){return(e=e._reactInternals)?us(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=rt(),a=Tn(e),l=an(r,a);l.payload=t,n!=null&&(l.callback=n),t=En(e,l,a),t!==null&&(zt(t,e,a,r),_a(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=rt(),a=Tn(e),l=an(r,a);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=En(e,l,a),t!==null&&(zt(t,e,a,r),_a(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=rt(),r=Tn(e),a=an(n,r);a.tag=2,t!=null&&(a.callback=t),t=En(e,a,r),t!==null&&(zt(t,e,r,n),_a(t,e,r))}};function vd(e,t,n,r,a,l,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,i):t.prototype&&t.prototype.isPureReactComponent?!Cr(n,r)||!Cr(a,l):!0}function wm(e,t,n){var r=!1,a=On,l=t.contextType;return typeof l=="object"&&l!==null?l=Rt(l):(a=dt(t)?ss:et.current,r=t.contextTypes,l=(r=r!=null)?$s(e,a):On),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=wl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=l),t}function wd(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&wl.enqueueReplaceState(t,t.state,null)}function Zi(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},Zo(e);var l=t.contextType;typeof l=="object"&&l!==null?a.context=Rt(l):(l=dt(t)?ss:et.current,a.context=$s(e,l)),a.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(Yi(e,t,l,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&&wl.enqueueReplaceState(a,a.state,null),Xa(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Ds(e,t){try{var n="",r=t;do n+=kf(r),r=r.return;while(r);var a=n}catch(l){a=`
|
||
Error generating stack: `+l.message+`
|
||
`+l.stack}return{value:e,source:t,stack:a,digest:null}}function ri(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function eo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Jx=typeof WeakMap=="function"?WeakMap:Map;function jm(e,t,n){n=an(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){nl||(nl=!0,uo=r),eo(e,t)},n}function km(e,t,n){n=an(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){eo(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){eo(e,t),typeof r!="function"&&(Rn===null?Rn=new Set([this]):Rn.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function jd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Jx;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=ch.bind(null,e,t,n),t.then(e,e))}function kd(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 bd(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=an(-1,1),t.tag=2,En(n,t,1))),n.lanes|=1),e)}var Gx=mn.ReactCurrentOwner,ot=!1;function nt(e,t,n,r){t.child=e===null?Xp(t,null,n,r):Is(t,e.child,n,r)}function Nd(e,t,n,r,a){n=n.render;var l=t.ref;return Ps(t,a),r=rc(e,t,n,r,l,a),n=ac(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,un(e,t,a)):(Re&&n&&qo(t),t.flags|=1,nt(e,t,r,a),t.child)}function Sd(e,t,n,r,a){if(e===null){var l=n.type;return typeof l=="function"&&!xc(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,bm(e,t,l,r,a)):(e=La(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&a)){var i=l.memoizedProps;if(n=n.compare,n=n!==null?n:Cr,n(i,r)&&e.ref===t.ref)return un(e,t,a)}return t.flags|=1,e=Pn(l,r),e.ref=t.ref,e.return=t,t.child=e}function bm(e,t,n,r,a){if(e!==null){var l=e.memoizedProps;if(Cr(l,r)&&e.ref===t.ref)if(ot=!1,t.pendingProps=r=l,(e.lanes&a)!==0)e.flags&131072&&(ot=!0);else return t.lanes=e.lanes,un(e,t,a)}return to(e,t,n,r,a)}function Nm(e,t,n){var r=t.pendingProps,a=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ne(_s,xt),xt|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ne(_s,xt),xt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,Ne(_s,xt),xt|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,Ne(_s,xt),xt|=r;return nt(e,t,a,n),t.child}function Sm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function to(e,t,n,r,a){var l=dt(n)?ss:et.current;return l=$s(t,l),Ps(t,a),n=rc(e,t,n,r,l,a),r=ac(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,un(e,t,a)):(Re&&r&&qo(t),t.flags|=1,nt(e,t,n,a),t.child)}function _d(e,t,n,r,a){if(dt(n)){var l=!0;qa(t)}else l=!1;if(Ps(t,a),t.stateNode===null)Ra(e,t),wm(t,n,r),Zi(t,n,r,a),r=!0;else if(e===null){var i=t.stateNode,o=t.memoizedProps;i.props=o;var c=i.context,d=n.contextType;typeof d=="object"&&d!==null?d=Rt(d):(d=dt(n)?ss:et.current,d=$s(t,d));var m=n.getDerivedStateFromProps,f=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==r||c!==d)&&wd(t,i,r,d),yn=!1;var p=t.memoizedState;i.state=p,Xa(t,r,i,a),c=t.memoizedState,o!==r||p!==c||ct.current||yn?(typeof m=="function"&&(Yi(t,n,m,r),c=t.memoizedState),(o=yn||vd(t,n,o,r,p,c,d))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),i.props=r,i.state=c,i.context=d,r=o):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Zp(e,t),o=t.memoizedProps,d=t.type===t.elementType?o:$t(t.type,o),i.props=d,f=t.pendingProps,p=i.context,c=n.contextType,typeof c=="object"&&c!==null?c=Rt(c):(c=dt(n)?ss:et.current,c=$s(t,c));var N=n.getDerivedStateFromProps;(m=typeof N=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==f||p!==c)&&wd(t,i,r,c),yn=!1,p=t.memoizedState,i.state=p,Xa(t,r,i,a);var v=t.memoizedState;o!==f||p!==v||ct.current||yn?(typeof N=="function"&&(Yi(t,n,N,r),v=t.memoizedState),(d=yn||vd(t,n,d,r,p,v,c)||!1)?(m||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,v,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,v,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),i.props=r,i.state=v,i.context=c,r=d):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return no(e,t,n,r,l,a)}function no(e,t,n,r,a,l){Sm(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return a&&ud(t,n,!1),un(e,t,l);r=t.stateNode,Gx.current=t;var o=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=Is(t,e.child,null,l),t.child=Is(t,null,o,l)):nt(e,t,o,l),t.memoizedState=r.state,a&&ud(t,n,!0),t.child}function _m(e){var t=e.stateNode;t.pendingContext?dd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&dd(e,t.context,!1),ec(e,t.containerInfo)}function Cd(e,t,n,r,a){return Os(),Qo(a),t.flags|=256,nt(e,t,n,r),t.child}var so={dehydrated:null,treeContext:null,retryLane:0};function ro(e){return{baseLanes:e,cachePool:null,transitions:null}}function Cm(e,t,n){var r=t.pendingProps,a=Pe.current,l=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(a&2)!==0),o?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Ne(Pe,a&1),e===null)return Gi(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,l?(r=t.mode,l=t.child,i={mode:"hidden",children:i},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=i):l=bl(i,r,0,null),e=Yn(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=ro(n),t.memoizedState=so,e):oc(t,i));if(a=e.memoizedState,a!==null&&(o=a.dehydrated,o!==null))return Xx(e,t,i,r,o,a,n);if(l){l=r.fallback,i=t.mode,a=e.child,o=a.sibling;var c={mode:"hidden",children:r.children};return!(i&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Pn(a,c),r.subtreeFlags=a.subtreeFlags&14680064),o!==null?l=Pn(o,l):(l=Yn(l,i,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,i=e.child.memoizedState,i=i===null?ro(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},l.memoizedState=i,l.childLanes=e.childLanes&~n,t.memoizedState=so,r}return l=e.child,e=l.sibling,r=Pn(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function oc(e,t){return t=bl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function xa(e,t,n,r){return r!==null&&Qo(r),Is(t,e.child,null,n),e=oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xx(e,t,n,r,a,l,i){if(n)return t.flags&256?(t.flags&=-257,r=ri(Error(B(422))),xa(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,a=t.mode,r=bl({mode:"visible",children:r.children},a,0,null),l=Yn(l,a,i,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&Is(t,e.child,null,i),t.child.memoizedState=ro(i),t.memoizedState=so,l);if(!(t.mode&1))return xa(e,t,i,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var o=r.dgst;return r=o,l=Error(B(419)),r=ri(l,r,void 0),xa(e,t,i,r)}if(o=(i&e.childLanes)!==0,ot||o){if(r=Ve,r!==null){switch(i&-i){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&(r.suspendedLanes|i)?0:a,a!==0&&a!==l.retryLane&&(l.retryLane=a,dn(e,a),zt(r,e,a,-1))}return fc(),r=ri(Error(B(421))),xa(e,t,i,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=dh.bind(null,e),a._reactRetry=t,null):(e=l.treeContext,ht=Cn(a.nextSibling),gt=t,Re=!0,It=null,e!==null&&(Nt[St++]=sn,Nt[St++]=rn,Nt[St++]=rs,sn=e.id,rn=e.overflow,rs=t),t=oc(t,r.children),t.flags|=4096,t)}function Ed(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function ai(e,t,n,r,a){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=a)}function Em(e,t,n){var r=t.pendingProps,a=r.revealOrder,l=r.tail;if(nt(e,t,r.children,n),r=Pe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ed(e,n,t);else if(e.tag===19)Ed(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}r&=1}if(Ne(Pe,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Ya(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),ai(t,!1,a,n,l);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Ya(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}ai(t,!0,n,null,l);break;case"together":ai(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ra(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function un(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ls|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=Pn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Pn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Yx(e,t,n){switch(t.tag){case 3:_m(t),Os();break;case 5:em(t);break;case 1:dt(t.type)&&qa(t);break;case 4:ec(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;Ne(Ja,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ne(Pe,Pe.current&1),t.flags|=128,null):n&t.child.childLanes?Cm(e,t,n):(Ne(Pe,Pe.current&1),e=un(e,t,n),e!==null?e.sibling:null);Ne(Pe,Pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Em(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Ne(Pe,Pe.current),r)break;return null;case 22:case 23:return t.lanes=0,Nm(e,t,n)}return un(e,t,n)}var Rm,ao,Tm,Pm;Rm=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}};ao=function(){};Tm=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Jn(Jt.current);var l=null;switch(n){case"input":a=Ci(e,a),r=Ci(e,r),l=[];break;case"select":a=Ae({},a,{value:void 0}),r=Ae({},r,{value:void 0}),l=[];break;case"textarea":a=Ti(e,a),r=Ti(e,r),l=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ha)}Li(n,r);var i;n=null;for(d in a)if(!r.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var o=a[d];for(i in o)o.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(wr.hasOwnProperty(d)?l||(l=[]):(l=l||[]).push(d,null));for(d in r){var c=r[d];if(o=a!=null?a[d]:void 0,r.hasOwnProperty(d)&&c!==o&&(c!=null||o!=null))if(d==="style")if(o){for(i in o)!o.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in c)c.hasOwnProperty(i)&&o[i]!==c[i]&&(n||(n={}),n[i]=c[i])}else n||(l||(l=[]),l.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(l=l||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(l=l||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(wr.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&_e("scroll",e),l||o===c||(l=[])):(l=l||[]).push(d,c))}n&&(l=l||[]).push("style",n);var d=l;(t.updateQueue=d)&&(t.flags|=4)}};Pm=function(e,t,n,r){n!==r&&(t.flags|=4)};function er(e,t){if(!Re)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ge(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Zx(e,t,n){var r=t.pendingProps;switch(Ko(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(t),null;case 1:return dt(t.type)&&Wa(),Ge(t),null;case 3:return r=t.stateNode,Ms(),Ce(ct),Ce(et),nc(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ma(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,It!==null&&(fo(It),It=null))),ao(e,t),Ge(t),null;case 5:tc(t);var a=Jn(Lr.current);if(n=t.type,e!==null&&t.stateNode!=null)Tm(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Ge(t),null}if(e=Jn(Jt.current),ma(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Ht]=t,r[Tr]=l,e=(t.mode&1)!==0,n){case"dialog":_e("cancel",r),_e("close",r);break;case"iframe":case"object":case"embed":_e("load",r);break;case"video":case"audio":for(a=0;a<or.length;a++)_e(or[a],r);break;case"source":_e("error",r);break;case"img":case"image":case"link":_e("error",r),_e("load",r);break;case"details":_e("toggle",r);break;case"input":Mc(r,l),_e("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},_e("invalid",r);break;case"textarea":zc(r,l),_e("invalid",r)}Li(n,l),a=null;for(var i in l)if(l.hasOwnProperty(i)){var o=l[i];i==="children"?typeof o=="string"?r.textContent!==o&&(l.suppressHydrationWarning!==!0&&pa(r.textContent,o,e),a=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(l.suppressHydrationWarning!==!0&&pa(r.textContent,o,e),a=["children",""+o]):wr.hasOwnProperty(i)&&o!=null&&i==="onScroll"&&_e("scroll",r)}switch(n){case"input":ra(r),Dc(r,l,!0);break;case"textarea":ra(r),Fc(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=Ha)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ap(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Ht]=t,e[Tr]=r,Rm(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ai(n,r),n){case"dialog":_e("cancel",e),_e("close",e),a=r;break;case"iframe":case"object":case"embed":_e("load",e),a=r;break;case"video":case"audio":for(a=0;a<or.length;a++)_e(or[a],e);a=r;break;case"source":_e("error",e),a=r;break;case"img":case"image":case"link":_e("error",e),_e("load",e),a=r;break;case"details":_e("toggle",e),a=r;break;case"input":Mc(e,r),a=Ci(e,r),_e("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=Ae({},r,{value:void 0}),_e("invalid",e);break;case"textarea":zc(e,r),a=Ti(e,r),_e("invalid",e);break;default:a=r}Li(n,a),o=a;for(l in o)if(o.hasOwnProperty(l)){var c=o[l];l==="style"?op(e,c):l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&lp(e,c)):l==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&jr(e,c):typeof c=="number"&&jr(e,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(wr.hasOwnProperty(l)?c!=null&&l==="onScroll"&&_e("scroll",e):c!=null&&Lo(e,l,c,i))}switch(n){case"input":ra(e),Dc(e,r,!1);break;case"textarea":ra(e),Fc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+$n(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?Cs(e,!!r.multiple,l,!1):r.defaultValue!=null&&Cs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Ha)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ge(t),null;case 6:if(e&&t.stateNode!=null)Pm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=Jn(Lr.current),Jn(Jt.current),ma(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ht]=t,(l=r.nodeValue!==n)&&(e=gt,e!==null))switch(e.tag){case 3:pa(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&pa(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ht]=t,t.stateNode=r}return Ge(t),null;case 13:if(Ce(Pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Re&&ht!==null&&t.mode&1&&!(t.flags&128))Jp(),Os(),t.flags|=98560,l=!1;else if(l=ma(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(B(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(B(317));l[Ht]=t}else Os(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ge(t),l=!1}else It!==null&&(fo(It),It=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Pe.current&1?Ue===0&&(Ue=3):fc())),t.updateQueue!==null&&(t.flags|=4),Ge(t),null);case 4:return Ms(),ao(e,t),e===null&&Er(t.stateNode.containerInfo),Ge(t),null;case 10:return Xo(t.type._context),Ge(t),null;case 17:return dt(t.type)&&Wa(),Ge(t),null;case 19:if(Ce(Pe),l=t.memoizedState,l===null)return Ge(t),null;if(r=(t.flags&128)!==0,i=l.rendering,i===null)if(r)er(l,!1);else{if(Ue!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Ya(e),i!==null){for(t.flags|=128,er(l,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,i=l.alternate,i===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,l.type=i.type,e=i.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ne(Pe,Pe.current&1|2),t.child}e=e.sibling}l.tail!==null&&Ie()>zs&&(t.flags|=128,r=!0,er(l,!1),t.lanes=4194304)}else{if(!r)if(e=Ya(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),er(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!Re)return Ge(t),null}else 2*Ie()-l.renderingStartTime>zs&&n!==1073741824&&(t.flags|=128,r=!0,er(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(n=l.last,n!==null?n.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Ie(),t.sibling=null,n=Pe.current,Ne(Pe,r?n&1|2:n&1),t):(Ge(t),null);case 22:case 23:return mc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?xt&1073741824&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function eh(e,t){switch(Ko(t),t.tag){case 1:return dt(t.type)&&Wa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ms(),Ce(ct),Ce(et),nc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return tc(t),null;case 13:if(Ce(Pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Os()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(Pe),null;case 4:return Ms(),null;case 10:return Xo(t.type._context),null;case 22:case 23:return mc(),null;case 24:return null;default:return null}}var ha=!1,Xe=!1,th=typeof WeakSet=="function"?WeakSet:Set,ee=null;function Ss(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){$e(e,t,r)}else n.current=null}function lo(e,t,n){try{n()}catch(r){$e(e,t,r)}}var Rd=!1;function nh(e,t){if(Vi=Ua,e=Ip(),Wo(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var i=0,o=-1,c=-1,d=0,m=0,f=e,p=null;t:for(;;){for(var N;f!==n||a!==0&&f.nodeType!==3||(o=i+a),f!==l||r!==0&&f.nodeType!==3||(c=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(N=f.firstChild)!==null;)p=f,f=N;for(;;){if(f===e)break t;if(p===n&&++d===a&&(o=i),p===l&&++m===r&&(c=i),(N=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=N}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Hi={focusedElem:e,selectionRange:n},Ua=!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 v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,k=v.memoizedState,y=t.stateNode,u=y.getSnapshotBeforeUpdate(t.elementType===t.type?w:$t(t.type,w),k);y.__reactInternalSnapshotBeforeUpdate=u}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(_){$e(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,ee=e;break}ee=t.return}return v=Rd,Rd=!1,v}function hr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var l=a.destroy;a.destroy=void 0,l!==void 0&&lo(t,n,l)}a=a.next}while(a!==r)}}function jl(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 r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function io(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 Lm(e){var t=e.alternate;t!==null&&(e.alternate=null,Lm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ht],delete t[Tr],delete t[Ki],delete t[Dx],delete t[zx])),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 Am(e){return e.tag===5||e.tag===3||e.tag===4}function Td(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Am(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 oo(e,t,n){var r=e.tag;if(r===5||r===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=Ha));else if(r!==4&&(e=e.child,e!==null))for(oo(e,t,n),e=e.sibling;e!==null;)oo(e,t,n),e=e.sibling}function co(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(co(e,t,n),e=e.sibling;e!==null;)co(e,t,n),e=e.sibling}var He=null,Ot=!1;function xn(e,t,n){for(n=n.child;n!==null;)$m(e,t,n),n=n.sibling}function $m(e,t,n){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(ml,n)}catch{}switch(n.tag){case 5:Xe||Ss(n,t);case 6:var r=He,a=Ot;He=null,xn(e,t,n),He=r,Ot=a,He!==null&&(Ot?(e=He,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):He.removeChild(n.stateNode));break;case 18:He!==null&&(Ot?(e=He,n=n.stateNode,e.nodeType===8?Yl(e.parentNode,n):e.nodeType===1&&Yl(e,n),Sr(e)):Yl(He,n.stateNode));break;case 4:r=He,a=Ot,He=n.stateNode.containerInfo,Ot=!0,xn(e,t,n),He=r,Ot=a;break;case 0:case 11:case 14:case 15:if(!Xe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var l=a,i=l.destroy;l=l.tag,i!==void 0&&(l&2||l&4)&&lo(n,t,i),a=a.next}while(a!==r)}xn(e,t,n);break;case 1:if(!Xe&&(Ss(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){$e(n,t,o)}xn(e,t,n);break;case 21:xn(e,t,n);break;case 22:n.mode&1?(Xe=(r=Xe)||n.memoizedState!==null,xn(e,t,n),Xe=r):xn(e,t,n);break;default:xn(e,t,n)}}function Pd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new th),t.forEach(function(r){var a=uh.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Lt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var l=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 5:He=o.stateNode,Ot=!1;break e;case 3:He=o.stateNode.containerInfo,Ot=!0;break e;case 4:He=o.stateNode.containerInfo,Ot=!0;break e}o=o.return}if(He===null)throw Error(B(160));$m(l,i,a),He=null,Ot=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){$e(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Om(t,e),t=t.sibling}function Om(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Lt(t,e),Bt(e),r&4){try{hr(3,e,e.return),jl(3,e)}catch(w){$e(e,e.return,w)}try{hr(5,e,e.return)}catch(w){$e(e,e.return,w)}}break;case 1:Lt(t,e),Bt(e),r&512&&n!==null&&Ss(n,n.return);break;case 5:if(Lt(t,e),Bt(e),r&512&&n!==null&&Ss(n,n.return),e.flags&32){var a=e.stateNode;try{jr(a,"")}catch(w){$e(e,e.return,w)}}if(r&4&&(a=e.stateNode,a!=null)){var l=e.memoizedProps,i=n!==null?n.memoizedProps:l,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&l.type==="radio"&&l.name!=null&&sp(a,l),Ai(o,i);var d=Ai(o,l);for(i=0;i<c.length;i+=2){var m=c[i],f=c[i+1];m==="style"?op(a,f):m==="dangerouslySetInnerHTML"?lp(a,f):m==="children"?jr(a,f):Lo(a,m,f,d)}switch(o){case"input":Ei(a,l);break;case"textarea":rp(a,l);break;case"select":var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!l.multiple;var N=l.value;N!=null?Cs(a,!!l.multiple,N,!1):p!==!!l.multiple&&(l.defaultValue!=null?Cs(a,!!l.multiple,l.defaultValue,!0):Cs(a,!!l.multiple,l.multiple?[]:"",!1))}a[Tr]=l}catch(w){$e(e,e.return,w)}}break;case 6:if(Lt(t,e),Bt(e),r&4){if(e.stateNode===null)throw Error(B(162));a=e.stateNode,l=e.memoizedProps;try{a.nodeValue=l}catch(w){$e(e,e.return,w)}}break;case 3:if(Lt(t,e),Bt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Sr(t.containerInfo)}catch(w){$e(e,e.return,w)}break;case 4:Lt(t,e),Bt(e);break;case 13:Lt(t,e),Bt(e),a=e.child,a.flags&8192&&(l=a.memoizedState!==null,a.stateNode.isHidden=l,!l||a.alternate!==null&&a.alternate.memoizedState!==null||(uc=Ie())),r&4&&Pd(e);break;case 22:if(m=n!==null&&n.memoizedState!==null,e.mode&1?(Xe=(d=Xe)||m,Lt(t,e),Xe=d):Lt(t,e),Bt(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!m&&e.mode&1)for(ee=e,m=e.child;m!==null;){for(f=ee=m;ee!==null;){switch(p=ee,N=p.child,p.tag){case 0:case 11:case 14:case 15:hr(4,p,p.return);break;case 1:Ss(p,p.return);var v=p.stateNode;if(typeof v.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(w){$e(r,n,w)}}break;case 5:Ss(p,p.return);break;case 22:if(p.memoizedState!==null){Ad(f);continue}}N!==null?(N.return=p,ee=N):Ad(f)}m=m.sibling}e:for(m=null,f=e;;){if(f.tag===5){if(m===null){m=f;try{a=f.stateNode,d?(l=a.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(o=f.stateNode,c=f.memoizedProps.style,i=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=ip("display",i))}catch(w){$e(e,e.return,w)}}}else if(f.tag===6){if(m===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(w){$e(e,e.return,w)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;m===f&&(m=null),f=f.return}m===f&&(m=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Lt(t,e),Bt(e),r&4&&Pd(e);break;case 21:break;default:Lt(t,e),Bt(e)}}function Bt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Am(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(jr(a,""),r.flags&=-33);var l=Td(e);co(e,l,a);break;case 3:case 4:var i=r.stateNode.containerInfo,o=Td(e);oo(e,o,i);break;default:throw Error(B(161))}}catch(c){$e(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function sh(e,t,n){ee=e,Im(e)}function Im(e,t,n){for(var r=(e.mode&1)!==0;ee!==null;){var a=ee,l=a.child;if(a.tag===22&&r){var i=a.memoizedState!==null||ha;if(!i){var o=a.alternate,c=o!==null&&o.memoizedState!==null||Xe;o=ha;var d=Xe;if(ha=i,(Xe=c)&&!d)for(ee=a;ee!==null;)i=ee,c=i.child,i.tag===22&&i.memoizedState!==null?$d(a):c!==null?(c.return=i,ee=c):$d(a);for(;l!==null;)ee=l,Im(l),l=l.sibling;ee=a,ha=o,Xe=d}Ld(e)}else a.subtreeFlags&8772&&l!==null?(l.return=a,ee=l):Ld(e)}}function Ld(e){for(;ee!==null;){var t=ee;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Xe||jl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Xe)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:$t(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&hd(t,l,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}hd(t,i,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var m=d.memoizedState;if(m!==null){var f=m.dehydrated;f!==null&&Sr(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}Xe||t.flags&512&&io(t)}catch(p){$e(t,t.return,p)}}if(t===e){ee=null;break}if(n=t.sibling,n!==null){n.return=t.return,ee=n;break}ee=t.return}}function Ad(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 $d(e){for(;ee!==null;){var t=ee;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{jl(4,t)}catch(c){$e(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){$e(t,a,c)}}var l=t.return;try{io(t)}catch(c){$e(t,l,c)}break;case 5:var i=t.return;try{io(t)}catch(c){$e(t,i,c)}}}catch(c){$e(t,t.return,c)}if(t===e){ee=null;break}var o=t.sibling;if(o!==null){o.return=t.return,ee=o;break}ee=t.return}}var rh=Math.ceil,tl=mn.ReactCurrentDispatcher,cc=mn.ReactCurrentOwner,Et=mn.ReactCurrentBatchConfig,je=0,Ve=null,De=null,qe=0,xt=0,_s=zn(0),Ue=0,Ir=null,ls=0,kl=0,dc=0,gr=null,it=null,uc=0,zs=1/0,en=null,nl=!1,uo=null,Rn=null,ga=!1,kn=null,sl=0,yr=0,po=null,Ta=-1,Pa=0;function rt(){return je&6?Ie():Ta!==-1?Ta:Ta=Ie()}function Tn(e){return e.mode&1?je&2&&qe!==0?qe&-qe:Ux.transition!==null?(Pa===0&&(Pa=wp()),Pa):(e=be,e!==0||(e=window.event,e=e===void 0?16:Cp(e.type)),e):1}function zt(e,t,n,r){if(50<yr)throw yr=0,po=null,Error(B(185));Vr(e,n,r),(!(je&2)||e!==Ve)&&(e===Ve&&(!(je&2)&&(kl|=n),Ue===4&&wn(e,qe)),ut(e,r),n===1&&je===0&&!(t.mode&1)&&(zs=Ie()+500,yl&&Fn()))}function ut(e,t){var n=e.callbackNode;Uf(e,t);var r=Fa(e,e===Ve?qe:0);if(r===0)n!==null&&Vc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Vc(n),t===1)e.tag===0?Fx(Od.bind(null,e)):qp(Od.bind(null,e)),Ix(function(){!(je&6)&&Fn()}),n=null;else{switch(jp(r)){case 1:n=Mo;break;case 4:n=yp;break;case 16:n=za;break;case 536870912:n=vp;break;default:n=za}n=Hm(n,Mm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Mm(e,t){if(Ta=-1,Pa=0,je&6)throw Error(B(327));var n=e.callbackNode;if(Ls()&&e.callbackNode!==n)return null;var r=Fa(e,e===Ve?qe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=rl(e,r);else{t=r;var a=je;je|=2;var l=zm();(Ve!==e||qe!==t)&&(en=null,zs=Ie()+500,Xn(e,t));do try{ih();break}catch(o){Dm(e,o)}while(!0);Go(),tl.current=l,je=a,De!==null?t=0:(Ve=null,qe=0,t=Ue)}if(t!==0){if(t===2&&(a=Di(e),a!==0&&(r=a,t=mo(e,a))),t===1)throw n=Ir,Xn(e,0),wn(e,r),ut(e,Ie()),n;if(t===6)wn(e,r);else{if(a=e.current.alternate,!(r&30)&&!ah(a)&&(t=rl(e,r),t===2&&(l=Di(e),l!==0&&(r=l,t=mo(e,l))),t===1))throw n=Ir,Xn(e,0),wn(e,r),ut(e,Ie()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:qn(e,it,en);break;case 3:if(wn(e,r),(r&130023424)===r&&(t=uc+500-Ie(),10<t)){if(Fa(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){rt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=qi(qn.bind(null,e,it,en),t);break}qn(e,it,en);break;case 4:if(wn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var i=31-Dt(r);l=1<<i,i=t[i],i>a&&(a=i),r&=~l}if(r=a,r=Ie()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rh(r/1960))-r,10<r){e.timeoutHandle=qi(qn.bind(null,e,it,en),r);break}qn(e,it,en);break;case 5:qn(e,it,en);break;default:throw Error(B(329))}}}return ut(e,Ie()),e.callbackNode===n?Mm.bind(null,e):null}function mo(e,t){var n=gr;return e.current.memoizedState.isDehydrated&&(Xn(e,t).flags|=256),e=rl(e,t),e!==2&&(t=it,it=n,t!==null&&fo(t)),e}function fo(e){it===null?it=e:it.push.apply(it,e)}function ah(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],l=a.getSnapshot;a=a.value;try{if(!Ft(l(),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 wn(e,t){for(t&=~dc,t&=~kl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Dt(t),r=1<<n;e[n]=-1,t&=~r}}function Od(e){if(je&6)throw Error(B(327));Ls();var t=Fa(e,0);if(!(t&1))return ut(e,Ie()),null;var n=rl(e,t);if(e.tag!==0&&n===2){var r=Di(e);r!==0&&(t=r,n=mo(e,r))}if(n===1)throw n=Ir,Xn(e,0),wn(e,t),ut(e,Ie()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,qn(e,it,en),ut(e,Ie()),null}function pc(e,t){var n=je;je|=1;try{return e(t)}finally{je=n,je===0&&(zs=Ie()+500,yl&&Fn())}}function is(e){kn!==null&&kn.tag===0&&!(je&6)&&Ls();var t=je;je|=1;var n=Et.transition,r=be;try{if(Et.transition=null,be=1,e)return e()}finally{be=r,Et.transition=n,je=t,!(je&6)&&Fn()}}function mc(){xt=_s.current,Ce(_s)}function Xn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ox(n)),De!==null)for(n=De.return;n!==null;){var r=n;switch(Ko(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Wa();break;case 3:Ms(),Ce(ct),Ce(et),nc();break;case 5:tc(r);break;case 4:Ms();break;case 13:Ce(Pe);break;case 19:Ce(Pe);break;case 10:Xo(r.type._context);break;case 22:case 23:mc()}n=n.return}if(Ve=e,De=e=Pn(e.current,null),qe=xt=t,Ue=0,Ir=null,dc=kl=ls=0,it=gr=null,Qn!==null){for(t=0;t<Qn.length;t++)if(n=Qn[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,l=n.pending;if(l!==null){var i=l.next;l.next=a,r.next=i}n.pending=r}Qn=null}return e}function Dm(e,t){do{var n=De;try{if(Go(),Ca.current=el,Za){for(var r=Le.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Za=!1}if(as=0,Be=Fe=Le=null,xr=!1,Ar=0,cc.current=null,n===null||n.return===null){Ue=1,Ir=t,De=null;break}e:{var l=e,i=n.return,o=n,c=t;if(t=qe,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,m=o,f=m.tag;if(!(m.mode&1)&&(f===0||f===11||f===15)){var p=m.alternate;p?(m.updateQueue=p.updateQueue,m.memoizedState=p.memoizedState,m.lanes=p.lanes):(m.updateQueue=null,m.memoizedState=null)}var N=kd(i);if(N!==null){N.flags&=-257,bd(N,i,o,l,t),N.mode&1&&jd(l,d,t),t=N,c=d;var v=t.updateQueue;if(v===null){var w=new Set;w.add(c),t.updateQueue=w}else v.add(c);break e}else{if(!(t&1)){jd(l,d,t),fc();break e}c=Error(B(426))}}else if(Re&&o.mode&1){var k=kd(i);if(k!==null){!(k.flags&65536)&&(k.flags|=256),bd(k,i,o,l,t),Qo(Ds(c,o));break e}}l=c=Ds(c,o),Ue!==4&&(Ue=2),gr===null?gr=[l]:gr.push(l),l=i;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var y=jm(l,c,t);xd(l,y);break e;case 1:o=c;var u=l.type,g=l.stateNode;if(!(l.flags&128)&&(typeof u.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Rn===null||!Rn.has(g)))){l.flags|=65536,t&=-t,l.lanes|=t;var _=km(l,o,t);xd(l,_);break e}}l=l.return}while(l!==null)}Um(n)}catch(L){t=L,De===n&&n!==null&&(De=n=n.return);continue}break}while(!0)}function zm(){var e=tl.current;return tl.current=el,e===null?el:e}function fc(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),Ve===null||!(ls&268435455)&&!(kl&268435455)||wn(Ve,qe)}function rl(e,t){var n=je;je|=2;var r=zm();(Ve!==e||qe!==t)&&(en=null,Xn(e,t));do try{lh();break}catch(a){Dm(e,a)}while(!0);if(Go(),je=n,tl.current=r,De!==null)throw Error(B(261));return Ve=null,qe=0,Ue}function lh(){for(;De!==null;)Fm(De)}function ih(){for(;De!==null&&!Lf();)Fm(De)}function Fm(e){var t=Vm(e.alternate,e,xt);e.memoizedProps=e.pendingProps,t===null?Um(e):De=t,cc.current=null}function Um(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=eh(n,t),n!==null){n.flags&=32767,De=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ue=6,De=null;return}}else if(n=Zx(n,t,xt),n!==null){De=n;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Ue===0&&(Ue=5)}function qn(e,t,n){var r=be,a=Et.transition;try{Et.transition=null,be=1,oh(e,t,n,r)}finally{Et.transition=a,be=r}return null}function oh(e,t,n,r){do Ls();while(kn!==null);if(je&6)throw Error(B(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(B(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(Bf(e,l),e===Ve&&(De=Ve=null,qe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ga||(ga=!0,Hm(za,function(){return Ls(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=Et.transition,Et.transition=null;var i=be;be=1;var o=je;je|=4,cc.current=null,nh(e,n),Om(n,e),Ex(Hi),Ua=!!Vi,Hi=Vi=null,e.current=n,sh(n),Af(),je=o,be=i,Et.transition=l}else e.current=n;if(ga&&(ga=!1,kn=e,sl=a),l=e.pendingLanes,l===0&&(Rn=null),If(n.stateNode),ut(e,Ie()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(nl)throw nl=!1,e=uo,uo=null,e;return sl&1&&e.tag!==0&&Ls(),l=e.pendingLanes,l&1?e===po?yr++:(yr=0,po=e):yr=0,Fn(),null}function Ls(){if(kn!==null){var e=jp(sl),t=Et.transition,n=be;try{if(Et.transition=null,be=16>e?16:e,kn===null)var r=!1;else{if(e=kn,kn=null,sl=0,je&6)throw Error(B(331));var a=je;for(je|=4,ee=e.current;ee!==null;){var l=ee,i=l.child;if(ee.flags&16){var o=l.deletions;if(o!==null){for(var c=0;c<o.length;c++){var d=o[c];for(ee=d;ee!==null;){var m=ee;switch(m.tag){case 0:case 11:case 15:hr(8,m,l)}var f=m.child;if(f!==null)f.return=m,ee=f;else for(;ee!==null;){m=ee;var p=m.sibling,N=m.return;if(Lm(m),m===d){ee=null;break}if(p!==null){p.return=N,ee=p;break}ee=N}}}var v=l.alternate;if(v!==null){var w=v.child;if(w!==null){v.child=null;do{var k=w.sibling;w.sibling=null,w=k}while(w!==null)}}ee=l}}if(l.subtreeFlags&2064&&i!==null)i.return=l,ee=i;else e:for(;ee!==null;){if(l=ee,l.flags&2048)switch(l.tag){case 0:case 11:case 15:hr(9,l,l.return)}var y=l.sibling;if(y!==null){y.return=l.return,ee=y;break e}ee=l.return}}var u=e.current;for(ee=u;ee!==null;){i=ee;var g=i.child;if(i.subtreeFlags&2064&&g!==null)g.return=i,ee=g;else e:for(i=u;ee!==null;){if(o=ee,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:jl(9,o)}}catch(L){$e(o,o.return,L)}if(o===i){ee=null;break e}var _=o.sibling;if(_!==null){_.return=o.return,ee=_;break e}ee=o.return}}if(je=a,Fn(),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(ml,e)}catch{}r=!0}return r}finally{be=n,Et.transition=t}}return!1}function Id(e,t,n){t=Ds(n,t),t=jm(e,t,1),e=En(e,t,1),t=rt(),e!==null&&(Vr(e,1,t),ut(e,t))}function $e(e,t,n){if(e.tag===3)Id(e,e,n);else for(;t!==null;){if(t.tag===3){Id(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Rn===null||!Rn.has(r))){e=Ds(n,e),e=km(t,e,1),t=En(t,e,1),e=rt(),t!==null&&(Vr(t,1,e),ut(t,e));break}}t=t.return}}function ch(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=rt(),e.pingedLanes|=e.suspendedLanes&n,Ve===e&&(qe&n)===n&&(Ue===4||Ue===3&&(qe&130023424)===qe&&500>Ie()-uc?Xn(e,0):dc|=n),ut(e,t)}function Bm(e,t){t===0&&(e.mode&1?(t=ia,ia<<=1,!(ia&130023424)&&(ia=4194304)):t=1);var n=rt();e=dn(e,t),e!==null&&(Vr(e,t,n),ut(e,n))}function dh(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bm(e,n)}function uh(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),Bm(e,n)}var Vm;Vm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ct.current)ot=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ot=!1,Yx(e,t,n);ot=!!(e.flags&131072)}else ot=!1,Re&&t.flags&1048576&&Kp(t,Qa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ra(e,t),e=t.pendingProps;var a=$s(t,et.current);Ps(t,n),a=rc(null,t,r,e,a,n);var l=ac();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,dt(r)?(l=!0,qa(t)):l=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Zo(t),a.updater=wl,t.stateNode=a,a._reactInternals=t,Zi(t,r,e,n),t=no(null,t,r,!0,l,n)):(t.tag=0,Re&&l&&qo(t),nt(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ra(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=mh(r),e=$t(r,e),a){case 0:t=to(null,t,r,e,n);break e;case 1:t=_d(null,t,r,e,n);break e;case 11:t=Nd(null,t,r,e,n);break e;case 14:t=Sd(null,t,r,$t(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:$t(r,a),to(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:$t(r,a),_d(e,t,r,a,n);case 3:e:{if(_m(t),e===null)throw Error(B(387));r=t.pendingProps,l=t.memoizedState,a=l.element,Zp(e,t),Xa(t,r,null,n);var i=t.memoizedState;if(r=i.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){a=Ds(Error(B(423)),t),t=Cd(e,t,r,n,a);break e}else if(r!==a){a=Ds(Error(B(424)),t),t=Cd(e,t,r,n,a);break e}else for(ht=Cn(t.stateNode.containerInfo.firstChild),gt=t,Re=!0,It=null,n=Xp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Os(),r===a){t=un(e,t,n);break e}nt(e,t,r,n)}t=t.child}return t;case 5:return em(t),e===null&&Gi(t),r=t.type,a=t.pendingProps,l=e!==null?e.memoizedProps:null,i=a.children,Wi(r,a)?i=null:l!==null&&Wi(r,l)&&(t.flags|=32),Sm(e,t),nt(e,t,i,n),t.child;case 6:return e===null&&Gi(t),null;case 13:return Cm(e,t,n);case 4:return ec(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Is(t,null,r,n):nt(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:$t(r,a),Nd(e,t,r,a,n);case 7:return nt(e,t,t.pendingProps,n),t.child;case 8:return nt(e,t,t.pendingProps.children,n),t.child;case 12:return nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,l=t.memoizedProps,i=a.value,Ne(Ja,r._currentValue),r._currentValue=i,l!==null)if(Ft(l.value,i)){if(l.children===a.children&&!ct.current){t=un(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var o=l.dependencies;if(o!==null){i=l.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(l.tag===1){c=an(-1,n&-n),c.tag=2;var d=l.updateQueue;if(d!==null){d=d.shared;var m=d.pending;m===null?c.next=c:(c.next=m.next,m.next=c),d.pending=c}}l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),Xi(l.return,n,t),o.lanes|=n;break}c=c.next}}else if(l.tag===10)i=l.type===t.type?null:l.child;else if(l.tag===18){if(i=l.return,i===null)throw Error(B(341));i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Xi(i,n,t),i=l.sibling}else i=l.child;if(i!==null)i.return=l;else for(i=l;i!==null;){if(i===t){i=null;break}if(l=i.sibling,l!==null){l.return=i.return,i=l;break}i=i.return}l=i}nt(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,Ps(t,n),a=Rt(a),r=r(a),t.flags|=1,nt(e,t,r,n),t.child;case 14:return r=t.type,a=$t(r,t.pendingProps),a=$t(r.type,a),Sd(e,t,r,a,n);case 15:return bm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:$t(r,a),Ra(e,t),t.tag=1,dt(r)?(e=!0,qa(t)):e=!1,Ps(t,n),wm(t,r,a),Zi(t,r,a,n),no(null,t,r,!0,e,n);case 19:return Em(e,t,n);case 22:return Nm(e,t,n)}throw Error(B(156,t.tag))};function Hm(e,t){return gp(e,t)}function ph(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _t(e,t,n,r){return new ph(e,t,n,r)}function xc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function mh(e){if(typeof e=="function")return xc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===$o)return 11;if(e===Oo)return 14}return 2}function Pn(e,t){var n=e.alternate;return n===null?(n=_t(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&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 La(e,t,n,r,a,l){var i=2;if(r=e,typeof e=="function")xc(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case hs:return Yn(n.children,a,l,t);case Ao:i=8,a|=8;break;case bi:return e=_t(12,n,t,a|2),e.elementType=bi,e.lanes=l,e;case Ni:return e=_t(13,n,t,a),e.elementType=Ni,e.lanes=l,e;case Si:return e=_t(19,n,t,a),e.elementType=Si,e.lanes=l,e;case ep:return bl(n,a,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yu:i=10;break e;case Zu:i=9;break e;case $o:i=11;break e;case Oo:i=14;break e;case gn:i=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=_t(i,n,t,a),t.elementType=e,t.type=r,t.lanes=l,t}function Yn(e,t,n,r){return e=_t(7,e,r,t),e.lanes=n,e}function bl(e,t,n,r){return e=_t(22,e,r,t),e.elementType=ep,e.lanes=n,e.stateNode={isHidden:!1},e}function li(e,t,n){return e=_t(6,e,null,t),e.lanes=n,e}function ii(e,t,n){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fh(e,t,n,r,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=Ul(0),this.expirationTimes=Ul(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ul(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function hc(e,t,n,r,a,l,i,o,c){return e=new fh(e,t,n,o,c),t===1?(t=1,l===!0&&(t|=8)):t=0,l=_t(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zo(l),e}function xh(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Wm(e){if(!e)return On;e=e._reactInternals;e:{if(us(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(dt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(dt(n))return Wp(e,n,t)}return t}function qm(e,t,n,r,a,l,i,o,c){return e=hc(n,r,!0,e,a,l,i,o,c),e.context=Wm(null),n=e.current,r=rt(),a=Tn(n),l=an(r,a),l.callback=t??null,En(n,l,a),e.current.lanes=a,Vr(e,a,r),ut(e,r),e}function Nl(e,t,n,r){var a=t.current,l=rt(),i=Tn(a);return n=Wm(n),t.context===null?t.context=n:t.pendingContext=n,t=an(l,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=En(a,t,i),e!==null&&(zt(e,a,i,l),_a(e,a,i)),i}function al(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 Md(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gc(e,t){Md(e,t),(e=e.alternate)&&Md(e,t)}function hh(){return null}var Km=typeof reportError=="function"?reportError:function(e){console.error(e)};function yc(e){this._internalRoot=e}Sl.prototype.render=yc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));Nl(e,t,null,null)};Sl.prototype.unmount=yc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;is(function(){Nl(null,e,null,null)}),t[cn]=null}};function Sl(e){this._internalRoot=e}Sl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Np();e={blockedOn:null,target:e,priority:t};for(var n=0;n<vn.length&&t!==0&&t<vn[n].priority;n++);vn.splice(n,0,e),n===0&&_p(e)}};function vc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Dd(){}function gh(e,t,n,r,a){if(a){if(typeof r=="function"){var l=r;r=function(){var d=al(i);l.call(d)}}var i=qm(t,r,e,0,null,!1,!1,"",Dd);return e._reactRootContainer=i,e[cn]=i.current,Er(e.nodeType===8?e.parentNode:e),is(),i}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var o=r;r=function(){var d=al(c);o.call(d)}}var c=hc(e,0,!1,null,null,!1,!1,"",Dd);return e._reactRootContainer=c,e[cn]=c.current,Er(e.nodeType===8?e.parentNode:e),is(function(){Nl(t,c,n,r)}),c}function Cl(e,t,n,r,a){var l=n._reactRootContainer;if(l){var i=l;if(typeof a=="function"){var o=a;a=function(){var c=al(i);o.call(c)}}Nl(t,i,e,a)}else i=gh(n,t,e,a,r);return al(i)}kp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ir(t.pendingLanes);n!==0&&(Do(t,n|1),ut(t,Ie()),!(je&6)&&(zs=Ie()+500,Fn()))}break;case 13:is(function(){var r=dn(e,1);if(r!==null){var a=rt();zt(r,e,1,a)}}),gc(e,1)}};zo=function(e){if(e.tag===13){var t=dn(e,134217728);if(t!==null){var n=rt();zt(t,e,134217728,n)}gc(e,134217728)}};bp=function(e){if(e.tag===13){var t=Tn(e),n=dn(e,t);if(n!==null){var r=rt();zt(n,e,t,r)}gc(e,t)}};Np=function(){return be};Sp=function(e,t){var n=be;try{return be=e,t()}finally{be=n}};Oi=function(e,t,n){switch(t){case"input":if(Ei(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 r=n[t];if(r!==e&&r.form===e.form){var a=gl(r);if(!a)throw Error(B(90));np(r),Ei(r,a)}}}break;case"textarea":rp(e,n);break;case"select":t=n.value,t!=null&&Cs(e,!!n.multiple,t,!1)}};up=pc;pp=is;var yh={usingClientEntryPoint:!1,Events:[Wr,ws,gl,cp,dp,pc]},tr={findFiberByHostInstance:Kn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},vh={bundleType:tr.bundleType,version:tr.version,rendererPackageName:tr.rendererPackageName,rendererConfig:tr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:mn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=xp(e),e===null?null:e.stateNode},findFiberByHostInstance:tr.findFiberByHostInstance||hh,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 ya=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ya.isDisabled&&ya.supportsFiber)try{ml=ya.inject(vh),Qt=ya}catch{}}wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yh;wt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vc(t))throw Error(B(200));return xh(e,t,null,n)};wt.createRoot=function(e,t){if(!vc(e))throw Error(B(299));var n=!1,r="",a=Km;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=hc(e,1,!1,null,null,n,!1,r,a),e[cn]=t.current,Er(e.nodeType===8?e.parentNode:e),new yc(t)};wt.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(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=xp(t),e=e===null?null:e.stateNode,e};wt.flushSync=function(e){return is(e)};wt.hydrate=function(e,t,n){if(!_l(t))throw Error(B(200));return Cl(null,e,t,!0,n)};wt.hydrateRoot=function(e,t,n){if(!vc(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,a=!1,l="",i=Km;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=qm(t,null,e,1,n??null,a,!1,l,i),e[cn]=t.current,Er(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Sl(t)};wt.render=function(e,t,n){if(!_l(t))throw Error(B(200));return Cl(null,e,t,!1,n)};wt.unmountComponentAtNode=function(e){if(!_l(e))throw Error(B(40));return e._reactRootContainer?(is(function(){Cl(null,null,e,!1,function(){e._reactRootContainer=null,e[cn]=null})}),!0):!1};wt.unstable_batchedUpdates=pc;wt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!_l(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return Cl(e,t,n,!1,r)};wt.version="18.3.1-next-f1338f8080-20240426";function Qm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qm)}catch(e){console.error(e)}}Qm(),Qu.exports=wt;var wh=Qu.exports,zd=wh;ji.createRoot=zd.createRoot,ji.hydrateRoot=zd.hydrateRoot;/**
|
||
* @remix-run/router v1.23.2
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function Mr(){return Mr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr.apply(this,arguments)}var bn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(bn||(bn={}));const Fd="popstate";function jh(e){e===void 0&&(e={});function t(r,a){let{pathname:l,search:i,hash:o}=r.location;return xo("",{pathname:l,search:i,hash:o},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:ll(a)}return bh(t,n,null,e)}function ze(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kh(){return Math.random().toString(36).substr(2,8)}function Ud(e,t){return{usr:e.state,key:e.key,idx:t}}function xo(e,t,n,r){return n===void 0&&(n=null),Mr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ws(t):t,{state:n,key:t&&t.key||r||kh()})}function ll(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ws(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function bh(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:l=!1}=r,i=a.history,o=bn.Pop,c=null,d=m();d==null&&(d=0,i.replaceState(Mr({},i.state,{idx:d}),""));function m(){return(i.state||{idx:null}).idx}function f(){o=bn.Pop;let k=m(),y=k==null?null:k-d;d=k,c&&c({action:o,location:w.location,delta:y})}function p(k,y){o=bn.Push;let u=xo(w.location,k,y);d=m()+1;let g=Ud(u,d),_=w.createHref(u);try{i.pushState(g,"",_)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;a.location.assign(_)}l&&c&&c({action:o,location:w.location,delta:1})}function N(k,y){o=bn.Replace;let u=xo(w.location,k,y);d=m();let g=Ud(u,d),_=w.createHref(u);i.replaceState(g,"",_),l&&c&&c({action:o,location:w.location,delta:0})}function v(k){let y=a.location.origin!=="null"?a.location.origin:a.location.href,u=typeof k=="string"?k:ll(k);return u=u.replace(/ $/,"%20"),ze(y,"No window.location.(origin|href) available to create URL for href: "+u),new URL(u,y)}let w={get action(){return o},get location(){return e(a,i)},listen(k){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Fd,f),c=k,()=>{a.removeEventListener(Fd,f),c=null}},createHref(k){return t(a,k)},createURL:v,encodeLocation(k){let y=v(k);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:N,go(k){return i.go(k)}};return w}var Bd;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Bd||(Bd={}));function Nh(e,t,n){return n===void 0&&(n="/"),Sh(e,t,n)}function Sh(e,t,n,r){let a=typeof t=="string"?Ws(t):t,l=jc(a.pathname||"/",n);if(l==null)return null;let i=Jm(e);_h(i);let o=null;for(let c=0;o==null&&c<i.length;++c){let d=Dh(l);o=Oh(i[c],d)}return o}function Jm(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(l,i,o)=>{let c={relativePath:o===void 0?l.path||"":o,caseSensitive:l.caseSensitive===!0,childrenIndex:i,route:l};c.relativePath.startsWith("/")&&(ze(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=Ln([r,c.relativePath]),m=n.concat(c);l.children&&l.children.length>0&&(ze(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Jm(l.children,t,m,d)),!(l.path==null&&!l.index)&&t.push({path:d,score:Ah(d,l.index),routesMeta:m})};return e.forEach((l,i)=>{var o;if(l.path===""||!((o=l.path)!=null&&o.includes("?")))a(l,i);else for(let c of Gm(l.path))a(l,i,c)}),t}function Gm(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return a?[l,""]:[l];let i=Gm(r.join("/")),o=[];return o.push(...i.map(c=>c===""?l:[l,c].join("/"))),a&&o.push(...i),o.map(c=>e.startsWith("/")&&c===""?"/":c)}function _h(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$h(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Ch=/^:[\w-]+$/,Eh=3,Rh=2,Th=1,Ph=10,Lh=-2,Vd=e=>e==="*";function Ah(e,t){let n=e.split("/"),r=n.length;return n.some(Vd)&&(r+=Lh),t&&(r+=Rh),n.filter(a=>!Vd(a)).reduce((a,l)=>a+(Ch.test(l)?Eh:l===""?Th:Ph),r)}function $h(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function Oh(e,t,n){let{routesMeta:r}=e,a={},l="/",i=[];for(let o=0;o<r.length;++o){let c=r[o],d=o===r.length-1,m=l==="/"?t:t.slice(l.length)||"/",f=Ih({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},m),p=c.route;if(!f)return null;Object.assign(a,f.params),i.push({params:a,pathname:Ln([l,f.pathname]),pathnameBase:Vh(Ln([l,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(l=Ln([l,f.pathnameBase]))}return i}function Ih(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Mh(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let l=a[0],i=l.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:r.reduce((d,m,f)=>{let{paramName:p,isOptional:N}=m;if(p==="*"){let w=o[f]||"";i=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const v=o[f];return N&&!v?d[p]=void 0:d[p]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:l,pathnameBase:i,pattern:e}}function Mh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),wc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,o,c)=>(r.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function Dh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return wc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function jc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const zh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fh=e=>zh.test(e);function Uh(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Ws(e):e,l;if(n)if(Fh(n))l=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),wc(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+n))}n.startsWith("/")?l=Hd(n.substring(1),"/"):l=Hd(n,t)}else l=t;return{pathname:l,search:Hh(r),hash:Wh(a)}}function Hd(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function oi(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Bh(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Xm(e,t){let n=Bh(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Ym(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Ws(e):(a=Mr({},e),ze(!a.pathname||!a.pathname.includes("?"),oi("?","pathname","search",a)),ze(!a.pathname||!a.pathname.includes("#"),oi("#","pathname","hash",a)),ze(!a.search||!a.search.includes("#"),oi("#","search","hash",a)));let l=e===""||a.pathname==="",i=l?"/":a.pathname,o;if(i==null)o=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),f-=1;a.pathname=p.join("/")}o=f>=0?t[f]:"/"}let c=Uh(a,o),d=i&&i!=="/"&&i.endsWith("/"),m=(l||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||m)&&(c.pathname+="/"),c}const Ln=e=>e.join("/").replace(/\/\/+/g,"/"),Vh=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Hh=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Wh=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function qh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Zm=["post","put","patch","delete"];new Set(Zm);const Kh=["get",...Zm];new Set(Kh);/**
|
||
* React Router v6.30.3
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function Dr(){return Dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dr.apply(this,arguments)}const kc=x.createContext(null),Qh=x.createContext(null),ps=x.createContext(null),El=x.createContext(null),Un=x.createContext({outlet:null,matches:[],isDataRoute:!1}),e0=x.createContext(null);function Jh(e,t){let{relative:n}=t===void 0?{}:t;Kr()||ze(!1);let{basename:r,navigator:a}=x.useContext(ps),{hash:l,pathname:i,search:o}=n0(e,{relative:n}),c=i;return r!=="/"&&(c=i==="/"?r:Ln([r,i])),a.createHref({pathname:c,search:o,hash:l})}function Kr(){return x.useContext(El)!=null}function qs(){return Kr()||ze(!1),x.useContext(El).location}function t0(e){x.useContext(ps).static||x.useLayoutEffect(e)}function Bn(){let{isDataRoute:e}=x.useContext(Un);return e?og():Gh()}function Gh(){Kr()||ze(!1);let e=x.useContext(kc),{basename:t,future:n,navigator:r}=x.useContext(ps),{matches:a}=x.useContext(Un),{pathname:l}=qs(),i=JSON.stringify(Xm(a,n.v7_relativeSplatPath)),o=x.useRef(!1);return t0(()=>{o.current=!0}),x.useCallback(function(d,m){if(m===void 0&&(m={}),!o.current)return;if(typeof d=="number"){r.go(d);return}let f=Ym(d,JSON.parse(i),l,m.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ln([t,f.pathname])),(m.replace?r.replace:r.push)(f,m.state,m)},[t,r,i,l,e])}function bc(){let{matches:e}=x.useContext(Un),t=e[e.length-1];return t?t.params:{}}function n0(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=x.useContext(ps),{matches:a}=x.useContext(Un),{pathname:l}=qs(),i=JSON.stringify(Xm(a,r.v7_relativeSplatPath));return x.useMemo(()=>Ym(e,JSON.parse(i),l,n==="path"),[e,i,l,n])}function Xh(e,t){return Yh(e,t)}function Yh(e,t,n,r){Kr()||ze(!1);let{navigator:a}=x.useContext(ps),{matches:l}=x.useContext(Un),i=l[l.length-1],o=i?i.params:{};i&&i.pathname;let c=i?i.pathnameBase:"/";i&&i.route;let d=qs(),m;if(t){var f;let k=typeof t=="string"?Ws(t):t;c==="/"||(f=k.pathname)!=null&&f.startsWith(c)||ze(!1),m=k}else m=d;let p=m.pathname||"/",N=p;if(c!=="/"){let k=c.replace(/^\//,"").split("/");N="/"+p.replace(/^\//,"").split("/").slice(k.length).join("/")}let v=Nh(e,{pathname:N}),w=sg(v&&v.map(k=>Object.assign({},k,{params:Object.assign({},o,k.params),pathname:Ln([c,a.encodeLocation?a.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?c:Ln([c,a.encodeLocation?a.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),l,n,r);return t&&w?x.createElement(El.Provider,{value:{location:Dr({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:bn.Pop}},w):w}function Zh(){let e=ig(),t=qh(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:a},n):null,null)}const eg=x.createElement(Zh,null);class tg extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?x.createElement(Un.Provider,{value:this.props.routeContext},x.createElement(e0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ng(e){let{routeContext:t,match:n,children:r}=e,a=x.useContext(kc);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Un.Provider,{value:t},r)}function sg(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=r)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,o=(a=n)==null?void 0:a.errors;if(o!=null){let m=i.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);m>=0||ze(!1),i=i.slice(0,Math.min(i.length,m+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let m=0;m<i.length;m++){let f=i[m];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(d=m),f.route.id){let{loaderData:p,errors:N}=n,v=f.route.loader&&p[f.route.id]===void 0&&(!N||N[f.route.id]===void 0);if(f.route.lazy||v){c=!0,d>=0?i=i.slice(0,d+1):i=[i[0]];break}}}return i.reduceRight((m,f,p)=>{let N,v=!1,w=null,k=null;n&&(N=o&&f.route.id?o[f.route.id]:void 0,w=f.route.errorElement||eg,c&&(d<0&&p===0?(cg("route-fallback"),v=!0,k=null):d===p&&(v=!0,k=f.route.hydrateFallbackElement||null)));let y=t.concat(i.slice(0,p+1)),u=()=>{let g;return N?g=w:v?g=k:f.route.Component?g=x.createElement(f.route.Component,null):f.route.element?g=f.route.element:g=m,x.createElement(ng,{match:f,routeContext:{outlet:m,matches:y,isDataRoute:n!=null},children:g})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?x.createElement(tg,{location:n.location,revalidation:n.revalidation,component:w,error:N,children:u(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):u()},null)}var s0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(s0||{}),r0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(r0||{});function rg(e){let t=x.useContext(kc);return t||ze(!1),t}function ag(e){let t=x.useContext(Qh);return t||ze(!1),t}function lg(e){let t=x.useContext(Un);return t||ze(!1),t}function a0(e){let t=lg(),n=t.matches[t.matches.length-1];return n.route.id||ze(!1),n.route.id}function ig(){var e;let t=x.useContext(e0),n=ag(),r=a0();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function og(){let{router:e}=rg(s0.UseNavigateStable),t=a0(r0.UseNavigateStable),n=x.useRef(!1);return t0(()=>{n.current=!0}),x.useCallback(function(a,l){l===void 0&&(l={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Dr({fromRouteId:t},l)))},[e,t])}const Wd={};function cg(e,t,n){Wd[e]||(Wd[e]=!0)}function dg(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function tt(e){ze(!1)}function ug(e){let{basename:t="/",children:n=null,location:r,navigationType:a=bn.Pop,navigator:l,static:i=!1,future:o}=e;Kr()&&ze(!1);let c=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:c,navigator:l,static:i,future:Dr({v7_relativeSplatPath:!1},o)}),[c,o,l,i]);typeof r=="string"&&(r=Ws(r));let{pathname:m="/",search:f="",hash:p="",state:N=null,key:v="default"}=r,w=x.useMemo(()=>{let k=jc(m,c);return k==null?null:{location:{pathname:k,search:f,hash:p,state:N,key:v},navigationType:a}},[c,m,f,p,N,v,a]);return w==null?null:x.createElement(ps.Provider,{value:d},x.createElement(El.Provider,{children:n,value:w}))}function pg(e){let{children:t,location:n}=e;return Xh(ho(t),n)}new Promise(()=>{});function ho(e,t){t===void 0&&(t=[]);let n=[];return x.Children.forEach(e,(r,a)=>{if(!x.isValidElement(r))return;let l=[...t,a];if(r.type===x.Fragment){n.push.apply(n,ho(r.props.children,l));return}r.type!==tt&&ze(!1),!r.props.index||!r.props.children||ze(!1);let i={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=ho(r.props.children,l)),n.push(i)}),n}/**
|
||
* React Router DOM v6.30.3
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},go.apply(this,arguments)}function mg(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,l;for(l=0;l<r.length;l++)a=r[l],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function fg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xg(e,t){return e.button===0&&(!t||t==="_self")&&!fg(e)}const hg=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],gg="6";try{window.__reactRouterVersion=gg}catch{}const yg="startTransition",qd=cf[yg];function vg(e){let{basename:t,children:n,future:r,window:a}=e,l=x.useRef();l.current==null&&(l.current=jh({window:a,v5Compat:!0}));let i=l.current,[o,c]=x.useState({action:i.action,location:i.location}),{v7_startTransition:d}=r||{},m=x.useCallback(f=>{d&&qd?qd(()=>c(f)):c(f)},[c,d]);return x.useLayoutEffect(()=>i.listen(m),[i,m]),x.useEffect(()=>dg(r),[r]),x.createElement(ug,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:i,future:r})}const wg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nn=x.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:l,replace:i,state:o,target:c,to:d,preventScrollReset:m,viewTransition:f}=t,p=mg(t,hg),{basename:N}=x.useContext(ps),v,w=!1;if(typeof d=="string"&&jg.test(d)&&(v=d,wg))try{let g=new URL(window.location.href),_=d.startsWith("//")?new URL(g.protocol+d):new URL(d),L=jc(_.pathname,N);_.origin===g.origin&&L!=null?d=L+_.search+_.hash:w=!0}catch{}let k=Jh(d,{relative:a}),y=kg(d,{replace:i,state:o,target:c,preventScrollReset:m,relative:a,viewTransition:f});function u(g){r&&r(g),g.defaultPrevented||y(g)}return x.createElement("a",go({},p,{href:v||k,onClick:w||l?r:u,ref:n,target:c}))});var Kd;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Kd||(Kd={}));var Qd;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Qd||(Qd={}));function kg(e,t){let{target:n,replace:r,state:a,preventScrollReset:l,relative:i,viewTransition:o}=t===void 0?{}:t,c=Bn(),d=qs(),m=n0(e,{relative:i});return x.useCallback(f=>{if(xg(f,n)){f.preventDefault();let p=r!==void 0?r:ll(d)===ll(m);c(e,{replace:p,state:a,preventScrollReset:l,relative:i,viewTransition:o})}},[d,c,m,r,a,n,e,l,i,o])}/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var bg={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"};/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ng=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Z=(e,t)=>{const n=x.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:o="",children:c,...d},m)=>x.createElement("svg",{ref:m,...bg,width:a,height:a,stroke:r,strokeWidth:i?Number(l)*24/Number(a):l,className:["lucide",`lucide-${Ng(e)}`,o].join(" "),...d},[...t.map(([f,p])=>x.createElement(f,p)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const l0=Z("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Jd=Z("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Oe=Z("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Sg=Z("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _g=Z("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Gd=Z("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Cg=Z("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Nc=Z("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const In=Z("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Xd=Z("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Mt=Z("Brain",[["path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z",key:"1mhkh5"}],["path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z",key:"1d6s00"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Eg=Z("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const yo=Z("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Mn=Z("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Wt=Z("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Yd=Z("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const pt=Z("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const zr=Z("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Zn=Z("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Rg=Z("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Xt=Z("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const i0=Z("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const o0=Z("Container",[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const cr=Z("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const il=Z("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const os=Z("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const An=Z("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ol=Z("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const yt=Z("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const vo=Z("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const pn=Z("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Tg=Z("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Pg=Z("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Lg=Z("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ag=Z("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $g=Z("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Og=Z("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const qt=Z("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const c0=Z("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const d0=Z("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ig=Z("MinusCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Mg=Z("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const cl=Z("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Yt=Z("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Gt=Z("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ln=Z("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const wo=Z("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Dg=Z("Router",[["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6.01 18H6",key:"19vcac"}],["path",{d:"M10.01 18H10",key:"uamcmx"}],["path",{d:"M15 10v4",key:"qjz1xs"}],["path",{d:"M17.84 7.17a4 4 0 0 0-5.66 0",key:"1rif40"}],["path",{d:"M20.66 4.34a8 8 0 0 0-11.31 0",key:"6a5xfq"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const u0=Z("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Zd=Z("ScrollText",[["path",{d:"M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4",key:"13a6an"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M15 12h-5",key:"r7krc0"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Qr=Z("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const dl=Z("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const zg=Z("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const p0=Z("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Fg=Z("ShieldAlert",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ke=Z("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const m0=Z("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ug=Z("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const eu=Z("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const es=Z("StopCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{width:"6",height:"6",x:"9",y:"9",key:"1wrtvo"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Bg=Z("Tag",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Kt=Z("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ye=Z("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Vg=Z("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Pt=Z("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const tu=Z("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Hg=Z("Wifi",[["path",{d:"M5 13a10 10 0 0 1 14 0",key:"6v8j51"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const vr=Z("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ct=Z("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Sc=Z("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
||
* @license lucide-react v0.303.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Rl=Z("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),Wg=[{path:"/",icon:Lg,label:"Dashboard"},{path:"/auto",icon:wo,label:"Auto Pentest"},{path:"/vuln-lab",icon:vo,label:"Vuln Lab"},{path:"/terminal",icon:Ye,label:"Terminal Agent"},{path:"/sandboxes",icon:o0,label:"Sandboxes"},{path:"/scan/new",icon:In,label:"AI Agent"},{path:"/realtime",icon:Rl,label:"Real-time Task"},{path:"/tasks",icon:Nc,label:"Task Library"},{path:"/scheduler",icon:Xt,label:"Scheduler"},{path:"/reports",icon:yt,label:"Reports"},{path:"/settings",icon:p0,label:"Settings"}];function qg(){const e=qs();return s.jsxs("aside",{className:"w-64 bg-dark-800 border-r border-dark-900/50 flex flex-col",children:[s.jsx("div",{className:"p-6 border-b border-dark-900/50",children:s.jsxs(nn,{to:"/",className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 bg-primary-500 rounded-lg flex items-center justify-center",children:s.jsx(Ke,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-lg font-bold text-white",children:"NeuroSploit"}),s.jsx("p",{className:"text-xs text-dark-400",children:"v3.0 AI Pentest"})]})]})}),s.jsx("nav",{className:"flex-1 p-4",children:s.jsx("ul",{className:"space-y-2",children:Wg.map(t=>{const n=e.pathname===t.path,r=t.icon;return s.jsx("li",{children:s.jsxs(nn,{to:t.path,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${n?"bg-primary-500/20 text-primary-500":"text-dark-300 hover:bg-dark-900/50 hover:text-white"}`,children:[s.jsx(r,{className:"w-5 h-5"}),s.jsx("span",{children:t.label})]})},t.path)})})}),s.jsx("div",{className:"p-4 border-t border-dark-900/50",children:s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx(l0,{className:"w-4 h-4 text-green-500"}),s.jsx("span",{className:"text-dark-400",children:"System Online"})]})})]})}const Kg={"/":"Dashboard","/scan/new":"New Security Scan","/reports":"Reports","/settings":"Settings"};function Qg(){const e=qs(),t=Kg[e.pathname]||"NeuroSploit";return s.jsxs("header",{className:"h-16 bg-dark-800 border-b border-dark-900/50 flex items-center justify-between px-6",children:[s.jsx("h1",{className:"text-xl font-semibold text-white",children:t}),s.jsx("div",{className:"flex items-center gap-4",children:s.jsx("span",{className:"text-sm text-dark-400",children:new Date().toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})})]})}function Jg({children:e}){return s.jsxs("div",{className:"flex min-h-screen bg-dark-700",children:[s.jsx(qg,{}),s.jsxs("div",{className:"flex-1 flex flex-col",children:[s.jsx(Qg,{}),s.jsx("main",{className:"flex-1 p-6 overflow-auto",children:e})]})]})}function f0(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=f0(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Jr(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=f0(e))&&(r&&(r+=" "),r+=t);return r}function re({children:e,className:t,title:n,subtitle:r,action:a}){return s.jsxs("div",{className:Jr("bg-dark-800 rounded-xl border border-dark-900/50",t),children:[(n||a)&&s.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-dark-900/50",children:[s.jsxs("div",{children:[n&&s.jsx("h3",{className:"text-lg font-semibold text-white",children:n}),r&&s.jsx("p",{className:"text-sm text-dark-400 mt-1",children:r})]}),a]}),s.jsx("div",{className:"p-4",children:e})]})}function H({variant:e="primary",size:t="md",isLoading:n=!1,children:r,className:a,disabled:l,...i}){const o="inline-flex items-center justify-center font-medium rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-dark-700 disabled:opacity-50 disabled:cursor-not-allowed",c={primary:"bg-primary-500 text-white hover:bg-primary-600 focus:ring-primary-500",secondary:"bg-dark-900 text-white hover:bg-dark-800 focus:ring-dark-500",danger:"bg-red-600 text-white hover:bg-red-700 focus:ring-red-500",ghost:"text-dark-300 hover:text-white hover:bg-dark-900/50 focus:ring-dark-500"},d={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"};return s.jsx("button",{className:Jr(o,c[e],d[t],a),disabled:l||n,...i,children:n?s.jsxs(s.Fragment,{children:[s.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading..."]}):r})}const Gg={critical:"bg-red-500/20 text-red-400 border-red-500/30",high:"bg-orange-500/20 text-orange-400 border-orange-500/30",medium:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",low:"bg-blue-500/20 text-blue-400 border-blue-500/30",info:"bg-gray-500/20 text-gray-400 border-gray-500/30",success:"bg-green-500/20 text-green-400 border-green-500/30",warning:"bg-amber-500/20 text-amber-400 border-amber-500/30",default:"bg-dark-900/50 text-dark-300 border-dark-700"};function Xg({variant:e="default",children:t,className:n}){return s.jsx("span",{className:Jr("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border",Gg[e],n),children:t})}function ts({severity:e}){const t=e.toLowerCase();return s.jsx(Xg,{variant:t,children:e.toUpperCase()})}function x0(e,t){return function(){return e.apply(t,arguments)}}const{toString:Yg}=Object.prototype,{getPrototypeOf:_c}=Object,{iterator:Tl,toStringTag:h0}=Symbol,Pl=(e=>t=>{const n=Yg.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ut=e=>(e=e.toLowerCase(),t=>Pl(t)===e),Ll=e=>t=>typeof t===e,{isArray:Ks}=Array,Fs=Ll("undefined");function Gr(e){return e!==null&&!Fs(e)&&e.constructor!==null&&!Fs(e.constructor)&&mt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const g0=Ut("ArrayBuffer");function Zg(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&g0(e.buffer),t}const ey=Ll("string"),mt=Ll("function"),y0=Ll("number"),Xr=e=>e!==null&&typeof e=="object",ty=e=>e===!0||e===!1,Aa=e=>{if(Pl(e)!=="object")return!1;const t=_c(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(h0 in e)&&!(Tl in e)},ny=e=>{if(!Xr(e)||Gr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},sy=Ut("Date"),ry=Ut("File"),ay=Ut("Blob"),ly=Ut("FileList"),iy=e=>Xr(e)&&mt(e.pipe),oy=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||mt(e.append)&&((t=Pl(e))==="formdata"||t==="object"&&mt(e.toString)&&e.toString()==="[object FormData]"))},cy=Ut("URLSearchParams"),[dy,uy,py,my]=["ReadableStream","Request","Response","Headers"].map(Ut),fy=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Yr(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Ks(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(Gr(e))return;const l=n?Object.getOwnPropertyNames(e):Object.keys(e),i=l.length;let o;for(r=0;r<i;r++)o=l[r],t.call(null,e[o],o,e)}}function v0(e,t){if(Gr(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,a;for(;r-- >0;)if(a=n[r],t===a.toLowerCase())return a;return null}const Gn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,w0=e=>!Fs(e)&&e!==Gn;function jo(){const{caseless:e,skipUndefined:t}=w0(this)&&this||{},n={},r=(a,l)=>{if(l==="__proto__"||l==="constructor"||l==="prototype")return;const i=e&&v0(n,l)||l;Aa(n[i])&&Aa(a)?n[i]=jo(n[i],a):Aa(a)?n[i]=jo({},a):Ks(a)?n[i]=a.slice():(!t||!Fs(a))&&(n[i]=a)};for(let a=0,l=arguments.length;a<l;a++)arguments[a]&&Yr(arguments[a],r);return n}const xy=(e,t,n,{allOwnKeys:r}={})=>(Yr(t,(a,l)=>{n&&mt(a)?Object.defineProperty(e,l,{value:x0(a,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,l,{value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),hy=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),gy=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},yy=(e,t,n,r)=>{let a,l,i;const o={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),l=a.length;l-- >0;)i=a[l],(!r||r(i,e,t))&&!o[i]&&(t[i]=e[i],o[i]=!0);e=n!==!1&&_c(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},vy=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},wy=e=>{if(!e)return null;if(Ks(e))return e;let t=e.length;if(!y0(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},jy=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&_c(Uint8Array)),ky=(e,t)=>{const r=(e&&e[Tl]).call(e);let a;for(;(a=r.next())&&!a.done;){const l=a.value;t.call(e,l[0],l[1])}},by=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Ny=Ut("HTMLFormElement"),Sy=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),nu=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_y=Ut("RegExp"),j0=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Yr(n,(a,l)=>{let i;(i=t(a,l,e))!==!1&&(r[l]=i||a)}),Object.defineProperties(e,r)},Cy=e=>{j0(e,(t,n)=>{if(mt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(mt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ey=(e,t)=>{const n={},r=a=>{a.forEach(l=>{n[l]=!0})};return Ks(e)?r(e):r(String(e).split(t)),n},Ry=()=>{},Ty=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Py(e){return!!(e&&mt(e.append)&&e[h0]==="FormData"&&e[Tl])}const Ly=e=>{const t=new Array(10),n=(r,a)=>{if(Xr(r)){if(t.indexOf(r)>=0)return;if(Gr(r))return r;if(!("toJSON"in r)){t[a]=r;const l=Ks(r)?[]:{};return Yr(r,(i,o)=>{const c=n(i,a+1);!Fs(c)&&(l[o]=c)}),t[a]=void 0,l}}return r};return n(e,0)},Ay=Ut("AsyncFunction"),$y=e=>e&&(Xr(e)||mt(e))&&mt(e.then)&&mt(e.catch),k0=((e,t)=>e?setImmediate:t?((n,r)=>(Gn.addEventListener("message",({source:a,data:l})=>{a===Gn&&l===n&&r.length&&r.shift()()},!1),a=>{r.push(a),Gn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",mt(Gn.postMessage)),Oy=typeof queueMicrotask<"u"?queueMicrotask.bind(Gn):typeof process<"u"&&process.nextTick||k0,Iy=e=>e!=null&&mt(e[Tl]),T={isArray:Ks,isArrayBuffer:g0,isBuffer:Gr,isFormData:oy,isArrayBufferView:Zg,isString:ey,isNumber:y0,isBoolean:ty,isObject:Xr,isPlainObject:Aa,isEmptyObject:ny,isReadableStream:dy,isRequest:uy,isResponse:py,isHeaders:my,isUndefined:Fs,isDate:sy,isFile:ry,isBlob:ay,isRegExp:_y,isFunction:mt,isStream:iy,isURLSearchParams:cy,isTypedArray:jy,isFileList:ly,forEach:Yr,merge:jo,extend:xy,trim:fy,stripBOM:hy,inherits:gy,toFlatObject:yy,kindOf:Pl,kindOfTest:Ut,endsWith:vy,toArray:wy,forEachEntry:ky,matchAll:by,isHTMLForm:Ny,hasOwnProperty:nu,hasOwnProp:nu,reduceDescriptors:j0,freezeMethods:Cy,toObjectSet:Ey,toCamelCase:Sy,noop:Ry,toFiniteNumber:Ty,findKey:v0,global:Gn,isContextDefined:w0,isSpecCompliantForm:Py,toJSONObject:Ly,isAsyncFn:Ay,isThenable:$y,setImmediate:k0,asap:Oy,isIterable:Iy};let ue=class b0 extends Error{static from(t,n,r,a,l,i){const o=new b0(t.message,n||t.code,r,a,l);return o.cause=t,o.name=t.name,i&&Object.assign(o,i),o}constructor(t,n,r,a,l){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),a&&(this.request=a),l&&(this.response=l,this.status=l.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:T.toJSONObject(this.config),code:this.code,status:this.status}}};ue.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ue.ERR_BAD_OPTION="ERR_BAD_OPTION";ue.ECONNABORTED="ECONNABORTED";ue.ETIMEDOUT="ETIMEDOUT";ue.ERR_NETWORK="ERR_NETWORK";ue.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ue.ERR_DEPRECATED="ERR_DEPRECATED";ue.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ue.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ue.ERR_CANCELED="ERR_CANCELED";ue.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ue.ERR_INVALID_URL="ERR_INVALID_URL";const My=null;function ko(e){return T.isPlainObject(e)||T.isArray(e)}function N0(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function su(e,t,n){return e?e.concat(t).map(function(a,l){return a=N0(a),!n&&l?"["+a+"]":a}).join(n?".":""):t}function Dy(e){return T.isArray(e)&&!e.some(ko)}const zy=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function Al(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,k){return!T.isUndefined(k[w])});const r=n.metaTokens,a=n.visitor||m,l=n.dots,i=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(a))throw new TypeError("visitor must be a function");function d(v){if(v===null)return"";if(T.isDate(v))return v.toISOString();if(T.isBoolean(v))return v.toString();if(!c&&T.isBlob(v))throw new ue("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(v)||T.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function m(v,w,k){let y=v;if(v&&!k&&typeof v=="object"){if(T.endsWith(w,"{}"))w=r?w:w.slice(0,-2),v=JSON.stringify(v);else if(T.isArray(v)&&Dy(v)||(T.isFileList(v)||T.endsWith(w,"[]"))&&(y=T.toArray(v)))return w=N0(w),y.forEach(function(g,_){!(T.isUndefined(g)||g===null)&&t.append(i===!0?su([w],_,l):i===null?w:w+"[]",d(g))}),!1}return ko(v)?!0:(t.append(su(k,w,l),d(v)),!1)}const f=[],p=Object.assign(zy,{defaultVisitor:m,convertValue:d,isVisitable:ko});function N(v,w){if(!T.isUndefined(v)){if(f.indexOf(v)!==-1)throw Error("Circular reference detected in "+w.join("."));f.push(v),T.forEach(v,function(y,u){(!(T.isUndefined(y)||y===null)&&a.call(t,y,T.isString(u)?u.trim():u,w,p))===!0&&N(y,w?w.concat(u):[u])}),f.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return N(e),t}function ru(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Cc(e,t){this._pairs=[],e&&Al(e,this,t)}const S0=Cc.prototype;S0.append=function(t,n){this._pairs.push([t,n])};S0.toString=function(t){const n=t?function(r){return t.call(this,r,ru)}:ru;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function Fy(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _0(e,t,n){if(!t)return e;const r=n&&n.encode||Fy,a=T.isFunction(n)?{serialize:n}:n,l=a&&a.serialize;let i;if(l?i=l(t,a):i=T.isURLSearchParams(t)?t.toString():new Cc(t,a).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class au{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ec={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Uy=typeof URLSearchParams<"u"?URLSearchParams:Cc,By=typeof FormData<"u"?FormData:null,Vy=typeof Blob<"u"?Blob:null,Hy={isBrowser:!0,classes:{URLSearchParams:Uy,FormData:By,Blob:Vy},protocols:["http","https","file","blob","url","data"]},Rc=typeof window<"u"&&typeof document<"u",bo=typeof navigator=="object"&&navigator||void 0,Wy=Rc&&(!bo||["ReactNative","NativeScript","NS"].indexOf(bo.product)<0),qy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ky=Rc&&window.location.href||"http://localhost",Qy=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rc,hasStandardBrowserEnv:Wy,hasStandardBrowserWebWorkerEnv:qy,navigator:bo,origin:Ky},Symbol.toStringTag,{value:"Module"})),Ze={...Qy,...Hy};function Jy(e,t){return Al(e,new Ze.classes.URLSearchParams,{visitor:function(n,r,a,l){return Ze.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}function Gy(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Xy(e){const t={},n=Object.keys(e);let r;const a=n.length;let l;for(r=0;r<a;r++)l=n[r],t[l]=e[l];return t}function C0(e){function t(n,r,a,l){let i=n[l++];if(i==="__proto__")return!0;const o=Number.isFinite(+i),c=l>=n.length;return i=!i&&T.isArray(a)?a.length:i,c?(T.hasOwnProp(a,i)?a[i]=[a[i],r]:a[i]=r,!o):((!a[i]||!T.isObject(a[i]))&&(a[i]=[]),t(n,r,a[i],l)&&T.isArray(a[i])&&(a[i]=Xy(a[i])),!o)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,a)=>{t(Gy(r),a,n,0)}),n}return null}function Yy(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Zr={transitional:Ec,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,l=T.isObject(t);if(l&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return a?JSON.stringify(C0(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(l){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Jy(t,this.formSerializer).toString();if((o=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Al(o?{"files[]":t}:t,c&&new c,this.formSerializer)}}return l||a?(n.setContentType("application/json",!1),Yy(t)):t}],transformResponse:[function(t){const n=this.transitional||Zr.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(r&&!this.responseType||a)){const i=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(o){if(i)throw o.name==="SyntaxError"?ue.from(o,ue.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ze.classes.FormData,Blob:Ze.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{Zr.headers[e]={}});const Zy=T.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ev=e=>{const t={};let n,r,a;return e&&e.split(`
|
||
`).forEach(function(i){a=i.indexOf(":"),n=i.substring(0,a).trim().toLowerCase(),r=i.substring(a+1).trim(),!(!n||t[n]&&Zy[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},lu=Symbol("internals");function nr(e){return e&&String(e).trim().toLowerCase()}function $a(e){return e===!1||e==null?e:T.isArray(e)?e.map($a):String(e)}function tv(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const nv=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ci(e,t,n,r,a){if(T.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!T.isString(t)){if(T.isString(r))return t.indexOf(r)!==-1;if(T.isRegExp(r))return r.test(t)}}function sv(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function rv(e,t){const n=T.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,l,i){return this[r].call(this,t,a,l,i)},configurable:!0})})}let ft=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function l(o,c,d){const m=nr(c);if(!m)throw new Error("header name must be a non-empty string");const f=T.findKey(a,m);(!f||a[f]===void 0||d===!0||d===void 0&&a[f]!==!1)&&(a[f||c]=$a(o))}const i=(o,c)=>T.forEach(o,(d,m)=>l(d,m,c));if(T.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(T.isString(t)&&(t=t.trim())&&!nv(t))i(ev(t),n);else if(T.isObject(t)&&T.isIterable(t)){let o={},c,d;for(const m of t){if(!T.isArray(m))throw TypeError("Object iterator must return a key-value pair");o[d=m[0]]=(c=o[d])?T.isArray(c)?[...c,m[1]]:[c,m[1]]:m[1]}i(o,n)}else t!=null&&l(n,t,r);return this}get(t,n){if(t=nr(t),t){const r=T.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return tv(a);if(T.isFunction(n))return n.call(this,a,r);if(T.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=nr(t),t){const r=T.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ci(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function l(i){if(i=nr(i),i){const o=T.findKey(r,i);o&&(!n||ci(r,r[o],o,n))&&(delete r[o],a=!0)}}return T.isArray(t)?t.forEach(l):l(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const l=n[r];(!t||ci(this,this[l],l,t,!0))&&(delete this[l],a=!0)}return a}normalize(t){const n=this,r={};return T.forEach(this,(a,l)=>{const i=T.findKey(r,l);if(i){n[i]=$a(a),delete n[l];return}const o=t?sv(l):String(l).trim();o!==l&&delete n[l],n[o]=$a(a),r[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return T.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&T.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
||
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[lu]=this[lu]={accessors:{}}).accessors,a=this.prototype;function l(i){const o=nr(i);r[o]||(rv(a,i),r[o]=!0)}return T.isArray(t)?t.forEach(l):l(t),this}};ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);T.reduceDescriptors(ft.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});T.freezeMethods(ft);function di(e,t){const n=this||Zr,r=t||n,a=ft.from(r.headers);let l=r.data;return T.forEach(e,function(o){l=o.call(n,l,a.normalize(),t?t.status:void 0)}),a.normalize(),l}function E0(e){return!!(e&&e.__CANCEL__)}let ea=class extends ue{constructor(t,n,r){super(t??"canceled",ue.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function R0(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ue("Request failed with status code "+n.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function av(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function lv(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,l=0,i;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),m=r[l];i||(i=d),n[a]=c,r[a]=d;let f=l,p=0;for(;f!==a;)p+=n[f++],f=f%e;if(a=(a+1)%e,a===l&&(l=(l+1)%e),d-i<t)return;const N=m&&d-m;return N?Math.round(p*1e3/N):void 0}}function iv(e,t){let n=0,r=1e3/t,a,l;const i=(d,m=Date.now())=>{n=m,a=null,l&&(clearTimeout(l),l=null),e(...d)};return[(...d)=>{const m=Date.now(),f=m-n;f>=r?i(d,m):(a=d,l||(l=setTimeout(()=>{l=null,i(a)},r-f)))},()=>a&&i(a)]}const ul=(e,t,n=3)=>{let r=0;const a=lv(50,250);return iv(l=>{const i=l.loaded,o=l.lengthComputable?l.total:void 0,c=i-r,d=a(c),m=i<=o;r=i;const f={loaded:i,total:o,progress:o?i/o:void 0,bytes:c,rate:d||void 0,estimated:d&&o&&m?(o-i)/d:void 0,event:l,lengthComputable:o!=null,[t?"download":"upload"]:!0};e(f)},n)},iu=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ou=e=>(...t)=>T.asap(()=>e(...t)),ov=Ze.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ze.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ze.origin),Ze.navigator&&/(msie|trident)/i.test(Ze.navigator.userAgent)):()=>!0,cv=Ze.hasStandardBrowserEnv?{write(e,t,n,r,a,l,i){if(typeof document>"u")return;const o=[`${e}=${encodeURIComponent(t)}`];T.isNumber(n)&&o.push(`expires=${new Date(n).toUTCString()}`),T.isString(r)&&o.push(`path=${r}`),T.isString(a)&&o.push(`domain=${a}`),l===!0&&o.push("secure"),T.isString(i)&&o.push(`SameSite=${i}`),document.cookie=o.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function dv(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function uv(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function T0(e,t,n){let r=!dv(t);return e&&(r||n==!1)?uv(e,t):t}const cu=e=>e instanceof ft?{...e}:e;function cs(e,t){t=t||{};const n={};function r(d,m,f,p){return T.isPlainObject(d)&&T.isPlainObject(m)?T.merge.call({caseless:p},d,m):T.isPlainObject(m)?T.merge({},m):T.isArray(m)?m.slice():m}function a(d,m,f,p){if(T.isUndefined(m)){if(!T.isUndefined(d))return r(void 0,d,f,p)}else return r(d,m,f,p)}function l(d,m){if(!T.isUndefined(m))return r(void 0,m)}function i(d,m){if(T.isUndefined(m)){if(!T.isUndefined(d))return r(void 0,d)}else return r(void 0,m)}function o(d,m,f){if(f in t)return r(d,m);if(f in e)return r(void 0,d)}const c={url:l,method:l,data:l,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:o,headers:(d,m,f)=>a(cu(d),cu(m),f,!0)};return T.forEach(Object.keys({...e,...t}),function(m){if(m==="__proto__"||m==="constructor"||m==="prototype")return;const f=T.hasOwnProp(c,m)?c[m]:a,p=f(e[m],t[m],m);T.isUndefined(p)&&f!==o||(n[m]=p)}),n}const P0=e=>{const t=cs({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:l,headers:i,auth:o}=t;if(t.headers=i=ft.from(i),t.url=_0(T0(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),o&&i.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),T.isFormData(n)){if(Ze.hasStandardBrowserEnv||Ze.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(T.isFunction(n.getHeaders)){const c=n.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([m,f])=>{d.includes(m.toLowerCase())&&i.set(m,f)})}}if(Ze.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&ov(t.url))){const c=a&&l&&cv.read(l);c&&i.set(a,c)}return t},pv=typeof XMLHttpRequest<"u",mv=pv&&function(e){return new Promise(function(n,r){const a=P0(e);let l=a.data;const i=ft.from(a.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:d}=a,m,f,p,N,v;function w(){N&&N(),v&&v(),a.cancelToken&&a.cancelToken.unsubscribe(m),a.signal&&a.signal.removeEventListener("abort",m)}let k=new XMLHttpRequest;k.open(a.method.toUpperCase(),a.url,!0),k.timeout=a.timeout;function y(){if(!k)return;const g=ft.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),L={data:!o||o==="text"||o==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:g,config:e,request:k};R0(function(R){n(R),w()},function(R){r(R),w()},L),k=null}"onloadend"in k?k.onloadend=y:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(y)},k.onabort=function(){k&&(r(new ue("Request aborted",ue.ECONNABORTED,e,k)),k=null)},k.onerror=function(_){const L=_&&_.message?_.message:"Network Error",D=new ue(L,ue.ERR_NETWORK,e,k);D.event=_||null,r(D),k=null},k.ontimeout=function(){let _=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const L=a.transitional||Ec;a.timeoutErrorMessage&&(_=a.timeoutErrorMessage),r(new ue(_,L.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,e,k)),k=null},l===void 0&&i.setContentType(null),"setRequestHeader"in k&&T.forEach(i.toJSON(),function(_,L){k.setRequestHeader(L,_)}),T.isUndefined(a.withCredentials)||(k.withCredentials=!!a.withCredentials),o&&o!=="json"&&(k.responseType=a.responseType),d&&([p,v]=ul(d,!0),k.addEventListener("progress",p)),c&&k.upload&&([f,N]=ul(c),k.upload.addEventListener("progress",f),k.upload.addEventListener("loadend",N)),(a.cancelToken||a.signal)&&(m=g=>{k&&(r(!g||g.type?new ea(null,e,k):g),k.abort(),k=null)},a.cancelToken&&a.cancelToken.subscribe(m),a.signal&&(a.signal.aborted?m():a.signal.addEventListener("abort",m)));const u=av(a.url);if(u&&Ze.protocols.indexOf(u)===-1){r(new ue("Unsupported protocol "+u+":",ue.ERR_BAD_REQUEST,e));return}k.send(l||null)})},fv=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const l=function(d){if(!a){a=!0,o();const m=d instanceof Error?d:this.reason;r.abort(m instanceof ue?m:new ea(m instanceof Error?m.message:m))}};let i=t&&setTimeout(()=>{i=null,l(new ue(`timeout of ${t}ms exceeded`,ue.ETIMEDOUT))},t);const o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(l):d.removeEventListener("abort",l)}),e=null)};e.forEach(d=>d.addEventListener("abort",l));const{signal:c}=r;return c.unsubscribe=()=>T.asap(o),c}},xv=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,a;for(;r<n;)a=r+t,yield e.slice(r,a),r=a},hv=async function*(e,t){for await(const n of gv(e))yield*xv(n,t)},gv=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},du=(e,t,n,r)=>{const a=hv(e,t);let l=0,i,o=c=>{i||(i=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:m}=await a.next();if(d){o(),c.close();return}let f=m.byteLength;if(n){let p=l+=f;n(p)}c.enqueue(new Uint8Array(m))}catch(d){throw o(d),d}},cancel(c){return o(c),a.return()}},{highWaterMark:2})},uu=64*1024,{isFunction:va}=T,yv=(({Request:e,Response:t})=>({Request:e,Response:t}))(T.global),{ReadableStream:pu,TextEncoder:mu}=T.global,fu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},vv=e=>{e=T.merge.call({skipUndefined:!0},yv,e);const{fetch:t,Request:n,Response:r}=e,a=t?va(t):typeof fetch=="function",l=va(n),i=va(r);if(!a)return!1;const o=a&&va(pu),c=a&&(typeof mu=="function"?(v=>w=>v.encode(w))(new mu):async v=>new Uint8Array(await new n(v).arrayBuffer())),d=l&&o&&fu(()=>{let v=!1;const w=new n(Ze.origin,{body:new pu,method:"POST",get duplex(){return v=!0,"half"}}).headers.has("Content-Type");return v&&!w}),m=i&&o&&fu(()=>T.isReadableStream(new r("").body)),f={stream:m&&(v=>v.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!f[v]&&(f[v]=(w,k)=>{let y=w&&w[v];if(y)return y.call(w);throw new ue(`Response type '${v}' is not supported`,ue.ERR_NOT_SUPPORT,k)})});const p=async v=>{if(v==null)return 0;if(T.isBlob(v))return v.size;if(T.isSpecCompliantForm(v))return(await new n(Ze.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(T.isArrayBufferView(v)||T.isArrayBuffer(v))return v.byteLength;if(T.isURLSearchParams(v)&&(v=v+""),T.isString(v))return(await c(v)).byteLength},N=async(v,w)=>{const k=T.toFiniteNumber(v.getContentLength());return k??p(w)};return async v=>{let{url:w,method:k,data:y,signal:u,cancelToken:g,timeout:_,onDownloadProgress:L,onUploadProgress:D,responseType:R,headers:E,withCredentials:U="same-origin",fetchOptions:q}=P0(v),A=t||fetch;R=R?(R+"").toLowerCase():"text";let te=fv([u,g&&g.toAbortSignal()],_),Q=null;const ne=te&&te.unsubscribe&&(()=>{te.unsubscribe()});let ae;try{if(D&&d&&k!=="get"&&k!=="head"&&(ae=await N(E,y))!==0){let V=new n(w,{method:"POST",body:y,duplex:"half"}),G;if(T.isFormData(y)&&(G=V.headers.get("content-type"))&&E.setContentType(G),V.body){const[ge,he]=iu(ae,ul(ou(D)));y=du(V.body,uu,ge,he)}}T.isString(U)||(U=U?"include":"omit");const ce=l&&"credentials"in n.prototype,xe={...q,signal:te,method:k.toUpperCase(),headers:E.normalize().toJSON(),body:y,duplex:"half",credentials:ce?U:void 0};Q=l&&new n(w,xe);let z=await(l?A(Q,q):A(w,xe));const Y=m&&(R==="stream"||R==="response");if(m&&(L||Y&&ne)){const V={};["status","statusText","headers"].forEach(ke=>{V[ke]=z[ke]});const G=T.toFiniteNumber(z.headers.get("content-length")),[ge,he]=L&&iu(G,ul(ou(L),!0))||[];z=new r(du(z.body,uu,ge,()=>{he&&he(),ne&&ne()}),V)}R=R||"text";let se=await f[T.findKey(f,R)||"text"](z,v);return!Y&&ne&&ne(),await new Promise((V,G)=>{R0(V,G,{data:se,headers:ft.from(z.headers),status:z.status,statusText:z.statusText,config:v,request:Q})})}catch(ce){throw ne&&ne(),ce&&ce.name==="TypeError"&&/Load failed|fetch/i.test(ce.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,v,Q,ce&&ce.response),{cause:ce.cause||ce}):ue.from(ce,ce&&ce.code,v,Q,ce&&ce.response)}}},wv=new Map,L0=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,l=[r,a,n];let i=l.length,o=i,c,d,m=wv;for(;o--;)c=l[o],d=m.get(c),d===void 0&&m.set(c,d=o?new Map:vv(t)),m=d;return d};L0();const Tc={http:My,xhr:mv,fetch:{get:L0}};T.forEach(Tc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const xu=e=>`- ${e}`,jv=e=>T.isFunction(e)||e===null||e===!1;function kv(e,t){e=T.isArray(e)?e:[e];const{length:n}=e;let r,a;const l={};for(let i=0;i<n;i++){r=e[i];let o;if(a=r,!jv(r)&&(a=Tc[(o=String(r)).toLowerCase()],a===void 0))throw new ue(`Unknown adapter '${o}'`);if(a&&(T.isFunction(a)||(a=a.get(t))))break;l[o||"#"+i]=a}if(!a){const i=Object.entries(l).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let o=n?i.length>1?`since :
|
||
`+i.map(xu).join(`
|
||
`):" "+xu(i[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return a}const A0={getAdapter:kv,adapters:Tc};function ui(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ea(null,e)}function hu(e){return ui(e),e.headers=ft.from(e.headers),e.data=di.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),A0.getAdapter(e.adapter||Zr.adapter,e)(e).then(function(r){return ui(e),r.data=di.call(e,e.transformResponse,r),r.headers=ft.from(r.headers),r},function(r){return E0(r)||(ui(e),r&&r.response&&(r.response.data=di.call(e,e.transformResponse,r.response),r.response.headers=ft.from(r.response.headers))),Promise.reject(r)})}const $0="1.13.5",$l={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$l[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const gu={};$l.transitional=function(t,n,r){function a(l,i){return"[Axios v"+$0+"] Transitional option '"+l+"'"+i+(r?". "+r:"")}return(l,i,o)=>{if(t===!1)throw new ue(a(i," has been removed"+(n?" in "+n:"")),ue.ERR_DEPRECATED);return n&&!gu[i]&&(gu[i]=!0,console.warn(a(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,i,o):!0}};$l.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function bv(e,t,n){if(typeof e!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const l=r[a],i=t[l];if(i){const o=e[l],c=o===void 0||i(o,l,e);if(c!==!0)throw new ue("option "+l+" must be "+c,ue.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ue("Unknown option "+l,ue.ERR_BAD_OPTION)}}const Oa={assertOptions:bv,validators:$l},bt=Oa.validators;let ns=class{constructor(t){this.defaults=t||{},this.interceptors={request:new au,response:new au}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const l=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
||
`+l):r.stack=l}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=cs(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:l}=n;r!==void 0&&Oa.assertOptions(r,{silentJSONParsing:bt.transitional(bt.boolean),forcedJSONParsing:bt.transitional(bt.boolean),clarifyTimeoutError:bt.transitional(bt.boolean),legacyInterceptorReqResOrdering:bt.transitional(bt.boolean)},!1),a!=null&&(T.isFunction(a)?n.paramsSerializer={serialize:a}:Oa.assertOptions(a,{encode:bt.function,serialize:bt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Oa.assertOptions(n,{baseUrl:bt.spelling("baseURL"),withXsrfToken:bt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=l&&T.merge(l.common,l[n.method]);l&&T.forEach(["delete","get","head","post","put","patch","common"],v=>{delete l[v]}),n.headers=ft.concat(i,l);const o=[];let c=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(n)===!1)return;c=c&&w.synchronous;const k=n.transitional||Ec;k&&k.legacyInterceptorReqResOrdering?o.unshift(w.fulfilled,w.rejected):o.push(w.fulfilled,w.rejected)});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let m,f=0,p;if(!c){const v=[hu.bind(this),void 0];for(v.unshift(...o),v.push(...d),p=v.length,m=Promise.resolve(n);f<p;)m=m.then(v[f++],v[f++]);return m}p=o.length;let N=n;for(;f<p;){const v=o[f++],w=o[f++];try{N=v(N)}catch(k){w.call(this,k);break}}try{m=hu.call(this,N)}catch(v){return Promise.reject(v)}for(f=0,p=d.length;f<p;)m=m.then(d[f++],d[f++]);return m}getUri(t){t=cs(this.defaults,t);const n=T0(t.baseURL,t.url,t.allowAbsoluteUrls);return _0(n,t.params,t.paramsSerializer)}};T.forEach(["delete","get","head","options"],function(t){ns.prototype[t]=function(n,r){return this.request(cs(r||{},{method:t,url:n,data:(r||{}).data}))}});T.forEach(["post","put","patch"],function(t){function n(r){return function(l,i,o){return this.request(cs(o||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:i}))}}ns.prototype[t]=n(),ns.prototype[t+"Form"]=n(!0)});let Nv=class O0{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(l){n=l});const r=this;this.promise.then(a=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](a);r._listeners=null}),this.promise.then=a=>{let l;const i=new Promise(o=>{r.subscribe(o),l=o}).then(a);return i.cancel=function(){r.unsubscribe(l)},i},t(function(l,i,o){r.reason||(r.reason=new ea(l,i,o),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new O0(function(a){t=a}),cancel:t}}};function Sv(e){return function(n){return e.apply(null,n)}}function _v(e){return T.isObject(e)&&e.isAxiosError===!0}const No={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(No).forEach(([e,t])=>{No[t]=e});function I0(e){const t=new ns(e),n=x0(ns.prototype.request,t);return T.extend(n,ns.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return I0(cs(e,a))},n}const Me=I0(Zr);Me.Axios=ns;Me.CanceledError=ea;Me.CancelToken=Nv;Me.isCancel=E0;Me.VERSION=$0;Me.toFormData=Al;Me.AxiosError=ue;Me.Cancel=Me.CanceledError;Me.all=function(t){return Promise.all(t)};Me.spread=Sv;Me.isAxiosError=_v;Me.mergeConfig=cs;Me.AxiosHeaders=ft;Me.formToJSON=e=>C0(T.isHTMLForm(e)?new FormData(e):e);Me.getAdapter=A0.getAdapter;Me.HttpStatusCode=No;Me.default=Me;const{Axios:Hw,AxiosError:Ww,CanceledError:qw,isCancel:Kw,CancelToken:Qw,VERSION:Jw,all:Gw,Cancel:Xw,isAxiosError:Yw,spread:Zw,toFormData:ej,AxiosHeaders:tj,HttpStatusCode:nj,formToJSON:sj,getAdapter:rj,mergeConfig:aj}=Me,W=Me.create({baseURL:"/api/v1",headers:{"Content-Type":"application/json"}}),At={list:async(e=1,t=10,n)=>{const r=new URLSearchParams({page:String(e),per_page:String(t)});return n&&r.append("status",n),(await W.get(`/scans?${r}`)).data},get:async e=>(await W.get(`/scans/${e}`)).data,create:async e=>(await W.post("/scans",e)).data,start:async e=>(await W.post(`/scans/${e}/start`)).data,stop:async e=>(await W.post(`/scans/${e}/stop`)).data,pause:async e=>(await W.post(`/scans/${e}/pause`)).data,resume:async e=>(await W.post(`/scans/${e}/resume`)).data,delete:async e=>(await W.delete(`/scans/${e}`)).data,skipToPhase:async(e,t)=>(await W.post(`/scans/${e}/skip-to/${t}`)).data,getEndpoints:async(e,t=1,n=50)=>(await W.get(`/scans/${e}/endpoints?page=${t}&per_page=${n}`)).data,getVulnerabilities:async(e,t,n=1,r=50)=>{const a=new URLSearchParams({page:String(n),per_page:String(r)});return t&&a.append("severity",t),(await W.get(`/scans/${e}/vulnerabilities?${a}`)).data}},yu={validate:async e=>(await W.post("/targets/validate",{url:e})).data,validateBulk:async e=>(await W.post("/targets/validate/bulk",{urls:e})).data,upload:async e=>{const t=new FormData;return t.append("file",e),(await W.post("/targets/upload",t,{headers:{"Content-Type":"multipart/form-data"}})).data}},We={list:async e=>{const t=new URLSearchParams;e!=null&&e.scanId&&t.append("scan_id",e.scanId),(e==null?void 0:e.autoGenerated)!==void 0&&t.append("auto_generated",String(e.autoGenerated));const n=t.toString();return(await W.get(`/reports${n?`?${n}`:""}`)).data},get:async e=>(await W.get(`/reports/${e}`)).data,generate:async e=>(await W.post("/reports",e)).data,generateAiReport:async e=>(await W.post("/reports/ai-generate",e)).data,getViewUrl:e=>`/api/v1/reports/${e}/view`,getDownloadUrl:(e,t)=>`/api/v1/reports/${e}/download/${t}`,getDownloadZipUrl:e=>`/api/v1/reports/${e}/download-zip`,delete:async e=>(await W.delete(`/reports/${e}`)).data},pi={getStats:async()=>(await W.get("/dashboard/stats")).data,getRecent:async(e=10)=>(await W.get(`/dashboard/recent?limit=${e}`)).data,getFindings:async(e=20,t)=>{const n=new URLSearchParams({limit:String(e)});return t&&n.append("severity",t),(await W.get(`/dashboard/findings?${n}`)).data},getVulnerabilityTypes:async()=>(await W.get("/dashboard/vulnerability-types")).data,getAgentTasks:async(e=20)=>(await W.get(`/dashboard/agent-tasks?limit=${e}`)).data,getActivityFeed:async(e=30)=>(await W.get(`/dashboard/activity-feed?limit=${e}`)).data},mi={getTypes:async()=>(await W.get("/vulnerabilities/types")).data,get:async e=>(await W.get(`/vulnerabilities/${e}`)).data,validate:async(e,t,n)=>(await W.patch(`/scans/vulnerabilities/${e}/validate`,{validation_status:t,notes:n})).data},vu={list:async(e,t,n)=>{const r=new URLSearchParams;return r.append("scan_id",e),t&&r.append("status",t),n&&r.append("task_type",n),(await W.get(`/agent-tasks?${r}`)).data},get:async e=>(await W.get(`/agent-tasks/${e}`)).data,getSummary:async e=>(await W.get(`/agent-tasks/summary?scan_id=${e}`)).data,getTimeline:async e=>(await W.get(`/agent-tasks/scan/${e}/timeline`)).data},we={run:async e=>(await W.post("/agent/run",e)).data,getStatus:async e=>(await W.get(`/agent/status/${e}`)).data,getByScan:async e=>{try{return(await W.get(`/agent/by-scan/${e}`)).data}catch{return null}},getLogs:async(e,t=100)=>(await W.get(`/agent/logs/${e}?limit=${t}`)).data,getFindings:async e=>(await W.get(`/agent/findings/${e}`)).data,delete:async e=>(await W.delete(`/agent/${e}`)).data,stop:async e=>(await W.post(`/agent/stop/${e}`)).data,pause:async e=>(await W.post(`/agent/pause/${e}`)).data,resume:async e=>(await W.post(`/agent/resume/${e}`)).data,skipToPhase:async(e,t)=>(await W.post(`/agent/skip-to/${e}/${t}`)).data,sendPrompt:async(e,t)=>(await W.post(`/agent/prompt/${e}`,{prompt:t})).data,autoPentest:async(e,t)=>(await W.post("/agent/run",{target:e,mode:"auto_pentest",subdomain_discovery:(t==null?void 0:t.subdomain_discovery)||!1,targets:t==null?void 0:t.targets,auth_type:t==null?void 0:t.auth_type,auth_value:t==null?void 0:t.auth_value,prompt:t==null?void 0:t.prompt})).data,quickRun:async(e,t="full_auto")=>(await W.post(`/agent/quick?target=${encodeURIComponent(e)}&mode=${t}`)).data,tasks:{list:async e=>{const t=e?`?category=${e}`:"";return(await W.get(`/agent/tasks${t}`)).data},get:async e=>(await W.get(`/agent/tasks/${e}`)).data,create:async e=>(await W.post("/agent/tasks",e)).data,delete:async e=>(await W.delete(`/agent/tasks/${e}`)).data},realtime:{createSession:async(e,t)=>(await W.post("/agent/realtime/session",{target:e,name:t})).data,sendMessage:async(e,t)=>(await W.post(`/agent/realtime/${e}/message`,{message:t})).data,getSession:async e=>(await W.get(`/agent/realtime/${e}`)).data,getReport:async e=>(await W.get(`/agent/realtime/${e}/report`)).data,deleteSession:async e=>(await W.delete(`/agent/realtime/${e}`)).data,listSessions:async()=>(await W.get("/agent/realtime/sessions/list")).data,getLlmStatus:async()=>(await W.get("/agent/realtime/llm-status")).data,getReportHtml:async e=>(await W.get(`/agent/realtime/${e}/report?format=html`,{responseType:"text"})).data,getToolsList:async()=>(await W.get("/agent/realtime/tools/list")).data,getToolsStatus:async()=>(await W.get("/agent/realtime/tools/status")).data,executeTool:async(e,t,n,r)=>(await W.post(`/agent/realtime/${e}/execute-tool`,{tool:t,options:n,timeout:r||300})).data}},hn={getTypes:async()=>(await W.get("/vuln-lab/types")).data,run:async e=>(await W.post("/vuln-lab/run",e)).data,listChallenges:async e=>{const t=new URLSearchParams;e!=null&&e.vuln_type&&t.append("vuln_type",e.vuln_type),e!=null&&e.vuln_category&&t.append("vuln_category",e.vuln_category),e!=null&&e.status&&t.append("status",e.status),e!=null&&e.result&&t.append("result",e.result),e!=null&&e.limit&&t.append("limit",String(e.limit));const n=t.toString();return(await W.get(`/vuln-lab/challenges${n?`?${n}`:""}`)).data},getChallenge:async e=>(await W.get(`/vuln-lab/challenges/${e}`)).data,getStats:async()=>(await W.get("/vuln-lab/stats")).data,stopChallenge:async e=>(await W.post(`/vuln-lab/challenges/${e}/stop`)).data,deleteChallenge:async e=>(await W.delete(`/vuln-lab/challenges/${e}`)).data,getLogs:async(e,t=100)=>(await W.get(`/vuln-lab/logs/${e}?limit=${t}`)).data},fs={list:async()=>(await W.get("/scheduler/")).data,create:async e=>(await W.post("/scheduler/",e)).data,delete:async e=>(await W.delete(`/scheduler/${e}`)).data,pause:async e=>(await W.post(`/scheduler/${e}/pause`)).data,resume:async e=>(await W.post(`/scheduler/${e}/resume`)).data,getAgentRoles:async()=>(await W.get("/scheduler/agent-roles")).data},Zt={createSession:async(e,t,n)=>(await W.post("/terminal/session",{target:e,name:t,template_id:n})).data,listSessions:async()=>(await W.get("/terminal/sessions")).data,getSession:async e=>(await W.get(`/terminal/sessions/${e}`)).data,deleteSession:async e=>(await W.delete(`/terminal/sessions/${e}`)).data,sendMessage:async(e,t)=>(await W.post(`/terminal/sessions/${e}/message`,{message:t})).data,executeCommand:async(e,t,n)=>(await W.post(`/terminal/sessions/${e}/execute`,{command:t,execution_method:n})).data,addExploitationStep:async(e,t)=>(await W.post(`/terminal/sessions/${e}/exploitation-path`,t)).data,getExploitationPath:async e=>(await W.get(`/terminal/sessions/${e}/exploitation-path`)).data,getVpnStatus:async e=>(await W.get(`/terminal/sessions/${e}/vpn-status`)).data,listTemplates:async()=>(await W.get("/terminal/templates")).data},sr={list:async()=>(await W.get("/sandbox/")).data,healthCheck:async e=>(await W.get(`/sandbox/${e}`)).data,destroy:async e=>(await W.delete(`/sandbox/${e}`)).data,cleanup:async()=>(await W.post("/sandbox/cleanup")).data,cleanupOrphans:async()=>(await W.post("/sandbox/cleanup-orphans")).data},Cv={},wu=e=>{let t;const n=new Set,r=(m,f)=>{const p=typeof m=="function"?m(t):m;if(!Object.is(p,t)){const N=t;t=f??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(v=>v(t,N))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>d,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(Cv?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,a,c);return c},Ev=e=>e?wu(e):wu;var M0={exports:{}},D0={},z0={exports:{}},F0={};/**
|
||
* @license React
|
||
* use-sync-external-store-shim.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Us=x;function Rv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tv=typeof Object.is=="function"?Object.is:Rv,Pv=Us.useState,Lv=Us.useEffect,Av=Us.useLayoutEffect,$v=Us.useDebugValue;function Ov(e,t){var n=t(),r=Pv({inst:{value:n,getSnapshot:t}}),a=r[0].inst,l=r[1];return Av(function(){a.value=n,a.getSnapshot=t,fi(a)&&l({inst:a})},[e,n,t]),Lv(function(){return fi(a)&&l({inst:a}),e(function(){fi(a)&&l({inst:a})})},[e]),$v(n),n}function fi(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tv(e,n)}catch{return!0}}function Iv(e,t){return t()}var Mv=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Iv:Ov;F0.useSyncExternalStore=Us.useSyncExternalStore!==void 0?Us.useSyncExternalStore:Mv;z0.exports=F0;var Dv=z0.exports;/**
|
||
* @license React
|
||
* use-sync-external-store-shim/with-selector.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Ol=x,zv=Dv;function Fv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Uv=typeof Object.is=="function"?Object.is:Fv,Bv=zv.useSyncExternalStore,Vv=Ol.useRef,Hv=Ol.useEffect,Wv=Ol.useMemo,qv=Ol.useDebugValue;D0.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var l=Vv(null);if(l.current===null){var i={hasValue:!1,value:null};l.current=i}else i=l.current;l=Wv(function(){function c(N){if(!d){if(d=!0,m=N,N=r(N),a!==void 0&&i.hasValue){var v=i.value;if(a(v,N))return f=v}return f=N}if(v=f,Uv(m,N))return v;var w=r(N);return a!==void 0&&a(v,w)?(m=N,v):(m=N,f=w)}var d=!1,m,f,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,r,a]);var o=Bv(e,l[0],l[1]);return Hv(function(){i.hasValue=!0,i.value=o},[o]),qv(o),o};M0.exports=D0;var Kv=M0.exports;const Qv=Iu(Kv),U0={},{useDebugValue:Jv}=Ro,{useSyncExternalStoreWithSelector:Gv}=Qv;let ju=!1;const Xv=e=>e;function Yv(e,t=Xv,n){(U0?"production":void 0)!=="production"&&n&&!ju&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),ju=!0);const r=Gv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Jv(r),r}const ku=e=>{(U0?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Ev(e):e,n=(r,a)=>Yv(t,r,a);return Object.assign(n,t),n},B0=e=>e?ku(e):ku,Zv={};function ew(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var l;const i=c=>c===null?null:JSON.parse(c,void 0),o=(l=n.getItem(a))!=null?l:null;return o instanceof Promise?o.then(i):i(o)},setItem:(a,l)=>n.setItem(a,JSON.stringify(l,void 0)),removeItem:a=>n.removeItem(a)}}const Fr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Fr(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Fr(r)(n)}}}},tw=(e,t)=>(n,r,a)=>{let l={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:k=>k,version:0,merge:(k,y)=>({...y,...k}),...t},i=!1;const o=new Set,c=new Set;let d;try{d=l.getStorage()}catch{}if(!d)return e((...k)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...k)},r,a);const m=Fr(l.serialize),f=()=>{const k=l.partialize({...r()});let y;const u=m({state:k,version:l.version}).then(g=>d.setItem(l.name,g)).catch(g=>{y=g});if(y)throw y;return u},p=a.setState;a.setState=(k,y)=>{p(k,y),f()};const N=e((...k)=>{n(...k),f()},r,a);let v;const w=()=>{var k;if(!d)return;i=!1,o.forEach(u=>u(r()));const y=((k=l.onRehydrateStorage)==null?void 0:k.call(l,r()))||void 0;return Fr(d.getItem.bind(d))(l.name).then(u=>{if(u)return l.deserialize(u)}).then(u=>{if(u)if(typeof u.version=="number"&&u.version!==l.version){if(l.migrate)return l.migrate(u.state,u.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return u.state}).then(u=>{var g;return v=l.merge(u,(g=r())!=null?g:N),n(v,!0),f()}).then(()=>{y==null||y(v,void 0),i=!0,c.forEach(u=>u(v))}).catch(u=>{y==null||y(void 0,u)})};return a.persist={setOptions:k=>{l={...l,...k},k.getStorage&&(d=k.getStorage())},clearStorage:()=>{d==null||d.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>w(),hasHydrated:()=>i,onHydrate:k=>(o.add(k),()=>{o.delete(k)}),onFinishHydration:k=>(c.add(k),()=>{c.delete(k)})},w(),v||N},nw=(e,t)=>(n,r,a)=>{let l={storage:ew(()=>localStorage),partialize:w=>w,version:0,merge:(w,k)=>({...k,...w}),...t},i=!1;const o=new Set,c=new Set;let d=l.storage;if(!d)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...w)},r,a);const m=()=>{const w=l.partialize({...r()});return d.setItem(l.name,{state:w,version:l.version})},f=a.setState;a.setState=(w,k)=>{f(w,k),m()};const p=e((...w)=>{n(...w),m()},r,a);a.getInitialState=()=>p;let N;const v=()=>{var w,k;if(!d)return;i=!1,o.forEach(u=>{var g;return u((g=r())!=null?g:p)});const y=((k=l.onRehydrateStorage)==null?void 0:k.call(l,(w=r())!=null?w:p))||void 0;return Fr(d.getItem.bind(d))(l.name).then(u=>{if(u)if(typeof u.version=="number"&&u.version!==l.version){if(l.migrate)return[!0,l.migrate(u.state,u.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,u.state];return[!1,void 0]}).then(u=>{var g;const[_,L]=u;if(N=l.merge(L,(g=r())!=null?g:p),n(N,!0),_)return m()}).then(()=>{y==null||y(N,void 0),N=r(),i=!0,c.forEach(u=>u(N))}).catch(u=>{y==null||y(void 0,u)})};return a.persist={setOptions:w=>{l={...l,...w},w.storage&&(d=w.storage)},clearStorage:()=>{d==null||d.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>v(),hasHydrated:()=>i,onHydrate:w=>(o.add(w),()=>{o.delete(w)}),onFinishHydration:w=>(c.add(w),()=>{c.delete(w)})},l.skipHydration||v(),N||p},sw=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((Zv?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),tw(e,t)):nw(e,t),rw=sw,aw=B0()(rw((e,t)=>({currentScan:null,scans:[],endpoints:[],vulnerabilities:[],logs:[],agentTasks:[],scanDataCache:{},isLoading:!1,error:null,setCurrentScan:n=>e({currentScan:n}),setScans:n=>e({scans:n}),updateScan:(n,r)=>e(a=>{var l;return{currentScan:((l=a.currentScan)==null?void 0:l.id)===n?{...a.currentScan,...r}:a.currentScan,scans:a.scans.map(i=>i.id===n?{...i,...r}:i)}}),addEndpoint:n=>e(r=>r.endpoints.some(l=>l.id===n.id||l.url===n.url&&l.method===n.method)?r:{endpoints:[...r.endpoints,n]}),addVulnerability:n=>e(r=>r.vulnerabilities.some(l=>l.id===n.id)?r:{vulnerabilities:[...r.vulnerabilities,n]}),setEndpoints:n=>e({endpoints:n}),setVulnerabilities:n=>e({vulnerabilities:n}),addLog:(n,r)=>e(a=>({logs:[...a.logs,{level:n,message:r,time:new Date().toISOString()}].slice(-200)})),setLogs:n=>e({logs:n}),addAgentTask:n=>e(r=>r.agentTasks.some(l=>l.id===n.id)?{agentTasks:r.agentTasks.map(l=>l.id===n.id?n:l)}:{agentTasks:[...r.agentTasks,n]}),updateAgentTask:(n,r)=>e(a=>({agentTasks:a.agentTasks.map(l=>l.id===n?{...l,...r}:l)})),setAgentTasks:n=>e({agentTasks:n}),setLoading:n=>e({isLoading:n}),setError:n=>e({error:n}),loadScanData:n=>{const a=t().scanDataCache[n];a&&e({endpoints:a.endpoints,vulnerabilities:a.vulnerabilities,logs:a.logs,agentTasks:a.agentTasks||[]})},saveScanData:n=>{const r=t();e({scanDataCache:{...r.scanDataCache,[n]:{endpoints:r.endpoints,vulnerabilities:r.vulnerabilities,logs:r.logs,agentTasks:r.agentTasks}}})},reset:()=>e({currentScan:null,scans:[],endpoints:[],vulnerabilities:[],logs:[],agentTasks:[],scanDataCache:{},isLoading:!1,error:null}),resetCurrentScan:()=>e({endpoints:[],vulnerabilities:[],logs:[],agentTasks:[]}),getVulnCounts:()=>{const n=t().vulnerabilities;return{critical:n.filter(r=>r.severity==="critical").length,high:n.filter(r=>r.severity==="high").length,medium:n.filter(r=>r.severity==="medium").length,low:n.filter(r=>r.severity==="low").length,info:n.filter(r=>r.severity==="info").length}}}),{name:"neurosploit-scan-store",partialize:e=>({scanDataCache:e.scanDataCache,scans:e.scans})})),lw=B0(e=>({stats:null,recentScans:[],recentVulnerabilities:[],isLoading:!1,setStats:t=>e({stats:t}),setRecentScans:t=>e({recentScans:t}),setRecentVulnerabilities:t=>e({recentVulnerabilities:t}),setLoading:t=>e({isLoading:t})}));function iw(){const{stats:e,recentScans:t,recentVulnerabilities:n,setStats:r,setRecentScans:a,setRecentVulnerabilities:l,setLoading:i}=lw(),[o,c]=x.useState([]),d=x.useCallback(async()=>{try{const[p,N,v]=await Promise.all([pi.getStats(),pi.getRecent(5),pi.getActivityFeed(15)]);r(p),a(N.recent_scans),l(N.recent_vulnerabilities),c(v.activities)}catch(p){console.error("Failed to fetch dashboard data:",p)}},[r,a,l]);x.useEffect(()=>{i(!0),d().finally(()=>i(!1));const p=setInterval(d,3e4);return()=>clearInterval(p)},[d,i]);const m=[{label:"Total Scans",value:(e==null?void 0:e.scans.total)||0,icon:l0,color:"text-blue-400",bgColor:"bg-blue-500/10"},{label:"Running",value:(e==null?void 0:e.scans.running)||0,icon:Ke,color:"text-green-400",bgColor:"bg-green-500/10"},{label:"Completed",value:(e==null?void 0:e.scans.completed)||0,icon:Wt,color:"text-emerald-400",bgColor:"bg-emerald-500/10"},{label:"Stopped",value:(e==null?void 0:e.scans.stopped)||0,icon:es,color:"text-yellow-400",bgColor:"bg-yellow-500/10"}],f=[{label:"Total Vulns",value:(e==null?void 0:e.vulnerabilities.total)||0,icon:Oe,color:"text-red-400",bgColor:"bg-red-500/10"},{label:"Critical",value:(e==null?void 0:e.vulnerabilities.critical)||0,icon:Oe,color:"text-red-500",bgColor:"bg-red-600/10"},{label:"High",value:(e==null?void 0:e.vulnerabilities.high)||0,icon:Oe,color:"text-orange-400",bgColor:"bg-orange-500/10"},{label:"Medium",value:(e==null?void 0:e.vulnerabilities.medium)||0,icon:Oe,color:"text-yellow-400",bgColor:"bg-yellow-500/10"}];return s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-white",children:"Welcome to NeuroSploit"}),s.jsx("p",{className:"text-dark-400 mt-1",children:"AI-Powered Penetration Testing Platform"})]}),s.jsx(nn,{to:"/scan/new",children:s.jsxs(H,{size:"lg",children:[s.jsx(Gt,{className:"w-5 h-5 mr-2"}),"New Scan"]})})]}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:m.map(p=>s.jsx(re,{className:"hover:border-dark-700 transition-colors",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:`p-3 rounded-lg ${p.bgColor}`,children:s.jsx(p.icon,{className:`w-6 h-6 ${p.color}`})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:p.value}),s.jsx("p",{className:"text-sm text-dark-400",children:p.label})]})]})},p.label))}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:f.map(p=>s.jsx(re,{className:"hover:border-dark-700 transition-colors",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:`p-3 rounded-lg ${p.bgColor}`,children:s.jsx(p.icon,{className:`w-6 h-6 ${p.color}`})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:p.value}),s.jsx("p",{className:"text-sm text-dark-400",children:p.label})]})]})},p.label))}),e&&e.vulnerabilities.total>0&&s.jsxs(re,{title:"Vulnerability Distribution",children:[s.jsxs("div",{className:"flex h-8 rounded-lg overflow-hidden",children:[e.vulnerabilities.critical>0&&s.jsx("div",{className:"bg-red-500 flex items-center justify-center text-white text-xs font-medium",style:{width:`${e.vulnerabilities.critical/e.vulnerabilities.total*100}%`},children:e.vulnerabilities.critical}),e.vulnerabilities.high>0&&s.jsx("div",{className:"bg-orange-500 flex items-center justify-center text-white text-xs font-medium",style:{width:`${e.vulnerabilities.high/e.vulnerabilities.total*100}%`},children:e.vulnerabilities.high}),e.vulnerabilities.medium>0&&s.jsx("div",{className:"bg-yellow-500 flex items-center justify-center text-white text-xs font-medium",style:{width:`${e.vulnerabilities.medium/e.vulnerabilities.total*100}%`},children:e.vulnerabilities.medium}),e.vulnerabilities.low>0&&s.jsx("div",{className:"bg-blue-500 flex items-center justify-center text-white text-xs font-medium",style:{width:`${e.vulnerabilities.low/e.vulnerabilities.total*100}%`},children:e.vulnerabilities.low})]}),s.jsxs("div",{className:"flex gap-4 mt-3 text-xs",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"w-3 h-3 rounded bg-red-500"})," Critical"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"w-3 h-3 rounded bg-orange-500"})," High"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"w-3 h-3 rounded bg-yellow-500"})," Medium"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"w-3 h-3 rounded bg-blue-500"})," Low"]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsx(re,{title:"Recent Scans",action:s.jsxs(nn,{to:"/reports",className:"text-sm text-primary-500 hover:text-primary-400 flex items-center gap-1",children:["View All ",s.jsx(Gd,{className:"w-4 h-4"})]}),children:s.jsx("div",{className:"space-y-3",children:t.length===0?s.jsx("p",{className:"text-dark-400 text-center py-4",children:"No scans yet. Start your first scan!"}):t.map(p=>s.jsxs(nn,{to:`/scan/${p.id}`,className:"flex items-center justify-between p-3 bg-dark-900/50 rounded-lg hover:bg-dark-900 transition-colors",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-white",children:p.name||"Unnamed Scan"}),s.jsx("p",{className:"text-xs text-dark-400",children:new Date(p.created_at).toLocaleDateString()})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ts,{severity:p.status}),s.jsxs("span",{className:"text-sm text-dark-400",children:[p.total_vulnerabilities," vulns"]})]})]},p.id))})}),s.jsx(re,{title:"Recent Findings",action:s.jsxs(nn,{to:"/reports",className:"text-sm text-primary-500 hover:text-primary-400 flex items-center gap-1",children:["View All ",s.jsx(Gd,{className:"w-4 h-4"})]}),children:s.jsx("div",{className:"space-y-3",children:n.length===0?s.jsx("p",{className:"text-dark-400 text-center py-4",children:"No vulnerabilities found yet."}):n.slice(0,5).map(p=>s.jsxs("div",{className:`flex items-center justify-between p-3 bg-dark-900/50 rounded-lg ${p.validation_status==="ai_rejected"?"opacity-60 border-l-2 border-orange-500/40":p.validation_status==="false_positive"?"opacity-40":""}`,children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-white truncate",children:p.title}),s.jsx("p",{className:"text-xs text-dark-400 truncate",children:p.affected_endpoint})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[p.validation_status==="ai_rejected"&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-orange-500/20 text-orange-400",children:"Rejected"}),p.validation_status==="validated"&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-green-500/20 text-green-400",children:"Validated"}),p.validation_status==="false_positive"&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-dark-600 text-dark-400",children:"FP"}),s.jsx(ts,{severity:p.severity})]})]},p.id))})})]}),s.jsx(re,{title:"Activity Feed",subtitle:"Recent activities across all scans",children:s.jsx("div",{className:"space-y-2 max-h-[400px] overflow-auto",children:o.length===0?s.jsx("p",{className:"text-dark-400 text-center py-4",children:"No recent activity."}):o.map((p,N)=>s.jsxs(nn,{to:p.link,className:"flex items-start gap-3 p-3 bg-dark-900/50 rounded-lg hover:bg-dark-900 transition-colors",children:[s.jsx("div",{className:`mt-0.5 p-2 rounded-lg ${p.type==="scan"?"bg-blue-500/20 text-blue-400":p.type==="vulnerability"?"bg-red-500/20 text-red-400":p.type==="agent_task"?"bg-purple-500/20 text-purple-400":"bg-green-500/20 text-green-400"}`,children:p.type==="scan"?s.jsx(Ke,{className:"w-4 h-4"}):p.type==="vulnerability"?s.jsx(Oe,{className:"w-4 h-4"}):p.type==="agent_task"?s.jsx(il,{className:"w-4 h-4"}):s.jsx(yt,{className:"w-4 h-4"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-dark-500 uppercase font-medium",children:p.type.replace("_"," ")}),s.jsx("span",{className:"text-xs text-dark-600",children:"•"}),s.jsx("span",{className:"text-xs text-dark-500",children:p.action})]}),s.jsx("p",{className:"font-medium text-white truncate mt-0.5",children:p.title}),p.description&&s.jsx("p",{className:"text-xs text-dark-400 truncate",children:p.description})]}),s.jsxs("div",{className:"flex flex-col items-end gap-1",children:[p.severity&&s.jsx(ts,{severity:p.severity}),p.status&&!p.severity&&s.jsx("span",{className:`text-xs px-2 py-0.5 rounded font-medium ${p.status==="completed"?"bg-green-500/20 text-green-400":p.status==="running"?"bg-blue-500/20 text-blue-400":p.status==="failed"?"bg-red-500/20 text-red-400":p.status==="stopped"?"bg-yellow-500/20 text-yellow-400":"bg-dark-700 text-dark-300"}`,children:p.status}),s.jsxs("span",{className:"text-xs text-dark-500 flex items-center gap-1",children:[s.jsx(Xt,{className:"w-3 h-3"}),new Date(p.timestamp).toLocaleTimeString()]})]})]},`${p.type}-${p.timestamp}-${N}`))})})]})}const st=x.forwardRef(({label:e,error:t,helperText:n,className:r,...a},l)=>s.jsxs("div",{className:"w-full",children:[e&&s.jsx("label",{className:"block text-sm font-medium text-dark-200 mb-1.5",children:e}),s.jsx("input",{ref:l,className:Jr("w-full px-4 py-2.5 bg-dark-900 border rounded-lg text-white placeholder-dark-500","focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent","transition-colors",t?"border-red-500":"border-dark-700",r),...a}),t&&s.jsx("p",{className:"mt-1 text-sm text-red-400",children:t}),n&&!t&&s.jsx("p",{className:"mt-1 text-sm text-dark-400",children:n})]}));st.displayName="Input";const Ur=x.forwardRef(({label:e,error:t,helperText:n,className:r,...a},l)=>s.jsxs("div",{className:"w-full",children:[e&&s.jsx("label",{className:"block text-sm font-medium text-dark-200 mb-1.5",children:e}),s.jsx("textarea",{ref:l,className:Jr("w-full px-4 py-2.5 bg-dark-900 border rounded-lg text-white placeholder-dark-500","focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent","transition-colors resize-none",t?"border-red-500":"border-dark-700",r),...a}),t&&s.jsx("p",{className:"mt-1 text-sm text-red-400",children:t}),n&&!t&&s.jsx("p",{className:"mt-1 text-sm text-dark-400",children:n})]}));Ur.displayName="Textarea";const bu=[{id:"full_auto",name:"Full Auto",icon:s.jsx(In,{className:"w-5 h-5"}),description:"Complete workflow: Recon -> Analyze -> Test -> Report",color:"primary"},{id:"recon_only",name:"Recon Only",icon:s.jsx(Qr,{className:"w-5 h-5"}),description:"Reconnaissance and enumeration only, no vulnerability testing",color:"blue"},{id:"prompt_only",name:"AI Prompt Mode",icon:s.jsx(Mt,{className:"w-5 h-5"}),description:"AI decides everything based on your prompt - full autonomy",warning:"HIGH TOKEN USAGE - The AI will use more API calls to decide what to do",color:"purple"},{id:"analyze_only",name:"Analyze Only",icon:s.jsx(Kt,{className:"w-5 h-5"}),description:"Analyze provided data without active testing",color:"green"}],ow=[{id:"all",name:"All Tasks"},{id:"full_auto",name:"Full Auto"},{id:"recon",name:"Reconnaissance"},{id:"vulnerability",name:"Vulnerability"},{id:"custom",name:"Custom"},{id:"reporting",name:"Reporting"}];function cw(){const e=Bn(),t=x.useRef(null),[n,r]=x.useState("single"),[a,l]=x.useState(""),[i,o]=x.useState(""),[c,d]=x.useState([]),[m,f]=x.useState(""),[p,N]=x.useState("full_auto"),[v,w]=x.useState([]),[k,y]=x.useState(null),[u,g]=x.useState("all"),[_,L]=x.useState(!1),[D,R]=x.useState(!1),[E,U]=x.useState(!1),[q,A]=x.useState(""),[te,Q]=x.useState(!1),[ne,ae]=x.useState("none"),[ce,xe]=x.useState(""),[z,Y]=x.useState(5),[se,V]=x.useState(!1);x.useEffect(()=>{G()},[]);const G=async M=>{R(!0);try{const me=await we.tasks.list(M==="all"?void 0:M);w(me)}catch(me){console.error("Failed to load tasks:",me)}finally{R(!1)}},ge=M=>{g(M),G(M)},he=async M=>{var de;const me=(de=M.target.files)==null?void 0:de[0];if(me)try{const h=(await yu.upload(me)).filter(b=>b.valid).map(b=>b.normalized_url);d(h),f("")}catch{f("Failed to parse file")}},ke=()=>{var M;switch(n){case"single":return a.trim();case"multiple":return((M=i.split(/[,\n]/)[0])==null?void 0:M.trim())||"";case"file":return c[0]||"";default:return""}},P=async()=>{var me;const M=ke();if(!M){f("Please enter a target URL");return}V(!0);try{const de=await yu.validateBulk([M]);if(!((me=de[0])!=null&&me.valid)){f("Invalid URL format"),V(!1);return}const S={target:de[0].normalized_url,mode:p,max_depth:z};k&&!E?S.task_id=k.id:E&&q.trim()&&(S.prompt=q),ne!=="none"&&ce.trim()&&(S.auth_type=ne,S.auth_value=ce);const h=await we.run(S);e(`/agent/${h.agent_id}`)}catch(de){console.error("Failed to start agent:",de),f("Failed to start agent. Please try again.")}finally{V(!1)}},X=bu.find(M=>M.id===p);return s.jsxs("div",{className:"max-w-5xl mx-auto space-y-6 animate-fadeIn",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"text-3xl font-bold text-white flex items-center gap-3",children:[s.jsx(In,{className:"w-8 h-8 text-primary-500"}),"AI Security Agent"]}),s.jsx("p",{className:"text-dark-400 mt-1",children:"Autonomous penetration testing powered by AI"})]})}),s.jsx(re,{title:"Operation Mode",subtitle:"Select how the AI agent should operate",children:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:bu.map(M=>s.jsxs("div",{onClick:()=>N(M.id),className:`p-4 rounded-xl border-2 cursor-pointer transition-all ${p===M.id?`border-${M.color}-500 bg-${M.color}-500/10`:"border-dark-700 hover:border-dark-500 bg-dark-900/50"}`,children:[s.jsxs("div",{className:`flex items-center gap-2 mb-2 ${p===M.id?`text-${M.color}-400`:"text-dark-300"}`,children:[M.icon,s.jsx("span",{className:"font-semibold",children:M.name})]}),s.jsx("p",{className:"text-sm text-dark-400",children:M.description}),M.warning&&p===M.id&&s.jsxs("div",{className:"mt-2 flex items-start gap-2 text-yellow-400 text-xs",children:[s.jsx(Oe,{className:"w-4 h-4 flex-shrink-0"}),s.jsx("span",{children:M.warning})]})]},M.id))})}),s.jsx(re,{title:"Target",subtitle:"Enter the URL to test",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(H,{variant:n==="single"?"primary":"secondary",onClick:()=>r("single"),children:[s.jsx(Og,{className:"w-4 h-4 mr-2"}),"Single URL"]}),s.jsxs(H,{variant:n==="multiple"?"primary":"secondary",onClick:()=>r("multiple"),children:[s.jsx(yt,{className:"w-4 h-4 mr-2"}),"Multiple URLs"]}),s.jsxs(H,{variant:n==="file"?"primary":"secondary",onClick:()=>r("file"),children:[s.jsx(tu,{className:"w-4 h-4 mr-2"}),"Upload File"]})]}),n==="single"&&s.jsx(st,{placeholder:"https://example.com",value:a,onChange:M=>{l(M.target.value),f("")},error:m}),n==="multiple"&&s.jsxs("div",{children:[s.jsx(Ur,{placeholder:`Enter URLs separated by commas or new lines:
|
||
https://example1.com
|
||
https://example2.com`,rows:5,value:i,onChange:M=>{o(M.target.value),f("")}}),s.jsx("p",{className:"text-xs text-dark-500 mt-1",children:"Note: Agent will test the first URL. Multiple URL support coming soon."}),m&&s.jsx("p",{className:"mt-1 text-sm text-red-400",children:m})]}),n==="file"&&s.jsxs("div",{children:[s.jsx("input",{type:"file",ref:t,onChange:he,accept:".txt,.csv,.lst",className:"hidden"}),s.jsxs("div",{onClick:()=>{var M;return(M=t.current)==null?void 0:M.click()},className:"border-2 border-dashed border-dark-700 rounded-lg p-8 text-center cursor-pointer hover:border-primary-500 transition-colors",children:[s.jsx(tu,{className:"w-10 h-10 mx-auto text-dark-400 mb-3"}),s.jsx("p",{className:"text-dark-300",children:"Click to upload a file with URLs"}),s.jsx("p",{className:"text-sm text-dark-500 mt-1",children:"Supports .txt, .csv, .lst files"})]}),c.length>0&&s.jsxs("p",{className:"mt-2 text-sm text-green-400",children:[c.length," valid URLs loaded - using first URL"]}),m&&s.jsx("p",{className:"mt-2 text-sm text-red-400",children:m})]})]})}),s.jsxs(re,{title:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Nc,{className:"w-5 h-5 text-primary-500"}),s.jsx("span",{children:"Task Library"})]}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>L(!_),children:s.jsx(pt,{className:`w-4 h-4 transition-transform ${_?"rotate-180":""}`})})]}),subtitle:"Select a preset task or create a custom prompt",children:[s.jsx("div",{className:"flex items-center justify-between mb-4 pb-4 border-b border-dark-700",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"checkbox",id:"customPrompt",checked:E,onChange:M=>U(M.target.checked),className:"w-4 h-4 rounded border-dark-600 bg-dark-800 text-primary-500 focus:ring-primary-500"}),s.jsx("label",{htmlFor:"customPrompt",className:"text-white",children:"Use custom prompt instead of task"})]})}),E?s.jsx(Ur,{placeholder:`Enter your custom prompt for the AI agent...
|
||
|
||
Example: Test for SQL injection on all form inputs, check for authentication bypass on the login endpoint, and look for IDOR vulnerabilities in user profile APIs.`,rows:6,value:q,onChange:M=>A(M.target.value)}):s.jsxs(s.Fragment,{children:[_&&s.jsx(s.Fragment,{children:s.jsx("div",{className:"flex gap-2 mb-4 flex-wrap",children:ow.map(M=>s.jsx(H,{variant:u===M.id?"primary":"secondary",size:"sm",onClick:()=>ge(M.id),children:M.name},M.id))})}),s.jsx("div",{className:`grid grid-cols-1 md:grid-cols-2 gap-3 ${_?"max-h-80 overflow-auto":""}`,children:D?s.jsx("p",{className:"text-dark-400 col-span-2 text-center py-4",children:"Loading tasks..."}):(_?v:v.slice(0,4)).map(M=>{var me;return s.jsxs("div",{onClick:()=>y(M),className:`p-4 rounded-lg border cursor-pointer transition-all ${(k==null?void 0:k.id)===M.id?"border-primary-500 bg-primary-500/10":"border-dark-700 hover:border-dark-500 bg-dark-900/50"}`,children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("span",{className:"font-medium text-white",children:M.name}),M.is_preset&&s.jsx("span",{className:"text-xs bg-primary-500/20 text-primary-400 px-2 py-0.5 rounded",children:"Preset"})]}),s.jsx("p",{className:"text-sm text-dark-400 line-clamp-2",children:M.description}),s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[s.jsx("span",{className:"text-xs text-dark-500",children:M.category}),M.estimated_tokens>0&&s.jsxs("span",{className:"text-xs text-dark-500",children:["~",M.estimated_tokens," tokens"]})]}),((me=M.tags)==null?void 0:me.length)>0&&s.jsx("div",{className:"flex gap-1 mt-2 flex-wrap",children:M.tags.slice(0,3).map(de=>s.jsx("span",{className:"text-xs bg-dark-700 text-dark-300 px-2 py-0.5 rounded",children:de},de))})]},M.id)})}),!_&&v.length>4&&s.jsxs(H,{variant:"ghost",className:"w-full mt-3",onClick:()=>L(!0),children:["Show all ",v.length," tasks"]})]}),k&&!E&&s.jsxs("div",{className:"mt-4 p-4 bg-dark-800 rounded-lg border border-dark-700",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("span",{className:"font-medium text-white",children:["Selected: ",k.name]}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>y(null),children:"Clear"})]}),s.jsx("p",{className:"text-sm text-dark-400 whitespace-pre-wrap line-clamp-4",children:k.prompt})]})]}),s.jsx(re,{title:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ag,{className:"w-5 h-5 text-primary-500"}),s.jsx("span",{children:"Authentication"}),s.jsx("span",{className:"text-xs text-dark-500",children:"(Optional)"})]}),children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex gap-2 flex-wrap",children:[{id:"none",label:"None"},{id:"cookie",label:"Cookie"},{id:"bearer",label:"Bearer Token"},{id:"basic",label:"Basic Auth"},{id:"header",label:"Custom Header"}].map(M=>s.jsx(H,{variant:ne===M.id?"primary":"secondary",size:"sm",onClick:()=>ae(M.id),children:M.label},M.id))}),ne!=="none"&&s.jsx(st,{placeholder:ne==="cookie"?"session=abc123; token=xyz789":ne==="bearer"?"eyJhbGciOiJIUzI1NiIs...":ne==="basic"?"username:password":"X-API-Key: your-api-key",value:ce,onChange:M=>xe(M.target.value),label:ne==="cookie"?"Cookie String":ne==="bearer"?"Bearer Token":ne==="basic"?"Username:Password":"Header:Value"})]})}),s.jsxs(re,{title:s.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>Q(!te),children:[s.jsx(p0,{className:"w-5 h-5 text-primary-500"}),s.jsx("span",{children:"Advanced Options"}),s.jsx(pt,{className:`w-4 h-4 transition-transform ${te?"rotate-180":""}`})]}),children:[te&&s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-dark-300 mb-1 block",children:"Max Crawl Depth"}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("input",{type:"range",min:"1",max:"10",value:z,onChange:M=>Y(parseInt(M.target.value)),className:"flex-1"}),s.jsx("span",{className:"text-white font-medium w-8",children:z})]})]})}),!te&&s.jsx("p",{className:"text-dark-500 text-sm",children:"Click to expand advanced options"})]}),p==="prompt_only"&&s.jsxs("div",{className:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-4 flex items-start gap-3",children:[s.jsx(Oe,{className:"w-6 h-6 text-yellow-500 flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-yellow-400",children:"High Token Usage Warning"}),s.jsx("p",{className:"text-sm text-yellow-300/80 mt-1",children:"In AI Prompt Mode, the agent has full autonomy to decide what tools to use and what tests to run. This results in significantly higher API token consumption. Consider using Full Auto mode for most use cases."})]})]}),s.jsxs("div",{className:"flex justify-end gap-3 sticky bottom-4 bg-dark-950/90 backdrop-blur p-4 -mx-4 rounded-lg",children:[s.jsx(H,{variant:"secondary",onClick:()=>e("/"),children:"Cancel"}),s.jsxs(H,{onClick:P,isLoading:se,size:"lg",children:[s.jsx(Yt,{className:"w-5 h-5 mr-2"}),"Deploy Agent (",X.name,")"]})]})]})}class dw{constructor(){Hn(this,"ws",null);Hn(this,"handlers",new Map);Hn(this,"reconnectAttempts",0);Hn(this,"maxReconnectAttempts",5);Hn(this,"reconnectDelay",1e3);Hn(this,"scanId",null)}connect(t){var a;if(((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.scanId===t)return;this.disconnect(),this.scanId=t;const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/scan/${t}`;try{this.ws=new WebSocket(r),this.ws.onopen=()=>{console.log("WebSocket connected"),this.reconnectAttempts=0},this.ws.onmessage=l=>{try{const i=JSON.parse(l.data);this.notifyHandlers(i.type,i),this.notifyHandlers("*",i)}catch(i){console.error("Failed to parse WebSocket message:",i)}},this.ws.onclose=()=>{console.log("WebSocket disconnected"),this.attemptReconnect()},this.ws.onerror=l=>{console.error("WebSocket error:",l)}}catch(l){console.error("Failed to create WebSocket:",l)}}disconnect(){this.ws&&(this.ws.close(),this.ws=null),this.scanId=null}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts||!this.scanId)return;this.reconnectAttempts++;const t=this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1);setTimeout(()=>{this.scanId&&(console.log(`Attempting reconnect (${this.reconnectAttempts}/${this.maxReconnectAttempts})...`),this.connect(this.scanId))},t)}subscribe(t,n){return this.handlers.has(t)||this.handlers.set(t,new Set),this.handlers.get(t).add(n),()=>{var r;(r=this.handlers.get(t))==null||r.delete(n)}}notifyHandlers(t,n){const r=this.handlers.get(t);r&&r.forEach(a=>{try{a(n)}catch(l){console.error("Handler error:",l)}})}send(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(typeof t=="string"?t:JSON.stringify(t))}ping(){this.send("ping")}}const xi=new dw;function Nu(e){let t=null;if(typeof e.confidence_score=="number")t=e.confidence_score;else if(e.confidence){const a=Number(e.confidence);isNaN(a)?t={high:90,medium:60,low:30}[e.confidence.toLowerCase()]??null:t=a}if(t===null)return null;const n=t>=90?"green":t>=60?"yellow":"red",r=t>=90?"Confirmed":t>=60?"Likely":"Low";return{score:t,color:n,label:r}}const Su={green:"bg-green-500/15 text-green-400 border-green-500/30",yellow:"bg-yellow-500/15 text-yellow-400 border-yellow-500/30",red:"bg-red-500/15 text-red-400 border-red-500/30"};function uw(){const{scanId:e}=bc(),t=Bn(),{currentScan:n,endpoints:r,vulnerabilities:a,logs:l,agentTasks:i,setCurrentScan:o,setEndpoints:c,setVulnerabilities:d,addEndpoint:m,addVulnerability:f,addLog:p,updateScan:N,addAgentTask:v,updateAgentTask:w,setAgentTasks:k,loadScanData:y,saveScanData:u,getVulnCounts:g}=aw(),[_,L]=x.useState(!1),[D,R]=x.useState(new Set),[E,U]=x.useState("vulns"),[q,A]=x.useState(!0),[te,Q]=x.useState(null),[ne,ae]=x.useState(null),[ce,xe]=x.useState(null),[z,Y]=x.useState(null),[se,V]=x.useState(new Set),[G,ge]=x.useState("all"),he=x.useMemo(()=>g(),[a]);x.useEffect(()=>{if(!e)return;y(e),(async()=>{var O,J,C,j,K,F;A(!0),Q(null);try{const ie=await At.get(e);o(ie);const[pe,Te,ve,kt]=await Promise.all([At.getEndpoints(e),At.getVulnerabilities(e),vu.list(e).catch(()=>({tasks:[]})),We.list({scanId:e,autoGenerated:!0}).catch(()=>({reports:[]}))]);if(((O=pe.endpoints)==null?void 0:O.length)>0&&c(pe.endpoints),((J=Te.vulnerabilities)==null?void 0:J.length)>0&&d(Te.vulnerabilities),((C=ve.tasks)==null?void 0:C.length)>0&&k(ve.tasks),((j=kt.reports)==null?void 0:j.length)>0&&ae(kt.reports[0]),!Te.vulnerabilities||Te.vulnerabilities.length===0){const Se=await we.getByScan(e);if(Se){if(xe(Se),Se.findings&&Se.findings.length>0){const ye=le=>({id:le.id,scan_id:e,title:le.title,vulnerability_type:le.vulnerability_type,severity:le.severity,cvss_score:le.cvss_score||null,cvss_vector:le.cvss_vector||null,cwe_id:le.cwe_id||null,description:le.description||null,affected_endpoint:le.affected_endpoint||null,poc_request:le.request||null,poc_response:le.response||null,poc_payload:le.payload||null,poc_parameter:le.parameter||null,poc_evidence:le.evidence||null,poc_code:le.poc_code||null,impact:le.impact||null,remediation:le.remediation||null,references:le.references||[],ai_analysis:le.evidence||null,validation_status:le.ai_status==="rejected"?"ai_rejected":"ai_confirmed",ai_rejection_reason:le.rejection_reason||null,confidence_score:le.confidence_score,confidence_breakdown:le.confidence_breakdown,proof_of_execution:le.proof_of_execution,negative_controls:le.negative_controls,created_at:new Date().toISOString()}),Vn=Se.findings.map(ye),$=(Se.rejected_findings||[]).map(ye),oe=[...Vn,...$];d(oe)}Se.progress!==void 0&&N(e,{progress:Se.progress,current_phase:Se.phase})}}}catch(ie){console.error("Failed to fetch scan:",ie),Q(((F=(K=ie==null?void 0:ie.response)==null?void 0:K.data)==null?void 0:F.detail)||"Failed to load scan")}finally{A(!1)}})();const b=setInterval(async()=>{var O,J,C;if((n==null?void 0:n.status)==="running"||(n==null?void 0:n.status)==="paused"||!n)try{const j=await At.get(e);o(j);const[K,F,ie]=await Promise.all([At.getEndpoints(e),At.getVulnerabilities(e),vu.list(e).catch(()=>({tasks:[]}))]);if(((O=K.endpoints)==null?void 0:O.length)>0&&c(K.endpoints),((J=F.vulnerabilities)==null?void 0:J.length)>0&&d(F.vulnerabilities),((C=ie.tasks)==null?void 0:C.length)>0&&k(ie.tasks),!F.vulnerabilities||F.vulnerabilities.length===0){const pe=await we.getByScan(e);if(pe){if(xe(pe),pe.findings&&pe.findings.length>0){const Te=ye=>({id:ye.id,scan_id:e,title:ye.title,vulnerability_type:ye.vulnerability_type,severity:ye.severity,cvss_score:ye.cvss_score||null,cvss_vector:ye.cvss_vector||null,cwe_id:ye.cwe_id||null,description:ye.description||null,affected_endpoint:ye.affected_endpoint||null,poc_request:ye.request||null,poc_response:ye.response||null,poc_payload:ye.payload||null,poc_parameter:ye.parameter||null,poc_evidence:ye.evidence||null,poc_code:ye.poc_code||null,impact:ye.impact||null,remediation:ye.remediation||null,references:ye.references||[],ai_analysis:ye.evidence||null,validation_status:ye.ai_status==="rejected"?"ai_rejected":"ai_confirmed",ai_rejection_reason:ye.rejection_reason||null,confidence_score:ye.confidence_score,confidence_breakdown:ye.confidence_breakdown,proof_of_execution:ye.proof_of_execution,negative_controls:ye.negative_controls,created_at:new Date().toISOString()}),ve=pe.findings.map(Te),kt=(pe.rejected_findings||[]).map(Te),Se=[...ve,...kt];d(Se)}pe.progress!==void 0&&N(e,{progress:pe.progress,current_phase:pe.phase})}}}catch(j){console.error("Poll error:",j)}},8e3);xi.connect(e);const I=xi.subscribe("*",O=>{switch(O.type){case"progress_update":N(e,{progress:O.progress,current_phase:O.message});break;case"phase_change":{const J=O.phase;N(e,{current_phase:J}),p("info",`Phase: ${J}`),J.endsWith("_skipped")&&V(C=>new Set([...C,J.replace("_skipped","")]));break}case"endpoint_found":m(O.endpoint);break;case"vuln_found":f(O.vulnerability),p("warning",`Found: ${O.vulnerability.title}`);break;case"stats_update":if(O.stats){const J=O.stats;N(e,{total_vulnerabilities:J.total_vulnerabilities,critical_count:J.critical,high_count:J.high,medium_count:J.medium,low_count:J.low,info_count:J.info,total_endpoints:J.total_endpoints})}break;case"log_message":p(O.level,O.message);break;case"scan_completed":N(e,{status:"completed",progress:100}),p("info","Scan completed"),u(e);break;case"scan_stopped":if(O.summary){const J=O.summary;N(e,{status:"stopped",progress:J.progress||(n==null?void 0:n.progress),total_vulnerabilities:J.total_vulnerabilities,critical_count:J.critical,high_count:J.high,medium_count:J.medium,low_count:J.low,info_count:J.info,total_endpoints:J.total_endpoints,duration:J.duration})}else N(e,{status:"stopped"});p("warning","Scan stopped by user"),u(e);break;case"scan_failed":N(e,{status:"failed"}),p("error",`Scan failed: ${O.error||"Unknown error"}`),u(e);break;case"agent_task":case"agent_task_started":O.task&&v(O.task);break;case"agent_task_completed":if(O.task){const J=O.task;w(J.id,J)}break;case"report_generated":if(O.report){const J=O.report;ae(J),p("info",`Report generated: ${J.title}`)}break;case"error":p("error",O.error);break}});return()=>{u(e),I(),xi.disconnect(),clearInterval(b)}},[e]);const ke=async()=>{if(e)try{await At.stop(e),N(e,{status:"stopped"}),u(e)}catch(h){console.error("Failed to stop scan:",h)}},P=async()=>{if(e)try{await At.pause(e),N(e,{status:"paused"})}catch(h){console.error("Failed to pause scan:",h)}},X=async()=>{if(e)try{await At.resume(e),N(e,{status:"running"})}catch(h){console.error("Failed to resume scan:",h)}},M=async h=>{if(e)try{await At.skipToPhase(e,h),Y(null)}catch(b){console.error("Failed to skip phase:",b)}},me=async()=>{if(e){L(!0);try{const h=await We.generate({scan_id:e,format:"html",include_poc:!0,include_remediation:!0});window.open(We.getViewUrl(h.id),"_blank")}catch(h){console.error("Failed to generate report:",h)}finally{L(!1)}}},de=h=>{const b=new Set(D);b.has(h)?b.delete(h):b.add(h),R(b)},S=h=>{navigator.clipboard.writeText(h)};return q?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx(ln,{className:"w-8 h-8 animate-spin text-primary-500"})}):te?s.jsxs("div",{className:"flex flex-col items-center justify-center h-64",children:[s.jsx(Oe,{className:"w-12 h-12 text-red-500 mb-4"}),s.jsx("p",{className:"text-xl text-white mb-2",children:"Failed to load scan"}),s.jsx("p",{className:"text-dark-400 mb-4",children:te}),s.jsx(H,{onClick:()=>t("/"),children:"Go to Dashboard"})]}):n?s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[s.jsx(Ke,{className:"w-6 h-6 text-primary-500"}),n.name||"Unnamed Scan"]}),s.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[s.jsx(ts,{severity:n.status}),s.jsxs("span",{className:"text-dark-400",children:["Started ",new Date(n.created_at).toLocaleString()]})]})]}),s.jsxs("div",{className:"flex gap-2",children:[(ce==null?void 0:ce.agent_id)&&s.jsxs(H,{variant:"secondary",onClick:()=>t(`/agent/${ce.agent_id}`),children:[s.jsx(il,{className:"w-4 h-4 mr-2"}),"Agent View"]}),n.status==="running"&&s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"secondary",onClick:P,children:[s.jsx(cl,{className:"w-4 h-4 mr-2"}),"Pause"]}),s.jsxs(H,{variant:"danger",onClick:ke,children:[s.jsx(es,{className:"w-4 h-4 mr-2"}),"Stop"]})]}),n.status==="paused"&&s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"primary",onClick:X,children:[s.jsx(Yt,{className:"w-4 h-4 mr-2"}),"Resume"]}),s.jsxs(H,{variant:"danger",onClick:ke,children:[s.jsx(es,{className:"w-4 h-4 mr-2"}),"Stop"]})]}),ne&&s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"secondary",onClick:()=>window.open(We.getViewUrl(ne.id),"_blank"),children:[s.jsx(yt,{className:"w-4 h-4 mr-2"}),"View Report"]}),s.jsxs(H,{variant:"secondary",onClick:()=>window.open(We.getDownloadZipUrl(ne.id),"_blank"),children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"Download ZIP"]})]}),(n.status==="completed"||n.status==="stopped")&&s.jsxs(H,{onClick:me,isLoading:_,children:[s.jsx(yt,{className:"w-4 h-4 mr-2"}),ne?"New Report":"Generate Report"]})]})]}),(n.status==="running"||n.status==="paused"||n.status==="completed"||n.status==="stopped")&&(()=>{const h=[{id:"initializing",label:"Init",fullLabel:"Initialization"},{id:"recon",label:"Recon",fullLabel:"Reconnaissance"},{id:"analyzing",label:"Analysis",fullLabel:"AI Analysis"},{id:"testing",label:"Testing",fullLabel:"Vulnerability Testing"},{id:"completed",label:"Done",fullLabel:"Completed"}],b=h.map(j=>j.id),I=n.current_phase||"initializing",O=I.startsWith("skipping_to_")?I.replace("skipping_to_",""):I.replace("_skipped",""),J=b.indexOf(O),C=n.status==="running"||n.status==="paused";return s.jsx(re,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center justify-between relative",children:h.map((j,K)=>{const F=K<J||n.status==="completed",ie=K===J&&C,pe=se.has(j.id),ve=K>J&&C&&j.id!=="initializing";return s.jsxs("div",{className:"flex items-center flex-1 last:flex-none",children:[s.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[ve?z===j.id?s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>M(j.id),className:"w-9 h-9 rounded-full bg-brand-500 text-white flex items-center justify-center hover:bg-brand-400 transition-colors",title:`Skip to ${j.fullLabel}`,children:s.jsx(Yd,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>Y(null),className:"w-7 h-7 rounded-full bg-dark-600 text-dark-300 flex items-center justify-center hover:bg-dark-500 transition-colors",children:s.jsx(Ct,{className:"w-3.5 h-3.5"})})]}):s.jsxs("button",{onClick:()=>Y(j.id),className:"w-9 h-9 rounded-full border-2 border-dark-500 bg-dark-800 text-dark-400 flex items-center justify-center hover:border-brand-400 hover:text-brand-400 hover:bg-brand-500/10 transition-all group",title:`Skip to ${j.fullLabel}`,children:[s.jsx(m0,{className:"w-4 h-4 opacity-0 group-hover:opacity-100 transition-opacity"}),s.jsx("span",{className:"absolute text-[10px] group-hover:hidden",children:K+1})]}):F?s.jsx("div",{className:`w-9 h-9 rounded-full flex items-center justify-center ${pe?"bg-yellow-500/20 border-2 border-yellow-500/50":"bg-green-500/20 border-2 border-green-500/50"}`,children:pe?s.jsx(Mg,{className:"w-4 h-4 text-yellow-400"}):s.jsx(Yd,{className:"w-4 h-4 text-green-400"})}):ie?s.jsx("div",{className:"w-9 h-9 rounded-full bg-brand-500/20 border-2 border-brand-500 flex items-center justify-center animate-pulse",children:s.jsx("div",{className:"w-3 h-3 rounded-full bg-brand-400"})}):s.jsx("div",{className:"w-9 h-9 rounded-full border-2 border-dark-600 bg-dark-800 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-dark-500",children:K+1})}),s.jsx("span",{className:`text-xs mt-2 font-medium ${ie?"text-brand-400":F?pe?"text-yellow-400":"text-green-400":"text-dark-500"}`,children:pe?`${j.label} (skipped)`:j.label}),ve&&z===j.id&&s.jsx("span",{className:"text-[10px] text-brand-400 mt-0.5",children:"Skip here?"})]}),K<h.length-1&&s.jsx("div",{className:`flex-1 h-0.5 mx-2 mt-[-20px] ${K<J?"bg-green-500/50":"bg-dark-600"}`})]},j.id)})}),s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsx("span",{className:"text-dark-300",children:I.startsWith("skipping_to_")?`Skipping to ${I.replace("skipping_to_","")}...`:n.current_phase||"Initializing..."}),s.jsxs("span",{className:"text-white font-medium",children:[n.progress,"%"]})]}),s.jsx("div",{className:"h-1.5 bg-dark-900 rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-brand-500 rounded-full transition-all duration-300",style:{width:`${n.progress}%`}})})]})})})(),ne&&s.jsxs("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"bg-green-500/20 rounded-full p-2",children:s.jsx(yt,{className:"w-5 h-5 text-green-400"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-white font-medium",children:ne.is_partial?"Partial Report Generated":"Report Generated"}),s.jsx("p",{className:"text-sm text-dark-400",children:ne.title||"Scan report is ready to view"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(H,{size:"sm",onClick:()=>window.open(We.getViewUrl(ne.id),"_blank"),children:[s.jsx(An,{className:"w-4 h-4 mr-2"}),"View Report"]}),s.jsx(H,{size:"sm",variant:"ghost",onClick:()=>ae(null),children:"Dismiss"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-4",children:[s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:r.length}),s.jsx("p",{className:"text-sm text-dark-400",children:"Endpoints"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:a.length}),s.jsx("p",{className:"text-sm text-dark-400",children:"Total Vulns"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-red-500",children:he.critical}),s.jsx("p",{className:"text-sm text-dark-400",children:"Critical"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-orange-500",children:he.high}),s.jsx("p",{className:"text-sm text-dark-400",children:"High"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-yellow-500",children:he.medium}),s.jsx("p",{className:"text-sm text-dark-400",children:"Medium"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-blue-500",children:he.low}),s.jsx("p",{className:"text-sm text-dark-400",children:"Low"})]})})]}),s.jsxs("div",{className:"flex gap-2 border-b border-dark-700 pb-2",children:[s.jsxs(H,{variant:E==="vulns"?"primary":"ghost",onClick:()=>U("vulns"),children:[s.jsx(Oe,{className:"w-4 h-4 mr-2"}),"Vulnerabilities (",a.length,")"]}),s.jsxs(H,{variant:E==="endpoints"?"primary":"ghost",onClick:()=>U("endpoints"),children:[s.jsx(pn,{className:"w-4 h-4 mr-2"}),"Endpoints (",r.length,")"]}),s.jsxs(H,{variant:E==="tasks"?"primary":"ghost",onClick:()=>U("tasks"),children:[s.jsx(il,{className:"w-4 h-4 mr-2"}),"Agent Tasks (",i.length,")"]})]}),E==="vulns"&&s.jsxs("div",{className:"space-y-3",children:[a.length>0&&s.jsx("div",{className:"flex gap-2 mb-2",children:["all","confirmed","rejected","validated"].map(h=>{const b=h==="all"?a.length:h==="confirmed"?a.filter(I=>!I.validation_status||I.validation_status==="ai_confirmed"||I.validation_status==="validated").length:h==="rejected"?a.filter(I=>I.validation_status==="ai_rejected"||I.validation_status==="false_positive").length:a.filter(I=>I.validation_status==="validated").length;return s.jsxs("button",{onClick:()=>ge(h),className:`px-3 py-1 text-xs rounded-full transition-colors ${G===h?"bg-primary-500/20 text-primary-400 border border-primary-500/30":"bg-dark-700 text-dark-400 border border-dark-600 hover:text-dark-300"}`,children:[h.charAt(0).toUpperCase()+h.slice(1)," (",b,")"]},h)})}),a.length===0?s.jsx(re,{children:s.jsx("p",{className:"text-dark-400 text-center py-8",children:n.status==="running"?"Scanning for vulnerabilities...":"No vulnerabilities found"})}):a.filter(h=>G==="all"?!0:G==="confirmed"?!h.validation_status||h.validation_status==="ai_confirmed"||h.validation_status==="validated":G==="rejected"?h.validation_status==="ai_rejected"||h.validation_status==="false_positive":G==="validated"?h.validation_status==="validated":!0).map((h,b)=>{var I;return s.jsxs("div",{className:`bg-dark-800 rounded-lg border overflow-hidden ${h.validation_status==="ai_rejected"?"border-orange-500/40 opacity-70":h.validation_status==="false_positive"?"border-dark-600 opacity-50":h.validation_status==="validated"?"border-green-500/40":"border-dark-700"}`,children:[s.jsx("div",{className:"p-4 cursor-pointer hover:bg-dark-750 transition-colors",onClick:()=>de(h.id||`vuln-${b}`),children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex items-start gap-2 flex-1",children:[D.has(h.id||`vuln-${b}`)?s.jsx(pt,{className:"w-4 h-4 mt-1 text-dark-400"}):s.jsx(zr,{className:"w-4 h-4 mt-1 text-dark-400"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-white",children:h.title}),s.jsx("p",{className:"text-sm text-dark-400 truncate mt-1",children:h.affected_endpoint})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[h.cvss_score&&s.jsxs("span",{className:`text-sm font-bold px-2 py-0.5 rounded ${h.cvss_score>=9?"bg-red-500/20 text-red-400":h.cvss_score>=7?"bg-orange-500/20 text-orange-400":h.cvss_score>=4?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:["CVSS ",h.cvss_score.toFixed(1)]}),s.jsx(ts,{severity:h.severity}),(()=>{const O=Nu(h);return O?s.jsxs("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full border ${Su[O.color]}`,children:[O.score,"/100"]}):null})(),h.validation_status==="ai_rejected"&&s.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-orange-500/20 text-orange-400 border border-orange-500/30 flex items-center gap-1",children:[s.jsx(Oe,{className:"w-3 h-3"})," AI Rejected"]}),h.validation_status==="validated"&&s.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-green-500/20 text-green-400 border border-green-500/30 flex items-center gap-1",children:[s.jsx(Wt,{className:"w-3 h-3"})," Validated"]}),h.validation_status==="false_positive"&&s.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-dark-600 text-dark-400 border border-dark-500 flex items-center gap-1",children:[s.jsx(Ct,{className:"w-3 h-3"})," False Positive"]}),(!h.validation_status||h.validation_status==="ai_confirmed")&&s.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-emerald-500/15 text-emerald-400 border border-emerald-500/30",children:"AI Confirmed"})]})]})}),D.has(h.id||`vuln-${b}`)&&s.jsxs("div",{className:"p-4 pt-0 space-y-4 border-t border-dark-700",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm",children:[h.vulnerability_type&&s.jsxs("span",{className:"text-dark-400",children:["Type: ",s.jsx("span",{className:"text-white",children:h.vulnerability_type})]}),h.cwe_id&&s.jsxs("a",{href:`https://cwe.mitre.org/data/definitions/${h.cwe_id.replace("CWE-","")}.html`,target:"_blank",rel:"noopener noreferrer",className:"text-primary-400 hover:underline flex items-center gap-1",children:[h.cwe_id,s.jsx(An,{className:"w-3 h-3"})]}),h.cvss_vector&&s.jsx("span",{className:"text-xs bg-dark-700 px-2 py-1 rounded font-mono text-dark-300",children:h.cvss_vector})]}),(()=>{const O=Nu(h);return O?s.jsxs("div",{className:`rounded-lg p-3 border ${Su[O.color]}`,children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Ke,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-semibold",children:"Validation Pipeline"}),s.jsxs("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${O.score>=90?"bg-green-500/20 text-green-400":O.score>=60?"bg-yellow-500/20 text-yellow-400":"bg-red-500/20 text-red-400"}`,children:[O.score,"/100 ",O.label]})]}),h.confidence_breakdown&&Object.keys(h.confidence_breakdown).length>0&&s.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs mt-1 mb-2",children:Object.entries(h.confidence_breakdown).map(([J,C])=>s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"opacity-70 capitalize",children:J.replace(/_/g," ")}),s.jsxs("span",{className:`font-mono font-medium ${Number(C)>0?"text-green-400":Number(C)<0?"text-red-400":"opacity-50"}`,children:[Number(C)>0?"+":"",C]})]},J))}),h.proof_of_execution&&s.jsxs("div",{className:"text-xs mt-1 flex items-start gap-1",children:[s.jsx(Wt,{className:"w-3 h-3 mt-0.5 flex-shrink-0 text-green-400"}),s.jsx("span",{className:"opacity-80",children:h.proof_of_execution})]}),h.negative_controls&&s.jsxs("div",{className:"text-xs mt-1 flex items-start gap-1",children:[s.jsx(Ke,{className:"w-3 h-3 mt-0.5 flex-shrink-0 text-blue-400"}),s.jsx("span",{className:"opacity-80",children:h.negative_controls})]})]}):null})(),h.description&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-1",children:"Description"}),s.jsx("p",{className:"text-sm text-dark-400",children:h.description})]}),h.impact&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-1",children:"Impact"}),s.jsx("p",{className:"text-sm text-dark-400",children:h.impact})]}),(h.poc_request||h.poc_payload)&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("p",{className:"text-sm font-medium text-dark-300",children:"Proof of Concept"}),s.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>S(h.poc_request||h.poc_payload||""),children:[s.jsx(cr,{className:"w-3 h-3 mr-1"}),"Copy"]})]}),h.poc_payload&&s.jsxs("div",{className:"mb-2",children:[s.jsx("p",{className:"text-xs text-dark-500 mb-1",children:"Payload:"}),s.jsx("pre",{className:"text-xs bg-dark-900 p-3 rounded overflow-x-auto text-yellow-400 font-mono",children:h.poc_payload})]}),h.poc_request&&s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-dark-500 mb-1",children:"Request:"}),s.jsx("pre",{className:"text-xs bg-dark-900 p-3 rounded overflow-x-auto text-dark-300 font-mono",children:h.poc_request})]}),h.poc_response&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"text-xs text-dark-500 mb-1",children:"Response:"}),s.jsx("pre",{className:"text-xs bg-dark-900 p-3 rounded overflow-x-auto text-dark-300 font-mono max-h-40",children:h.poc_response})]})]}),h.poc_code&&s.jsxs("div",{className:"mt-3",children:[s.jsx("p",{className:"text-xs font-medium text-dark-400 mb-1",children:"Exploitation Code"}),s.jsx("pre",{className:"p-3 bg-dark-950 rounded text-xs text-green-400 overflow-x-auto max-h-[400px] overflow-y-auto whitespace-pre-wrap",children:h.poc_code})]}),h.remediation&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-green-400 mb-1",children:"Remediation"}),s.jsx("p",{className:"text-sm text-dark-400",children:h.remediation})]}),h.ai_analysis&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-purple-400 mb-1",children:"AI Analysis"}),s.jsx("p",{className:"text-sm text-dark-400 whitespace-pre-wrap",children:h.ai_analysis})]}),h.validation_status==="ai_rejected"&&h.ai_rejection_reason&&s.jsxs("div",{className:"bg-orange-500/10 border border-orange-500/20 rounded-lg p-3",children:[s.jsxs("p",{className:"text-sm font-medium text-orange-400 mb-1 flex items-center gap-1",children:[s.jsx(Oe,{className:"w-4 h-4"})," AI Rejection Reason"]}),s.jsx("p",{className:"text-sm text-orange-300/80",children:h.ai_rejection_reason})]}),h.validation_status!=="validated"&&h.validation_status!=="false_positive"&&s.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-dark-700",children:[s.jsx("span",{className:"text-xs text-dark-500 mr-2",children:"Manual Review:"}),s.jsxs(H,{variant:"ghost",size:"sm",className:"text-green-400 hover:bg-green-500/10 border border-green-500/30",onClick:async O=>{O.stopPropagation();try{await mi.validate(h.id,"validated");const J=a.map(C=>C.id===h.id?{...C,validation_status:"validated"}:C);d(J)}catch(J){console.error("Validate error:",J)}},children:[s.jsx(Wt,{className:"w-3 h-3 mr-1"}),"Validate"]}),s.jsxs(H,{variant:"ghost",size:"sm",className:"text-dark-400 hover:bg-red-500/10 border border-dark-600",onClick:async O=>{O.stopPropagation();try{await mi.validate(h.id,"false_positive");const J=a.map(C=>C.id===h.id?{...C,validation_status:"false_positive"}:C);d(J)}catch(J){console.error("Mark FP error:",J)}},children:[s.jsx(Ct,{className:"w-3 h-3 mr-1"}),"False Positive"]}),h.validation_status==="ai_rejected"&&s.jsx("span",{className:"text-xs text-orange-400/60 ml-2",children:"AI rejected this finding - review the evidence above"})]}),(h.validation_status==="validated"||h.validation_status==="false_positive")&&s.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-dark-700",children:[s.jsx("span",{className:"text-xs text-dark-500",children:h.validation_status==="validated"?"Manually validated by pentester":"Marked as false positive"}),s.jsx(H,{variant:"ghost",size:"sm",className:"text-dark-500 hover:text-dark-300 text-xs",onClick:async O=>{O.stopPropagation();try{const J=h.ai_rejection_reason?"ai_rejected":"ai_confirmed";await mi.validate(h.id,J);const C=a.map(j=>j.id===h.id?{...j,validation_status:J}:j);d(C)}catch(J){console.error("Revert error:",J)}},children:"Undo"})]}),((I=h.references)==null?void 0:I.length)>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-1",children:"References"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:h.references.map((O,J)=>s.jsxs("a",{href:O,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary-400 hover:underline flex items-center gap-1",children:[(()=>{try{return new URL(O).hostname}catch{return O}})(),s.jsx(An,{className:"w-3 h-3"})]},J))})]})]})]},h.id||`vuln-${b}`)})]}),E==="endpoints"&&s.jsx(re,{title:"Discovered Endpoints",subtitle:`${r.length} endpoints found`,children:s.jsx("div",{className:"space-y-2 max-h-[500px] overflow-auto",children:r.length===0?s.jsx("p",{className:"text-dark-400 text-center py-8",children:"No endpoints discovered yet"}):r.map((h,b)=>{var I;return s.jsxs("div",{className:"flex items-center gap-3 p-3 bg-dark-900/50 rounded-lg hover:bg-dark-900 transition-colors",children:[s.jsx(pn,{className:"w-4 h-4 text-dark-400 flex-shrink-0"}),s.jsx("span",{className:`text-xs px-2 py-0.5 rounded font-medium ${h.method==="GET"?"bg-green-500/20 text-green-400":h.method==="POST"?"bg-blue-500/20 text-blue-400":h.method==="PUT"?"bg-yellow-500/20 text-yellow-400":h.method==="DELETE"?"bg-red-500/20 text-red-400":"bg-dark-700 text-dark-300"}`,children:h.method}),s.jsx("span",{className:"text-sm text-dark-200 truncate flex-1 font-mono",children:h.path||h.url}),((I=h.parameters)==null?void 0:I.length)>0&&s.jsxs("span",{className:"text-xs text-dark-500",children:[h.parameters.length," params"]}),h.content_type&&s.jsx("span",{className:"text-xs text-dark-500",children:h.content_type}),h.response_status&&s.jsx("span",{className:`text-xs font-medium ${h.response_status<300?"text-green-400":h.response_status<400?"text-yellow-400":"text-red-400"}`,children:h.response_status})]},h.id||`endpoint-${b}`)})})}),E==="tasks"&&s.jsx(re,{title:"Agent Tasks",subtitle:`${i.length} tasks executed`,children:s.jsx("div",{className:"space-y-3 max-h-[500px] overflow-auto",children:i.length===0?s.jsx("p",{className:"text-dark-400 text-center py-8",children:n.status==="running"?"Agent tasks will appear here...":"No agent tasks recorded"}):i.map((h,b)=>s.jsxs("div",{className:"p-4 bg-dark-900/50 rounded-lg border border-dark-700",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[s.jsx("div",{className:`mt-0.5 ${h.status==="completed"?"text-green-400":h.status==="running"?"text-blue-400":h.status==="failed"?"text-red-400":"text-dark-400"}`,children:h.status==="completed"?s.jsx(Wt,{className:"w-5 h-5"}):h.status==="running"?s.jsx(ln,{className:"w-5 h-5 animate-spin"}):h.status==="failed"?s.jsx(Ct,{className:"w-5 h-5"}):s.jsx(Xt,{className:"w-5 h-5"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-white",children:h.task_name}),h.description&&s.jsx("p",{className:"text-sm text-dark-400 mt-1",children:h.description}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3 mt-2 text-xs",children:[h.tool_name&&s.jsx("span",{className:"bg-dark-700 px-2 py-1 rounded text-dark-300",children:h.tool_name}),s.jsx("span",{className:`px-2 py-1 rounded ${h.task_type==="recon"?"bg-blue-500/20 text-blue-400":h.task_type==="analysis"?"bg-purple-500/20 text-purple-400":h.task_type==="testing"?"bg-orange-500/20 text-orange-400":"bg-green-500/20 text-green-400"}`,children:h.task_type}),h.duration_ms!==null&&s.jsx("span",{className:"text-dark-500",children:h.duration_ms<1e3?`${h.duration_ms}ms`:`${(h.duration_ms/1e3).toFixed(1)}s`})]})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("span",{className:`text-xs px-2 py-1 rounded font-medium ${h.status==="completed"?"bg-green-500/20 text-green-400":h.status==="running"?"bg-blue-500/20 text-blue-400":h.status==="failed"?"bg-red-500/20 text-red-400":"bg-dark-700 text-dark-300"}`,children:h.status}),(h.items_processed>0||h.items_found>0)&&s.jsxs("p",{className:"text-xs text-dark-500 mt-2",children:[h.items_processed>0&&`${h.items_processed} processed`,h.items_processed>0&&h.items_found>0&&" / ",h.items_found>0&&`${h.items_found} found`]})]})]}),h.result_summary&&s.jsx("p",{className:"text-xs text-dark-400 mt-3 border-t border-dark-700 pt-3",children:h.result_summary}),h.error_message&&s.jsxs("p",{className:"text-xs text-red-400 mt-3 border-t border-dark-700 pt-3",children:["Error: ",h.error_message]})]},h.id||`task-${b}`))})}),s.jsx(re,{title:"Activity Log",children:s.jsx("div",{className:"space-y-1 max-h-60 overflow-auto font-mono text-xs",children:l.length===0?s.jsx("p",{className:"text-dark-400 text-center py-4",children:"Waiting for activity..."}):l.map((h,b)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-dark-500",children:new Date(h.time).toLocaleTimeString()}),s.jsx("span",{className:`${h.level==="error"?"text-red-400":h.level==="warning"?"text-yellow-400":h.level==="success"?"text-green-400":"text-dark-300"}`,children:h.message})]},b))})})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center h-64",children:[s.jsx(Oe,{className:"w-12 h-12 text-yellow-500 mb-4"}),s.jsx("p",{className:"text-xl text-white mb-2",children:"Scan not found"}),s.jsx("p",{className:"text-dark-400 mb-4",children:"The scan may still be initializing or does not exist."}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(H,{onClick:()=>window.location.reload(),children:"Refresh"}),s.jsx(H,{variant:"secondary",onClick:()=>t("/"),children:"Go to Dashboard"})]})]})}const hi={initializing:s.jsx(Xt,{className:"w-4 h-4"}),reconnaissance:s.jsx(Kt,{className:"w-4 h-4"}),"reconnaissance complete":s.jsx(Kt,{className:"w-4 h-4"}),recon:s.jsx(Kt,{className:"w-4 h-4"}),"starting reconnaissance":s.jsx(Kt,{className:"w-4 h-4"}),scanning:s.jsx(Ke,{className:"w-4 h-4"}),analysis:s.jsx(In,{className:"w-4 h-4"}),"attack surface analyzed":s.jsx(In,{className:"w-4 h-4"}),testing:s.jsx(Ke,{className:"w-4 h-4"}),"vulnerability testing complete":s.jsx(Ke,{className:"w-4 h-4"}),enhancement:s.jsx(Mt,{className:"w-4 h-4"}),"findings enhanced":s.jsx(Mt,{className:"w-4 h-4"}),reporting:s.jsx(yt,{className:"w-4 h-4"}),"assessment complete":s.jsx(Wt,{className:"w-4 h-4"}),completed:s.jsx(Wt,{className:"w-4 h-4"}),stopped:s.jsx(es,{className:"w-4 h-4"}),error:s.jsx(Ct,{className:"w-4 h-4"})},gi=[{key:"recon",label:"Reconnaissance",progress:20},{key:"analysis",label:"Analysis",progress:30},{key:"testing",label:"Testing",progress:70},{key:"enhancement",label:"Enhancement",progress:90},{key:"completed",label:"Completed",progress:100}],yi=e=>{const t=e.toLowerCase();return t.includes("recon")||t.includes("initializing")?0:t.includes("analysis")||t.includes("attack surface")?1:t.includes("test")||t.includes("vuln")?2:t.includes("enhance")||t.includes("finding")?3:t.includes("complete")||t.includes("report")?4:0},vi={full_auto:"Full Auto",recon_only:"Recon Only",prompt_only:"AI Prompt Mode",analyze_only:"Analyze Only"};function pw(){const{agentId:e}=bc(),t=Bn(),n=x.useRef(null),r=x.useRef(null),[a,l]=x.useState(null),[i,o]=x.useState([]),[c,d]=x.useState(!0),[m,f]=x.useState(null),[p,N]=x.useState(new Set),[v,w]=x.useState(!1),[k,y]=x.useState(!1),[u,g]=x.useState(!0),[_,L]=x.useState(""),[D,R]=x.useState(!1),[E,U]=x.useState(null),[q,A]=x.useState(null),[te,Q]=x.useState(!1),[ne,ae]=x.useState(new Set),ce=i.filter(S=>S.source==="script"||!S.source&&!S.message.includes("[LLM]")&&!S.message.includes("[AI]")),xe=i.filter(S=>S.source==="llm"||S.message.includes("[LLM]")||S.message.includes("[AI]"));x.useEffect(()=>{if(!e)return;const S=async()=>{var b;try{const[I,O]=await Promise.all([we.getStatus(e),we.getLogs(e,500)]);l(I),o(O.logs),f(null)}catch(I){((b=I.response)==null?void 0:b.status)===404?f("Agent not found"):console.error("Failed to fetch agent status:",I)}finally{d(!1)}};S();const h=setInterval(()=>{((a==null?void 0:a.status)==="running"||(a==null?void 0:a.status)==="paused")&&S()},5e3);return()=>clearInterval(h)},[e,a==null?void 0:a.status]),x.useEffect(()=>{var S,h;u&&((S=n.current)==null||S.scrollIntoView({behavior:"smooth"}),(h=r.current)==null||h.scrollIntoView({behavior:"smooth"}))},[i,u]);const z=S=>{const h=new Set(p);h.has(S)?h.delete(S):h.add(S),N(h)},Y=()=>{if(!a)return null;const S={critical:a.findings.filter(h=>h.severity==="critical").length,high:a.findings.filter(h=>h.severity==="high").length,medium:a.findings.filter(h=>h.severity==="medium").length,low:a.findings.filter(h=>h.severity==="low").length,info:a.findings.filter(h=>h.severity==="info").length};return{report_info:{agent_id:e,target:a.target,mode:a.mode,status:a.status,started_at:a.started_at,completed_at:a.completed_at||new Date().toISOString(),total_findings:a.findings.length,severity_breakdown:S},findings:a.findings.map(h=>({id:h.id,title:h.title,severity:h.severity,type:h.vulnerability_type,cvss_score:h.cvss_score,cvss_vector:h.cvss_vector,cwe_id:h.cwe_id,affected_endpoint:h.affected_endpoint,parameter:h.parameter,payload:h.payload,evidence:h.evidence,request:h.request,response:h.response,description:h.description,impact:h.impact,poc_code:h.poc_code,remediation:h.remediation,references:h.references,ai_verified:h.ai_verified,confidence:h.confidence})),logs:i.slice(-100)}},se=async(S="json")=>{if(!(!e||!a)){w(!0);try{if(S==="html"){const h=V(),b=new Blob([h],{type:"text/html"}),I=URL.createObjectURL(b),O=document.createElement("a");O.href=I,O.download=`neurosploit-report-${e}-${new Date().toISOString().split("T")[0]}.html`,O.click(),URL.revokeObjectURL(I)}else{const h=a.report||Y(),b=new Blob([JSON.stringify(h,null,2)],{type:"application/json"}),I=URL.createObjectURL(b),O=document.createElement("a");O.href=I,O.download=`neurosploit-report-${e}-${new Date().toISOString().split("T")[0]}.json`,O.click(),URL.revokeObjectURL(I)}}finally{w(!1)}}},V=()=>{if(!a)return"";const S={critical:"#dc2626",high:"#ea580c",medium:"#ca8a04",low:"#2563eb",info:"#6b7280"},h={"sql injection":"A03:2021 - Injection",sqli:"A03:2021 - Injection",xss:"A03:2021 - Injection","cross-site scripting":"A03:2021 - Injection","command injection":"A03:2021 - Injection",ssrf:"A10:2021 - Server-Side Request Forgery",idor:"A01:2021 - Broken Access Control","broken access":"A01:2021 - Broken Access Control",auth:"A07:2021 - Identification and Authentication Failures",csrf:"A01:2021 - Broken Access Control",crypto:"A02:2021 - Cryptographic Failures",config:"A05:2021 - Security Misconfiguration",header:"A05:2021 - Security Misconfiguration",cors:"A05:2021 - Security Misconfiguration",clickjacking:"A05:2021 - Security Misconfiguration"},b=(F,ie)=>{const pe=(F+" "+ie).toLowerCase();for(const[Te,ve]of Object.entries(h))if(pe.includes(Te))return ve;return""},I={critical:a.findings.filter(F=>F.severity==="critical").length,high:a.findings.filter(F=>F.severity==="high").length,medium:a.findings.filter(F=>F.severity==="medium").length,low:a.findings.filter(F=>F.severity==="low").length,info:a.findings.filter(F=>F.severity==="info").length},O=Math.min(100,I.critical*25+I.high*15+I.medium*8+I.low*3),J=O>=75?"Critical":O>=50?"High":O>=25?"Medium":"Low",C=O>=75?"#dc2626":O>=50?"#ea580c":O>=25?"#ca8a04":"#22c55e",j=a.findings.map((F,ie)=>{const pe=b(F.title,F.vulnerability_type),Te=F.cwe_id?`https://cwe.mitre.org/data/definitions/${F.cwe_id.replace("CWE-","")}.html`:"";return`
|
||
<div style="background: #1e293b; border: 1px solid #334155; border-left: 4px solid ${S[F.severity]}; border-radius: 8px; margin-bottom: 24px; overflow: hidden; page-break-inside: avoid;">
|
||
<div style="padding: 20px; display: flex; justify-content: space-between; align-items: flex-start; background: linear-gradient(135deg, ${S[F.severity]}10 0%, transparent 100%);">
|
||
<div style="flex: 1;">
|
||
<div style="display: flex; align-items: center; gap: 12px; margin-bottom: 8px;">
|
||
<span style="background: ${S[F.severity]}; color: white; padding: 4px 12px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase;">
|
||
${F.severity}
|
||
</span>
|
||
<span style="color: #64748b; font-size: 12px;">Finding #${ie+1}</span>
|
||
</div>
|
||
<h3 style="margin: 0 0 8px 0; color: white; font-size: 18px; font-weight: 600;">${F.title}</h3>
|
||
<p style="margin: 0; color: #94a3b8; font-size: 13px; font-family: monospace;">${F.affected_endpoint}</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div style="padding: 20px; border-top: 1px solid #334155;">
|
||
<!-- Technical Metrics -->
|
||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; padding: 16px; background: #0f172a; border-radius: 8px; margin-bottom: 20px;">
|
||
${F.cvss_score?`
|
||
<div>
|
||
<div style="color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;">CVSS 3.1 Score</div>
|
||
<div style="display: flex; align-items: baseline; gap: 8px;">
|
||
<span style="font-size: 28px; font-weight: 700; color: ${S[F.severity]};">${F.cvss_score}</span>
|
||
<span style="font-size: 12px; color: #94a3b8;">${F.cvss_score>=9?"Critical":F.cvss_score>=7?"High":F.cvss_score>=4?"Medium":"Low"}</span>
|
||
</div>
|
||
${F.cvss_vector?`<div style="font-size: 10px; color: #475569; font-family: monospace; margin-top: 4px;">${F.cvss_vector}</div>`:""}
|
||
</div>
|
||
`:""}
|
||
${F.cwe_id?`
|
||
<div>
|
||
<div style="color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;">CWE Reference</div>
|
||
<a href="${Te}" target="_blank" style="color: #60a5fa; text-decoration: none; font-size: 14px; font-weight: 500;">${F.cwe_id}</a>
|
||
</div>
|
||
`:""}
|
||
${pe?`
|
||
<div>
|
||
<div style="color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;">OWASP Top 10</div>
|
||
<div style="color: #fbbf24; font-size: 13px; font-weight: 500;">${pe}</div>
|
||
</div>
|
||
`:""}
|
||
<div>
|
||
<div style="color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;">Vulnerability Type</div>
|
||
<div style="color: white; font-size: 14px;">${F.vulnerability_type}</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Description -->
|
||
${F.description?`
|
||
<div style="margin-bottom: 20px;">
|
||
<h4 style="color: #e2e8f0; font-size: 13px; font-weight: 600; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.5px;">📋 Description</h4>
|
||
<p style="color: #cbd5e1; margin: 0; line-height: 1.7; font-size: 14px;">${F.description}</p>
|
||
</div>
|
||
`:""}
|
||
|
||
<!-- Affected Endpoint -->
|
||
<div style="margin-bottom: 20px;">
|
||
<h4 style="color: #e2e8f0; font-size: 13px; font-weight: 600; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.5px;">🎯 Affected Endpoint</h4>
|
||
<div style="background: #0f172a; padding: 12px 16px; border-radius: 6px; font-family: monospace; font-size: 13px; color: #38bdf8; overflow-x: auto;">${F.affected_endpoint}</div>
|
||
</div>
|
||
|
||
<!-- Evidence -->
|
||
${F.evidence?`
|
||
<div style="margin-bottom: 20px;">
|
||
<h4 style="color: #e2e8f0; font-size: 13px; font-weight: 600; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.5px;">🔍 Evidence / Proof of Concept</h4>
|
||
<pre style="background: #0f172a; padding: 16px; border-radius: 6px; color: #fbbf24; margin: 0; overflow-x: auto; font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-all;">${F.evidence}</pre>
|
||
</div>
|
||
`:""}
|
||
|
||
<!-- Impact -->
|
||
${F.impact?`
|
||
<div style="margin-bottom: 20px;">
|
||
<h4 style="color: #e2e8f0; font-size: 13px; font-weight: 600; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.5px;">⚠️ Impact</h4>
|
||
<p style="color: #cbd5e1; margin: 0; line-height: 1.7; font-size: 14px;">${F.impact}</p>
|
||
</div>
|
||
`:""}
|
||
|
||
<!-- Remediation -->
|
||
${F.remediation?`
|
||
<div style="background: linear-gradient(135deg, #16a34a15 0%, #16a34a05 100%); border: 1px solid #16a34a40; border-radius: 8px; padding: 16px;">
|
||
<h4 style="color: #4ade80; font-size: 13px; font-weight: 600; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.5px;">✅ Remediation</h4>
|
||
<p style="color: #cbd5e1; margin: 0; line-height: 1.7; font-size: 14px;">${F.remediation}</p>
|
||
</div>
|
||
`:""}
|
||
|
||
<!-- References -->
|
||
${F.references&&F.references.length>0?`
|
||
<div style="margin-top: 20px;">
|
||
<h4 style="color: #e2e8f0; font-size: 13px; font-weight: 600; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.5px;">📚 References</h4>
|
||
<ul style="margin: 0; padding-left: 20px; color: #94a3b8; font-size: 13px;">
|
||
${F.references.map(ve=>`<li style="margin-bottom: 4px;"><a href="${ve}" target="_blank" style="color: #60a5fa; text-decoration: none;">${ve}</a></li>`).join("")}
|
||
</ul>
|
||
</div>
|
||
`:""}
|
||
</div>
|
||
</div>
|
||
`}).join(""),K=`
|
||
<div style="background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); border: 1px solid #334155; border-radius: 12px; padding: 24px; margin-bottom: 40px;">
|
||
<h2 style="color: white; margin: 0 0 16px; font-size: 20px; border: none; padding: 0;">📊 Executive Summary</h2>
|
||
<p style="color: #cbd5e1; line-height: 1.8; margin: 0 0 20px;">
|
||
This security assessment of <strong style="color: white;">${a.target}</strong> was conducted using NeuroSploit AI-powered penetration testing platform.
|
||
The assessment identified <strong style="color: white;">${a.findings.length} security findings</strong> across various severity levels.
|
||
${I.critical>0?`<span style="color: #dc2626; font-weight: 600;">${I.critical} critical vulnerabilities require immediate attention.</span>`:""}
|
||
${I.high>0?`<span style="color: #ea580c;">${I.high} high-severity issues should be addressed promptly.</span>`:""}
|
||
</p>
|
||
<div style="display: flex; align-items: center; gap: 16px; padding: 16px; background: #0f172a; border-radius: 8px;">
|
||
<div>
|
||
<div style="color: #64748b; font-size: 12px; text-transform: uppercase; margin-bottom: 4px;">Overall Risk Score</div>
|
||
<div style="font-size: 32px; font-weight: 700; color: ${C};">${O}/100</div>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="height: 12px; background: #1e293b; border-radius: 6px; overflow: hidden;">
|
||
<div style="height: 100%; width: ${O}%; background: ${C}; border-radius: 6px;"></div>
|
||
</div>
|
||
<div style="color: ${C}; font-size: 14px; font-weight: 600; margin-top: 8px;">${J} Risk</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`;return`<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>NeuroSploit Security Report - ${e}</title>
|
||
<style>
|
||
* { box-sizing: border-box; }
|
||
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0f172a; color: #e2e8f0; margin: 0; padding: 40px; line-height: 1.6; }
|
||
.container { max-width: 1000px; margin: 0 auto; }
|
||
.header { text-align: center; margin-bottom: 40px; padding-bottom: 40px; border-bottom: 1px solid #334155; }
|
||
.header h1 { color: white; margin: 0 0 8px; font-size: 28px; }
|
||
.header p { color: #94a3b8; margin: 0; font-size: 14px; }
|
||
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 40px; }
|
||
.stat-card { background: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 16px; text-align: center; }
|
||
.stat-value { font-size: 28px; font-weight: bold; margin-bottom: 4px; }
|
||
.stat-label { color: #94a3b8; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
|
||
h2 { color: white; border-bottom: 1px solid #334155; padding-bottom: 12px; font-size: 18px; }
|
||
.footer { text-align: center; margin-top: 40px; padding-top: 40px; border-top: 1px solid #334155; color: #64748b; font-size: 12px; }
|
||
@media print {
|
||
body { background: white; color: black; padding: 20px; }
|
||
.stat-card, .findings > div { border-color: #ddd; background: #f9f9f9; }
|
||
.header, .footer { border-color: #ddd; }
|
||
}
|
||
@media (max-width: 768px) {
|
||
.stats { grid-template-columns: repeat(3, 1fr); }
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="container">
|
||
<div class="header">
|
||
<h1>🛡️ NeuroSploit Security Assessment Report</h1>
|
||
<p>Target: ${a.target} | Agent ID: ${e} | Mode: ${vi[a.mode]||a.mode}</p>
|
||
<p>Date: ${new Date().toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}</p>
|
||
</div>
|
||
|
||
${K}
|
||
|
||
<div class="stats">
|
||
<div class="stat-card"><div class="stat-value" style="color: white;">${a.findings.length}</div><div class="stat-label">Total</div></div>
|
||
<div class="stat-card"><div class="stat-value" style="color: #dc2626;">${I.critical}</div><div class="stat-label">Critical</div></div>
|
||
<div class="stat-card"><div class="stat-value" style="color: #ea580c;">${I.high}</div><div class="stat-label">High</div></div>
|
||
<div class="stat-card"><div class="stat-value" style="color: #ca8a04;">${I.medium}</div><div class="stat-label">Medium</div></div>
|
||
<div class="stat-card"><div class="stat-value" style="color: #2563eb;">${I.low}</div><div class="stat-label">Low</div></div>
|
||
<div class="stat-card"><div class="stat-value" style="color: #6b7280;">${I.info}</div><div class="stat-label">Info</div></div>
|
||
</div>
|
||
|
||
<h2>🔍 Detailed Findings</h2>
|
||
<div class="findings">
|
||
${j||'<p style="text-align: center; color: #94a3b8; padding: 40px;">No vulnerabilities identified during this assessment.</p>'}
|
||
</div>
|
||
|
||
<div class="footer">
|
||
<p><strong>Generated by NeuroSploit v3.0 AI Security Scanner</strong></p>
|
||
<p>Report generated: ${new Date().toISOString()}</p>
|
||
<p style="margin-top: 16px; font-size: 11px;">This report is confidential and intended for authorized personnel only.</p>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html>`},G=async()=>{if(e){y(!0);try{await we.stop(e);const S=await we.getStatus(e);l(S)}catch(S){console.error("Failed to stop agent:",S)}finally{y(!1)}}},ge=async()=>{if(e)try{await we.pause(e);const S=await we.getStatus(e);l(S)}catch(S){console.error("Failed to pause agent:",S)}},he=async()=>{if(e)try{await we.resume(e);const S=await we.getStatus(e);l(S)}catch(S){console.error("Failed to resume agent:",S)}},ke=async()=>{if(!_.trim()||!e)return;R(!0),U(null);const S=_;try{await we.sendPrompt(e,_),L(""),U(`Prompt sent: "${S.slice(0,50)}${S.length>50?"...":""}"`),setTimeout(()=>U(null),5e3);const[h,b]=await Promise.all([we.getStatus(e),we.getLogs(e,200)]);l(h),o(b.logs||[])}catch(h){console.error("Failed to send prompt:",h),U("Failed to send prompt"),setTimeout(()=>U(null),3e3)}finally{R(!1)}},P=async S=>{if(e){Q(!0);try{await we.skipToPhase(e,S);const h=a?yi(a.phase):0,b=gi.findIndex(O=>O.key===S),I=new Set(ne);for(let O=h;O<b;O++)I.add(gi[O].key);ae(I),A(null)}catch(h){console.error("Failed to skip phase:",h)}finally{Q(!1)}}};x.useEffect(()=>{if(!a)return;const S=a.phase.toLowerCase();if(S.includes("_skipped")){const h=S.replace("_skipped","");ae(b=>new Set(b).add(h))}},[a==null?void 0:a.phase]);const X=S=>{navigator.clipboard.writeText(S)};if(c)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx(ln,{className:"w-8 h-8 animate-spin text-primary-500"})});if(m)return s.jsxs("div",{className:"flex flex-col items-center justify-center h-64",children:[s.jsx(Ct,{className:"w-12 h-12 text-red-500 mb-4"}),s.jsx("p",{className:"text-xl text-white mb-2",children:m}),s.jsx(H,{onClick:()=>t("/scan/new"),children:"Start New Agent"})]});if(!a)return null;const M={critical:a.findings.filter(S=>S.severity==="critical").length,high:a.findings.filter(S=>S.severity==="high").length,medium:a.findings.filter(S=>S.severity==="medium").length,low:a.findings.filter(S=>S.severity==="low").length,info:a.findings.filter(S=>S.severity==="info").length},me=S=>{var h;return s.jsxs("div",{className:"p-4 pt-0 space-y-4 border-t border-dark-700",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-dark-400",children:"CVSS:"}),s.jsx("span",{className:`font-bold ${S.cvss_score>=9?"text-red-500":S.cvss_score>=7?"text-orange-500":S.cvss_score>=4?"text-yellow-500":"text-blue-500"}`,children:((h=S.cvss_score)==null?void 0:h.toFixed(1))||"N/A"})]}),S.cwe_id&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-dark-400",children:"CWE:"}),s.jsxs("a",{href:`https://cwe.mitre.org/data/definitions/${S.cwe_id.replace("CWE-","")}.html`,target:"_blank",rel:"noopener noreferrer",className:"text-primary-400 hover:underline flex items-center gap-1",children:[S.cwe_id,s.jsx(An,{className:"w-3 h-3"})]})]}),s.jsx("span",{className:"text-xs bg-dark-700 px-2 py-1 rounded text-dark-300",children:S.vulnerability_type}),S.confidence&&s.jsxs("span",{className:`text-xs px-2 py-1 rounded ${S.confidence==="high"?"bg-green-500/20 text-green-400":S.confidence==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-red-500/20 text-red-400"}`,children:[S.confidence," confidence"]})]}),S.cvss_vector&&s.jsx("div",{className:"text-xs bg-dark-800 p-2 rounded font-mono text-dark-300",children:S.cvss_vector}),s.jsxs("div",{className:"bg-dark-800/50 rounded-lg p-4 space-y-3",children:[s.jsxs("h4",{className:"text-sm font-medium text-primary-400 flex items-center gap-2",children:[s.jsx(i0,{className:"w-4 h-4"}),"Technical Details"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-xs text-dark-500",children:"Endpoint:"}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsx(pn,{className:"w-4 h-4 text-dark-400"}),s.jsx("code",{className:"text-sm text-blue-400 bg-dark-900 px-2 py-1 rounded break-all",children:S.affected_endpoint})]})]}),S.parameter&&s.jsxs("div",{children:[s.jsx("span",{className:"text-xs text-dark-500",children:"Vulnerable Parameter:"}),s.jsx("code",{className:"block mt-1 text-sm text-yellow-400 bg-dark-900 px-2 py-1 rounded",children:S.parameter})]}),S.payload&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-dark-500",children:"Payload Used:"}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>X(S.payload),children:s.jsx(cr,{className:"w-3 h-3"})})]}),s.jsx("code",{className:"block mt-1 text-sm text-red-400 bg-dark-900 px-2 py-1 rounded break-all",children:S.payload})]}),S.request&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-dark-500",children:"HTTP Request:"}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>X(S.request),children:s.jsx(cr,{className:"w-3 h-3"})})]}),s.jsx("pre",{className:"mt-1 text-xs text-green-400 bg-dark-900 p-2 rounded overflow-x-auto max-h-32",children:S.request})]}),S.response&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-dark-500",children:"HTTP Response (excerpt):"}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>X(S.response),children:s.jsx(cr,{className:"w-3 h-3"})})]}),s.jsx("pre",{className:"mt-1 text-xs text-orange-400 bg-dark-900 p-2 rounded overflow-x-auto max-h-32",children:S.response})]}),S.evidence&&s.jsxs("div",{children:[s.jsx("span",{className:"text-xs text-dark-500",children:"Evidence:"}),s.jsx("p",{className:"mt-1 text-sm text-dark-300 bg-dark-900 p-2 rounded",children:S.evidence})]})]}),S.description&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-1",children:"Description"}),s.jsx("p",{className:"text-sm text-dark-400",children:S.description})]}),S.impact&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-1",children:"Impact"}),s.jsx("p",{className:"text-sm text-dark-400",children:S.impact})]}),S.poc_code&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("p",{className:"text-sm font-medium text-dark-300",children:"Proof of Concept"}),s.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>X(S.poc_code),children:[s.jsx(cr,{className:"w-3 h-3 mr-1"}),"Copy"]})]}),s.jsx("pre",{className:"text-xs bg-dark-800 p-3 rounded overflow-x-auto text-dark-300 font-mono",children:S.poc_code})]}),S.remediation&&s.jsxs("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-3",children:[s.jsx("p",{className:"text-sm font-medium text-green-400 mb-1",children:"Remediation"}),s.jsx("p",{className:"text-sm text-dark-400",children:S.remediation})]}),S.references&&S.references.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-1",children:"References"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:S.references.map((b,I)=>s.jsxs("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary-400 hover:underline flex items-center gap-1 bg-dark-800 px-2 py-1 rounded",children:[(()=>{try{return new URL(b).hostname}catch{return b}})(),s.jsx(An,{className:"w-3 h-3"})]},I))})]})]})},de=(S,h,b,I)=>s.jsxs("div",{className:"space-y-1 max-h-[400px] overflow-auto font-mono text-xs",children:[S.length===0?s.jsxs("p",{className:"text-dark-400 text-center py-8",children:["No ",b.toLowerCase()," activity yet..."]}):S.map((O,J)=>{const C=O.message.includes("[USER PROMPT]"),j=O.message.includes("[AI RESPONSE]")||O.message.includes("[AI]");return s.jsxs("div",{className:`flex gap-2 py-1 px-1 rounded ${C?"bg-blue-500/10 border-l-2 border-blue-500":j&&O.message.includes("[AI RESPONSE]")?"bg-purple-500/10 border-l-2 border-purple-500":"hover:bg-dark-800/30"}`,children:[s.jsx("span",{className:"text-dark-500 flex-shrink-0 w-20",children:new Date(O.time).toLocaleTimeString()}),s.jsx("span",{className:"flex-shrink-0",children:C?s.jsx(dl,{className:"w-3 h-3 text-blue-400"}):j?s.jsx(Mt,{className:"w-3 h-3 text-purple-400"}):I}),s.jsx("span",{className:`break-words ${C?"text-blue-300 font-medium":j&&O.message.includes("[AI RESPONSE]")?"text-purple-300":O.level==="error"?"text-red-400":O.level==="warning"?"text-yellow-400":O.level==="success"?"text-green-400":O.level==="llm"?"text-purple-400":"text-dark-300"}`,children:O.message})]},J)}),s.jsx("div",{ref:h})]});return s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[s.jsx(In,{className:"w-7 h-7 text-primary-500"}),"Agent: ",e]}),s.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[s.jsxs("span",{className:`px-3 py-1 rounded-full text-sm font-medium flex items-center gap-1 ${a.status==="running"?"bg-blue-500/20 text-blue-400":a.status==="completed"?"bg-green-500/20 text-green-400":a.status==="paused"?"bg-yellow-500/20 text-yellow-400":a.status==="stopped"?"bg-orange-500/20 text-orange-400":"bg-red-500/20 text-red-400"}`,children:[hi[a.status],a.status.charAt(0).toUpperCase()+a.status.slice(1)]}),s.jsxs("span",{className:"text-dark-400",children:["Mode: ",vi[a.mode]||a.mode]}),a.task&&s.jsxs("span",{className:"text-dark-400",children:["Task: ",a.task]})]})]}),s.jsxs("div",{className:"flex gap-2",children:[a.status==="running"&&s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"secondary",onClick:ge,children:[s.jsx(cl,{className:"w-4 h-4 mr-2"}),"Pause"]}),s.jsxs(H,{variant:"danger",onClick:G,isLoading:k,children:[s.jsx(es,{className:"w-4 h-4 mr-2"}),"Stop"]})]}),a.status==="paused"&&s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"primary",onClick:he,children:[s.jsx(Yt,{className:"w-4 h-4 mr-2"}),"Resume"]}),s.jsxs(H,{variant:"danger",onClick:G,isLoading:k,children:[s.jsx(es,{className:"w-4 h-4 mr-2"}),"Stop"]})]}),a.scan_id&&s.jsxs(H,{variant:"secondary",onClick:()=>t(`/scan/${a.scan_id}`),children:[s.jsx(Ke,{className:"w-4 h-4 mr-2"}),"View in Dashboard"]}),(a.findings.length>0||a.report)&&s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(H,{onClick:()=>se("html"),isLoading:v,variant:"primary",children:[s.jsx(yt,{className:"w-4 h-4 mr-2"}),"HTML Report"]}),s.jsxs(H,{onClick:()=>se("json"),isLoading:v,variant:"secondary",children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"JSON"]})]})]})]}),(a.status==="running"||a.status==="completed"||a.status==="stopped")&&s.jsx(re,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center justify-between px-2",children:gi.map((S,h)=>{const b=a.status==="completed"?4:(a.status==="stopped",yi(a.phase)),I=h===b,O=h<b||a.status==="completed",J=a.status==="stopped"&&h>b,C=ne.has(S.key),j=(a.status==="running"||a.status==="paused")&&h>b&&S.key!=="completed";return s.jsxs("div",{className:"flex flex-col items-center flex-1 relative group",children:[h>0&&s.jsx("div",{className:`absolute top-4 right-1/2 w-full h-0.5 -translate-y-1/2 z-0 ${O||I?"bg-green-500/50":C?"bg-yellow-500/30":"bg-dark-700"}`}),s.jsx("div",{className:`relative z-10 w-8 h-8 rounded-full flex items-center justify-center mb-1 transition-all ${C?"bg-yellow-500/20 text-yellow-500 ring-2 ring-yellow-500/30":O?"bg-green-500 text-white":I?"bg-primary-500 text-white animate-pulse ring-2 ring-primary-500/30":J?"bg-yellow-500/20 text-yellow-500":j?"bg-dark-700 text-dark-400 cursor-pointer hover:bg-primary-500/20 hover:text-primary-400 hover:ring-2 hover:ring-primary-500/30":"bg-dark-700 text-dark-400"}`,onClick:()=>j&&A(S.key),children:C?s.jsx(Ig,{className:"w-4 h-4"}):O?s.jsx(Wt,{className:"w-4 h-4"}):I?hi[S.key==="recon"?"reconnaissance":S.key]||s.jsx("span",{className:"text-xs font-bold",children:h+1}):J?s.jsx(es,{className:"w-4 h-4"}):j?s.jsx(m0,{className:"w-3.5 h-3.5"}):s.jsx("span",{className:"text-xs font-bold",children:h+1})}),s.jsx("span",{className:`text-xs text-center ${C?"text-yellow-500":O||I?"text-white":j?"text-dark-400 group-hover:text-primary-400":"text-dark-500"}`,children:C?`${S.label} (skipped)`:S.label}),j&&s.jsxs("div",{className:"absolute -top-8 left-1/2 -translate-x-1/2 bg-dark-800 text-primary-400 text-[10px] px-2 py-0.5 rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none border border-dark-600",children:["Skip to ",S.label]}),q===S.key&&s.jsxs("div",{className:"absolute top-10 left-1/2 -translate-x-1/2 z-20 bg-dark-800 border border-dark-600 rounded-lg p-3 shadow-xl whitespace-nowrap",children:[s.jsxs("p",{className:"text-xs text-dark-300 mb-2",children:["Skip to ",s.jsx("span",{className:"text-white font-medium",children:S.label}),"?"]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>P(S.key),disabled:te,className:"px-3 py-1 bg-primary-500 text-white text-xs rounded hover:bg-primary-600 disabled:opacity-50",children:te?"Skipping...":"Confirm"}),s.jsx("button",{onClick:()=>A(null),className:"px-3 py-1 bg-dark-700 text-dark-300 text-xs rounded hover:bg-dark-600",children:"Cancel"})]})]})]},S.key)})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 text-dark-300",children:[hi[a.phase.toLowerCase()]||s.jsx(Xt,{className:"w-4 h-4"}),s.jsx("span",{className:"capitalize",children:a.phase.replace(/_/g," ")})]}),s.jsxs("span",{className:"text-white font-medium",children:[a.progress,"%"]})]}),s.jsx("div",{className:"h-2 bg-dark-900 rounded-full overflow-hidden",children:s.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${a.status==="completed"?"bg-green-500":a.status==="stopped"?"bg-yellow-500":"bg-primary-500"}`,style:{width:`${a.progress}%`}})})]})}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-4",children:[s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:a.findings_count}),s.jsx("p",{className:"text-sm text-dark-400",children:"Total Findings"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-red-500",children:M.critical}),s.jsx("p",{className:"text-sm text-dark-400",children:"Critical"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-orange-500",children:M.high}),s.jsx("p",{className:"text-sm text-dark-400",children:"High"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-yellow-500",children:M.medium}),s.jsx("p",{className:"text-sm text-dark-400",children:"Medium"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-blue-500",children:M.low}),s.jsx("p",{className:"text-sm text-dark-400",children:"Low"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-gray-400",children:M.info}),s.jsx("p",{className:"text-sm text-dark-400",children:"Info"})]})})]}),a.status==="running"&&s.jsx(re,{children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-primary-400",children:[s.jsx(Mt,{className:"w-5 h-5"}),s.jsx("h3",{className:"font-medium",children:"Custom AI Prompt"})]}),s.jsx("p",{className:"text-sm text-dark-400",children:'Send a custom instruction to the AI agent. Example: "Test for IDOR on /api/users/[id]" or "Check for XXE in XML endpoints"'}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"text",value:_,onChange:S=>L(S.target.value),onKeyDown:S=>S.key==="Enter"&&ke(),placeholder:"Enter custom vulnerability test prompt...",className:"flex-1 bg-dark-800 border border-dark-600 rounded-lg px-4 py-2 text-white placeholder-dark-400 focus:outline-none focus:border-primary-500"}),s.jsxs(H,{onClick:ke,isLoading:D,disabled:!_.trim(),children:[s.jsx(dl,{className:"w-4 h-4 mr-2"}),"Send"]})]}),E&&s.jsxs("div",{className:`flex items-center gap-2 text-sm ${E.includes("Failed")?"text-red-400":"text-green-400"}`,children:[E.includes("Failed")?s.jsx(Ct,{className:"w-4 h-4"}):s.jsx(Wt,{className:"w-4 h-4"}),E," - Check AI Analysis logs for response"]})]})}),s.jsx(re,{title:"Vulnerabilities Found",subtitle:`${a.findings_count} findings`,children:s.jsx("div",{className:"space-y-3 max-h-[600px] overflow-auto",children:a.findings.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Oe,{className:"w-12 h-12 text-dark-600 mx-auto mb-3"}),s.jsx("p",{className:"text-dark-400",children:a.status==="running"?"Scanning for vulnerabilities...":"No vulnerabilities found"})]}):a.findings.map(S=>s.jsxs("div",{className:"bg-dark-900/50 rounded-lg border border-dark-700 overflow-hidden",children:[s.jsx("div",{className:"p-4 cursor-pointer hover:bg-dark-800/50 transition-colors",onClick:()=>z(S.id),children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex items-start gap-2 flex-1",children:[p.has(S.id)?s.jsx(pt,{className:"w-4 h-4 mt-1 text-dark-400"}):s.jsx(zr,{className:"w-4 h-4 mt-1 text-dark-400"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-white",children:S.title}),s.jsx("p",{className:"text-sm text-dark-400 truncate",children:S.affected_endpoint}),S.parameter&&s.jsxs("p",{className:"text-xs text-yellow-400 mt-1",children:["Parameter: ",s.jsx("code",{className:"bg-dark-800 px-1 rounded",children:S.parameter})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ts,{severity:S.severity}),S.ai_verified&&s.jsxs("span",{className:"text-xs bg-purple-500/20 text-purple-400 px-2 py-0.5 rounded flex items-center gap-1",children:[s.jsx(Mt,{className:"w-3 h-3"}),"AI Verified"]})]})]})}),p.has(S.id)&&me(S)]},S.id))})}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsx(re,{title:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ye,{className:"w-4 h-4 text-green-400"}),s.jsx("span",{children:"Script Activity"}),s.jsx("span",{className:"text-xs bg-dark-700 px-2 py-0.5 rounded text-dark-400",children:ce.length})]}),subtitle:"Tool executions, HTTP requests, scanning progress",children:de(ce,n,"Script",s.jsx(Ye,{className:"w-3 h-3 text-green-400"}))}),s.jsx(re,{title:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Mt,{className:"w-4 h-4 text-purple-400"}),s.jsx("span",{children:"AI Analysis"}),s.jsx("span",{className:"text-xs bg-dark-700 px-2 py-0.5 rounded text-dark-400",children:xe.length})]}),subtitle:"LLM reasoning, vulnerability analysis, decisions",children:de(xe,r,"AI",s.jsx(Mt,{className:"w-3 h-3 text-purple-400"}))})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs("label",{className:"flex items-center gap-2 text-sm text-dark-400 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:u,onChange:S=>g(S.target.checked),className:"w-4 h-4 rounded border-dark-600 bg-dark-800 text-primary-500 focus:ring-primary-500"}),"Auto-scroll logs"]})}),(a.status==="completed"||a.status==="stopped")&&(a.report||a.findings.length>0)&&(()=>{var h;const S=a.report||{summary:{target:a.target,mode:a.mode,duration:a.started_at?`${Math.round((new Date(a.completed_at||new Date).getTime()-new Date(a.started_at).getTime())/6e4)} min`:"N/A",total_findings:a.findings.length,severity_breakdown:{critical:a.findings.filter(b=>b.severity==="critical").length,high:a.findings.filter(b=>b.severity==="high").length,medium:a.findings.filter(b=>b.severity==="medium").length,low:a.findings.filter(b=>b.severity==="low").length,info:a.findings.filter(b=>b.severity==="info").length}},executive_summary:a.status==="stopped"?`Scan was stopped by user. ${a.findings.length} finding(s) discovered before stopping.`:null,recommendations:[]};return s.jsx(re,{title:a.status==="stopped"?"Partial Report Summary":"Report Summary",children:s.jsxs("div",{className:"space-y-4",children:[a.status==="stopped"&&s.jsxs("div",{className:"flex items-center gap-2 text-yellow-500 bg-yellow-500/10 border border-yellow-500/30 rounded-lg px-3 py-2",children:[s.jsx(Oe,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm",children:"Scan was stopped - showing partial results"})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Target"}),s.jsx("p",{className:"text-white font-medium",children:S.summary.target})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Mode"}),s.jsx("p",{className:"text-white font-medium",children:vi[S.summary.mode]||S.summary.mode})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Duration"}),s.jsx("p",{className:"text-white font-medium",children:S.summary.duration})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Total Findings"}),s.jsx("p",{className:"text-white font-medium",children:S.summary.total_findings})]})]}),S.executive_summary&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-2",children:"Executive Summary"}),s.jsx("p",{className:"text-dark-400 whitespace-pre-wrap",children:S.executive_summary})]}),((h=S.recommendations)==null?void 0:h.length)>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-2",children:"Recommendations"}),s.jsx("ul",{className:"space-y-2",children:S.recommendations.map((b,I)=>s.jsxs("li",{className:"flex items-start gap-2 text-dark-400",children:[s.jsx(Wt,{className:"w-4 h-4 text-green-500 flex-shrink-0 mt-0.5"}),b]},I))})]})]})})})(),a.error&&s.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 flex items-start gap-3",children:[s.jsx(Ct,{className:"w-6 h-6 text-red-500 flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-red-400",children:"Agent Error"}),s.jsx("p",{className:"text-sm text-red-300/80 mt-1",children:a.error})]})]})]})}const mw=[{id:"all",name:"All Tasks",color:"dark"},{id:"full_auto",name:"Full Auto",color:"primary"},{id:"recon",name:"Reconnaissance",color:"blue"},{id:"vulnerability",name:"Vulnerability",color:"orange"},{id:"custom",name:"Custom",color:"purple"},{id:"reporting",name:"Reporting",color:"green"}];function fw(){var q;const e=Bn(),[t,n]=x.useState([]),[r,a]=x.useState([]),[l,i]=x.useState(!0),[o,c]=x.useState("all"),[d,m]=x.useState(""),[f,p]=x.useState(null),[N,v]=x.useState(!1),[w,k]=x.useState({name:"",description:"",category:"custom",prompt:"",system_prompt:"",tags:""}),[y,u]=x.useState(!1),[g,_]=x.useState(null);x.useEffect(()=>{L()},[]),x.useEffect(()=>{D()},[t,o,d]);const L=async()=>{i(!0);try{const A=await we.tasks.list();n(A)}catch(A){console.error("Failed to load tasks:",A)}finally{i(!1)}},D=()=>{let A=[...t];if(o!=="all"&&(A=A.filter(te=>te.category===o)),d.trim()){const te=d.toLowerCase();A=A.filter(Q=>{var ne;return Q.name.toLowerCase().includes(te)||Q.description.toLowerCase().includes(te)||((ne=Q.tags)==null?void 0:ne.some(ae=>ae.toLowerCase().includes(te)))})}a(A)},R=async()=>{if(!(!w.name.trim()||!w.prompt.trim())){u(!0);try{await we.tasks.create({name:w.name,description:w.description,category:w.category,prompt:w.prompt,system_prompt:w.system_prompt||void 0,tags:w.tags.split(",").map(A=>A.trim()).filter(A=>A)}),await L(),v(!1),k({name:"",description:"",category:"custom",prompt:"",system_prompt:"",tags:""})}catch(A){console.error("Failed to create task:",A)}finally{u(!1)}}},E=async A=>{try{await we.tasks.delete(A),await L(),_(null),(f==null?void 0:f.id)===A&&p(null)}catch(te){console.error("Failed to delete task:",te)}},U=A=>{e("/scan/new",{state:{selectedTaskId:A.id}})};return s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-3xl font-bold text-white flex items-center gap-3",children:[s.jsx(Nc,{className:"w-8 h-8 text-primary-500"}),"Task Library"]}),s.jsx("p",{className:"text-dark-400 mt-1",children:"Manage and create reusable security testing tasks"})]}),s.jsxs(H,{onClick:()=>v(!0),children:[s.jsx(Gt,{className:"w-4 h-4 mr-2"}),"Create Task"]})]}),s.jsx(re,{children:s.jsxs("div",{className:"flex flex-wrap gap-4",children:[s.jsx("div",{className:"flex-1 min-w-[200px]",children:s.jsxs("div",{className:"relative",children:[s.jsx(Qr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-dark-400"}),s.jsx("input",{type:"text",placeholder:"Search tasks...",value:d,onChange:A=>m(A.target.value),className:"w-full pl-10 pr-4 py-2 bg-dark-900 border border-dark-700 rounded-lg text-white placeholder-dark-500 focus:border-primary-500 focus:outline-none"})]})}),s.jsx("div",{className:"flex gap-2 flex-wrap",children:mw.map(A=>s.jsx(H,{variant:o===A.id?"primary":"secondary",size:"sm",onClick:()=>c(A.id),children:A.name},A.id))})]})}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsx("div",{className:"lg:col-span-2 space-y-3",children:l?s.jsx(re,{children:s.jsx("p",{className:"text-dark-400 text-center py-8",children:"Loading tasks..."})}):r.length===0?s.jsx(re,{children:s.jsx("p",{className:"text-dark-400 text-center py-8",children:d||o!=="all"?"No tasks match your filters":"No tasks found. Create your first task!"})}):r.map(A=>{var te;return s.jsx("div",{onClick:()=>p(A),className:`bg-dark-800 rounded-lg border p-4 cursor-pointer transition-all ${(f==null?void 0:f.id)===A.id?"border-primary-500 bg-primary-500/5":"border-dark-700 hover:border-dark-500"}`,children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"font-medium text-white",children:A.name}),A.is_preset&&s.jsx("span",{className:"text-xs bg-primary-500/20 text-primary-400 px-2 py-0.5 rounded",children:"Preset"})]}),s.jsx("p",{className:"text-sm text-dark-400 line-clamp-2",children:A.description}),s.jsxs("div",{className:"flex items-center gap-3 mt-3",children:[s.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${A.category==="full_auto"?"bg-primary-500/20 text-primary-400":A.category==="recon"?"bg-blue-500/20 text-blue-400":A.category==="vulnerability"?"bg-orange-500/20 text-orange-400":A.category==="reporting"?"bg-green-500/20 text-green-400":"bg-purple-500/20 text-purple-400"}`,children:A.category}),A.estimated_tokens>0&&s.jsxs("span",{className:"text-xs text-dark-500 flex items-center gap-1",children:[s.jsx(Rl,{className:"w-3 h-3"}),"~",A.estimated_tokens," tokens"]})]}),((te=A.tags)==null?void 0:te.length)>0&&s.jsxs("div",{className:"flex gap-1 mt-2 flex-wrap",children:[A.tags.slice(0,5).map(Q=>s.jsxs("span",{className:"text-xs bg-dark-700 text-dark-300 px-2 py-0.5 rounded flex items-center gap-1",children:[s.jsx(Bg,{className:"w-3 h-3"}),Q]},Q)),A.tags.length>5&&s.jsxs("span",{className:"text-xs text-dark-500",children:["+",A.tags.length-5," more"]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(H,{variant:"ghost",size:"sm",onClick:Q=>{Q.stopPropagation(),U(A)},children:s.jsx(Yt,{className:"w-4 h-4"})}),!A.is_preset&&s.jsx(H,{variant:"ghost",size:"sm",onClick:Q=>{Q.stopPropagation(),_(A.id)},children:s.jsx(Pt,{className:"w-4 h-4 text-red-400"})})]})]})},A.id)})}),s.jsx("div",{children:s.jsx(re,{title:"Task Details",children:f?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Name"}),s.jsx("p",{className:"text-white font-medium",children:f.name})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Description"}),s.jsx("p",{className:"text-dark-300",children:f.description})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Category"}),s.jsx("p",{className:"text-white",children:f.category})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Prompt"}),s.jsx("pre",{className:"text-xs bg-dark-900 p-3 rounded-lg overflow-auto max-h-60 text-dark-300 whitespace-pre-wrap",children:f.prompt})]}),f.system_prompt&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"System Prompt"}),s.jsx("pre",{className:"text-xs bg-dark-900 p-3 rounded-lg overflow-auto max-h-40 text-dark-300 whitespace-pre-wrap",children:f.system_prompt})]}),((q=f.tools_required)==null?void 0:q.length)>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Required Tools"}),s.jsx("div",{className:"flex gap-1 flex-wrap mt-1",children:f.tools_required.map(A=>s.jsx("span",{className:"text-xs bg-dark-700 text-dark-300 px-2 py-1 rounded",children:A},A))})]}),s.jsx("div",{className:"pt-4 border-t border-dark-700",children:s.jsxs(H,{className:"w-full",onClick:()=>U(f),children:[s.jsx(Yt,{className:"w-4 h-4 mr-2"}),"Run This Task"]})})]}):s.jsx("p",{className:"text-dark-400 text-center py-8",children:"Select a task to view details"})})})]}),N&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-dark-800 rounded-xl border border-dark-700 w-full max-w-2xl max-h-[90vh] overflow-auto",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-dark-700",children:[s.jsx("h3",{className:"text-xl font-bold text-white",children:"Create New Task"}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>v(!1),children:s.jsx(Sc,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"p-4 space-y-4",children:[s.jsx(st,{label:"Task Name",placeholder:"My Custom Task",value:w.name,onChange:A=>k({...w,name:A.target.value})}),s.jsx(st,{label:"Description",placeholder:"Brief description of what this task does",value:w.description,onChange:A=>k({...w,description:A.target.value})}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Category"}),s.jsxs("select",{value:w.category,onChange:A=>k({...w,category:A.target.value}),className:"w-full px-4 py-2 bg-dark-900 border border-dark-700 rounded-lg text-white focus:border-primary-500 focus:outline-none",children:[s.jsx("option",{value:"custom",children:"Custom"}),s.jsx("option",{value:"recon",children:"Reconnaissance"}),s.jsx("option",{value:"vulnerability",children:"Vulnerability"}),s.jsx("option",{value:"full_auto",children:"Full Auto"}),s.jsx("option",{value:"reporting",children:"Reporting"})]})]}),s.jsx(Ur,{label:"Prompt",placeholder:"Enter the prompt for the AI agent...",rows:8,value:w.prompt,onChange:A=>k({...w,prompt:A.target.value})}),s.jsx(Ur,{label:"System Prompt (Optional)",placeholder:"Enter a system prompt to guide the AI's behavior...",rows:4,value:w.system_prompt,onChange:A=>k({...w,system_prompt:A.target.value})}),s.jsx(st,{label:"Tags (comma separated)",placeholder:"pentest, api, auth, custom",value:w.tags,onChange:A=>k({...w,tags:A.target.value})})]}),s.jsxs("div",{className:"flex justify-end gap-3 p-4 border-t border-dark-700",children:[s.jsx(H,{variant:"secondary",onClick:()=>v(!1),children:"Cancel"}),s.jsxs(H,{onClick:R,isLoading:y,disabled:!w.name.trim()||!w.prompt.trim(),children:[s.jsx(u0,{className:"w-4 h-4 mr-2"}),"Create Task"]})]})]})}),g&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-dark-800 rounded-xl border border-dark-700 p-6 max-w-md",children:[s.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Delete Task?"}),s.jsx("p",{className:"text-dark-400 mb-6",children:"Are you sure you want to delete this task? This action cannot be undone."}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(H,{variant:"secondary",onClick:()=>_(null),children:"Cancel"}),s.jsxs(H,{variant:"danger",onClick:()=>E(g),children:[s.jsx(Pt,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})})]})}const _u={critical:0,high:1,medium:2,low:3,info:4},xw={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-blue-500",info:"bg-gray-500"};function hw(){var J,C;const e=x.useRef(null),t=x.useRef(null),[n,r]=x.useState([]),[a,l]=x.useState(null),[i,o]=x.useState(null),[c,d]=x.useState(!1),[m,f]=x.useState(""),[p,N]=x.useState(""),[v,w]=x.useState(!1),[k,y]=x.useState(""),[u,g]=x.useState(!1),[_,L]=x.useState(new Set),[D,R]=x.useState(new Set),[E,U]=x.useState(null),[q,A]=x.useState(!1),[te,Q]=x.useState(null),[ne,ae]=x.useState(null),[ce,xe]=x.useState(!1),z=600,Y=[{label:"Security Headers",prompt:"Analyze security headers and identify misconfigurations",icon:"🛡️"},{label:"Full Scan",prompt:"Perform a comprehensive security assessment including headers, cookies, CORS, and endpoint discovery",icon:"🔍"},{label:"XSS Test",prompt:"Test for Cross-Site Scripting (XSS) vulnerabilities in all input fields",icon:"💉"},{label:"SQL Injection",prompt:"Check for SQL injection vulnerabilities in parameters and forms",icon:"🗃️"},{label:"Directory Enum",prompt:"Discover hidden directories, files, and endpoints using common wordlists",icon:"📁"},{label:"Tech Stack",prompt:"Detect technologies, frameworks, and versions used by this application",icon:"⚙️"}],se=[{tool:"ffuf",label:"FFUF",description:"Fast web fuzzer",icon:"⚡"},{tool:"feroxbuster",label:"Feroxbuster",description:"Directory brute-force",icon:"🦀"},{tool:"nuclei",label:"Nuclei",description:"Vulnerability scanner",icon:"☢️"},{tool:"nmap",label:"Nmap",description:"Port scanner",icon:"🔌"},{tool:"nikto",label:"Nikto",description:"Web server scanner",icon:"🕷️"},{tool:"httpx",label:"HTTPX",description:"HTTP toolkit",icon:"🌐"}];x.useEffect(()=>{ge(),V(),G()},[]);const V=async()=>{try{const j=await we.realtime.getLlmStatus();U({available:j.available,provider:j.provider,error:j.error})}catch(j){console.error("Failed to check LLM status:",j),U({available:!1,provider:null,error:"Failed to connect to backend"})}},G=async()=>{try{const j=await we.realtime.getToolsStatus();Q(j)}catch(j){console.error("Failed to load tools info:",j)}};x.useEffect(()=>{var j;(j=e.current)==null||j.scrollIntoView({behavior:"smooth"})},[a==null?void 0:a.messages]);const ge=async()=>{try{const j=await we.realtime.listSessions();r(j.sessions||[])}catch(j){console.error("Failed to load sessions:",j)}},he=async()=>{var j,K;if(m.trim()){w(!0),o(null);try{const F=await we.realtime.createSession(m,p||void 0);await ge(),await ke(F.session_id),d(!1),f(""),N("")}catch(F){o(((K=(j=F.response)==null?void 0:j.data)==null?void 0:K.detail)||"Failed to create session")}finally{w(!1)}}},ke=async j=>{var K,F;o(null);try{const ie=await we.realtime.getSession(j);l(ie)}catch(ie){o(((F=(K=ie.response)==null?void 0:K.data)==null?void 0:F.detail)||"Failed to load session")}},P=async j=>{var ie,pe,Te;const K=j||k;if(!K.trim()||!a)return;g(!0),y("");const F={role:"user",content:K,timestamp:new Date().toISOString()};l(ve=>ve?{...ve,messages:[...ve.messages,F]}:null);try{const ve=await we.realtime.sendMessage(a.session_id,K),kt={role:"assistant",content:ve.response,timestamp:new Date().toISOString(),metadata:{tests_executed:ve.tests_executed}};l(Se=>Se?{...Se,messages:[...Se.messages,kt],findings:ve.findings||Se.findings}:null),(ie=t.current)==null||ie.focus()}catch(ve){const kt={role:"assistant",content:`Error: ${((Te=(pe=ve.response)==null?void 0:pe.data)==null?void 0:Te.detail)||ve.message||"Failed to send message"}`,timestamp:new Date().toISOString(),metadata:{error:!0}};l(Se=>Se?{...Se,messages:[...Se.messages,kt]}:null)}finally{g(!1)}},X=async j=>{var F,ie;if(!a)return;ae(j),A(!1);const K={role:"user",content:`Execute ${j} scan on target`,timestamp:new Date().toISOString()};l(pe=>pe?{...pe,messages:[...pe.messages,K]}:null);try{await we.realtime.executeTool(a.session_id,j),await ke(a.session_id)}catch(pe){const Te={role:"assistant",content:`Tool execution failed: ${((ie=(F=pe.response)==null?void 0:F.data)==null?void 0:ie.detail)||pe.message}`,timestamp:new Date().toISOString(),metadata:{error:!0}};l(ve=>ve?{...ve,messages:[...ve.messages,Te]}:null)}finally{ae(null)}},M=async j=>{if(confirm("Delete this session?"))try{await we.realtime.deleteSession(j),(a==null?void 0:a.session_id)===j&&l(null),await ge()}catch(K){console.error("Failed to delete session:",K)}},me=async()=>{if(a){xe(!0);try{const j=await we.realtime.getReportHtml(a.session_id),K=window.open("","_blank");K&&(K.document.write(j),K.document.close())}catch(j){console.error("Failed to generate HTML report:",j)}finally{xe(!1)}}},de=async()=>{if(a)try{const j=await we.realtime.getReport(a.session_id),K=new Blob([JSON.stringify(j,null,2)],{type:"application/json"}),F=URL.createObjectURL(K),ie=document.createElement("a");ie.href=F,ie.download=`report-${a.session_id}-${new Date().toISOString().split("T")[0]}.json`,ie.click(),URL.revokeObjectURL(F)}catch(j){console.error("Failed to generate report:",j)}},S=j=>{const K=new Set(_);K.has(j)?K.delete(j):K.add(j),L(K)},h=j=>{const K=new Set(D);K.has(j)?K.delete(j):K.add(j),R(K)},b=(j,K)=>{var ye,Vn,$,oe,le;const F=j.role==="user",ie=(ye=j.metadata)==null?void 0:ye.error,pe=(Vn=j.metadata)==null?void 0:Vn.api_error,Te=($=j.metadata)==null?void 0:$.tool_execution,ve=D.has(K),Se=!F&&j.content.length>z&&!ve?j.content.substring(0,z)+"...":j.content;return s.jsx("div",{className:`flex ${F?"justify-end":"justify-start"} animate-fadeIn`,children:s.jsxs("div",{className:`max-w-[85%] rounded-xl px-4 py-3 shadow-lg overflow-hidden ${F?"bg-gradient-to-r from-primary-600 to-primary-500 text-white":ie||pe?"bg-red-500/10 border border-red-500/30 text-red-300":Te?"bg-purple-500/10 border border-purple-500/30 text-purple-200":"bg-dark-800/80 border border-dark-700 text-dark-200"}`,children:[!F&&s.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs text-dark-400",children:[Te?s.jsx(vr,{className:"w-3 h-3 text-purple-400"}):s.jsx(In,{className:"w-3 h-3"}),s.jsx("span",{children:Te?"Tool Execution":"NeuroSploit AI"}),pe&&s.jsx("span",{className:"bg-red-500/20 text-red-400 px-1.5 py-0.5 rounded text-[10px]",children:"API Error"}),((oe=j.metadata)==null?void 0:oe.tests_executed)&&s.jsx("span",{className:"bg-green-500/20 text-green-400 px-1.5 py-0.5 rounded text-[10px]",children:"Tests Executed"}),((le=j.metadata)==null?void 0:le.new_findings)&&j.metadata.new_findings>0&&s.jsxs("span",{className:"bg-orange-500/20 text-orange-400 px-1.5 py-0.5 rounded text-[10px]",children:["+",j.metadata.new_findings," findings"]})]}),s.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed prose prose-invert prose-sm max-w-none break-words overflow-x-auto",children:Se}),!F&&j.content.length>z&&s.jsx("button",{onClick:()=>h(K),className:"mt-3 text-xs text-primary-400 hover:text-primary-300 transition-colors flex items-center gap-1 font-medium",children:ve?s.jsxs(s.Fragment,{children:[s.jsx(pt,{className:"w-3 h-3"}),"Show less"]}):s.jsxs(s.Fragment,{children:[s.jsx(zr,{className:"w-3 h-3"}),"Show more (",Math.ceil((j.content.length-z)/100)*100,"+ chars)"]})}),s.jsx("div",{className:`text-[10px] mt-2 ${F?"text-primary-200":"text-dark-500"}`,children:new Date(j.timestamp).toLocaleTimeString()})]})},K)},I=a!=null&&a.findings?[...a.findings].sort((j,K)=>(_u[j.severity]||4)-(_u[K.severity]||4)):[],O=I.reduce((j,K)=>{var ie;const F=((ie=K.severity)==null?void 0:ie.toLowerCase())||"info";return j[F]=(j[F]||0)+1,j},{});return s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[s.jsxs("div",{children:[s.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[s.jsx(Rl,{className:"w-7 h-7 text-yellow-500"}),"Real-time Task"]}),s.jsx("p",{className:"text-dark-400 mt-1",children:"Interactive AI-powered security testing with real tool execution"})]}),s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[E&&s.jsx("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs cursor-help ${E.available?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-red-500/20 text-red-400 border border-red-500/30"}`,title:E.error||`Connected to ${E.provider}`,children:E.available?s.jsxs(s.Fragment,{children:[s.jsx(Mn,{className:"w-3.5 h-3.5"}),s.jsx("span",{className:"font-medium",children:(J=E.provider)==null?void 0:J.toUpperCase()})]}):s.jsxs(s.Fragment,{children:[s.jsx(Jd,{className:"w-3.5 h-3.5"}),s.jsx("span",{children:"No AI"})]})}),te&&s.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs cursor-help ${te.available?"bg-blue-500/20 text-blue-400 border border-blue-500/30":"bg-dark-700 text-dark-400 border border-dark-600"}`,title:te.available?"Docker tools ready":"Docker not available",children:[s.jsx(Ye,{className:"w-3.5 h-3.5"}),s.jsx("span",{children:te.available?"Tools Ready":"No Docker"})]}),s.jsxs(H,{onClick:()=>d(!0),children:[s.jsx(Gt,{className:"w-4 h-4 mr-2"}),"New Session"]})]})]}),c&&s.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",children:s.jsxs(re,{className:"w-full max-w-md mx-4 shadow-2xl",children:[s.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[s.jsx(Kt,{className:"w-5 h-5 text-primary-500"}),"Create New Session"]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm text-dark-300 mb-1",children:"Target URL *"}),s.jsx("input",{type:"text",value:m,onChange:j=>f(j.target.value),placeholder:"https://example.com",className:"w-full bg-dark-800 border border-dark-600 rounded-lg px-4 py-2.5 text-white placeholder-dark-400 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500",autoFocus:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm text-dark-300 mb-1",children:"Session Name (optional)"}),s.jsx("input",{type:"text",value:p,onChange:j=>N(j.target.value),placeholder:"My Security Test",className:"w-full bg-dark-800 border border-dark-600 rounded-lg px-4 py-2.5 text-white placeholder-dark-400 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500"})]}),i&&s.jsxs("div",{className:"text-red-400 text-sm flex items-center gap-2 bg-red-500/10 p-3 rounded-lg",children:[s.jsx(Ct,{className:"w-4 h-4 flex-shrink-0"}),i]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[s.jsx(H,{variant:"secondary",onClick:()=>d(!1),children:"Cancel"}),s.jsx(H,{onClick:he,isLoading:v,disabled:!m.trim(),children:"Create Session"})]})]})]})}),q&&a&&s.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",children:s.jsxs(re,{className:"w-full max-w-2xl mx-4 shadow-2xl",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h3",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[s.jsx(vr,{className:"w-5 h-5 text-purple-500"}),"Execute Security Tool"]}),s.jsx("button",{onClick:()=>A(!1),className:"text-dark-400 hover:text-white",children:s.jsx(Ct,{className:"w-5 h-5"})})]}),s.jsxs("p",{className:"text-dark-400 text-sm mb-4",children:["Target: ",s.jsx("span",{className:"text-white font-mono",children:a.target})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:se.map(j=>s.jsxs("button",{onClick:()=>X(j.tool),disabled:ne!==null||!(te!=null&&te.available),className:"p-4 bg-dark-800 hover:bg-dark-700 border border-dark-600 hover:border-purple-500/50 rounded-xl transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed group",children:[s.jsx("div",{className:"text-2xl mb-2",children:j.icon}),s.jsx("div",{className:"font-medium text-white group-hover:text-purple-400 transition-colors",children:j.label}),s.jsx("div",{className:"text-xs text-dark-400 mt-1",children:j.description})]},j.tool))}),!(te!=null&&te.available)&&s.jsxs("div",{className:"mt-4 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg text-yellow-400 text-sm",children:[s.jsx(Jd,{className:"w-4 h-4 inline mr-2"}),"Docker is not available. Tools require Docker to be running."]})]})}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[s.jsx("div",{className:"lg:col-span-1",children:s.jsx(re,{title:"Sessions",className:"h-fit",children:s.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto",children:n.length===0?s.jsx("p",{className:"text-dark-400 text-sm text-center py-4",children:"No sessions yet. Create one to start testing."}):n.map(j=>s.jsxs("div",{className:`p-3 rounded-xl cursor-pointer transition-all ${(a==null?void 0:a.session_id)===j.session_id?"bg-primary-500/20 border border-primary-500/50 shadow-lg shadow-primary-500/10":"bg-dark-800/50 hover:bg-dark-800 border border-transparent hover:border-dark-600"}`,onClick:()=>ke(j.session_id),children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-white font-medium truncate text-sm",children:j.name}),s.jsxs("p",{className:"text-dark-400 text-xs truncate flex items-center gap-1 mt-0.5",children:[s.jsx(pn,{className:"w-3 h-3"}),j.target]})]}),s.jsx("button",{onClick:K=>{K.stopPropagation(),M(j.session_id)},className:"p-1.5 text-dark-500 hover:text-red-400 hover:bg-red-500/10 rounded-lg transition-colors",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs",children:[s.jsxs("span",{className:"text-dark-400",children:[j.messages_count," msgs"]}),j.findings_count>0&&s.jsxs("span",{className:"bg-red-500/20 text-red-400 px-2 py-0.5 rounded-full font-medium",children:[j.findings_count," findings"]})]})]},j.session_id))})})}),s.jsx("div",{className:"lg:col-span-2",children:a?s.jsxs(re,{className:"flex flex-col h-[calc(100vh-220px)]",children:[s.jsxs("div",{className:"flex items-center justify-between pb-4 border-b border-dark-700",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("h3",{className:"text-white font-medium flex items-center gap-2",children:[s.jsx(Kt,{className:"w-4 h-4 text-primary-500 flex-shrink-0"}),s.jsx("span",{className:"truncate",children:a.name})]}),s.jsx("p",{className:"text-dark-400 text-sm truncate",children:a.target})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[s.jsxs(H,{variant:"secondary",size:"sm",onClick:()=>A(!0),disabled:ne!==null,children:[s.jsx(vr,{className:"w-4 h-4 mr-1"}),"Tools"]}),s.jsxs("div",{className:"relative group",children:[s.jsxs(H,{variant:"secondary",size:"sm",onClick:me,isLoading:ce,children:[s.jsx(yt,{className:"w-4 h-4 mr-1"}),"Report"]}),s.jsxs("div",{className:"absolute right-0 mt-1 w-40 bg-dark-800 border border-dark-600 rounded-lg shadow-xl opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all z-10",children:[s.jsxs("button",{onClick:me,className:"w-full px-3 py-2 text-left text-sm text-dark-300 hover:bg-dark-700 hover:text-white rounded-t-lg flex items-center gap-2",children:[s.jsx(An,{className:"w-3 h-3"}),"Open HTML Report"]}),s.jsxs("button",{onClick:de,className:"w-full px-3 py-2 text-left text-sm text-dark-300 hover:bg-dark-700 hover:text-white rounded-b-lg flex items-center gap-2",children:[s.jsx(i0,{className:"w-3 h-3"}),"Download JSON"]})]})]})]})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto py-4 space-y-4 scroll-smooth",children:[a.messages.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(d0,{className:"w-12 h-12 text-dark-600 mx-auto mb-3"}),s.jsx("p",{className:"text-dark-400",children:"Start by typing a security testing instruction or use a quick prompt"})]}):a.messages.map((j,K)=>b(j,K)),(u||ne)&&s.jsx("div",{className:"flex justify-start",children:s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-xl px-4 py-3 flex items-center gap-3 text-dark-400",children:[s.jsx(ln,{className:"w-4 h-4 animate-spin text-primary-500"}),s.jsx("span",{children:ne?`Running ${ne}...`:"Analyzing and testing..."})]})}),s.jsx("div",{ref:e})]}),s.jsx("div",{className:"flex flex-wrap gap-2 py-3 border-t border-dark-700",children:Y.map((j,K)=>s.jsxs("button",{onClick:()=>P(j.prompt),disabled:u||ne!==null,className:"px-3 py-1.5 text-xs bg-dark-800 hover:bg-dark-700 text-dark-300 hover:text-white rounded-full transition-all disabled:opacity-50 flex items-center gap-1.5 border border-dark-700 hover:border-dark-600",children:[s.jsx("span",{children:j.icon}),j.label]},K))}),s.jsxs("div",{className:"flex gap-2 pt-2",children:[s.jsx("input",{ref:t,type:"text",value:k,onChange:j=>y(j.target.value),onKeyDown:j=>j.key==="Enter"&&!j.shiftKey&&P(),placeholder:"Type your security testing instruction...",disabled:u||ne!==null,className:"flex-1 bg-dark-800 border border-dark-600 rounded-xl px-4 py-3 text-white placeholder-dark-400 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500 disabled:opacity-50"}),s.jsx(H,{onClick:()=>P(),isLoading:u,disabled:!k.trim()||ne!==null,className:"px-4",children:s.jsx(dl,{className:"w-4 h-4"})})]})]}):s.jsx(re,{className:"flex flex-col items-center justify-center h-[calc(100vh-220px)]",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-20 h-20 bg-gradient-to-br from-primary-500/20 to-purple-500/20 rounded-2xl flex items-center justify-center mx-auto mb-6",children:s.jsx(Ye,{className:"w-10 h-10 text-primary-400"})}),s.jsx("h3",{className:"text-white text-lg font-medium mb-2",children:"No Session Selected"}),s.jsx("p",{className:"text-dark-400 text-center mb-6 max-w-sm",children:"Select a session from the list or create a new one to start interactive security testing"}),s.jsxs(H,{onClick:()=>d(!0),className:"mx-auto",children:[s.jsx(Gt,{className:"w-4 h-4 mr-2"}),"Create New Session"]})]})})}),s.jsxs("div",{className:"lg:col-span-1 space-y-4",children:[I.length>0&&s.jsx(re,{className:"!p-3",children:s.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:["critical","high","medium","low","info"].map(j=>{const K=O[j]||0;return K===0?null:s.jsxs("div",{className:`px-2 py-1 rounded-lg text-xs font-medium flex items-center gap-1 ${j==="critical"?"bg-red-500/20 text-red-400":j==="high"?"bg-orange-500/20 text-orange-400":j==="medium"?"bg-yellow-500/20 text-yellow-400":j==="low"?"bg-blue-500/20 text-blue-400":"bg-gray-500/20 text-gray-400"}`,children:[s.jsx("span",{className:`w-2 h-2 rounded-full ${xw[j]}`}),K," ",j]},j)})})}),s.jsx(re,{title:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ke,{className:"w-4 h-4 text-red-400"}),s.jsx("span",{children:"Findings"}),I.length>0&&s.jsx("span",{className:"bg-red-500/20 text-red-400 text-xs px-2 py-0.5 rounded-full font-medium",children:I.length})]}),className:"h-fit max-h-[calc(100vh-320px)] overflow-y-auto",children:I.length===0?s.jsxs("div",{className:"text-center py-8",children:[s.jsx(Qr,{className:"w-8 h-8 text-dark-600 mx-auto mb-2"}),s.jsx("p",{className:"text-dark-400 text-sm",children:"No findings yet. Send a testing instruction to discover vulnerabilities."})]}):s.jsx("div",{className:"space-y-2",children:I.map((j,K)=>s.jsxs("div",{className:"bg-dark-900/50 rounded-xl border border-dark-700 overflow-hidden hover:border-dark-600 transition-colors",children:[s.jsx("div",{className:"p-3 cursor-pointer hover:bg-dark-800/50 transition-colors",onClick:()=>S(K),children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex items-start gap-2 flex-1 min-w-0",children:[_.has(K)?s.jsx(pt,{className:"w-4 h-4 mt-0.5 text-dark-400 flex-shrink-0"}):s.jsx(zr,{className:"w-4 h-4 mt-0.5 text-dark-400 flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-white truncate",children:j.title}),s.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[s.jsx("p",{className:"text-xs text-dark-400 truncate flex-1",children:j.affected_endpoint}),j.cvss_score&&s.jsx("span",{className:`text-[10px] font-bold px-1.5 py-0.5 rounded ${j.cvss_score>=9?"bg-red-500/20 text-red-400":j.cvss_score>=7?"bg-orange-500/20 text-orange-400":j.cvss_score>=4?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:j.cvss_score})]})]})]}),s.jsx(ts,{severity:j.severity})]})}),_.has(K)&&s.jsxs("div",{className:"px-3 pb-3 pt-0 space-y-3 border-t border-dark-700 overflow-hidden",children:[(j.cvss_score||j.cwe_id||j.owasp)&&s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[j.cvss_score&&s.jsxs("div",{className:"bg-dark-800 px-2 py-1 rounded text-xs",children:[s.jsx("span",{className:"text-dark-500",children:"CVSS:"})," ",s.jsx("span",{className:`font-bold ${j.cvss_score>=9?"text-red-400":j.cvss_score>=7?"text-orange-400":j.cvss_score>=4?"text-yellow-400":"text-blue-400"}`,children:j.cvss_score})]}),j.cwe_id&&s.jsxs("div",{className:"bg-dark-800 px-2 py-1 rounded text-xs",children:[s.jsx("span",{className:"text-dark-500",children:"CWE:"})," ",s.jsx("span",{className:"text-blue-400",children:j.cwe_id})]}),j.owasp&&s.jsxs("div",{className:"bg-dark-800 px-2 py-1 rounded text-xs",children:[s.jsx("span",{className:"text-dark-500",children:"OWASP:"})," ",s.jsx("span",{className:"text-yellow-400 truncate",children:j.owasp.split(" - ")[0]})]})]}),s.jsxs("div",{className:"mt-3",children:[s.jsx("p",{className:"text-[10px] text-dark-500 uppercase tracking-wider font-medium",children:"Type"}),s.jsx("p",{className:"text-sm text-dark-300 break-words",children:j.vulnerability_type})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-dark-500 uppercase tracking-wider font-medium",children:"Description"}),s.jsx("p",{className:"text-sm text-dark-300 break-words",children:j.description})]}),j.evidence&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-dark-500 uppercase tracking-wider font-medium",children:"Evidence"}),s.jsx("p",{className:"text-sm text-dark-300 font-mono bg-dark-800 p-2 rounded-lg text-xs overflow-x-auto break-all max-h-32 overflow-y-auto",children:j.evidence})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-dark-500 uppercase tracking-wider font-medium",children:"Remediation"}),s.jsx("p",{className:"text-sm text-green-400 break-words",children:j.remediation})]})]})]},K))})}),a&&((C=a.recon_data)==null?void 0:C.technologies)&&a.recon_data.technologies.length>0&&s.jsx(re,{title:"Technologies",className:"!p-4",children:s.jsx("div",{className:"flex flex-wrap gap-2",children:a.recon_data.technologies.map((j,K)=>s.jsx("span",{className:"px-2.5 py-1 text-xs bg-dark-800 text-dark-300 rounded-lg border border-dark-700",children:j},K))})})]})]})]})}function gw(){const[e,t]=x.useState([]),[n,r]=x.useState(new Map),[a,l]=x.useState(!0);x.useEffect(()=>{(async()=>{try{const[d,m]=await Promise.all([We.list(),At.list(1,100)]);t(d.reports);const f=new Map;m.scans.forEach(p=>f.set(p.id,p)),r(f)}catch(d){console.error("Failed to fetch reports:",d)}finally{l(!1)}})()},[]);const i=async c=>{if(confirm("Are you sure you want to delete this report?"))try{await We.delete(c),t(e.filter(d=>d.id!==c))}catch(d){console.error("Failed to delete report:",d)}},o=(c,d)=>{window.open(We.getDownloadUrl(c,d),"_blank")};return a?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-primary-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-white",children:"Reports"}),s.jsx("p",{className:"text-dark-400 mt-1",children:"View and download security assessment reports"})]})}),e.length===0?s.jsx(re,{children:s.jsxs("div",{className:"text-center py-12",children:[s.jsx(yt,{className:"w-16 h-16 mx-auto text-dark-500 mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Reports Yet"}),s.jsx("p",{className:"text-dark-400 mb-4",children:"Reports are generated after completing a security scan."}),s.jsx(nn,{to:"/scan/new",children:s.jsx(H,{children:"Start a New Scan"})})]})}):s.jsx("div",{className:"grid gap-4",children:e.map(c=>{const d=n.get(c.scan_id);return s.jsx(re,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"p-3 bg-primary-500/10 rounded-lg",children:s.jsx(yt,{className:"w-6 h-6 text-primary-500"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-white",children:c.title||(d==null?void 0:d.name)||"Security Report"}),s.jsxs("div",{className:"flex items-center gap-3 mt-1 text-sm text-dark-400",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(yo,{className:"w-4 h-4"}),new Date(c.generated_at).toLocaleDateString()]}),s.jsx("span",{className:"uppercase text-xs bg-dark-700 px-2 py-0.5 rounded",children:c.format}),d&&s.jsxs("span",{children:[d.total_vulnerabilities," vulnerabilities"]})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(H,{variant:"ghost",onClick:()=>window.open(We.getViewUrl(c.id),"_blank"),children:[s.jsx(ol,{className:"w-4 h-4 mr-2"}),"View"]}),s.jsxs(H,{variant:"secondary",onClick:()=>o(c.id,"html"),children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"HTML"]}),s.jsxs(H,{variant:"secondary",onClick:()=>o(c.id,"json"),children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"JSON"]}),s.jsx(H,{variant:"ghost",onClick:()=>i(c.id),className:"text-red-400 hover:text-red-300",children:s.jsx(Pt,{className:"w-4 h-4"})})]})]})},c.id)})})]})}function yw(){const{reportId:e}=bc(),t=Bn(),[n,r]=x.useState(!0);return x.useEffect(()=>{if(!e){t("/reports");return}r(!1)},[e]),n||!e?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-primary-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-4 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(H,{variant:"ghost",onClick:()=>t("/reports"),children:[s.jsx(Sg,{className:"w-4 h-4 mr-2"}),"Back to Reports"]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(H,{variant:"secondary",onClick:()=>window.open(We.getDownloadUrl(e,"html"),"_blank"),children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"Download HTML"]}),s.jsxs(H,{variant:"secondary",onClick:()=>window.open(We.getDownloadUrl(e,"json"),"_blank"),children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"Download JSON"]}),s.jsxs(H,{onClick:()=>window.open(We.getViewUrl(e),"_blank"),children:[s.jsx(An,{className:"w-4 h-4 mr-2"}),"Open in New Tab"]})]})]}),s.jsx("div",{className:"bg-dark-800 rounded-xl overflow-hidden border border-dark-900/50",children:s.jsx("iframe",{src:We.getViewUrl(e),className:"w-full h-[calc(100vh-200px)]",title:"Report"})})]})}function vw(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[a,l]=x.useState(""),[i,o]=x.useState(""),[c,d]=x.useState(""),[m,f]=x.useState("claude"),[p,N]=x.useState("3"),[v,w]=x.useState(""),[k,y]=x.useState(!1),[u,g]=x.useState(!1),[_,L]=x.useState(!1),[D,R]=x.useState(!1),[E,U]=x.useState(!1),[q,A]=x.useState(!1),[te,Q]=x.useState(!1),[ne,ae]=x.useState(null);x.useEffect(()=>{ce(),xe()},[]);const ce=async()=>{try{const V=await fetch("/api/v1/settings");if(V.ok){const G=await V.json();t(G),f(G.llm_provider),N(String(G.max_concurrent_scans)),y(G.aggressive_mode),g(G.enable_model_routing??!1),L(G.enable_knowledge_augmentation??!1),R(G.enable_browser_validation??!1),w(G.max_output_tokens?String(G.max_output_tokens):"")}}catch(V){console.error("Failed to fetch settings:",V)}},xe=async()=>{try{const V=await fetch("/api/v1/settings/stats");if(V.ok){const G=await V.json();r(G)}}catch(V){console.error("Failed to fetch db stats:",V)}},z=async()=>{U(!0),ae(null);try{const V=await fetch("/api/v1/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({llm_provider:m,anthropic_api_key:a||void 0,openai_api_key:i||void 0,openrouter_api_key:c||void 0,max_concurrent_scans:parseInt(p),aggressive_mode:k,enable_model_routing:u,enable_knowledge_augmentation:_,enable_browser_validation:D,max_output_tokens:v?parseInt(v):null})});if(V.ok){const G=await V.json();t(G),l(""),o(""),d(""),ae({type:"success",text:"Settings saved successfully!"})}else ae({type:"error",text:"Failed to save settings"})}catch{ae({type:"error",text:"Failed to save settings"})}finally{U(!1)}},Y=async()=>{A(!0),ae(null);try{const V=await fetch("/api/v1/settings/clear-database",{method:"POST"});if(V.ok)ae({type:"success",text:"Database cleared successfully!"}),Q(!1),xe();else{const G=await V.json();ae({type:"error",text:G.detail||"Failed to clear database"})}}catch{ae({type:"error",text:"Failed to clear database"})}finally{A(!1)}},se=({enabled:V,onToggle:G})=>s.jsx("button",{onClick:G,className:`w-12 h-6 rounded-full transition-colors ${V?"bg-primary-500":"bg-dark-700"}`,children:s.jsx("div",{className:`w-5 h-5 bg-white rounded-full shadow-md transform transition-transform ${V?"translate-x-6":"translate-x-0.5"}`})});return s.jsxs("div",{className:"max-w-2xl mx-auto space-y-6 animate-fadeIn",children:[ne&&s.jsx("div",{className:`p-4 rounded-lg ${ne.type==="success"?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:ne.text}),s.jsx(re,{title:"LLM Configuration",subtitle:"Configure AI model for vulnerability analysis",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-dark-200 mb-2",children:"LLM Provider"}),s.jsx("div",{className:"flex gap-2 flex-wrap",children:["claude","openai","openrouter","ollama"].map(V=>s.jsx(H,{variant:m===V?"primary":"secondary",onClick:()=>f(V),children:V==="openrouter"?"OpenRouter":V.charAt(0).toUpperCase()+V.slice(1)},V))})]}),m==="claude"&&s.jsx(st,{label:"Anthropic API Key",type:"password",placeholder:e!=null&&e.has_anthropic_key?"••••••••••••••••":"sk-ant-...",value:a,onChange:V=>l(V.target.value),helperText:e!=null&&e.has_anthropic_key?"API key is configured. Enter a new key to update.":"Required for Claude-powered analysis"}),m==="openai"&&s.jsx(st,{label:"OpenAI API Key",type:"password",placeholder:e!=null&&e.has_openai_key?"••••••••••••••••":"sk-...",value:i,onChange:V=>o(V.target.value),helperText:e!=null&&e.has_openai_key?"API key is configured. Enter a new key to update.":"Required for OpenAI-powered analysis"}),m==="openrouter"&&s.jsx(st,{label:"OpenRouter API Key",type:"password",placeholder:e!=null&&e.has_openrouter_key?"••••••••••••••••":"sk-or-...",value:c,onChange:V=>d(V.target.value),helperText:e!=null&&e.has_openrouter_key?"API key is configured. Enter a new key to update.":"Required for OpenRouter model access"}),s.jsx(st,{label:"Max Output Tokens",type:"number",min:"1024",max:"64000",placeholder:"Default (profile-based)",value:v,onChange:V=>w(V.target.value),helperText:"Override max output tokens (up to 64000 for Claude). Leave empty for profile defaults."})]})}),s.jsx(re,{title:"Advanced Features",subtitle:"Optional AI enhancement modules",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-dark-900/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Dg,{className:"w-5 h-5 text-blue-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-white",children:"Model Routing"}),s.jsx("p",{className:"text-sm text-dark-400",children:"Route tasks to specialized LLM profiles by type (reasoning, analysis, generation)"})]})]}),s.jsx(se,{enabled:u,onToggle:()=>g(!u)})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 bg-dark-900/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Mt,{className:"w-5 h-5 text-purple-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-white",children:"Knowledge Augmentation"}),s.jsx("p",{className:"text-sm text-dark-400",children:"Enrich AI context with bug bounty pattern datasets (19 vuln types)"})]})]}),s.jsx(se,{enabled:_,onToggle:()=>L(!_)})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 bg-dark-900/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ol,{className:"w-5 h-5 text-green-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-white",children:"Browser Validation"}),s.jsx("p",{className:"text-sm text-dark-400",children:"Playwright-based browser validation with screenshot capture"})]})]}),s.jsx(se,{enabled:D,onToggle:()=>R(!D)})]})]})}),s.jsx(re,{title:"Scan Settings",subtitle:"Configure default scan behavior",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(st,{label:"Max Concurrent Scans",type:"number",min:"1",max:"10",value:p,onChange:V=>N(V.target.value),helperText:"Maximum number of scans that can run simultaneously"}),s.jsxs("div",{className:"flex items-center justify-between p-4 bg-dark-900/50 rounded-lg",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-white",children:"Enable Aggressive Mode"}),s.jsx("p",{className:"text-sm text-dark-400",children:"Use more payloads and bypass techniques (may be slower)"})]}),s.jsx(se,{enabled:k,onToggle:()=>y(!k)})]})]})}),s.jsx(re,{title:"Database Management",subtitle:"Manage stored data",children:s.jsxs("div",{className:"space-y-4",children:[n&&s.jsxs("div",{className:"grid grid-cols-4 gap-4 p-4 bg-dark-900/50 rounded-lg",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:n.scans}),s.jsx("p",{className:"text-xs text-dark-400",children:"Scans"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:n.vulnerabilities}),s.jsx("p",{className:"text-xs text-dark-400",children:"Vulnerabilities"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:n.endpoints}),s.jsx("p",{className:"text-xs text-dark-400",children:"Endpoints"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:n.reports}),s.jsx("p",{className:"text-xs text-dark-400",children:"Reports"})]})]}),te?s.jsxs("div",{className:"p-4 bg-red-500/20 border border-red-500/50 rounded-lg space-y-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Oe,{className:"w-6 h-6 text-red-400 flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-red-400",children:"Are you sure?"}),s.jsx("p",{className:"text-sm text-dark-300 mt-1",children:"This will permanently delete all scans, vulnerabilities, endpoints, and reports. This action cannot be undone."})]})]}),s.jsxs("div",{className:"flex gap-3 justify-end",children:[s.jsx(H,{variant:"secondary",onClick:()=>Q(!1),children:"Cancel"}),s.jsxs(H,{variant:"danger",onClick:Y,isLoading:q,children:[s.jsx(Pt,{className:"w-4 h-4 mr-2"}),"Yes, Clear Everything"]})]})]}):s.jsxs("div",{className:"flex items-center justify-between p-4 bg-red-500/10 border border-red-500/30 rounded-lg",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-white",children:"Clear All Data"}),s.jsx("p",{className:"text-sm text-dark-400",children:"Remove all scans, vulnerabilities, and reports"})]}),s.jsxs(H,{variant:"danger",onClick:()=>Q(!0),children:[s.jsx(Pt,{className:"w-4 h-4 mr-2"}),"Clear Database"]})]}),s.jsxs(H,{variant:"secondary",onClick:xe,className:"w-full",children:[s.jsx(ln,{className:"w-4 h-4 mr-2"}),"Refresh Statistics"]})]})}),s.jsx(re,{title:"About NeuroSploit",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ke,{className:"w-8 h-8 text-primary-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-bold text-white text-lg",children:"NeuroSploit v3.0"}),s.jsx("p",{className:"text-sm text-dark-400",children:"AI-Powered Penetration Testing Platform"})]})]}),s.jsxs("div",{className:"text-sm text-dark-400 space-y-1",children:[s.jsx("p",{children:"Dynamic vulnerability testing driven by AI prompts"}),s.jsx("p",{children:"50+ vulnerability types across 10 categories"}),s.jsx("p",{children:"Multi-provider LLM support (Claude, GPT, OpenRouter, Ollama)"}),s.jsx("p",{children:"Task-type model routing and knowledge augmentation"}),s.jsx("p",{children:"Playwright browser validation with screenshot capture"}),s.jsx("p",{children:"OHVR-structured PoC reporting"}),s.jsx("p",{children:"Scheduled recurring scans with cron/interval triggers"})]})]})}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(H,{onClick:z,isLoading:E,size:"lg",children:[s.jsx(u0,{className:"w-5 h-5 mr-2"}),"Save Settings"]})})]})}const Cu=[{label:"Every Hour",value:"0 * * * *",desc:"Runs at the start of every hour"},{label:"Every 6 Hours",value:"0 */6 * * *",desc:"Runs every 6 hours"},{label:"Daily at 2 AM",value:"0 2 * * *",desc:"Runs once a day at 2:00 AM"},{label:"Daily at Midnight",value:"0 0 * * *",desc:"Runs once a day at midnight"},{label:"Weekdays at 9 AM",value:"0 9 * * 1-5",desc:"Monday to Friday at 9:00 AM"},{label:"Weekly (Monday)",value:"0 0 * * 1",desc:"Every Monday at midnight"},{label:"Weekly (Friday)",value:"0 18 * * 5",desc:"Every Friday at 6:00 PM"},{label:"Monthly (1st)",value:"0 0 1 * *",desc:"First day of each month"},{label:"Custom",value:"custom",desc:"Enter a custom cron expression"}],ww=[{id:"quick",label:"Quick",icon:Rl,desc:"Fast surface scan"},{id:"full",label:"Full",icon:Qr,desc:"Comprehensive analysis"},{id:"custom",label:"Custom",icon:zg,desc:"Custom configuration"}],Eu=[{id:0,short:"Sun",full:"Sunday"},{id:1,short:"Mon",full:"Monday"},{id:2,short:"Tue",full:"Tuesday"},{id:3,short:"Wed",full:"Wednesday"},{id:4,short:"Thu",full:"Thursday"},{id:5,short:"Fri",full:"Friday"},{id:6,short:"Sat",full:"Saturday"}];function jw(){var h;const[e,t]=x.useState([]),[n,r]=x.useState([]),[a,l]=x.useState(!0),[i,o]=x.useState(!1),[c,d]=x.useState(null),[m,f]=x.useState(null),[p,N]=x.useState(""),[v,w]=x.useState(""),[k,y]=x.useState("quick"),[u,g]=x.useState("preset"),[_,L]=x.useState("0 2 * * *"),[D,R]=x.useState(""),[E,U]=x.useState("60"),[q,A]=x.useState([1,2,3,4,5]),[te,Q]=x.useState("02"),[ne,ae]=x.useState("00"),[ce,xe]=x.useState(""),[z,Y]=x.useState(!1),[se,V]=x.useState(!1),G=x.useCallback(async()=>{l(!0);try{const[b,I]=await Promise.all([fs.list(),fs.getAgentRoles()]);t(b),r(I)}catch(b){console.error("Failed to fetch scheduler data:",b)}finally{l(!1)}},[]);x.useEffect(()=>{G()},[G]),x.useEffect(()=>{if(c){const b=setTimeout(()=>d(null),4e3);return()=>clearTimeout(b)}},[c]);const ge=()=>{if(u==="interval")return;if(u==="preset")return _==="custom"?D:_;if(q.length===0)return;const b=q.sort((I,O)=>I-O).join(",");return`${ne} ${te} * * ${b}`},he=()=>{if(u==="interval")return parseInt(E)||60},ke=async()=>{var O,J;if(!p.trim()){d({type:"error",text:"Job ID is required"});return}if(!v.trim()){d({type:"error",text:"Target URL is required"});return}const b=ge(),I=he();if(!b&&!I){d({type:"error",text:"Please configure a schedule (select days or set interval)"});return}V(!0),d(null);try{await fs.create({job_id:p.trim(),target:v.trim(),scan_type:k,cron_expression:b,interval_minutes:I,agent_role:ce||void 0}),d({type:"success",text:`Schedule "${p}" created successfully`}),o(!1),de(),G()}catch(C){const j=((J=(O=C==null?void 0:C.response)==null?void 0:O.data)==null?void 0:J.detail)||"Failed to create schedule";d({type:"error",text:j})}finally{V(!1)}},P=async b=>{try{await fs.delete(b),d({type:"success",text:`Schedule "${b}" deleted`}),f(null),G()}catch{d({type:"error",text:`Failed to delete "${b}"`})}},X=async b=>{try{await fs.pause(b),G()}catch{d({type:"error",text:`Failed to pause "${b}"`})}},M=async b=>{try{await fs.resume(b),G()}catch{d({type:"error",text:`Failed to resume "${b}"`})}},me=b=>{A(I=>I.includes(b)?I.filter(O=>O!==b):[...I,b])},de=()=>{N(""),w(""),y("quick"),g("preset"),L("0 2 * * *"),R(""),U("60"),A([1,2,3,4,5]),Q("02"),ae("00"),xe(""),Y(!1)},S=n.find(b=>b.id===ce);return s.jsxs("div",{className:"max-w-5xl mx-auto space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[s.jsx("div",{className:"p-2 bg-brand-500/20 rounded-lg",children:s.jsx(yo,{className:"w-6 h-6 text-brand-400"})}),"Scan Scheduler"]}),s.jsx("p",{className:"text-dark-400 mt-1 ml-14",children:"Schedule automated recurring scans with agent specialization"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(H,{variant:"secondary",onClick:G,children:[s.jsx(ln,{className:"w-4 h-4 mr-2"}),"Refresh"]}),s.jsxs(H,{onClick:()=>{o(!i),i&&de()},children:[s.jsx(Gt,{className:"w-4 h-4 mr-2"}),"New Schedule"]})]})]}),c&&s.jsxs("div",{className:`flex items-center gap-3 p-4 rounded-lg border transition-all ${c.type==="success"?"bg-green-500/10 border-green-500/30 text-green-400":"bg-red-500/10 border-red-500/30 text-red-400"}`,children:[c.type==="success"?s.jsx(Mn,{className:"w-5 h-5 flex-shrink-0"}):s.jsx(Oe,{className:"w-5 h-5 flex-shrink-0"}),s.jsx("span",{children:c.text})]}),i&&s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"p-5 border-b border-dark-700",children:[s.jsx("h3",{className:"text-lg font-semibold text-white",children:"Create New Schedule"}),s.jsx("p",{className:"text-dark-400 text-sm mt-1",children:"Configure a recurring scan with specialized agent roles"})]}),s.jsxs("div",{className:"p-5 space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(st,{label:"Job ID",placeholder:"daily-scan-prod",value:p,onChange:b=>N(b.target.value),helperText:"Unique identifier for this schedule"}),s.jsx(st,{label:"Target URL",placeholder:"https://example.com",value:v,onChange:b=>w(b.target.value),helperText:"URL to scan on each execution"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-dark-200 mb-3",children:"Scan Type"}),s.jsx("div",{className:"grid grid-cols-3 gap-3",children:ww.map(({id:b,label:I,icon:O,desc:J})=>s.jsxs("button",{onClick:()=>y(b),className:`p-4 rounded-lg border-2 text-left transition-all ${k===b?"border-brand-500 bg-brand-500/10":"border-dark-600 bg-dark-900/50 hover:border-dark-500"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(O,{className:`w-4 h-4 ${k===b?"text-brand-400":"text-dark-400"}`}),s.jsx("span",{className:`font-medium ${k===b?"text-white":"text-dark-300"}`,children:I})]}),s.jsx("p",{className:"text-xs text-dark-500",children:J})]},b))})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-dark-200 mb-3",children:[s.jsx(Ke,{className:"w-4 h-4 inline mr-1 -mt-0.5"}),"Agent Role"]}),s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>Y(!z),className:"w-full flex items-center justify-between p-3 rounded-lg border border-dark-600 bg-dark-900/50 hover:border-dark-500 transition-colors text-left",children:[s.jsx("div",{children:S?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-white font-medium",children:S.name}),s.jsxs("span",{className:"text-dark-500 text-sm ml-2",children:["- ",S.description]})]}):s.jsx("span",{className:"text-dark-500",children:"Select an agent role (optional)"})}),s.jsx(pt,{className:`w-4 h-4 text-dark-400 transition-transform ${z?"rotate-180":""}`})]}),z&&s.jsxs("div",{className:"absolute z-20 w-full mt-1 bg-dark-800 border border-dark-600 rounded-lg shadow-xl max-h-72 overflow-y-auto",children:[s.jsxs("button",{onClick:()=>{xe(""),Y(!1)},className:`w-full flex items-start gap-3 p-3 text-left hover:bg-dark-700/50 transition-colors border-b border-dark-700/50 ${ce?"":"bg-dark-700/30"}`,children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-dark-600 flex items-center justify-center flex-shrink-0 mt-0.5",children:s.jsx(Kt,{className:"w-4 h-4 text-dark-400"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-dark-300 font-medium",children:"Default Agent"}),s.jsx("p",{className:"text-dark-500 text-xs",children:"No specialization - uses general pentest agent"})]})]}),n.map(b=>s.jsxs("button",{onClick:()=>{xe(b.id),Y(!1)},className:`w-full flex items-start gap-3 p-3 text-left hover:bg-dark-700/50 transition-colors ${ce===b.id?"bg-brand-500/10 border-l-2 border-brand-500":""}`,children:[s.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5 ${ce===b.id?"bg-brand-500/20":"bg-dark-600"}`,children:s.jsx(Ke,{className:`w-4 h-4 ${ce===b.id?"text-brand-400":"text-dark-400"}`})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:`font-medium ${ce===b.id?"text-brand-400":"text-white"}`,children:b.name}),s.jsx("p",{className:"text-dark-500 text-xs mt-0.5",children:b.description}),b.tools.length>0&&s.jsxs("div",{className:"flex flex-wrap gap-1 mt-1.5",children:[b.tools.slice(0,4).map(I=>s.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-dark-600 text-dark-300 rounded",children:I},I)),b.tools.length>4&&s.jsxs("span",{className:"px-1.5 py-0.5 text-[10px] bg-dark-600 text-dark-400 rounded",children:["+",b.tools.length-4]})]})]})]},b.id))]})]})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-dark-200 mb-3",children:[s.jsx(Xt,{className:"w-4 h-4 inline mr-1 -mt-0.5"}),"Schedule"]}),s.jsx("div",{className:"flex gap-1 p-1 bg-dark-900/50 rounded-lg mb-4",children:[{id:"preset",label:"Presets"},{id:"days",label:"Days & Time"},{id:"interval",label:"Interval"}].map(b=>s.jsx("button",{onClick:()=>g(b.id),className:`flex-1 py-2 px-3 rounded-md text-sm font-medium transition-all ${u===b.id?"bg-brand-500 text-white shadow-sm":"text-dark-400 hover:text-dark-200"}`,children:b.label},b.id))}),u==="preset"&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"grid grid-cols-2 gap-2",children:Cu.map(b=>s.jsxs("button",{onClick:()=>L(b.value),className:`p-3 rounded-lg border text-left transition-all ${_===b.value?"border-brand-500 bg-brand-500/10":"border-dark-600 bg-dark-900/30 hover:border-dark-500"}`,children:[s.jsx("p",{className:`text-sm font-medium ${_===b.value?"text-brand-400":"text-dark-200"}`,children:b.label}),s.jsx("p",{className:"text-xs text-dark-500 mt-0.5",children:b.desc})]},b.value))}),_==="custom"&&s.jsx(st,{label:"Custom Cron Expression",placeholder:"*/30 * * * *",value:D,onChange:b=>R(b.target.value),helperText:"Format: minute hour day-of-month month day-of-week"})]}),u==="days"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400 mb-2",children:"Select days of the week"}),s.jsx("div",{className:"flex gap-2",children:Eu.map(b=>s.jsx("button",{onClick:()=>me(b.id),className:`flex-1 py-3 rounded-lg border-2 text-center text-sm font-medium transition-all ${q.includes(b.id)?"border-brand-500 bg-brand-500/15 text-brand-400":"border-dark-600 bg-dark-900/30 text-dark-400 hover:border-dark-500"}`,title:b.full,children:b.short},b.id))}),s.jsxs("div",{className:"flex gap-2 mt-2",children:[s.jsx("button",{onClick:()=>A([1,2,3,4,5]),className:"text-xs text-brand-400 hover:text-brand-300 transition-colors",children:"Weekdays"}),s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsx("button",{onClick:()=>A([0,6]),className:"text-xs text-brand-400 hover:text-brand-300 transition-colors",children:"Weekends"}),s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsx("button",{onClick:()=>A([0,1,2,3,4,5,6]),className:"text-xs text-brand-400 hover:text-brand-300 transition-colors",children:"Every Day"})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400 mb-2",children:"Execution Time"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("select",{value:te,onChange:b=>Q(b.target.value),className:"bg-dark-900 border border-dark-600 rounded-lg px-3 py-2.5 text-white text-sm focus:border-brand-500 focus:outline-none",children:Array.from({length:24},(b,I)=>s.jsx("option",{value:String(I).padStart(2,"0"),children:String(I).padStart(2,"0")},I))}),s.jsx("span",{className:"text-dark-400 text-lg font-bold",children:":"}),s.jsx("select",{value:ne,onChange:b=>ae(b.target.value),className:"bg-dark-900 border border-dark-600 rounded-lg px-3 py-2.5 text-white text-sm focus:border-brand-500 focus:outline-none",children:["00","15","30","45"].map(b=>s.jsx("option",{value:b,children:b},b))}),s.jsx("span",{className:"text-dark-500 text-sm ml-2",children:"UTC"})]})]}),q.length>0&&s.jsx("div",{className:"p-3 bg-dark-900/50 rounded-lg border border-dark-700/50",children:s.jsxs("p",{className:"text-xs text-dark-400",children:["Cron: ",s.jsx("code",{className:"text-brand-400 bg-dark-700 px-1.5 py-0.5 rounded",children:`${ne} ${te} * * ${q.sort((b,I)=>b-I).join(",")}`})]})})]}),u==="interval"&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"grid grid-cols-4 gap-2",children:[{label:"15 min",value:"15"},{label:"30 min",value:"30"},{label:"1 hour",value:"60"},{label:"2 hours",value:"120"},{label:"4 hours",value:"240"},{label:"6 hours",value:"360"},{label:"12 hours",value:"720"},{label:"24 hours",value:"1440"}].map(b=>s.jsx("button",{onClick:()=>U(b.value),className:`py-2.5 px-3 rounded-lg border text-sm font-medium transition-all ${E===b.value?"border-brand-500 bg-brand-500/10 text-brand-400":"border-dark-600 bg-dark-900/30 text-dark-400 hover:border-dark-500"}`,children:b.label},b.value))}),s.jsx(st,{label:"Custom interval (minutes)",type:"number",min:"1",value:E,onChange:b=>U(b.target.value),helperText:`Scan runs every ${parseInt(E)>=60?`${Math.floor(parseInt(E)/60)}h ${parseInt(E)%60}m`:`${E} minutes`}`})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-dark-700",children:[s.jsx("p",{className:"text-xs text-dark-500",children:u==="interval"?`Runs every ${parseInt(E)>=60?`${Math.floor(parseInt(E)/60)} hour(s)`:`${E} min`}`:u==="days"&&q.length>0?`Runs on ${q.sort((b,I)=>b-I).map(b=>Eu[b].short).join(", ")} at ${te}:${ne}`:u==="preset"&&_!=="custom"&&((h=Cu.find(b=>b.value===_))==null?void 0:h.desc)||""}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(H,{variant:"secondary",onClick:()=>{o(!1),de()},children:"Cancel"}),s.jsxs(H,{onClick:ke,isLoading:se,children:[s.jsx(Gt,{className:"w-4 h-4 mr-2"}),"Create Schedule"]})]})]})]})]}),e.length>0&&s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"bg-dark-800/50 border border-dark-700/50 rounded-lg p-4",children:[s.jsx("p",{className:"text-dark-400 text-sm",children:"Total Schedules"}),s.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:e.length})]}),s.jsxs("div",{className:"bg-dark-800/50 border border-dark-700/50 rounded-lg p-4",children:[s.jsx("p",{className:"text-dark-400 text-sm",children:"Active"}),s.jsx("p",{className:"text-2xl font-bold text-green-400 mt-1",children:e.filter(b=>b.status==="active").length})]}),s.jsxs("div",{className:"bg-dark-800/50 border border-dark-700/50 rounded-lg p-4",children:[s.jsx("p",{className:"text-dark-400 text-sm",children:"Total Runs"}),s.jsx("p",{className:"text-2xl font-bold text-brand-400 mt-1",children:e.reduce((b,I)=>b+I.run_count,0)})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center justify-between mb-4",children:s.jsxs("h3",{className:"text-lg font-semibold text-white",children:["Scheduled Jobs",s.jsxs("span",{className:"text-dark-500 text-sm font-normal ml-2",children:[e.length," job",e.length!==1?"s":""]})]})}),a?s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsx(ln,{className:"w-6 h-6 text-dark-400 animate-spin"})}):e.length===0?s.jsx(re,{children:s.jsxs("div",{className:"text-center py-16",children:[s.jsx("div",{className:"w-16 h-16 bg-dark-700/50 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(yo,{className:"w-8 h-8 text-dark-500"})}),s.jsx("p",{className:"text-dark-300 font-medium",children:"No scheduled jobs yet"}),s.jsx("p",{className:"text-dark-500 text-sm mt-1 mb-4",children:"Create a schedule to run automated recurring scans"}),s.jsxs(H,{onClick:()=>o(!0),children:[s.jsx(Gt,{className:"w-4 h-4 mr-2"}),"Create First Schedule"]})]})}):s.jsx("div",{className:"space-y-3",children:e.map(b=>s.jsx("div",{className:"bg-dark-800 border border-dark-700/50 rounded-xl p-5 hover:border-dark-600 transition-colors",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0 ${b.status==="active"?"bg-green-500/15":"bg-yellow-500/15"}`,children:b.status==="active"?s.jsx(Yt,{className:"w-5 h-5 text-green-400"}):s.jsx(cl,{className:"w-5 h-5 text-yellow-400"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("p",{className:"font-semibold text-white text-lg",children:b.id}),s.jsx("span",{className:`px-2.5 py-0.5 text-xs rounded-full font-medium ${b.status==="active"?"bg-green-500/15 text-green-400 border border-green-500/30":"bg-yellow-500/15 text-yellow-400 border border-yellow-500/30"}`,children:b.status}),s.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-dark-700 text-dark-300",children:b.scan_type}),b.agent_role&&s.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-brand-500/15 text-brand-400 border border-brand-500/30",children:b.agent_role.replace(/_/g," ")})]}),s.jsxs("div",{className:"flex items-center gap-4 mt-2 text-sm text-dark-400",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Kt,{className:"w-3.5 h-3.5"}),b.target]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Xt,{className:"w-3.5 h-3.5"}),b.schedule]}),b.run_count>0&&s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(ln,{className:"w-3.5 h-3.5"}),b.run_count," run",b.run_count!==1?"s":""]})]}),(b.next_run||b.last_run)&&s.jsxs("div",{className:"flex items-center gap-4 mt-1.5 text-xs text-dark-500",children:[b.next_run&&s.jsxs("span",{children:["Next: ",new Date(b.next_run).toLocaleString()]}),b.last_run&&s.jsxs("span",{children:["Last: ",new Date(b.last_run).toLocaleString()]})]})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[b.status==="active"?s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>X(b.id),title:"Pause schedule",children:s.jsx(cl,{className:"w-4 h-4 text-yellow-400"})}):s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>M(b.id),title:"Resume schedule",children:s.jsx(Yt,{className:"w-4 h-4 text-green-400"})}),m===b.id?s.jsxs("div",{className:"flex items-center gap-1 ml-2",children:[s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>P(b.id),children:s.jsx("span",{className:"text-red-400 text-xs font-medium",children:"Confirm"})}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>f(null),children:s.jsx("span",{className:"text-dark-400 text-xs",children:"Cancel"})})]}):s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>f(b.id),title:"Delete schedule",children:s.jsx(Pt,{className:"w-4 h-4 text-red-400"})})]})]})},b.id))})]})]})}const kw=[{key:"parallel",label:"Parallel Streams",icon:$g,range:[0,50]},{key:"deep",label:"Deep Analysis",icon:Mt,range:[50,75]},{key:"final",label:"Finalization",icon:Ke,range:[75,100]}],bw=[{key:"recon",label:"Recon",icon:pn,color:"blue",activeUntil:25},{key:"junior",label:"Junior AI",icon:Mt,color:"purple",activeUntil:35},{key:"tools",label:"Tools",icon:vr,color:"orange",activeUntil:50}],Nw={blue:{bg:"bg-blue-500/20",text:"text-blue-400",border:"border-blue-500/40",pulse:"bg-blue-400"},purple:{bg:"bg-purple-500/20",text:"text-purple-400",border:"border-purple-500/40",pulse:"bg-purple-400"},orange:{bg:"bg-orange-500/20",text:"text-orange-400",border:"border-orange-500/40",pulse:"bg-orange-400"}};function Sw(e){return e<50?0:e<75?1:2}function _w({stream:e,progress:t,isRunning:n}){const r=n&&t<e.activeUntil,a=t>=e.activeUntil,l=Nw[e.color],i=e.icon;return s.jsxs("div",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full border text-xs font-medium transition-all duration-300 ${r?`${l.bg} ${l.text} ${l.border}`:a?"bg-dark-700/50 text-dark-400 border-dark-600":"bg-dark-900 text-dark-500 border-dark-700"}`,children:[r&&s.jsxs("span",{className:"relative flex h-2 w-2",children:[s.jsx("span",{className:`animate-ping absolute inline-flex h-full w-full rounded-full ${l.pulse} opacity-75`}),s.jsx("span",{className:`relative inline-flex rounded-full h-2 w-2 ${l.pulse}`})]}),a&&s.jsx(Mn,{className:"w-3 h-3 text-green-500"}),!r&&!a&&s.jsx(i,{className:"w-3 h-3"}),s.jsx("span",{children:e.label})]})}function Ru(e){return e.startsWith("[STREAM 1]")?"text-blue-400":e.startsWith("[STREAM 2]")?"text-purple-400":e.startsWith("[STREAM 3]")?"text-orange-400":e.startsWith("[TOOL]")?"text-orange-300":e.startsWith("[DEEP]")?"text-cyan-400":e.startsWith("[FINAL]")?"text-green-400":""}const Tu={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-blue-500",info:"bg-gray-500"},Cw={critical:"border-red-500/40",high:"border-orange-500/40",medium:"border-yellow-500/40",low:"border-blue-500/40",info:"border-gray-500/40"};function Pu(e){let t=null;if(typeof e.confidence_score=="number")t=e.confidence_score;else if(e.confidence){const a=Number(e.confidence);isNaN(a)?t={high:90,medium:60,low:30}[e.confidence.toLowerCase()]??null:t=a}if(t===null)return null;const n=t>=90?"green":t>=60?"yellow":"red",r=t>=90?"Confirmed":t>=60?"Likely":"Low";return{score:t,color:n,label:r}}const Lu={green:"bg-green-500/15 text-green-400 border-green-500/30",yellow:"bg-yellow-500/15 text-yellow-400 border-yellow-500/30",red:"bg-red-500/15 text-red-400 border-red-500/30"},wi="neurosploit_autopentest_session";function Ew(){const e=Bn(),[t,n]=x.useState(""),[r,a]=x.useState(!1),[l,i]=x.useState(""),[o,c]=x.useState(!1),[d,m]=x.useState(!1),[f,p]=x.useState(""),[N,v]=x.useState(""),[w,k]=x.useState(!1),[y,u]=x.useState(""),[g,_]=x.useState(!1),[L,D]=x.useState(null),[R,E]=x.useState(null),[U,q]=x.useState(null),[A,te]=x.useState(!0),[Q,ne]=x.useState(!1),[ae,ce]=x.useState([]),[xe,z]=x.useState(null),[Y,se]=x.useState(!1),[V,G]=x.useState(null),ge=x.useRef(null),he=x.useRef(null);x.useEffect(()=>{try{const C=localStorage.getItem(wi);if(C){const j=JSON.parse(C);D(j.agentId),n(j.target),_(!0)}}catch{}},[]),x.useEffect(()=>{if(L&&g){const C={agentId:L,target:t||"",startedAt:new Date().toISOString()};localStorage.setItem(wi,JSON.stringify(C))}},[L,g,t]),x.useEffect(()=>{if(!L)return;const C=async()=>{try{const j=await we.getStatus(L);E(j),(j.status==="completed"||j.status==="error"||j.status==="stopped")&&(_(!1),ge.current&&clearInterval(ge.current))}catch{}try{const j=await we.getLogs(L,200);ce(j.logs||[])}catch{}};return C(),ge.current=setInterval(C,3e3),()=>{ge.current&&clearInterval(ge.current)}},[L]),x.useEffect(()=>{Q&&he.current&&he.current.scrollIntoView({behavior:"smooth"})},[ae,Q]);const ke=async()=>{var j,K;const C=t.trim();if(C){q(null),_(!0),E(null),ce([]),G(null);try{const F=r?l.split(`
|
||
`).map(pe=>pe.trim()).filter(Boolean):void 0,ie=await we.autoPentest(C,{subdomain_discovery:o,targets:F,auth_type:f||void 0,auth_value:N||void 0,prompt:y.trim()||void 0});D(ie.agent_id)}catch(F){q(((K=(j=F==null?void 0:F.response)==null?void 0:j.data)==null?void 0:K.detail)||(F==null?void 0:F.message)||"Failed to start pentest"),_(!1)}}},P=async()=>{if(L)try{await we.stop(L),_(!1)}catch{}},X=()=>{localStorage.removeItem(wi),D(null),E(null),ce([]),_(!1),q(null),G(null),n("")},M=x.useCallback(async()=>{var C,j;if(R!=null&&R.scan_id){se(!0);try{const K=await We.generateAiReport({scan_id:R.scan_id,title:`AI Pentest Report - ${t}`});G(K.id)}catch(K){q(((j=(C=K==null?void 0:K.response)==null?void 0:C.data)==null?void 0:j.detail)||"Failed to generate AI report")}finally{se(!1)}}},[R==null?void 0:R.scan_id,t]),me=R?Sw(R.progress):-1,de=(R==null?void 0:R.findings)||[],S=(R==null?void 0:R.rejected_findings)||[],h=[...de,...S],[b,I]=x.useState("all"),O=b==="confirmed"?de:b==="rejected"?S:h,J=de.reduce((C,j)=>(C[j.severity]=(C[j.severity]||0)+1,C),{});return s.jsxs("div",{className:"min-h-screen flex flex-col items-center py-12 px-4",children:[s.jsxs("div",{className:"text-center mb-10",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-green-500/20 rounded-2xl mb-4",children:s.jsx(wo,{className:"w-8 h-8 text-green-400"})}),s.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:"Auto Pentest"}),s.jsx("p",{className:"text-dark-400 max-w-md",children:"One-click comprehensive penetration test. 100 vulnerability types, AI-powered analysis, full report."})]}),!L&&s.jsxs("div",{className:"w-full max-w-2xl bg-dark-800 border border-dark-700 rounded-2xl p-8",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Target URL"}),s.jsx("input",{type:"url",value:t,onChange:C=>n(C.target.value),placeholder:"https://example.com",disabled:g,className:"w-full px-4 py-4 bg-dark-900 border border-dark-600 rounded-xl text-white text-lg placeholder-dark-500 focus:outline-none focus:border-green-500 focus:ring-1 focus:ring-green-500 disabled:opacity-50"})]}),s.jsxs("div",{className:"flex flex-wrap gap-4 mb-6",children:[s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:o,onChange:C=>c(C.target.checked),disabled:g,className:"w-4 h-4 rounded bg-dark-900 border-dark-600 text-green-500 focus:ring-green-500"}),s.jsx("span",{className:"text-sm text-dark-300",children:"Subdomain Discovery"})]}),s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:r,onChange:C=>a(C.target.checked),disabled:g,className:"w-4 h-4 rounded bg-dark-900 border-dark-600 text-green-500 focus:ring-green-500"}),s.jsx("span",{className:"text-sm text-dark-300",children:"Multiple Targets"})]})]}),r&&s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Additional Targets (one per line)"}),s.jsx("textarea",{value:l,onChange:C=>i(C.target.value),rows:4,disabled:g,placeholder:`https://api.example.com
|
||
https://admin.example.com`,className:"w-full px-4 py-3 bg-dark-900 border border-dark-600 rounded-xl text-white placeholder-dark-500 focus:outline-none focus:border-green-500 disabled:opacity-50"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("button",{onClick:()=>m(!d),disabled:g,className:"flex items-center gap-2 text-sm text-dark-400 hover:text-white transition-colors disabled:opacity-50",children:[s.jsx(c0,{className:"w-4 h-4"}),s.jsx("span",{children:"Authentication (Optional)"}),d?s.jsx(Zn,{className:"w-4 h-4"}):s.jsx(pt,{className:"w-4 h-4"})]}),d&&s.jsxs("div",{className:"mt-3 space-y-3 pl-6",children:[s.jsxs("select",{value:f,onChange:C=>p(C.target.value),disabled:g,className:"w-full px-3 py-2 bg-dark-900 border border-dark-600 rounded-lg text-white text-sm focus:outline-none focus:border-green-500",children:[s.jsx("option",{value:"",children:"No Authentication"}),s.jsx("option",{value:"bearer",children:"Bearer Token"}),s.jsx("option",{value:"cookie",children:"Cookie"}),s.jsx("option",{value:"basic",children:"Basic Auth (user:pass)"}),s.jsx("option",{value:"header",children:"Custom Header (Name:Value)"})]}),f&&s.jsx("input",{type:"text",value:N,onChange:C=>v(C.target.value),disabled:g,placeholder:f==="bearer"?"eyJhbGciOiJIUzI1NiIs...":f==="cookie"?"session=abc123; token=xyz":f==="basic"?"admin:password123":"X-API-Key:your-api-key",className:"w-full px-3 py-2 bg-dark-900 border border-dark-600 rounded-lg text-white text-sm placeholder-dark-500 focus:outline-none focus:border-green-500"})]})]}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("button",{onClick:()=>k(!w),disabled:g,className:"flex items-center gap-2 text-sm text-dark-400 hover:text-white transition-colors disabled:opacity-50",children:[s.jsx(d0,{className:"w-4 h-4"}),s.jsx("span",{children:"Custom AI Prompt (Optional)"}),w?s.jsx(Zn,{className:"w-4 h-4"}):s.jsx(pt,{className:"w-4 h-4"})]}),w&&s.jsxs("div",{className:"mt-3 pl-6",children:[s.jsx("textarea",{value:y,onChange:C=>u(C.target.value),rows:4,disabled:g,placeholder:`Focus on authentication bypass and IDOR vulnerabilities.
|
||
The app uses JWT tokens in localStorage.
|
||
Admin panel at /admin requires role=admin cookie.`,className:"w-full px-4 py-3 bg-dark-900 border border-dark-600 rounded-xl text-white text-sm placeholder-dark-500 focus:outline-none focus:border-green-500 disabled:opacity-50"}),s.jsx("p",{className:"mt-1 text-xs text-dark-500",children:"Guide the AI agent with additional context, focus areas, or specific instructions."})]})]}),U&&s.jsxs("div",{className:"mb-6 p-3 bg-red-500/10 border border-red-500/20 rounded-lg flex items-center gap-2",children:[s.jsx(Oe,{className:"w-5 h-5 text-red-400"}),s.jsx("span",{className:"text-red-400 text-sm",children:U})]}),s.jsxs("button",{onClick:ke,disabled:!t.trim(),className:"w-full py-4 bg-green-500 hover:bg-green-600 disabled:bg-dark-600 disabled:text-dark-400 text-white font-bold text-lg rounded-xl transition-colors flex items-center justify-center gap-3",children:[s.jsx(wo,{className:"w-6 h-6"}),"START PENTEST"]})]}),L&&s.jsxs("div",{className:"w-full max-w-4xl",children:[s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-6 mb-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`w-3 h-3 rounded-full ${g?"bg-green-500 animate-pulse":(R==null?void 0:R.status)==="completed"?"bg-green-500":(R==null?void 0:R.status)==="error"?"bg-red-500":"bg-gray-500"}`}),s.jsx("h3",{className:"text-white font-semibold",children:g?"Pentest Running":(R==null?void 0:R.status)==="completed"?"Pentest Complete":(R==null?void 0:R.status)==="error"?"Pentest Failed":"Pentest Stopped"}),s.jsx("span",{className:"text-dark-400 text-sm",children:t})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[g&&s.jsxs("button",{onClick:P,className:"px-4 py-1.5 bg-red-500/20 hover:bg-red-500/30 text-red-400 rounded-lg text-sm transition-colors flex items-center gap-1.5",children:[s.jsx(Sc,{className:"w-4 h-4"})," Stop"]}),!g&&s.jsxs("button",{onClick:X,className:"px-4 py-1.5 bg-dark-700 hover:bg-dark-600 text-dark-300 rounded-lg text-sm transition-colors flex items-center gap-1.5",children:[s.jsx(Pt,{className:"w-4 h-4"})," Clear Session"]})]})]}),R&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between text-sm mb-2",children:[s.jsx("span",{className:"text-dark-400",children:R.phase||"Initializing..."}),s.jsxs("span",{className:"text-dark-400",children:[R.progress,"%"]})]}),s.jsx("div",{className:"w-full bg-dark-900 rounded-full h-2 mb-4",children:s.jsx("div",{className:"bg-green-500 h-2 rounded-full transition-all duration-500",style:{width:`${R.progress}%`}})}),s.jsx("div",{className:"grid grid-cols-3 gap-3",children:kw.map((C,j)=>{const K=C.icon,F=j===me&&g,ie=j<me||R.status==="completed";return s.jsxs("div",{className:`rounded-xl p-3 border transition-all duration-300 ${F?"bg-green-500/10 border-green-500/30":ie?"bg-dark-700/50 border-dark-600":"bg-dark-900 border-dark-700"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[F?s.jsx(qt,{className:"w-4 h-4 animate-spin text-green-400 flex-shrink-0"}):ie?s.jsx(Mn,{className:"w-4 h-4 text-green-500 flex-shrink-0"}):s.jsx(K,{className:`w-4 h-4 flex-shrink-0 ${F?"text-green-400":"text-dark-500"}`}),s.jsx("span",{className:`text-xs font-medium ${F?"text-green-400":ie?"text-dark-300":"text-dark-500"}`,children:C.label}),s.jsxs("span",{className:`ml-auto text-[10px] ${F?"text-green-500/60":ie?"text-dark-500":"text-dark-600"}`,children:[C.range[0],"-",C.range[1],"%"]})]}),j===0&&s.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:bw.map(pe=>s.jsx(_w,{stream:pe,progress:R.progress,isRunning:g},pe.key))})]},C.key)})})]})]}),de.length>0&&s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-6 mb-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("h3",{className:"text-white font-semibold",children:["Findings (",de.length,")"]}),s.jsx("div",{className:"flex gap-2",children:["critical","high","medium","low","info"].map(C=>{const j=J[C]||0;return j===0?null:s.jsx("span",{className:`${Tu[C]} text-white px-2 py-0.5 rounded-full text-xs font-bold`,children:j},C)})})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:()=>{te(!0),ne(!1)},className:`px-3 py-1 rounded-lg text-xs transition-colors ${A?"bg-primary-500 text-white":"bg-dark-700 text-dark-400 hover:text-white"}`,children:[s.jsx(Eg,{className:"w-3 h-3 inline mr-1"}),"Findings (",de.length,")"]}),S.length>0&&s.jsxs("button",{onClick:()=>{te(!0),ne(!1),I(b==="rejected"?"all":"rejected")},className:`px-3 py-1 rounded-lg text-xs transition-colors ${b==="rejected"&&A?"bg-orange-500/30 text-orange-400":"bg-dark-700 text-orange-400/60 hover:text-orange-400"}`,children:[s.jsx(Oe,{className:"w-3 h-3 inline mr-1"}),"Rejected (",S.length,")"]}),s.jsxs("button",{onClick:()=>{ne(!0),te(!1)},className:`px-3 py-1 rounded-lg text-xs transition-colors ${Q?"bg-primary-500 text-white":"bg-dark-700 text-dark-400 hover:text-white"}`,children:[s.jsx(Zd,{className:"w-3 h-3 inline mr-1"}),"Activity Log"]})]})]}),A&&h.length>0&&S.length>0&&s.jsx("div",{className:"flex gap-1 mb-2",children:["all","confirmed","rejected"].map(C=>s.jsx("button",{onClick:()=>I(C),className:`px-2 py-0.5 rounded-full text-xs transition-colors ${b===C?"bg-primary-500/20 text-primary-400":"text-dark-500 hover:text-dark-300"}`,children:C==="all"?`All (${h.length})`:C==="confirmed"?`Confirmed (${de.length})`:`Rejected (${S.length})`},C))}),A&&s.jsx("div",{className:"space-y-2 max-h-[500px] overflow-y-auto pr-1",children:O.map(C=>s.jsxs("div",{className:`border ${C.ai_status==="rejected"?"border-orange-500/30 opacity-70":Cw[C.severity]||"border-dark-600"} rounded-xl bg-dark-900 overflow-hidden`,children:[s.jsxs("button",{onClick:()=>z(xe===C.id?null:C.id),className:"w-full flex items-center gap-3 p-3 text-left hover:bg-dark-800/50 transition-colors",children:[s.jsx("span",{className:`${Tu[C.severity]} text-white px-2 py-0.5 rounded text-xs font-bold uppercase flex-shrink-0`,children:C.severity}),s.jsx("span",{className:`text-sm flex-1 truncate ${C.ai_status==="rejected"?"text-dark-400":"text-white"}`,children:C.title}),C.ai_status==="rejected"&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-orange-500/20 text-orange-400 flex-shrink-0",children:"Rejected"}),(()=>{const j=Pu(C);return j?s.jsxs("span",{className:`text-xs font-semibold px-1.5 py-0.5 rounded-full border flex-shrink-0 ${Lu[j.color]}`,children:[j.score,"/100"]}):null})(),s.jsx("span",{className:"text-dark-500 text-xs flex-shrink-0",children:C.vulnerability_type}),xe===C.id?s.jsx(Zn,{className:"w-4 h-4 text-dark-400"}):s.jsx(pt,{className:"w-4 h-4 text-dark-400"})]}),xe===C.id&&s.jsxs("div",{className:"px-3 pb-3 space-y-2 border-t border-dark-700 pt-2",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[C.affected_endpoint&&s.jsxs("div",{children:[s.jsx("span",{className:"text-dark-500",children:"Endpoint: "}),s.jsx("span",{className:"text-dark-300 break-all",children:C.affected_endpoint})]}),C.parameter&&s.jsxs("div",{children:[s.jsx("span",{className:"text-dark-500",children:"Parameter: "}),s.jsx("span",{className:"text-dark-300",children:C.parameter})]}),C.cwe_id&&s.jsxs("div",{children:[s.jsx("span",{className:"text-dark-500",children:"CWE: "}),s.jsx("span",{className:"text-dark-300",children:C.cwe_id})]}),C.cvss_score>0&&s.jsxs("div",{children:[s.jsx("span",{className:"text-dark-500",children:"CVSS: "}),s.jsx("span",{className:"text-dark-300",children:C.cvss_score})]})]}),C.description&&s.jsxs("p",{className:"text-dark-400 text-xs",children:[C.description.substring(0,300),C.description.length>300?"...":""]}),C.payload&&s.jsxs("div",{className:"bg-dark-800 rounded-lg p-2",children:[s.jsx("span",{className:"text-dark-500 text-xs",children:"Payload: "}),s.jsx("code",{className:"text-green-400 text-xs break-all",children:C.payload.substring(0,200)})]}),C.evidence&&s.jsxs("div",{className:"bg-dark-800 rounded-lg p-2",children:[s.jsx("span",{className:"text-dark-500 text-xs",children:"Evidence: "}),s.jsx("span",{className:"text-dark-300 text-xs",children:C.evidence.substring(0,300)})]}),C.poc_code&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"text-xs font-medium text-dark-400 mb-1",children:"PoC Code"}),s.jsx("pre",{className:"p-2 bg-dark-950 rounded text-xs text-green-400 overflow-x-auto max-h-[300px] overflow-y-auto whitespace-pre-wrap",children:C.poc_code})]}),C.ai_status==="rejected"&&C.rejection_reason&&s.jsxs("div",{className:"bg-orange-500/10 border border-orange-500/20 rounded-lg p-2",children:[s.jsx("span",{className:"text-orange-400 text-xs font-medium",children:"Rejection: "}),s.jsx("span",{className:"text-orange-300/80 text-xs",children:C.rejection_reason})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:`text-xs ${C.ai_status==="rejected"?"text-orange-400":C.ai_verified?"text-green-400":"text-dark-500"}`,children:C.ai_status==="rejected"?"AI Rejected":C.ai_verified?"AI Verified":"Tool Detected"}),(()=>{const j=Pu(C);return j?s.jsxs("span",{className:`text-xs font-semibold px-1.5 py-0.5 rounded-full border ${Lu[j.color]}`,children:["Confidence: ",j.score,"/100 (",j.label,")"]}):null})()]}),(()=>{const j=C.confidence_breakdown&&Object.keys(C.confidence_breakdown).length>0,K=!!C.proof_of_execution,F=!!C.negative_controls;return!j&&!K&&!F?null:s.jsxs("div",{className:"bg-dark-800 rounded-lg p-2 space-y-1",children:[j&&s.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-0.5 text-xs text-dark-400",children:Object.entries(C.confidence_breakdown).map(([ie,pe])=>s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"capitalize",children:ie.replace(/_/g," ")}),s.jsxs("span",{className:`font-mono font-medium ${Number(pe)>0?"text-green-400":Number(pe)<0?"text-red-400":"text-dark-500"}`,children:[Number(pe)>0?"+":"",pe]})]},ie))}),K&&s.jsxs("p",{className:"text-xs text-dark-400 flex items-start gap-1",children:[s.jsx("span",{className:"text-green-400",children:"✓"}),s.jsxs("span",{children:["Proof: ",s.jsx("span",{className:"text-dark-300",children:C.proof_of_execution})]})]}),F&&s.jsxs("p",{className:"text-xs text-dark-400 flex items-start gap-1",children:[s.jsx("span",{className:"text-blue-400",children:"■"}),s.jsxs("span",{children:["Controls: ",s.jsx("span",{className:"text-dark-300",children:C.negative_controls})]})]})]})})()]})]},C.id))}),Q&&s.jsxs("div",{className:"bg-dark-900 rounded-xl p-3 max-h-[500px] overflow-y-auto font-mono text-xs",children:[ae.length===0?s.jsx("p",{className:"text-dark-500 text-center py-4",children:"No logs yet..."}):ae.map((C,j)=>s.jsxs("div",{className:"flex gap-2 py-0.5",children:[s.jsx("span",{className:"text-dark-600 flex-shrink-0",children:C.time||""}),s.jsx("span",{className:`flex-shrink-0 uppercase w-12 ${C.level==="error"?"text-red-400":C.level==="warning"?"text-yellow-400":C.level==="info"?"text-blue-400":"text-dark-500"}`,children:C.level}),s.jsx("span",{className:Ru(C.message)||(C.source==="llm"?"text-purple-400":"text-dark-300"),children:C.message})]},j)),s.jsx("div",{ref:he})]})]}),de.length===0&&g&&s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-6 mb-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-white font-semibold",children:"Activity"}),s.jsxs("button",{onClick:()=>ne(!Q),className:`px-3 py-1 rounded-lg text-xs transition-colors ${Q?"bg-primary-500 text-white":"bg-dark-700 text-dark-400 hover:text-white"}`,children:[s.jsx(Zd,{className:"w-3 h-3 inline mr-1"}),Q?"Hide":"Show"," Logs"]})]}),Q?s.jsxs("div",{className:"bg-dark-900 rounded-xl p-3 max-h-[400px] overflow-y-auto font-mono text-xs",children:[ae.length===0?s.jsxs("div",{className:"flex items-center justify-center py-4 text-dark-500",children:[s.jsx(qt,{className:"w-4 h-4 animate-spin mr-2"})," Waiting for logs..."]}):ae.map((C,j)=>s.jsxs("div",{className:"flex gap-2 py-0.5",children:[s.jsx("span",{className:"text-dark-600 flex-shrink-0",children:C.time||""}),s.jsx("span",{className:`flex-shrink-0 uppercase w-12 ${C.level==="error"?"text-red-400":C.level==="warning"?"text-yellow-400":C.level==="info"?"text-blue-400":"text-dark-500"}`,children:C.level}),s.jsx("span",{className:Ru(C.message)||(C.source==="llm"?"text-purple-400":"text-dark-300"),children:C.message})]},j)),s.jsx("div",{ref:he})]}):s.jsxs("div",{className:"flex items-center justify-center py-6 text-dark-500",children:[s.jsx(qt,{className:"w-5 h-5 animate-spin mr-2"}),"Scanning in progress... Findings will appear here as they are discovered."]})]}),(R==null?void 0:R.status)==="completed"&&s.jsxs("div",{className:"bg-dark-800 border border-green-500/30 rounded-2xl p-6 mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(Mn,{className:"w-6 h-6 text-green-500"}),s.jsx("h3",{className:"text-green-400 font-semibold text-lg",children:"Pentest Complete"})]}),s.jsxs("p",{className:"text-dark-400 mb-4",children:["Found ",de.length," vulnerabilities across ",t,"."]}),Y&&s.jsxs("div",{className:"mb-4 p-4 bg-purple-500/10 border border-purple-500/20 rounded-xl flex items-center gap-3",children:[s.jsx(qt,{className:"w-5 h-5 text-purple-400 animate-spin"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-purple-400 font-medium text-sm",children:"Generating AI Report..."}),s.jsx("p",{className:"text-dark-400 text-xs",children:"The AI is analyzing findings and writing the executive summary."})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-3",children:[s.jsxs("button",{onClick:()=>e(`/agent/${L}`),className:"px-5 py-2 bg-primary-500 hover:bg-primary-600 text-white rounded-lg transition-colors flex items-center gap-2 text-sm",children:[s.jsx(An,{className:"w-4 h-4"})," View Full Results"]}),V?s.jsxs(s.Fragment,{children:[s.jsxs("a",{href:We.getViewUrl(V),target:"_blank",rel:"noopener noreferrer",className:"px-5 py-2 bg-green-500 hover:bg-green-600 text-white rounded-lg transition-colors flex items-center gap-2 text-sm",children:[s.jsx(yt,{className:"w-4 h-4"})," View Report"]}),s.jsxs("a",{href:We.getDownloadZipUrl(V),className:"px-5 py-2 bg-dark-700 hover:bg-dark-600 text-white rounded-lg transition-colors flex items-center gap-2 text-sm",children:[s.jsx(os,{className:"w-4 h-4"})," Download ZIP"]})]}):s.jsxs("button",{onClick:M,disabled:Y||!R.scan_id,className:"px-5 py-2 bg-purple-500 hover:bg-purple-600 disabled:opacity-50 text-white rounded-lg transition-colors flex items-center gap-2 text-sm",children:[s.jsx(Ug,{className:"w-4 h-4"})," Generate AI Report"]})]})]}),(R==null?void 0:R.status)==="error"&&s.jsxs("div",{className:"bg-dark-800 border border-red-500/30 rounded-2xl p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[s.jsx(Oe,{className:"w-6 h-6 text-red-400"}),s.jsx("h3",{className:"text-red-400 font-semibold",children:"Pentest Failed"})]}),s.jsx("p",{className:"text-dark-400",children:R.error||"An unexpected error occurred."})]})]})]})}const rr={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-blue-500",info:"bg-gray-500"},wa={detected:{bg:"bg-green-500/20",text:"text-green-400",label:"Detected"},not_detected:{bg:"bg-red-500/20",text:"text-red-400",label:"Not Detected"},error:{bg:"bg-yellow-500/20",text:"text-yellow-400",label:"Error"}},Au={running:{bg:"bg-blue-500/20",text:"text-blue-400"},completed:{bg:"bg-green-500/20",text:"text-green-400"},failed:{bg:"bg-red-500/20",text:"text-red-400"},stopped:{bg:"bg-orange-500/20",text:"text-orange-400"},pending:{bg:"bg-gray-500/20",text:"text-gray-400"}},Rw={error:"text-red-400",warning:"text-yellow-400",info:"text-blue-300",debug:"text-dark-500",critical:"text-red-500 font-bold"};function V0({log:e}){const t=Rw[e.level]||"text-dark-400",n=e.time?new Date(e.time).toLocaleTimeString():"",r=e.source==="llm";return s.jsxs("div",{className:`flex gap-2 text-xs font-mono leading-relaxed ${t}`,children:[s.jsx("span",{className:"text-dark-600 shrink-0 w-16",children:n}),s.jsx("span",{className:`shrink-0 w-12 uppercase ${e.level==="error"?"text-red-500":e.level==="warning"?"text-yellow-500":"text-dark-600"}`,children:e.level}),r&&s.jsx("span",{className:"text-purple-500 shrink-0",children:"[AI]"}),s.jsx("span",{className:"break-all",children:e.message})]})}function Tw(){var kt,Se,ye,Vn;const e=Bn(),[t,n]=x.useState(""),[r,a]=x.useState(""),[l,i]=x.useState(""),[o,c]=x.useState(!1),[d,m]=x.useState(""),[f,p]=x.useState(""),[N,v]=x.useState(""),[w,k]=x.useState(""),[y,u]=x.useState({}),[g,_]=x.useState(null),[L,D]=x.useState([]),[R,E]=x.useState(null),[U,q]=x.useState(!1),[A,te]=x.useState(null),[Q,ne]=x.useState(null),[ae,ce]=x.useState([]),[xe,z]=x.useState(null),[Y,se]=x.useState("test"),[V,G]=x.useState(!0),[ge,he]=x.useState("all"),[ke,P]=x.useState(null),[X,M]=x.useState(null),[me,de]=x.useState(!1),S=x.useRef(null),h=x.useRef(null),b=x.useRef(!0);x.useEffect(()=>{hn.getTypes().then($=>{u($.categories)}).catch(()=>{}),I(),O()},[]),x.useEffect(()=>{b.current&&h.current&&h.current.scrollIntoView({behavior:"smooth"})},[ae]),x.useEffect(()=>{if(!A||!U)return;const $=async()=>{try{const oe=await hn.getChallenge(A);ne(oe),oe.logs&&ce(oe.logs),["completed","failed","stopped","error"].includes(oe.status)&&(q(!1),S.current&&clearInterval(S.current),I(),O())}catch{}};return $(),S.current=setInterval($,3e3),()=>{S.current&&clearInterval(S.current)}},[A,U]);const I=async()=>{try{const $=await hn.listChallenges({limit:50});D($.challenges)}catch{}},O=async()=>{try{const $=await hn.getStats();E($)}catch{}},J=async()=>{var $,oe;if(!(!t.trim()||!l)){z(null),q(!0),ne(null),ce([]),G(!0);try{const le=await hn.run({target_url:t.trim(),vuln_type:l,challenge_name:r||void 0,auth_type:d||void 0,auth_value:f||void 0,notes:N||void 0});te(le.challenge_id)}catch(le){z(((oe=($=le==null?void 0:le.response)==null?void 0:$.data)==null?void 0:oe.detail)||(le==null?void 0:le.message)||"Failed to start test"),q(!1)}}},C=async()=>{if(A)try{await hn.stopChallenge(A),q(!1)}catch{}},j=async $=>{try{await hn.deleteChallenge($),ke===$&&(P(null),M(null)),I(),O()}catch{}},K=x.useCallback(async $=>{if(ke===$){P(null),M(null);return}P($),de(!0);try{const oe=await hn.getChallenge($);M(oe)}catch{M(null)}finally{de(!1)}},[ke]),ie=(()=>{for(const $ of Object.values(y)){const oe=$.types.find(le=>le.key===l);if(oe)return oe}return null})(),pe=Object.entries(y).map(([$,oe])=>{const le=w?oe.types.filter(fn=>fn.key.includes(w.toLowerCase())||fn.title.toLowerCase().includes(w.toLowerCase())):oe.types;return{key:$,...oe,types:le}}).filter($=>$.types.length>0),Te=$=>{if(!$)return"-";if($<60)return`${$}s`;const oe=Math.floor($/60),le=$%60;return`${oe}m ${le}s`},ve=ge==="all"?ae:ae.filter($=>$.level===ge);return s.jsxs("div",{className:"min-h-screen flex flex-col items-center py-8 px-4",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-purple-500/20 rounded-2xl mb-4",children:s.jsx(vo,{className:"w-8 h-8 text-purple-400"})}),s.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:"Vulnerability Lab"}),s.jsx("p",{className:"text-dark-400 max-w-lg",children:"Test individual vulnerability types against labs, CTFs, and PortSwigger challenges. Track detection performance per vuln type."})]}),s.jsx("div",{className:"flex gap-2 mb-6",children:[{key:"test",label:"New Test",icon:Yt},{key:"history",label:"History",icon:Xt},{key:"stats",label:"Stats",icon:Cg}].map($=>s.jsxs("button",{onClick:()=>se($.key),className:`flex items-center gap-2 px-5 py-2.5 rounded-lg text-sm font-medium transition-colors ${Y===$.key?"bg-purple-500/20 text-purple-400 border border-purple-500/30":"bg-dark-800 text-dark-400 border border-dark-700 hover:text-white"}`,children:[s.jsx($.icon,{className:"w-4 h-4"}),$.label]},$.key))}),Y==="test"&&s.jsxs("div",{className:"w-full max-w-3xl",children:[s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-8",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Target URL"}),s.jsx("input",{type:"url",value:t,onChange:$=>n($.target.value),placeholder:"https://lab.example.com/vuln-page",disabled:U,className:"w-full px-4 py-4 bg-dark-900 border border-dark-600 rounded-xl text-white text-lg placeholder-dark-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500 disabled:opacity-50"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Challenge Name (optional)"}),s.jsx("input",{type:"text",value:r,onChange:$=>a($.target.value),placeholder:l!=null&&l.startsWith("xss")?'e.g. "Reflected XSS with most tags and attributes blocked"':"e.g. PortSwigger Lab: Reflected XSS into HTML context",disabled:U,className:"w-full px-4 py-3 bg-dark-900 border border-dark-600 rounded-xl text-white placeholder-dark-500 focus:outline-none focus:border-purple-500 disabled:opacity-50"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:["Vulnerability Type ",ie&&s.jsx("span",{className:`ml-2 px-2 py-0.5 rounded text-xs ${rr[ie.severity]} text-white`,children:ie.severity})]}),s.jsxs("div",{className:"relative mb-3",children:[s.jsx(Qr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-dark-500"}),s.jsx("input",{type:"text",value:w,onChange:$=>k($.target.value),placeholder:"Search vuln types...",disabled:U,className:"w-full pl-10 pr-4 py-2.5 bg-dark-900 border border-dark-600 rounded-lg text-white text-sm placeholder-dark-500 focus:outline-none focus:border-purple-500 disabled:opacity-50"})]}),ie&&s.jsxs("div",{className:"mb-3 p-3 bg-purple-500/10 border border-purple-500/20 rounded-lg flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-purple-400 font-medium",children:ie.title}),ie.cwe_id&&s.jsx("span",{className:"ml-2 text-dark-500 text-xs",children:ie.cwe_id})]}),s.jsx("button",{onClick:()=>i(""),disabled:U,className:"text-dark-500 hover:text-white text-xs",children:"Clear"})]}),s.jsx("div",{className:"max-h-80 overflow-y-auto border border-dark-600 rounded-xl bg-dark-900",children:pe.map($=>s.jsxs("div",{className:"border-b border-dark-700 last:border-b-0",children:[s.jsxs("button",{onClick:()=>_(g===$.key?null:$.key),disabled:U,className:"w-full flex items-center justify-between px-4 py-3 text-sm font-medium text-dark-300 hover:text-white hover:bg-dark-800 transition-colors disabled:opacity-50",children:[s.jsxs("span",{children:[$.label," (",$.types.length,")"]}),g===$.key?s.jsx(Zn,{className:"w-4 h-4"}):s.jsx(pt,{className:"w-4 h-4"})]}),g===$.key&&s.jsx("div",{className:"px-2 pb-2",children:$.types.map(oe=>s.jsxs("button",{onClick:()=>i(oe.key),disabled:U,className:`w-full flex items-center justify-between px-3 py-2 rounded-lg text-sm transition-colors disabled:opacity-50 ${l===oe.key?"bg-purple-500/20 text-purple-400":"text-dark-400 hover:bg-dark-800 hover:text-white"}`,children:[s.jsx("span",{className:"text-left",children:oe.title}),s.jsxs("div",{className:"flex items-center gap-2",children:[oe.cwe_id&&s.jsx("span",{className:"text-dark-600 text-xs",children:oe.cwe_id}),s.jsx("span",{className:`w-2 h-2 rounded-full ${rr[oe.severity]}`})]})]},oe.key))})]},$.key))})]}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("button",{onClick:()=>c(!o),disabled:U,className:"flex items-center gap-2 text-sm text-dark-400 hover:text-white transition-colors disabled:opacity-50",children:[s.jsx(c0,{className:"w-4 h-4"}),s.jsx("span",{children:"Authentication (Optional)"}),o?s.jsx(Zn,{className:"w-4 h-4"}):s.jsx(pt,{className:"w-4 h-4"})]}),o&&s.jsxs("div",{className:"mt-3 space-y-3 pl-6",children:[s.jsxs("select",{value:d,onChange:$=>m($.target.value),disabled:U,className:"w-full px-3 py-2 bg-dark-900 border border-dark-600 rounded-lg text-white text-sm focus:outline-none focus:border-purple-500",children:[s.jsx("option",{value:"",children:"No Authentication"}),s.jsx("option",{value:"bearer",children:"Bearer Token"}),s.jsx("option",{value:"cookie",children:"Cookie"}),s.jsx("option",{value:"basic",children:"Basic Auth (user:pass)"}),s.jsx("option",{value:"header",children:"Custom Header (Name:Value)"})]}),d&&s.jsx("input",{type:"text",value:f,onChange:$=>p($.target.value),disabled:U,placeholder:d==="bearer"?"eyJhbGciOiJIUzI1NiIs...":d==="cookie"?"session=abc123; token=xyz":d==="basic"?"admin:password123":"X-API-Key:your-api-key",className:"w-full px-3 py-2 bg-dark-900 border border-dark-600 rounded-lg text-white text-sm placeholder-dark-500 focus:outline-none focus:border-purple-500"})]})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Notes (optional)"}),s.jsx("textarea",{value:N,onChange:$=>v($.target.value),rows:2,disabled:U,placeholder:l!=null&&l.startsWith("xss")?"Hints: blocked chars/tags, encoding observed, context (e.g. 'angle brackets HTML-encoded, input in onclick attribute')":"e.g. PortSwigger Apprentice level, no WAF",className:"w-full px-4 py-3 bg-dark-900 border border-dark-600 rounded-xl text-white placeholder-dark-500 focus:outline-none focus:border-purple-500 disabled:opacity-50"})]}),xe&&s.jsxs("div",{className:"mb-6 p-3 bg-red-500/10 border border-red-500/20 rounded-lg flex items-center gap-2",children:[s.jsx(Oe,{className:"w-5 h-5 text-red-400"}),s.jsx("span",{className:"text-red-400 text-sm",children:xe})]}),U?s.jsxs("button",{onClick:C,className:"w-full py-4 bg-red-500 hover:bg-red-600 text-white font-bold text-lg rounded-xl transition-colors flex items-center justify-center gap-3",children:[s.jsx(eu,{className:"w-6 h-6"}),"STOP TEST"]}):s.jsxs("button",{onClick:J,disabled:!t.trim()||!l,className:"w-full py-4 bg-purple-500 hover:bg-purple-600 disabled:bg-dark-600 disabled:text-dark-400 text-white font-bold text-lg rounded-xl transition-colors flex items-center justify-center gap-3",children:[s.jsx(vo,{className:"w-6 h-6"}),"START TEST"]})]}),Q&&s.jsxs("div",{className:"mt-6 space-y-4",children:[s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h3",{className:"text-white font-semibold flex items-center gap-2",children:[Q.status==="running"&&s.jsx(qt,{className:"w-5 h-5 animate-spin text-purple-400"}),Q.status==="completed"&&s.jsx(Mn,{className:"w-5 h-5 text-green-400"}),["failed","error"].includes(Q.status)&&s.jsx(Ct,{className:"w-5 h-5 text-red-400"}),Q.status==="stopped"&&s.jsx(eu,{className:"w-5 h-5 text-orange-400"}),(ie==null?void 0:ie.title)||l]}),s.jsxs("span",{className:"text-sm text-dark-400",children:[Q.progress||0,"%"]})]}),s.jsx("div",{className:"w-full bg-dark-900 rounded-full h-2 mb-4",children:s.jsx("div",{className:`h-2 rounded-full transition-all duration-500 ${Q.status==="completed"?"bg-green-500":Q.status==="error"||Q.status==="failed"?"bg-red-500":"bg-purple-500"}`,style:{width:`${Q.progress||0}%`}})}),s.jsxs("div",{className:"flex items-center gap-4 text-sm text-dark-400 mb-3",children:[Q.phase&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Ke,{className:"w-3.5 h-3.5"}),Q.phase]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Ye,{className:"w-3.5 h-3.5"}),ae.length," log entries"]}),Q.findings_count>0&&s.jsxs("span",{className:"flex items-center gap-1 text-green-400",children:[s.jsx(Oe,{className:"w-3.5 h-3.5"}),Q.findings_count," finding(s)"]})]}),Q.findings&&Q.findings.length>0&&s.jsx("div",{className:"mb-3 space-y-2",children:Q.findings.slice(-3).map(($,oe)=>s.jsxs("div",{className:"p-2 bg-green-500/5 border border-green-500/20 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs font-bold ${rr[$.severity||"medium"]} text-white`,children:($.severity||"medium").toUpperCase()}),s.jsx("span",{className:"text-sm text-green-300",children:$.title||$.vulnerability_type||"Finding"})]}),$.affected_endpoint&&s.jsx("p",{className:"text-xs text-dark-500 mt-1 truncate",children:$.affected_endpoint})]},oe))}),Q.result&&s.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[s.jsx("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${((kt=wa[Q.result])==null?void 0:kt.bg)||"bg-gray-500/20"} ${((Se=wa[Q.result])==null?void 0:Se.text)||"text-gray-400"}`,children:((ye=wa[Q.result])==null?void 0:ye.label)||Q.result}),Q.scan_id&&s.jsxs("button",{onClick:()=>e(`/scan/${Q.scan_id}`),className:"text-sm text-purple-400 hover:text-purple-300 flex items-center gap-1",children:[s.jsx(ol,{className:"w-4 h-4"})," View Scan Details"]})]}),Q.error&&s.jsx("div",{className:"mt-3 p-2 bg-red-500/10 border border-red-500/20 rounded text-red-400 text-sm",children:Q.error})]}),s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-dark-700",children:[s.jsxs("button",{onClick:()=>G(!V),className:"flex items-center gap-2 text-sm font-medium text-dark-300 hover:text-white transition-colors",children:[s.jsx(Ye,{className:"w-4 h-4 text-purple-400"}),"Live Agent Logs",s.jsxs("span",{className:"text-dark-600 text-xs",children:["(",ae.length,")"]}),V?s.jsx(Zn,{className:"w-4 h-4"}):s.jsx(pt,{className:"w-4 h-4"})]}),V&&s.jsx("div",{className:"flex items-center gap-1",children:["all","info","warning","error"].map($=>s.jsx("button",{onClick:()=>he($),className:`px-2 py-1 rounded text-xs transition-colors ${ge===$?"bg-purple-500/20 text-purple-400":"text-dark-500 hover:text-white"}`,children:$},$))})]}),V&&s.jsxs("div",{className:"p-3 bg-dark-900 max-h-80 overflow-y-auto space-y-0.5",onScroll:$=>{const oe=$.currentTarget;b.current=oe.scrollTop+oe.clientHeight>=oe.scrollHeight-50},children:[ve.length===0?s.jsx("p",{className:"text-dark-600 text-xs font-mono",children:"Waiting for logs..."}):ve.map(($,oe)=>s.jsx(V0,{log:$},oe)),s.jsx("div",{ref:h})]})]})]})]}),Y==="history"&&s.jsx("div",{className:"w-full max-w-4xl",children:s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl overflow-hidden",children:[s.jsxs("div",{className:"p-4 border-b border-dark-700 flex items-center justify-between",children:[s.jsxs("h3",{className:"text-white font-semibold",children:["Challenge History (",L.length,")"]}),s.jsx("button",{onClick:I,className:"text-sm text-dark-400 hover:text-white",children:"Refresh"})]}),L.length===0?s.jsx("div",{className:"p-8 text-center text-dark-500",children:"No challenges yet. Start your first test!"}):s.jsx("div",{className:"divide-y divide-dark-700",children:L.map($=>{const oe=Au[$.status]||Au.pending,le=$.result?wa[$.result]:null,fn=ke===$.id;return s.jsxs("div",{children:[s.jsxs("div",{className:`p-4 cursor-pointer transition-colors ${fn?"bg-dark-900/80":"hover:bg-dark-900/50"}`,onClick:()=>K($.id),children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(zr,{className:`w-4 h-4 text-dark-500 transition-transform ${fn?"rotate-90":""}`}),s.jsx("span",{className:"text-white font-medium",children:$.challenge_name||$.vuln_type.replace(/_/g," ").replace(/\b\w/g,Ee=>Ee.toUpperCase())}),s.jsx("span",{className:`px-2 py-0.5 rounded text-xs ${oe.bg} ${oe.text}`,children:$.status}),le&&s.jsx("span",{className:`px-2 py-0.5 rounded text-xs ${le.bg} ${le.text}`,children:le.label})]}),s.jsxs("div",{className:"flex items-center gap-2",onClick:Ee=>Ee.stopPropagation(),children:[$.scan_id&&s.jsx("button",{onClick:()=>e(`/scan/${$.scan_id}`),className:"p-1.5 text-dark-400 hover:text-white rounded",title:"View scan details",children:s.jsx(ol,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>j($.id),className:"p-1.5 text-dark-400 hover:text-red-400 rounded",title:"Delete",children:s.jsx(Pt,{className:"w-4 h-4"})})]})]}),s.jsxs("div",{className:"flex items-center gap-4 text-xs text-dark-500 ml-7",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Kt,{className:"w-3 h-3"}),$.target_url.length>50?$.target_url.slice(0,50)+"...":$.target_url]}),s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsx("span",{children:$.vuln_type}),$.vuln_category&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsx("span",{children:$.vuln_category})]}),s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Xt,{className:"w-3 h-3"}),Te($.duration)]}),($.endpoints_count??0)>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(pn,{className:"w-3 h-3"}),$.endpoints_count," endpoints"]})]}),($.logs_count??0)>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Ye,{className:"w-3 h-3"}),$.logs_count," logs"]})]})]}),$.findings_count>0&&s.jsx("div",{className:"flex gap-2 mt-2 ml-7",children:["critical","high","medium","low","info"].map(Ee=>{const ta=$[`${Ee}_count`];return ta?s.jsxs("span",{className:`${rr[Ee]} text-white px-2 py-0.5 rounded text-xs font-bold`,children:[ta," ",Ee]},Ee):null})})]}),fn&&s.jsx("div",{className:"border-t border-dark-700 bg-dark-900/50",children:me?s.jsxs("div",{className:"p-6 flex items-center justify-center gap-2 text-dark-400",children:[s.jsx(qt,{className:"w-5 h-5 animate-spin"}),"Loading details..."]}):X?s.jsxs("div",{className:"p-4 space-y-4",children:[(X.findings_detail||X.findings||[]).length>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"text-sm font-medium text-dark-300 mb-2 flex items-center gap-2",children:[s.jsx(Ke,{className:"w-4 h-4 text-green-400"}),"Findings (",(X.findings_detail||X.findings||[]).length,")"]}),s.jsx("div",{className:"space-y-2",children:(X.findings_detail||X.findings||[]).map((Ee,ta)=>s.jsxs("div",{className:"p-3 bg-dark-800 border border-dark-700 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs font-bold ${rr[Ee.severity||"medium"]} text-white`,children:(Ee.severity||"medium").toUpperCase()}),s.jsx("span",{className:"text-sm text-white font-medium",children:Ee.title||Ee.vulnerability_type||"Finding"})]}),Ee.vulnerability_type&&s.jsxs("p",{className:"text-xs text-dark-500 mb-1",children:["Type: ",Ee.vulnerability_type]}),Ee.affected_endpoint&&s.jsxs("p",{className:"text-xs text-dark-400 mb-1 flex items-center gap-1",children:[s.jsx(pn,{className:"w-3 h-3"}),Ee.affected_endpoint]}),Ee.payload&&s.jsxs("div",{className:"mt-1",children:[s.jsx("span",{className:"text-xs text-dark-600",children:"Payload: "}),s.jsx("code",{className:"text-xs text-purple-400 bg-dark-900 px-1.5 py-0.5 rounded break-all",children:Ee.payload})]}),Ee.evidence&&s.jsxs("div",{className:"mt-1",children:[s.jsx("span",{className:"text-xs text-dark-600",children:"Evidence: "}),s.jsx("span",{className:"text-xs text-dark-400",children:Ee.evidence.slice(0,300)})]})]},ta))})]}),(X.findings_detail||X.findings||[]).length===0&&X.status!=="running"&&s.jsx("div",{className:"p-3 bg-dark-800 border border-dark-700 rounded-lg text-center text-dark-500 text-sm",children:"No findings detected for this challenge."}),(X.logs||[]).length>0&&s.jsx(Pw,{logs:X.logs}),X.notes&&s.jsxs("div",{className:"p-3 bg-dark-800 border border-dark-700 rounded-lg",children:[s.jsxs("h4",{className:"text-xs font-medium text-dark-500 mb-1 flex items-center gap-1",children:[s.jsx(yt,{className:"w-3 h-3"})," Notes"]}),s.jsx("p",{className:"text-sm text-dark-300",children:X.notes})]})]}):s.jsx("div",{className:"p-6 text-center text-dark-500 text-sm",children:"Failed to load challenge details."})})]},$.id)})})]})}),Y==="stats"&&s.jsx("div",{className:"w-full max-w-4xl",children:R?s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"grid grid-cols-4 gap-4",children:[{label:"Total Tests",value:R.total,color:"text-white"},{label:"Running",value:R.running,color:"text-blue-400"},{label:"Detection Rate",value:`${R.detection_rate}%`,color:"text-green-400"},{label:"Detected",value:((Vn=R.result_counts)==null?void 0:Vn.detected)||0,color:"text-green-400"}].map(($,oe)=>s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-xl p-4 text-center",children:[s.jsx("div",{className:`text-2xl font-bold ${$.color}`,children:$.value}),s.jsx("div",{className:"text-xs text-dark-500 mt-1",children:$.label})]},oe))}),Object.keys(R.by_category).length>0&&s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-6",children:[s.jsx("h3",{className:"text-white font-semibold mb-4",children:"Detection by Category"}),s.jsx("div",{className:"space-y-3",children:Object.entries(R.by_category).map(([$,oe])=>{var Ee;const le=oe.total>0?Math.round(oe.detected/oe.total*100):0,fn=((Ee=y[$])==null?void 0:Ee.label)||$;return s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("span",{className:"text-sm text-dark-300",children:fn}),s.jsxs("span",{className:"text-sm text-dark-400",children:[oe.detected,"/",oe.total," (",le,"%)"]})]}),s.jsx("div",{className:"w-full bg-dark-900 rounded-full h-2",children:s.jsx("div",{className:`h-2 rounded-full transition-all ${le>=70?"bg-green-500":le>=40?"bg-yellow-500":"bg-red-500"}`,style:{width:`${le}%`}})})]},$)})})]}),Object.keys(R.by_type).length>0&&s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-6",children:[s.jsx("h3",{className:"text-white font-semibold mb-4",children:"Detection by Vulnerability Type"}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(R.by_type).map(([$,oe])=>{const le=oe.total>0?Math.round(oe.detected/oe.total*100):0;return s.jsxs("div",{className:"flex items-center justify-between p-2 bg-dark-900 rounded-lg",children:[s.jsx("span",{className:"text-sm text-dark-300",children:$.replace(/_/g," ")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:`text-xs font-bold ${le>=70?"text-green-400":le>=40?"text-yellow-400":"text-red-400"}`,children:[le,"%"]}),s.jsxs("span",{className:"text-xs text-dark-600",children:["(",oe.detected,"/",oe.total,")"]})]})]},$)})})]}),R.total===0&&s.jsx("div",{className:"text-center text-dark-500 py-8",children:"No test data yet. Run some vulnerability tests to see stats!"})]}):s.jsx("div",{className:"text-center text-dark-500 py-12",children:"Loading stats..."})})]})}function Pw({logs:e}){const[t,n]=x.useState(!1),[r,a]=x.useState("all"),l=r==="all"?e:e.filter(d=>d.level===r),i=t?l:l.slice(-30),o=e.filter(d=>d.level==="error").length,c=e.filter(d=>d.level==="warning").length;return s.jsxs("div",{className:"border border-dark-700 rounded-lg overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-dark-800 border-b border-dark-700",children:[s.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-2 text-sm font-medium text-dark-300 hover:text-white transition-colors",children:[s.jsx(Ye,{className:"w-4 h-4 text-purple-400"}),"Agent Logs (",e.length,")",o>0&&s.jsxs("span",{className:"text-red-400 text-xs",children:["(",o," errors)"]}),c>0&&s.jsxs("span",{className:"text-yellow-400 text-xs",children:["(",c," warnings)"]}),t?s.jsx(Zn,{className:"w-3 h-3"}):s.jsx(pt,{className:"w-3 h-3"})]}),s.jsx("div",{className:"flex items-center gap-1",children:["all","info","warning","error"].map(d=>s.jsx("button",{onClick:()=>a(d),className:`px-2 py-0.5 rounded text-xs transition-colors ${r===d?"bg-purple-500/20 text-purple-400":"text-dark-600 hover:text-white"}`,children:d},d))})]}),s.jsxs("div",{className:`p-2 bg-dark-900 overflow-y-auto space-y-0.5 ${t?"max-h-96":"max-h-48"}`,children:[!t&&l.length>30&&s.jsxs("p",{className:"text-dark-600 text-xs font-mono mb-1",children:["... ",l.length-30," older entries hidden (click to expand)"]}),i.map((d,m)=>s.jsx(V0,{log:d},m)),i.length===0&&s.jsx("p",{className:"text-dark-600 text-xs font-mono",children:"No logs matching filter."})]})]})}const $u={recon:"bg-blue-500",exploit:"bg-red-500",pivot:"bg-orange-500",escalate:"bg-purple-500",action:"bg-green-500"},Lw={recon:"text-blue-400",exploit:"text-red-400",pivot:"text-orange-400",escalate:"text-purple-400",action:"text-green-400"},Aw=[{id:"network_scanner",name:"Network Scanner",description:"Discover hosts, open ports, and running services across a target network.",icon:"globe",accent:"blue"},{id:"lateral_movement",name:"Lateral Movement",description:"Pivot across compromised hosts and expand access within the network.",icon:"arrows",accent:"orange"},{id:"privilege_escalation",name:"Privilege Escalation",description:"Identify and exploit misconfigurations to elevate privileges on a host.",icon:"shield",accent:"red"},{id:"vpn_recon",name:"VPN Reconnaissance",description:"Enumerate VPN endpoints, test credentials, and map internal networks.",icon:"wifi",accent:"green"}],Ou={blue:{bg:"bg-blue-500/10",border:"border-blue-500/30 hover:border-blue-500/60",text:"text-blue-400",icon:"text-blue-400"},orange:{bg:"bg-orange-500/10",border:"border-orange-500/30 hover:border-orange-500/60",text:"text-orange-400",icon:"text-orange-400"},red:{bg:"bg-red-500/10",border:"border-red-500/30 hover:border-red-500/60",text:"text-red-400",icon:"text-red-400"},green:{bg:"bg-green-500/10",border:"border-green-500/30 hover:border-green-500/60",text:"text-green-400",icon:"text-green-400"}};function $w({icon:e,className:t}){switch(e){case"globe":return s.jsx(pn,{className:t});case"arrows":return s.jsx(_g,{className:t});case"shield":return s.jsx(Fg,{className:t});case"wifi":return s.jsx(Hg,{className:t});default:return s.jsx(Ye,{className:t})}}function Ow(){const e=x.useRef(null),t=x.useRef(null),n=x.useRef(null),[r,a]=x.useState([]),[l,i]=x.useState(null),[o,c]=x.useState(null),[d,m]=x.useState(""),[f,p]=x.useState(""),[N,v]=x.useState(!0),[w,k]=x.useState(!1),[y,u]=x.useState(!1),[g,_]=x.useState(!1),[L,D]=x.useState(!1),[R,E]=x.useState(""),[U,q]=x.useState(""),[A,te]=x.useState(null),[Q,ne]=x.useState(Aw),[ae,ce]=x.useState(null);x.useEffect(()=>{xe(),z()},[]),x.useEffect(()=>{if(!l)return;let P=!1;const X=async()=>{try{const me=await Zt.getVpnStatus(l);P||ce(me)}catch{}};X();const M=setInterval(X,3e3);return()=>{P=!0,clearInterval(M)}},[l]),x.useEffect(()=>{var P;(P=e.current)==null||P.scrollIntoView({behavior:"smooth"})},[o==null?void 0:o.messages]);const xe=async()=>{try{const P=await Zt.listSessions();a(P.sessions||P||[])}catch(P){console.error("Failed to load terminal sessions:",P)}},z=async()=>{try{const P=await Zt.listTemplates();P&&Array.isArray(P)&&P.length>0&&ne(P)}catch{}},Y=x.useCallback(async P=>{k(!0);try{const X=await Zt.getSession(P);i(P),c(X),X.vpn_status&&ce(X.vpn_status)}catch(X){console.error("Failed to load session:",X)}finally{k(!1)}},[]),se=async()=>{if(R.trim()){k(!0);try{const P=await Zt.createSession(R.trim(),U.trim()||void 0,A||void 0);await xe(),await Y(P.session_id),D(!1),E(""),q(""),te(null)}catch(P){console.error("Failed to create session:",P)}finally{k(!1)}}},V=async P=>{if(confirm("Delete this terminal session?"))try{await Zt.deleteSession(P),l===P&&(i(null),c(null),ce(null)),await xe()}catch(X){console.error("Failed to delete session:",X)}},G=async()=>{var X,M,me;if(!d.trim()||!l||y)return;const P={role:"user",content:d.trim(),timestamp:new Date().toISOString()};c(de=>de&&{...de,messages:[...de.messages,P]}),m(""),u(!0);try{const de=await Zt.sendMessage(l,d.trim()),S={role:"assistant",content:de.response,timestamp:new Date().toISOString(),suggested_commands:de.suggested_commands||[]};c(h=>h&&{...h,messages:[...h.messages,S]}),(X=t.current)==null||X.focus()}catch(de){const S={role:"system",content:`Error: ${((me=(M=de==null?void 0:de.response)==null?void 0:M.data)==null?void 0:me.detail)||(de==null?void 0:de.message)||"Failed to send message"}`,timestamp:new Date().toISOString()};c(h=>h&&{...h,messages:[...h.messages,S]})}finally{u(!1)}},ge=x.useCallback(async P=>{var me,de,S;const X=P||f;if(!X.trim()||!l||g)return;const M={role:"user",content:`$ ${X.trim()}`,timestamp:new Date().toISOString()};c(h=>h&&{...h,messages:[...h.messages,M]}),P||p(""),_(!0);try{const h=await Zt.executeCommand(l,X.trim(),N?"sandbox":"direct"),I={role:"tool",content:[h.stdout||"",h.stderr?`
|
||
[stderr]
|
||
${h.stderr}`:""].filter(Boolean).join("")||"(no output)",timestamp:new Date().toISOString(),exit_code:h.exit_code,command:h.command,duration:h.duration};c(O=>O&&{...O,messages:[...O.messages,I]}),(me=n.current)==null||me.focus()}catch(h){const b={role:"tool",content:((S=(de=h==null?void 0:h.response)==null?void 0:de.data)==null?void 0:S.detail)||(h==null?void 0:h.message)||"Command execution failed",timestamp:new Date().toISOString(),exit_code:-1};c(I=>I&&{...I,messages:[...I.messages,b]})}finally{_(!1)}},[l,f,g,N]),he=x.useCallback(async()=>{if(l)try{const P=await Zt.getExploitationPath(l);c(X=>X&&{...X,exploitation_path:P.steps||P||[]})}catch{}},[l]);x.useEffect(()=>{l&&o&&o.messages.length>0&&he()},[l,o==null?void 0:o.messages.length,he]);const ke=(P,X)=>{switch(P.role){case"user":return s.jsx("div",{className:"flex justify-end animate-fadeIn",children:s.jsxs("div",{className:"max-w-[80%] rounded-xl px-4 py-3 border-l-4 border-primary-500 bg-dark-800 text-white shadow-lg",children:[s.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed break-words",children:P.content}),s.jsx("div",{className:"text-[10px] mt-2 text-dark-500",children:new Date(P.timestamp).toLocaleTimeString()})]})},X);case"assistant":return s.jsx("div",{className:"flex justify-start animate-fadeIn",children:s.jsxs("div",{className:"max-w-[85%] rounded-xl px-4 py-3 bg-dark-900 text-dark-200 shadow-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs text-dark-400",children:[s.jsx(In,{className:"w-3.5 h-3.5 text-primary-500"}),s.jsx("span",{className:"font-medium",children:"Terminal Agent"})]}),s.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed break-words",children:P.content}),P.suggested_commands&&P.suggested_commands.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2 mt-3 pt-3 border-t border-dark-700",children:P.suggested_commands.map((M,me)=>s.jsxs("button",{onClick:()=>ge(M),disabled:g,className:"px-3 py-1.5 text-xs font-mono bg-green-500/20 text-green-400 rounded-lg hover:bg-green-500/30 transition-colors disabled:opacity-50 flex items-center gap-1.5 border border-green-500/20 hover:border-green-500/40",children:[s.jsx(Yt,{className:"w-3 h-3"}),M]},me))}),s.jsx("div",{className:"text-[10px] mt-2 text-dark-500",children:new Date(P.timestamp).toLocaleTimeString()})]})},X);case"tool":return s.jsx("div",{className:"flex justify-start animate-fadeIn",children:s.jsxs("div",{className:`max-w-[90%] rounded-xl px-4 py-3 bg-dark-950 shadow-lg border-l-4 ${P.exit_code!==void 0&&P.exit_code!==0?"border-red-500":"border-green-500/50"}`,children:[P.command&&s.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs",children:[s.jsx(Ye,{className:"w-3.5 h-3.5 text-green-400"}),s.jsx("span",{className:"font-mono text-green-400",children:P.command}),P.exit_code!==void 0&&s.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${P.exit_code===0?"bg-green-500/20 text-green-400":"bg-red-500/10 text-red-400"}`,children:["exit ",P.exit_code]}),P.duration!==void 0&&s.jsx("span",{className:"text-dark-500",children:P.duration<1?"<1s":`${P.duration.toFixed(1)}s`})]}),s.jsx("pre",{className:"font-mono text-xs text-green-400 whitespace-pre-wrap break-all leading-relaxed max-h-80 overflow-y-auto",children:P.content}),s.jsx("div",{className:"text-[10px] mt-2 text-dark-500",children:new Date(P.timestamp).toLocaleTimeString()})]})},X);case"system":return s.jsx("div",{className:"flex justify-center animate-fadeIn",children:s.jsx("p",{className:"text-dark-400 text-xs italic text-center px-4 py-2 max-w-[70%]",children:P.content})},X);default:return null}};return s.jsxs("div",{className:"h-[calc(100vh-80px)] flex gap-0 animate-fadeIn",children:[s.jsxs("div",{className:"w-72 flex-shrink-0 bg-dark-800 border-r border-dark-700 flex flex-col",children:[s.jsxs("div",{className:"p-4 border-b border-dark-700",children:[s.jsx("div",{className:"flex items-center justify-between mb-3",children:s.jsxs("h2",{className:"text-white font-semibold flex items-center gap-2",children:[s.jsx(Ye,{className:"w-5 h-5 text-primary-500"}),"Terminal Agent"]})}),s.jsxs("button",{onClick:()=>D(!0),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-primary-500 hover:bg-primary-600 text-white text-sm font-medium rounded-lg transition-colors",children:[s.jsx(Gt,{className:"w-4 h-4"}),"New Session"]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-1.5",children:r.length===0?s.jsx("p",{className:"text-dark-500 text-sm text-center py-8",children:"No sessions yet."}):r.map(P=>s.jsxs("div",{onClick:()=>Y(P.session_id),className:`p-3 rounded-lg cursor-pointer transition-all group ${l===P.session_id?"bg-primary-500/20 text-primary-500 border border-primary-500/30":"bg-dark-900/50 hover:bg-dark-900 border border-transparent hover:border-dark-700 text-dark-300"}`,children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"font-medium text-sm truncate flex-1",children:P.name||P.target}),s.jsx("button",{onClick:X=>{X.stopPropagation(),V(P.session_id)},className:"p-1 text-dark-500 hover:text-red-400 opacity-0 group-hover:opacity-100 transition-all rounded",children:s.jsx(Pt,{className:"w-3.5 h-3.5"})})]}),s.jsxs("p",{className:"text-dark-500 text-xs truncate mt-0.5 flex items-center gap-1",children:[s.jsx(pn,{className:"w-3 h-3"}),P.target]}),s.jsxs("div",{className:"flex items-center gap-3 mt-1.5 text-[10px] text-dark-500",children:[s.jsxs("span",{children:[P.messages_count," msgs"]}),s.jsxs("span",{children:[P.commands_count," cmds"]}),P.template_id&&s.jsx("span",{className:"bg-dark-700 px-1.5 py-0.5 rounded text-dark-400",children:P.template_id.replace(/_/g," ")})]})]},P.session_id))})]}),s.jsx("div",{className:"flex-1 flex flex-col bg-dark-900 min-w-0",children:l&&o?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-dark-700 bg-dark-800/50 flex-shrink-0",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(Ye,{className:"w-4 h-4 text-primary-500 flex-shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"text-white font-medium text-sm truncate",children:o.name||"Terminal Session"}),s.jsx("p",{className:"text-dark-400 text-xs truncate",children:o.target})]})]}),s.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:o.template_id&&s.jsx("span",{className:"text-dark-500 text-xs bg-dark-700 px-2 py-1 rounded",children:o.template_id.replace(/_/g," ")})})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4 scroll-smooth",children:[o.messages.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[s.jsx("div",{className:"w-16 h-16 bg-dark-800 rounded-2xl flex items-center justify-center mb-4",children:s.jsx(Ye,{className:"w-8 h-8 text-dark-600"})}),s.jsx("p",{className:"text-dark-400 text-sm mb-1",children:"Session ready"}),s.jsx("p",{className:"text-dark-500 text-xs max-w-md",children:"Use the prompt input to ask the AI agent for guidance, or use the command input to execute commands directly on the target."})]}):o.messages.map((P,X)=>ke(P,X)),y&&s.jsx("div",{className:"flex justify-start",children:s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 bg-dark-800 border border-dark-700 rounded-xl text-dark-400 text-sm",children:[s.jsx(qt,{className:"w-4 h-4 animate-spin text-primary-500"}),"Agent is thinking..."]})}),g&&s.jsx("div",{className:"flex justify-start",children:s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 bg-dark-950 border border-green-500/20 rounded-xl text-green-400 text-sm font-mono",children:[s.jsx(qt,{className:"w-4 h-4 animate-spin"}),"Executing command..."]})}),s.jsx("div",{ref:e})]}),s.jsxs("div",{className:"border-t border-dark-700 bg-dark-800 px-6 py-4 flex-shrink-0 space-y-3",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{ref:t,type:"text",value:d,onChange:P=>m(P.target.value),onKeyDown:P=>{P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),G())},placeholder:"Ask the AI agent for guidance...",disabled:y||g,className:"flex-1 bg-dark-900 border border-dark-700 rounded-lg px-4 py-2.5 text-white text-sm placeholder-dark-500 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500 disabled:opacity-50"}),s.jsx("button",{onClick:G,disabled:!d.trim()||y||g,className:"px-4 py-2.5 bg-primary-500 hover:bg-primary-600 text-white rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:s.jsx(dl,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsxs("div",{className:"flex-1 flex items-center bg-dark-950 border border-dark-700 rounded-lg overflow-hidden focus-within:border-green-500/50 focus-within:ring-1 focus-within:ring-green-500/30",children:[s.jsx("span",{className:"pl-4 pr-1 text-green-400 font-mono text-sm select-none",children:"$"}),s.jsx("input",{ref:n,type:"text",value:f,onChange:P=>p(P.target.value),onKeyDown:P=>{P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),ge())},placeholder:"Enter command to execute...",disabled:y||g,className:"flex-1 bg-transparent py-2.5 pr-4 text-green-400 font-mono text-sm placeholder-dark-500 focus:outline-none disabled:opacity-50"})]}),s.jsx("button",{onClick:()=>ge(),disabled:!f.trim()||y||g,className:"px-4 py-2.5 bg-green-500/20 hover:bg-green-500/30 text-green-400 border border-green-500/30 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:s.jsx(Yt,{className:"w-4 h-4"})}),s.jsxs("div",{className:"flex items-center gap-2 pl-2 border-l border-dark-700",children:[s.jsx("button",{onClick:()=>v(!N),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${N?"bg-green-500":"bg-red-500/60"}`,children:s.jsx("span",{className:`inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform ${N?"translate-x-4.5":"translate-x-0.5"}`,style:{transform:N?"translateX(16px)":"translateX(2px)"}})}),s.jsx("span",{className:`text-xs font-medium ${N?"text-green-400":"text-red-400"}`,children:N?"Sandbox":"Direct"})]})]})]})]}):s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center",children:[s.jsx("div",{className:"w-20 h-20 bg-gradient-to-br from-primary-500/20 to-green-500/20 rounded-2xl flex items-center justify-center mb-6",children:s.jsx(Ye,{className:"w-10 h-10 text-primary-400"})}),s.jsx("h3",{className:"text-white text-lg font-medium mb-2",children:"Terminal Agent"}),s.jsx("p",{className:"text-dark-400 text-center mb-6 max-w-md text-sm",children:"Interactive AI-assisted terminal for infrastructure pentesting. Create a new session or select an existing one to get started."}),s.jsxs("button",{onClick:()=>D(!0),className:"flex items-center gap-2 px-6 py-3 bg-primary-500 hover:bg-primary-600 text-white font-medium rounded-lg transition-colors",children:[s.jsx(Gt,{className:"w-4 h-4"}),"New Session"]}),w&&s.jsxs("div",{className:"flex items-center gap-2 mt-4 text-dark-400 text-sm",children:[s.jsx(qt,{className:"w-4 h-4 animate-spin"}),"Loading..."]})]})}),s.jsxs("div",{className:"w-72 flex-shrink-0 bg-dark-800 border-l border-dark-700 flex flex-col",children:[s.jsxs("div",{className:"p-4 border-b border-dark-700",children:[s.jsx("h3",{className:"text-dark-300 text-xs font-semibold uppercase tracking-wider mb-3",children:"VPN Status"}),ae?s.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${ae.connected?"bg-green-500/10 border-green-500/30":"bg-red-500/10 border-red-500/30"}`,children:[s.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${ae.connected?"bg-green-500 animate-pulse":"bg-red-500"}`}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:`text-sm font-medium ${ae.connected?"text-green-400":"text-red-400"}`,children:ae.connected?"Connected":"Disconnected"}),ae.connected&&ae.ip&&s.jsx("p",{className:"text-xs text-dark-400 truncate font-mono",children:ae.ip}),ae.connected&&ae.interface&&s.jsx("p",{className:"text-xs text-dark-500 truncate",children:ae.interface})]}),ae.connected&&ae.latency_ms!==null&&s.jsxs("span",{className:"text-xs text-dark-400",children:[ae.latency_ms,"ms"]})]}):s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-dark-900 border border-dark-700",children:[s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-dark-600"}),s.jsx("span",{className:"text-dark-500 text-sm",children:"No session active"})]})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[s.jsx("h3",{className:"text-dark-300 text-xs font-semibold uppercase tracking-wider mb-4",children:"Exploitation Path"}),o&&o.exploitation_path.length>0?s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-0.5 bg-dark-700"}),s.jsx("div",{className:"space-y-4",children:o.exploitation_path.map((P,X)=>{const M=$u[P.step_type]||"bg-dark-500",me=Lw[P.step_type]||"text-dark-400";return s.jsxs("div",{className:"relative pl-6",children:[s.jsx("div",{className:`absolute left-0 top-1 w-[15px] h-[15px] rounded-full border-2 border-dark-800 ${M} z-10`}),s.jsxs("div",{className:"bg-dark-900 rounded-lg p-3 border border-dark-700",children:[s.jsx("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${me}`,children:P.step_type}),s.jsx("p",{className:"text-dark-300 text-xs mt-1 leading-relaxed",children:P.description}),P.command&&s.jsxs("p",{className:"font-mono text-[10px] text-green-400/70 mt-1.5 truncate bg-dark-950 px-2 py-1 rounded",children:["$ ",P.command]}),P.result&&s.jsx("p",{className:"text-dark-500 text-[10px] mt-1 truncate",children:P.result}),s.jsx("p",{className:"text-dark-600 text-[9px] mt-1.5",children:new Date(P.timestamp).toLocaleTimeString()})]})]},X)})})]}):s.jsxs("div",{className:"text-center py-8",children:[s.jsx(Rg,{className:"w-8 h-8 text-dark-700 mx-auto mb-2"}),s.jsx("p",{className:"text-dark-500 text-xs",children:l?"No exploitation steps yet. Start interacting to build the attack path.":"Select a session to view the exploitation path."})]})]}),o&&o.exploitation_path.length>0&&s.jsx("div",{className:"p-4 border-t border-dark-700",children:s.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries($u).map(([P,X])=>s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:`w-2 h-2 rounded-full ${X}`}),s.jsx("span",{className:"text-dark-500 text-[10px] capitalize",children:P})]},P))})})]}),L&&s.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl w-full max-w-lg mx-4 shadow-2xl",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 pb-4",children:[s.jsxs("h3",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[s.jsx(Ye,{className:"w-5 h-5 text-primary-500"}),"New Terminal Session"]}),s.jsx("button",{onClick:()=>{D(!1),te(null),E(""),q("")},className:"text-dark-400 hover:text-white transition-colors",children:s.jsx(Sc,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"px-6 pb-6 space-y-5",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Session Template"}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:Q.map(P=>{const X=Ou[P.accent]||Ou.blue,M=A===P.id;return s.jsxs("button",{onClick:()=>te(M?null:P.id),className:`p-4 rounded-xl border text-left transition-all ${M?`${X.bg} ${X.border.replace("hover:","")} ring-1 ring-${P.accent}-500/30`:"bg-dark-900 border-dark-700 hover:border-dark-600"}`,children:[s.jsx($w,{icon:P.icon,className:`w-6 h-6 mb-2 ${M?X.icon:"text-dark-500"}`}),s.jsx("p",{className:`text-sm font-medium ${M?X.text:"text-dark-300"}`,children:P.name}),s.jsx("p",{className:"text-dark-500 text-xs mt-1 leading-relaxed line-clamp-2",children:P.description})]},P.id)})})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-1.5",children:"Target *"}),s.jsx("input",{type:"text",value:R,onChange:P=>E(P.target.value),placeholder:"10.10.10.1 or 192.168.1.0/24 or vpn.target.htb",autoFocus:!0,className:"w-full bg-dark-900 border border-dark-700 rounded-lg px-4 py-2.5 text-white text-sm placeholder-dark-500 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-1.5",children:"Session Name (optional)"}),s.jsx("input",{type:"text",value:U,onChange:P=>q(P.target.value),placeholder:"e.g. HTB Machine - Recon Phase",className:"w-full bg-dark-900 border border-dark-700 rounded-lg px-4 py-2.5 text-white text-sm placeholder-dark-500 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500"})]}),s.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[s.jsx("button",{onClick:()=>{D(!1),te(null),E(""),q("")},className:"px-4 py-2 text-sm text-dark-400 hover:text-white transition-colors",children:"Cancel"}),s.jsx("button",{onClick:se,disabled:!R.trim()||w,className:"flex items-center gap-2 px-5 py-2 bg-primary-500 hover:bg-primary-600 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:w?s.jsxs(s.Fragment,{children:[s.jsx(qt,{className:"w-4 h-4 animate-spin"}),"Creating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Gt,{className:"w-4 h-4"}),"Create Session"]})})]})]})]})})]})}function Iw(e){if(e<60)return`${Math.floor(e)}s`;if(e<3600){const r=Math.floor(e/60),a=Math.floor(e%60);return`${r}m ${a}s`}const t=Math.floor(e/3600),n=Math.floor(e%3600/60);return`${t}h ${n}m`}function Mw(e){if(!e)return"Unknown";const t=(Date.now()-new Date(e).getTime())/1e3;return t<60?"Just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function Dw(){var L,D,R;const[e,t]=x.useState(null),[n,r]=x.useState(!0),[a,l]=x.useState(null),[i,o]=x.useState(null),[c,d]=x.useState({}),[m,f]=x.useState({}),[p,N]=x.useState(!1),v=x.useCallback(async(E=!1)=>{E&&r(!0);try{const U=await sr.list();t(U)}catch(U){console.error("Failed to fetch sandbox data:",U),e||t({pool:{active:0,max_concurrent:0,image:"N/A",container_ttl_minutes:0,docker_available:!1},containers:[],error:"Failed to connect to backend"})}finally{r(!1)}},[]);x.useEffect(()=>{v(!0);const E=setInterval(()=>v(!1),5e3);return()=>clearInterval(E)},[v]),x.useEffect(()=>{if(a){const E=setTimeout(()=>l(null),4e3);return()=>clearTimeout(E)}},[a]);const w=async E=>{var U,q;if(i!==E){o(E),setTimeout(()=>o(null),5e3);return}o(null),N(!0);try{await sr.destroy(E),l({type:"success",text:`Container for scan ${E.slice(0,8)}... destroyed`}),v(!1)}catch(A){l({type:"error",text:((q=(U=A==null?void 0:A.response)==null?void 0:U.data)==null?void 0:q.detail)||"Failed to destroy container"})}finally{N(!1)}},k=async E=>{f(U=>({...U,[E]:!0}));try{const U=await sr.healthCheck(E);d(q=>({...q,[E]:U})),setTimeout(()=>{d(q=>({...q,[E]:null}))},8e3)}catch{d(U=>({...U,[E]:{status:"error",tools:[]}}))}finally{f(U=>({...U,[E]:!1}))}},y=async E=>{var U,q;N(!0);try{E==="expired"?await sr.cleanup():await sr.cleanupOrphans(),l({type:"success",text:`${E==="expired"?"Expired":"Orphan"} containers cleaned up`}),v(!1)}catch(A){l({type:"error",text:((q=(U=A==null?void 0:A.response)==null?void 0:U.data)==null?void 0:q.detail)||"Cleanup failed"})}finally{N(!1)}};if(n&&!e)return s.jsxs("div",{className:"animate-pulse space-y-6",children:[s.jsx("div",{className:"h-8 bg-dark-800 rounded w-64"}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[1,2,3,4].map(E=>s.jsx("div",{className:"h-24 bg-dark-800 rounded-lg"},E))}),s.jsx("div",{className:"space-y-4",children:[1,2].map(E=>s.jsx("div",{className:"h-40 bg-dark-800 rounded-lg"},E))})]});const u=e==null?void 0:e.pool,g=(e==null?void 0:e.containers)||[],_=u?u.active/u.max_concurrent*100:0;return s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 bg-blue-500/20 rounded-lg flex items-center justify-center",children:s.jsx(o0,{className:"w-6 h-6 text-blue-400"})}),"Sandbox Containers"]}),s.jsx("p",{className:"text-dark-400 mt-1",children:"Real-time monitoring of per-scan Kali Linux containers"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>y("expired"),isLoading:p,children:[s.jsx(Vg,{className:"w-4 h-4 mr-1"}),"Cleanup Expired"]}),s.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>y("orphans"),isLoading:p,children:[s.jsx(Pt,{className:"w-4 h-4 mr-1"}),"Cleanup Orphans"]}),s.jsxs(H,{variant:"secondary",size:"sm",onClick:()=>v(!1),children:[s.jsx(ln,{className:"w-4 h-4 mr-1"}),"Refresh"]})]})]}),a&&s.jsxs("div",{className:`flex items-center gap-2 px-4 py-3 rounded-lg text-sm animate-fadeIn ${a.type==="success"?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:[a.type==="success"?s.jsx(Mn,{className:"w-4 h-4 flex-shrink-0"}):s.jsx(Oe,{className:"w-4 h-4 flex-shrink-0"}),a.text]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[s.jsx(re,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${_>=100?"bg-red-500/20":_>=80?"bg-yellow-500/20":"bg-green-500/20"}`,children:s.jsx(Xd,{className:`w-5 h-5 ${_>=100?"text-red-400":_>=80?"text-yellow-400":"text-green-400"}`})}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-2xl font-bold text-white",children:[(u==null?void 0:u.active)||0,s.jsxs("span",{className:"text-dark-400 text-lg",children:["/",(u==null?void 0:u.max_concurrent)||0]})]}),s.jsx("p",{className:"text-xs text-dark-400",children:"Active Containers"})]})]})}),s.jsx(re,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${u!=null&&u.docker_available?"bg-green-500/20":"bg-red-500/20"}`,children:s.jsx(Tg,{className:`w-5 h-5 ${u!=null&&u.docker_available?"text-green-400":"text-red-400"}`})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-lg font-bold text-white",children:u!=null&&u.docker_available?"Online":"Offline"}),s.jsx("p",{className:"text-xs text-dark-400",children:"Docker Engine"})]})]})}),s.jsx(re,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 bg-purple-500/20 rounded-lg flex items-center justify-center",children:s.jsx(il,{className:"w-5 h-5 text-purple-400"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-bold text-white truncate max-w-[140px]",title:u==null?void 0:u.image,children:((D=(L=u==null?void 0:u.image)==null?void 0:L.split(":")[0])==null?void 0:D.split("/").pop())||"N/A"}),s.jsx("p",{className:"text-xs text-dark-400",children:(R=u==null?void 0:u.image)!=null&&R.includes(":")?u.image.split(":")[1]:"latest"})]})]})}),s.jsx(re,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 bg-orange-500/20 rounded-lg flex items-center justify-center",children:s.jsx(Xt,{className:"w-5 h-5 text-orange-400"})}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-2xl font-bold text-white",children:[(u==null?void 0:u.container_ttl_minutes)||0,s.jsx("span",{className:"text-dark-400 text-lg",children:" min"})]}),s.jsx("p",{className:"text-xs text-dark-400",children:"Container TTL"})]})]})})]}),u&&u.max_concurrent>0&&s.jsxs("div",{className:"bg-dark-800 rounded-lg p-4 border border-dark-700",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-sm text-dark-300",children:"Pool Capacity"}),s.jsxs("span",{className:`text-sm font-medium ${_>=100?"text-red-400":_>=80?"text-yellow-400":"text-green-400"}`,children:[Math.round(_),"%"]})]}),s.jsx("div",{className:"w-full bg-dark-900 rounded-full h-2.5",children:s.jsx("div",{className:`h-2.5 rounded-full transition-all duration-500 ${_>=100?"bg-red-500":_>=80?"bg-yellow-500":"bg-green-500"}`,style:{width:`${Math.min(_,100)}%`}})})]}),g.length===0?s.jsxs("div",{className:"bg-dark-800 rounded-lg border border-dark-700 p-12 text-center",children:[s.jsx(Xd,{className:"w-16 h-16 text-dark-600 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-dark-300 mb-2",children:"No Sandbox Containers Running"}),s.jsx("p",{className:"text-dark-400 text-sm max-w-md mx-auto",children:"Containers are automatically created when scans start and destroyed when they complete. Start a scan to see containers here."})]}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("h2",{className:"text-lg font-semibold text-white",children:["Running Containers (",g.length,")"]}),g.map(E=>{const U=c[E.scan_id],q=m[E.scan_id],A=i===E.scan_id;return s.jsxs("div",{className:"bg-dark-800 rounded-lg border border-dark-700 p-5 hover:border-dark-600 transition-colors",children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`w-3 h-3 rounded-full ${E.available?"bg-green-500 animate-pulse":"bg-red-500"}`}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-white font-medium font-mono text-sm",children:E.container_name}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsx("span",{className:"text-xs text-dark-400",children:"Scan:"}),s.jsxs(nn,{to:`/scan/${E.scan_id}`,className:"text-xs text-primary-400 hover:text-primary-300 font-mono",children:[E.scan_id.slice(0,12),"..."]})]})]})]}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("span",{className:`inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-medium ${E.available?"bg-green-500/10 text-green-400 border border-green-500/30":"bg-red-500/10 text-red-400 border border-red-500/30"}`,children:E.available?s.jsxs(s.Fragment,{children:[s.jsx(Mn,{className:"w-3 h-3"})," Running"]}):s.jsxs(s.Fragment,{children:[s.jsx(Ct,{className:"w-3 h-3"})," Stopped"]})})})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-dark-400 mb-1",children:"Uptime"}),s.jsx("p",{className:"text-sm text-white font-medium",children:Iw(E.uptime_seconds)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-dark-400 mb-1",children:"Created"}),s.jsx("p",{className:"text-sm text-dark-300",children:Mw(E.created_at)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-dark-400 mb-1",children:"Installed Tools"}),s.jsx("p",{className:"text-sm text-white font-medium",children:E.installed_tools.length})]})]}),E.installed_tools.length>0&&s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"text-xs text-dark-400 mb-2",children:"Tools"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:E.installed_tools.map(te=>s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-dark-900 border border-dark-600 rounded text-xs text-dark-300",children:[s.jsx(vr,{className:"w-3 h-3 text-dark-500"}),te]},te))})]}),U&&s.jsxs("div",{className:`mb-4 px-3 py-2 rounded-lg text-xs animate-fadeIn ${U.status==="healthy"?"bg-green-500/10 border border-green-500/20 text-green-400":U.status==="degraded"?"bg-yellow-500/10 border border-yellow-500/20 text-yellow-400":"bg-red-500/10 border border-red-500/20 text-red-400"}`,children:[s.jsxs("span",{className:"font-medium",children:["Health: ",U.status]}),U.tools.length>0&&s.jsxs("span",{className:"ml-2",children:["— Verified: ",U.tools.join(", ")]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-3 border-t border-dark-700",children:[s.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>k(E.scan_id),isLoading:q,children:[s.jsx(Pg,{className:"w-4 h-4 mr-1"}),"Health Check"]}),s.jsxs(H,{variant:A?"danger":"ghost",size:"sm",onClick:()=>w(E.scan_id),isLoading:p,children:[s.jsx(Pt,{className:"w-4 h-4 mr-1"}),A?"Confirm Destroy":"Destroy"]})]})]},E.scan_id)})]}),s.jsx("div",{className:"text-center text-xs text-dark-500",children:"Auto-refreshing every 5 seconds"})]})}function zw(){return s.jsx(Jg,{children:s.jsxs(pg,{children:[s.jsx(tt,{path:"/",element:s.jsx(iw,{})}),s.jsx(tt,{path:"/auto",element:s.jsx(Ew,{})}),s.jsx(tt,{path:"/vuln-lab",element:s.jsx(Tw,{})}),s.jsx(tt,{path:"/terminal",element:s.jsx(Ow,{})}),s.jsx(tt,{path:"/scan/new",element:s.jsx(cw,{})}),s.jsx(tt,{path:"/scan/:scanId",element:s.jsx(uw,{})}),s.jsx(tt,{path:"/agent/:agentId",element:s.jsx(pw,{})}),s.jsx(tt,{path:"/tasks",element:s.jsx(fw,{})}),s.jsx(tt,{path:"/realtime",element:s.jsx(hw,{})}),s.jsx(tt,{path:"/scheduler",element:s.jsx(jw,{})}),s.jsx(tt,{path:"/sandboxes",element:s.jsx(Dw,{})}),s.jsx(tt,{path:"/reports",element:s.jsx(gw,{})}),s.jsx(tt,{path:"/reports/:reportId",element:s.jsx(yw,{})}),s.jsx(tt,{path:"/settings",element:s.jsx(vw,{})})]})})}ji.createRoot(document.getElementById("root")).render(s.jsx(Ro.StrictMode,{children:s.jsx(vg,{children:s.jsx(zw,{})})}));
|
||
//# sourceMappingURL=index-DScaoRL2.js.map
|