Files
Remote-Control-Center/mc_test/dist/renderer/assets/main-D-T5fPSb.js
2025-11-25 09:56:15 +03:00

310 lines
365 KiB
JavaScript
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var tp=Object.defineProperty;var rp=(e,t,r)=>t in e?tp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ke=(e,t,r)=>rp(e,typeof t!="symbol"?t+"":t,r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=r(s);fetch(s.href,a)}})();function gu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function np(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var vu={exports:{}},pi={},ku={exports:{}},Te={};/**
* @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 Js=Symbol.for("react.element"),sp=Symbol.for("react.portal"),ap=Symbol.for("react.fragment"),ip=Symbol.for("react.strict_mode"),op=Symbol.for("react.profiler"),lp=Symbol.for("react.provider"),cp=Symbol.for("react.context"),up=Symbol.for("react.forward_ref"),dp=Symbol.for("react.suspense"),fp=Symbol.for("react.memo"),pp=Symbol.for("react.lazy"),nc=Symbol.iterator;function hp(e){return e===null||typeof e!="object"?null:(e=nc&&e[nc]||e["@@iterator"],typeof e=="function"?e:null)}var wu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Su=Object.assign,bu={};function ts(e,t,r){this.props=e,this.context=t,this.refs=bu,this.updater=r||wu}ts.prototype.isReactComponent={};ts.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")};ts.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Eu(){}Eu.prototype=ts.prototype;function sl(e,t,r){this.props=e,this.context=t,this.refs=bu,this.updater=r||wu}var al=sl.prototype=new Eu;al.constructor=sl;Su(al,ts.prototype);al.isPureReactComponent=!0;var sc=Array.isArray,Nu=Object.prototype.hasOwnProperty,il={current:null},Cu={key:!0,ref:!0,__self:!0,__source:!0};function ju(e,t,r){var n,s={},a=null,l=null;if(t!=null)for(n in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(a=""+t.key),t)Nu.call(t,n)&&!Cu.hasOwnProperty(n)&&(s[n]=t[n]);var u=arguments.length-2;if(u===1)s.children=r;else if(1<u){for(var d=Array(u),m=0;m<u;m++)d[m]=arguments[m+2];s.children=d}if(e&&e.defaultProps)for(n in u=e.defaultProps,u)s[n]===void 0&&(s[n]=u[n]);return{$$typeof:Js,type:e,key:a,ref:l,props:s,_owner:il.current}}function mp(e,t){return{$$typeof:Js,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ol(e){return typeof e=="object"&&e!==null&&e.$$typeof===Js}function xp(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var ac=/\/+/g;function Ri(e,t){return typeof e=="object"&&e!==null&&e.key!=null?xp(""+e.key):t.toString(36)}function ja(e,t,r,n,s){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Js:case sp:l=!0}}if(l)return l=e,s=s(l),e=n===""?"."+Ri(l,0):n,sc(s)?(r="",e!=null&&(r=e.replace(ac,"$&/")+"/"),ja(s,t,r,"",function(m){return m})):s!=null&&(ol(s)&&(s=mp(s,r+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(ac,"$&/")+"/")+e)),t.push(s)),1;if(l=0,n=n===""?".":n+":",sc(e))for(var u=0;u<e.length;u++){a=e[u];var d=n+Ri(a,u);l+=ja(a,t,r,d,s)}else if(d=hp(e),typeof d=="function")for(e=d.call(e),u=0;!(a=e.next()).done;)a=a.value,d=n+Ri(a,u++),l+=ja(a,t,r,d,s);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function la(e,t,r){if(e==null)return e;var n=[],s=0;return ja(e,n,"","",function(a){return t.call(r,a,s++)}),n}function yp(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Dt={current:null},_a={transition:null},gp={ReactCurrentDispatcher:Dt,ReactCurrentBatchConfig:_a,ReactCurrentOwner:il};Te.Children={map:la,forEach:function(e,t,r){la(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return la(e,function(){t++}),t},toArray:function(e){return la(e,function(t){return t})||[]},only:function(e){if(!ol(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Te.Component=ts;Te.Fragment=ap;Te.Profiler=op;Te.PureComponent=sl;Te.StrictMode=ip;Te.Suspense=dp;Te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gp;Te.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=Su({},e.props),s=e.key,a=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,l=il.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(d in t)Nu.call(t,d)&&!Cu.hasOwnProperty(d)&&(n[d]=t[d]===void 0&&u!==void 0?u[d]:t[d])}var d=arguments.length-2;if(d===1)n.children=r;else if(1<d){u=Array(d);for(var m=0;m<d;m++)u[m]=arguments[m+2];n.children=u}return{$$typeof:Js,type:e.type,key:s,ref:a,props:n,_owner:l}};Te.createContext=function(e){return e={$$typeof:cp,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:lp,_context:e},e.Consumer=e};Te.createElement=ju;Te.createFactory=function(e){var t=ju.bind(null,e);return t.type=e,t};Te.createRef=function(){return{current:null}};Te.forwardRef=function(e){return{$$typeof:up,render:e}};Te.isValidElement=ol;Te.lazy=function(e){return{$$typeof:pp,_payload:{_status:-1,_result:e},_init:yp}};Te.memo=function(e,t){return{$$typeof:fp,type:e,compare:t===void 0?null:t}};Te.startTransition=function(e){var t=_a.transition;_a.transition={};try{e()}finally{_a.transition=t}};Te.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Te.useCallback=function(e,t){return Dt.current.useCallback(e,t)};Te.useContext=function(e){return Dt.current.useContext(e)};Te.useDebugValue=function(){};Te.useDeferredValue=function(e){return Dt.current.useDeferredValue(e)};Te.useEffect=function(e,t){return Dt.current.useEffect(e,t)};Te.useId=function(){return Dt.current.useId()};Te.useImperativeHandle=function(e,t,r){return Dt.current.useImperativeHandle(e,t,r)};Te.useInsertionEffect=function(e,t){return Dt.current.useInsertionEffect(e,t)};Te.useLayoutEffect=function(e,t){return Dt.current.useLayoutEffect(e,t)};Te.useMemo=function(e,t){return Dt.current.useMemo(e,t)};Te.useReducer=function(e,t,r){return Dt.current.useReducer(e,t,r)};Te.useRef=function(e){return Dt.current.useRef(e)};Te.useState=function(e){return Dt.current.useState(e)};Te.useSyncExternalStore=function(e,t,r){return Dt.current.useSyncExternalStore(e,t,r)};Te.useTransition=function(){return Dt.current.useTransition()};Te.version="18.2.0";ku.exports=Te;var $=ku.exports;const _u=gu($);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var vp=$,kp=Symbol.for("react.element"),wp=Symbol.for("react.fragment"),Sp=Object.prototype.hasOwnProperty,bp=vp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ep={key:!0,ref:!0,__self:!0,__source:!0};function Tu(e,t,r){var n,s={},a=null,l=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(l=t.ref);for(n in t)Sp.call(t,n)&&!Ep.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:kp,type:e,key:a,ref:l,props:s,_owner:bp.current}}pi.Fragment=wp;pi.jsx=Tu;pi.jsxs=Tu;vu.exports=pi;var i=vu.exports,co={},Pu={exports:{}},qt={},Mu={exports:{}},Au={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function t(Q,ue){var ye=Q.length;Q.push(ue);e:for(;0<ye;){var Be=ye-1>>>1,He=Q[Be];if(0<s(He,ue))Q[Be]=ue,Q[ye]=He,ye=Be;else break e}}function r(Q){return Q.length===0?null:Q[0]}function n(Q){if(Q.length===0)return null;var ue=Q[0],ye=Q.pop();if(ye!==ue){Q[0]=ye;e:for(var Be=0,He=Q.length,mt=He>>>1;Be<mt;){var ot=2*(Be+1)-1,Ce=Q[ot],Qe=ot+1,rt=Q[Qe];if(0>s(Ce,ye))Qe<He&&0>s(rt,Ce)?(Q[Be]=rt,Q[Qe]=ye,Be=Qe):(Q[Be]=Ce,Q[ot]=ye,Be=ot);else if(Qe<He&&0>s(rt,ye))Q[Be]=rt,Q[Qe]=ye,Be=Qe;else break e}}return ue}function s(Q,ue){var ye=Q.sortIndex-ue.sortIndex;return ye!==0?ye:Q.id-ue.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],m=[],v=1,E=null,N=3,C=!1,b=!1,w=!1,L=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(Q){for(var ue=r(m);ue!==null;){if(ue.callback===null)n(m);else if(ue.startTime<=Q)n(m),ue.sortIndex=ue.expirationTime,t(d,ue);else break;ue=r(m)}}function I(Q){if(w=!1,S(Q),!b)if(r(d)!==null)b=!0,vt(A);else{var ue=r(m);ue!==null&&or(I,ue.startTime-Q)}}function A(Q,ue){b=!1,w&&(w=!1,g(H),H=-1),C=!0;var ye=N;try{for(S(ue),E=r(d);E!==null&&(!(E.expirationTime>ue)||Q&&!Fe());){var Be=E.callback;if(typeof Be=="function"){E.callback=null,N=E.priorityLevel;var He=Be(E.expirationTime<=ue);ue=e.unstable_now(),typeof He=="function"?E.callback=He:E===r(d)&&n(d),S(ue)}else n(d);E=r(d)}if(E!==null)var mt=!0;else{var ot=r(m);ot!==null&&or(I,ot.startTime-ue),mt=!1}return mt}finally{E=null,N=ye,C=!1}}var O=!1,R=null,H=-1,de=5,le=-1;function Fe(){return!(e.unstable_now()-le<de)}function Ze(){if(R!==null){var Q=e.unstable_now();le=Q;var ue=!0;try{ue=R(!0,Q)}finally{ue?oe():(O=!1,R=null)}}else O=!1}var oe;if(typeof y=="function")oe=function(){y(Ze)};else if(typeof MessageChannel<"u"){var tt=new MessageChannel,Vt=tt.port2;tt.port1.onmessage=Ze,oe=function(){Vt.postMessage(null)}}else oe=function(){L(Ze,0)};function vt(Q){R=Q,O||(O=!0,oe())}function or(Q,ue){H=L(function(){Q(e.unstable_now())},ue)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Q){Q.callback=null},e.unstable_continueExecution=function(){b||C||(b=!0,vt(A))},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):de=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return N},e.unstable_getFirstCallbackNode=function(){return r(d)},e.unstable_next=function(Q){switch(N){case 1:case 2:case 3:var ue=3;break;default:ue=N}var ye=N;N=ue;try{return Q()}finally{N=ye}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Q,ue){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var ye=N;N=Q;try{return ue()}finally{N=ye}},e.unstable_scheduleCallback=function(Q,ue,ye){var Be=e.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?Be+ye:Be):ye=Be,Q){case 1:var He=-1;break;case 2:He=250;break;case 5:He=1073741823;break;case 4:He=1e4;break;default:He=5e3}return He=ye+He,Q={id:v++,callback:ue,priorityLevel:Q,startTime:ye,expirationTime:He,sortIndex:-1},ye>Be?(Q.sortIndex=ye,t(m,Q),r(d)===null&&Q===r(m)&&(w?(g(H),H=-1):w=!0,or(I,ye-Be))):(Q.sortIndex=He,t(d,Q),b||C||(b=!0,vt(A))),Q},e.unstable_shouldYield=Fe,e.unstable_wrapCallback=function(Q){var ue=N;return function(){var ye=N;N=ue;try{return Q.apply(this,arguments)}finally{N=ye}}}})(Au);Mu.exports=Au;var Np=Mu.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 Iu=$,Xt=Np;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Lu=new Set,As={};function Sn(e,t){Wn(e,t),Wn(e+"Capture",t)}function Wn(e,t){for(As[e]=t,e=0;e<t.length;e++)Lu.add(t[e])}var Tr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uo=Object.prototype.hasOwnProperty,Cp=/^[: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]*$/,ic={},oc={};function jp(e){return uo.call(oc,e)?!0:uo.call(ic,e)?!1:Cp.test(e)?oc[e]=!0:(ic[e]=!0,!1)}function _p(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Tp(e,t,r,n){if(t===null||typeof t>"u"||_p(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 Ut(e,t,r,n,s,a,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=l}var Nt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Nt[e]=new Ut(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 Ut(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Nt[e]=new Ut(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Nt[e]=new Ut(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 Ut(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Nt[e]=new Ut(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Nt[e]=new Ut(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Nt[e]=new Ut(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Nt[e]=new Ut(e,5,!1,e.toLowerCase(),null,!1,!1)});var ll=/[\-:]([a-z])/g;function cl(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(ll,cl);Nt[t]=new Ut(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(ll,cl);Nt[t]=new Ut(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(ll,cl);Nt[t]=new Ut(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Nt[e]=new Ut(e,1,!1,e.toLowerCase(),null,!1,!1)});Nt.xlinkHref=new Ut("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Nt[e]=new Ut(e,1,!1,e.toLowerCase(),null,!0,!0)});function ul(e,t,r,n){var s=Nt.hasOwnProperty(t)?Nt[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Tp(t,r,s,n)&&(r=null),n||s===null?jp(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Ir=Iu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ca=Symbol.for("react.element"),_n=Symbol.for("react.portal"),Tn=Symbol.for("react.fragment"),dl=Symbol.for("react.strict_mode"),fo=Symbol.for("react.profiler"),Ru=Symbol.for("react.provider"),zu=Symbol.for("react.context"),fl=Symbol.for("react.forward_ref"),po=Symbol.for("react.suspense"),ho=Symbol.for("react.suspense_list"),pl=Symbol.for("react.memo"),Rr=Symbol.for("react.lazy"),Du=Symbol.for("react.offscreen"),lc=Symbol.iterator;function ls(e){return e===null||typeof e!="object"?null:(e=lc&&e[lc]||e["@@iterator"],typeof e=="function"?e:null)}var et=Object.assign,zi;function gs(e){if(zi===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);zi=t&&t[1]||""}return`
`+zi+e}var Di=!1;function Ui(e,t){if(!e||Di)return"";Di=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(m){var n=m}Reflect.construct(e,[],t)}else{try{t.call()}catch(m){n=m}e.call(t.prototype)}else{try{throw Error()}catch(m){n=m}e()}}catch(m){if(m&&n&&typeof m.stack=="string"){for(var s=m.stack.split(`
`),a=n.stack.split(`
`),l=s.length-1,u=a.length-1;1<=l&&0<=u&&s[l]!==a[u];)u--;for(;1<=l&&0<=u;l--,u--)if(s[l]!==a[u]){if(l!==1||u!==1)do if(l--,u--,0>u||s[l]!==a[u]){var d=`
`+s[l].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=l&&0<=u);break}}}finally{Di=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?gs(e):""}function Pp(e){switch(e.tag){case 5:return gs(e.type);case 16:return gs("Lazy");case 13:return gs("Suspense");case 19:return gs("SuspenseList");case 0:case 2:case 15:return e=Ui(e.type,!1),e;case 11:return e=Ui(e.type.render,!1),e;case 1:return e=Ui(e.type,!0),e;default:return""}}function mo(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 Tn:return"Fragment";case _n:return"Portal";case fo:return"Profiler";case dl:return"StrictMode";case po:return"Suspense";case ho:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zu:return(e.displayName||"Context")+".Consumer";case Ru:return(e._context.displayName||"Context")+".Provider";case fl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pl:return t=e.displayName||null,t!==null?t:mo(e.type)||"Memo";case Rr:t=e._payload,e=e._init;try{return mo(e(t))}catch{}}return null}function Mp(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 mo(t);case 8:return t===dl?"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 Zr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Uu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ap(e){var t=Uu(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){n=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(l){n=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ua(e){e._valueTracker||(e._valueTracker=Ap(e))}function Ou(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Uu(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function $a(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 xo(e,t){var r=t.checked;return et({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function cc(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Zr(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $u(e,t){t=t.checked,t!=null&&ul(e,"checked",t,!1)}function yo(e,t){$u(e,t);var r=Zr(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?go(e,t.type,r):t.hasOwnProperty("defaultValue")&&go(e,t.type,Zr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function uc(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function go(e,t,r){(t!=="number"||$a(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var vs=Array.isArray;function $n(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Zr(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function vo(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return et({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function dc(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(K(92));if(vs(r)){if(1<r.length)throw Error(K(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Zr(r)}}function Fu(e,t){var r=Zr(t.value),n=Zr(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function fc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Hu(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ko(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Hu(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var da,Bu=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(da=da||document.createElement("div"),da.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=da.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Is(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var bs={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},Ip=["Webkit","ms","Moz","O"];Object.keys(bs).forEach(function(e){Ip.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),bs[t]=bs[e]})});function Vu(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||bs.hasOwnProperty(e)&&bs[e]?(""+t).trim():t+"px"}function Ku(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Vu(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var Lp=et({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 wo(e,t){if(t){if(Lp[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function So(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 bo=null;function hl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Eo=null,Fn=null,Hn=null;function pc(e){if(e=qs(e)){if(typeof Eo!="function")throw Error(K(280));var t=e.stateNode;t&&(t=gi(t),Eo(e.stateNode,e.type,t))}}function Wu(e){Fn?Hn?Hn.push(e):Hn=[e]:Fn=e}function Yu(){if(Fn){var e=Fn,t=Hn;if(Hn=Fn=null,pc(e),t)for(e=0;e<t.length;e++)pc(t[e])}}function Gu(e,t){return e(t)}function Qu(){}var Oi=!1;function Ju(e,t,r){if(Oi)return e(t,r);Oi=!0;try{return Gu(e,t,r)}finally{Oi=!1,(Fn!==null||Hn!==null)&&(Qu(),Yu())}}function Ls(e,t){var r=e.stateNode;if(r===null)return null;var n=gi(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(K(231,t,typeof r));return r}var No=!1;if(Tr)try{var cs={};Object.defineProperty(cs,"passive",{get:function(){No=!0}}),window.addEventListener("test",cs,cs),window.removeEventListener("test",cs,cs)}catch{No=!1}function Rp(e,t,r,n,s,a,l,u,d){var m=Array.prototype.slice.call(arguments,3);try{t.apply(r,m)}catch(v){this.onError(v)}}var Es=!1,Fa=null,Ha=!1,Co=null,zp={onError:function(e){Es=!0,Fa=e}};function Dp(e,t,r,n,s,a,l,u,d){Es=!1,Fa=null,Rp.apply(zp,arguments)}function Up(e,t,r,n,s,a,l,u,d){if(Dp.apply(this,arguments),Es){if(Es){var m=Fa;Es=!1,Fa=null}else throw Error(K(198));Ha||(Ha=!0,Co=m)}}function bn(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Zu(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function hc(e){if(bn(e)!==e)throw Error(K(188))}function Op(e){var t=e.alternate;if(!t){if(t=bn(e),t===null)throw Error(K(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var a=s.alternate;if(a===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===a.child){for(a=s.child;a;){if(a===r)return hc(s),e;if(a===n)return hc(s),t;a=a.sibling}throw Error(K(188))}if(r.return!==n.return)r=s,n=a;else{for(var l=!1,u=s.child;u;){if(u===r){l=!0,r=s,n=a;break}if(u===n){l=!0,n=s,r=a;break}u=u.sibling}if(!l){for(u=a.child;u;){if(u===r){l=!0,r=a,n=s;break}if(u===n){l=!0,n=a,r=s;break}u=u.sibling}if(!l)throw Error(K(189))}}if(r.alternate!==n)throw Error(K(190))}if(r.tag!==3)throw Error(K(188));return r.stateNode.current===r?e:t}function Xu(e){return e=Op(e),e!==null?qu(e):null}function qu(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=qu(e);if(t!==null)return t;e=e.sibling}return null}var ed=Xt.unstable_scheduleCallback,mc=Xt.unstable_cancelCallback,$p=Xt.unstable_shouldYield,Fp=Xt.unstable_requestPaint,ct=Xt.unstable_now,Hp=Xt.unstable_getCurrentPriorityLevel,ml=Xt.unstable_ImmediatePriority,td=Xt.unstable_UserBlockingPriority,Ba=Xt.unstable_NormalPriority,Bp=Xt.unstable_LowPriority,rd=Xt.unstable_IdlePriority,hi=null,vr=null;function Vp(e){if(vr&&typeof vr.onCommitFiberRoot=="function")try{vr.onCommitFiberRoot(hi,e,void 0,(e.current.flags&128)===128)}catch{}}var pr=Math.clz32?Math.clz32:Yp,Kp=Math.log,Wp=Math.LN2;function Yp(e){return e>>>=0,e===0?32:31-(Kp(e)/Wp|0)|0}var fa=64,pa=4194304;function ks(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 Va(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,a=e.pingedLanes,l=r&268435455;if(l!==0){var u=l&~s;u!==0?n=ks(u):(a&=l,a!==0&&(n=ks(a)))}else l=r&~s,l!==0?n=ks(l):a!==0&&(n=ks(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-pr(t),s=1<<r,n|=e[r],t&=~s;return n}function Gp(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qp(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-pr(a),u=1<<l,d=s[l];d===-1?(!(u&r)||u&n)&&(s[l]=Gp(u,t)):d<=t&&(e.expiredLanes|=u),a&=~u}}function jo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function nd(){var e=fa;return fa<<=1,!(fa&4194240)&&(fa=64),e}function $i(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Zs(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pr(t),e[t]=r}function Jp(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-pr(r),a=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~a}}function xl(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-pr(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var $e=0;function sd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var ad,yl,id,od,ld,_o=!1,ha=[],Hr=null,Br=null,Vr=null,Rs=new Map,zs=new Map,Ur=[],Zp="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function xc(e,t){switch(e){case"focusin":case"focusout":Hr=null;break;case"dragenter":case"dragleave":Br=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":Rs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":zs.delete(t.pointerId)}}function us(e,t,r,n,s,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[s]},t!==null&&(t=qs(t),t!==null&&yl(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Xp(e,t,r,n,s){switch(t){case"focusin":return Hr=us(Hr,e,t,r,n,s),!0;case"dragenter":return Br=us(Br,e,t,r,n,s),!0;case"mouseover":return Vr=us(Vr,e,t,r,n,s),!0;case"pointerover":var a=s.pointerId;return Rs.set(a,us(Rs.get(a)||null,e,t,r,n,s)),!0;case"gotpointercapture":return a=s.pointerId,zs.set(a,us(zs.get(a)||null,e,t,r,n,s)),!0}return!1}function cd(e){var t=fn(e.target);if(t!==null){var r=bn(t);if(r!==null){if(t=r.tag,t===13){if(t=Zu(r),t!==null){e.blockedOn=t,ld(e.priority,function(){id(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ta(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=To(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);bo=n,r.target.dispatchEvent(n),bo=null}else return t=qs(r),t!==null&&yl(t),e.blockedOn=r,!1;t.shift()}return!0}function yc(e,t,r){Ta(e)&&r.delete(t)}function qp(){_o=!1,Hr!==null&&Ta(Hr)&&(Hr=null),Br!==null&&Ta(Br)&&(Br=null),Vr!==null&&Ta(Vr)&&(Vr=null),Rs.forEach(yc),zs.forEach(yc)}function ds(e,t){e.blockedOn===t&&(e.blockedOn=null,_o||(_o=!0,Xt.unstable_scheduleCallback(Xt.unstable_NormalPriority,qp)))}function Ds(e){function t(s){return ds(s,e)}if(0<ha.length){ds(ha[0],e);for(var r=1;r<ha.length;r++){var n=ha[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Hr!==null&&ds(Hr,e),Br!==null&&ds(Br,e),Vr!==null&&ds(Vr,e),Rs.forEach(t),zs.forEach(t),r=0;r<Ur.length;r++)n=Ur[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Ur.length&&(r=Ur[0],r.blockedOn===null);)cd(r),r.blockedOn===null&&Ur.shift()}var Bn=Ir.ReactCurrentBatchConfig,Ka=!0;function eh(e,t,r,n){var s=$e,a=Bn.transition;Bn.transition=null;try{$e=1,gl(e,t,r,n)}finally{$e=s,Bn.transition=a}}function th(e,t,r,n){var s=$e,a=Bn.transition;Bn.transition=null;try{$e=4,gl(e,t,r,n)}finally{$e=s,Bn.transition=a}}function gl(e,t,r,n){if(Ka){var s=To(e,t,r,n);if(s===null)Ji(e,t,n,Wa,r),xc(e,n);else if(Xp(s,e,t,r,n))n.stopPropagation();else if(xc(e,n),t&4&&-1<Zp.indexOf(e)){for(;s!==null;){var a=qs(s);if(a!==null&&ad(a),a=To(e,t,r,n),a===null&&Ji(e,t,n,Wa,r),a===s)break;s=a}s!==null&&n.stopPropagation()}else Ji(e,t,n,null,r)}}var Wa=null;function To(e,t,r,n){if(Wa=null,e=hl(n),e=fn(e),e!==null)if(t=bn(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Zu(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Wa=e,null}function ud(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Hp()){case ml:return 1;case td:return 4;case Ba:case Bp:return 16;case rd:return 536870912;default:return 16}default:return 16}}var $r=null,vl=null,Pa=null;function dd(){if(Pa)return Pa;var e,t=vl,r=t.length,n,s="value"in $r?$r.value:$r.textContent,a=s.length;for(e=0;e<r&&t[e]===s[e];e++);var l=r-e;for(n=1;n<=l&&t[r-n]===s[a-n];n++);return Pa=s.slice(e,1<n?1-n:void 0)}function Ma(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ma(){return!0}function gc(){return!1}function er(e){function t(r,n,s,a,l){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=a,this.target=l,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(r=e[u],this[u]=r?r(a):a[u]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?ma:gc,this.isPropagationStopped=gc,this}return et(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=ma)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ma)},persist:function(){},isPersistent:ma}),t}var rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kl=er(rs),Xs=et({},rs,{view:0,detail:0}),rh=er(Xs),Fi,Hi,fs,mi=et({},Xs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wl,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==fs&&(fs&&e.type==="mousemove"?(Fi=e.screenX-fs.screenX,Hi=e.screenY-fs.screenY):Hi=Fi=0,fs=e),Fi)},movementY:function(e){return"movementY"in e?e.movementY:Hi}}),vc=er(mi),nh=et({},mi,{dataTransfer:0}),sh=er(nh),ah=et({},Xs,{relatedTarget:0}),Bi=er(ah),ih=et({},rs,{animationName:0,elapsedTime:0,pseudoElement:0}),oh=er(ih),lh=et({},rs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ch=er(lh),uh=et({},rs,{data:0}),kc=er(uh),dh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fh={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ph={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ph[e])?!!t[e]:!1}function wl(){return hh}var mh=et({},Xs,{key:function(e){if(e.key){var t=dh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ma(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wl,charCode:function(e){return e.type==="keypress"?Ma(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ma(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),xh=er(mh),yh=et({},mi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wc=er(yh),gh=et({},Xs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wl}),vh=er(gh),kh=et({},rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),wh=er(kh),Sh=et({},mi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),bh=er(Sh),Eh=[9,13,27,32],Sl=Tr&&"CompositionEvent"in window,Ns=null;Tr&&"documentMode"in document&&(Ns=document.documentMode);var Nh=Tr&&"TextEvent"in window&&!Ns,fd=Tr&&(!Sl||Ns&&8<Ns&&11>=Ns),Sc=" ",bc=!1;function pd(e,t){switch(e){case"keyup":return Eh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pn=!1;function Ch(e,t){switch(e){case"compositionend":return hd(t);case"keypress":return t.which!==32?null:(bc=!0,Sc);case"textInput":return e=t.data,e===Sc&&bc?null:e;default:return null}}function jh(e,t){if(Pn)return e==="compositionend"||!Sl&&pd(e,t)?(e=dd(),Pa=vl=$r=null,Pn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return fd&&t.locale!=="ko"?null:t.data;default:return null}}var _h={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ec(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_h[e.type]:t==="textarea"}function md(e,t,r,n){Wu(n),t=Ya(t,"onChange"),0<t.length&&(r=new kl("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Cs=null,Us=null;function Th(e){Cd(e,0)}function xi(e){var t=In(e);if(Ou(t))return e}function Ph(e,t){if(e==="change")return t}var xd=!1;if(Tr){var Vi;if(Tr){var Ki="oninput"in document;if(!Ki){var Nc=document.createElement("div");Nc.setAttribute("oninput","return;"),Ki=typeof Nc.oninput=="function"}Vi=Ki}else Vi=!1;xd=Vi&&(!document.documentMode||9<document.documentMode)}function Cc(){Cs&&(Cs.detachEvent("onpropertychange",yd),Us=Cs=null)}function yd(e){if(e.propertyName==="value"&&xi(Us)){var t=[];md(t,Us,e,hl(e)),Ju(Th,t)}}function Mh(e,t,r){e==="focusin"?(Cc(),Cs=t,Us=r,Cs.attachEvent("onpropertychange",yd)):e==="focusout"&&Cc()}function Ah(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return xi(Us)}function Ih(e,t){if(e==="click")return xi(t)}function Lh(e,t){if(e==="input"||e==="change")return xi(t)}function Rh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mr=typeof Object.is=="function"?Object.is:Rh;function Os(e,t){if(mr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!uo.call(t,s)||!mr(e[s],t[s]))return!1}return!0}function jc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _c(e,t){var r=jc(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=jc(r)}}function gd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vd(){for(var e=window,t=$a();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=$a(e.document)}return t}function bl(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 zh(e){var t=vd(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&gd(r.ownerDocument.documentElement,r)){if(n!==null&&bl(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,a=Math.min(n.start,s);n=n.end===void 0?a:Math.min(n.end,s),!e.extend&&a>n&&(s=n,n=a,a=s),s=_c(r,a);var l=_c(r,n);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Dh=Tr&&"documentMode"in document&&11>=document.documentMode,Mn=null,Po=null,js=null,Mo=!1;function Tc(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Mo||Mn==null||Mn!==$a(n)||(n=Mn,"selectionStart"in n&&bl(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),js&&Os(js,n)||(js=n,n=Ya(Po,"onSelect"),0<n.length&&(t=new kl("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Mn)))}function xa(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var An={animationend:xa("Animation","AnimationEnd"),animationiteration:xa("Animation","AnimationIteration"),animationstart:xa("Animation","AnimationStart"),transitionend:xa("Transition","TransitionEnd")},Wi={},kd={};Tr&&(kd=document.createElement("div").style,"AnimationEvent"in window||(delete An.animationend.animation,delete An.animationiteration.animation,delete An.animationstart.animation),"TransitionEvent"in window||delete An.transitionend.transition);function yi(e){if(Wi[e])return Wi[e];if(!An[e])return e;var t=An[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in kd)return Wi[e]=t[r];return e}var wd=yi("animationend"),Sd=yi("animationiteration"),bd=yi("animationstart"),Ed=yi("transitionend"),Nd=new Map,Pc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function qr(e,t){Nd.set(e,t),Sn(t,[e])}for(var Yi=0;Yi<Pc.length;Yi++){var Gi=Pc[Yi],Uh=Gi.toLowerCase(),Oh=Gi[0].toUpperCase()+Gi.slice(1);qr(Uh,"on"+Oh)}qr(wd,"onAnimationEnd");qr(Sd,"onAnimationIteration");qr(bd,"onAnimationStart");qr("dblclick","onDoubleClick");qr("focusin","onFocus");qr("focusout","onBlur");qr(Ed,"onTransitionEnd");Wn("onMouseEnter",["mouseout","mouseover"]);Wn("onMouseLeave",["mouseout","mouseover"]);Wn("onPointerEnter",["pointerout","pointerover"]);Wn("onPointerLeave",["pointerout","pointerover"]);Sn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Sn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Sn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Sn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Sn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Sn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ws="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),$h=new Set("cancel close invalid load scroll toggle".split(" ").concat(ws));function Mc(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,Up(n,t,void 0,e),e.currentTarget=null}function Cd(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var l=n.length-1;0<=l;l--){var u=n[l],d=u.instance,m=u.currentTarget;if(u=u.listener,d!==a&&s.isPropagationStopped())break e;Mc(s,u,m),a=d}else for(l=0;l<n.length;l++){if(u=n[l],d=u.instance,m=u.currentTarget,u=u.listener,d!==a&&s.isPropagationStopped())break e;Mc(s,u,m),a=d}}}if(Ha)throw e=Co,Ha=!1,Co=null,e}function We(e,t){var r=t[zo];r===void 0&&(r=t[zo]=new Set);var n=e+"__bubble";r.has(n)||(jd(t,e,2,!1),r.add(n))}function Qi(e,t,r){var n=0;t&&(n|=4),jd(r,e,n,t)}var ya="_reactListening"+Math.random().toString(36).slice(2);function $s(e){if(!e[ya]){e[ya]=!0,Lu.forEach(function(r){r!=="selectionchange"&&($h.has(r)||Qi(r,!1,e),Qi(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ya]||(t[ya]=!0,Qi("selectionchange",!1,t))}}function jd(e,t,r,n){switch(ud(t)){case 1:var s=eh;break;case 4:s=th;break;default:s=gl}r=s.bind(null,t,r,e),s=void 0,!No||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Ji(e,t,r,n,s){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var u=n.stateNode.containerInfo;if(u===s||u.nodeType===8&&u.parentNode===s)break;if(l===4)for(l=n.return;l!==null;){var d=l.tag;if((d===3||d===4)&&(d=l.stateNode.containerInfo,d===s||d.nodeType===8&&d.parentNode===s))return;l=l.return}for(;u!==null;){if(l=fn(u),l===null)return;if(d=l.tag,d===5||d===6){n=a=l;continue e}u=u.parentNode}}n=n.return}Ju(function(){var m=a,v=hl(r),E=[];e:{var N=Nd.get(e);if(N!==void 0){var C=kl,b=e;switch(e){case"keypress":if(Ma(r)===0)break e;case"keydown":case"keyup":C=xh;break;case"focusin":b="focus",C=Bi;break;case"focusout":b="blur",C=Bi;break;case"beforeblur":case"afterblur":C=Bi;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":C=vc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":C=sh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":C=vh;break;case wd:case Sd:case bd:C=oh;break;case Ed:C=wh;break;case"scroll":C=rh;break;case"wheel":C=bh;break;case"copy":case"cut":case"paste":C=ch;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":C=wc}var w=(t&4)!==0,L=!w&&e==="scroll",g=w?N!==null?N+"Capture":null:N;w=[];for(var y=m,S;y!==null;){S=y;var I=S.stateNode;if(S.tag===5&&I!==null&&(S=I,g!==null&&(I=Ls(y,g),I!=null&&w.push(Fs(y,I,S)))),L)break;y=y.return}0<w.length&&(N=new C(N,b,null,r,v),E.push({event:N,listeners:w}))}}if(!(t&7)){e:{if(N=e==="mouseover"||e==="pointerover",C=e==="mouseout"||e==="pointerout",N&&r!==bo&&(b=r.relatedTarget||r.fromElement)&&(fn(b)||b[Pr]))break e;if((C||N)&&(N=v.window===v?v:(N=v.ownerDocument)?N.defaultView||N.parentWindow:window,C?(b=r.relatedTarget||r.toElement,C=m,b=b?fn(b):null,b!==null&&(L=bn(b),b!==L||b.tag!==5&&b.tag!==6)&&(b=null)):(C=null,b=m),C!==b)){if(w=vc,I="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(w=wc,I="onPointerLeave",g="onPointerEnter",y="pointer"),L=C==null?N:In(C),S=b==null?N:In(b),N=new w(I,y+"leave",C,r,v),N.target=L,N.relatedTarget=S,I=null,fn(v)===m&&(w=new w(g,y+"enter",b,r,v),w.target=S,w.relatedTarget=L,I=w),L=I,C&&b)t:{for(w=C,g=b,y=0,S=w;S;S=jn(S))y++;for(S=0,I=g;I;I=jn(I))S++;for(;0<y-S;)w=jn(w),y--;for(;0<S-y;)g=jn(g),S--;for(;y--;){if(w===g||g!==null&&w===g.alternate)break t;w=jn(w),g=jn(g)}w=null}else w=null;C!==null&&Ac(E,N,C,w,!1),b!==null&&L!==null&&Ac(E,L,b,w,!0)}}e:{if(N=m?In(m):window,C=N.nodeName&&N.nodeName.toLowerCase(),C==="select"||C==="input"&&N.type==="file")var A=Ph;else if(Ec(N))if(xd)A=Lh;else{A=Ah;var O=Mh}else(C=N.nodeName)&&C.toLowerCase()==="input"&&(N.type==="checkbox"||N.type==="radio")&&(A=Ih);if(A&&(A=A(e,m))){md(E,A,r,v);break e}O&&O(e,N,m),e==="focusout"&&(O=N._wrapperState)&&O.controlled&&N.type==="number"&&go(N,"number",N.value)}switch(O=m?In(m):window,e){case"focusin":(Ec(O)||O.contentEditable==="true")&&(Mn=O,Po=m,js=null);break;case"focusout":js=Po=Mn=null;break;case"mousedown":Mo=!0;break;case"contextmenu":case"mouseup":case"dragend":Mo=!1,Tc(E,r,v);break;case"selectionchange":if(Dh)break;case"keydown":case"keyup":Tc(E,r,v)}var R;if(Sl)e:{switch(e){case"compositionstart":var H="onCompositionStart";break e;case"compositionend":H="onCompositionEnd";break e;case"compositionupdate":H="onCompositionUpdate";break e}H=void 0}else Pn?pd(e,r)&&(H="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(H="onCompositionStart");H&&(fd&&r.locale!=="ko"&&(Pn||H!=="onCompositionStart"?H==="onCompositionEnd"&&Pn&&(R=dd()):($r=v,vl="value"in $r?$r.value:$r.textContent,Pn=!0)),O=Ya(m,H),0<O.length&&(H=new kc(H,e,null,r,v),E.push({event:H,listeners:O}),R?H.data=R:(R=hd(r),R!==null&&(H.data=R)))),(R=Nh?Ch(e,r):jh(e,r))&&(m=Ya(m,"onBeforeInput"),0<m.length&&(v=new kc("onBeforeInput","beforeinput",null,r,v),E.push({event:v,listeners:m}),v.data=R))}Cd(E,t)})}function Fs(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Ya(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,a=s.stateNode;s.tag===5&&a!==null&&(s=a,a=Ls(e,r),a!=null&&n.unshift(Fs(e,a,s)),a=Ls(e,t),a!=null&&n.push(Fs(e,a,s))),e=e.return}return n}function jn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ac(e,t,r,n,s){for(var a=t._reactName,l=[];r!==null&&r!==n;){var u=r,d=u.alternate,m=u.stateNode;if(d!==null&&d===n)break;u.tag===5&&m!==null&&(u=m,s?(d=Ls(r,a),d!=null&&l.unshift(Fs(r,d,u))):s||(d=Ls(r,a),d!=null&&l.push(Fs(r,d,u)))),r=r.return}l.length!==0&&e.push({event:t,listeners:l})}var Fh=/\r\n?/g,Hh=/\u0000|\uFFFD/g;function Ic(e){return(typeof e=="string"?e:""+e).replace(Fh,`
`).replace(Hh,"")}function ga(e,t,r){if(t=Ic(t),Ic(e)!==t&&r)throw Error(K(425))}function Ga(){}var Ao=null,Io=null;function Lo(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ro=typeof setTimeout=="function"?setTimeout:void 0,Bh=typeof clearTimeout=="function"?clearTimeout:void 0,Lc=typeof Promise=="function"?Promise:void 0,Vh=typeof queueMicrotask=="function"?queueMicrotask:typeof Lc<"u"?function(e){return Lc.resolve(null).then(e).catch(Kh)}:Ro;function Kh(e){setTimeout(function(){throw e})}function Zi(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),Ds(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);Ds(t)}function Kr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Rc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var ns=Math.random().toString(36).slice(2),gr="__reactFiber$"+ns,Hs="__reactProps$"+ns,Pr="__reactContainer$"+ns,zo="__reactEvents$"+ns,Wh="__reactListeners$"+ns,Yh="__reactHandles$"+ns;function fn(e){var t=e[gr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Pr]||r[gr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Rc(e);e!==null;){if(r=e[gr])return r;e=Rc(e)}return t}e=r,r=e.parentNode}return null}function qs(e){return e=e[gr]||e[Pr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function In(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function gi(e){return e[Hs]||null}var Do=[],Ln=-1;function en(e){return{current:e}}function Ye(e){0>Ln||(e.current=Do[Ln],Do[Ln]=null,Ln--)}function Ke(e,t){Ln++,Do[Ln]=e.current,e.current=t}var Xr={},Lt=en(Xr),Ft=en(!1),yn=Xr;function Yn(e,t){var r=e.type.contextTypes;if(!r)return Xr;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in r)s[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ht(e){return e=e.childContextTypes,e!=null}function Qa(){Ye(Ft),Ye(Lt)}function zc(e,t,r){if(Lt.current!==Xr)throw Error(K(168));Ke(Lt,t),Ke(Ft,r)}function _d(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(K(108,Mp(e)||"Unknown",s));return et({},r,n)}function Ja(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xr,yn=Lt.current,Ke(Lt,e),Ke(Ft,Ft.current),!0}function Dc(e,t,r){var n=e.stateNode;if(!n)throw Error(K(169));r?(e=_d(e,t,yn),n.__reactInternalMemoizedMergedChildContext=e,Ye(Ft),Ye(Lt),Ke(Lt,e)):Ye(Ft),Ke(Ft,r)}var Er=null,vi=!1,Xi=!1;function Td(e){Er===null?Er=[e]:Er.push(e)}function Gh(e){vi=!0,Td(e)}function tn(){if(!Xi&&Er!==null){Xi=!0;var e=0,t=$e;try{var r=Er;for($e=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Er=null,vi=!1}catch(s){throw Er!==null&&(Er=Er.slice(e+1)),ed(ml,tn),s}finally{$e=t,Xi=!1}}return null}var Rn=[],zn=0,Za=null,Xa=0,tr=[],rr=0,gn=null,Cr=1,jr="";function on(e,t){Rn[zn++]=Xa,Rn[zn++]=Za,Za=e,Xa=t}function Pd(e,t,r){tr[rr++]=Cr,tr[rr++]=jr,tr[rr++]=gn,gn=e;var n=Cr;e=jr;var s=32-pr(n)-1;n&=~(1<<s),r+=1;var a=32-pr(t)+s;if(30<a){var l=s-s%5;a=(n&(1<<l)-1).toString(32),n>>=l,s-=l,Cr=1<<32-pr(t)+s|r<<s|n,jr=a+e}else Cr=1<<a|r<<s|n,jr=e}function El(e){e.return!==null&&(on(e,1),Pd(e,1,0))}function Nl(e){for(;e===Za;)Za=Rn[--zn],Rn[zn]=null,Xa=Rn[--zn],Rn[zn]=null;for(;e===gn;)gn=tr[--rr],tr[rr]=null,jr=tr[--rr],tr[rr]=null,Cr=tr[--rr],tr[rr]=null}var Jt=null,Qt=null,Je=!1,fr=null;function Md(e,t){var r=nr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Uc(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Jt=e,Qt=Kr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Jt=e,Qt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=gn!==null?{id:Cr,overflow:jr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=nr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Jt=e,Qt=null,!0):!1;default:return!1}}function Uo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Oo(e){if(Je){var t=Qt;if(t){var r=t;if(!Uc(e,t)){if(Uo(e))throw Error(K(418));t=Kr(r.nextSibling);var n=Jt;t&&Uc(e,t)?Md(n,r):(e.flags=e.flags&-4097|2,Je=!1,Jt=e)}}else{if(Uo(e))throw Error(K(418));e.flags=e.flags&-4097|2,Je=!1,Jt=e}}}function Oc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Jt=e}function va(e){if(e!==Jt)return!1;if(!Je)return Oc(e),Je=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Lo(e.type,e.memoizedProps)),t&&(t=Qt)){if(Uo(e))throw Ad(),Error(K(418));for(;t;)Md(e,t),t=Kr(t.nextSibling)}if(Oc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Qt=Kr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Qt=null}}else Qt=Jt?Kr(e.stateNode.nextSibling):null;return!0}function Ad(){for(var e=Qt;e;)e=Kr(e.nextSibling)}function Gn(){Qt=Jt=null,Je=!1}function Cl(e){fr===null?fr=[e]:fr.push(e)}var Qh=Ir.ReactCurrentBatchConfig;function ur(e,t){if(e&&e.defaultProps){t=et({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var qa=en(null),ei=null,Dn=null,jl=null;function _l(){jl=Dn=ei=null}function Tl(e){var t=qa.current;Ye(qa),e._currentValue=t}function $o(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Vn(e,t){ei=e,jl=Dn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&($t=!0),e.firstContext=null)}function ar(e){var t=e._currentValue;if(jl!==e)if(e={context:e,memoizedValue:t,next:null},Dn===null){if(ei===null)throw Error(K(308));Dn=e,ei.dependencies={lanes:0,firstContext:e}}else Dn=Dn.next=e;return t}var pn=null;function Pl(e){pn===null?pn=[e]:pn.push(e)}function Id(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Pl(t)):(r.next=s.next,s.next=r),t.interleaved=r,Mr(e,n)}function Mr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var zr=!1;function Ml(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ld(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 _r(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wr(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Re&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Mr(e,r)}return s=n.interleaved,s===null?(t.next=t,Pl(n)):(t.next=s.next,s.next=t),n.interleaved=t,Mr(e,r)}function Aa(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,xl(e,r)}}function $c(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var l={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?s=a=l:a=a.next=l,r=r.next}while(r!==null);a===null?s=a=t:a=a.next=t}else s=a=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function ti(e,t,r,n){var s=e.updateQueue;zr=!1;var a=s.firstBaseUpdate,l=s.lastBaseUpdate,u=s.shared.pending;if(u!==null){s.shared.pending=null;var d=u,m=d.next;d.next=null,l===null?a=m:l.next=m,l=d;var v=e.alternate;v!==null&&(v=v.updateQueue,u=v.lastBaseUpdate,u!==l&&(u===null?v.firstBaseUpdate=m:u.next=m,v.lastBaseUpdate=d))}if(a!==null){var E=s.baseState;l=0,v=m=d=null,u=a;do{var N=u.lane,C=u.eventTime;if((n&N)===N){v!==null&&(v=v.next={eventTime:C,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var b=e,w=u;switch(N=t,C=r,w.tag){case 1:if(b=w.payload,typeof b=="function"){E=b.call(C,E,N);break e}E=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=w.payload,N=typeof b=="function"?b.call(C,E,N):b,N==null)break e;E=et({},E,N);break e;case 2:zr=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,N=s.effects,N===null?s.effects=[u]:N.push(u))}else C={eventTime:C,lane:N,tag:u.tag,payload:u.payload,callback:u.callback,next:null},v===null?(m=v=C,d=E):v=v.next=C,l|=N;if(u=u.next,u===null){if(u=s.shared.pending,u===null)break;N=u,u=N.next,N.next=null,s.lastBaseUpdate=N,s.shared.pending=null}}while(!0);if(v===null&&(d=E),s.baseState=d,s.firstBaseUpdate=m,s.lastBaseUpdate=v,t=s.shared.interleaved,t!==null){s=t;do l|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);kn|=l,e.lanes=l,e.memoizedState=E}}function Fc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(K(191,s));s.call(n)}}}var Rd=new Iu.Component().refs;function Fo(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:et({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ki={isMounted:function(e){return(e=e._reactInternals)?bn(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=zt(),s=Gr(e),a=_r(n,s);a.payload=t,r!=null&&(a.callback=r),t=Wr(e,a,s),t!==null&&(hr(t,e,s,n),Aa(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=zt(),s=Gr(e),a=_r(n,s);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Wr(e,a,s),t!==null&&(hr(t,e,s,n),Aa(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=zt(),n=Gr(e),s=_r(r,n);s.tag=2,t!=null&&(s.callback=t),t=Wr(e,s,n),t!==null&&(hr(t,e,n,r),Aa(t,e,n))}};function Hc(e,t,r,n,s,a,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,l):t.prototype&&t.prototype.isPureReactComponent?!Os(r,n)||!Os(s,a):!0}function zd(e,t,r){var n=!1,s=Xr,a=t.contextType;return typeof a=="object"&&a!==null?a=ar(a):(s=Ht(t)?yn:Lt.current,n=t.contextTypes,a=(n=n!=null)?Yn(e,s):Xr),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ki,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=a),t}function Bc(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&ki.enqueueReplaceState(t,t.state,null)}function Ho(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs=Rd,Ml(e);var a=t.contextType;typeof a=="object"&&a!==null?s.context=ar(a):(a=Ht(t)?yn:Lt.current,s.context=Yn(e,a)),s.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Fo(e,t,a,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&ki.enqueueReplaceState(s,s.state,null),ti(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ps(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(K(309));var n=r.stateNode}if(!n)throw Error(K(147,e));var s=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(l){var u=s.refs;u===Rd&&(u=s.refs={}),l===null?delete u[a]:u[a]=l},t._stringRef=a,t)}if(typeof e!="string")throw Error(K(284));if(!r._owner)throw Error(K(290,e))}return e}function ka(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vc(e){var t=e._init;return t(e._payload)}function Dd(e){function t(g,y){if(e){var S=g.deletions;S===null?(g.deletions=[y],g.flags|=16):S.push(y)}}function r(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function n(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function s(g,y){return g=Qr(g,y),g.index=0,g.sibling=null,g}function a(g,y,S){return g.index=S,e?(S=g.alternate,S!==null?(S=S.index,S<y?(g.flags|=2,y):S):(g.flags|=2,y)):(g.flags|=1048576,y)}function l(g){return e&&g.alternate===null&&(g.flags|=2),g}function u(g,y,S,I){return y===null||y.tag!==6?(y=ao(S,g.mode,I),y.return=g,y):(y=s(y,S),y.return=g,y)}function d(g,y,S,I){var A=S.type;return A===Tn?v(g,y,S.props.children,I,S.key):y!==null&&(y.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Rr&&Vc(A)===y.type)?(I=s(y,S.props),I.ref=ps(g,y,S),I.return=g,I):(I=Ua(S.type,S.key,S.props,null,g.mode,I),I.ref=ps(g,y,S),I.return=g,I)}function m(g,y,S,I){return y===null||y.tag!==4||y.stateNode.containerInfo!==S.containerInfo||y.stateNode.implementation!==S.implementation?(y=io(S,g.mode,I),y.return=g,y):(y=s(y,S.children||[]),y.return=g,y)}function v(g,y,S,I,A){return y===null||y.tag!==7?(y=xn(S,g.mode,I,A),y.return=g,y):(y=s(y,S),y.return=g,y)}function E(g,y,S){if(typeof y=="string"&&y!==""||typeof y=="number")return y=ao(""+y,g.mode,S),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ca:return S=Ua(y.type,y.key,y.props,null,g.mode,S),S.ref=ps(g,null,y),S.return=g,S;case _n:return y=io(y,g.mode,S),y.return=g,y;case Rr:var I=y._init;return E(g,I(y._payload),S)}if(vs(y)||ls(y))return y=xn(y,g.mode,S,null),y.return=g,y;ka(g,y)}return null}function N(g,y,S,I){var A=y!==null?y.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return A!==null?null:u(g,y,""+S,I);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ca:return S.key===A?d(g,y,S,I):null;case _n:return S.key===A?m(g,y,S,I):null;case Rr:return A=S._init,N(g,y,A(S._payload),I)}if(vs(S)||ls(S))return A!==null?null:v(g,y,S,I,null);ka(g,S)}return null}function C(g,y,S,I,A){if(typeof I=="string"&&I!==""||typeof I=="number")return g=g.get(S)||null,u(y,g,""+I,A);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case ca:return g=g.get(I.key===null?S:I.key)||null,d(y,g,I,A);case _n:return g=g.get(I.key===null?S:I.key)||null,m(y,g,I,A);case Rr:var O=I._init;return C(g,y,S,O(I._payload),A)}if(vs(I)||ls(I))return g=g.get(S)||null,v(y,g,I,A,null);ka(y,I)}return null}function b(g,y,S,I){for(var A=null,O=null,R=y,H=y=0,de=null;R!==null&&H<S.length;H++){R.index>H?(de=R,R=null):de=R.sibling;var le=N(g,R,S[H],I);if(le===null){R===null&&(R=de);break}e&&R&&le.alternate===null&&t(g,R),y=a(le,y,H),O===null?A=le:O.sibling=le,O=le,R=de}if(H===S.length)return r(g,R),Je&&on(g,H),A;if(R===null){for(;H<S.length;H++)R=E(g,S[H],I),R!==null&&(y=a(R,y,H),O===null?A=R:O.sibling=R,O=R);return Je&&on(g,H),A}for(R=n(g,R);H<S.length;H++)de=C(R,g,H,S[H],I),de!==null&&(e&&de.alternate!==null&&R.delete(de.key===null?H:de.key),y=a(de,y,H),O===null?A=de:O.sibling=de,O=de);return e&&R.forEach(function(Fe){return t(g,Fe)}),Je&&on(g,H),A}function w(g,y,S,I){var A=ls(S);if(typeof A!="function")throw Error(K(150));if(S=A.call(S),S==null)throw Error(K(151));for(var O=A=null,R=y,H=y=0,de=null,le=S.next();R!==null&&!le.done;H++,le=S.next()){R.index>H?(de=R,R=null):de=R.sibling;var Fe=N(g,R,le.value,I);if(Fe===null){R===null&&(R=de);break}e&&R&&Fe.alternate===null&&t(g,R),y=a(Fe,y,H),O===null?A=Fe:O.sibling=Fe,O=Fe,R=de}if(le.done)return r(g,R),Je&&on(g,H),A;if(R===null){for(;!le.done;H++,le=S.next())le=E(g,le.value,I),le!==null&&(y=a(le,y,H),O===null?A=le:O.sibling=le,O=le);return Je&&on(g,H),A}for(R=n(g,R);!le.done;H++,le=S.next())le=C(R,g,H,le.value,I),le!==null&&(e&&le.alternate!==null&&R.delete(le.key===null?H:le.key),y=a(le,y,H),O===null?A=le:O.sibling=le,O=le);return e&&R.forEach(function(Ze){return t(g,Ze)}),Je&&on(g,H),A}function L(g,y,S,I){if(typeof S=="object"&&S!==null&&S.type===Tn&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case ca:e:{for(var A=S.key,O=y;O!==null;){if(O.key===A){if(A=S.type,A===Tn){if(O.tag===7){r(g,O.sibling),y=s(O,S.props.children),y.return=g,g=y;break e}}else if(O.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Rr&&Vc(A)===O.type){r(g,O.sibling),y=s(O,S.props),y.ref=ps(g,O,S),y.return=g,g=y;break e}r(g,O);break}else t(g,O);O=O.sibling}S.type===Tn?(y=xn(S.props.children,g.mode,I,S.key),y.return=g,g=y):(I=Ua(S.type,S.key,S.props,null,g.mode,I),I.ref=ps(g,y,S),I.return=g,g=I)}return l(g);case _n:e:{for(O=S.key;y!==null;){if(y.key===O)if(y.tag===4&&y.stateNode.containerInfo===S.containerInfo&&y.stateNode.implementation===S.implementation){r(g,y.sibling),y=s(y,S.children||[]),y.return=g,g=y;break e}else{r(g,y);break}else t(g,y);y=y.sibling}y=io(S,g.mode,I),y.return=g,g=y}return l(g);case Rr:return O=S._init,L(g,y,O(S._payload),I)}if(vs(S))return b(g,y,S,I);if(ls(S))return w(g,y,S,I);ka(g,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,y!==null&&y.tag===6?(r(g,y.sibling),y=s(y,S),y.return=g,g=y):(r(g,y),y=ao(S,g.mode,I),y.return=g,g=y),l(g)):r(g,y)}return L}var Qn=Dd(!0),Ud=Dd(!1),ea={},kr=en(ea),Bs=en(ea),Vs=en(ea);function hn(e){if(e===ea)throw Error(K(174));return e}function Al(e,t){switch(Ke(Vs,t),Ke(Bs,e),Ke(kr,ea),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ko(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ko(t,e)}Ye(kr),Ke(kr,t)}function Jn(){Ye(kr),Ye(Bs),Ye(Vs)}function Od(e){hn(Vs.current);var t=hn(kr.current),r=ko(t,e.type);t!==r&&(Ke(Bs,e),Ke(kr,r))}function Il(e){Bs.current===e&&(Ye(kr),Ye(Bs))}var Xe=en(0);function ri(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var qi=[];function Ll(){for(var e=0;e<qi.length;e++)qi[e]._workInProgressVersionPrimary=null;qi.length=0}var Ia=Ir.ReactCurrentDispatcher,eo=Ir.ReactCurrentBatchConfig,vn=0,qe=null,pt=null,yt=null,ni=!1,_s=!1,Ks=0,Jh=0;function Tt(){throw Error(K(321))}function Rl(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!mr(e[r],t[r]))return!1;return!0}function zl(e,t,r,n,s,a){if(vn=a,qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ia.current=e===null||e.memoizedState===null?em:tm,e=r(n,s),_s){a=0;do{if(_s=!1,Ks=0,25<=a)throw Error(K(301));a+=1,yt=pt=null,t.updateQueue=null,Ia.current=rm,e=r(n,s)}while(_s)}if(Ia.current=si,t=pt!==null&&pt.next!==null,vn=0,yt=pt=qe=null,ni=!1,t)throw Error(K(300));return e}function Dl(){var e=Ks!==0;return Ks=0,e}function yr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?qe.memoizedState=yt=e:yt=yt.next=e,yt}function ir(){if(pt===null){var e=qe.alternate;e=e!==null?e.memoizedState:null}else e=pt.next;var t=yt===null?qe.memoizedState:yt.next;if(t!==null)yt=t,pt=e;else{if(e===null)throw Error(K(310));pt=e,e={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},yt===null?qe.memoizedState=yt=e:yt=yt.next=e}return yt}function Ws(e,t){return typeof t=="function"?t(e):t}function to(e){var t=ir(),r=t.queue;if(r===null)throw Error(K(311));r.lastRenderedReducer=e;var n=pt,s=n.baseQueue,a=r.pending;if(a!==null){if(s!==null){var l=s.next;s.next=a.next,a.next=l}n.baseQueue=s=a,r.pending=null}if(s!==null){a=s.next,n=n.baseState;var u=l=null,d=null,m=a;do{var v=m.lane;if((vn&v)===v)d!==null&&(d=d.next={lane:0,action:m.action,hasEagerState:m.hasEagerState,eagerState:m.eagerState,next:null}),n=m.hasEagerState?m.eagerState:e(n,m.action);else{var E={lane:v,action:m.action,hasEagerState:m.hasEagerState,eagerState:m.eagerState,next:null};d===null?(u=d=E,l=n):d=d.next=E,qe.lanes|=v,kn|=v}m=m.next}while(m!==null&&m!==a);d===null?l=n:d.next=u,mr(n,t.memoizedState)||($t=!0),t.memoizedState=n,t.baseState=l,t.baseQueue=d,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do a=s.lane,qe.lanes|=a,kn|=a,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function ro(e){var t=ir(),r=t.queue;if(r===null)throw Error(K(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,a=t.memoizedState;if(s!==null){r.pending=null;var l=s=s.next;do a=e(a,l.action),l=l.next;while(l!==s);mr(a,t.memoizedState)||($t=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function $d(){}function Fd(e,t){var r=qe,n=ir(),s=t(),a=!mr(n.memoizedState,s);if(a&&(n.memoizedState=s,$t=!0),n=n.queue,Ul(Vd.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||yt!==null&&yt.memoizedState.tag&1){if(r.flags|=2048,Ys(9,Bd.bind(null,r,n,s,t),void 0,null),gt===null)throw Error(K(349));vn&30||Hd(r,t,s)}return s}function Hd(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=qe.updateQueue,t===null?(t={lastEffect:null,stores:null},qe.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Bd(e,t,r,n){t.value=r,t.getSnapshot=n,Kd(t)&&Wd(e)}function Vd(e,t,r){return r(function(){Kd(t)&&Wd(e)})}function Kd(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!mr(e,r)}catch{return!0}}function Wd(e){var t=Mr(e,1);t!==null&&hr(t,e,1,-1)}function Kc(e){var t=yr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ws,lastRenderedState:e},t.queue=e,e=e.dispatch=qh.bind(null,qe,e),[t.memoizedState,e]}function Ys(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=qe.updateQueue,t===null?(t={lastEffect:null,stores:null},qe.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function Yd(){return ir().memoizedState}function La(e,t,r,n){var s=yr();qe.flags|=e,s.memoizedState=Ys(1|t,r,void 0,n===void 0?null:n)}function wi(e,t,r,n){var s=ir();n=n===void 0?null:n;var a=void 0;if(pt!==null){var l=pt.memoizedState;if(a=l.destroy,n!==null&&Rl(n,l.deps)){s.memoizedState=Ys(t,r,a,n);return}}qe.flags|=e,s.memoizedState=Ys(1|t,r,a,n)}function Wc(e,t){return La(8390656,8,e,t)}function Ul(e,t){return wi(2048,8,e,t)}function Gd(e,t){return wi(4,2,e,t)}function Qd(e,t){return wi(4,4,e,t)}function Jd(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Zd(e,t,r){return r=r!=null?r.concat([e]):null,wi(4,4,Jd.bind(null,t,e),r)}function Ol(){}function Xd(e,t){var r=ir();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Rl(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function qd(e,t){var r=ir();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Rl(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function ef(e,t,r){return vn&21?(mr(r,t)||(r=nd(),qe.lanes|=r,kn|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,$t=!0),e.memoizedState=r)}function Zh(e,t){var r=$e;$e=r!==0&&4>r?r:4,e(!0);var n=eo.transition;eo.transition={};try{e(!1),t()}finally{$e=r,eo.transition=n}}function tf(){return ir().memoizedState}function Xh(e,t,r){var n=Gr(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},rf(e))nf(t,r);else if(r=Id(e,t,r,n),r!==null){var s=zt();hr(r,e,n,s),sf(r,t,n)}}function qh(e,t,r){var n=Gr(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(rf(e))nf(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,u=a(l,r);if(s.hasEagerState=!0,s.eagerState=u,mr(u,l)){var d=t.interleaved;d===null?(s.next=s,Pl(t)):(s.next=d.next,d.next=s),t.interleaved=s;return}}catch{}finally{}r=Id(e,t,s,n),r!==null&&(s=zt(),hr(r,e,n,s),sf(r,t,n))}}function rf(e){var t=e.alternate;return e===qe||t!==null&&t===qe}function nf(e,t){_s=ni=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function sf(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,xl(e,r)}}var si={readContext:ar,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useInsertionEffect:Tt,useLayoutEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useMutableSource:Tt,useSyncExternalStore:Tt,useId:Tt,unstable_isNewReconciler:!1},em={readContext:ar,useCallback:function(e,t){return yr().memoizedState=[e,t===void 0?null:t],e},useContext:ar,useEffect:Wc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,La(4194308,4,Jd.bind(null,t,e),r)},useLayoutEffect:function(e,t){return La(4194308,4,e,t)},useInsertionEffect:function(e,t){return La(4,2,e,t)},useMemo:function(e,t){var r=yr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=yr();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=Xh.bind(null,qe,e),[n.memoizedState,e]},useRef:function(e){var t=yr();return e={current:e},t.memoizedState=e},useState:Kc,useDebugValue:Ol,useDeferredValue:function(e){return yr().memoizedState=e},useTransition:function(){var e=Kc(!1),t=e[0];return e=Zh.bind(null,e[1]),yr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=qe,s=yr();if(Je){if(r===void 0)throw Error(K(407));r=r()}else{if(r=t(),gt===null)throw Error(K(349));vn&30||Hd(n,t,r)}s.memoizedState=r;var a={value:r,getSnapshot:t};return s.queue=a,Wc(Vd.bind(null,n,a,e),[e]),n.flags|=2048,Ys(9,Bd.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=yr(),t=gt.identifierPrefix;if(Je){var r=jr,n=Cr;r=(n&~(1<<32-pr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ks++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Jh++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tm={readContext:ar,useCallback:Xd,useContext:ar,useEffect:Ul,useImperativeHandle:Zd,useInsertionEffect:Gd,useLayoutEffect:Qd,useMemo:qd,useReducer:to,useRef:Yd,useState:function(){return to(Ws)},useDebugValue:Ol,useDeferredValue:function(e){var t=ir();return ef(t,pt.memoizedState,e)},useTransition:function(){var e=to(Ws)[0],t=ir().memoizedState;return[e,t]},useMutableSource:$d,useSyncExternalStore:Fd,useId:tf,unstable_isNewReconciler:!1},rm={readContext:ar,useCallback:Xd,useContext:ar,useEffect:Ul,useImperativeHandle:Zd,useInsertionEffect:Gd,useLayoutEffect:Qd,useMemo:qd,useReducer:ro,useRef:Yd,useState:function(){return ro(Ws)},useDebugValue:Ol,useDeferredValue:function(e){var t=ir();return pt===null?t.memoizedState=e:ef(t,pt.memoizedState,e)},useTransition:function(){var e=ro(Ws)[0],t=ir().memoizedState;return[e,t]},useMutableSource:$d,useSyncExternalStore:Fd,useId:tf,unstable_isNewReconciler:!1};function Zn(e,t){try{var r="",n=t;do r+=Pp(n),n=n.return;while(n);var s=r}catch(a){s=`
Error generating stack: `+a.message+`
`+a.stack}return{value:e,source:t,stack:s,digest:null}}function no(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Bo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var nm=typeof WeakMap=="function"?WeakMap:Map;function af(e,t,r){r=_r(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){ii||(ii=!0,qo=n),Bo(e,t)},r}function of(e,t,r){r=_r(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){Bo(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Bo(e,t),typeof n!="function"&&(Yr===null?Yr=new Set([this]):Yr.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),r}function Yc(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new nm;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=ym.bind(null,e,t,r),t.then(e,e))}function Gc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Qc(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=_r(-1,1),t.tag=2,Wr(r,t,1))),r.lanes|=1),e)}var sm=Ir.ReactCurrentOwner,$t=!1;function Rt(e,t,r,n){t.child=e===null?Ud(t,null,r,n):Qn(t,e.child,r,n)}function Jc(e,t,r,n,s){r=r.render;var a=t.ref;return Vn(t,s),n=zl(e,t,r,n,a,s),r=Dl(),e!==null&&!$t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Ar(e,t,s)):(Je&&r&&El(t),t.flags|=1,Rt(e,t,n,s),t.child)}function Zc(e,t,r,n,s){if(e===null){var a=r.type;return typeof a=="function"&&!Yl(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,lf(e,t,a,n,s)):(e=Ua(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&s)){var l=a.memoizedProps;if(r=r.compare,r=r!==null?r:Os,r(l,n)&&e.ref===t.ref)return Ar(e,t,s)}return t.flags|=1,e=Qr(a,n),e.ref=t.ref,e.return=t,t.child=e}function lf(e,t,r,n,s){if(e!==null){var a=e.memoizedProps;if(Os(a,n)&&e.ref===t.ref)if($t=!1,t.pendingProps=n=a,(e.lanes&s)!==0)e.flags&131072&&($t=!0);else return t.lanes=e.lanes,Ar(e,t,s)}return Vo(e,t,r,n,s)}function cf(e,t,r){var n=t.pendingProps,s=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ke(On,Yt),Yt|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ke(On,Yt),Yt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Ke(On,Yt),Yt|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Ke(On,Yt),Yt|=n;return Rt(e,t,s,r),t.child}function uf(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Vo(e,t,r,n,s){var a=Ht(r)?yn:Lt.current;return a=Yn(t,a),Vn(t,s),r=zl(e,t,r,n,a,s),n=Dl(),e!==null&&!$t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Ar(e,t,s)):(Je&&n&&El(t),t.flags|=1,Rt(e,t,r,s),t.child)}function Xc(e,t,r,n,s){if(Ht(r)){var a=!0;Ja(t)}else a=!1;if(Vn(t,s),t.stateNode===null)Ra(e,t),zd(t,r,n),Ho(t,r,n,s),n=!0;else if(e===null){var l=t.stateNode,u=t.memoizedProps;l.props=u;var d=l.context,m=r.contextType;typeof m=="object"&&m!==null?m=ar(m):(m=Ht(r)?yn:Lt.current,m=Yn(t,m));var v=r.getDerivedStateFromProps,E=typeof v=="function"||typeof l.getSnapshotBeforeUpdate=="function";E||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(u!==n||d!==m)&&Bc(t,l,n,m),zr=!1;var N=t.memoizedState;l.state=N,ti(t,n,l,s),d=t.memoizedState,u!==n||N!==d||Ft.current||zr?(typeof v=="function"&&(Fo(t,r,v,n),d=t.memoizedState),(u=zr||Hc(t,r,u,n,N,d,m))?(E||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=d),l.props=n,l.state=d,l.context=m,n=u):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{l=t.stateNode,Ld(e,t),u=t.memoizedProps,m=t.type===t.elementType?u:ur(t.type,u),l.props=m,E=t.pendingProps,N=l.context,d=r.contextType,typeof d=="object"&&d!==null?d=ar(d):(d=Ht(r)?yn:Lt.current,d=Yn(t,d));var C=r.getDerivedStateFromProps;(v=typeof C=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(u!==E||N!==d)&&Bc(t,l,n,d),zr=!1,N=t.memoizedState,l.state=N,ti(t,n,l,s);var b=t.memoizedState;u!==E||N!==b||Ft.current||zr?(typeof C=="function"&&(Fo(t,r,C,n),b=t.memoizedState),(m=zr||Hc(t,r,m,n,N,b,d)||!1)?(v||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(n,b,d),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(n,b,d)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||u===e.memoizedProps&&N===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&N===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=b),l.props=n,l.state=b,l.context=d,n=m):(typeof l.componentDidUpdate!="function"||u===e.memoizedProps&&N===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&N===e.memoizedState||(t.flags|=1024),n=!1)}return Ko(e,t,r,n,a,s)}function Ko(e,t,r,n,s,a){uf(e,t);var l=(t.flags&128)!==0;if(!n&&!l)return s&&Dc(t,r,!1),Ar(e,t,a);n=t.stateNode,sm.current=t;var u=l&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&l?(t.child=Qn(t,e.child,null,a),t.child=Qn(t,null,u,a)):Rt(e,t,u,a),t.memoizedState=n.state,s&&Dc(t,r,!0),t.child}function df(e){var t=e.stateNode;t.pendingContext?zc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&zc(e,t.context,!1),Al(e,t.containerInfo)}function qc(e,t,r,n,s){return Gn(),Cl(s),t.flags|=256,Rt(e,t,r,n),t.child}var Wo={dehydrated:null,treeContext:null,retryLane:0};function Yo(e){return{baseLanes:e,cachePool:null,transitions:null}}function ff(e,t,r){var n=t.pendingProps,s=Xe.current,a=!1,l=(t.flags&128)!==0,u;if((u=l)||(u=e!==null&&e.memoizedState===null?!1:(s&2)!==0),u?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Ke(Xe,s&1),e===null)return Oo(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=n.children,e=n.fallback,a?(n=t.mode,a=t.child,l={mode:"hidden",children:l},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=l):a=Ei(l,n,0,null),e=xn(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Yo(r),t.memoizedState=Wo,e):$l(t,l));if(s=e.memoizedState,s!==null&&(u=s.dehydrated,u!==null))return am(e,t,l,n,u,s,r);if(a){a=n.fallback,l=t.mode,s=e.child,u=s.sibling;var d={mode:"hidden",children:n.children};return!(l&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=d,t.deletions=null):(n=Qr(s,d),n.subtreeFlags=s.subtreeFlags&14680064),u!==null?a=Qr(u,a):(a=xn(a,l,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,l=e.child.memoizedState,l=l===null?Yo(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~r,t.memoizedState=Wo,n}return a=e.child,e=a.sibling,n=Qr(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function $l(e,t){return t=Ei({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function wa(e,t,r,n){return n!==null&&Cl(n),Qn(t,e.child,null,r),e=$l(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function am(e,t,r,n,s,a,l){if(r)return t.flags&256?(t.flags&=-257,n=no(Error(K(422))),wa(e,t,l,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,s=t.mode,n=Ei({mode:"visible",children:n.children},s,0,null),a=xn(a,s,l,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&Qn(t,e.child,null,l),t.child.memoizedState=Yo(l),t.memoizedState=Wo,a);if(!(t.mode&1))return wa(e,t,l,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var u=n.dgst;return n=u,a=Error(K(419)),n=no(a,n,void 0),wa(e,t,l,n)}if(u=(l&e.childLanes)!==0,$t||u){if(n=gt,n!==null){switch(l&-l){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|l)?0:s,s!==0&&s!==a.retryLane&&(a.retryLane=s,Mr(e,s),hr(n,e,s,-1))}return Wl(),n=no(Error(K(421))),wa(e,t,l,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=gm.bind(null,e),s._reactRetry=t,null):(e=a.treeContext,Qt=Kr(s.nextSibling),Jt=t,Je=!0,fr=null,e!==null&&(tr[rr++]=Cr,tr[rr++]=jr,tr[rr++]=gn,Cr=e.id,jr=e.overflow,gn=t),t=$l(t,n.children),t.flags|=4096,t)}function eu(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),$o(e.return,t,r)}function so(e,t,r,n,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=s)}function pf(e,t,r){var n=t.pendingProps,s=n.revealOrder,a=n.tail;if(Rt(e,t,n.children,r),n=Xe.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&eu(e,r,t);else if(e.tag===19)eu(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ke(Xe,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&ri(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),so(t,!1,s,r,a);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ri(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}so(t,!0,r,null,a);break;case"together":so(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ra(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ar(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),kn|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,r=Qr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Qr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function im(e,t,r){switch(t.tag){case 3:df(t),Gn();break;case 5:Od(t);break;case 1:Ht(t.type)&&Ja(t);break;case 4:Al(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;Ke(qa,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ke(Xe,Xe.current&1),t.flags|=128,null):r&t.child.childLanes?ff(e,t,r):(Ke(Xe,Xe.current&1),e=Ar(e,t,r),e!==null?e.sibling:null);Ke(Xe,Xe.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return pf(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Ke(Xe,Xe.current),n)break;return null;case 22:case 23:return t.lanes=0,cf(e,t,r)}return Ar(e,t,r)}var hf,Go,mf,xf;hf=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Go=function(){};mf=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,hn(kr.current);var a=null;switch(r){case"input":s=xo(e,s),n=xo(e,n),a=[];break;case"select":s=et({},s,{value:void 0}),n=et({},n,{value:void 0}),a=[];break;case"textarea":s=vo(e,s),n=vo(e,n),a=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Ga)}wo(r,n);var l;r=null;for(m in s)if(!n.hasOwnProperty(m)&&s.hasOwnProperty(m)&&s[m]!=null)if(m==="style"){var u=s[m];for(l in u)u.hasOwnProperty(l)&&(r||(r={}),r[l]="")}else m!=="dangerouslySetInnerHTML"&&m!=="children"&&m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(As.hasOwnProperty(m)?a||(a=[]):(a=a||[]).push(m,null));for(m in n){var d=n[m];if(u=s!=null?s[m]:void 0,n.hasOwnProperty(m)&&d!==u&&(d!=null||u!=null))if(m==="style")if(u){for(l in u)!u.hasOwnProperty(l)||d&&d.hasOwnProperty(l)||(r||(r={}),r[l]="");for(l in d)d.hasOwnProperty(l)&&u[l]!==d[l]&&(r||(r={}),r[l]=d[l])}else r||(a||(a=[]),a.push(m,r)),r=d;else m==="dangerouslySetInnerHTML"?(d=d?d.__html:void 0,u=u?u.__html:void 0,d!=null&&u!==d&&(a=a||[]).push(m,d)):m==="children"?typeof d!="string"&&typeof d!="number"||(a=a||[]).push(m,""+d):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&(As.hasOwnProperty(m)?(d!=null&&m==="onScroll"&&We("scroll",e),a||u===d||(a=[])):(a=a||[]).push(m,d))}r&&(a=a||[]).push("style",r);var m=a;(t.updateQueue=m)&&(t.flags|=4)}};xf=function(e,t,r,n){r!==n&&(t.flags|=4)};function hs(e,t){if(!Je)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Pt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function om(e,t,r){var n=t.pendingProps;switch(Nl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(t),null;case 1:return Ht(t.type)&&Qa(),Pt(t),null;case 3:return n=t.stateNode,Jn(),Ye(Ft),Ye(Lt),Ll(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(va(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,fr!==null&&(rl(fr),fr=null))),Go(e,t),Pt(t),null;case 5:Il(t);var s=hn(Vs.current);if(r=t.type,e!==null&&t.stateNode!=null)mf(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(K(166));return Pt(t),null}if(e=hn(kr.current),va(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[gr]=t,n[Hs]=a,e=(t.mode&1)!==0,r){case"dialog":We("cancel",n),We("close",n);break;case"iframe":case"object":case"embed":We("load",n);break;case"video":case"audio":for(s=0;s<ws.length;s++)We(ws[s],n);break;case"source":We("error",n);break;case"img":case"image":case"link":We("error",n),We("load",n);break;case"details":We("toggle",n);break;case"input":cc(n,a),We("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},We("invalid",n);break;case"textarea":dc(n,a),We("invalid",n)}wo(r,a),s=null;for(var l in a)if(a.hasOwnProperty(l)){var u=a[l];l==="children"?typeof u=="string"?n.textContent!==u&&(a.suppressHydrationWarning!==!0&&ga(n.textContent,u,e),s=["children",u]):typeof u=="number"&&n.textContent!==""+u&&(a.suppressHydrationWarning!==!0&&ga(n.textContent,u,e),s=["children",""+u]):As.hasOwnProperty(l)&&u!=null&&l==="onScroll"&&We("scroll",n)}switch(r){case"input":ua(n),uc(n,a,!0);break;case"textarea":ua(n),fc(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=Ga)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{l=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Hu(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),r==="select"&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[gr]=t,e[Hs]=n,hf(e,t,!1,!1),t.stateNode=e;e:{switch(l=So(r,n),r){case"dialog":We("cancel",e),We("close",e),s=n;break;case"iframe":case"object":case"embed":We("load",e),s=n;break;case"video":case"audio":for(s=0;s<ws.length;s++)We(ws[s],e);s=n;break;case"source":We("error",e),s=n;break;case"img":case"image":case"link":We("error",e),We("load",e),s=n;break;case"details":We("toggle",e),s=n;break;case"input":cc(e,n),s=xo(e,n),We("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=et({},n,{value:void 0}),We("invalid",e);break;case"textarea":dc(e,n),s=vo(e,n),We("invalid",e);break;default:s=n}wo(r,s),u=s;for(a in u)if(u.hasOwnProperty(a)){var d=u[a];a==="style"?Ku(e,d):a==="dangerouslySetInnerHTML"?(d=d?d.__html:void 0,d!=null&&Bu(e,d)):a==="children"?typeof d=="string"?(r!=="textarea"||d!=="")&&Is(e,d):typeof d=="number"&&Is(e,""+d):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(As.hasOwnProperty(a)?d!=null&&a==="onScroll"&&We("scroll",e):d!=null&&ul(e,a,d,l))}switch(r){case"input":ua(e),uc(e,n,!1);break;case"textarea":ua(e),fc(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Zr(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?$n(e,!!n.multiple,a,!1):n.defaultValue!=null&&$n(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Ga)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Pt(t),null;case 6:if(e&&t.stateNode!=null)xf(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(K(166));if(r=hn(Vs.current),hn(kr.current),va(t)){if(n=t.stateNode,r=t.memoizedProps,n[gr]=t,(a=n.nodeValue!==r)&&(e=Jt,e!==null))switch(e.tag){case 3:ga(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ga(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[gr]=t,t.stateNode=n}return Pt(t),null;case 13:if(Ye(Xe),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Je&&Qt!==null&&t.mode&1&&!(t.flags&128))Ad(),Gn(),t.flags|=98560,a=!1;else if(a=va(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(K(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(K(317));a[gr]=t}else Gn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pt(t),a=!1}else fr!==null&&(rl(fr),fr=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Xe.current&1?ht===0&&(ht=3):Wl())),t.updateQueue!==null&&(t.flags|=4),Pt(t),null);case 4:return Jn(),Go(e,t),e===null&&$s(t.stateNode.containerInfo),Pt(t),null;case 10:return Tl(t.type._context),Pt(t),null;case 17:return Ht(t.type)&&Qa(),Pt(t),null;case 19:if(Ye(Xe),a=t.memoizedState,a===null)return Pt(t),null;if(n=(t.flags&128)!==0,l=a.rendering,l===null)if(n)hs(a,!1);else{if(ht!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=ri(e),l!==null){for(t.flags|=128,hs(a,!1),n=l.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,l=a.alternate,l===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ke(Xe,Xe.current&1|2),t.child}e=e.sibling}a.tail!==null&&ct()>Xn&&(t.flags|=128,n=!0,hs(a,!1),t.lanes=4194304)}else{if(!n)if(e=ri(l),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),hs(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!Je)return Pt(t),null}else 2*ct()-a.renderingStartTime>Xn&&r!==1073741824&&(t.flags|=128,n=!0,hs(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(r=a.last,r!==null?r.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=ct(),t.sibling=null,r=Xe.current,Ke(Xe,n?r&1|2:r&1),t):(Pt(t),null);case 22:case 23:return Kl(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Yt&1073741824&&(Pt(t),t.subtreeFlags&6&&(t.flags|=8192)):Pt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function lm(e,t){switch(Nl(t),t.tag){case 1:return Ht(t.type)&&Qa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jn(),Ye(Ft),Ye(Lt),Ll(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Il(t),null;case 13:if(Ye(Xe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));Gn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ye(Xe),null;case 4:return Jn(),null;case 10:return Tl(t.type._context),null;case 22:case 23:return Kl(),null;case 24:return null;default:return null}}var Sa=!1,It=!1,cm=typeof WeakSet=="function"?WeakSet:Set,te=null;function Un(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){it(e,t,n)}else r.current=null}function Qo(e,t,r){try{r()}catch(n){it(e,t,n)}}var tu=!1;function um(e,t){if(Ao=Ka,e=vd(),bl(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var l=0,u=-1,d=-1,m=0,v=0,E=e,N=null;t:for(;;){for(var C;E!==r||s!==0&&E.nodeType!==3||(u=l+s),E!==a||n!==0&&E.nodeType!==3||(d=l+n),E.nodeType===3&&(l+=E.nodeValue.length),(C=E.firstChild)!==null;)N=E,E=C;for(;;){if(E===e)break t;if(N===r&&++m===s&&(u=l),N===a&&++v===n&&(d=l),(C=E.nextSibling)!==null)break;E=N,N=E.parentNode}E=C}r=u===-1||d===-1?null:{start:u,end:d}}else r=null}r=r||{start:0,end:0}}else r=null;for(Io={focusedElem:e,selectionRange:r},Ka=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var w=b.memoizedProps,L=b.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?w:ur(t.type,w),L);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(I){it(t,t.return,I)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return b=tu,tu=!1,b}function Ts(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&Qo(t,r,a)}s=s.next}while(s!==n)}}function Si(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Jo(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function yf(e){var t=e.alternate;t!==null&&(e.alternate=null,yf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[gr],delete t[Hs],delete t[zo],delete t[Wh],delete t[Yh])),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 gf(e){return e.tag===5||e.tag===3||e.tag===4}function ru(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gf(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 Zo(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ga));else if(n!==4&&(e=e.child,e!==null))for(Zo(e,t,r),e=e.sibling;e!==null;)Zo(e,t,r),e=e.sibling}function Xo(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Xo(e,t,r),e=e.sibling;e!==null;)Xo(e,t,r),e=e.sibling}var bt=null,dr=!1;function Lr(e,t,r){for(r=r.child;r!==null;)vf(e,t,r),r=r.sibling}function vf(e,t,r){if(vr&&typeof vr.onCommitFiberUnmount=="function")try{vr.onCommitFiberUnmount(hi,r)}catch{}switch(r.tag){case 5:It||Un(r,t);case 6:var n=bt,s=dr;bt=null,Lr(e,t,r),bt=n,dr=s,bt!==null&&(dr?(e=bt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):bt.removeChild(r.stateNode));break;case 18:bt!==null&&(dr?(e=bt,r=r.stateNode,e.nodeType===8?Zi(e.parentNode,r):e.nodeType===1&&Zi(e,r),Ds(e)):Zi(bt,r.stateNode));break;case 4:n=bt,s=dr,bt=r.stateNode.containerInfo,dr=!0,Lr(e,t,r),bt=n,dr=s;break;case 0:case 11:case 14:case 15:if(!It&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var a=s,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&Qo(r,t,l),s=s.next}while(s!==n)}Lr(e,t,r);break;case 1:if(!It&&(Un(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(u){it(r,t,u)}Lr(e,t,r);break;case 21:Lr(e,t,r);break;case 22:r.mode&1?(It=(n=It)||r.memoizedState!==null,Lr(e,t,r),It=n):Lr(e,t,r);break;default:Lr(e,t,r)}}function nu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new cm),t.forEach(function(n){var s=vm.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function cr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var a=e,l=t,u=l;e:for(;u!==null;){switch(u.tag){case 5:bt=u.stateNode,dr=!1;break e;case 3:bt=u.stateNode.containerInfo,dr=!0;break e;case 4:bt=u.stateNode.containerInfo,dr=!0;break e}u=u.return}if(bt===null)throw Error(K(160));vf(a,l,s),bt=null,dr=!1;var d=s.alternate;d!==null&&(d.return=null),s.return=null}catch(m){it(s,t,m)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)kf(t,e),t=t.sibling}function kf(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(cr(t,e),xr(e),n&4){try{Ts(3,e,e.return),Si(3,e)}catch(w){it(e,e.return,w)}try{Ts(5,e,e.return)}catch(w){it(e,e.return,w)}}break;case 1:cr(t,e),xr(e),n&512&&r!==null&&Un(r,r.return);break;case 5:if(cr(t,e),xr(e),n&512&&r!==null&&Un(r,r.return),e.flags&32){var s=e.stateNode;try{Is(s,"")}catch(w){it(e,e.return,w)}}if(n&4&&(s=e.stateNode,s!=null)){var a=e.memoizedProps,l=r!==null?r.memoizedProps:a,u=e.type,d=e.updateQueue;if(e.updateQueue=null,d!==null)try{u==="input"&&a.type==="radio"&&a.name!=null&&$u(s,a),So(u,l);var m=So(u,a);for(l=0;l<d.length;l+=2){var v=d[l],E=d[l+1];v==="style"?Ku(s,E):v==="dangerouslySetInnerHTML"?Bu(s,E):v==="children"?Is(s,E):ul(s,v,E,m)}switch(u){case"input":yo(s,a);break;case"textarea":Fu(s,a);break;case"select":var N=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!a.multiple;var C=a.value;C!=null?$n(s,!!a.multiple,C,!1):N!==!!a.multiple&&(a.defaultValue!=null?$n(s,!!a.multiple,a.defaultValue,!0):$n(s,!!a.multiple,a.multiple?[]:"",!1))}s[Hs]=a}catch(w){it(e,e.return,w)}}break;case 6:if(cr(t,e),xr(e),n&4){if(e.stateNode===null)throw Error(K(162));s=e.stateNode,a=e.memoizedProps;try{s.nodeValue=a}catch(w){it(e,e.return,w)}}break;case 3:if(cr(t,e),xr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Ds(t.containerInfo)}catch(w){it(e,e.return,w)}break;case 4:cr(t,e),xr(e);break;case 13:cr(t,e),xr(e),s=e.child,s.flags&8192&&(a=s.memoizedState!==null,s.stateNode.isHidden=a,!a||s.alternate!==null&&s.alternate.memoizedState!==null||(Bl=ct())),n&4&&nu(e);break;case 22:if(v=r!==null&&r.memoizedState!==null,e.mode&1?(It=(m=It)||v,cr(t,e),It=m):cr(t,e),xr(e),n&8192){if(m=e.memoizedState!==null,(e.stateNode.isHidden=m)&&!v&&e.mode&1)for(te=e,v=e.child;v!==null;){for(E=te=v;te!==null;){switch(N=te,C=N.child,N.tag){case 0:case 11:case 14:case 15:Ts(4,N,N.return);break;case 1:Un(N,N.return);var b=N.stateNode;if(typeof b.componentWillUnmount=="function"){n=N,r=N.return;try{t=n,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(w){it(n,r,w)}}break;case 5:Un(N,N.return);break;case 22:if(N.memoizedState!==null){au(E);continue}}C!==null?(C.return=N,te=C):au(E)}v=v.sibling}e:for(v=null,E=e;;){if(E.tag===5){if(v===null){v=E;try{s=E.stateNode,m?(a=s.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(u=E.stateNode,d=E.memoizedProps.style,l=d!=null&&d.hasOwnProperty("display")?d.display:null,u.style.display=Vu("display",l))}catch(w){it(e,e.return,w)}}}else if(E.tag===6){if(v===null)try{E.stateNode.nodeValue=m?"":E.memoizedProps}catch(w){it(e,e.return,w)}}else if((E.tag!==22&&E.tag!==23||E.memoizedState===null||E===e)&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===e)break e;for(;E.sibling===null;){if(E.return===null||E.return===e)break e;v===E&&(v=null),E=E.return}v===E&&(v=null),E.sibling.return=E.return,E=E.sibling}}break;case 19:cr(t,e),xr(e),n&4&&nu(e);break;case 21:break;default:cr(t,e),xr(e)}}function xr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(gf(r)){var n=r;break e}r=r.return}throw Error(K(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Is(s,""),n.flags&=-33);var a=ru(e);Xo(e,a,s);break;case 3:case 4:var l=n.stateNode.containerInfo,u=ru(e);Zo(e,u,l);break;default:throw Error(K(161))}}catch(d){it(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dm(e,t,r){te=e,wf(e)}function wf(e,t,r){for(var n=(e.mode&1)!==0;te!==null;){var s=te,a=s.child;if(s.tag===22&&n){var l=s.memoizedState!==null||Sa;if(!l){var u=s.alternate,d=u!==null&&u.memoizedState!==null||It;u=Sa;var m=It;if(Sa=l,(It=d)&&!m)for(te=s;te!==null;)l=te,d=l.child,l.tag===22&&l.memoizedState!==null?iu(s):d!==null?(d.return=l,te=d):iu(s);for(;a!==null;)te=a,wf(a),a=a.sibling;te=s,Sa=u,It=m}su(e)}else s.subtreeFlags&8772&&a!==null?(a.return=s,te=a):su(e)}}function su(e){for(;te!==null;){var t=te;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:It||Si(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!It)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:ur(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Fc(t,a,n);break;case 3:var l=t.updateQueue;if(l!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Fc(t,l,r)}break;case 5:var u=t.stateNode;if(r===null&&t.flags&4){r=u;var d=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":d.autoFocus&&r.focus();break;case"img":d.src&&(r.src=d.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var m=t.alternate;if(m!==null){var v=m.memoizedState;if(v!==null){var E=v.dehydrated;E!==null&&Ds(E)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}It||t.flags&512&&Jo(t)}catch(N){it(t,t.return,N)}}if(t===e){te=null;break}if(r=t.sibling,r!==null){r.return=t.return,te=r;break}te=t.return}}function au(e){for(;te!==null;){var t=te;if(t===e){te=null;break}var r=t.sibling;if(r!==null){r.return=t.return,te=r;break}te=t.return}}function iu(e){for(;te!==null;){var t=te;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Si(4,t)}catch(d){it(t,r,d)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(d){it(t,s,d)}}var a=t.return;try{Jo(t)}catch(d){it(t,a,d)}break;case 5:var l=t.return;try{Jo(t)}catch(d){it(t,l,d)}}}catch(d){it(t,t.return,d)}if(t===e){te=null;break}var u=t.sibling;if(u!==null){u.return=t.return,te=u;break}te=t.return}}var fm=Math.ceil,ai=Ir.ReactCurrentDispatcher,Fl=Ir.ReactCurrentOwner,sr=Ir.ReactCurrentBatchConfig,Re=0,gt=null,ut=null,Et=0,Yt=0,On=en(0),ht=0,Gs=null,kn=0,bi=0,Hl=0,Ps=null,Ot=null,Bl=0,Xn=1/0,br=null,ii=!1,qo=null,Yr=null,ba=!1,Fr=null,oi=0,Ms=0,el=null,za=-1,Da=0;function zt(){return Re&6?ct():za!==-1?za:za=ct()}function Gr(e){return e.mode&1?Re&2&&Et!==0?Et&-Et:Qh.transition!==null?(Da===0&&(Da=nd()),Da):(e=$e,e!==0||(e=window.event,e=e===void 0?16:ud(e.type)),e):1}function hr(e,t,r,n){if(50<Ms)throw Ms=0,el=null,Error(K(185));Zs(e,r,n),(!(Re&2)||e!==gt)&&(e===gt&&(!(Re&2)&&(bi|=r),ht===4&&Or(e,Et)),Bt(e,n),r===1&&Re===0&&!(t.mode&1)&&(Xn=ct()+500,vi&&tn()))}function Bt(e,t){var r=e.callbackNode;Qp(e,t);var n=Va(e,e===gt?Et:0);if(n===0)r!==null&&mc(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&mc(r),t===1)e.tag===0?Gh(ou.bind(null,e)):Td(ou.bind(null,e)),Vh(function(){!(Re&6)&&tn()}),r=null;else{switch(sd(n)){case 1:r=ml;break;case 4:r=td;break;case 16:r=Ba;break;case 536870912:r=rd;break;default:r=Ba}r=Tf(r,Sf.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Sf(e,t){if(za=-1,Da=0,Re&6)throw Error(K(327));var r=e.callbackNode;if(Kn()&&e.callbackNode!==r)return null;var n=Va(e,e===gt?Et:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=li(e,n);else{t=n;var s=Re;Re|=2;var a=Ef();(gt!==e||Et!==t)&&(br=null,Xn=ct()+500,mn(e,t));do try{mm();break}catch(u){bf(e,u)}while(!0);_l(),ai.current=a,Re=s,ut!==null?t=0:(gt=null,Et=0,t=ht)}if(t!==0){if(t===2&&(s=jo(e),s!==0&&(n=s,t=tl(e,s))),t===1)throw r=Gs,mn(e,0),Or(e,n),Bt(e,ct()),r;if(t===6)Or(e,n);else{if(s=e.current.alternate,!(n&30)&&!pm(s)&&(t=li(e,n),t===2&&(a=jo(e),a!==0&&(n=a,t=tl(e,a))),t===1))throw r=Gs,mn(e,0),Or(e,n),Bt(e,ct()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(K(345));case 2:ln(e,Ot,br);break;case 3:if(Or(e,n),(n&130023424)===n&&(t=Bl+500-ct(),10<t)){if(Va(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){zt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Ro(ln.bind(null,e,Ot,br),t);break}ln(e,Ot,br);break;case 4:if(Or(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var l=31-pr(n);a=1<<l,l=t[l],l>s&&(s=l),n&=~a}if(n=s,n=ct()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*fm(n/1960))-n,10<n){e.timeoutHandle=Ro(ln.bind(null,e,Ot,br),n);break}ln(e,Ot,br);break;case 5:ln(e,Ot,br);break;default:throw Error(K(329))}}}return Bt(e,ct()),e.callbackNode===r?Sf.bind(null,e):null}function tl(e,t){var r=Ps;return e.current.memoizedState.isDehydrated&&(mn(e,t).flags|=256),e=li(e,t),e!==2&&(t=Ot,Ot=r,t!==null&&rl(t)),e}function rl(e){Ot===null?Ot=e:Ot.push.apply(Ot,e)}function pm(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],a=s.getSnapshot;s=s.value;try{if(!mr(a(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Or(e,t){for(t&=~Hl,t&=~bi,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-pr(t),n=1<<r;e[r]=-1,t&=~n}}function ou(e){if(Re&6)throw Error(K(327));Kn();var t=Va(e,0);if(!(t&1))return Bt(e,ct()),null;var r=li(e,t);if(e.tag!==0&&r===2){var n=jo(e);n!==0&&(t=n,r=tl(e,n))}if(r===1)throw r=Gs,mn(e,0),Or(e,t),Bt(e,ct()),r;if(r===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ln(e,Ot,br),Bt(e,ct()),null}function Vl(e,t){var r=Re;Re|=1;try{return e(t)}finally{Re=r,Re===0&&(Xn=ct()+500,vi&&tn())}}function wn(e){Fr!==null&&Fr.tag===0&&!(Re&6)&&Kn();var t=Re;Re|=1;var r=sr.transition,n=$e;try{if(sr.transition=null,$e=1,e)return e()}finally{$e=n,sr.transition=r,Re=t,!(Re&6)&&tn()}}function Kl(){Yt=On.current,Ye(On)}function mn(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Bh(r)),ut!==null)for(r=ut.return;r!==null;){var n=r;switch(Nl(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Qa();break;case 3:Jn(),Ye(Ft),Ye(Lt),Ll();break;case 5:Il(n);break;case 4:Jn();break;case 13:Ye(Xe);break;case 19:Ye(Xe);break;case 10:Tl(n.type._context);break;case 22:case 23:Kl()}r=r.return}if(gt=e,ut=e=Qr(e.current,null),Et=Yt=t,ht=0,Gs=null,Hl=bi=kn=0,Ot=Ps=null,pn!==null){for(t=0;t<pn.length;t++)if(r=pn[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,a=r.pending;if(a!==null){var l=a.next;a.next=s,n.next=l}r.pending=n}pn=null}return e}function bf(e,t){do{var r=ut;try{if(_l(),Ia.current=si,ni){for(var n=qe.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}ni=!1}if(vn=0,yt=pt=qe=null,_s=!1,Ks=0,Fl.current=null,r===null||r.return===null){ht=1,Gs=t,ut=null;break}e:{var a=e,l=r.return,u=r,d=t;if(t=Et,u.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){var m=d,v=u,E=v.tag;if(!(v.mode&1)&&(E===0||E===11||E===15)){var N=v.alternate;N?(v.updateQueue=N.updateQueue,v.memoizedState=N.memoizedState,v.lanes=N.lanes):(v.updateQueue=null,v.memoizedState=null)}var C=Gc(l);if(C!==null){C.flags&=-257,Qc(C,l,u,a,t),C.mode&1&&Yc(a,m,t),t=C,d=m;var b=t.updateQueue;if(b===null){var w=new Set;w.add(d),t.updateQueue=w}else b.add(d);break e}else{if(!(t&1)){Yc(a,m,t),Wl();break e}d=Error(K(426))}}else if(Je&&u.mode&1){var L=Gc(l);if(L!==null){!(L.flags&65536)&&(L.flags|=256),Qc(L,l,u,a,t),Cl(Zn(d,u));break e}}a=d=Zn(d,u),ht!==4&&(ht=2),Ps===null?Ps=[a]:Ps.push(a),a=l;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=af(a,d,t);$c(a,g);break e;case 1:u=d;var y=a.type,S=a.stateNode;if(!(a.flags&128)&&(typeof y.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Yr===null||!Yr.has(S)))){a.flags|=65536,t&=-t,a.lanes|=t;var I=of(a,u,t);$c(a,I);break e}}a=a.return}while(a!==null)}Cf(r)}catch(A){t=A,ut===r&&r!==null&&(ut=r=r.return);continue}break}while(!0)}function Ef(){var e=ai.current;return ai.current=si,e===null?si:e}function Wl(){(ht===0||ht===3||ht===2)&&(ht=4),gt===null||!(kn&268435455)&&!(bi&268435455)||Or(gt,Et)}function li(e,t){var r=Re;Re|=2;var n=Ef();(gt!==e||Et!==t)&&(br=null,mn(e,t));do try{hm();break}catch(s){bf(e,s)}while(!0);if(_l(),Re=r,ai.current=n,ut!==null)throw Error(K(261));return gt=null,Et=0,ht}function hm(){for(;ut!==null;)Nf(ut)}function mm(){for(;ut!==null&&!$p();)Nf(ut)}function Nf(e){var t=_f(e.alternate,e,Yt);e.memoizedProps=e.pendingProps,t===null?Cf(e):ut=t,Fl.current=null}function Cf(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=lm(r,t),r!==null){r.flags&=32767,ut=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ht=6,ut=null;return}}else if(r=om(r,t,Yt),r!==null){ut=r;return}if(t=t.sibling,t!==null){ut=t;return}ut=t=e}while(t!==null);ht===0&&(ht=5)}function ln(e,t,r){var n=$e,s=sr.transition;try{sr.transition=null,$e=1,xm(e,t,r,n)}finally{sr.transition=s,$e=n}return null}function xm(e,t,r,n){do Kn();while(Fr!==null);if(Re&6)throw Error(K(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(K(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(Jp(e,a),e===gt&&(ut=gt=null,Et=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||ba||(ba=!0,Tf(Ba,function(){return Kn(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=sr.transition,sr.transition=null;var l=$e;$e=1;var u=Re;Re|=4,Fl.current=null,um(e,r),kf(r,e),zh(Io),Ka=!!Ao,Io=Ao=null,e.current=r,dm(r),Fp(),Re=u,$e=l,sr.transition=a}else e.current=r;if(ba&&(ba=!1,Fr=e,oi=s),a=e.pendingLanes,a===0&&(Yr=null),Vp(r.stateNode),Bt(e,ct()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(ii)throw ii=!1,e=qo,qo=null,e;return oi&1&&e.tag!==0&&Kn(),a=e.pendingLanes,a&1?e===el?Ms++:(Ms=0,el=e):Ms=0,tn(),null}function Kn(){if(Fr!==null){var e=sd(oi),t=sr.transition,r=$e;try{if(sr.transition=null,$e=16>e?16:e,Fr===null)var n=!1;else{if(e=Fr,Fr=null,oi=0,Re&6)throw Error(K(331));var s=Re;for(Re|=4,te=e.current;te!==null;){var a=te,l=a.child;if(te.flags&16){var u=a.deletions;if(u!==null){for(var d=0;d<u.length;d++){var m=u[d];for(te=m;te!==null;){var v=te;switch(v.tag){case 0:case 11:case 15:Ts(8,v,a)}var E=v.child;if(E!==null)E.return=v,te=E;else for(;te!==null;){v=te;var N=v.sibling,C=v.return;if(yf(v),v===m){te=null;break}if(N!==null){N.return=C,te=N;break}te=C}}}var b=a.alternate;if(b!==null){var w=b.child;if(w!==null){b.child=null;do{var L=w.sibling;w.sibling=null,w=L}while(w!==null)}}te=a}}if(a.subtreeFlags&2064&&l!==null)l.return=a,te=l;else e:for(;te!==null;){if(a=te,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Ts(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,te=g;break e}te=a.return}}var y=e.current;for(te=y;te!==null;){l=te;var S=l.child;if(l.subtreeFlags&2064&&S!==null)S.return=l,te=S;else e:for(l=y;te!==null;){if(u=te,u.flags&2048)try{switch(u.tag){case 0:case 11:case 15:Si(9,u)}}catch(A){it(u,u.return,A)}if(u===l){te=null;break e}var I=u.sibling;if(I!==null){I.return=u.return,te=I;break e}te=u.return}}if(Re=s,tn(),vr&&typeof vr.onPostCommitFiberRoot=="function")try{vr.onPostCommitFiberRoot(hi,e)}catch{}n=!0}return n}finally{$e=r,sr.transition=t}}return!1}function lu(e,t,r){t=Zn(r,t),t=af(e,t,1),e=Wr(e,t,1),t=zt(),e!==null&&(Zs(e,1,t),Bt(e,t))}function it(e,t,r){if(e.tag===3)lu(e,e,r);else for(;t!==null;){if(t.tag===3){lu(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Yr===null||!Yr.has(n))){e=Zn(r,e),e=of(t,e,1),t=Wr(t,e,1),e=zt(),t!==null&&(Zs(t,1,e),Bt(t,e));break}}t=t.return}}function ym(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=zt(),e.pingedLanes|=e.suspendedLanes&r,gt===e&&(Et&r)===r&&(ht===4||ht===3&&(Et&130023424)===Et&&500>ct()-Bl?mn(e,0):Hl|=r),Bt(e,t)}function jf(e,t){t===0&&(e.mode&1?(t=pa,pa<<=1,!(pa&130023424)&&(pa=4194304)):t=1);var r=zt();e=Mr(e,t),e!==null&&(Zs(e,t,r),Bt(e,r))}function gm(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),jf(e,r)}function vm(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(K(314))}n!==null&&n.delete(t),jf(e,r)}var _f;_f=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ft.current)$t=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return $t=!1,im(e,t,r);$t=!!(e.flags&131072)}else $t=!1,Je&&t.flags&1048576&&Pd(t,Xa,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Ra(e,t),e=t.pendingProps;var s=Yn(t,Lt.current);Vn(t,r),s=zl(null,t,n,e,s,r);var a=Dl();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ht(n)?(a=!0,Ja(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Ml(t),s.updater=ki,t.stateNode=s,s._reactInternals=t,Ho(t,n,e,r),t=Ko(null,t,n,!0,a,r)):(t.tag=0,Je&&a&&El(t),Rt(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Ra(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=wm(n),e=ur(n,e),s){case 0:t=Vo(null,t,n,e,r);break e;case 1:t=Xc(null,t,n,e,r);break e;case 11:t=Jc(null,t,n,e,r);break e;case 14:t=Zc(null,t,n,ur(n.type,e),r);break e}throw Error(K(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:ur(n,s),Vo(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:ur(n,s),Xc(e,t,n,s,r);case 3:e:{if(df(t),e===null)throw Error(K(387));n=t.pendingProps,a=t.memoizedState,s=a.element,Ld(e,t),ti(t,n,null,r);var l=t.memoizedState;if(n=l.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=Zn(Error(K(423)),t),t=qc(e,t,n,r,s);break e}else if(n!==s){s=Zn(Error(K(424)),t),t=qc(e,t,n,r,s);break e}else for(Qt=Kr(t.stateNode.containerInfo.firstChild),Jt=t,Je=!0,fr=null,r=Ud(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Gn(),n===s){t=Ar(e,t,r);break e}Rt(e,t,n,r)}t=t.child}return t;case 5:return Od(t),e===null&&Oo(t),n=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,l=s.children,Lo(n,s)?l=null:a!==null&&Lo(n,a)&&(t.flags|=32),uf(e,t),Rt(e,t,l,r),t.child;case 6:return e===null&&Oo(t),null;case 13:return ff(e,t,r);case 4:return Al(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Qn(t,null,n,r):Rt(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:ur(n,s),Jc(e,t,n,s,r);case 7:return Rt(e,t,t.pendingProps,r),t.child;case 8:return Rt(e,t,t.pendingProps.children,r),t.child;case 12:return Rt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,a=t.memoizedProps,l=s.value,Ke(qa,n._currentValue),n._currentValue=l,a!==null)if(mr(a.value,l)){if(a.children===s.children&&!Ft.current){t=Ar(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var u=a.dependencies;if(u!==null){l=a.child;for(var d=u.firstContext;d!==null;){if(d.context===n){if(a.tag===1){d=_r(-1,r&-r),d.tag=2;var m=a.updateQueue;if(m!==null){m=m.shared;var v=m.pending;v===null?d.next=d:(d.next=v.next,v.next=d),m.pending=d}}a.lanes|=r,d=a.alternate,d!==null&&(d.lanes|=r),$o(a.return,r,t),u.lanes|=r;break}d=d.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(K(341));l.lanes|=r,u=l.alternate,u!==null&&(u.lanes|=r),$o(l,r,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}Rt(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Vn(t,r),s=ar(s),n=n(s),t.flags|=1,Rt(e,t,n,r),t.child;case 14:return n=t.type,s=ur(n,t.pendingProps),s=ur(n.type,s),Zc(e,t,n,s,r);case 15:return lf(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:ur(n,s),Ra(e,t),t.tag=1,Ht(n)?(e=!0,Ja(t)):e=!1,Vn(t,r),zd(t,n,s),Ho(t,n,s,r),Ko(null,t,n,!0,e,r);case 19:return pf(e,t,r);case 22:return cf(e,t,r)}throw Error(K(156,t.tag))};function Tf(e,t){return ed(e,t)}function km(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(e,t,r,n){return new km(e,t,r,n)}function Yl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wm(e){if(typeof e=="function")return Yl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fl)return 11;if(e===pl)return 14}return 2}function Qr(e,t){var r=e.alternate;return r===null?(r=nr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Ua(e,t,r,n,s,a){var l=2;if(n=e,typeof e=="function")Yl(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Tn:return xn(r.children,s,a,t);case dl:l=8,s|=8;break;case fo:return e=nr(12,r,t,s|2),e.elementType=fo,e.lanes=a,e;case po:return e=nr(13,r,t,s),e.elementType=po,e.lanes=a,e;case ho:return e=nr(19,r,t,s),e.elementType=ho,e.lanes=a,e;case Du:return Ei(r,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ru:l=10;break e;case zu:l=9;break e;case fl:l=11;break e;case pl:l=14;break e;case Rr:l=16,n=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=nr(l,r,t,s),t.elementType=e,t.type=n,t.lanes=a,t}function xn(e,t,r,n){return e=nr(7,e,n,t),e.lanes=r,e}function Ei(e,t,r,n){return e=nr(22,e,n,t),e.elementType=Du,e.lanes=r,e.stateNode={isHidden:!1},e}function ao(e,t,r){return e=nr(6,e,null,t),e.lanes=r,e}function io(e,t,r){return t=nr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Sm(e,t,r,n,s){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=$i(0),this.expirationTimes=$i(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$i(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Gl(e,t,r,n,s,a,l,u,d){return e=new Sm(e,t,r,u,d),t===1?(t=1,a===!0&&(t|=8)):t=0,a=nr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ml(a),e}function bm(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_n,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Pf(e){if(!e)return Xr;e=e._reactInternals;e:{if(bn(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ht(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var r=e.type;if(Ht(r))return _d(e,r,t)}return t}function Mf(e,t,r,n,s,a,l,u,d){return e=Gl(r,n,!0,e,s,a,l,u,d),e.context=Pf(null),r=e.current,n=zt(),s=Gr(r),a=_r(n,s),a.callback=t??null,Wr(r,a,s),e.current.lanes=s,Zs(e,s,n),Bt(e,n),e}function Ni(e,t,r,n){var s=t.current,a=zt(),l=Gr(s);return r=Pf(r),t.context===null?t.context=r:t.pendingContext=r,t=_r(a,l),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Wr(s,t,l),e!==null&&(hr(e,s,l,a),Aa(e,s,l)),l}function ci(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function cu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ql(e,t){cu(e,t),(e=e.alternate)&&cu(e,t)}function Em(){return null}var Af=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jl(e){this._internalRoot=e}Ci.prototype.render=Jl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));Ni(e,t,null,null)};Ci.prototype.unmount=Jl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wn(function(){Ni(null,e,null,null)}),t[Pr]=null}};function Ci(e){this._internalRoot=e}Ci.prototype.unstable_scheduleHydration=function(e){if(e){var t=od();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Ur.length&&t!==0&&t<Ur[r].priority;r++);Ur.splice(r,0,e),r===0&&cd(e)}};function Zl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ji(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function uu(){}function Nm(e,t,r,n,s){if(s){if(typeof n=="function"){var a=n;n=function(){var m=ci(l);a.call(m)}}var l=Mf(t,n,e,0,null,!1,!1,"",uu);return e._reactRootContainer=l,e[Pr]=l.current,$s(e.nodeType===8?e.parentNode:e),wn(),l}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var u=n;n=function(){var m=ci(d);u.call(m)}}var d=Gl(e,0,!1,null,null,!1,!1,"",uu);return e._reactRootContainer=d,e[Pr]=d.current,$s(e.nodeType===8?e.parentNode:e),wn(function(){Ni(t,d,r,n)}),d}function _i(e,t,r,n,s){var a=r._reactRootContainer;if(a){var l=a;if(typeof s=="function"){var u=s;s=function(){var d=ci(l);u.call(d)}}Ni(t,l,e,s)}else l=Nm(r,t,e,s,n);return ci(l)}ad=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ks(t.pendingLanes);r!==0&&(xl(t,r|1),Bt(t,ct()),!(Re&6)&&(Xn=ct()+500,tn()))}break;case 13:wn(function(){var n=Mr(e,1);if(n!==null){var s=zt();hr(n,e,1,s)}}),Ql(e,1)}};yl=function(e){if(e.tag===13){var t=Mr(e,134217728);if(t!==null){var r=zt();hr(t,e,134217728,r)}Ql(e,134217728)}};id=function(e){if(e.tag===13){var t=Gr(e),r=Mr(e,t);if(r!==null){var n=zt();hr(r,e,t,n)}Ql(e,t)}};od=function(){return $e};ld=function(e,t){var r=$e;try{return $e=e,t()}finally{$e=r}};Eo=function(e,t,r){switch(t){case"input":if(yo(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=gi(n);if(!s)throw Error(K(90));Ou(n),yo(n,s)}}}break;case"textarea":Fu(e,r);break;case"select":t=r.value,t!=null&&$n(e,!!r.multiple,t,!1)}};Gu=Vl;Qu=wn;var Cm={usingClientEntryPoint:!1,Events:[qs,In,gi,Wu,Yu,Vl]},ms={findFiberByHostInstance:fn,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},jm={bundleType:ms.bundleType,version:ms.version,rendererPackageName:ms.rendererPackageName,rendererConfig:ms.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ir.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Xu(e),e===null?null:e.stateNode},findFiberByHostInstance:ms.findFiberByHostInstance||Em,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ea=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ea.isDisabled&&Ea.supportsFiber)try{hi=Ea.inject(jm),vr=Ea}catch{}}qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cm;qt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zl(t))throw Error(K(200));return bm(e,t,null,r)};qt.createRoot=function(e,t){if(!Zl(e))throw Error(K(299));var r=!1,n="",s=Af;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Gl(e,1,!1,null,null,r,!1,n,s),e[Pr]=t.current,$s(e.nodeType===8?e.parentNode:e),new Jl(t)};qt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=Xu(t),e=e===null?null:e.stateNode,e};qt.flushSync=function(e){return wn(e)};qt.hydrate=function(e,t,r){if(!ji(t))throw Error(K(200));return _i(null,e,t,!0,r)};qt.hydrateRoot=function(e,t,r){if(!Zl(e))throw Error(K(405));var n=r!=null&&r.hydratedSources||null,s=!1,a="",l=Af;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(l=r.onRecoverableError)),t=Mf(t,null,e,1,r??null,s,!1,a,l),e[Pr]=t.current,$s(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new Ci(t)};qt.render=function(e,t,r){if(!ji(t))throw Error(K(200));return _i(null,e,t,!1,r)};qt.unmountComponentAtNode=function(e){if(!ji(e))throw Error(K(40));return e._reactRootContainer?(wn(function(){_i(null,null,e,!1,function(){e._reactRootContainer=null,e[Pr]=null})}),!0):!1};qt.unstable_batchedUpdates=Vl;qt.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!ji(r))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return _i(e,t,r,!1,n)};qt.version="18.2.0-next-9e3b772b8-20220608";function If(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(If)}catch(e){console.error(e)}}If(),Pu.exports=qt;var _m=Pu.exports,du=_m;co.createRoot=du.createRoot,co.hydrateRoot=du.hydrateRoot;/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Tm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pm=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),fu=e=>{const t=Pm(e);return t.charAt(0).toUpperCase()+t.slice(1)},Lf=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Mm=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Am={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Im=$.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:a,iconNode:l,...u},d)=>$.createElement("svg",{ref:d,...Am,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Lf("lucide",s),...!a&&!Mm(u)&&{"aria-hidden":"true"},...u},[...l.map(([m,v])=>$.createElement(m,v)),...Array.isArray(a)?a:[a]]));/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ze=(e,t)=>{const r=$.forwardRef(({className:n,...s},a)=>$.createElement(Im,{ref:a,iconNode:t,className:Lf(`lucide-${Tm(fu(e))}`,`lucide-${e}`,n),...s}));return r.displayName=fu(e),r};/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Lm=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Rf=ze("activity",Lm);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Rm=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],zm=ze("building-2",Rm);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Dm=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Um=ze("chevron-down",Dm);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Om=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],$m=ze("chevron-up",Om);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Fm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],qn=ze("circle-alert",Fm);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Bm=ze("circle-check",Hm);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vm=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ui=ze("circle-check-big",Vm);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Km=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ta=ze("circle-x",Km);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wm=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ra=ze("clock",Wm);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ym=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],zf=ze("download",Ym);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Gm=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Qm=ze("grid-3x3",Gm);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jm=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}],["path",{d:"M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"auskq0"}]],Zm=ze("heart-pulse",Jm);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],qm=ze("info",Xm);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const e0=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],t0=ze("loader-circle",e0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const r0=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Df=ze("lock",r0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const n0=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],s0=ze("monitor",n0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const a0=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Uf=ze("play",a0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const i0=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Of=ze("plus",i0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const o0=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],l0=ze("power",o0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const c0=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Na=ze("refresh-cw",c0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const u0=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],di=ze("save",u0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const d0=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],f0=ze("search",d0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const p0=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],h0=ze("shield",p0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const m0=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],x0=ze("sparkles",m0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const y0=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],g0=ze("square-check-big",y0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const v0=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],k0=ze("square",v0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const w0=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],S0=ze("tag",w0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const b0=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],fi=ze("terminal",b0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const E0=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],pu=ze("trash-2",E0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const N0=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],C0=ze("triangle-alert",N0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const j0=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],_0=ze("users",j0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const T0=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],$f=ze("user",T0);/**
* @license lucide-react v0.545.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const P0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zt=ze("x",P0);class M0{constructor(){ke(this,"debug",this.createLogMethod("debug"));ke(this,"info",this.createLogMethod("info"));ke(this,"warn",this.createLogMethod("warn"));ke(this,"error",this.createLogMethod("error"))}createLogMethod(t){return(r,n,s)=>{try{window.electronAPI&&window.electronAPI.logEvent&&window.electronAPI.logEvent(t,r,n,s)}catch(a){console.error("Failed to send log to main process:",a)}}}}const x=new M0,A0={},hu=e=>{let t;const r=new Set,n=(v,E)=>{const N=typeof v=="function"?v(t):v;if(!Object.is(N,t)){const C=t;t=E??(typeof N!="object"||N===null)?N:Object.assign({},t,N),r.forEach(b=>b(t,C))}},s=()=>t,d={setState:n,getState:s,getInitialState:()=>m,subscribe:v=>(r.add(v),()=>r.delete(v)),destroy:()=>{(A0?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},m=t=e(n,s,d);return d},I0=e=>e?hu(e):hu;var Ff={exports:{}},Hf={},Bf={exports:{}},Vf={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var es=$;function L0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var R0=typeof Object.is=="function"?Object.is:L0,z0=es.useState,D0=es.useEffect,U0=es.useLayoutEffect,O0=es.useDebugValue;function $0(e,t){var r=t(),n=z0({inst:{value:r,getSnapshot:t}}),s=n[0].inst,a=n[1];return U0(function(){s.value=r,s.getSnapshot=t,oo(s)&&a({inst:s})},[e,r,t]),D0(function(){return oo(s)&&a({inst:s}),e(function(){oo(s)&&a({inst:s})})},[e]),O0(r),r}function oo(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!R0(e,r)}catch{return!0}}function F0(e,t){return t()}var H0=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?F0:$0;Vf.useSyncExternalStore=es.useSyncExternalStore!==void 0?es.useSyncExternalStore:H0;Bf.exports=Vf;var B0=Bf.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 Ti=$,V0=B0;function K0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var W0=typeof Object.is=="function"?Object.is:K0,Y0=V0.useSyncExternalStore,G0=Ti.useRef,Q0=Ti.useEffect,J0=Ti.useMemo,Z0=Ti.useDebugValue;Hf.useSyncExternalStoreWithSelector=function(e,t,r,n,s){var a=G0(null);if(a.current===null){var l={hasValue:!1,value:null};a.current=l}else l=a.current;a=J0(function(){function d(C){if(!m){if(m=!0,v=C,C=n(C),s!==void 0&&l.hasValue){var b=l.value;if(s(b,C))return E=b}return E=C}if(b=E,W0(v,C))return b;var w=n(C);return s!==void 0&&s(b,w)?(v=C,b):(v=C,E=w)}var m=!1,v,E,N=r===void 0?null:r;return[function(){return d(t())},N===null?void 0:function(){return d(N())}]},[t,r,n,s]);var u=Y0(e,a[0],a[1]);return Q0(function(){l.hasValue=!0,l.value=u},[u]),Z0(u),u};Ff.exports=Hf;var X0=Ff.exports;const q0=gu(X0),Kf={},{useDebugValue:ex}=_u,{useSyncExternalStoreWithSelector:tx}=q0;let mu=!1;const rx=e=>e;function nx(e,t=rx,r){(Kf?"production":void 0)!=="production"&&r&&!mu&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),mu=!0);const n=tx(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return ex(n),n}const sx=e=>{(Kf?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?I0(e):e,r=(n,s)=>nx(t,n,s);return Object.assign(r,t),r},ax=e=>sx,ix={};function Wf(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var a;const l=d=>d===null?null:JSON.parse(d,void 0),u=(a=r.getItem(s))!=null?a:null;return u instanceof Promise?u.then(l):l(u)},setItem:(s,a)=>r.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>r.removeItem(s)}}const Qs=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return Qs(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Qs(n)(r)}}}},ox=(e,t)=>(r,n,s)=>{let a={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:L=>L,version:0,merge:(L,g)=>({...g,...L}),...t},l=!1;const u=new Set,d=new Set;let m;try{m=a.getStorage()}catch{}if(!m)return e((...L)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...L)},n,s);const v=Qs(a.serialize),E=()=>{const L=a.partialize({...n()});let g;const y=v({state:L,version:a.version}).then(S=>m.setItem(a.name,S)).catch(S=>{g=S});if(g)throw g;return y},N=s.setState;s.setState=(L,g)=>{N(L,g),E()};const C=e((...L)=>{r(...L),E()},n,s);let b;const w=()=>{var L;if(!m)return;l=!1,u.forEach(y=>y(n()));const g=((L=a.onRehydrateStorage)==null?void 0:L.call(a,n()))||void 0;return Qs(m.getItem.bind(m))(a.name).then(y=>{if(y)return a.deserialize(y)}).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==a.version){if(a.migrate)return a.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var S;return b=a.merge(y,(S=n())!=null?S:C),r(b,!0),E()}).then(()=>{g==null||g(b,void 0),l=!0,d.forEach(y=>y(b))}).catch(y=>{g==null||g(void 0,y)})};return s.persist={setOptions:L=>{a={...a,...L},L.getStorage&&(m=L.getStorage())},clearStorage:()=>{m==null||m.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>w(),hasHydrated:()=>l,onHydrate:L=>(u.add(L),()=>{u.delete(L)}),onFinishHydration:L=>(d.add(L),()=>{d.delete(L)})},w(),b||C},lx=(e,t)=>(r,n,s)=>{let a={storage:Wf(()=>localStorage),partialize:w=>w,version:0,merge:(w,L)=>({...L,...w}),...t},l=!1;const u=new Set,d=new Set;let m=a.storage;if(!m)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...w)},n,s);const v=()=>{const w=a.partialize({...n()});return m.setItem(a.name,{state:w,version:a.version})},E=s.setState;s.setState=(w,L)=>{E(w,L),v()};const N=e((...w)=>{r(...w),v()},n,s);s.getInitialState=()=>N;let C;const b=()=>{var w,L;if(!m)return;l=!1,u.forEach(y=>{var S;return y((S=n())!=null?S:N)});const g=((L=a.onRehydrateStorage)==null?void 0:L.call(a,(w=n())!=null?w:N))||void 0;return Qs(m.getItem.bind(m))(a.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==a.version){if(a.migrate)return[!0,a.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var S;const[I,A]=y;if(C=a.merge(A,(S=n())!=null?S:N),r(C,!0),I)return v()}).then(()=>{g==null||g(C,void 0),C=n(),l=!0,d.forEach(y=>y(C))}).catch(y=>{g==null||g(void 0,y)})};return s.persist={setOptions:w=>{a={...a,...w},w.storage&&(m=w.storage)},clearStorage:()=>{m==null||m.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>b(),hasHydrated:()=>l,onHydrate:w=>(u.add(w),()=>{u.delete(w)}),onFinishHydration:w=>(d.add(w),()=>{d.delete(w)})},a.skipHydration||b(),C||N},cx=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((ix?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),ox(e,t)):lx(e,t),ux=cx,ty=[{id:"1",name:"EP-SN-01",status:"running",os:"Ubuntu 22.04 LTS",ip:"192.168.200.2",hypervisor:"VMware ESXi",specs:{cpu:"Intel Core i7-9700K",ram:"16 GB",disk:"512 GB SSD"},testLinks:[{name:"RDP Connection",url:"ssh://192.168.200.3:22"},{name:"Web Server",url:"http://192.168.200.3:8080"},{name:"Admin Panel",url:"http://192.168.200.3:8081/admin"}],logs:[{timestamp:new Date().toISOString(),level:"info",message:"Machine started successfully"},{timestamp:new Date(Date.now()-3e5).toISOString(),level:"info",message:"RDP service is running"}]},{id:"2",name:"EP-Test-01",status:"running",os:"Ubuntu 22.04 LTS",ip:"192.168.200.10",hypervisor:"KVM",specs:{cpu:"AMD Ryzen 7 5700G",ram:"8 GB",disk:"256 GB SSD"},testLinks:[{name:"SSH Connection",url:"ssh://192.168.200.10:22"},{name:"Web Server",url:"http://192.168.200.10:80"},{name:"SFTP",url:"sftp://192.168.200.10:22"}],logs:[{timestamp:new Date().toISOString(),level:"info",message:"SSH service is running"},{timestamp:new Date(Date.now()-6e5).toISOString(),level:"info",message:"System update completed"}]},{id:"3",name:"VNC Desktop",status:"running",os:"CentOS 8",ip:"192.168.1.100",hypervisor:"VMware vSphere",specs:{cpu:"Intel Xeon E5-2680",ram:"12 GB",disk:"1 TB HDD"},testLinks:[{name:"VNC Connection",url:"vnc://192.168.1.100:5901"},{name:"Desktop Environment",url:"http://192.168.1.100:6080"}],logs:[{timestamp:new Date().toISOString(),level:"info",message:"VNC server started"},{timestamp:new Date(Date.now()-9e5).toISOString(),level:"warn",message:"High CPU usage detected"}]},{id:"4",name:"Local Test Machine",status:"running",os:"Windows 11 Pro",ip:"127.0.0.1",hypervisor:"Local",specs:{cpu:"Intel Core i5-12400",ram:"16 GB",disk:"512 GB NVMe"},testLinks:[{name:"Local RDP",url:"rdp://127.0.0.1:3389"},{name:"Localhost Web",url:"http://127.0.0.1:8080"}],logs:[{timestamp:new Date().toISOString(),level:"info",message:"Local machine ready for testing"}]}],Ve={BASE_URL:"https://mc.exbytestudios.com",ENDPOINTS:{AUTH:{LOGIN_ECDH:"/auth/login-ecdh",KEY_EXCHANGE:"/auth/key-exchange",REVOKE:"/auth/revoke"},CONNECTIONS:{CREATE:"/connect",LIST:"/connections",DELETE:e=>`/connections/${e}`},HEALTH:{CHECK:"/health",DETAILED:"/health/detailed"}},TIMEOUTS:{DEFAULT:3e4,LONG:6e4}};function dx(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Yf={exports:{}};const fx={},px=Object.freeze(Object.defineProperty({__proto__:null,default:fx},Symbol.toStringTag,{value:"Module"})),hx=np(px);(function(e){(function(t){var r=function(c){var p,f=new Float64Array(16);if(c)for(p=0;p<c.length;p++)f[p]=c[p];return f},n=function(){throw new Error("no PRNG")},s=new Uint8Array(16),a=new Uint8Array(32);a[0]=9;var l=r(),u=r([1]),d=r([56129,1]),m=r([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),v=r([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),E=r([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),N=r([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),C=r([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function b(c,p,f,o){c[p]=f>>24&255,c[p+1]=f>>16&255,c[p+2]=f>>8&255,c[p+3]=f&255,c[p+4]=o>>24&255,c[p+5]=o>>16&255,c[p+6]=o>>8&255,c[p+7]=o&255}function w(c,p,f,o,h){var j,_=0;for(j=0;j<h;j++)_|=c[p+j]^f[o+j];return(1&_-1>>>8)-1}function L(c,p,f,o){return w(c,p,f,o,16)}function g(c,p,f,o){return w(c,p,f,o,32)}function y(c,p,f,o){for(var h=o[0]&255|(o[1]&255)<<8|(o[2]&255)<<16|(o[3]&255)<<24,j=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,_=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,D=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,W=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,ae=o[4]&255|(o[5]&255)<<8|(o[6]&255)<<16|(o[7]&255)<<24,Z=p[0]&255|(p[1]&255)<<8|(p[2]&255)<<16|(p[3]&255)<<24,Ae=p[4]&255|(p[5]&255)<<8|(p[6]&255)<<16|(p[7]&255)<<24,ee=p[8]&255|(p[9]&255)<<8|(p[10]&255)<<16|(p[11]&255)<<24,fe=p[12]&255|(p[13]&255)<<8|(p[14]&255)<<16|(p[15]&255)<<24,he=o[8]&255|(o[9]&255)<<8|(o[10]&255)<<16|(o[11]&255)<<24,we=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,ve=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,me=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,ge=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,xe=o[12]&255|(o[13]&255)<<8|(o[14]&255)<<16|(o[15]&255)<<24,re=h,ie=j,q=_,ne=D,se=W,J=ae,P=Z,M=Ae,F=ee,z=fe,U=he,B=we,ce=ve,Se=me,Ne=ge,be=xe,k,_e=0;_e<20;_e+=2)k=re+ce|0,se^=k<<7|k>>>25,k=se+re|0,F^=k<<9|k>>>23,k=F+se|0,ce^=k<<13|k>>>19,k=ce+F|0,re^=k<<18|k>>>14,k=J+ie|0,z^=k<<7|k>>>25,k=z+J|0,Se^=k<<9|k>>>23,k=Se+z|0,ie^=k<<13|k>>>19,k=ie+Se|0,J^=k<<18|k>>>14,k=U+P|0,Ne^=k<<7|k>>>25,k=Ne+U|0,q^=k<<9|k>>>23,k=q+Ne|0,P^=k<<13|k>>>19,k=P+q|0,U^=k<<18|k>>>14,k=be+B|0,ne^=k<<7|k>>>25,k=ne+be|0,M^=k<<9|k>>>23,k=M+ne|0,B^=k<<13|k>>>19,k=B+M|0,be^=k<<18|k>>>14,k=re+ne|0,ie^=k<<7|k>>>25,k=ie+re|0,q^=k<<9|k>>>23,k=q+ie|0,ne^=k<<13|k>>>19,k=ne+q|0,re^=k<<18|k>>>14,k=J+se|0,P^=k<<7|k>>>25,k=P+J|0,M^=k<<9|k>>>23,k=M+P|0,se^=k<<13|k>>>19,k=se+M|0,J^=k<<18|k>>>14,k=U+z|0,B^=k<<7|k>>>25,k=B+U|0,F^=k<<9|k>>>23,k=F+B|0,z^=k<<13|k>>>19,k=z+F|0,U^=k<<18|k>>>14,k=be+Ne|0,ce^=k<<7|k>>>25,k=ce+be|0,Se^=k<<9|k>>>23,k=Se+ce|0,Ne^=k<<13|k>>>19,k=Ne+Se|0,be^=k<<18|k>>>14;re=re+h|0,ie=ie+j|0,q=q+_|0,ne=ne+D|0,se=se+W|0,J=J+ae|0,P=P+Z|0,M=M+Ae|0,F=F+ee|0,z=z+fe|0,U=U+he|0,B=B+we|0,ce=ce+ve|0,Se=Se+me|0,Ne=Ne+ge|0,be=be+xe|0,c[0]=re>>>0&255,c[1]=re>>>8&255,c[2]=re>>>16&255,c[3]=re>>>24&255,c[4]=ie>>>0&255,c[5]=ie>>>8&255,c[6]=ie>>>16&255,c[7]=ie>>>24&255,c[8]=q>>>0&255,c[9]=q>>>8&255,c[10]=q>>>16&255,c[11]=q>>>24&255,c[12]=ne>>>0&255,c[13]=ne>>>8&255,c[14]=ne>>>16&255,c[15]=ne>>>24&255,c[16]=se>>>0&255,c[17]=se>>>8&255,c[18]=se>>>16&255,c[19]=se>>>24&255,c[20]=J>>>0&255,c[21]=J>>>8&255,c[22]=J>>>16&255,c[23]=J>>>24&255,c[24]=P>>>0&255,c[25]=P>>>8&255,c[26]=P>>>16&255,c[27]=P>>>24&255,c[28]=M>>>0&255,c[29]=M>>>8&255,c[30]=M>>>16&255,c[31]=M>>>24&255,c[32]=F>>>0&255,c[33]=F>>>8&255,c[34]=F>>>16&255,c[35]=F>>>24&255,c[36]=z>>>0&255,c[37]=z>>>8&255,c[38]=z>>>16&255,c[39]=z>>>24&255,c[40]=U>>>0&255,c[41]=U>>>8&255,c[42]=U>>>16&255,c[43]=U>>>24&255,c[44]=B>>>0&255,c[45]=B>>>8&255,c[46]=B>>>16&255,c[47]=B>>>24&255,c[48]=ce>>>0&255,c[49]=ce>>>8&255,c[50]=ce>>>16&255,c[51]=ce>>>24&255,c[52]=Se>>>0&255,c[53]=Se>>>8&255,c[54]=Se>>>16&255,c[55]=Se>>>24&255,c[56]=Ne>>>0&255,c[57]=Ne>>>8&255,c[58]=Ne>>>16&255,c[59]=Ne>>>24&255,c[60]=be>>>0&255,c[61]=be>>>8&255,c[62]=be>>>16&255,c[63]=be>>>24&255}function S(c,p,f,o){for(var h=o[0]&255|(o[1]&255)<<8|(o[2]&255)<<16|(o[3]&255)<<24,j=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,_=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,D=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,W=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,ae=o[4]&255|(o[5]&255)<<8|(o[6]&255)<<16|(o[7]&255)<<24,Z=p[0]&255|(p[1]&255)<<8|(p[2]&255)<<16|(p[3]&255)<<24,Ae=p[4]&255|(p[5]&255)<<8|(p[6]&255)<<16|(p[7]&255)<<24,ee=p[8]&255|(p[9]&255)<<8|(p[10]&255)<<16|(p[11]&255)<<24,fe=p[12]&255|(p[13]&255)<<8|(p[14]&255)<<16|(p[15]&255)<<24,he=o[8]&255|(o[9]&255)<<8|(o[10]&255)<<16|(o[11]&255)<<24,we=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,ve=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,me=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,ge=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,xe=o[12]&255|(o[13]&255)<<8|(o[14]&255)<<16|(o[15]&255)<<24,re=h,ie=j,q=_,ne=D,se=W,J=ae,P=Z,M=Ae,F=ee,z=fe,U=he,B=we,ce=ve,Se=me,Ne=ge,be=xe,k,_e=0;_e<20;_e+=2)k=re+ce|0,se^=k<<7|k>>>25,k=se+re|0,F^=k<<9|k>>>23,k=F+se|0,ce^=k<<13|k>>>19,k=ce+F|0,re^=k<<18|k>>>14,k=J+ie|0,z^=k<<7|k>>>25,k=z+J|0,Se^=k<<9|k>>>23,k=Se+z|0,ie^=k<<13|k>>>19,k=ie+Se|0,J^=k<<18|k>>>14,k=U+P|0,Ne^=k<<7|k>>>25,k=Ne+U|0,q^=k<<9|k>>>23,k=q+Ne|0,P^=k<<13|k>>>19,k=P+q|0,U^=k<<18|k>>>14,k=be+B|0,ne^=k<<7|k>>>25,k=ne+be|0,M^=k<<9|k>>>23,k=M+ne|0,B^=k<<13|k>>>19,k=B+M|0,be^=k<<18|k>>>14,k=re+ne|0,ie^=k<<7|k>>>25,k=ie+re|0,q^=k<<9|k>>>23,k=q+ie|0,ne^=k<<13|k>>>19,k=ne+q|0,re^=k<<18|k>>>14,k=J+se|0,P^=k<<7|k>>>25,k=P+J|0,M^=k<<9|k>>>23,k=M+P|0,se^=k<<13|k>>>19,k=se+M|0,J^=k<<18|k>>>14,k=U+z|0,B^=k<<7|k>>>25,k=B+U|0,F^=k<<9|k>>>23,k=F+B|0,z^=k<<13|k>>>19,k=z+F|0,U^=k<<18|k>>>14,k=be+Ne|0,ce^=k<<7|k>>>25,k=ce+be|0,Se^=k<<9|k>>>23,k=Se+ce|0,Ne^=k<<13|k>>>19,k=Ne+Se|0,be^=k<<18|k>>>14;c[0]=re>>>0&255,c[1]=re>>>8&255,c[2]=re>>>16&255,c[3]=re>>>24&255,c[4]=J>>>0&255,c[5]=J>>>8&255,c[6]=J>>>16&255,c[7]=J>>>24&255,c[8]=U>>>0&255,c[9]=U>>>8&255,c[10]=U>>>16&255,c[11]=U>>>24&255,c[12]=be>>>0&255,c[13]=be>>>8&255,c[14]=be>>>16&255,c[15]=be>>>24&255,c[16]=P>>>0&255,c[17]=P>>>8&255,c[18]=P>>>16&255,c[19]=P>>>24&255,c[20]=M>>>0&255,c[21]=M>>>8&255,c[22]=M>>>16&255,c[23]=M>>>24&255,c[24]=F>>>0&255,c[25]=F>>>8&255,c[26]=F>>>16&255,c[27]=F>>>24&255,c[28]=z>>>0&255,c[29]=z>>>8&255,c[30]=z>>>16&255,c[31]=z>>>24&255}function I(c,p,f,o){y(c,p,f,o)}function A(c,p,f,o){S(c,p,f,o)}var O=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function R(c,p,f,o,h,j,_){var D=new Uint8Array(16),W=new Uint8Array(64),ae,Z;for(Z=0;Z<16;Z++)D[Z]=0;for(Z=0;Z<8;Z++)D[Z]=j[Z];for(;h>=64;){for(I(W,D,_,O),Z=0;Z<64;Z++)c[p+Z]=f[o+Z]^W[Z];for(ae=1,Z=8;Z<16;Z++)ae=ae+(D[Z]&255)|0,D[Z]=ae&255,ae>>>=8;h-=64,p+=64,o+=64}if(h>0)for(I(W,D,_,O),Z=0;Z<h;Z++)c[p+Z]=f[o+Z]^W[Z];return 0}function H(c,p,f,o,h){var j=new Uint8Array(16),_=new Uint8Array(64),D,W;for(W=0;W<16;W++)j[W]=0;for(W=0;W<8;W++)j[W]=o[W];for(;f>=64;){for(I(_,j,h,O),W=0;W<64;W++)c[p+W]=_[W];for(D=1,W=8;W<16;W++)D=D+(j[W]&255)|0,j[W]=D&255,D>>>=8;f-=64,p+=64}if(f>0)for(I(_,j,h,O),W=0;W<f;W++)c[p+W]=_[W];return 0}function de(c,p,f,o,h){var j=new Uint8Array(32);A(j,o,h,O);for(var _=new Uint8Array(8),D=0;D<8;D++)_[D]=o[D+16];return H(c,p,f,_,j)}function le(c,p,f,o,h,j,_){var D=new Uint8Array(32);A(D,j,_,O);for(var W=new Uint8Array(8),ae=0;ae<8;ae++)W[ae]=j[ae+16];return R(c,p,f,o,h,W,D)}var Fe=function(c){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var p,f,o,h,j,_,D,W;p=c[0]&255|(c[1]&255)<<8,this.r[0]=p&8191,f=c[2]&255|(c[3]&255)<<8,this.r[1]=(p>>>13|f<<3)&8191,o=c[4]&255|(c[5]&255)<<8,this.r[2]=(f>>>10|o<<6)&7939,h=c[6]&255|(c[7]&255)<<8,this.r[3]=(o>>>7|h<<9)&8191,j=c[8]&255|(c[9]&255)<<8,this.r[4]=(h>>>4|j<<12)&255,this.r[5]=j>>>1&8190,_=c[10]&255|(c[11]&255)<<8,this.r[6]=(j>>>14|_<<2)&8191,D=c[12]&255|(c[13]&255)<<8,this.r[7]=(_>>>11|D<<5)&8065,W=c[14]&255|(c[15]&255)<<8,this.r[8]=(D>>>8|W<<8)&8191,this.r[9]=W>>>5&127,this.pad[0]=c[16]&255|(c[17]&255)<<8,this.pad[1]=c[18]&255|(c[19]&255)<<8,this.pad[2]=c[20]&255|(c[21]&255)<<8,this.pad[3]=c[22]&255|(c[23]&255)<<8,this.pad[4]=c[24]&255|(c[25]&255)<<8,this.pad[5]=c[26]&255|(c[27]&255)<<8,this.pad[6]=c[28]&255|(c[29]&255)<<8,this.pad[7]=c[30]&255|(c[31]&255)<<8};Fe.prototype.blocks=function(c,p,f){for(var o=this.fin?0:2048,h,j,_,D,W,ae,Z,Ae,ee,fe,he,we,ve,me,ge,xe,re,ie,q,ne=this.h[0],se=this.h[1],J=this.h[2],P=this.h[3],M=this.h[4],F=this.h[5],z=this.h[6],U=this.h[7],B=this.h[8],ce=this.h[9],Se=this.r[0],Ne=this.r[1],be=this.r[2],k=this.r[3],_e=this.r[4],Ie=this.r[5],Le=this.r[6],je=this.r[7],Pe=this.r[8],Me=this.r[9];f>=16;)h=c[p+0]&255|(c[p+1]&255)<<8,ne+=h&8191,j=c[p+2]&255|(c[p+3]&255)<<8,se+=(h>>>13|j<<3)&8191,_=c[p+4]&255|(c[p+5]&255)<<8,J+=(j>>>10|_<<6)&8191,D=c[p+6]&255|(c[p+7]&255)<<8,P+=(_>>>7|D<<9)&8191,W=c[p+8]&255|(c[p+9]&255)<<8,M+=(D>>>4|W<<12)&8191,F+=W>>>1&8191,ae=c[p+10]&255|(c[p+11]&255)<<8,z+=(W>>>14|ae<<2)&8191,Z=c[p+12]&255|(c[p+13]&255)<<8,U+=(ae>>>11|Z<<5)&8191,Ae=c[p+14]&255|(c[p+15]&255)<<8,B+=(Z>>>8|Ae<<8)&8191,ce+=Ae>>>5|o,ee=0,fe=ee,fe+=ne*Se,fe+=se*(5*Me),fe+=J*(5*Pe),fe+=P*(5*je),fe+=M*(5*Le),ee=fe>>>13,fe&=8191,fe+=F*(5*Ie),fe+=z*(5*_e),fe+=U*(5*k),fe+=B*(5*be),fe+=ce*(5*Ne),ee+=fe>>>13,fe&=8191,he=ee,he+=ne*Ne,he+=se*Se,he+=J*(5*Me),he+=P*(5*Pe),he+=M*(5*je),ee=he>>>13,he&=8191,he+=F*(5*Le),he+=z*(5*Ie),he+=U*(5*_e),he+=B*(5*k),he+=ce*(5*be),ee+=he>>>13,he&=8191,we=ee,we+=ne*be,we+=se*Ne,we+=J*Se,we+=P*(5*Me),we+=M*(5*Pe),ee=we>>>13,we&=8191,we+=F*(5*je),we+=z*(5*Le),we+=U*(5*Ie),we+=B*(5*_e),we+=ce*(5*k),ee+=we>>>13,we&=8191,ve=ee,ve+=ne*k,ve+=se*be,ve+=J*Ne,ve+=P*Se,ve+=M*(5*Me),ee=ve>>>13,ve&=8191,ve+=F*(5*Pe),ve+=z*(5*je),ve+=U*(5*Le),ve+=B*(5*Ie),ve+=ce*(5*_e),ee+=ve>>>13,ve&=8191,me=ee,me+=ne*_e,me+=se*k,me+=J*be,me+=P*Ne,me+=M*Se,ee=me>>>13,me&=8191,me+=F*(5*Me),me+=z*(5*Pe),me+=U*(5*je),me+=B*(5*Le),me+=ce*(5*Ie),ee+=me>>>13,me&=8191,ge=ee,ge+=ne*Ie,ge+=se*_e,ge+=J*k,ge+=P*be,ge+=M*Ne,ee=ge>>>13,ge&=8191,ge+=F*Se,ge+=z*(5*Me),ge+=U*(5*Pe),ge+=B*(5*je),ge+=ce*(5*Le),ee+=ge>>>13,ge&=8191,xe=ee,xe+=ne*Le,xe+=se*Ie,xe+=J*_e,xe+=P*k,xe+=M*be,ee=xe>>>13,xe&=8191,xe+=F*Ne,xe+=z*Se,xe+=U*(5*Me),xe+=B*(5*Pe),xe+=ce*(5*je),ee+=xe>>>13,xe&=8191,re=ee,re+=ne*je,re+=se*Le,re+=J*Ie,re+=P*_e,re+=M*k,ee=re>>>13,re&=8191,re+=F*be,re+=z*Ne,re+=U*Se,re+=B*(5*Me),re+=ce*(5*Pe),ee+=re>>>13,re&=8191,ie=ee,ie+=ne*Pe,ie+=se*je,ie+=J*Le,ie+=P*Ie,ie+=M*_e,ee=ie>>>13,ie&=8191,ie+=F*k,ie+=z*be,ie+=U*Ne,ie+=B*Se,ie+=ce*(5*Me),ee+=ie>>>13,ie&=8191,q=ee,q+=ne*Me,q+=se*Pe,q+=J*je,q+=P*Le,q+=M*Ie,ee=q>>>13,q&=8191,q+=F*_e,q+=z*k,q+=U*be,q+=B*Ne,q+=ce*Se,ee+=q>>>13,q&=8191,ee=(ee<<2)+ee|0,ee=ee+fe|0,fe=ee&8191,ee=ee>>>13,he+=ee,ne=fe,se=he,J=we,P=ve,M=me,F=ge,z=xe,U=re,B=ie,ce=q,p+=16,f-=16;this.h[0]=ne,this.h[1]=se,this.h[2]=J,this.h[3]=P,this.h[4]=M,this.h[5]=F,this.h[6]=z,this.h[7]=U,this.h[8]=B,this.h[9]=ce},Fe.prototype.finish=function(c,p){var f=new Uint16Array(10),o,h,j,_;if(this.leftover){for(_=this.leftover,this.buffer[_++]=1;_<16;_++)this.buffer[_]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(o=this.h[1]>>>13,this.h[1]&=8191,_=2;_<10;_++)this.h[_]+=o,o=this.h[_]>>>13,this.h[_]&=8191;for(this.h[0]+=o*5,o=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=o,o=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=o,f[0]=this.h[0]+5,o=f[0]>>>13,f[0]&=8191,_=1;_<10;_++)f[_]=this.h[_]+o,o=f[_]>>>13,f[_]&=8191;for(f[9]-=8192,h=(o^1)-1,_=0;_<10;_++)f[_]&=h;for(h=~h,_=0;_<10;_++)this.h[_]=this.h[_]&h|f[_];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,j=this.h[0]+this.pad[0],this.h[0]=j&65535,_=1;_<8;_++)j=(this.h[_]+this.pad[_]|0)+(j>>>16)|0,this.h[_]=j&65535;c[p+0]=this.h[0]>>>0&255,c[p+1]=this.h[0]>>>8&255,c[p+2]=this.h[1]>>>0&255,c[p+3]=this.h[1]>>>8&255,c[p+4]=this.h[2]>>>0&255,c[p+5]=this.h[2]>>>8&255,c[p+6]=this.h[3]>>>0&255,c[p+7]=this.h[3]>>>8&255,c[p+8]=this.h[4]>>>0&255,c[p+9]=this.h[4]>>>8&255,c[p+10]=this.h[5]>>>0&255,c[p+11]=this.h[5]>>>8&255,c[p+12]=this.h[6]>>>0&255,c[p+13]=this.h[6]>>>8&255,c[p+14]=this.h[7]>>>0&255,c[p+15]=this.h[7]>>>8&255},Fe.prototype.update=function(c,p,f){var o,h;if(this.leftover){for(h=16-this.leftover,h>f&&(h=f),o=0;o<h;o++)this.buffer[this.leftover+o]=c[p+o];if(f-=h,p+=h,this.leftover+=h,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(f>=16&&(h=f-f%16,this.blocks(c,p,h),p+=h,f-=h),f){for(o=0;o<f;o++)this.buffer[this.leftover+o]=c[p+o];this.leftover+=f}};function Ze(c,p,f,o,h,j){var _=new Fe(j);return _.update(f,o,h),_.finish(c,p),0}function oe(c,p,f,o,h,j){var _=new Uint8Array(16);return Ze(_,0,f,o,h,j),L(c,p,_,0)}function tt(c,p,f,o,h){var j;if(f<32)return-1;for(le(c,0,p,0,f,o,h),Ze(c,16,c,32,f-32,c),j=0;j<16;j++)c[j]=0;return 0}function Vt(c,p,f,o,h){var j,_=new Uint8Array(32);if(f<32||(de(_,0,32,o,h),oe(p,16,p,32,f-32,_)!==0))return-1;for(le(c,0,p,0,f,o,h),j=0;j<32;j++)c[j]=0;return 0}function vt(c,p){var f;for(f=0;f<16;f++)c[f]=p[f]|0}function or(c){var p,f,o=1;for(p=0;p<16;p++)f=c[p]+o+65535,o=Math.floor(f/65536),c[p]=f-o*65536;c[0]+=o-1+37*(o-1)}function Q(c,p,f){for(var o,h=~(f-1),j=0;j<16;j++)o=h&(c[j]^p[j]),c[j]^=o,p[j]^=o}function ue(c,p){var f,o,h,j=r(),_=r();for(f=0;f<16;f++)_[f]=p[f];for(or(_),or(_),or(_),o=0;o<2;o++){for(j[0]=_[0]-65517,f=1;f<15;f++)j[f]=_[f]-65535-(j[f-1]>>16&1),j[f-1]&=65535;j[15]=_[15]-32767-(j[14]>>16&1),h=j[15]>>16&1,j[14]&=65535,Q(_,j,1-h)}for(f=0;f<16;f++)c[2*f]=_[f]&255,c[2*f+1]=_[f]>>8}function ye(c,p){var f=new Uint8Array(32),o=new Uint8Array(32);return ue(f,c),ue(o,p),g(f,0,o,0)}function Be(c){var p=new Uint8Array(32);return ue(p,c),p[0]&1}function He(c,p){var f;for(f=0;f<16;f++)c[f]=p[2*f]+(p[2*f+1]<<8);c[15]&=32767}function mt(c,p,f){for(var o=0;o<16;o++)c[o]=p[o]+f[o]}function ot(c,p,f){for(var o=0;o<16;o++)c[o]=p[o]-f[o]}function Ce(c,p,f){var o,h,j=0,_=0,D=0,W=0,ae=0,Z=0,Ae=0,ee=0,fe=0,he=0,we=0,ve=0,me=0,ge=0,xe=0,re=0,ie=0,q=0,ne=0,se=0,J=0,P=0,M=0,F=0,z=0,U=0,B=0,ce=0,Se=0,Ne=0,be=0,k=f[0],_e=f[1],Ie=f[2],Le=f[3],je=f[4],Pe=f[5],Me=f[6],lt=f[7],Oe=f[8],nt=f[9],st=f[10],at=f[11],ft=f[12],Ct=f[13],jt=f[14],_t=f[15];o=p[0],j+=o*k,_+=o*_e,D+=o*Ie,W+=o*Le,ae+=o*je,Z+=o*Pe,Ae+=o*Me,ee+=o*lt,fe+=o*Oe,he+=o*nt,we+=o*st,ve+=o*at,me+=o*ft,ge+=o*Ct,xe+=o*jt,re+=o*_t,o=p[1],_+=o*k,D+=o*_e,W+=o*Ie,ae+=o*Le,Z+=o*je,Ae+=o*Pe,ee+=o*Me,fe+=o*lt,he+=o*Oe,we+=o*nt,ve+=o*st,me+=o*at,ge+=o*ft,xe+=o*Ct,re+=o*jt,ie+=o*_t,o=p[2],D+=o*k,W+=o*_e,ae+=o*Ie,Z+=o*Le,Ae+=o*je,ee+=o*Pe,fe+=o*Me,he+=o*lt,we+=o*Oe,ve+=o*nt,me+=o*st,ge+=o*at,xe+=o*ft,re+=o*Ct,ie+=o*jt,q+=o*_t,o=p[3],W+=o*k,ae+=o*_e,Z+=o*Ie,Ae+=o*Le,ee+=o*je,fe+=o*Pe,he+=o*Me,we+=o*lt,ve+=o*Oe,me+=o*nt,ge+=o*st,xe+=o*at,re+=o*ft,ie+=o*Ct,q+=o*jt,ne+=o*_t,o=p[4],ae+=o*k,Z+=o*_e,Ae+=o*Ie,ee+=o*Le,fe+=o*je,he+=o*Pe,we+=o*Me,ve+=o*lt,me+=o*Oe,ge+=o*nt,xe+=o*st,re+=o*at,ie+=o*ft,q+=o*Ct,ne+=o*jt,se+=o*_t,o=p[5],Z+=o*k,Ae+=o*_e,ee+=o*Ie,fe+=o*Le,he+=o*je,we+=o*Pe,ve+=o*Me,me+=o*lt,ge+=o*Oe,xe+=o*nt,re+=o*st,ie+=o*at,q+=o*ft,ne+=o*Ct,se+=o*jt,J+=o*_t,o=p[6],Ae+=o*k,ee+=o*_e,fe+=o*Ie,he+=o*Le,we+=o*je,ve+=o*Pe,me+=o*Me,ge+=o*lt,xe+=o*Oe,re+=o*nt,ie+=o*st,q+=o*at,ne+=o*ft,se+=o*Ct,J+=o*jt,P+=o*_t,o=p[7],ee+=o*k,fe+=o*_e,he+=o*Ie,we+=o*Le,ve+=o*je,me+=o*Pe,ge+=o*Me,xe+=o*lt,re+=o*Oe,ie+=o*nt,q+=o*st,ne+=o*at,se+=o*ft,J+=o*Ct,P+=o*jt,M+=o*_t,o=p[8],fe+=o*k,he+=o*_e,we+=o*Ie,ve+=o*Le,me+=o*je,ge+=o*Pe,xe+=o*Me,re+=o*lt,ie+=o*Oe,q+=o*nt,ne+=o*st,se+=o*at,J+=o*ft,P+=o*Ct,M+=o*jt,F+=o*_t,o=p[9],he+=o*k,we+=o*_e,ve+=o*Ie,me+=o*Le,ge+=o*je,xe+=o*Pe,re+=o*Me,ie+=o*lt,q+=o*Oe,ne+=o*nt,se+=o*st,J+=o*at,P+=o*ft,M+=o*Ct,F+=o*jt,z+=o*_t,o=p[10],we+=o*k,ve+=o*_e,me+=o*Ie,ge+=o*Le,xe+=o*je,re+=o*Pe,ie+=o*Me,q+=o*lt,ne+=o*Oe,se+=o*nt,J+=o*st,P+=o*at,M+=o*ft,F+=o*Ct,z+=o*jt,U+=o*_t,o=p[11],ve+=o*k,me+=o*_e,ge+=o*Ie,xe+=o*Le,re+=o*je,ie+=o*Pe,q+=o*Me,ne+=o*lt,se+=o*Oe,J+=o*nt,P+=o*st,M+=o*at,F+=o*ft,z+=o*Ct,U+=o*jt,B+=o*_t,o=p[12],me+=o*k,ge+=o*_e,xe+=o*Ie,re+=o*Le,ie+=o*je,q+=o*Pe,ne+=o*Me,se+=o*lt,J+=o*Oe,P+=o*nt,M+=o*st,F+=o*at,z+=o*ft,U+=o*Ct,B+=o*jt,ce+=o*_t,o=p[13],ge+=o*k,xe+=o*_e,re+=o*Ie,ie+=o*Le,q+=o*je,ne+=o*Pe,se+=o*Me,J+=o*lt,P+=o*Oe,M+=o*nt,F+=o*st,z+=o*at,U+=o*ft,B+=o*Ct,ce+=o*jt,Se+=o*_t,o=p[14],xe+=o*k,re+=o*_e,ie+=o*Ie,q+=o*Le,ne+=o*je,se+=o*Pe,J+=o*Me,P+=o*lt,M+=o*Oe,F+=o*nt,z+=o*st,U+=o*at,B+=o*ft,ce+=o*Ct,Se+=o*jt,Ne+=o*_t,o=p[15],re+=o*k,ie+=o*_e,q+=o*Ie,ne+=o*Le,se+=o*je,J+=o*Pe,P+=o*Me,M+=o*lt,F+=o*Oe,z+=o*nt,U+=o*st,B+=o*at,ce+=o*ft,Se+=o*Ct,Ne+=o*jt,be+=o*_t,j+=38*ie,_+=38*q,D+=38*ne,W+=38*se,ae+=38*J,Z+=38*P,Ae+=38*M,ee+=38*F,fe+=38*z,he+=38*U,we+=38*B,ve+=38*ce,me+=38*Se,ge+=38*Ne,xe+=38*be,h=1,o=j+h+65535,h=Math.floor(o/65536),j=o-h*65536,o=_+h+65535,h=Math.floor(o/65536),_=o-h*65536,o=D+h+65535,h=Math.floor(o/65536),D=o-h*65536,o=W+h+65535,h=Math.floor(o/65536),W=o-h*65536,o=ae+h+65535,h=Math.floor(o/65536),ae=o-h*65536,o=Z+h+65535,h=Math.floor(o/65536),Z=o-h*65536,o=Ae+h+65535,h=Math.floor(o/65536),Ae=o-h*65536,o=ee+h+65535,h=Math.floor(o/65536),ee=o-h*65536,o=fe+h+65535,h=Math.floor(o/65536),fe=o-h*65536,o=he+h+65535,h=Math.floor(o/65536),he=o-h*65536,o=we+h+65535,h=Math.floor(o/65536),we=o-h*65536,o=ve+h+65535,h=Math.floor(o/65536),ve=o-h*65536,o=me+h+65535,h=Math.floor(o/65536),me=o-h*65536,o=ge+h+65535,h=Math.floor(o/65536),ge=o-h*65536,o=xe+h+65535,h=Math.floor(o/65536),xe=o-h*65536,o=re+h+65535,h=Math.floor(o/65536),re=o-h*65536,j+=h-1+37*(h-1),h=1,o=j+h+65535,h=Math.floor(o/65536),j=o-h*65536,o=_+h+65535,h=Math.floor(o/65536),_=o-h*65536,o=D+h+65535,h=Math.floor(o/65536),D=o-h*65536,o=W+h+65535,h=Math.floor(o/65536),W=o-h*65536,o=ae+h+65535,h=Math.floor(o/65536),ae=o-h*65536,o=Z+h+65535,h=Math.floor(o/65536),Z=o-h*65536,o=Ae+h+65535,h=Math.floor(o/65536),Ae=o-h*65536,o=ee+h+65535,h=Math.floor(o/65536),ee=o-h*65536,o=fe+h+65535,h=Math.floor(o/65536),fe=o-h*65536,o=he+h+65535,h=Math.floor(o/65536),he=o-h*65536,o=we+h+65535,h=Math.floor(o/65536),we=o-h*65536,o=ve+h+65535,h=Math.floor(o/65536),ve=o-h*65536,o=me+h+65535,h=Math.floor(o/65536),me=o-h*65536,o=ge+h+65535,h=Math.floor(o/65536),ge=o-h*65536,o=xe+h+65535,h=Math.floor(o/65536),xe=o-h*65536,o=re+h+65535,h=Math.floor(o/65536),re=o-h*65536,j+=h-1+37*(h-1),c[0]=j,c[1]=_,c[2]=D,c[3]=W,c[4]=ae,c[5]=Z,c[6]=Ae,c[7]=ee,c[8]=fe,c[9]=he,c[10]=we,c[11]=ve,c[12]=me,c[13]=ge,c[14]=xe,c[15]=re}function Qe(c,p){Ce(c,p,p)}function rt(c,p){var f=r(),o;for(o=0;o<16;o++)f[o]=p[o];for(o=253;o>=0;o--)Qe(f,f),o!==2&&o!==4&&Ce(f,f,p);for(o=0;o<16;o++)c[o]=f[o]}function kt(c,p){var f=r(),o;for(o=0;o<16;o++)f[o]=p[o];for(o=250;o>=0;o--)Qe(f,f),o!==1&&Ce(f,f,p);for(o=0;o<16;o++)c[o]=f[o]}function xt(c,p,f){var o=new Uint8Array(32),h=new Float64Array(80),j,_,D=r(),W=r(),ae=r(),Z=r(),Ae=r(),ee=r();for(_=0;_<31;_++)o[_]=p[_];for(o[31]=p[31]&127|64,o[0]&=248,He(h,f),_=0;_<16;_++)W[_]=h[_],Z[_]=D[_]=ae[_]=0;for(D[0]=Z[0]=1,_=254;_>=0;--_)j=o[_>>>3]>>>(_&7)&1,Q(D,W,j),Q(ae,Z,j),mt(Ae,D,ae),ot(D,D,ae),mt(ae,W,Z),ot(W,W,Z),Qe(Z,Ae),Qe(ee,D),Ce(D,ae,D),Ce(ae,W,Ae),mt(Ae,D,ae),ot(D,D,ae),Qe(W,D),ot(ae,Z,ee),Ce(D,ae,d),mt(D,D,Z),Ce(ae,ae,D),Ce(D,Z,ee),Ce(Z,W,h),Qe(W,Ae),Q(D,W,j),Q(ae,Z,j);for(_=0;_<16;_++)h[_+16]=D[_],h[_+32]=ae[_],h[_+48]=W[_],h[_+64]=Z[_];var fe=h.subarray(32),he=h.subarray(16);return rt(fe,fe),Ce(he,he,fe),ue(c,he),0}function Kt(c,p){return xt(c,p,a)}function na(c,p){return n(p,32),Kt(c,p)}function En(c,p,f){var o=new Uint8Array(32);return xt(o,f,p),A(c,s,o,O)}var sa=tt,Pi=Vt;function Mi(c,p,f,o,h,j){var _=new Uint8Array(32);return En(_,h,j),sa(c,p,f,o,_)}function Ai(c,p,f,o,h,j){var _=new Uint8Array(32);return En(_,h,j),Pi(c,p,f,o,_)}var aa=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ia(c,p,f,o){for(var h=new Int32Array(16),j=new Int32Array(16),_,D,W,ae,Z,Ae,ee,fe,he,we,ve,me,ge,xe,re,ie,q,ne,se,J,P,M,F,z,U,B,ce=c[0],Se=c[1],Ne=c[2],be=c[3],k=c[4],_e=c[5],Ie=c[6],Le=c[7],je=p[0],Pe=p[1],Me=p[2],lt=p[3],Oe=p[4],nt=p[5],st=p[6],at=p[7],ft=0;o>=128;){for(se=0;se<16;se++)J=8*se+ft,h[se]=f[J+0]<<24|f[J+1]<<16|f[J+2]<<8|f[J+3],j[se]=f[J+4]<<24|f[J+5]<<16|f[J+6]<<8|f[J+7];for(se=0;se<80;se++)if(_=ce,D=Se,W=Ne,ae=be,Z=k,Ae=_e,ee=Ie,fe=Le,he=je,we=Pe,ve=Me,me=lt,ge=Oe,xe=nt,re=st,ie=at,P=Le,M=at,F=M&65535,z=M>>>16,U=P&65535,B=P>>>16,P=(k>>>14|Oe<<18)^(k>>>18|Oe<<14)^(Oe>>>9|k<<23),M=(Oe>>>14|k<<18)^(Oe>>>18|k<<14)^(k>>>9|Oe<<23),F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,P=k&_e^~k&Ie,M=Oe&nt^~Oe&st,F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,P=aa[se*2],M=aa[se*2+1],F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,P=h[se%16],M=j[se%16],F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,z+=F>>>16,U+=z>>>16,B+=U>>>16,q=U&65535|B<<16,ne=F&65535|z<<16,P=q,M=ne,F=M&65535,z=M>>>16,U=P&65535,B=P>>>16,P=(ce>>>28|je<<4)^(je>>>2|ce<<30)^(je>>>7|ce<<25),M=(je>>>28|ce<<4)^(ce>>>2|je<<30)^(ce>>>7|je<<25),F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,P=ce&Se^ce&Ne^Se&Ne,M=je&Pe^je&Me^Pe&Me,F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,z+=F>>>16,U+=z>>>16,B+=U>>>16,fe=U&65535|B<<16,ie=F&65535|z<<16,P=ae,M=me,F=M&65535,z=M>>>16,U=P&65535,B=P>>>16,P=q,M=ne,F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,z+=F>>>16,U+=z>>>16,B+=U>>>16,ae=U&65535|B<<16,me=F&65535|z<<16,Se=_,Ne=D,be=W,k=ae,_e=Z,Ie=Ae,Le=ee,ce=fe,Pe=he,Me=we,lt=ve,Oe=me,nt=ge,st=xe,at=re,je=ie,se%16===15)for(J=0;J<16;J++)P=h[J],M=j[J],F=M&65535,z=M>>>16,U=P&65535,B=P>>>16,P=h[(J+9)%16],M=j[(J+9)%16],F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,q=h[(J+1)%16],ne=j[(J+1)%16],P=(q>>>1|ne<<31)^(q>>>8|ne<<24)^q>>>7,M=(ne>>>1|q<<31)^(ne>>>8|q<<24)^(ne>>>7|q<<25),F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,q=h[(J+14)%16],ne=j[(J+14)%16],P=(q>>>19|ne<<13)^(ne>>>29|q<<3)^q>>>6,M=(ne>>>19|q<<13)^(q>>>29|ne<<3)^(ne>>>6|q<<26),F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,z+=F>>>16,U+=z>>>16,B+=U>>>16,h[J]=U&65535|B<<16,j[J]=F&65535|z<<16;P=ce,M=je,F=M&65535,z=M>>>16,U=P&65535,B=P>>>16,P=c[0],M=p[0],F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,z+=F>>>16,U+=z>>>16,B+=U>>>16,c[0]=ce=U&65535|B<<16,p[0]=je=F&65535|z<<16,P=Se,M=Pe,F=M&65535,z=M>>>16,U=P&65535,B=P>>>16,P=c[1],M=p[1],F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,z+=F>>>16,U+=z>>>16,B+=U>>>16,c[1]=Se=U&65535|B<<16,p[1]=Pe=F&65535|z<<16,P=Ne,M=Me,F=M&65535,z=M>>>16,U=P&65535,B=P>>>16,P=c[2],M=p[2],F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,z+=F>>>16,U+=z>>>16,B+=U>>>16,c[2]=Ne=U&65535|B<<16,p[2]=Me=F&65535|z<<16,P=be,M=lt,F=M&65535,z=M>>>16,U=P&65535,B=P>>>16,P=c[3],M=p[3],F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,z+=F>>>16,U+=z>>>16,B+=U>>>16,c[3]=be=U&65535|B<<16,p[3]=lt=F&65535|z<<16,P=k,M=Oe,F=M&65535,z=M>>>16,U=P&65535,B=P>>>16,P=c[4],M=p[4],F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,z+=F>>>16,U+=z>>>16,B+=U>>>16,c[4]=k=U&65535|B<<16,p[4]=Oe=F&65535|z<<16,P=_e,M=nt,F=M&65535,z=M>>>16,U=P&65535,B=P>>>16,P=c[5],M=p[5],F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,z+=F>>>16,U+=z>>>16,B+=U>>>16,c[5]=_e=U&65535|B<<16,p[5]=nt=F&65535|z<<16,P=Ie,M=st,F=M&65535,z=M>>>16,U=P&65535,B=P>>>16,P=c[6],M=p[6],F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,z+=F>>>16,U+=z>>>16,B+=U>>>16,c[6]=Ie=U&65535|B<<16,p[6]=st=F&65535|z<<16,P=Le,M=at,F=M&65535,z=M>>>16,U=P&65535,B=P>>>16,P=c[7],M=p[7],F+=M&65535,z+=M>>>16,U+=P&65535,B+=P>>>16,z+=F>>>16,U+=z>>>16,B+=U>>>16,c[7]=Le=U&65535|B<<16,p[7]=at=F&65535|z<<16,ft+=128,o-=128}return o}function wr(c,p,f){var o=new Int32Array(8),h=new Int32Array(8),j=new Uint8Array(256),_,D=f;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,h[0]=4089235720,h[1]=2227873595,h[2]=4271175723,h[3]=1595750129,h[4]=2917565137,h[5]=725511199,h[6]=4215389547,h[7]=327033209,ia(o,h,p,f),f%=128,_=0;_<f;_++)j[_]=p[D-f+_];for(j[f]=128,f=256-128*(f<112?1:0),j[f-9]=0,b(j,f-8,D/536870912|0,D<<3),ia(o,h,j,f),_=0;_<8;_++)b(c,8*_,o[_],h[_]);return 0}function Nn(c,p){var f=r(),o=r(),h=r(),j=r(),_=r(),D=r(),W=r(),ae=r(),Z=r();ot(f,c[1],c[0]),ot(Z,p[1],p[0]),Ce(f,f,Z),mt(o,c[0],c[1]),mt(Z,p[0],p[1]),Ce(o,o,Z),Ce(h,c[3],p[3]),Ce(h,h,v),Ce(j,c[2],p[2]),mt(j,j,j),ot(_,o,f),ot(D,j,h),mt(W,j,h),mt(ae,o,f),Ce(c[0],_,D),Ce(c[1],ae,W),Ce(c[2],W,D),Ce(c[3],_,ae)}function oa(c,p,f){var o;for(o=0;o<4;o++)Q(c[o],p[o],f)}function ss(c,p){var f=r(),o=r(),h=r();rt(h,p[2]),Ce(f,p[0],h),Ce(o,p[1],h),ue(c,o),c[31]^=Be(f)<<7}function rn(c,p,f){var o,h;for(vt(c[0],l),vt(c[1],u),vt(c[2],u),vt(c[3],l),h=255;h>=0;--h)o=f[h/8|0]>>(h&7)&1,oa(c,p,o),Nn(p,c),Nn(c,c),oa(c,p,o)}function nn(c,p){var f=[r(),r(),r(),r()];vt(f[0],E),vt(f[1],N),vt(f[2],u),Ce(f[3],E,N),rn(c,f,p)}function as(c,p,f){var o=new Uint8Array(64),h=[r(),r(),r(),r()],j;for(f||n(p,32),wr(o,p,32),o[0]&=248,o[31]&=127,o[31]|=64,nn(h,o),ss(c,h),j=0;j<32;j++)p[j+32]=c[j];return 0}var sn=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function is(c,p){var f,o,h,j;for(o=63;o>=32;--o){for(f=0,h=o-32,j=o-12;h<j;++h)p[h]+=f-16*p[o]*sn[h-(o-32)],f=Math.floor((p[h]+128)/256),p[h]-=f*256;p[h]+=f,p[o]=0}for(f=0,h=0;h<32;h++)p[h]+=f-(p[31]>>4)*sn[h],f=p[h]>>8,p[h]&=255;for(h=0;h<32;h++)p[h]-=f*sn[h];for(o=0;o<32;o++)p[o+1]+=p[o]>>8,c[o]=p[o]&255}function os(c){var p=new Float64Array(64),f;for(f=0;f<64;f++)p[f]=c[f];for(f=0;f<64;f++)c[f]=0;is(c,p)}function T(c,p,f,o){var h=new Uint8Array(64),j=new Uint8Array(64),_=new Uint8Array(64),D,W,ae=new Float64Array(64),Z=[r(),r(),r(),r()];wr(h,o,32),h[0]&=248,h[31]&=127,h[31]|=64;var Ae=f+64;for(D=0;D<f;D++)c[64+D]=p[D];for(D=0;D<32;D++)c[32+D]=h[32+D];for(wr(_,c.subarray(32),f+32),os(_),nn(Z,_),ss(c,Z),D=32;D<64;D++)c[D]=o[D];for(wr(j,c,f+64),os(j),D=0;D<64;D++)ae[D]=0;for(D=0;D<32;D++)ae[D]=_[D];for(D=0;D<32;D++)for(W=0;W<32;W++)ae[D+W]+=j[D]*h[W];return is(c.subarray(32),ae),Ae}function V(c,p){var f=r(),o=r(),h=r(),j=r(),_=r(),D=r(),W=r();return vt(c[2],u),He(c[1],p),Qe(h,c[1]),Ce(j,h,m),ot(h,h,c[2]),mt(j,c[2],j),Qe(_,j),Qe(D,_),Ce(W,D,_),Ce(f,W,h),Ce(f,f,j),kt(f,f),Ce(f,f,h),Ce(f,f,j),Ce(f,f,j),Ce(c[0],f,j),Qe(o,c[0]),Ce(o,o,j),ye(o,h)&&Ce(c[0],c[0],C),Qe(o,c[0]),Ce(o,o,j),ye(o,h)?-1:(Be(c[0])===p[31]>>7&&ot(c[0],l,c[0]),Ce(c[3],c[0],c[1]),0)}function Y(c,p,f,o){var h,j=new Uint8Array(32),_=new Uint8Array(64),D=[r(),r(),r(),r()],W=[r(),r(),r(),r()];if(f<64||V(W,o))return-1;for(h=0;h<f;h++)c[h]=p[h];for(h=0;h<32;h++)c[h+32]=o[h];if(wr(_,c,f),os(_),rn(D,W,_),nn(W,p.subarray(32)),Nn(D,W),ss(j,D),f-=64,g(p,0,j,0)){for(h=0;h<f;h++)c[h]=0;return-1}for(h=0;h<f;h++)c[h]=p[h+64];return f}var G=32,X=24,pe=32,Ee=16,De=32,dt=32,wt=32,St=32,lr=32,ec=X,Xf=pe,qf=Ee,Sr=64,an=32,Cn=64,Ii=32,Li=64;t.lowlevel={crypto_core_hsalsa20:A,crypto_stream_xor:le,crypto_stream:de,crypto_stream_salsa20_xor:R,crypto_stream_salsa20:H,crypto_onetimeauth:Ze,crypto_onetimeauth_verify:oe,crypto_verify_16:L,crypto_verify_32:g,crypto_secretbox:tt,crypto_secretbox_open:Vt,crypto_scalarmult:xt,crypto_scalarmult_base:Kt,crypto_box_beforenm:En,crypto_box_afternm:sa,crypto_box:Mi,crypto_box_open:Ai,crypto_box_keypair:na,crypto_hash:wr,crypto_sign:T,crypto_sign_keypair:as,crypto_sign_open:Y,crypto_secretbox_KEYBYTES:G,crypto_secretbox_NONCEBYTES:X,crypto_secretbox_ZEROBYTES:pe,crypto_secretbox_BOXZEROBYTES:Ee,crypto_scalarmult_BYTES:De,crypto_scalarmult_SCALARBYTES:dt,crypto_box_PUBLICKEYBYTES:wt,crypto_box_SECRETKEYBYTES:St,crypto_box_BEFORENMBYTES:lr,crypto_box_NONCEBYTES:ec,crypto_box_ZEROBYTES:Xf,crypto_box_BOXZEROBYTES:qf,crypto_sign_BYTES:Sr,crypto_sign_PUBLICKEYBYTES:an,crypto_sign_SECRETKEYBYTES:Cn,crypto_sign_SEEDBYTES:Ii,crypto_hash_BYTES:Li,gf:r,D:m,L:sn,pack25519:ue,unpack25519:He,M:Ce,A:mt,S:Qe,Z:ot,pow2523:kt,add:Nn,set25519:vt,modL:is,scalarmult:rn,scalarbase:nn};function tc(c,p){if(c.length!==G)throw new Error("bad key size");if(p.length!==X)throw new Error("bad nonce size")}function ep(c,p){if(c.length!==wt)throw new Error("bad public key size");if(p.length!==St)throw new Error("bad secret key size")}function Wt(){for(var c=0;c<arguments.length;c++)if(!(arguments[c]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function rc(c){for(var p=0;p<c.length;p++)c[p]=0}t.randomBytes=function(c){var p=new Uint8Array(c);return n(p,c),p},t.secretbox=function(c,p,f){Wt(c,p,f),tc(f,p);for(var o=new Uint8Array(pe+c.length),h=new Uint8Array(o.length),j=0;j<c.length;j++)o[j+pe]=c[j];return tt(h,o,o.length,p,f),h.subarray(Ee)},t.secretbox.open=function(c,p,f){Wt(c,p,f),tc(f,p);for(var o=new Uint8Array(Ee+c.length),h=new Uint8Array(o.length),j=0;j<c.length;j++)o[j+Ee]=c[j];return o.length<32||Vt(h,o,o.length,p,f)!==0?null:h.subarray(pe)},t.secretbox.keyLength=G,t.secretbox.nonceLength=X,t.secretbox.overheadLength=Ee,t.scalarMult=function(c,p){if(Wt(c,p),c.length!==dt)throw new Error("bad n size");if(p.length!==De)throw new Error("bad p size");var f=new Uint8Array(De);return xt(f,c,p),f},t.scalarMult.base=function(c){if(Wt(c),c.length!==dt)throw new Error("bad n size");var p=new Uint8Array(De);return Kt(p,c),p},t.scalarMult.scalarLength=dt,t.scalarMult.groupElementLength=De,t.box=function(c,p,f,o){var h=t.box.before(f,o);return t.secretbox(c,p,h)},t.box.before=function(c,p){Wt(c,p),ep(c,p);var f=new Uint8Array(lr);return En(f,c,p),f},t.box.after=t.secretbox,t.box.open=function(c,p,f,o){var h=t.box.before(f,o);return t.secretbox.open(c,p,h)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var c=new Uint8Array(wt),p=new Uint8Array(St);return na(c,p),{publicKey:c,secretKey:p}},t.box.keyPair.fromSecretKey=function(c){if(Wt(c),c.length!==St)throw new Error("bad secret key size");var p=new Uint8Array(wt);return Kt(p,c),{publicKey:p,secretKey:new Uint8Array(c)}},t.box.publicKeyLength=wt,t.box.secretKeyLength=St,t.box.sharedKeyLength=lr,t.box.nonceLength=ec,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(c,p){if(Wt(c,p),p.length!==Cn)throw new Error("bad secret key size");var f=new Uint8Array(Sr+c.length);return T(f,c,c.length,p),f},t.sign.open=function(c,p){if(Wt(c,p),p.length!==an)throw new Error("bad public key size");var f=new Uint8Array(c.length),o=Y(f,c,c.length,p);if(o<0)return null;for(var h=new Uint8Array(o),j=0;j<h.length;j++)h[j]=f[j];return h},t.sign.detached=function(c,p){for(var f=t.sign(c,p),o=new Uint8Array(Sr),h=0;h<o.length;h++)o[h]=f[h];return o},t.sign.detached.verify=function(c,p,f){if(Wt(c,p,f),p.length!==Sr)throw new Error("bad signature size");if(f.length!==an)throw new Error("bad public key size");var o=new Uint8Array(Sr+c.length),h=new Uint8Array(Sr+c.length),j;for(j=0;j<Sr;j++)o[j]=p[j];for(j=0;j<c.length;j++)o[j+Sr]=c[j];return Y(h,o,o.length,f)>=0},t.sign.keyPair=function(){var c=new Uint8Array(an),p=new Uint8Array(Cn);return as(c,p),{publicKey:c,secretKey:p}},t.sign.keyPair.fromSecretKey=function(c){if(Wt(c),c.length!==Cn)throw new Error("bad secret key size");for(var p=new Uint8Array(an),f=0;f<p.length;f++)p[f]=c[32+f];return{publicKey:p,secretKey:new Uint8Array(c)}},t.sign.keyPair.fromSeed=function(c){if(Wt(c),c.length!==Ii)throw new Error("bad seed size");for(var p=new Uint8Array(an),f=new Uint8Array(Cn),o=0;o<32;o++)f[o]=c[o];return as(p,f,!0),{publicKey:p,secretKey:f}},t.sign.publicKeyLength=an,t.sign.secretKeyLength=Cn,t.sign.seedLength=Ii,t.sign.signatureLength=Sr,t.hash=function(c){Wt(c);var p=new Uint8Array(Li);return wr(p,c,c.length),p},t.hash.hashLength=Li,t.verify=function(c,p){return Wt(c,p),c.length===0||p.length===0||c.length!==p.length?!1:w(c,0,p,0,c.length)===0},t.setPRNG=function(c){n=c},function(){var c=typeof self<"u"?self.crypto||self.msCrypto:null;if(c&&c.getRandomValues){var p=65536;t.setPRNG(function(f,o){var h,j=new Uint8Array(o);for(h=0;h<o;h+=p)c.getRandomValues(j.subarray(h,h+Math.min(o-h,p)));for(h=0;h<o;h++)f[h]=j[h];rc(j)})}else typeof dx<"u"&&(c=hx,c&&c.randomBytes&&t.setPRNG(function(f,o){var h,j=c.randomBytes(o);for(h=0;h<o;h++)f[h]=j[h];rc(j)}))}()})(e.exports?e.exports:self.nacl=self.nacl||{})})(Yf);var mx=Yf.exports;class Gf{static async verifyServerKeySignature(t,r,n="production"){try{x.info("signature-verification","🔐 Starting server key signature verification (TweetNaCl)",{environment:n,serverKeyLength:t.length,signatureLength:r.length});const s=this.TRUSTED_SIGNING_KEYS[n];if(!s)return x.error("signature-verification","No trusted signing key found for environment",{environment:n}),!1;const a=this.extractEd25519PublicKeyFromSPKI(s),l=this.base64ToUint8Array(r),u=atob(t),d=new TextEncoder().encode(u);x.debug("signature-verification","Verification data prepared",{trustedKeyLength:a.length,signatureLength:l.length,messageLength:d.length});const m=mx.sign.detached.verify(d,l,a);return m?x.info("signature-verification","✅ Server key signature verification successful"):x.warn("signature-verification","❌ Server key signature verification failed"),m}catch(s){return x.error("signature-verification","Server key signature verification error",{error:s instanceof Error?s.message:String(s),environment:n}),!1}}static extractEd25519PublicKeyFromSPKI(t){try{const r=atob(t);x.debug("signature-verification","Decoded PEM from base64",{pemLength:r.length,hasPemHeaders:r.includes("-----BEGIN PUBLIC KEY-----")});const n=r.replace(/-----BEGIN PUBLIC KEY-----/g,"").replace(/-----END PUBLIC KEY-----/g,"").replace(/\s/g,""),s=this.base64ToUint8Array(n);if(x.debug("signature-verification","Extracted SPKI bytes",{spkiLength:s.length}),s.length<32)throw new Error(`SPKI too short: ${s.length} bytes (expected >=32)`);const a=s.slice(s.length-32);return x.info("signature-verification","🔑 Ed25519 raw public key extracted",{rawKeyLength:a.length}),a}catch(r){throw x.error("signature-verification","Failed to extract Ed25519 public key from SPKI",{error:r instanceof Error?r.message:String(r),keyLength:t.length,keyPreview:t.substring(0,50)+"..."}),r}}static base64ToUint8Array(t){const r=atob(t),n=new Uint8Array(r.length);for(let s=0;s<r.length;s++)n[s]=r.charCodeAt(s);return n}}ke(Gf,"TRUSTED_SIGNING_KEYS",{production:"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUNvd0JRWURLMlZ3QXlFQUU5TEUwQ2t2SGRGcFRGVHZORkVLbkZqMFJZQkc1dVYrQ0F0TkJVR2ZSUHM9Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo=",staging:"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUNvd0JRWURLMlZ3QXlFQUU5TEUwQ2t2SGRGcFRGVHZORkVLbkZqMFJZQkc1dVYrQ0F0TkJVR2ZSUHM9Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo=",development:"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUNvd0JRWURLMlZ3QXlFQUU5TEUwQ2t2SGRGcFRGVHZORkVLbkZqMFJZQkc1dVYrQ0F0TkJVR2ZSUHM9Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo="});class cn{static async generateKeyPair(){try{const t=await crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveBits","deriveKey"]);return this.keyPair={privateKey:t.privateKey,publicKey:t.publicKey},this.keyPairCreatedAt=Date.now(),console.log("ECDH key pair generated successfully"),this.keyPair}catch(t){throw console.error("Failed to generate ECDH key pair:",t),t}}static isKeyPairExpired(){return this.keyPairCreatedAt?Date.now()-this.keyPairCreatedAt>this.KEY_PAIR_TTL:!0}static async getClientPublicKey(){(!this.keyPair||this.isKeyPairExpired())&&await this.generateKeyPair();try{const t=await crypto.subtle.exportKey("spki",this.keyPair.publicKey),r=new Uint8Array(t);return`-----BEGIN PUBLIC KEY-----
${btoa(String.fromCharCode(...r))}
-----END PUBLIC KEY-----`}catch(t){throw console.error("Failed to export client public key:",t),t}}static async getClientPublicKeyBase64(){this.keyPair||await this.generateKeyPair();try{const t=await crypto.subtle.exportKey("spki",this.keyPair.publicKey),r=new Uint8Array(t),s=`-----BEGIN PUBLIC KEY-----
${btoa(String.fromCharCode(...r))}
-----END PUBLIC KEY-----`,a=new TextEncoder().encode(s);return btoa(String.fromCharCode(...a))}catch(t){throw console.error("Failed to export client public key as base64:",t),t}}static async setServerPublicKey(t){try{if(x.info("key-exchange","Setting server public key with signature verification",{curve:t.curve,format:t.format,hasSignature:!!t.signature}),!t.signature)throw x.error("key-exchange","Server public key missing signature - rejecting for security"),new Error("Server public key missing Ed25519 signature - possible MITM attack!");if(!await Gf.verifyServerKeySignature(t.public_key,t.signature,"production"))throw x.error("key-exchange","Invalid server key signature - rejecting for security",{serverKeyHash:t.public_key.substring(0,50)+"..."}),new Error("Invalid server key signature - possible MITM attack!");this.serverPublicKey=t,x.info("key-exchange","Server public key verified and set successfully",{curve:t.curve,format:t.format,serverKeyHash:t.public_key.substring(0,50)+"..."})}catch(r){throw x.error("key-exchange","Failed to set server public key",{error:r instanceof Error?r.message:String(r),curve:t.curve}),r}}static async deriveSharedSecret(t){if(!this.keyPair||this.isKeyPairExpired())throw new Error("Client key pair not generated or expired");if(!this.serverPublicKey)throw new Error("Server public key not set");try{const r=atob(this.serverPublicKey.public_key);x.debug("key-exchange","Decoded ECDH server PEM from base64",{pemLength:r.length,hasPemHeaders:r.includes("-----BEGIN PUBLIC KEY-----")});const n=r.replace(/-----BEGIN PUBLIC KEY-----/g,"").replace(/-----END PUBLIC KEY-----/g,"").replace(/\s/g,""),s=Uint8Array.from(atob(n),m=>m.charCodeAt(0));x.debug("key-exchange","Extracted ECDH SPKI bytes",{bufferLength:s.length});const a=await crypto.subtle.importKey("spki",s,{name:"ECDH",namedCurve:"P-256"},!1,[]),l=await crypto.subtle.deriveBits({name:"ECDH",public:a},this.keyPair.privateKey,256);if(t){const m=atob(t),v=new Uint8Array(m.length);for(let E=0;E<m.length;E++)v[E]=m.charCodeAt(E);this.hkdfSalt=v,x.info("key-exchange","Using HKDF salt from server",{saltLength:this.hkdfSalt.length})}else this.hkdfSalt=crypto.getRandomValues(new Uint8Array(32)),x.warn("key-exchange","No server salt provided, generating client salt (legacy mode)");const u={name:"HKDF",hash:"SHA-256",salt:this.hkdfSalt,info:new TextEncoder().encode("remote_access_ecdh")},d=await crypto.subtle.deriveKey(u,await crypto.subtle.importKey("raw",l,"HKDF",!1,["deriveKey"]),{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]);return this.sharedSecret=d,x.info("key-exchange","Shared secret derived with HKDF successfully",{usedServerSalt:!!t}),d}catch(r){throw x.error("key-exchange","Failed to derive shared secret",{error:r}),r}}static getHKDFSalt(){return this.hkdfSalt?btoa(String.fromCharCode(...this.hkdfSalt)):null}static async getEncryptionKey(){this.sharedSecret||await this.deriveSharedSecret();try{const t=await crypto.subtle.exportKey("raw",this.sharedSecret),r=new Uint8Array(t);return btoa(String.fromCharCode(...r))}catch(t){throw console.error("Failed to export encryption key:",t),t}}static async performKeyExchange(t){try{this.setServerPublicKey(t),await this.deriveSharedSecret(t.hkdf_salt);const r=await this.getEncryptionKey();return console.log("Key exchange completed successfully"),r}catch(r){throw console.error("Key exchange failed:",r),r}}static isKeyExchangeComplete(){return this.keyPair!==null&&this.serverPublicKey!==null&&this.sharedSecret!==null}static reset(){this.keyPair=null,this.serverPublicKey=null,this.sharedSecret=null,console.log("Key exchange state reset")}static getStatus(){return{hasKeyPair:this.keyPair!==null,hasServerKey:this.serverPublicKey!==null,hasSharedSecret:this.sharedSecret!==null,isComplete:this.isKeyExchangeComplete()}}static validateServerPublicKey(t){try{if(t.format!=="PEM")return console.error("Invalid server key format:",t.format),!1;if(t.curve!=="P-256")return console.error("Invalid server key curve:",t.curve),!1;try{atob(t.public_key)}catch(r){return console.error("Invalid server key encoding:",r),!1}return!0}catch(r){return console.error("Server key validation failed:",r),!1}}static getStatistics(){var t;return{keyPairGenerated:this.keyPair!==null,serverKeyReceived:this.serverPublicKey!==null,sharedSecretDerived:this.sharedSecret!==null,curve:((t=this.serverPublicKey)==null?void 0:t.curve)||null,keySize:this.sharedSecret?256:null}}}ke(cn,"keyPair",null),ke(cn,"serverPublicKey",null),ke(cn,"sharedSecret",null),ke(cn,"keyPairCreatedAt",null),ke(cn,"hkdfSalt",null),ke(cn,"KEY_PAIR_TTL",5*60*1e3);const Nr=cn;class xx{constructor(){ke(this,"encryptionKey",null);ke(this,"useECDH",!1)}async initializeWithECDH(t){try{this.useECDH=!0;const r=await Nr.performKeyExchange(t),n=this.base64ToArrayBuffer(r);this.encryptionKey=await crypto.subtle.importKey("raw",n,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"]),x.info("encryption-service","EncryptionService initialized with ECDH key exchange")}catch(r){throw x.error("encryption-service","Failed to initialize EncryptionService with ECDH",{error:r}),r}}async initializeKey(t){try{this.useECDH=!1;const r=this.base64ToArrayBuffer(t);this.encryptionKey=await crypto.subtle.importKey("raw",r,{name:"AES-GCM"},!1,["encrypt","decrypt"]),x.info("encryption-service","Encryption key initialized successfully")}catch(r){throw x.error("encryption-service","Failed to initialize encryption key",{error:r}),new Error("Failed to initialize encryption key")}}async encryptPassword(t,r){if(!this.encryptionKey)throw new Error("Encryption key not initialized");try{const n=crypto.getRandomValues(new Uint8Array(12)),s=new TextEncoder().encode(t),a={name:"AES-GCM",iv:n};let l=0,u;if(r){l=Date.now(),u=crypto.getRandomValues(new Uint8Array(16));const N={sessionId:r,timestamp:l,clientNonce:Array.from(u)};a.additionalData=new TextEncoder().encode(JSON.stringify(N))}const d=await crypto.subtle.encrypt(a,this.encryptionKey,s),m=new Uint8Array(n.length+d.byteLength);m.set(n,0),m.set(new Uint8Array(d),n.length);const v=this.arrayBufferToBase64(m.buffer),E=u?this.arrayBufferToBase64(u.buffer):"";return x.debug("encryption-service","Password encrypted successfully",{passwordLength:t.length,encryptedLength:v.length,sessionId:r,usesAAD:!!r}),{encrypted:v,nonce:E,timestamp:l}}catch(n){throw x.error("encryption-service","Failed to encrypt password",{error:n}),new Error("Password encryption failed")}}async decryptPassword(t,r,n,s){if(!this.encryptionKey)throw new Error("Encryption key not initialized");try{const a=this.base64ToArrayBuffer(t),l=a.slice(0,12),u=a.slice(12);let d;if(r&&n&&s){const E=new Uint8Array(this.base64ToArrayBuffer(n)),N={sessionId:r,timestamp:s,clientNonce:Array.from(E)};d=new TextEncoder().encode(JSON.stringify(N))}const m=await crypto.subtle.decrypt({name:"AES-GCM",iv:l,...d&&{additionalData:d}},this.encryptionKey,u),v=new TextDecoder().decode(m);return x.debug("encryption-service","Password decrypted successfully"),v}catch(a){throw x.error("encryption-service","Failed to decrypt password",{error:a}),new Error("Password decryption failed")}}isInitialized(){return this.encryptionKey!==null}isUsingECDH(){return this.useECDH}getStatus(){return{initialized:this.isInitialized(),useECDH:this.useECDH,keyExchangeComplete:this.useECDH?Nr.isKeyExchangeComplete():!0}}clearKey(){this.encryptionKey=null,this.useECDH&&(Nr.reset(),this.useECDH=!1),x.info("encryption-service","Encryption key cleared")}base64ToArrayBuffer(t){const r=atob(t),n=new Uint8Array(r.length);for(let s=0;s<r.length;s++)n[s]=r.charCodeAt(s);return n.buffer}arrayBufferToBase64(t){const r=new Uint8Array(t);let n="";for(let s=0;s<r.byteLength;s++)n+=String.fromCharCode(r[s]);return btoa(n)}async testEncryption(t="test123",r="test-session"){try{if(!this.isInitialized())throw new Error("Encryption key not initialized");const n=await this.encryptPassword(t,r),a=await this.decryptPassword(n.encrypted,r,n.nonce,n.timestamp)===t;return x.info("encryption-service","Encryption test completed",{success:a,testPasswordLength:t.length,encryptedLength:n.encrypted.length}),a}catch(n){return x.error("encryption-service","Encryption test failed",{error:n}),!1}}}const At=new xx,yx="modulepreload",gx=function(e,t){return new URL(e,t).href},xu={},Xl=function(t,r,n){let s=Promise.resolve();if(r&&r.length>0){const l=document.getElementsByTagName("link"),u=document.querySelector("meta[property=csp-nonce]"),d=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=Promise.allSettled(r.map(m=>{if(m=gx(m,n),m in xu)return;xu[m]=!0;const v=m.endsWith(".css"),E=v?'[rel="stylesheet"]':"";if(!!n)for(let b=l.length-1;b>=0;b--){const w=l[b];if(w.href===m&&(!v||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${E}`))return;const C=document.createElement("link");if(C.rel=v?"stylesheet":yx,v||(C.as="script"),C.crossOrigin="",C.href=m,d&&C.setAttribute("nonce",d),document.head.appendChild(C),v)return new Promise((b,w)=>{C.addEventListener("load",b),C.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${m}`)))})}))}function a(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return s.then(l=>{for(const u of l||[])u.status==="rejected"&&a(u.reason);return t().catch(a)})};class un{static createError(t,r,n,s,a=!1){const l={type:t,message:r,userMessage:n||this.getDefaultUserMessage(t),details:s,timestamp:new Date,retryable:a};return x.error("error-handler",`${t} error occurred`,{type:t,message:r,userMessage:l.userMessage,retryable:a,details:s}),l}static async handleApiError(t){var r,n;if(t instanceof Response){let s={};try{const a=t.headers.get("content-type");a!=null&&a.includes("application/json")?s=await t.json():s={message:await t.text()}}catch(a){x.warn("error-handler","Failed to parse error response",{parseError:a})}switch(t.status){case 401:return this.createError("AUTH","Unauthorized access","Your session has expired. Please log in again.",{status:t.status,details:s});case 403:let a="You don't have permission to perform this action.";return(r=s.message)!=null&&r.includes("create_connections")||(n=s.required_role)!=null&&n.includes("privileges")?a="Your account has limited access (GUEST role). You can only view connections but cannot create new ones. Please contact your administrator to upgrade your account to USER role for full access.":s.message&&(a=`Access denied: ${s.message}`),this.createError("PERMISSION","Forbidden access",a,{status:t.status,details:s});case 404:return this.createError("NETWORK","Resource not found","The requested resource was not found.",{status:t.status,details:s});case 422:return this.createError("VALIDATION","Validation error",s.detail||"Please check your input and try again.",{status:t.status,details:s});case 429:return this.createError("NETWORK","Too many requests","Too many requests. Please wait a moment and try again.",{status:t.status,details:s},!0);case 500:case 502:case 503:case 504:return this.createError("NETWORK","Server error","A server error occurred. Please try again later.",{status:t.status,details:s},!0);default:return this.createError("NETWORK",`HTTP ${t.status}: ${t.statusText}`,"A network error occurred. Please try again.",{status:t.status,details:s},t.status>=500)}}if(t instanceof Error){if(t.name==="TypeError"&&t.message.includes("fetch"))return this.createError("NETWORK","Network connection failed","Unable to connect to the server. Please check your internet connection.",{originalError:t.message},!0);if(t.name==="AbortError")return this.createError("NETWORK","Request timeout","The request took too long. Please try again.",{originalError:t.message},!0);if(t.message.includes("encryption")||t.message.includes("crypto"))return this.createError("ENCRYPTION","Encryption error","A security error occurred. Please try logging in again.",{originalError:t.message});if(t.message.includes("guacamole")||t.message.includes("connection"))return this.createError("GUACAMOLE","Connection error","Failed to connect to the remote machine. Please check credentials and try again.",{originalError:t.message},!0)}return this.createError("UNKNOWN",t instanceof Error?t.message:String(t),"An unexpected error occurred. Please try again.",{originalError:t})}static shouldRetry(t,r,n=3){return r>=n?!1:t.retryable}static getDefaultUserMessage(t){switch(t){case"NETWORK":return"A network error occurred. Please try again.";case"AUTH":return"Authentication failed. Please log in again.";case"VALIDATION":return"Please check your input and try again.";case"PERMISSION":return"You don't have permission to perform this action.";case"GUACAMOLE":return"Failed to connect to the remote machine. Please try again.";case"ENCRYPTION":return"A security error occurred. Please try again.";default:return"An unexpected error occurred. Please try again."}}static formatErrorForUI(t){let r,n="error",s;switch(t.type){case"AUTH":r="Authentication Error",s="Please log in again";break;case"NETWORK":r="Connection Error",n=t.retryable?"warning":"error",s=t.retryable?"Retrying...":void 0;break;case"VALIDATION":r="Input Error",n="warning";break;case"PERMISSION":r="Access Denied";break;case"GUACAMOLE":r="Connection Failed",s="Check credentials and try again";break;case"ENCRYPTION":r="Security Error",s="Please restart the application";break;default:r="Error"}return{title:r,message:t.userMessage,type:n,action:s}}}class Ss{static async verifyCertificate(t){try{if(typeof window<"u"&&window.electronAPI){const r=await window.electronAPI.getCertificate(t);return this.validateCertificate(t,r)}return this.validateCertificateBrowser(t)}catch(r){return console.error("Certificate verification failed:",r),!1}}static validateCertificate(t,r){const n=this.PINNED_CERTIFICATES.find(d=>d.hostname===t);if(!n)return console.warn(`No pinned certificate found for hostname: ${t}`),!0;if(r.fingerprint.toLowerCase()!==n.fingerprint.toLowerCase())return console.error(`Certificate fingerprint mismatch for ${t}:`,{expected:n.fingerprint,actual:r.fingerprint}),!1;if(r.algorithm!==n.algorithm)return console.error(`Certificate algorithm mismatch for ${t}:`,{expected:n.algorithm,actual:r.algorithm}),!1;const s=new Date(r.validTo),a=new Date;if(s<a)return console.error(`Certificate expired for ${t}:`,{validTo:r.validTo,now:a.toISOString()}),!1;const l=new Date(r.validFrom),u=(a.getTime()-l.getTime())/(1e3*60*60*24);return u>this.MAX_CERTIFICATE_AGE_DAYS&&console.warn(`Certificate is too old for ${t}:`,{ageInDays:u,maxAge:this.MAX_CERTIFICATE_AGE_DAYS}),console.log(`Certificate validation passed for ${t}`),!0}static validateCertificateBrowser(t){return window.location.protocol!=="https:"?(console.error("Non-HTTPS connection detected"),!1):(this.PINNED_CERTIFICATES.find(n=>n.hostname===t)&&console.log(`HTTPS validation passed for ${t}`),!0)}static getPinnedCertificate(t){return this.PINNED_CERTIFICATES.find(r=>r.hostname===t)||null}static addPinnedCertificate(t){const r=this.PINNED_CERTIFICATES.findIndex(n=>n.hostname===t.hostname);r>=0?this.PINNED_CERTIFICATES[r]=t:this.PINNED_CERTIFICATES.push(t),console.log(`Added pinned certificate for ${t.hostname}`)}static removePinnedCertificate(t){const r=this.PINNED_CERTIFICATES.findIndex(n=>n.hostname===t);return r>=0?(this.PINNED_CERTIFICATES.splice(r,1),console.log(`Removed pinned certificate for ${t}`),!0):!1}static getAllPinnedCertificates(){return[...this.PINNED_CERTIFICATES]}static hasPinnedCertificate(t){return this.PINNED_CERTIFICATES.some(r=>r.hostname===t)}static updateCertificateFingerprint(t,r){const n=this.getPinnedCertificate(t);return n?(n.fingerprint=r,n.lastVerified=new Date().toISOString(),console.log(`Updated certificate fingerprint for ${t}`),!0):!1}static async validateAllCertificates(){const t={};for(const r of this.PINNED_CERTIFICATES)try{t[r.hostname]=await this.verifyCertificate(r.hostname)}catch(n){console.error(`Failed to validate certificate for ${r.hostname}:`,n),t[r.hostname]=!1}return t}static getStatistics(){const t=this.PINNED_CERTIFICATES,r=t.reduce((s,a)=>(s[a.algorithm]=(s[a.algorithm]||0)+1,s),{}),n=t.sort((s,a)=>new Date(s.lastVerified).getTime()-new Date(a.lastVerified).getTime());return{totalCertificates:t.length,certificatesByAlgorithm:r,oldestCertificate:n[0]||null,newestCertificate:n[n.length-1]||null}}}ke(Ss,"pinCache",null),ke(Ss,"CACHE_TTL",24*60*60*1e3),ke(Ss,"PINNED_CERTIFICATES",[{hostname:"mc.exbytestudios.com",fingerprint:"PLACEHOLDER_REAL_CERTIFICATE_FINGERPRINT_HERE",algorithm:"sha256",lastVerified:new Date().toISOString()},{hostname:"backup.mc.exbytestudios.com",fingerprint:"PLACEHOLDER_BACKUP_CERTIFICATE_FINGERPRINT_HERE",algorithm:"sha256",lastVerified:new Date().toISOString()}]),ke(Ss,"MAX_CERTIFICATE_AGE_DAYS",365);const lo=new Ss;class Gt{static async fetchWithRetry(t,r={}){var v,E,N;const{timeout:n=this.defaultTimeout,retryConfig:s={},...a}=r;if(!((v=a.headers)!=null&&v.Authorization))try{const b=(await Xl(async()=>{const{authService:w}=await Promise.resolve().then(()=>vx);return{authService:w}},void 0,import.meta.url)).authService.getToken();b&&(a.headers={...a.headers,Authorization:`Bearer ${b}`})}catch{}try{const C=new URL(t).hostname;if(!lo.isPinCacheValid())try{await lo.loadDynamicPins(Ve.BASE_URL)}catch(w){x.warn("api-client","Failed to load dynamic certificate pins, using static pins",{error:w})}if(!await lo.verifyCertificate(C)){const w=new Error(`Certificate pinning validation failed for ${C}`);throw x.error("api-client","Certificate pinning failed",{hostname:C,url:t}),w}x.debug("api-client","Certificate pinning validation passed",{hostname:C})}catch(C){throw x.error("api-client","Certificate pinning error",{error:C,url:t}),C}const l={...this.defaultRetryConfig,...s};let u,d=0;for(;d<=l.maxRetries;)try{x.debug("api-client",`Attempting request (${d+1}/${l.maxRetries+1})`,{url:t,method:a.method||"GET",attempt:d+1});const C=new AbortController,b=setTimeout(()=>C.abort(),n),w=await fetch(t,{...a,signal:C.signal});if(clearTimeout(b),!w.ok){const g=w.clone();if(d<l.maxRetries&&((E=l.retryCondition)!=null&&E.call(l,g))){u=g;const y=this.calculateDelay(d,l);x.warn("api-client",`Request failed, retrying in ${y}ms`,{url:t,status:w.status,attempt:d+1,nextRetryIn:y}),await this.delay(y),d++;continue}throw g}x.info("api-client","Request successful",{url:t,status:w.status,attempt:d+1});const L=w.headers.get("content-type");return L!=null&&L.includes("application/json")?await w.json():{}}catch(C){if(u=C,d<l.maxRetries&&((N=l.retryCondition)!=null&&N.call(l,C))){const b=this.calculateDelay(d,l);x.warn("api-client",`Request failed with error, retrying in ${b}ms`,{url:t,error:C instanceof Error?C.message:String(C),attempt:d+1,nextRetryIn:b}),await this.delay(b),d++;continue}break}throw x.error("api-client","Request failed after all retries",{url:t,totalAttempts:d+1,error:u}),await un.handleApiError(u)}static async get(t,r={}){return this.fetchWithRetry(t,{...r,method:"GET"})}static async post(t,r,n={}){return this.fetchWithRetry(t,{...n,method:"POST",body:r?JSON.stringify(r):void 0,headers:{"Content-Type":"application/json",...n.headers}})}static async put(t,r,n={}){return this.fetchWithRetry(t,{...n,method:"PUT",body:r?JSON.stringify(r):void 0,headers:{"Content-Type":"application/json",...n.headers}})}static async delete(t,r={}){return this.fetchWithRetry(t,{...r,method:"DELETE"})}static calculateDelay(t,r){const n=r.baseDelay*Math.pow(2,t),s=Math.random()*.1*n;return Math.min(n+s,r.maxDelay)}static delay(t){return new Promise(r=>setTimeout(r,t))}static withAuth(t,r={}){return{...r,headers:{Authorization:`Bearer ${t}`,...r.headers}}}static async checkHealth(t){try{return await this.get(`${t}/health`,{timeout:5e3,retryConfig:{maxRetries:1}}),!0}catch(r){return x.warn("api-client","Health check failed",{error:r}),!1}}}ke(Gt,"defaultRetryConfig",{maxRetries:3,baseDelay:1e3,maxDelay:1e4,retryCondition:t=>t instanceof Response?t.status>=500||t.status===429:t instanceof TypeError&&t.message.includes("fetch")}),ke(Gt,"defaultTimeout",3e4);const Dr=class Dr{constructor(){ke(this,"tokenCheckInterval",null);ke(this,"onTokenExpiredCallback",null);ke(this,"onTokenWarningCallback",null);ke(this,"currentToken",null);ke(this,"currentUser",null);this.initializeAuth()}async initializeAuth(){var t,r;try{const n=await this.getStoredAuth();if(n&&Date.now()<n.expiresAt){if(!n.token||!n.token.startsWith("eyJ")){x.error("auth-service","Invalid token format in storage, clearing auth",{tokenPrefix:((t=n.token)==null?void 0:t.substring(0,10))||"empty",tokenLength:((r=n.token)==null?void 0:r.length)||0}),this.clearAuth();return}this.currentToken=n.token,this.currentUser=n.userInfo,this.startTokenMonitoring(),x.info("auth-service","Auth restored from storage",{username:n.userInfo.username,tokenPrefix:n.token.substring(0,20)+"..."}),await this.restoreEncryptionService()}else x.debug("auth-service","No valid stored auth found")}catch(n){x.error("auth-service","Failed to initialize auth",{error:n}),this.clearAuth()}}async login(t,r){try{x.info("auth-service","Starting ECDH key exchange login",{username:t}),this.clearAuth(),At.clearKey(),x.info("auth-service","Previous session cleared before new login"),await Nr.generateKeyPair();const n=await Nr.getClientPublicKeyBase64();x.debug("auth-service","Client ECDH key pair generated");const s=await Gt.post(`${Ve.BASE_URL}${Ve.ENDPOINTS.AUTH.KEY_EXCHANGE}`,{client_public_key:n},{timeout:1e4});x.info("auth-service","Key exchange completed",{sessionId:s.session_id,curve:s.curve});const a={public_key:s.server_public_key,curve:s.curve,format:s.format,signature:s.signature,hkdf_salt:s.hkdf_salt};await Nr.setServerPublicKey(a),await At.initializeWithECDH(a),x.info("auth-service","ECDH initialized",{status:At.getStatus()});const l=await Gt.post(`${Ve.BASE_URL}${Ve.ENDPOINTS.AUTH.LOGIN_ECDH}`,{username:t,password:r,session_id:s.session_id},{timeout:1e4,retryConfig:{maxRetries:2}});if(!await At.testEncryption())throw new Error("ECDH encryption initialization test failed");return await this.saveAuth(l),this.startTokenMonitoring(),x.info("auth-service","Login successful with ECDH",{username:l.user_info.username,role:l.user_info.role,encryptionInitialized:At.isInitialized(),useECDH:At.isUsingECDH()}),l}catch(n){throw x.error("auth-service","Login failed",{error:n}),n}}async logout(){try{this.currentToken&&(await Gt.post(`${Ve.BASE_URL}${Ve.ENDPOINTS.AUTH.REVOKE}`,{},Gt.withAuth(this.currentToken,{timeout:5e3,retryConfig:{maxRetries:1}})).catch(()=>{}),x.info("auth-service","Token revoked on server"))}finally{this.clearAuth(),this.stopTokenMonitoring(),At.clearKey(),x.info("auth-service","Logged out and encryption cleared")}}async getToken(){const t=await this.getStoredAuth();return t?Date.now()>=t.expiresAt?(this.clearAuth(),null):t.token:null}getCurrentUser(){return this.currentUser?this.currentUser:null}isAuthenticated(){return this.currentUser!==null}getAuthHeaders(){return this.currentToken?this.currentToken.startsWith("eyJ")?(x.debug("auth-service","Providing auth headers",{tokenPrefix:this.currentToken.substring(0,30)+"..."}),{Authorization:`Bearer ${this.currentToken}`}):(x.error("auth-service","Current token is invalid (not a JWT), clearing auth",{tokenPrefix:this.currentToken.substring(0,10),tokenLength:this.currentToken.length}),this.clearAuth(),{}):(x.warn("auth-service","No token available for auth headers"),{})}async restoreEncryptionService(){try{if(!this.isAuthenticated())return x.debug("auth-service","No saved token, cannot restore encryption service"),!1;if(At.isInitialized())return x.debug("auth-service","Encryption service already initialized"),!0;x.info("auth-service","Restoring encryption service with new key exchange"),await Nr.generateKeyPair();const t=await Nr.getClientPublicKeyBase64();x.debug("auth-service","Client ECDH key pair generated for restore");const r=await Gt.post(`${Ve.BASE_URL}/auth/refresh-ecdh`,{client_public_key:t},{headers:this.getAuthHeaders(),timeout:1e4});x.info("auth-service","ECDH session refreshed successfully",{sessionId:r.session_id,curve:r.curve});const n={public_key:r.server_public_key,curve:r.curve,format:r.format,signature:r.signature,hkdf_salt:r.hkdf_salt};if(await Nr.setServerPublicKey(n),await At.initializeWithECDH(n),!await At.testEncryption())throw new Error("Encryption test failed after restore");return x.info("auth-service","Encryption service restored successfully"),!0}catch(t){return x.error("auth-service","Failed to restore encryption service",{error:t}),!1}}async saveAuth(t){var n;if(!t.access_token||!t.access_token.startsWith("eyJ"))throw x.error("auth-service","Received invalid JWT token from API",{tokenPrefix:((n=t.access_token)==null?void 0:n.substring(0,10))||"empty"}),new Error("Invalid JWT token received from server");const r={token:t.access_token,expiresAt:Date.now()+t.expires_in*1e3,userInfo:t.user_info};try{if(typeof window<"u"&&window.electronAPI!==void 0&&typeof window.electronAPI.isEncryptionAvailable=="function")if(await window.electronAPI.isEncryptionAvailable()){const l=JSON.stringify(r),u=await window.electronAPI.encryptData(l);localStorage.setItem(Dr.AUTH_KEY,u),x.info("auth-service","Auth data saved securely with safeStorage")}else x.warn("auth-service","safeStorage not available, using localStorage (less secure)"),localStorage.setItem(Dr.AUTH_KEY,JSON.stringify(r));else x.info("auth-service","Running in dev mode, using localStorage"),localStorage.setItem(Dr.AUTH_KEY,JSON.stringify(r));this.currentToken=r.token,this.currentUser=r.userInfo}catch(s){throw x.error("auth-service","Failed to save auth data",{error:s}),s}}async getStoredAuth(){try{const t=localStorage.getItem(Dr.AUTH_KEY);if(!t)return null;const r=typeof window<"u"&&window.electronAPI!==void 0&&typeof window.electronAPI.decryptData=="function";if(!t.trim().startsWith("{")&&r)try{x.debug("auth-service","Decrypting stored auth with safeStorage");const s=await window.electronAPI.decryptData(t);return JSON.parse(s)}catch(s){return x.error("auth-service","Failed to decrypt stored auth, clearing storage",{decryptError:s}),this.clearAuth(),null}else return x.debug("auth-service","Loading plain JSON auth from storage"),JSON.parse(t)}catch(t){return x.error("auth-service","Failed to parse stored auth",{error:t}),null}}clearAuth(){localStorage.removeItem(Dr.AUTH_KEY),this.currentToken=null,this.currentUser=null,x.info("auth-service","Auth data cleared")}setOnTokenExpired(t){this.onTokenExpiredCallback=t}setOnTokenWarning(t){this.onTokenWarningCallback=t}startTokenMonitoring(){this.stopTokenMonitoring(),this.tokenCheckInterval=setInterval(async()=>{const t=await this.getStoredAuth();if(!t)return;const r=t.expiresAt-Date.now(),n=5*60*1e3;r<=n&&(x.warn("auth-service","Token expires soon",{timeUntilExpiry:Math.round(r/1e3)}),r<=0?(x.error("auth-service","Token expired, logging out"),this.clearAuth(),this.stopTokenMonitoring(),this.onTokenExpiredCallback&&this.onTokenExpiredCallback()):this.onTokenWarningCallback&&this.onTokenWarningCallback(Math.round(r/1e3)))},3e4)}stopTokenMonitoring(){this.tokenCheckInterval&&(clearInterval(this.tokenCheckInterval),this.tokenCheckInterval=null)}};ke(Dr,"AUTH_KEY","mcc_auth");let nl=Dr;const Ue=new nl,vx=Object.freeze(Object.defineProperty({__proto__:null,authService:Ue},Symbol.toStringTag,{value:"Module"}));class kx{async createConnection(t,r){var n,s,a;try{x.info("guacamole-service","Creating connection",{machineId:t.id,machineName:t.name,ipAddress:t.ip,hypervisor:t.hypervisor,hostnameToUse:t.hypervisor==="Saved"?t.ip:t.name});let l;if(r!=null&&r.password){if(!At.isInitialized())throw new Error("Encryption service not initialized. Please log in again.");l=(await At.encryptPassword(r.password)).encrypted,x.debug("guacamole-service","Password encrypted for transmission (without AAD)")}const u=(r==null?void 0:r.protocol)||"rdp",d={hostname:t.hypervisor==="Saved"?t.ip:t.name,protocol:u,ttl_minutes:60,...(r==null?void 0:r.username)&&{username:r.username},...l&&{password:l},...u==="ssh"&&{enable_sftp:(r==null?void 0:r.enableSftp)!==void 0?r.enableSftp:!0,...(r==null?void 0:r.sftpRootDirectory)&&{sftp_root_directory:r.sftpRootDirectory},...(r==null?void 0:r.sftpServerAliveInterval)&&{sftp_server_alive_interval:r.sftpServerAliveInterval}}},m={"Content-Type":"application/json",...Ue.getAuthHeaders()};x.info("guacamole-service","Sending request",{url:`${Ve.BASE_URL}${Ve.ENDPOINTS.CONNECTIONS.CREATE}`,method:"POST",headers:Object.keys(m),hasAuthHeader:!!m.Authorization,requestBody:d});const v=await fetch(`${Ve.BASE_URL}${Ve.ENDPOINTS.CONNECTIONS.CREATE}`,{method:"POST",headers:m,body:JSON.stringify(d)});if(!v.ok){const N=await v.json().catch(()=>({}));throw v.status===401&&(x.error("guacamole-service","Session expired or invalid",{errorDetail:N.detail,machineId:t.id}),(n=N.detail)!=null&&n.includes("Session expired")||(s=N.detail)!=null&&s.includes("Invalid session")||(a=N.detail)!=null&&a.includes("encryption session has expired"))?(await Ue.logout().catch(()=>{}),new Error("Your session has expired. Please log in again.")):(x.error("guacamole-service","API request failed",{status:v.status,statusText:v.statusText,errorData:N,url:`${Ve.BASE_URL}${Ve.ENDPOINTS.CONNECTIONS.CREATE}`,requestBody:d}),new Error(N.detail||`Failed to create connection: ${v.status} ${v.statusText}`))}const E=await v.json();return x.info("guacamole-service","Connection created successfully",{machineId:t.id,connectionId:E.connection_id,expiresAt:E.expires_at}),E}catch(l){throw x.error("guacamole-service","Failed to create connection",{machineId:t.id,error:l instanceof Error?l.message:"Unknown error"}),l}}async listConnections(){var t,r,n;try{const s={...Ue.getAuthHeaders()},a=await fetch(`${Ve.BASE_URL}${Ve.ENDPOINTS.CONNECTIONS.LIST}`,{method:"GET",headers:s});if(!a.ok){if(a.status===401){const u=await a.json().catch(()=>({}));if((t=u.detail)!=null&&t.includes("Session expired")||(r=u.detail)!=null&&r.includes("Invalid session")||(n=u.detail)!=null&&n.includes("encryption session has expired"))throw await Ue.logout().catch(()=>{}),new Error("Your session has expired. Please log in again.")}throw new Error(`Failed to list connections: ${a.statusText}`)}const l=await a.json();return x.info("guacamole-service","Connections list retrieved",{count:l.length}),l}catch(s){throw x.error("guacamole-service","Failed to list connections",{error:s}),s}}async getActiveConnections(){var t,r,n;try{x.info("guacamole-service","Fetching active connections for restoration");const s={...Ue.getAuthHeaders()},a=await fetch(`${Ve.BASE_URL}${Ve.ENDPOINTS.CONNECTIONS.LIST}`,{method:"GET",headers:s});if(!a.ok){if(a.status===401){const d=await a.json().catch(()=>({}));if((t=d.detail)!=null&&t.includes("Session expired")||(r=d.detail)!=null&&r.includes("Invalid session")||(n=d.detail)!=null&&n.includes("encryption session has expired"))throw await Ue.logout().catch(()=>{}),new Error("Your session has expired. Please log in again.")}throw new Error(`Failed to get active connections: ${a.statusText}`)}const l=await a.json(),u=l.connections.filter(d=>d.status==="active"&&d.connection_url!==null&&d.remaining_minutes>0);return x.info("guacamole-service","Active connections retrieved",{total:l.total_connections,active:u.length,restorable:u.filter(d=>d.connection_url).length}),u}catch(s){throw x.error("guacamole-service","Failed to get active connections",{error:s instanceof Error?s.message:"Unknown error"}),s}}async deleteConnection(t){var r,n,s;try{const a={...Ue.getAuthHeaders()},l=await fetch(`${Ve.BASE_URL}${Ve.ENDPOINTS.CONNECTIONS.DELETE(t)}`,{method:"DELETE",headers:a});if(!l.ok){if(l.status===401){const u=await l.json().catch(()=>({}));if((r=u.detail)!=null&&r.includes("Session expired")||(n=u.detail)!=null&&n.includes("Invalid session")||(s=u.detail)!=null&&s.includes("encryption session has expired"))throw await Ue.logout().catch(()=>{}),new Error("Your session has expired. Please log in again.")}throw new Error(`Failed to delete connection: ${l.statusText}`)}x.info("guacamole-service","Connection deleted",{connectionId:t})}catch(a){throw x.error("guacamole-service","Failed to delete connection",{connectionId:t,error:a}),a}}async extendConnectionTTL(t,r=60){var n,s,a;try{const l={"Content-Type":"application/json",...Ue.getAuthHeaders()},u=await fetch(`${Ve.BASE_URL}/connections/${t}/extend`,{method:"POST",headers:l,body:JSON.stringify({additional_minutes:r})});if(!u.ok){if(u.status===401){const m=await u.json().catch(()=>({}));if((n=m.detail)!=null&&n.includes("Session expired")||(s=m.detail)!=null&&s.includes("Invalid session")||(a=m.detail)!=null&&a.includes("encryption session has expired"))throw await Ue.logout().catch(()=>{}),new Error("Your session has expired. Please log in again.")}throw u.status===404?new Error("Connection not found or already expired"):u.status===403?new Error("You do not have permission to extend this connection"):new Error(`Failed to extend connection: ${u.statusText}`)}const d=await u.json();return x.info("guacamole-service","Connection TTL extended",{connectionId:t,additionalMinutes:r,newExpiresAt:d.new_expires_at}),{new_expires_at:d.new_expires_at,additional_minutes:d.additional_minutes}}catch(l){throw x.error("guacamole-service","Failed to extend connection TTL",{connectionId:t,additionalMinutes:r,error:l}),l}}getConnectionUrl(t){return t}}const dn=new kx;class Qf{static async getSavedMachines(t=!1){try{const r=await Ue.getAuthHeaders();x.info("saved-machines-api","Fetching saved machines",{includeStats:t});const n=await Gt.get(`${this.baseUrl}?include_stats=${t}`,{headers:r});return x.info("saved-machines-api","Saved machines fetched successfully",{total:n.total}),n}catch(r){throw x.error("saved-machines-api","Failed to fetch saved machines",{error:r}),r}}static async getSavedMachine(t){try{const r=await Ue.getAuthHeaders();x.info("saved-machines-api","Fetching saved machine",{machineId:t});const n=await Gt.get(`${this.baseUrl}/${t}`,{headers:r});return x.info("saved-machines-api","Saved machine fetched successfully",{machineId:t,name:n.name}),n}catch(r){throw x.error("saved-machines-api","Failed to fetch saved machine",{machineId:t,error:r}),r}}static async createSavedMachine(t){try{const r=await Ue.getAuthHeaders();x.info("saved-machines-api","Creating saved machine",{name:t.name,hostname:t.hostname,protocol:t.protocol,hasPassword:!!t.password});let n;if(t.password){if(!At.isInitialized())throw new Error("Encryption service not initialized. Please log in again.");n=(await At.encryptPassword(t.password,`saved-machine-${t.name}`)).encrypted,x.debug("saved-machines-api","Password encrypted for saved machine",{name:t.name})}const s={...t,password:n},a=await Gt.post(this.baseUrl,s,{headers:r});return x.info("saved-machines-api","Saved machine created successfully",{machineId:a.id,name:a.name}),a}catch(r){throw x.error("saved-machines-api","Failed to create saved machine",{name:t.name,error:r}),r}}static async updateSavedMachine(t,r){try{const n=await Ue.getAuthHeaders();x.info("saved-machines-api","Updating saved machine",{machineId:t,updates:Object.keys(r),hasPassword:!!r.password});let s;if(r.password){if(!At.isInitialized())throw new Error("Encryption service not initialized. Please log in again.");s=(await At.encryptPassword(r.password,`saved-machine-${t}`)).encrypted,x.debug("saved-machines-api","Password encrypted for machine update",{machineId:t})}const a={...r,...s!==void 0&&{password:s}},l=await Gt.put(`${this.baseUrl}/${t}`,a,{headers:n});return x.info("saved-machines-api","Saved machine updated successfully",{machineId:t,name:l.name}),l}catch(n){throw x.error("saved-machines-api","Failed to update saved machine",{machineId:t,error:n}),n}}static async deleteSavedMachine(t){try{const r=await Ue.getAuthHeaders();x.info("saved-machines-api","Deleting saved machine",{machineId:t}),await Gt.delete(`${this.baseUrl}/${t}`,{headers:r}),x.info("saved-machines-api","Saved machine deleted successfully",{machineId:t})}catch(r){throw x.error("saved-machines-api","Failed to delete saved machine",{machineId:t,error:r}),r}}static async connectToSavedMachine(t){try{const r=await Ue.getAuthHeaders();x.info("saved-machines-api","Recording connection to saved machine",{machineId:t});const n=await Gt.post(`${this.baseUrl}/${t}/connect`,{},{headers:r});return x.info("saved-machines-api","Connection recorded successfully",{machineId:t,historyId:n.history_id}),n}catch(r){throw x.error("saved-machines-api","Failed to record connection",{machineId:t,error:r}),r}}static async toggleFavorite(t,r){return this.updateSavedMachine(t,{is_favorite:r})}static async updateTags(t,r){return this.updateSavedMachine(t,{tags:r})}static filterByTags(t,r){return!r||r.length===0?t:t.filter(n=>r.some(s=>n.tags.includes(s)))}static filterByProtocol(t,r){return t.filter(n=>n.protocol===r)}static filterFavorites(t){return t.filter(r=>r.is_favorite)}static search(t,r){if(!r)return t;const n=r.toLowerCase();return t.filter(s=>{var a;return s.name.toLowerCase().includes(n)||s.hostname.toLowerCase().includes(n)||((a=s.description)==null?void 0:a.toLowerCase().includes(n))})}}ke(Qf,"baseUrl",`${Ve.BASE_URL}/api/machines/saved`);const xs=Qf;function wx(e){return{id:e.id,name:e.name,status:"unknown",os:e.os&&e.os.trim()!==""?e.os:"Unknown",ip:e.hostname,hypervisor:"Saved",port:e.port,protocol:e.protocol,specs:{cpu:"N/A",ram:"N/A",disk:"N/A"},testLinks:[{url:`${e.protocol}://${e.hostname}:${e.port}`,name:`${e.protocol.toUpperCase()} (Port ${e.port})`}],logs:[]}}const Mt=ax()(ux((e,t)=>(x.info("store","Initializing machine store with persistence"),{machines:[],selectedMachine:null,loading:!1,error:null,guacamoleVisible:!1,searchQuery:"",filteredMachines:[],savedMachines:[],savedMachinesLoading:!1,showAddMachineModal:!1,showSaveConfirmModal:!1,machineToSave:null,setMachines:r=>{x.info("store","Setting machines",{count:r.length}),e({machines:r,filteredMachines:r.filter(n=>n.name.toLowerCase().includes(t().searchQuery.toLowerCase())||n.ip.toLowerCase().includes(t().searchQuery.toLowerCase()))})},selectMachine:r=>e({selectedMachine:r}),setLoading:r=>e({loading:r}),setError:r=>e({error:r}),setGuacamoleVisible:r=>e({guacamoleVisible:r}),setShowAddMachineModal:r=>e({showAddMachineModal:r}),setShowSaveConfirmModal:r=>e({showSaveConfirmModal:r}),setMachineToSave:r=>e({machineToSave:r}),setSearchQuery:r=>{const{machines:n}=t();e({searchQuery:r,filteredMachines:n.filter(s=>s.name.toLowerCase().includes(r.toLowerCase())||s.ip.toLowerCase().includes(r.toLowerCase()))})},fetchMachines:async()=>{const{setLoading:r,setError:n,savedMachines:s}=t();r(!0);try{{const a=await window.electronAPI.getMachineList();if(a.success&&a.machines){x.info("store","Machines fetched successfully",{count:a.machines.length});const u=[...s.map(wx),...a.machines];e({machines:u,filteredMachines:u.filter(d=>d.name.toLowerCase().includes(t().searchQuery.toLowerCase())||d.ip.toLowerCase().includes(t().searchQuery.toLowerCase()))}),n(null)}else throw new Error(a.message||"Failed to fetch machines")}}catch(a){const l=a instanceof Error?a.message:"Failed to fetch machines";x.error("store","Failed to fetch machines",{error:l}),n(l)}finally{r(!1)}},connectToMachine:async r=>{const{setError:n}=t();try{x.info("store","Connecting to machine",{machineId:r.id,machineName:r.name});{const s=await window.electronAPI.connectToMachine(r);if(!s.success)throw new Error(s.message);x.info("store","Connected to machine successfully",{machineId:r.id}),n(null)}}catch(s){const a=s instanceof Error?s.message:"Failed to connect to machine";throw x.error("store","Connection failed",{machineId:r.id,error:a}),n(a),s}},controlMachine:async(r,n)=>{const{setError:s,fetchMachines:a,machines:l}=t();try{x.info("store",`Controlling machine: ${n}`,{machineId:r});{const u=await window.electronAPI.controlMachine(r,n);if(!u.success)throw new Error(u.message);x.info("store",`Machine ${n} successful`,{machineId:r}),s(null),await a()}}catch(u){const d=u instanceof Error?u.message:`Failed to ${n} machine`;throw x.error("store",`Machine ${n} failed`,{machineId:r,error:d}),s(d),u}},connectGuacamole:async r=>{const{setError:n,setGuacamoleVisible:s}=t();try{if(x.info("store","Connecting to Guacamole",{machineId:r.id,machineName:r.name}),!(await dn.createConnection(r)).connection_url)throw new Error("Failed to create Guacamole connection");s(!0),n(null)}catch(a){const l=a instanceof Error?a.message:"Failed to connect to Guacamole";throw x.error("store","Guacamole connection failed",{machineId:r.id,error:l}),n(l),a}},fetchSavedMachines:async(r=!1)=>{e({savedMachinesLoading:!0});try{x.info("store","Fetching saved machines",{includeStats:r});const n=await xs.getSavedMachines(r);e({savedMachines:n.machines,savedMachinesLoading:!1}),x.info("store","Saved machines fetched successfully",{total:n.total}),await t().fetchMachines()}catch(n){const s=n instanceof Error?n.message:"Failed to fetch saved machines";throw x.error("store","Failed to fetch saved machines",{error:s}),e({error:s,savedMachinesLoading:!1}),n}},createSavedMachine:async r=>{try{x.info("store","Creating saved machine",{name:r.name});const n=await xs.createSavedMachine(r);return e(s=>({savedMachines:[...s.savedMachines,n]})),await t().fetchMachines(),x.info("store","Saved machine created",{id:n.id,name:n.name}),n}catch(n){const s=n instanceof Error?n.message:"Failed to create saved machine";throw x.error("store","Failed to create saved machine",{error:s}),e({error:s}),n}},updateSavedMachine:async(r,n)=>{try{x.info("store","Updating saved machine",{machineId:r,updates:n});const s=await xs.updateSavedMachine(r,n);return e(a=>({savedMachines:a.savedMachines.map(l=>l.id===r?s:l)})),await t().fetchMachines(),x.info("store","Saved machine updated",{id:s.id}),s}catch(s){const a=s instanceof Error?s.message:"Failed to update saved machine";throw x.error("store","Failed to update saved machine",{error:a}),e({error:a}),s}},deleteSavedMachine:async r=>{try{x.info("store","Deleting saved machine",{machineId:r}),await xs.deleteSavedMachine(r),e(n=>({savedMachines:n.savedMachines.filter(s=>s.id!==r)})),await t().fetchMachines(),x.info("store","Saved machine deleted",{machineId:r})}catch(n){const s=n instanceof Error?n.message:"Failed to delete saved machine";throw x.error("store","Failed to delete saved machine",{error:s}),e({error:s}),n}},toggleFavorite:async r=>{try{const n=t().savedMachines.find(s=>s.id===r);if(!n)throw new Error("Machine not found");x.info("store","Toggling favorite",{machineId:r,current:n.is_favorite}),await t().updateSavedMachine(r,{is_favorite:!n.is_favorite})}catch(n){const s=n instanceof Error?n.message:"Failed to toggle favorite";throw x.error("store","Failed to toggle favorite",{error:s}),e({error:s}),n}},connectToSavedMachine:async r=>{try{x.info("store","Connecting to saved machine",{machineId:r}),await xs.connectToSavedMachine(r),await t().fetchSavedMachines(),x.info("store","Connected to saved machine",{machineId:r})}catch(n){const s=n instanceof Error?n.message:"Failed to connect to saved machine";throw x.error("store","Failed to connect to saved machine",{error:s}),e({error:s}),n}},resetState:()=>{x.info("store","Resetting all state (logout/user switch)"),e({machines:[],selectedMachine:null,loading:!1,error:null,guacamoleVisible:!1,searchQuery:"",filteredMachines:[],savedMachines:[],savedMachinesLoading:!1,showAddMachineModal:!1,showSaveConfirmModal:!1,machineToSave:null}),x.info("store","State reset complete")}}),{name:"machine-store",storage:Wf(()=>localStorage),partialize:e=>({machines:e.machines,selectedMachine:e.selectedMachine,savedMachines:e.savedMachines,searchQuery:e.searchQuery})}));class Oa{static parseOS(t){const r=t.toLowerCase();return r.includes("windows")?{family:"windows",version:this.extractWindowsVersion(r),architecture:this.extractArchitecture(r)}:r.includes("ubuntu")||r.includes("debian")||r.includes("centos")||r.includes("rhel")||r.includes("linux")?{family:"linux",version:this.extractLinuxVersion(r),architecture:this.extractArchitecture(r)}:r.includes("macos")||r.includes("mac os")||r.includes("darwin")?{family:"macos",version:this.extractMacVersion(r),architecture:this.extractArchitecture(r)}:r.includes("unix")||r.includes("solaris")||r.includes("aix")?{family:"unix",architecture:this.extractArchitecture(r)}:{family:"unknown"}}static getRecommendedProtocols(t){const r=[];switch(t.family){case"windows":r.push(this.PROTOCOLS.rdp,this.PROTOCOLS.vnc,this.PROTOCOLS.ssh);break;case"linux":r.push(this.PROTOCOLS.ssh,this.PROTOCOLS.vnc),this.hasDesktopEnvironment(t)&&r.push(this.PROTOCOLS.telnet);break;case"macos":r.push(this.PROTOCOLS.ssh,this.PROTOCOLS.vnc);break;case"unix":r.push(this.PROTOCOLS.ssh,this.PROTOCOLS.telnet);break;default:r.push(this.PROTOCOLS.ssh,this.PROTOCOLS.vnc,this.PROTOCOLS.rdp,this.PROTOCOLS.telnet)}return r}static getDefaultProtocol(t){return this.getRecommendedProtocols(t)[0]||this.PROTOCOLS.ssh}static getCompatibilityInfo(t){const r={recommendations:[],warnings:[],tips:[]};switch(t.family){case"windows":r.recommendations.push("RDP provides the best experience for Windows machines"),r.tips.push("Ensure Remote Desktop is enabled in Windows settings"),t.version&&t.version.includes("home")&&r.warnings.push("Windows Home editions may have limited RDP support");break;case"linux":r.recommendations.push("SSH is the most reliable option for Linux systems"),r.tips.push("VNC requires a desktop environment and VNC server installation");break;case"macos":r.recommendations.push("SSH works best for macOS command line access"),r.tips.push('Enable "Remote Login" in System Preferences for SSH'),r.warnings.push("VNC may require additional setup on macOS");break;default:r.tips.push("Try SSH first as it's widely supported")}return r}static validatePort(t,r){const n=this.PROTOCOLS[t];return n?r===n.defaultPort?{valid:!0}:this.getAlternativePorts(t).includes(r)?{valid:!0}:{valid:!0,suggestion:n.defaultPort}:{valid:!1}}static extractWindowsVersion(t){const r=[/windows\s*(\d+)/i,/windows\s*(xp|vista|7|8|8\.1|10|11)/i,/windows\s*(server\s*\d+)/i];for(const n of r){const s=t.match(n);if(s)return s[1]}return""}static extractLinuxVersion(t){const r=[/ubuntu\s*(\d+\.\d+)/i,/debian\s*(\d+)/i,/centos\s*(\d+)/i,/rhel\s*(\d+)/i];for(const n of r){const s=t.match(n);if(s)return s[1]}return""}static extractMacVersion(t){const r=[/macos\s*(\d+\.\d+)/i,/mac\s*os\s*(\d+\.\d+)/i];for(const n of r){const s=t.match(n);if(s)return s[1]}return""}static extractArchitecture(t){return t.includes("x64")||t.includes("x86_64")||t.includes("amd64")?"x64":t.includes("x86")||t.includes("i386")?"x86":t.includes("arm64")||t.includes("aarch64")?"arm64":t.includes("arm")?"arm":""}static hasDesktopEnvironment(t){var r,n,s,a;return((r=t.version)==null?void 0:r.includes("desktop"))||((n=t.version)==null?void 0:n.includes("gnome"))||((s=t.version)==null?void 0:s.includes("kde"))||!((a=t.version)!=null&&a.includes("server"))}static getAlternativePorts(t){return{rdp:[3389,3390,3391],vnc:[5900,5901,5902,5903],ssh:[22,2222,2022],telnet:[23,2323]}[t]||[]}}ke(Oa,"PROTOCOLS",{rdp:{value:"rdp",label:"RDP",description:"Remote Desktop Protocol - Native Windows remote access",icon:"🖥️",defaultPort:3389,requirements:["Windows OS","Remote Desktop enabled"]},vnc:{value:"vnc",label:"VNC",description:"Virtual Network Computing - Cross-platform remote desktop",icon:"🖱️",defaultPort:5900,requirements:["VNC Server installed"]},ssh:{value:"ssh",label:"SSH",description:"Secure Shell - Command line access",icon:"⌨️",defaultPort:22,requirements:["SSH Server enabled"]},telnet:{value:"telnet",label:"Telnet",description:"Telnet - Legacy command line access (not secure)",icon:"📡",defaultPort:23,requirements:["Telnet Server enabled"]}});const Sx=({machine:e,onConnect:t,isConnected:r=!1,userRole:n,className:s="",size:a="md"})=>{const l=$.useMemo(()=>Oa.parseOS(e.os),[e.os]),u=$.useMemo(()=>Oa.getDefaultProtocol(l),[l]),m=$.useMemo(()=>Oa.getCompatibilityInfo(l),[l]).warnings.length>0,E=n==="GUEST"&&!r,N={sm:"px-3 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-3 text-base"},C={sm:12,md:16,lg:20},b=()=>{E||t(e,u)};return i.jsx("div",{className:"relative",children:i.jsxs("button",{onClick:b,disabled:E,className:`
flex items-center gap-2
min-w-[125px]
${E?"bg-gray-400 cursor-not-allowed opacity-60":r?"bg-green-600 hover:bg-green-700":"bg-kaspersky-base hover:bg-kaspersky-dark"}
text-white rounded-md transition-all duration-200
font-medium
${N[a]}
${m&&!E?"ring-2 ring-yellow-400 ring-opacity-50":""}
${s}
`,title:E?"Access denied: GUEST role cannot create connections. Contact your administrator.":r?`Active session via ${u.label}`:`Connect via ${u.label} (${u.description})`,children:[i.jsx("span",{className:"text-lg w-6 flex justify-center",children:u.icon}),i.jsx(Uf,{size:C[a],className:r?"text-green-200":""}),i.jsx("span",{className:"flex-1 text-left",children:r?"Active":"Connect"}),m&&!r&&i.jsx(qn,{size:C[a],className:"text-yellow-300"})]})})},bx={primary:`
bg-kaspersky-primary text-white
hover:bg-kaspersky-primary-dark hover:shadow-kaspersky-lg
active:bg-kaspersky-primary-dark active:scale-[0.98]
disabled:bg-kaspersky-text-lighter disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:shadow-none
focus:outline-none focus:ring-4 focus:ring-kaspersky-primary/30
`,secondary:`
bg-kaspersky-secondary text-white
hover:bg-opacity-90 hover:shadow-kaspersky
active:bg-opacity-80 active:scale-[0.98]
disabled:bg-kaspersky-text-lighter disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:shadow-none
focus:outline-none focus:ring-4 focus:ring-kaspersky-secondary/30
`,danger:`
bg-kaspersky-danger text-white
hover:bg-red-700 hover:shadow-kaspersky-lg
active:bg-red-800 active:scale-[0.98]
disabled:bg-kaspersky-text-lighter disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:shadow-none
focus:outline-none focus:ring-4 focus:ring-kaspersky-danger/30
`,success:`
bg-kaspersky-success text-white
hover:bg-green-600 hover:shadow-kaspersky-lg
active:bg-green-700 active:scale-[0.98]
disabled:bg-kaspersky-text-lighter disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:shadow-none
focus:outline-none focus:ring-4 focus:ring-kaspersky-success/30
`,ghost:`
bg-transparent text-kaspersky-text-dark border-2 border-kaspersky-border
hover:bg-kaspersky-bg hover:border-kaspersky-border-dark
active:bg-kaspersky-bg-card active:scale-[0.98]
disabled:text-kaspersky-text-lighter disabled:border-kaspersky-border-light disabled:cursor-not-allowed disabled:opacity-60
focus:outline-none focus:ring-4 focus:ring-kaspersky-primary/20
`},Ex={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg"},Ge=({variant:e="primary",size:t="md",isLoading:r=!1,leftIcon:n,rightIcon:s,fullWidth:a=!1,className:l="",children:u,disabled:d,...m})=>i.jsxs("button",{className:`
${bx[e]}
${Ex[t]}
${a?"w-full":""}
font-semibold rounded-lg
transition-all duration-300 transform
flex items-center justify-center gap-2
disabled:transform-none
${l}
`.trim().replace(/\s+/g," "),disabled:d||r,...m,children:[r&&i.jsx(t0,{size:16,className:"animate-spin"}),!r&&n&&i.jsx("span",{className:"flex-shrink-0",children:n}),i.jsx("span",{children:u}),!r&&s&&i.jsx("span",{className:"flex-shrink-0",children:s})]});function Nx({onConnect:e,machineStatuses:t,onMachineSelected:r,machineConnections:n,userRole:s,onBulkSelectionChange:a}={}){const{machines:l,selectedMachine:u,selectMachine:d,fetchMachines:m,loading:v,searchQuery:E,setSearchQuery:N,filteredMachines:C,setShowAddMachineModal:b}=Mt(),[w,L]=$.useState(new Set),[g,y]=$.useState(!1),S=$.useMemo(()=>C,[C]),I=$.useCallback(()=>{y(oe=>!oe),g&&(L(new Set),a==null||a([]))},[g,a]),A=$.useCallback(oe=>{L(tt=>{const Vt=new Set(tt);return Vt.has(oe)?Vt.delete(oe):Vt.add(oe),a==null||a(Array.from(Vt)),Vt})},[a]),O=$.useCallback(()=>{const oe=new Set(S.map(tt=>tt.id));L(oe),a==null||a(Array.from(oe))},[S,a]),R=$.useCallback(()=>{L(new Set),a==null||a([])},[a]),H=$.useMemo(()=>S.length===0?!1:S.every(oe=>w.has(oe.id)),[S,w]);$.useEffect(()=>{g&&(L(new Set),a==null||a([]))},[E]);const de=$.useCallback(oe=>(t==null?void 0:t.get(oe))||"unknown",[t]),le=$.useCallback(oe=>{switch(oe){case"running":return"bg-kaspersky-success shadow-green-300 shadow-sm";case"stopped":return"bg-kaspersky-danger shadow-red-300 shadow-sm";case"checking":return"bg-kaspersky-warning shadow-yellow-300 shadow-sm animate-pulse";case"error":return"bg-kaspersky-warning shadow-yellow-300 shadow-sm";case"unknown":default:return"bg-gray-400 shadow-gray-300 shadow-sm"}},[]);$.useEffect(()=>(x.info("sidebar","Component mounted"),()=>{x.info("sidebar","Component unmounted")}),[]),$.useEffect(()=>{x.info("sidebar","Machines updated",{count:l.length,machines:l.map(oe=>({id:oe.id,name:oe.name,status:oe.status}))})},[l]),$.useEffect(()=>{x.info("sidebar","Starting initial fetch"),m();const oe=setInterval(m,3e4);return()=>clearInterval(oe)},[m]);const Fe=$.useCallback(oe=>{N(oe.target.value)},[N]),Ze=$.useCallback((oe,tt)=>{d(oe),e==null||e(oe,tt)},[d,e]);return i.jsxs("div",{className:"w-96 bg-white border-r border-kaspersky-border shadow-kaspersky select-none",children:[i.jsxs("div",{className:"p-4",children:[i.jsxs("div",{className:"relative",children:[i.jsx("input",{type:"text",placeholder:"Search machines...",value:E,onChange:Fe,className:"w-full pl-10 pr-4 py-2 bg-kaspersky-bg text-kaspersky-text rounded-lg border-2 border-kaspersky-border focus:outline-none focus:border-kaspersky-primary focus:bg-white transition-all duration-300 select-text"}),i.jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2",children:i.jsx(f0,{size:18,className:"text-kaspersky-text-lighter"})})]}),i.jsx("div",{className:"mt-3",children:i.jsx(Ge,{variant:"primary",size:"md",fullWidth:!0,onClick:()=>b(!0),leftIcon:i.jsx(Of,{size:18}),children:"Add Custom Machine"})})]}),i.jsx("div",{className:"border-t border-kaspersky-border pt-3 px-4 pb-2",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("button",{onClick:I,className:`text-sm font-medium transition-colors ${g?"text-kaspersky-primary":"text-kaspersky-text-light hover:text-kaspersky-text-dark"}`,children:g?"✓ Bulk Mode":"Bulk Select"}),g&&S.length>0&&i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("span",{className:"text-sm text-kaspersky-text-light",children:[w.size," selected"]}),i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:H,onChange:()=>H?R():O(),className:"w-4 h-4 text-kaspersky-primary bg-kaspersky-bg border-kaspersky-border rounded focus:ring-kaspersky-primary focus:ring-2"}),i.jsx("span",{className:"text-sm text-kaspersky-text-light",children:"All"})]})]})]})}),i.jsx("div",{className:"overflow-y-auto h-[calc(100vh-11rem)]",children:v?i.jsx("div",{className:"flex items-center justify-center h-32",children:i.jsx("div",{className:"w-8 h-8 border-4 border-kaspersky-primary border-t-transparent rounded-full animate-spin"})}):i.jsx("div",{className:"space-y-1 p-2",children:S.map(oe=>i.jsx("div",{className:`rounded-lg transition-all duration-200 ${(u==null?void 0:u.id)===oe.id?"bg-kaspersky-primary/10 border-2 border-kaspersky-primary shadow-kaspersky":"hover:bg-kaspersky-bg border-2 border-transparent hover:shadow-sm"}`,children:i.jsx("div",{className:"p-3",children:i.jsxs("div",{className:"flex items-center justify-between",children:[g&&i.jsx("label",{className:"flex-shrink-0 mr-2 cursor-pointer",onClick:tt=>tt.stopPropagation(),children:i.jsx("input",{type:"checkbox",checked:w.has(oe.id),onChange:()=>A(oe.id),className:"w-4 h-4 text-kaspersky-primary bg-kaspersky-bg border-kaspersky-border rounded focus:ring-kaspersky-primary focus:ring-2"})}),i.jsxs("button",{onClick:()=>{g?A(oe.id):(d(oe),r&&r(oe))},className:"flex items-center text-left flex-1 min-w-0",children:[!g&&i.jsx("div",{className:`w-3 h-3 rounded-full mr-3 flex-shrink-0 ${le(de(oe.id))}`,title:`Status: ${de(oe.id)}`}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"font-medium text-kaspersky-text-dark truncate",children:oe.name}),i.jsx("div",{className:"text-sm text-kaspersky-text-light",children:i.jsx("span",{className:"truncate",children:oe.ip})})]})]}),e&&!g&&i.jsx("div",{className:"ml-3 flex-shrink-0",children:i.jsx(Sx,{machine:oe,onConnect:Ze,isConnected:n==null?void 0:n.has(oe.id),userRole:s,size:"sm",className:"w-auto"})})]})})},oe.id))})})]})}const Cx=$.memo(Nx);function jx({machine:e,machineStatus:t,isConnected:r=!1,connectionInfo:n,onDelete:s,onExtendConnection:a}){var A,O;const l=t||e.status,{deleteSavedMachine:u}=Mt(),[d,m]=$.useState(!1),[v,E]=$.useState(!1),[N,C]=$.useState(""),[b,w]=$.useState({minutes:0,isWarning:!1}),[L,g]=$.useState(!1),y=e.hypervisor==="Saved";$.useEffect(()=>{if(!r||!n){C("");return}const R=()=>{const de=Date.now(),le=n.connectedAt.getTime(),Fe=de-le,Ze=Math.floor(Fe/1e3),oe=Math.floor(Ze/60),tt=Math.floor(oe/60);tt>0?C(`${tt}h ${oe%60}m`):oe>0?C(`${oe}m ${Ze%60}s`):Ze>5?C(`${Ze}s`):C("just now")};R();const H=setInterval(R,1e3);return()=>clearInterval(H)},[r,n]),$.useEffect(()=>{if(!r||!(n!=null&&n.expiresAt)){w({minutes:0,isWarning:!1});return}const R=()=>{const de=Date.now(),Fe=n.expiresAt.getTime()-de,Ze=Math.floor(Fe/6e4);w({minutes:Ze,isWarning:Ze<=10&&Ze>0})};R();const H=setInterval(R,3e4);return()=>clearInterval(H)},[r,n]);const S=async()=>{if(!(!a||L)){g(!0);try{await a(60),x.info("machine-details","Connection extended successfully")}catch(R){x.error("machine-details","Failed to extend connection",{error:R})}finally{g(!1)}}},I=async()=>{if(y){m(!0);try{x.info("machine-details","Deleting saved machine",{machineId:e.id}),await u(e.id),x.info("machine-details","Saved machine deleted successfully"),E(!1),s&&s()}catch(R){x.error("machine-details","Failed to delete machine",{error:R})}finally{m(!1)}}};return i.jsxs("div",{className:"flex-1 p-6 overflow-auto select-none",children:[i.jsxs("div",{className:"bg-kaspersky-bg-card rounded-lg p-6 shadow-kaspersky",children:[i.jsx("div",{className:"mb-6",children:i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h1",{className:"text-2xl font-semibold text-kaspersky-text-dark break-words",children:e.name}),i.jsx("div",{className:"flex items-center mt-2 gap-4 flex-wrap",children:r&&n?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center px-3 py-1.5 bg-kaspersky-primary bg-opacity-10 border border-kaspersky-primary border-opacity-30 rounded-lg",children:[i.jsx("div",{className:`w-2.5 h-2.5 rounded-full mr-2 shadow-sm ${l==="running"?"bg-kaspersky-success animate-pulse":l==="stopped"?"bg-kaspersky-danger":l==="checking"?"bg-kaspersky-warning animate-pulse":l==="unknown"?"bg-gray-400":"bg-kaspersky-primary animate-pulse"}`}),i.jsxs("span",{className:"text-xs text-kaspersky-primary font-semibold",children:["Connected ",N?`(${N})`:""]})]}),a&&i.jsxs("button",{onClick:S,disabled:L,className:`flex items-center gap-2 px-3 py-1.5 rounded-lg transition-all duration-200 ${b.isWarning?"bg-kaspersky-warning bg-opacity-10 border border-kaspersky-warning border-opacity-30 text-kaspersky-warning hover:bg-opacity-20 animate-pulse":"bg-kaspersky-success bg-opacity-10 border border-kaspersky-success border-opacity-30 text-kaspersky-success hover:bg-opacity-20"} disabled:opacity-50 disabled:cursor-not-allowed`,title:`Extend connection by 60 minutes (${b.minutes}m remaining)`,children:[i.jsx(ra,{className:"w-3.5 h-3.5"}),i.jsx("span",{className:"text-xs font-semibold",children:L?"Extending...":`Extend (${b.minutes}m left)`})]})]}):i.jsxs("div",{className:"flex items-center",children:[i.jsx("div",{className:`w-3 h-3 rounded-full mr-2 shadow-sm ${l==="running"?"bg-kaspersky-success":l==="stopped"?"bg-kaspersky-danger":l==="checking"?"bg-kaspersky-warning animate-pulse":l==="unknown"?"bg-gray-400":"bg-kaspersky-warning"}`}),i.jsx("span",{className:"text-sm text-kaspersky-text capitalize font-medium",children:l==="checking"?"Checking...":l})]})})]}),y&&i.jsxs("button",{onClick:()=>E(!0),disabled:d||r,className:"flex-shrink-0 px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",title:r?"Disconnect first to delete":"Delete saved machine",children:[i.jsx(pu,{size:18}),i.jsx("span",{className:"text-sm font-medium",children:"Delete"})]})]})}),i.jsxs("div",{className:y?"flex flex-col gap-6":"grid grid-cols-2 gap-6",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-lg font-semibold mb-4 text-kaspersky-primary",children:"System Information"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-kaspersky-text-light font-medium",children:"Operating System"}),i.jsx("div",{className:"text-kaspersky-text-dark font-medium",children:e.os})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-kaspersky-text-light font-medium",children:"Hostname"}),i.jsx("div",{className:"text-kaspersky-text-dark font-medium",children:e.ip})]}),e.port&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-kaspersky-text-light font-medium",children:"Port"}),i.jsx("div",{className:"text-kaspersky-text-dark font-medium",children:e.port})]}),e.protocol&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-kaspersky-text-light font-medium",children:"Protocol"}),i.jsx("div",{className:"text-kaspersky-text-dark font-medium",children:e.protocol.toUpperCase()})]}),!y&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-kaspersky-text-light font-medium",children:"Hypervisor"}),i.jsx("div",{className:"text-kaspersky-text-dark font-medium",children:e.hypervisor})]})]})]}),!y&&i.jsxs("div",{children:[i.jsx("h2",{className:"text-lg font-semibold mb-4 text-kaspersky-primary",children:"Hardware Specifications"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-kaspersky-text-light font-medium",children:"CPU"}),i.jsx("div",{className:"text-kaspersky-text-dark font-medium",children:e.specs.cpu})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-kaspersky-text-light font-medium",children:"Memory"}),i.jsx("div",{className:"text-kaspersky-text-dark font-medium",children:e.specs.ram})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-kaspersky-text-light font-medium",children:"Storage"}),i.jsx("div",{className:"text-kaspersky-text-dark font-medium",children:e.specs.disk})]})]})]})]}),i.jsxs("div",{className:"mt-6",children:[i.jsx("h2",{className:"text-lg font-medium mb-4 text-kaspersky-primary",children:"Test Links"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:(A=e.testLinks)==null?void 0:A.map((R,H)=>i.jsx("a",{href:R.url,target:"_blank",rel:"noopener noreferrer",className:"inline-block px-3 py-1 bg-kaspersky-primary text-white rounded-lg hover:bg-kaspersky-primary-dark hover:shadow-kaspersky transition-all duration-300",children:R.name},H))})]}),i.jsxs("div",{className:"mt-6",children:[i.jsx("h2",{className:"text-lg font-semibold mb-4 text-kaspersky-primary",children:"Execution Log"}),i.jsx("div",{className:"bg-kaspersky-bg rounded-lg p-4 font-mono text-sm max-h-48 overflow-auto border border-kaspersky-border",children:(O=e.logs)==null?void 0:O.map((R,H)=>i.jsxs("div",{className:"text-kaspersky-text mb-1",children:[i.jsxs("span",{className:"text-kaspersky-text-light",children:["[",new Date(R.timestamp).toLocaleString(),"]"]}),i.jsxs("span",{className:`ml-2 font-medium ${R.level==="error"?"text-kaspersky-danger":R.level==="warn"?"text-kaspersky-warning":"text-kaspersky-text-dark"}`,children:["[",R.level.toUpperCase(),"] ",R.message]})]},H))})]})]}),v&&i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:i.jsxs("div",{className:"bg-kaspersky-bg-card rounded-lg p-6 max-w-md w-full shadow-2xl border border-kaspersky-border",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx("div",{className:"p-3 bg-red-600 bg-opacity-20 rounded-full",children:i.jsx(pu,{size:24,className:"text-red-500"})}),i.jsx("h3",{className:"text-xl font-semibold text-kaspersky-text-dark",children:"Delete Machine"})]}),i.jsxs("p",{className:"text-kaspersky-text mb-6",children:["Are you sure you want to delete ",i.jsx("strong",{className:"text-kaspersky-text-dark",children:e.name}),"? This action cannot be undone."]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("button",{onClick:I,disabled:d,className:"flex-1 px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed font-medium",children:d?"Deleting...":"Delete"}),i.jsx("button",{onClick:()=>E(!1),disabled:d,className:"flex-1 px-4 py-2 bg-kaspersky-bg hover:bg-kaspersky-border text-kaspersky-text-dark rounded-lg transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed font-medium border border-kaspersky-border",children:"Cancel"})]})]})})]})}function _x({machine:e,onConnect:t,isConnected:r,onDisconnect:n,userRole:s}){const[a,l]=$.useState({connect:!1,health:!1,issue:!1}),{controlMachine:u}=Mt(),d=(b,w)=>{l(L=>({...L,[b]:w}))},m=async()=>{r&&n?n():t&&t()},v=async()=>{d("health",!0);try{x.info("action-panel","Starting health check",{machineId:e.id,machineName:e.name}),await new Promise(b=>setTimeout(b,1500)),x.info("action-panel","Health check completed",{machineId:e.id,status:"healthy"})}catch(b){x.error("action-panel","Health check failed",{machineId:e.id,error:b instanceof Error?b.message:String(b)})}finally{d("health",!1)}},E=async()=>{d("issue",!0);try{x.info("action-panel","Creating issue",{machineId:e.id,machineName:e.name}),await new Promise(b=>setTimeout(b,1e3)),x.info("action-panel","Issue created successfully",{machineId:e.id,issueId:"MOCK-123"})}catch(b){x.error("action-panel","Failed to create issue",{machineId:e.id,error:b instanceof Error?b.message:String(b)})}finally{d("issue",!1)}},C=s==="GUEST"&&!r;return i.jsx("div",{className:"bg-white border-t border-kaspersky-border p-4 shadow-kaspersky select-none",children:i.jsxs("div",{className:"flex justify-end gap-3",children:[i.jsx(Ge,{variant:r?"danger":"primary",size:"md",onClick:m,isLoading:a.connect,disabled:C,leftIcon:r?i.jsx(l0,{size:18}):i.jsx(Uf,{size:18}),title:C?"Access denied: GUEST role cannot create connections. Contact your administrator.":void 0,children:r?"Disconnect":"Connect"}),i.jsx(Ge,{variant:"secondary",size:"md",onClick:v,isLoading:a.health,leftIcon:i.jsx(Zm,{size:18}),children:a.health?"Checking...":"Health Check"}),i.jsx(Ge,{variant:"ghost",size:"md",onClick:E,isLoading:a.issue,leftIcon:i.jsx(qn,{size:18}),children:a.issue?"Creating...":"Create Issue"}),r&&i.jsxs("div",{className:"relative",children:[i.jsx(Ge,{variant:"ghost",size:"md",disabled:!0,leftIcon:i.jsx(x0,{size:18}),className:"opacity-50 cursor-not-allowed",children:"LLM Help"}),i.jsx("span",{className:"absolute -top-1 -right-1 bg-gradient-to-r from-kaspersky-primary to-kaspersky-danger text-white text-[9px] font-bold px-1.5 py-0.5 rounded-full uppercase tracking-wide shadow-sm",children:"Soon"})]})]})})}class yu{static sanitizeIpAddress(t){const r=t.trim().replace(/[^0-9.:a-fA-F]/g,"");if(/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(r)||/^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/.test(r))return r;throw new Error("Invalid IP address format")}static sanitizeMachineName(t){if(!t||typeof t!="string")throw new Error("Machine name is required");const r=t.trim().replace(/[^a-zA-Z0-9\-_\s]/g,"");if(r.length===0)throw new Error("Machine name cannot be empty");if(r.length>50)throw new Error("Machine name too long (max 50 characters)");return r}static sanitizeUsername(t){if(!t||typeof t!="string")throw new Error("Username is required");const r=t.trim().toLowerCase().replace(/[^a-z0-9@._-]/g,"");if(r.length<3)throw new Error("Username too short (min 3 characters)");if(r.length>50)throw new Error("Username too long (max 50 characters)");return r}static validatePassword(t){if(!t||typeof t!="string")throw new Error("Password is required");if(t.length<8)throw new Error("Password too short (min 8 characters)");if(t.length>128)throw new Error("Password too long (max 128 characters)");if(/[\x00-\x1f\x7f]/.test(t))throw new Error("Password contains invalid characters");return!0}static sanitizeUrl(t){if(!t||typeof t!="string")throw new Error("URL is required");try{const r=new URL(t.trim());if(!["http:","https:"].includes(r.protocol))throw new Error("Invalid protocol. Only HTTP and HTTPS are allowed");if(["localhost","127.0.0.1","0.0.0.0"].includes(r.hostname))throw new Error("Localhost URLs not allowed in production");return r.toString()}catch(r){throw r instanceof Error&&r.message.includes("Invalid URL")?new Error("Invalid URL format"):r}}static sanitizeText(t,r=1e3){return!t||typeof t!="string"?"":t.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,"").trim().slice(0,r)}static validatePort(t){const r=typeof t=="string"?parseInt(t,10):t;if(isNaN(r)||r<1||r>65535)throw new Error("Invalid port number (must be 1-65535)");return r}static sanitizeProtocol(t){if(!t||typeof t!="string")throw new Error("Protocol is required");const r=["rdp","vnc","ssh","telnet"],n=t.toLowerCase().trim();if(!r.includes(n))throw new Error(`Invalid protocol. Allowed: ${r.join(", ")}`);return n}}const Tx=({onLogin:e})=>{const[t,r]=$.useState(""),[n,s]=$.useState(""),[a,l]=$.useState(!1),[u,d]=$.useState(null),[m,v]=$.useState(null),[E,N]=$.useState(!1),C=$.useRef(null),b=5*60*1e3,w=()=>{(t||n)&&(r(""),s(""),d(null),N(!0),setTimeout(()=>{N(!1)},5e3))},L=()=>{C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{w()},b)},g=()=>{N(!1),L()};$.useEffect(()=>(L(),()=>{C.current&&clearTimeout(C.current)}),[]),$.useEffect(()=>{(t||n)&&L()},[t,n]);const y=async S=>{S.preventDefault(),l(!0),d(null);try{const I=yu.sanitizeUsername(t);yu.validatePassword(n),await e(I,n),r(""),s("")}catch(I){d(I instanceof Error?I.message:"Authentication failed. Please check your credentials and try again.")}finally{l(!1)}};return i.jsxs("div",{className:"min-h-screen w-full bg-gradient-to-br from-kaspersky-secondary via-kaspersky-primary-dark to-kaspersky-secondary animate-gradient flex items-center justify-center p-4 overflow-hidden",onMouseMove:g,onClick:g,onKeyDown:g,children:[i.jsx("div",{className:"absolute inset-0 opacity-10 overflow-hidden",children:i.jsx("div",{className:"absolute inset-0 w-full h-full animate-pattern",style:{backgroundImage:"radial-gradient(circle at 2px 2px, rgba(0, 168, 142, 0.4) 1px, transparent 0)",backgroundSize:"40px 40px"}})}),i.jsxs("div",{className:"relative z-10 w-full max-w-md select-none",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 bg-kaspersky-primary rounded-2xl shadow-kaspersky-xl mb-6 transform hover:scale-105 transition-transform duration-300",children:i.jsx(h0,{size:48,className:"text-white",strokeWidth:1.5})}),i.jsx("h1",{className:"text-4xl font-bold text-white mb-2 tracking-tight",children:"URG Duty"}),i.jsx("p",{className:"text-kaspersky-text-lighter text-lg",children:"Remote Access Control Center"})]}),i.jsxs("div",{className:"bg-white/95 backdrop-blur-sm rounded-2xl shadow-kaspersky-xl p-8",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("h2",{className:"text-2xl font-semibold text-kaspersky-text-dark mb-2",children:"Sign In"}),i.jsx("p",{className:"text-kaspersky-text-light text-sm",children:"Enter your credentials to access the system"})]}),E&&i.jsxs("div",{className:"mb-6 bg-orange-50 border-l-4 border-orange-500 rounded-lg p-4 flex items-start gap-3 animate-fadeIn select-none",children:[i.jsx(ra,{size:20,className:"text-orange-500 flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"text-sm font-medium text-orange-700",children:"Форма очищена"}),i.jsx("p",{className:"text-sm text-kaspersky-text-light mt-1",children:"Форма была очищена из-за неактивности (5 минут)"})]})]}),u&&i.jsxs("div",{className:"mb-6 bg-red-50 border-l-4 border-kaspersky-danger rounded-lg p-4 flex items-start gap-3 animate-shake select-none",children:[i.jsx(qn,{size:20,className:"text-kaspersky-danger flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"text-sm font-medium text-kaspersky-danger",children:"Authentication Failed"}),i.jsx("p",{className:"text-sm text-kaspersky-text-light mt-1",children:u})]})]}),i.jsxs("form",{onSubmit:y,className:"space-y-6",children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-kaspersky-text-dark mb-2",children:"Username"}),i.jsxs("div",{className:`relative transition-all duration-300 ${m==="username"?"transform scale-[1.02]":""}`,children:[i.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:i.jsx($f,{size:18,className:`transition-colors duration-300 ${m==="username"?"text-kaspersky-primary":"text-kaspersky-text-lighter"}`})}),i.jsx("input",{type:"text",id:"username",value:t,onChange:S=>r(S.target.value),onFocus:()=>v("username"),onBlur:()=>v(null),className:`w-full pl-10 pr-4 py-3 border-2 rounded-lg font-kaspersky
transition-all duration-300 outline-none
${m==="username"?"border-kaspersky-primary bg-kaspersky-bg-card shadow-kaspersky":"border-kaspersky-border bg-kaspersky-bg-card hover:border-kaspersky-border-dark"}
disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-gray-100
`,placeholder:"Enter your username",required:!0,disabled:a,autoFocus:!0,autoComplete:"username"})]})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-kaspersky-text-dark mb-2",children:"Password"}),i.jsxs("div",{className:`relative transition-all duration-300 ${m==="password"?"transform scale-[1.02]":""}`,children:[i.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:i.jsx(Df,{size:18,className:`transition-colors duration-300 ${m==="password"?"text-kaspersky-primary":"text-kaspersky-text-lighter"}`})}),i.jsx("input",{type:"password",id:"password",value:n,onChange:S=>s(S.target.value),onFocus:()=>v("password"),onBlur:()=>v(null),className:`w-full pl-10 pr-4 py-3 border-2 rounded-lg font-kaspersky
transition-all duration-300 outline-none
${m==="password"?"border-kaspersky-primary bg-kaspersky-bg-card shadow-kaspersky":"border-kaspersky-border bg-kaspersky-bg-card hover:border-kaspersky-border-dark"}
disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-gray-100
`,placeholder:"Enter your password",required:!0,disabled:a,autoComplete:"current-password"})]})]}),i.jsx("button",{type:"submit",disabled:a||!t||!n,className:`
w-full py-3 px-6 rounded-lg font-semibold text-white
transition-all duration-300 transform
${a||!t||!n?"bg-kaspersky-text-lighter cursor-not-allowed opacity-60":"bg-kaspersky-primary hover:bg-kaspersky-primary-dark hover:shadow-kaspersky-lg active:scale-[0.98]"}
disabled:transform-none
focus:outline-none focus:ring-4 focus:ring-kaspersky-primary/30
`,children:a?i.jsxs("span",{className:"flex items-center justify-center gap-2",children:[i.jsxs("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Authenticating..."]}):"Sign In"}),i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-0 flex items-center",children:i.jsx("div",{className:"w-full border-t border-gray-300"})}),i.jsx("div",{className:"relative flex justify-center text-sm",children:i.jsx("span",{className:"px-2 bg-white/95 backdrop-blur-sm text-gray-500",children:"or"})})]}),i.jsxs("div",{className:"relative",children:[i.jsxs("button",{type:"button",disabled:!0,className:"w-full py-3 px-6 rounded-lg font-semibold text-gray-500 bg-gray-200 cursor-not-allowed opacity-60 flex items-center justify-center gap-3",children:[i.jsx(zm,{size:20,className:"text-gray-500"}),i.jsx("span",{children:"Sign in with ADFS"})]}),i.jsx("span",{className:"absolute -top-1 -right-1 bg-gradient-to-r from-kaspersky-primary to-kaspersky-danger text-white text-[9px] font-bold px-1.5 py-0.5 rounded-full uppercase tracking-wide shadow-sm",children:"Soon"})]})]})]})]})]})},Px=({isOpen:e,connections:t,onRestore:r,onRestoreMultiple:n,onClose:s,onSkip:a})=>{const[l,u]=$.useState(new Set);if($.useEffect(()=>{e||u(new Set)},[e]),!e)return null;const d=w=>{u(L=>{const g=new Set(L);return g.has(w)?g.delete(w):g.add(w),g})},m=()=>{u(new Set(t.map(w=>w.connection_id)))},v=()=>{u(new Set)},E=()=>{const w=t.filter(L=>l.has(L.connection_id));w.length>0&&(n(w),u(new Set))},N=()=>{n(t),u(new Set)},C=w=>{switch(w.toLowerCase()){case"rdp":return"bg-blue-100 text-blue-700 border-blue-200";case"ssh":return"bg-green-100 text-green-700 border-green-200";case"vnc":return"bg-purple-100 text-purple-700 border-purple-200";default:return"bg-gray-100 text-gray-700 border-gray-200"}},b=w=>{if(w<60)return`${w} мин`;const L=Math.floor(w/60),g=w%60;return g>0?`${L}ч ${g}м`:`${L}ч`};return i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:i.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-2xl max-h-[80vh] flex flex-col select-none",children:[i.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-kaspersky-primary/10 rounded-xl flex items-center justify-center",children:i.jsx(Na,{className:"text-kaspersky-primary",size:24})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold text-kaspersky-text-dark",children:"Восстановить подключения"}),i.jsxs("p",{className:"text-sm text-kaspersky-text-light mt-1",children:["У вас есть ",t.length," активных ",t.length===1?"подключение":"подключения"]})]})]}),i.jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 transition-colors p-2 hover:bg-gray-100 rounded-lg",children:i.jsx(Zt,{size:24})})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("p",{className:"text-kaspersky-text",children:"Выберите подключения для восстановления:"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{onClick:m,className:"text-xs text-kaspersky-primary hover:text-kaspersky-primary-dark font-medium transition-colors",children:"Выбрать все"}),i.jsx("span",{className:"text-gray-300",children:"|"}),i.jsx("button",{onClick:v,className:"text-xs text-kaspersky-text-light hover:text-kaspersky-text font-medium transition-colors",children:"Снять выбор"})]})]}),i.jsx("div",{className:"space-y-3",children:t.map(w=>{const L=l.has(w.connection_id);return i.jsx("div",{className:`border-2 rounded-xl p-4 transition-all duration-200 hover:shadow-md cursor-pointer group ${L?"border-kaspersky-primary bg-kaspersky-primary/5":"border-kaspersky-border hover:border-kaspersky-primary"}`,onClick:()=>d(w.connection_id),children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[i.jsx("div",{className:"flex-shrink-0 pt-1",children:i.jsx("div",{className:`w-5 h-5 rounded border-2 flex items-center justify-center transition-all ${L?"bg-kaspersky-primary border-kaspersky-primary":"border-gray-300 group-hover:border-kaspersky-primary"}`,children:L?i.jsx(g0,{size:16,className:"text-white",strokeWidth:3}):i.jsx(k0,{size:16,className:"text-transparent"})})}),i.jsx("div",{className:"w-10 h-10 bg-kaspersky-bg rounded-lg flex items-center justify-center flex-shrink-0 group-hover:bg-kaspersky-primary/10 transition-colors",children:i.jsx(s0,{className:"text-kaspersky-primary",size:20})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h3",{className:"font-semibold text-kaspersky-text-dark text-lg mb-1 truncate",children:w.hostname}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[i.jsx("span",{className:`px-2 py-1 rounded-md text-xs font-medium border ${C(w.protocol)}`,children:w.protocol.toUpperCase()}),i.jsxs("span",{className:"text-xs text-kaspersky-text-light flex items-center gap-1",children:[i.jsx(ra,{size:12}),"Осталось: ",b(w.remaining_minutes)]})]}),i.jsxs("p",{className:"text-xs text-kaspersky-text-lighter",children:["Создано: ",new Date(w.created_at).toLocaleString("ru-RU",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})]})]})]}),i.jsxs("button",{onClick:g=>{g.stopPropagation(),r(w)},className:"ml-4 px-4 py-2 bg-kaspersky-primary hover:bg-kaspersky-primary-dark text-white rounded-lg transition-colors font-medium text-sm flex items-center gap-2 whitespace-nowrap",children:[i.jsx(Na,{size:16}),"Восстановить"]})]})},w.connection_id)})})]}),i.jsxs("div",{className:"flex items-center justify-between gap-3 p-6 border-t border-gray-200 bg-gray-50",children:[i.jsx("p",{className:"text-sm text-kaspersky-text-light",children:l.size>0?`Выбрано: ${l.size} из ${t.length}`:"Выберите подключения или создайте новое"}),i.jsxs("div",{className:"flex gap-3",children:[i.jsxs("button",{onClick:a,className:"px-6 py-2.5 bg-white border-2 border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors font-medium flex items-center gap-2",children:[i.jsx(ta,{size:18}),"Создать новое"]}),i.jsxs("button",{onClick:N,className:"px-6 py-2.5 bg-kaspersky-secondary hover:bg-kaspersky-secondary/90 text-white rounded-lg transition-colors font-medium flex items-center gap-2",children:[i.jsx(Na,{size:18}),"Восстановить всё"]}),i.jsxs("button",{onClick:E,disabled:l.size===0,className:`px-6 py-2.5 rounded-lg transition-colors font-medium flex items-center gap-2 ${l.size===0?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-kaspersky-primary hover:bg-kaspersky-primary-dark text-white"}`,children:[i.jsx(Na,{size:18}),"Восстановить выбранные"]})]})]})]})})},Mx=({isOpen:e,onClose:t,onSuccess:r})=>{const{createSavedMachine:n,setShowSaveConfirmModal:s,setMachineToSave:a}=Mt(),[l,u]=$.useState({name:"",hostname:"",port:3389,protocol:"rdp",os:"",username:"",password:"",description:"",tags:[],is_favorite:!1}),[d,m]=$.useState(""),[v,E]=$.useState(!1),[N,C]=$.useState(null),[b,w]=$.useState(!0),L=R=>{const{name:H,value:de,type:le}=R.target;u(Fe=>({...Fe,[H]:le==="number"?parseInt(de):de}))},g=R=>{const{name:H,checked:de}=R.target;u(le=>({...le,[H]:de}))},y=()=>{var R;d.trim()&&!((R=l.tags)!=null&&R.includes(d.trim()))&&(u(H=>({...H,tags:[...H.tags||[],d.trim()]})),m(""))},S=R=>{u(H=>{var de;return{...H,tags:((de=H.tags)==null?void 0:de.filter(le=>le!==R))||[]}})},I=async R=>{if(R.preventDefault(),!l.name.trim()){C("Название машины обязательно");return}if(!l.hostname.trim()){C("Хост обязателен");return}if(l.port<1||l.port>65535){C("Порт должен быть от 1 до 65535");return}if(C(null),b){a(l),s(!0),t();return}E(!0);try{x.info("AddMachineModal","Creating machine",{name:l.name}),await n(l),x.info("AddMachineModal","Machine created successfully"),A(),r&&r(),t()}catch(H){const de=H instanceof Error?H.message:"Не удалось создать машину";x.error("AddMachineModal","Failed to create machine",{error:de}),C(de)}finally{E(!1)}},A=()=>{u({name:"",hostname:"",port:3389,protocol:"rdp",os:"",username:"",password:"",description:"",tags:[],is_favorite:!1}),m(""),C(null)},O=()=>{A(),t()};return e?i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-60 flex items-center justify-center z-50 p-4 backdrop-blur-sm",children:i.jsx("div",{className:"bg-kaspersky-bg-card rounded-lg shadow-2xl max-w-2xl w-full max-h-[90vh] overflow-y-auto border border-kaspersky-border select-none",children:i.jsxs("div",{className:"p-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsx("h2",{className:"text-2xl font-bold text-kaspersky-text-dark",children:"Добавить машину"}),i.jsx("button",{onClick:O,className:"text-kaspersky-text-light hover:text-kaspersky-danger transition-colors p-1 rounded-lg hover:bg-kaspersky-bg",disabled:v,children:i.jsx(Zt,{size:24})})]}),N&&i.jsx("div",{className:"mb-4 p-3 bg-kaspersky-danger bg-opacity-10 border border-kaspersky-danger rounded-lg text-kaspersky-danger text-sm font-medium animate-shake",children:N}),i.jsxs("form",{onSubmit:I,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"name",className:"block text-sm font-semibold text-kaspersky-text-dark mb-2",children:"Название *"}),i.jsx("input",{type:"text",id:"name",name:"name",value:l.name,onChange:L,className:"w-full px-4 py-2.5 bg-kaspersky-bg border-2 border-kaspersky-border rounded-lg text-kaspersky-text-dark focus:outline-none focus:border-kaspersky-primary focus:bg-white transition-all duration-200 select-text",placeholder:"Например: Production Server",required:!0,disabled:v})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"hostname",className:"block text-sm font-semibold text-kaspersky-text-dark mb-2",children:"Хост (IP или домен) *"}),i.jsx("input",{type:"text",id:"hostname",name:"hostname",value:l.hostname,onChange:L,className:"w-full px-4 py-2.5 bg-kaspersky-bg border-2 border-kaspersky-border rounded-lg text-kaspersky-text-dark focus:outline-none focus:border-kaspersky-primary focus:bg-white transition-all duration-200 select-text",placeholder:"192.168.1.100 или example.com",required:!0,disabled:v})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"os",className:"block text-sm font-semibold text-kaspersky-text-dark mb-2",children:"Операционная система"}),i.jsx("input",{type:"text",id:"os",name:"os",value:l.os,onChange:L,className:"w-full px-4 py-2.5 bg-kaspersky-bg border-2 border-kaspersky-border rounded-lg text-kaspersky-text-dark focus:outline-none focus:border-kaspersky-primary focus:bg-white transition-all duration-200 select-text",placeholder:"Windows Server 2019, Ubuntu 22.04, etc.",disabled:v})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"protocol",className:"block text-sm font-semibold text-kaspersky-text-dark mb-2",children:"Протокол *"}),i.jsxs("select",{id:"protocol",name:"protocol",value:l.protocol,onChange:L,className:"w-full px-4 py-2.5 bg-kaspersky-bg border-2 border-kaspersky-border rounded-lg text-kaspersky-text-dark focus:outline-none focus:border-kaspersky-primary focus:bg-white transition-all duration-200 select-text",required:!0,disabled:v,children:[i.jsx("option",{value:"rdp",children:"RDP"}),i.jsx("option",{value:"ssh",children:"SSH"}),i.jsx("option",{value:"vnc",children:"VNC"}),i.jsx("option",{value:"telnet",children:"Telnet"})]})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"port",className:"block text-sm font-semibold text-kaspersky-text-dark mb-2",children:"Порт *"}),i.jsx("input",{type:"number",id:"port",name:"port",value:l.port,onChange:L,min:"1",max:"65535",className:"w-full px-4 py-2.5 bg-kaspersky-bg border-2 border-kaspersky-border rounded-lg text-kaspersky-text-dark focus:outline-none focus:border-kaspersky-primary focus:bg-white transition-all duration-200 select-text",required:!0,disabled:v})]})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"username",className:"block text-sm font-semibold text-kaspersky-text-dark mb-2",children:"Имя пользователя"}),i.jsx("input",{type:"text",id:"username",name:"username",value:l.username,onChange:L,className:"w-full px-4 py-2.5 bg-kaspersky-bg border-2 border-kaspersky-border rounded-lg text-kaspersky-text-dark focus:outline-none focus:border-kaspersky-primary focus:bg-white transition-all duration-200 select-text",placeholder:"Опционально",disabled:v})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"password",className:"block text-sm font-semibold text-kaspersky-text-dark mb-2",children:"Пароль"}),i.jsx("input",{type:"password",id:"password",name:"password",value:l.password,onChange:L,className:"w-full px-4 py-2.5 bg-kaspersky-bg border-2 border-kaspersky-border rounded-lg text-kaspersky-text-dark focus:outline-none focus:border-kaspersky-primary focus:bg-white transition-all duration-200 select-text",placeholder:"Опционально",disabled:v}),i.jsx("p",{className:"mt-2 text-xs text-kaspersky-text-light",children:"🔒 Пароль будет зашифрован и безопасно сохранен"})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"description",className:"block text-sm font-semibold text-kaspersky-text-dark mb-2",children:"Описание"}),i.jsx("textarea",{id:"description",name:"description",value:l.description,onChange:L,rows:3,className:"w-full px-4 py-2.5 bg-kaspersky-bg border-2 border-kaspersky-border rounded-lg text-kaspersky-text-dark focus:outline-none focus:border-kaspersky-primary focus:bg-white resize-none transition-all duration-200 select-text",placeholder:"Опциональное описание машины",disabled:v})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-semibold text-kaspersky-text-dark mb-2",children:"Теги"}),i.jsxs("div",{className:"flex gap-2 mb-2",children:[i.jsx("input",{type:"text",value:d,onChange:R=>m(R.target.value),onKeyPress:R=>R.key==="Enter"&&(R.preventDefault(),y()),className:"flex-1 px-4 py-2.5 bg-kaspersky-bg border-2 border-kaspersky-border rounded-lg text-kaspersky-text-dark focus:outline-none focus:border-kaspersky-primary focus:bg-white transition-all duration-200 select-text",placeholder:"Введите тег и нажмите Enter",disabled:v}),i.jsx(Ge,{type:"button",onClick:y,variant:"secondary",disabled:v||!d.trim(),leftIcon:i.jsx(Of,{size:16}),children:"Добавить"})]}),l.tags&&l.tags.length>0&&i.jsx("div",{className:"flex flex-wrap gap-2",children:l.tags.map((R,H)=>i.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-kaspersky-primary bg-opacity-10 text-kaspersky-primary rounded-lg text-sm font-medium border border-kaspersky-primary border-opacity-30",children:[R,i.jsx("button",{type:"button",onClick:()=>S(R),className:"hover:text-kaspersky-danger transition-colors ml-1",disabled:v,children:i.jsx(Zt,{size:14})})]},H))})]}),i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-kaspersky-bg rounded-lg border border-kaspersky-border",children:[i.jsx("input",{type:"checkbox",id:"is_favorite",name:"is_favorite",checked:l.is_favorite,onChange:g,className:"w-5 h-5 text-kaspersky-primary bg-white border-2 border-kaspersky-border rounded focus:ring-2 focus:ring-kaspersky-primary cursor-pointer",disabled:v}),i.jsx("label",{htmlFor:"is_favorite",className:"text-sm font-medium text-kaspersky-text-dark cursor-pointer flex-1",children:"⭐ Добавить в избранное"})]}),i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-kaspersky-bg rounded-lg border border-kaspersky-border",children:[i.jsx("input",{type:"checkbox",id:"askToSave",checked:b,onChange:R=>w(R.target.checked),className:"w-5 h-5 text-kaspersky-primary bg-white border-2 border-kaspersky-border rounded focus:ring-2 focus:ring-kaspersky-primary cursor-pointer",disabled:v}),i.jsx("label",{htmlFor:"askToSave",className:"text-sm font-medium text-kaspersky-text-dark cursor-pointer flex-1",children:"💬 Спросить подтверждение перед сохранением"})]}),i.jsxs("div",{className:"flex gap-3 pt-4",children:[i.jsx(Ge,{type:"submit",variant:"primary",fullWidth:!0,disabled:v,isLoading:v,leftIcon:v?void 0:i.jsx(di,{size:18}),children:v?"Сохранение...":"Сохранить"}),i.jsx(Ge,{type:"button",variant:"secondary",onClick:O,disabled:v,leftIcon:i.jsx(Zt,{size:18}),children:"Отмена"})]})]})]})})}):null},Ax=({isOpen:e,onClose:t,onSuccess:r})=>{const{machineToSave:n,createSavedMachine:s,setMachineToSave:a,setShowSaveConfirmModal:l}=Mt(),[u,d]=$.useState(!1),[m,v]=$.useState(null),E=async()=>{if(!n){v("Нет данных для сохранения");return}d(!0),v(null);try{x.info("SaveConfirmationModal","Saving machine",{name:n.name}),await s(n),x.info("SaveConfirmationModal","Machine saved successfully"),a(null),l(!1),r&&r(),t()}catch(C){const b=C instanceof Error?C.message:"Не удалось сохранить машину";x.error("SaveConfirmationModal","Failed to save machine",{error:b}),v(b)}finally{d(!1)}},N=()=>{a(null),l(!1),v(null),t()};return!e||!n?null:i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:i.jsx("div",{className:"bg-kaspersky-bg-card rounded-lg shadow-2xl border border-kaspersky-border max-w-md w-full select-none",children:i.jsxs("div",{className:"p-6",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsx("div",{className:"flex-shrink-0 w-12 h-12 bg-kaspersky-primary bg-opacity-10 rounded-full flex items-center justify-center border-2 border-kaspersky-primary border-opacity-30",children:i.jsx(di,{className:"w-6 h-6 text-kaspersky-primary"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-xl font-bold text-kaspersky-text-dark",children:"Сохранить машину?"}),i.jsx("p",{className:"text-sm text-kaspersky-text-light",children:"Подтвердите сохранение в профиль"})]})]}),m&&i.jsxs("div",{className:"mb-4 p-3 bg-kaspersky-danger bg-opacity-10 border border-kaspersky-danger rounded text-kaspersky-danger text-sm",children:["⚠️ ",m]}),i.jsxs("div",{className:"mb-6 p-4 bg-kaspersky-bg rounded-lg border border-kaspersky-border space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-kaspersky-text-light text-sm font-medium",children:"Название:"}),i.jsx("span",{className:"text-kaspersky-text-dark font-semibold",children:n.name})]}),i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-kaspersky-text-light text-sm font-medium",children:"Хост:"}),i.jsxs("span",{className:"text-kaspersky-text-dark font-mono text-sm",children:[n.hostname,":",n.port]})]}),i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-kaspersky-text-light text-sm font-medium",children:"Протокол:"}),i.jsx("span",{className:"text-kaspersky-primary uppercase text-sm font-bold",children:n.protocol})]}),n.username&&i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-kaspersky-text-light text-sm font-medium",children:"Пользователь:"}),i.jsx("span",{className:"text-kaspersky-text-dark text-sm font-medium",children:n.username})]}),n.password&&i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-kaspersky-text-light text-sm font-medium",children:"Пароль:"}),i.jsx("span",{className:"text-kaspersky-success text-sm font-medium",children:"✓ Будет зашифрован"})]}),n.description&&i.jsxs("div",{className:"pt-3 border-t border-kaspersky-border",children:[i.jsx("span",{className:"text-kaspersky-text-light text-sm font-medium block mb-1",children:"Описание:"}),i.jsx("span",{className:"text-kaspersky-text text-sm",children:n.description})]}),n.tags&&n.tags.length>0&&i.jsxs("div",{className:"pt-3 border-t border-kaspersky-border",children:[i.jsx("span",{className:"text-kaspersky-text-light text-sm font-medium block mb-2",children:"Теги:"}),i.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.tags.map((C,b)=>i.jsx("span",{className:"px-2.5 py-1 bg-kaspersky-primary bg-opacity-20 text-kaspersky-primary rounded-md text-xs font-medium border border-kaspersky-primary border-opacity-30",children:C},b))})]}),n.is_favorite&&i.jsxs("div",{className:"pt-3 border-t border-kaspersky-border flex items-center gap-2",children:[i.jsx("svg",{className:"w-5 h-5 text-kaspersky-warning",fill:"currentColor",viewBox:"0 0 20 20",children:i.jsx("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})}),i.jsx("span",{className:"text-kaspersky-warning text-sm font-semibold",children:"В избранном"})]})]}),i.jsx("div",{className:"mb-6 p-3 bg-kaspersky-primary bg-opacity-5 rounded-lg border border-kaspersky-primary border-opacity-20",children:i.jsx("p",{className:"text-kaspersky-text text-sm",children:"🔒 Машина будет сохранена в вашем профиле и доступна из любой сессии. Все данные будут зашифрованы для обеспечения безопасности."})}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx(Ge,{onClick:E,disabled:u,variant:"primary",fullWidth:!0,isLoading:u,leftIcon:u?void 0:i.jsx(di,{size:18}),children:u?"Сохранение...":"Сохранить"}),i.jsx(Ge,{onClick:N,disabled:u,variant:"secondary",leftIcon:i.jsx(Zt,{size:18}),children:"Отмена"})]})]})})})},Ix=({message:e="Loading..."})=>i.jsxs("div",{className:"flex flex-col items-center justify-center p-8",children:[i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-kaspersky-base mb-3"}),i.jsx("p",{className:"text-kaspersky-text text-sm",children:e})]}),Lx=$.lazy(()=>Xl(()=>import("./GuacamoleViewer-DQlYXUqt.js"),[],import.meta.url).then(e=>({default:e.default}))),Rx=$.lazy(()=>Xl(()=>import("./MachineCredentialsModal-CeIiyq96.js"),[],import.meta.url).then(e=>({default:e.default}))),Jf=(e,t)=>{const r=n=>i.jsx($.Suspense,{fallback:i.jsx(Ix,{message:t}),children:i.jsx(e,{...n})});return r.displayName=`withSuspense(${e.displayName||e.name})`,r},zx=Jf(Lx,"Loading remote connection..."),Dx=Jf(Rx,"Loading connection form...");class Ux extends $.Component{constructor(r){super(r);ke(this,"handleTryAgain",()=>{this.setState({hasError:!1,error:void 0,errorId:void 0})});ke(this,"handleReload",()=>{window.location.reload()});this.state={hasError:!1}}static getDerivedStateFromError(r){return{hasError:!0,error:r,errorId:Math.random().toString(36).substr(2,9)}}componentDidCatch(r,n){var a,l;const s=this.state.errorId;x.error("error-boundary","React Error Boundary caught an error",{errorId:s,error:r.message,stack:r.stack,componentStack:n.componentStack}),(l=(a=this.props).onError)==null||l.call(a,r,n)}render(){return this.state.hasError?this.props.fallback||i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-6",children:i.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-6 max-w-md w-full",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsx("svg",{className:"w-6 h-6 text-red-600 mr-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.732-.833-2.5 0L4.268 18.5c-.77.833.192 2.5 1.732 2.5z"})}),i.jsx("h3",{className:"text-lg font-medium text-red-800",children:"Something went wrong"})]}),i.jsx("p",{className:"text-red-700 mb-4",children:"An unexpected error occurred. Our team has been notified."}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("button",{onClick:this.handleTryAgain,className:"px-4 py-2 bg-red-600 text-white rounded hover:bg-red-700 transition-colors",children:"Try Again"}),i.jsx("button",{onClick:this.handleReload,className:"px-4 py-2 border border-red-300 text-red-700 rounded hover:bg-red-50 transition-colors",children:"Reload Page"})]}),!1]})}):this.props.children}}const Ox=({toast:e})=>{const{removeToast:t}=ql(),r=a=>{const l="flex items-start p-4 mb-3 rounded-lg shadow-kaspersky border-2 transition-all duration-300 ease-in-out transform hover:scale-[1.02] animate-fadeIn";switch(a){case"success":return`${l} bg-kaspersky-success bg-opacity-10 border-kaspersky-success text-kaspersky-success`;case"error":return`${l} bg-kaspersky-danger bg-opacity-10 border-kaspersky-danger text-kaspersky-danger`;case"warning":return`${l} bg-kaspersky-warning bg-opacity-10 border-kaspersky-warning text-kaspersky-warning`;case"info":return`${l} bg-kaspersky-primary bg-opacity-10 border-kaspersky-primary text-kaspersky-primary`;default:return`${l} bg-kaspersky-bg-card border-kaspersky-border text-kaspersky-text`}},n=a=>{const l="w-5 h-5 mr-3 mt-0.5 flex-shrink-0";switch(a){case"success":return i.jsx(Bm,{className:`${l} text-kaspersky-success`});case"error":return i.jsx(ta,{className:`${l} text-kaspersky-danger`});case"warning":return i.jsx(C0,{className:`${l} text-kaspersky-warning`});case"info":return i.jsx(qm,{className:`${l} text-kaspersky-primary`});default:return null}},s=()=>{t(e.id)};return i.jsxs("div",{className:r(e.type),children:[n(e.type),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h4",{className:"font-semibold text-sm text-kaspersky-text-dark",children:e.title}),e.message&&i.jsx("p",{className:"mt-1 text-sm text-kaspersky-text opacity-90",children:e.message}),e.action&&i.jsx("button",{onClick:e.action.onClick,className:"mt-2 text-sm font-semibold underline hover:no-underline transition-all hover:opacity-80",children:e.action.label})]}),i.jsx("button",{onClick:s,className:"ml-3 flex-shrink-0 p-1 rounded-lg hover:bg-black hover:bg-opacity-10 transition-all duration-200","aria-label":"Close notification",children:i.jsx(Zt,{size:16})})]})},$x=()=>{const{toasts:e}=ql();return e.length===0?null:i.jsx("div",{className:"fixed top-4 right-4 z-50 max-w-sm w-full space-y-2",children:e.map(t=>i.jsx(Ox,{toast:t},t.id))})},Zf=$.createContext(void 0),Fx=({children:e})=>{const[t,r]=$.useState([]),n=$.useCallback(d=>{const m=Math.random().toString(36).substr(2,9),v={...d,id:m};r(N=>[...N,v]);const E=d.duration??(d.type==="error"?8e3:4e3);return E>0&&setTimeout(()=>s(m),E),m},[]),s=$.useCallback(d=>{r(m=>m.filter(v=>v.id!==d))},[]),a=$.useCallback(()=>{r([])},[]),l=$.useCallback((d,m)=>{r(v=>v.map(E=>E.id===d?{...E,...m}:E))},[]),u={toasts:t,addToast:n,removeToast:s,clearToasts:a,updateToast:l};return i.jsxs(Zf.Provider,{value:u,children:[e,i.jsx($x,{})]})},ql=()=>{const e=$.useContext(Zf);if(!e)throw new Error("useToast must be used within ToastProvider");return e},Hx=()=>{const{addToast:e}=ql();return{success:(t,r,n)=>e({type:"success",title:t,message:r,duration:n}),error:(t,r,n)=>e({type:"error",title:t,message:r,duration:n}),warning:(t,r,n)=>e({type:"warning",title:t,message:r,duration:n}),info:(t,r,n)=>e({type:"info",title:t,message:r,duration:n})}};function Bx({selectedCount:e,onHealthCheck:t,onSSHCommand:r,onClearSelection:n,userRole:s}){if(e===0)return null;const a=s==="GUEST";return i.jsxs("div",{className:"fixed bottom-6 left-1/2 transform -translate-x-1/2 z-50",children:[i.jsxs("div",{className:"bg-kaspersky-bg-card rounded-lg shadow-2xl border-2 border-kaspersky-primary px-6 py-4 flex items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2 pr-4 border-r border-kaspersky-border",children:[i.jsx("div",{className:"w-8 h-8 rounded-full bg-kaspersky-primary bg-opacity-10 flex items-center justify-center",children:i.jsx("span",{className:"text-sm font-bold text-kaspersky-primary",children:e})}),i.jsx("span",{className:"text-sm font-medium text-kaspersky-text-dark",children:e===1?"machine selected":"machines selected"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ge,{onClick:t,variant:"primary",size:"md",leftIcon:i.jsx(Rf,{size:18}),title:"Check availability of selected machines",children:"Health Check"}),i.jsx(Ge,{onClick:r,variant:"secondary",size:"md",leftIcon:i.jsx(fi,{size:18}),disabled:a,title:a?"GUEST role cannot execute SSH commands":"Run SSH command on selected machines",children:"Run Command"}),i.jsx(Ge,{onClick:()=>{},variant:"secondary",size:"md",leftIcon:i.jsx(Qm,{size:18}),disabled:!0,title:"Coming soon: Connect to multiple machines",children:"Multi-Connect"}),i.jsx(Ge,{onClick:()=>{},variant:"secondary",size:"md",leftIcon:i.jsx(S0,{size:18}),disabled:!0,title:"Coming soon: Update tags for selected machines",children:"Update Tags"})]}),i.jsx("button",{onClick:n,className:"ml-4 pl-4 border-l border-kaspersky-border text-kaspersky-text-light hover:text-kaspersky-danger transition-colors",title:"Clear selection",children:i.jsx(Zt,{size:20})})]}),a&&i.jsx("div",{className:"absolute -top-12 left-1/2 transform -translate-x-1/2 bg-kaspersky-warning text-white px-4 py-2 rounded-lg text-sm font-medium shadow-lg whitespace-nowrap",children:"⚠️ GUEST role: Limited access to bulk operations"})]})}function Vx({isOpen:e,progress:t,isComplete:r,onClose:n,onCancel:s}){const[a,l]=$.useState(0);if($.useEffect(()=>{const d=t.total>0?t.checked/t.total*100:0,m=setTimeout(()=>l(d),100);return()=>clearTimeout(m)},[t.checked,t.total]),!e)return null;const u=t.total>0?Math.round(t.checked/t.total*100):0;return i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[100]",children:i.jsxs("div",{className:"bg-kaspersky-bg-card rounded-lg shadow-2xl border border-kaspersky-border max-w-lg w-full mx-4 select-none",children:[i.jsx("div",{className:"p-6 border-b border-kaspersky-border",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-kaspersky-primary bg-opacity-10 rounded-full flex items-center justify-center",children:i.jsx(Rf,{className:`w-6 h-6 text-kaspersky-primary ${r?"":"animate-pulse"}`})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-xl font-bold text-kaspersky-text-dark",children:r?"Health Check Complete":"Checking Machines..."}),i.jsx("p",{className:"text-sm text-kaspersky-text-light",children:r?`Checked ${t.total} machine${t.total!==1?"s":""}`:`${t.checked} of ${t.total} machines checked`})]})]}),r&&i.jsx("button",{onClick:n,className:"text-kaspersky-text-light hover:text-kaspersky-text-dark transition-colors",children:i.jsx(Zt,{size:24})})]})}),i.jsxs("div",{className:"p-6 space-y-4",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("span",{className:"text-sm font-medium text-kaspersky-text-dark",children:"Progress"}),i.jsxs("span",{className:"text-sm font-bold text-kaspersky-primary",children:[u,"%"]})]}),i.jsx("div",{className:"w-full h-3 bg-kaspersky-bg rounded-full overflow-hidden",children:i.jsx("div",{className:`h-full transition-all duration-300 ${r?"bg-kaspersky-success":"bg-kaspersky-primary"}`,style:{width:`${a}%`}})})]}),!r&&t.currentMachine&&i.jsxs("div",{className:"flex items-center gap-2 text-sm text-kaspersky-text-light",children:[i.jsx(ra,{size:16,className:"animate-spin"}),i.jsxs("span",{children:["Checking: ",i.jsx("span",{className:"font-medium text-kaspersky-text-dark",children:t.currentMachine})]})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[i.jsxs("div",{className:"bg-kaspersky-bg p-3 rounded-lg text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-kaspersky-text-dark",children:t.total}),i.jsx("div",{className:"text-xs text-kaspersky-text-light mt-1",children:"Total"})]}),i.jsxs("div",{className:"bg-green-50 p-3 rounded-lg text-center",children:[i.jsxs("div",{className:"flex items-center justify-center gap-1",children:[i.jsx(ui,{size:16,className:"text-kaspersky-success"}),i.jsx("span",{className:"text-2xl font-bold text-kaspersky-success",children:t.available})]}),i.jsx("div",{className:"text-xs text-kaspersky-success mt-1",children:"Available"})]}),i.jsxs("div",{className:"bg-red-50 p-3 rounded-lg text-center",children:[i.jsxs("div",{className:"flex items-center justify-center gap-1",children:[i.jsx(ta,{size:16,className:"text-kaspersky-danger"}),i.jsx("span",{className:"text-2xl font-bold text-kaspersky-danger",children:t.unavailable})]}),i.jsx("div",{className:"text-xs text-kaspersky-danger mt-1",children:"Unavailable"})]})]})]}),i.jsxs("div",{className:"p-6 border-t border-kaspersky-border flex justify-end gap-3",children:[!r&&s&&i.jsx(Ge,{onClick:s,variant:"secondary",leftIcon:i.jsx(Zt,{size:18}),children:"Cancel"}),r&&i.jsx(Ge,{onClick:n,variant:"primary",leftIcon:i.jsx(ui,{size:18}),children:"View Results"})]})]})})}function Kx({isOpen:e,results:t,onClose:r,onRetryFailed:n}){const[s,a]=$.useState("all"),[l,u]=$.useState("name"),[d,m]=$.useState("asc"),v=$.useMemo(()=>{if(!t)return[];let b=t.results;switch(s){case"available":b=b.filter(w=>w.available);break;case"unavailable":b=b.filter(w=>!w.available);break}return[...b].sort((w,L)=>{let g=0;switch(l){case"name":g=w.machine_name.localeCompare(L.machine_name);break;case"status":g=w.status.localeCompare(L.status);break;case"response_time":g=(w.response_time_ms||9999)-(L.response_time_ms||9999);break}return d==="asc"?g:-g})},[t,s,l,d]),E=()=>{if(!t)return;const b=["Machine Name","Hostname","Status","Available","Response Time (ms)","Error"],w=t.results.map(S=>{var I;return[S.machine_name,S.hostname,S.status,S.available?"Yes":"No",((I=S.response_time_ms)==null?void 0:I.toString())||"N/A",S.error||""]}),L=[b.join(","),...w.map(S=>S.map(I=>`"${I}"`).join(","))].join(`
`),g=new Blob([L],{type:"text/csv;charset=utf-8;"}),y=document.createElement("a");y.href=URL.createObjectURL(g),y.download=`health-check-results-${new Date().toISOString()}.csv`,y.click()},N=b=>{l===b?m(d==="asc"?"desc":"asc"):(u(b),m("asc"))};if(!e||!t)return null;const C=t.unavailable>0;return i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[100]",children:i.jsxs("div",{className:"bg-kaspersky-bg-card rounded-lg shadow-2xl border border-kaspersky-border max-w-4xl w-full mx-4 max-h-[90vh] flex flex-col select-none",children:[i.jsxs("div",{className:"p-6 border-b border-kaspersky-border",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-xl font-bold text-kaspersky-text-dark",children:"Health Check Results"}),i.jsxs("p",{className:"text-sm text-kaspersky-text-light mt-1",children:["Completed in ",(t.execution_time_ms/1e3).toFixed(2),"s"]})]}),i.jsx("button",{onClick:r,className:"text-kaspersky-text-light hover:text-kaspersky-text-dark transition-colors",children:i.jsx(Zt,{size:24})})]}),i.jsxs("div",{className:"grid grid-cols-4 gap-3 mt-4",children:[i.jsxs("div",{className:"bg-kaspersky-bg p-3 rounded-lg text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-kaspersky-text-dark",children:t.total}),i.jsx("div",{className:"text-xs text-kaspersky-text-light mt-1",children:"Total"})]}),i.jsxs("div",{className:"bg-green-50 p-3 rounded-lg text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-kaspersky-success",children:t.available}),i.jsx("div",{className:"text-xs text-kaspersky-success mt-1",children:"Available"})]}),i.jsxs("div",{className:"bg-red-50 p-3 rounded-lg text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-kaspersky-danger",children:t.unavailable}),i.jsx("div",{className:"text-xs text-kaspersky-danger mt-1",children:"Unavailable"})]}),i.jsxs("div",{className:"bg-blue-50 p-3 rounded-lg text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-blue-600",children:t.success}),i.jsx("div",{className:"text-xs text-blue-600 mt-1",children:"Success"})]})]})]}),i.jsxs("div",{className:"flex border-b border-kaspersky-border px-6",children:[i.jsxs("button",{onClick:()=>a("all"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${s==="all"?"border-kaspersky-primary text-kaspersky-primary":"border-transparent text-kaspersky-text-light hover:text-kaspersky-text-dark"}`,children:["All (",t.total,")"]}),i.jsxs("button",{onClick:()=>a("available"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${s==="available"?"border-kaspersky-success text-kaspersky-success":"border-transparent text-kaspersky-text-light hover:text-kaspersky-text-dark"}`,children:["Available (",t.available,")"]}),i.jsxs("button",{onClick:()=>a("unavailable"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${s==="unavailable"?"border-kaspersky-danger text-kaspersky-danger":"border-transparent text-kaspersky-text-light hover:text-kaspersky-text-dark"}`,children:["Unavailable (",t.unavailable,")"]})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[i.jsxs("table",{className:"w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-kaspersky-border",children:[i.jsx("th",{className:"text-left p-2 text-sm font-semibold text-kaspersky-text-dark",children:"Status"}),i.jsxs("th",{className:"text-left p-2 text-sm font-semibold text-kaspersky-text-dark cursor-pointer hover:text-kaspersky-primary",onClick:()=>N("name"),children:["Machine Name ",l==="name"&&(d==="asc"?"↑":"↓")]}),i.jsx("th",{className:"text-left p-2 text-sm font-semibold text-kaspersky-text-dark",children:"Hostname"}),i.jsxs("th",{className:"text-left p-2 text-sm font-semibold text-kaspersky-text-dark cursor-pointer hover:text-kaspersky-primary",onClick:()=>N("response_time"),children:["Response ",l==="response_time"&&(d==="asc"?"↑":"↓")]}),i.jsx("th",{className:"text-left p-2 text-sm font-semibold text-kaspersky-text-dark",children:"Error"})]})}),i.jsx("tbody",{children:v.map(b=>i.jsxs("tr",{className:"border-b border-kaspersky-border hover:bg-kaspersky-bg transition-colors",children:[i.jsx("td",{className:"p-2",children:i.jsx("div",{title:b.available?"Available":b.status==="timeout"?"Timeout":"Unavailable",children:b.available?i.jsx(ui,{size:18,className:"text-kaspersky-success"}):b.status==="timeout"?i.jsx(ra,{size:18,className:"text-kaspersky-warning"}):i.jsx(ta,{size:18,className:"text-kaspersky-danger"})})}),i.jsx("td",{className:"p-2 text-sm font-medium text-kaspersky-text-dark",children:b.machine_name}),i.jsx("td",{className:"p-2 text-sm text-kaspersky-text-light",children:b.hostname}),i.jsx("td",{className:"p-2 text-sm text-kaspersky-text-light",children:b.response_time_ms?`${b.response_time_ms}ms`:"N/A"}),i.jsx("td",{className:"p-2 text-sm text-kaspersky-danger",children:b.error&&i.jsxs("div",{className:"flex items-center gap-1",title:b.error,children:[i.jsx(qn,{size:14}),i.jsx("span",{className:"truncate max-w-[200px]",children:b.error})]})})]},b.machine_id))})]}),v.length===0&&i.jsx("div",{className:"text-center py-8 text-kaspersky-text-light",children:"No results to display"})]}),i.jsxs("div",{className:"p-6 border-t border-kaspersky-border flex justify-between items-center",children:[i.jsx("div",{className:"flex gap-2",children:C&&n&&i.jsxs(Ge,{onClick:n,variant:"secondary",size:"sm",leftIcon:i.jsx(qn,{size:16}),children:["Retry Failed (",t.unavailable,")"]})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ge,{onClick:E,variant:"secondary",size:"sm",leftIcon:i.jsx(zf,{size:16}),children:"Export CSV"}),i.jsx(Ge,{onClick:r,variant:"primary",size:"sm",children:"Close"})]})]})]})})}function Wx({isOpen:e,selectedMachines:t,onClose:r,onExecute:n,userRole:s}){const[a,l]=$.useState(""),[u,d]=$.useState("saved"),[m,v]=$.useState({username:"",password:""}),[E,N]=$.useState({}),C=t.filter(A=>A.hypervisor==="Saved"),b=t.filter(A=>A.hypervisor!=="Saved"),w=s==="USER",L=["uptime","df -h","free -m","top -bn1","systemctl status","docker ps","ps aux","ls -la","cat /etc/os-release","hostname"],g=!w||L.some(A=>a.trim().startsWith(A));$.useEffect(()=>{if(u==="custom"){const A={};t.forEach(O=>{E[O.id]||(A[O.id]={username:"",password:""})}),N(O=>({...O,...A}))}},[u,t]);const y=()=>{if(a.trim()&&g)if(u==="global"){if(!m.username||!m.password)return;n(a,"global",m)}else if(u==="custom"){if(!t.every(O=>{var R,H;return((R=E[O.id])==null?void 0:R.username)&&((H=E[O.id])==null?void 0:H.password)}))return;n(a,"custom",void 0,E)}else n(a,"saved")},S=(A,O,R)=>{N(H=>({...H,[A]:{...H[A],[O]:R}}))},I=()=>{if(!m.username||!m.password)return;const A={};t.forEach(O=>{A[O.id]={username:m.username,password:m.password}}),N(A)};return e?i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[100]",children:i.jsxs("div",{className:"bg-kaspersky-bg-card rounded-lg shadow-2xl border border-kaspersky-border max-w-3xl w-full mx-4 max-h-[90vh] flex flex-col select-none",children:[i.jsx("div",{className:"p-6 border-b border-kaspersky-border",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-kaspersky-primary bg-opacity-10 rounded-full flex items-center justify-center",children:i.jsx(fi,{className:"w-6 h-6 text-kaspersky-primary"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-xl font-bold text-kaspersky-text-dark",children:"Execute SSH Command"}),i.jsxs("p",{className:"text-sm text-kaspersky-text-light",children:["Run command on ",t.length," machine",t.length!==1?"s":""]})]})]}),i.jsx("button",{onClick:r,className:"text-kaspersky-text-light hover:text-kaspersky-text-dark transition-colors",children:i.jsx(Zt,{size:24})})]})}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-semibold text-kaspersky-text-dark mb-2",children:"Command *"}),i.jsx("input",{type:"text",value:a,onChange:A=>l(A.target.value),placeholder:w?"e.g. uptime, df -h, free -m":"e.g. systemctl restart nginx",className:"w-full px-4 py-2.5 bg-kaspersky-bg border-2 border-kaspersky-border rounded-lg text-kaspersky-text-dark focus:outline-none focus:border-kaspersky-primary focus:bg-white transition-all duration-200 font-mono select-text"}),w&&!g&&a.trim()&&i.jsxs("p",{className:"mt-2 text-sm text-kaspersky-danger",children:["⚠️ This command is not in the whitelist. Allowed: ",L.join(", ")]}),w&&i.jsx("p",{className:"mt-2 text-sm text-kaspersky-text-light",children:" USER role: Only whitelist commands allowed"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-semibold text-kaspersky-text-dark mb-3",children:"Credentials Mode *"}),i.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[i.jsx("button",{onClick:()=>d("saved"),className:`p-4 rounded-lg border-2 transition-all ${u==="saved"?"border-kaspersky-primary bg-kaspersky-primary bg-opacity-10":"border-kaspersky-border bg-kaspersky-bg hover:border-kaspersky-primary hover:border-opacity-50"}`,children:i.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i.jsx(di,{size:24,className:u==="saved"?"text-kaspersky-primary":"text-kaspersky-text-light"}),i.jsx("span",{className:"text-sm font-medium text-kaspersky-text-dark",children:"Saved"}),i.jsx("span",{className:"text-xs text-kaspersky-text-light text-center",children:"Use stored credentials"})]})}),i.jsx("button",{onClick:()=>d("global"),className:`p-4 rounded-lg border-2 transition-all ${u==="global"?"border-kaspersky-primary bg-kaspersky-primary bg-opacity-10":"border-kaspersky-border bg-kaspersky-bg hover:border-kaspersky-primary hover:border-opacity-50"}`,children:i.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i.jsx(_0,{size:24,className:u==="global"?"text-kaspersky-primary":"text-kaspersky-text-light"}),i.jsx("span",{className:"text-sm font-medium text-kaspersky-text-dark",children:"Global"}),i.jsx("span",{className:"text-xs text-kaspersky-text-light text-center",children:"Same for all machines"})]})}),i.jsx("button",{onClick:()=>d("custom"),className:`p-4 rounded-lg border-2 transition-all ${u==="custom"?"border-kaspersky-primary bg-kaspersky-primary bg-opacity-10":"border-kaspersky-border bg-kaspersky-bg hover:border-kaspersky-primary hover:border-opacity-50"}`,children:i.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i.jsx($f,{size:24,className:u==="custom"?"text-kaspersky-primary":"text-kaspersky-text-light"}),i.jsx("span",{className:"text-sm font-medium text-kaspersky-text-dark",children:"Custom"}),i.jsx("span",{className:"text-xs text-kaspersky-text-light text-center",children:"Per-machine credentials"})]})})]})]}),u==="saved"&&i.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(Df,{size:20,className:"text-blue-600 flex-shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-blue-900 mb-1",children:"Using Saved Credentials"}),i.jsxs("p",{className:"text-sm text-blue-700",children:["✅ ",C.length," machine",C.length!==1?"s":""," with saved credentials"]}),b.length>0&&i.jsxs("p",{className:"text-sm text-blue-700 mt-1",children:["⚠️ ",b.length," machine",b.length!==1?"s":""," without saved credentials (will fail)"]})]})]})}),u==="global"&&i.jsxs("div",{className:"bg-kaspersky-bg border border-kaspersky-border rounded-lg p-4 space-y-3",children:[i.jsx("h4",{className:"font-semibold text-kaspersky-text-dark",children:"Global Credentials"}),i.jsxs("p",{className:"text-sm text-kaspersky-text-light",children:["These credentials will be used for all ",t.length," machines"]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-kaspersky-text-dark mb-1",children:"Username"}),i.jsx("input",{type:"text",value:m.username,onChange:A=>v(O=>({...O,username:A.target.value})),placeholder:"root",className:"w-full px-3 py-2 bg-white border border-kaspersky-border rounded-lg text-kaspersky-text-dark focus:outline-none focus:border-kaspersky-primary select-text"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-kaspersky-text-dark mb-1",children:"Password"}),i.jsx("input",{type:"password",value:m.password,onChange:A=>v(O=>({...O,password:A.target.value})),placeholder:"••••••••",className:"w-full px-3 py-2 bg-white border border-kaspersky-border rounded-lg text-kaspersky-text-dark focus:outline-none focus:border-kaspersky-primary select-text"})]})]})]}),u==="custom"&&i.jsxs("div",{className:"bg-kaspersky-bg border border-kaspersky-border rounded-lg p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h4",{className:"font-semibold text-kaspersky-text-dark",children:"Custom Credentials Per Machine"}),i.jsx(Ge,{onClick:I,variant:"secondary",size:"sm",disabled:!m.username||!m.password,children:"Copy from Global"})]}),i.jsxs("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 space-y-2",children:[i.jsx("p",{className:"text-xs text-yellow-800 font-medium",children:"Quick Fill (optional)"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsx("input",{type:"text",value:m.username,onChange:A=>v(O=>({...O,username:A.target.value})),placeholder:"Username",className:"px-2 py-1 text-sm bg-white border border-yellow-300 rounded select-text"}),i.jsx("input",{type:"password",value:m.password,onChange:A=>v(O=>({...O,password:A.target.value})),placeholder:"Password",className:"px-2 py-1 text-sm bg-white border border-yellow-300 rounded select-text"})]})]}),i.jsx("div",{className:"max-h-60 overflow-y-auto space-y-3",children:t.map(A=>{var O,R;return i.jsxs("div",{className:"bg-white border border-kaspersky-border rounded p-3 space-y-2",children:[i.jsx("div",{className:"font-medium text-sm text-kaspersky-text-dark",children:A.name}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsx("input",{type:"text",value:((O=E[A.id])==null?void 0:O.username)||"",onChange:H=>S(A.id,"username",H.target.value),placeholder:"Username",className:"px-2 py-1 text-sm bg-kaspersky-bg border border-kaspersky-border rounded focus:outline-none focus:border-kaspersky-primary select-text"}),i.jsx("input",{type:"password",value:((R=E[A.id])==null?void 0:R.password)||"",onChange:H=>S(A.id,"password",H.target.value),placeholder:"Password",className:"px-2 py-1 text-sm bg-kaspersky-bg border border-kaspersky-border rounded focus:outline-none focus:border-kaspersky-primary select-text"})]})]},A.id)})})]})]}),i.jsxs("div",{className:"p-6 border-t border-kaspersky-border flex justify-between items-center",children:[i.jsxs("div",{className:"text-sm text-kaspersky-text-light",children:[u==="saved"&&`Using saved credentials for ${C.length}/${t.length} machines`,u==="global"&&`Same credentials for all ${t.length} machines`,u==="custom"&&"Custom credentials for each machine"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ge,{onClick:r,variant:"secondary",leftIcon:i.jsx(Zt,{size:18}),children:"Cancel"}),i.jsxs(Ge,{onClick:y,variant:"primary",leftIcon:i.jsx(fi,{size:18}),disabled:!a.trim()||!g||u==="global"&&(!m.username||!m.password)||u==="custom"&&!t.every(A=>{var O,R;return((O=E[A.id])==null?void 0:O.username)&&((R=E[A.id])==null?void 0:R.password)}),children:["Execute on ",t.length," Machine",t.length!==1?"s":""]})]})]})]})}):null}function Yx({isOpen:e,results:t,onClose:r,onRetryFailed:n}){const[s,a]=$.useState("all"),[l,u]=$.useState(new Set),d=$.useMemo(()=>{if(!t)return[];switch(s){case"success":return t.results.filter(b=>b.status==="success");case"failed":return t.results.filter(b=>b.status!=="success");default:return t.results}},[t,s]),m=b=>{u(w=>{const L=new Set(w);return L.has(b)?L.delete(b):L.add(b),L})},v=()=>{u(new Set(d.map(b=>b.machine_id)))},E=()=>{u(new Set)},N=()=>{if(!t)return;const b=["Machine Name","Hostname","Status","Exit Code","Stdout","Stderr","Error"],w=t.results.map(S=>{var I;return[S.machine_name,S.hostname,S.status,((I=S.exit_code)==null?void 0:I.toString())||"N/A",S.stdout||"",S.stderr||"",S.error||""]}),L=[b.join(","),...w.map(S=>S.map(I=>`"${I.replace(/"/g,'""')}"`).join(","))].join(`
`),g=new Blob([L],{type:"text/csv;charset=utf-8;"}),y=document.createElement("a");y.href=URL.createObjectURL(g),y.download=`ssh-results-${new Date().toISOString()}.csv`,y.click()};if(!e||!t)return null;const C=t.failed>0;return i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[100]",children:i.jsxs("div",{className:"bg-kaspersky-bg-card rounded-lg shadow-2xl border border-kaspersky-border max-w-5xl w-full mx-4 max-h-[90vh] flex flex-col select-none",children:[i.jsxs("div",{className:"p-6 border-b border-kaspersky-border",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-xl font-bold text-kaspersky-text-dark",children:"SSH Command Results"}),i.jsxs("p",{className:"text-sm text-kaspersky-text-light mt-1",children:["Completed in ",(t.execution_time_ms/1e3).toFixed(2),"s"]}),i.jsx("code",{className:"text-xs bg-kaspersky-bg px-2 py-1 rounded mt-2 inline-block",children:t.command})]}),i.jsx("button",{onClick:r,className:"text-kaspersky-text-light hover:text-kaspersky-text-dark transition-colors",children:i.jsx(Zt,{size:24})})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-3 mt-4",children:[i.jsxs("div",{className:"bg-kaspersky-bg p-3 rounded-lg text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-kaspersky-text-dark",children:t.total}),i.jsx("div",{className:"text-xs text-kaspersky-text-light mt-1",children:"Total"})]}),i.jsxs("div",{className:"bg-green-50 p-3 rounded-lg text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-kaspersky-success",children:t.success}),i.jsx("div",{className:"text-xs text-kaspersky-success mt-1",children:"Success"})]}),i.jsxs("div",{className:"bg-red-50 p-3 rounded-lg text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-kaspersky-danger",children:t.failed}),i.jsx("div",{className:"text-xs text-kaspersky-danger mt-1",children:"Failed"})]})]})]}),i.jsxs("div",{className:"flex border-b border-kaspersky-border px-6 justify-between items-center",children:[i.jsxs("div",{className:"flex",children:[i.jsxs("button",{onClick:()=>a("all"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${s==="all"?"border-kaspersky-primary text-kaspersky-primary":"border-transparent text-kaspersky-text-light hover:text-kaspersky-text-dark"}`,children:["All (",t.total,")"]}),i.jsxs("button",{onClick:()=>a("success"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${s==="success"?"border-kaspersky-success text-kaspersky-success":"border-transparent text-kaspersky-text-light hover:text-kaspersky-text-dark"}`,children:["Success (",t.success,")"]}),i.jsxs("button",{onClick:()=>a("failed"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${s==="failed"?"border-kaspersky-danger text-kaspersky-danger":"border-transparent text-kaspersky-text-light hover:text-kaspersky-text-dark"}`,children:["Failed (",t.failed,")"]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{onClick:v,className:"text-xs text-kaspersky-primary hover:underline",children:"Expand All"}),i.jsx("span",{className:"text-kaspersky-text-light",children:"|"}),i.jsx("button",{onClick:E,className:"text-xs text-kaspersky-primary hover:underline",children:"Collapse All"})]})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[i.jsx("div",{className:"space-y-2",children:d.map(b=>{const w=l.has(b.machine_id),L=b.stdout||b.stderr;return i.jsxs("div",{className:"border border-kaspersky-border rounded-lg overflow-hidden",children:[i.jsxs("button",{onClick:()=>L&&m(b.machine_id),className:"w-full p-4 flex items-center justify-between hover:bg-kaspersky-bg transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{title:b.status,children:b.status==="success"?i.jsx(ui,{size:20,className:"text-kaspersky-success"}):b.status==="timeout"?i.jsx(qn,{size:20,className:"text-kaspersky-warning"}):i.jsx(ta,{size:20,className:"text-kaspersky-danger"})}),i.jsxs("div",{className:"text-left",children:[i.jsx("div",{className:"font-medium text-kaspersky-text-dark",children:b.machine_name}),i.jsx("div",{className:"text-sm text-kaspersky-text-light",children:b.hostname})]}),b.exit_code!==void 0&&i.jsxs("span",{className:`px-2 py-1 rounded text-xs font-mono ${b.exit_code===0?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:["Exit: ",b.exit_code]}),b.error&&i.jsx("span",{className:"px-2 py-1 rounded text-xs bg-red-100 text-red-800 max-w-xs truncate",children:b.error}),b.execution_time_ms&&i.jsxs("span",{className:"text-xs text-kaspersky-text-light",children:[b.execution_time_ms,"ms"]})]}),L&&i.jsx("div",{children:w?i.jsx($m,{size:20,className:"text-kaspersky-text-light"}):i.jsx(Um,{size:20,className:"text-kaspersky-text-light"})})]}),w&&L&&i.jsxs("div",{className:"border-t border-kaspersky-border bg-kaspersky-bg p-4 space-y-3",children:[b.stdout&&i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-semibold text-kaspersky-text-dark mb-1",children:"STDOUT:"}),i.jsx("pre",{className:"bg-white border border-kaspersky-border rounded p-3 text-xs overflow-x-auto font-mono whitespace-pre-wrap",children:b.stdout})]}),b.stderr&&i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-semibold text-kaspersky-danger mb-1",children:"STDERR:"}),i.jsx("pre",{className:"bg-red-50 border border-red-200 rounded p-3 text-xs overflow-x-auto font-mono whitespace-pre-wrap text-red-800",children:b.stderr})]})]})]},b.machine_id)})}),d.length===0&&i.jsx("div",{className:"text-center py-8 text-kaspersky-text-light",children:"No results to display"})]}),i.jsxs("div",{className:"p-6 border-t border-kaspersky-border flex justify-between items-center",children:[i.jsx("div",{className:"flex gap-2",children:C&&n&&i.jsxs(Ge,{onClick:n,variant:"secondary",size:"sm",leftIcon:i.jsx(fi,{size:16}),children:["Retry Failed (",t.failed,")"]})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ge,{onClick:N,variant:"secondary",size:"sm",leftIcon:i.jsx(zf,{size:16}),children:"Export CSV"}),i.jsx(Ge,{onClick:r,variant:"primary",size:"sm",children:"Close"})]})]})]})})}class Gx{static getDefaultPort(t){return t.os.toLowerCase().includes("windows")?3389:22}static async checkAvailability(t,r){try{const n=r||this.getDefaultPort(t);x.info("machine-availability","Checking machine availability",{machineId:t.id,hostname:t.name,os:t.os,port:n,portSource:r?"explicit":"auto-detected"});const s=await Ue.getAuthHeaders(),a=await fetch(`${Ve.BASE_URL}/machines/check-availability`,{method:"POST",headers:{"Content-Type":"application/json",...s},body:JSON.stringify({hostname:t.name,port:n})});if(!a.ok){const u=await a.text().catch(()=>"Unknown error");return x.error("machine-availability","Check failed",{hostname:t.name,status:a.status,error:u}),{available:!1,hostname:t.name,port:n,checkedAt:new Date().toISOString()}}const l=await a.json();return x.info("machine-availability","Check completed",{machineId:t.id,hostname:l.hostname,available:l.available,responseTimeMs:l.responseTimeMs}),l}catch(n){const s=r||this.getDefaultPort(t);return x.error("machine-availability","Check failed with exception",{hostname:t.name,error:n}),{available:!1,hostname:t.name,port:s,checkedAt:new Date().toISOString()}}}static async checkMultiple(t,r){const n=new Map,s=t.map(async l=>{const u=await this.checkAvailability(l,r);return{machineId:l.id,result:u}});return(await Promise.allSettled(s)).forEach(l=>{l.status==="fulfilled"&&n.set(l.value.machineId,l.value.result)}),n}}const Qx=Gx;class Jx{async bulkHealthCheck(t){try{const r=await Ue.getToken();if(!r)throw new Error("Authentication token not found. Please log in again.");const n=await fetch(`${Ve.BASE_URL}/bulk/health-check`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({machine_ids:t.machine_ids,timeout:t.timeout??5,check_port:t.check_port??!0})});if(!n.ok){const a=await n.json().catch(()=>({detail:"Unknown error"}));throw n.status===403?new Error(a.detail||"Permission denied. Check role-based limits."):new Error(a.detail||`Request failed with status ${n.status}`)}return await n.json()}catch(r){throw r instanceof Error?r:new Error("Failed to perform bulk health check")}}async bulkSSHCommand(t){try{const r=await Ue.getToken();if(!r)throw new Error("Authentication token not found. Please log in again.");const n=await fetch(`${Ve.BASE_URL}/bulk/ssh-command`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({machine_ids:t.machine_ids,machine_hostnames:t.machine_hostnames,command:t.command,credentials_mode:t.credentials_mode,global_credentials:t.global_credentials,machine_credentials:t.machine_credentials,timeout:t.timeout??30})});if(!n.ok){const a=await n.json().catch(()=>({detail:"Unknown error"}));throw n.status===403?new Error(a.detail||"Permission denied. Check role and command whitelist."):new Error(a.detail||`Request failed with status ${n.status}`)}return await n.json()}catch(r){throw r instanceof Error?r:new Error("Failed to execute bulk SSH command")}}getRoleLimits(t){const r={GUEST:{maxHealthCheck:10,maxSSHCommand:0},USER:{maxHealthCheck:50,maxSSHCommand:20},ADMIN:{maxHealthCheck:200,maxSSHCommand:100},SUPER_ADMIN:{maxHealthCheck:200,maxSSHCommand:100}};return r[t]||r.GUEST}}const Ca=new Jx;class Zx{constructor(){ke(this,"ws",null);ke(this,"reconnectTimer",null);ke(this,"reconnectAttempts",0);ke(this,"maxReconnectAttempts",10);ke(this,"reconnectDelay",1e3);ke(this,"maxReconnectDelay",3e4);ke(this,"isIntentionallyDisconnected",!1);ke(this,"pingTimer",null);ke(this,"pingInterval",25e3);ke(this,"eventHandlers",new Map)}connect(t){return new Promise((r,n)=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){x.info("websocket","Already connected"),r();return}this.isIntentionallyDisconnected=!1;const a=`${Ve.BASE_URL.replace("https://","wss://").replace("http://","ws://")}/ws/notifications`;x.info("websocket","Connecting to WebSocket",{url:a});try{this.ws=new WebSocket(a),this.ws.onopen=()=>{if(x.info("websocket","WebSocket connected"),this.ws&&this.ws.readyState===WebSocket.OPEN){this.ws.send(JSON.stringify({type:"auth",token:t})),x.info("websocket","Sent authentication");const l=setTimeout(()=>{x.error("websocket","Connection confirmation timeout"),this.disconnect(),n(new Error("Connection confirmation timeout"))},5e3),u=d=>{try{const m=JSON.parse(d.data);m.type==="connected"&&(clearTimeout(l),x.info("websocket","Authentication confirmed",m.data),this.reconnectAttempts=0,this.startPingTimer(),this.ws&&(this.ws.onmessage=v=>this.handleMessage(v)),r())}catch(m){x.error("websocket","Failed to parse auth response",{error:m})}};this.ws.onmessage=u}},this.ws.onerror=l=>{x.error("websocket","WebSocket error",{error:l}),n(l)},this.ws.onclose=l=>{x.info("websocket","WebSocket closed",{code:l.code,reason:l.reason,wasClean:l.wasClean}),this.stopPingTimer(),!this.isIntentionallyDisconnected&&this.reconnectAttempts<this.maxReconnectAttempts&&this.scheduleReconnect(t)}}catch(l){x.error("websocket","Failed to create WebSocket",{error:l}),n(l)}})}disconnect(){this.isIntentionallyDisconnected=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopPingTimer(),this.ws&&(this.ws.close(),this.ws=null),x.info("websocket","Disconnected")}scheduleReconnect(t){if(this.reconnectTimer)return;this.reconnectAttempts++;const r=Math.min(this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1),this.maxReconnectDelay);x.info("websocket","Scheduling reconnect",{attempt:this.reconnectAttempts,delay:`${r}ms`}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect(t).catch(n=>{x.error("websocket","Reconnect failed",{error:n})})},r)}startPingTimer(){this.stopPingTimer(),this.pingTimer=setInterval(()=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&(this.ws.send(JSON.stringify({type:"ping",timestamp:new Date().toISOString()})),x.debug("websocket","Sent ping"))},this.pingInterval)}stopPingTimer(){this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=null)}handleMessage(t){try{const r=JSON.parse(t.data);if(r.type==="pong"){x.debug("websocket","Received pong");return}if(r.type==="ping"){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"pong",timestamp:new Date().toISOString()}));return}x.info("websocket","Received event",{type:r.type,timestamp:r.timestamp});const n=this.eventHandlers.get(r.type);n&&n.forEach(a=>{try{a(r)}catch(l){x.error("websocket","Event handler error",{type:r.type,error:l})}});const s=this.eventHandlers.get("*");s&&s.forEach(a=>{try{a(r)}catch(l){x.error("websocket","Global event handler error",{type:r.type,error:l})}})}catch(r){x.error("websocket","Failed to parse message",{error:r})}}on(t,r){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Set),this.eventHandlers.get(t).add(r),x.info("websocket","Registered event handler",{eventType:t}),()=>{const n=this.eventHandlers.get(t);n&&(n.delete(r),n.size===0&&this.eventHandlers.delete(t))}}removeAllListeners(){this.eventHandlers.clear(),x.info("websocket","Removed all event handlers")}isConnected(){return this.ws!==null&&this.ws.readyState===WebSocket.OPEN}getReconnectAttempts(){return this.reconnectAttempts}}const ys=new Zx;function Xx(){const e=Mt(T=>T.selectedMachine),t=Mt(T=>T.machines),r=Mt(T=>T.savedMachines),n=Mt(T=>T.showAddMachineModal),s=Mt(T=>T.setShowAddMachineModal),a=Mt(T=>T.showSaveConfirmModal),l=Mt(T=>T.fetchSavedMachines),u=Mt(T=>T.resetState),[d,m]=$.useState(!1),[v,E]=$.useState(()=>{try{const T=localStorage.getItem("machine-connections");if(T){const V=JSON.parse(T),Y=new Map;for(const[G,X]of V)Y.set(G,{...X,connectedAt:new Date(X.connectedAt),expiresAt:new Date(X.expiresAt)});return x.info("app","Restored connections from localStorage",{count:Y.size}),Y}}catch(T){x.error("app","Failed to restore connections from localStorage",{error:T})}return new Map}),[N,C]=$.useState(new Map),[,b]=$.useState(!1),[w,L]=$.useState(Ue.getCurrentUser()),[g,y]=$.useState(!1),[S,I]=$.useState(Ue.isAuthenticated()),[A,O]=$.useState([]),[R,H]=$.useState(!1),[de,le]=$.useState({total:0,checked:0,available:0,unavailable:0,currentMachine:void 0}),[Fe,Ze]=$.useState(null),[oe,tt]=$.useState(!1),[Vt,vt]=$.useState(!1),[or,Q]=$.useState(null),[ue,ye]=$.useState(!1),[Be,He]=$.useState(!1),[mt,ot]=$.useState([]),[Ce,Qe]=$.useState(!1),{error:rt,success:kt,warning:xt}=Hx(),Kt=e?v.get(e.id):null;$.useEffect(()=>{try{const T=Array.from(v.entries()).map(([V,Y])=>[V,{machineId:Y.machineId,connectionUrl:Y.connectionUrl,connectionId:Y.connectionId,connectedAt:Y.connectedAt.toISOString(),expiresAt:Y.expiresAt.toISOString()}]);localStorage.setItem("machine-connections",JSON.stringify(T)),v.size>0&&x.debug("app","Machine connections saved to localStorage",{totalConnections:v.size,machineIds:Array.from(v.keys())})}catch(T){x.error("app","Failed to save connections to localStorage",{error:T})}},[v]),$.useEffect(()=>(I(Ue.isAuthenticated()),Ue.setOnTokenExpired(()=>{x.warn("app","Token expired, forcing re-login"),v.forEach(T=>{T.ttlTimerId&&clearTimeout(T.ttlTimerId)}),ys.disconnect(),Qe(!1),u(),L(null),E(new Map),C(new Map),y(!1),I(!1),localStorage.removeItem("machine-connections"),localStorage.removeItem("machine-store")}),Ue.setOnTokenWarning(T=>{T<=60&&y(!0)}),()=>{v.forEach(T=>{T.ttlTimerId&&clearTimeout(T.ttlTimerId)}),ys.disconnect(),x.debug("app","Cleaned up all TTL timers and WebSocket on unmount")}),[v]),$.useEffect(()=>{if(!S)return;x.info("websocket","Setting up WebSocket event handlers");const T=ys.on("*",V=>{var Y;switch(x.info("websocket","Received WebSocket event",{type:V.type}),V.type){case"connected":{x.info("websocket","WebSocket connected successfully"),Qe(!0);break}case"connection_expired":{const{connection_id:G,hostname:X,protocol:pe}=V.data;x.warn("websocket","Connection expired notification received",{connection_id:G,hostname:X,protocol:pe});const Ee=Array.from(v.entries()).find(([,De])=>De.connectionId===G);if(Ee){const[De,dt]=Ee;dt.ttlTimerId&&clearTimeout(dt.ttlTimerId),E(wt=>{const St=new Map(wt);return St.delete(De),St}),xt("Connection Expired",`Your connection to ${X} (${pe.toUpperCase()}) has expired.`),x.info("websocket","Removed expired connection",{machineId:De,connection_id:G})}break}case"connection_will_expire":{const{connection_id:G,hostname:X,protocol:pe,minutes_remaining:Ee}=V.data;x.warn("websocket","Connection will expire warning received",{connection_id:G,hostname:X,protocol:pe,minutes_remaining:Ee}),xt("Connection Expiring Soon",`Your connection to ${X} (${pe.toUpperCase()}) will expire in ${Ee} minutes.`);break}case"connection_extended":{const{connection_id:G,hostname:X,new_expires_at:pe,additional_minutes:Ee}=V.data;x.info("websocket","Connection extended notification received",{connection_id:G,hostname:X,new_expires_at:pe,additional_minutes:Ee});const De=Array.from(v.entries()).find(([,dt])=>dt.connectionId===G);if(De){const[dt]=De;E(wt=>{const St=new Map(wt),lr=St.get(dt);return lr&&(lr.expiresAt=new Date(pe)),St}),kt("Connection Extended",`Connection to ${X} extended by ${Ee} minutes.`),x.info("websocket","Updated connection expiration time",{machineId:dt,new_expires_at:pe})}break}case"jwt_will_expire":{x.warn("websocket","JWT will expire soon",{data:V.data}),xt("Session Expiring Soon",`Your session will expire in ${((Y=V.data)==null?void 0:Y.minutes_remaining)||5} minutes.`);break}case"jwt_expired":{x.error("websocket","JWT expired",{data:V.data}),rt("Session Expired","Your session has expired. Please log in again.");break}default:x.debug("websocket","Unhandled WebSocket event type",{type:V.type})}});return()=>{x.info("websocket","Cleaning up WebSocket event handlers"),T()}},[S,v,xt,rt,kt]),$.useEffect(()=>{if(!S||v.size===0)return;x.info("app","Starting periodic connection check",{connectionCount:v.size});const T=setInterval(()=>{const V=new Date;v.forEach((Y,G)=>{const X=Y.expiresAt.getTime()-V.getTime(),pe=Math.floor(X/6e4);x.debug("app","Checking connection expiry",{machineId:G,minutesUntilExpiry:pe,expiresAt:Y.expiresAt.toISOString()}),pe<0&&(x.warn("app","Connection expired locally (client-side check)",{machineId:G,connectionId:Y.connectionId}),Y.ttlTimerId&&clearTimeout(Y.ttlTimerId),E(Ee=>{const De=new Map(Ee);return De.delete(G),De}))})},3e4);return()=>{x.info("app","Stopping periodic connection check"),clearInterval(T)}},[S,v]);const na=async(T,V)=>{try{x.info("app","Clearing previous session before new login"),v.forEach(G=>{G.ttlTimerId&&clearTimeout(G.ttlTimerId)}),u(),E(new Map),C(new Map),L(null),x.info("app","Previous session cleared, proceeding with login"),await Ue.login(T,V);const Y=Ue.getCurrentUser();L(Y),I(!0),(Y==null?void 0:Y.role)==="GUEST"?(xt("Limited Access","You are logged in as GUEST. You can only view connections but cannot create new ones. Contact your administrator for USER role."),x.warn("app","User logged in with GUEST role - limited access",{username:Y.username})):(kt("Login successful",`Welcome, ${(Y==null?void 0:Y.username)||"User"}!`),x.info("app","User logged in successfully",{username:Y==null?void 0:Y.username,role:Y==null?void 0:Y.role}));try{await l(),x.info("app","Saved machines loaded successfully")}catch(G){x.warn("app","Failed to load saved machines",{error:G})}sa().catch(G=>{x.error("app","Failed to check active connections",{error:G})});try{const G=await Ue.getToken();G?(await ys.connect(G),x.info("app","WebSocket connected successfully after login")):x.warn("app","No access token available for WebSocket connection")}catch(G){x.error("app","Failed to connect WebSocket",{error:G})}}catch(Y){x.error("app","Login failed",{error:Y});const G=await un.handleApiError(Y);throw rt("Login failed",G.userMessage),Y}},En=async()=>{try{v.forEach(T=>{T.ttlTimerId&&clearTimeout(T.ttlTimerId)}),await Ue.logout(),ys.disconnect(),Qe(!1),x.info("app","WebSocket disconnected on logout"),u(),L(null),E(new Map),C(new Map),I(!1),localStorage.removeItem("machine-connections"),localStorage.removeItem("machine-store"),x.info("app","User logged out, all data cleared (security)")}catch(T){x.error("app","Logout failed",{error:T})}},sa=async()=>{try{x.info("app","Checking for active connections to restore");const T=await dn.getActiveConnections();T.length>0?(x.info("app","Found active connections",{count:T.length,connections:T.map(V=>({id:V.connection_id,hostname:V.hostname,protocol:V.protocol,remaining_minutes:V.remaining_minutes}))}),ot(T),He(!0)):x.info("app","No active connections to restore")}catch(T){x.error("app","Failed to check active connections",{error:T})}},Pi=async T=>{try{if(x.info("app","Restoring connection",{connection_id:T.connection_id,hostname:T.hostname,protocol:T.protocol}),!T.connection_url)throw new Error("Connection URL is not available");He(!1);const V=dn.getConnectionUrl(T.connection_url);x.info("app","Opening restored connection",{connectionUrl:V.substring(0,100)+"..."});let Y=t.find(X=>X.name.toLowerCase()===T.hostname.toLowerCase()||X.ip.toLowerCase()===T.hostname.toLowerCase());Y?x.info("app","Found existing machine in sidebar",{machineId:Y.id,machineName:Y.name,hostname:T.hostname}):(x.info("app","Machine not found in sidebar, creating temporary machine",{hostname:T.hostname}),Y={id:`restored-${T.connection_id}`,name:T.hostname,ip:T.hostname,status:"running",os:"unknown",hypervisor:"unknown",specs:{cpu:"unknown",ram:"unknown",disk:"unknown"},testLinks:[],logs:[]});const G={machineId:Y.id,connectionUrl:T.connection_url,connectionId:T.connection_id,connectedAt:new Date(T.created_at),expiresAt:new Date(T.expires_at)};E(X=>{const pe=new Map(X);return pe.set(Y.id,G),pe}),kt("Подключение восстановлено",`Восстановлено подключение к ${T.hostname} (${T.protocol.toUpperCase()}). Осталось ${T.remaining_minutes} мин.`),x.info("app","Connection restored successfully",{connection_id:T.connection_id,hostname:T.hostname,machineId:Y.id,usedExisting:Y.id!==`restored-${T.connection_id}`})}catch(V){x.error("app","Failed to restore connection",{error:V});const Y=await un.handleApiError(V);rt("Ошибка восстановления",Y.userMessage)}},Mi=async T=>{if(T.length===0)return;x.info("app","Restoring multiple connections",{count:T.length,connections:T.map(G=>({id:G.connection_id,hostname:G.hostname}))}),He(!1);let V=0,Y=0;for(const G of T)try{if(x.info("app","Restoring connection",{connection_id:G.connection_id,hostname:G.hostname,protocol:G.protocol}),!G.connection_url)throw new Error("Connection URL is not available");let X=t.find(Ee=>Ee.name.toLowerCase()===G.hostname.toLowerCase()||Ee.ip.toLowerCase()===G.hostname.toLowerCase());X||(X={id:`restored-${G.connection_id}`,name:G.hostname,ip:G.hostname,status:"running",os:"unknown",hypervisor:"unknown",specs:{cpu:"unknown",ram:"unknown",disk:"unknown"},testLinks:[],logs:[]});const pe={machineId:X.id,connectionUrl:G.connection_url,connectionId:G.connection_id,connectedAt:new Date(G.created_at),expiresAt:new Date(G.expires_at)};E(Ee=>{const De=new Map(Ee);return De.set(X.id,pe),De}),V++,x.info("app","Connection restored successfully",{connection_id:G.connection_id,hostname:G.hostname,machineId:X.id}),await new Promise(Ee=>setTimeout(Ee,300))}catch(X){Y++,x.error("app","Failed to restore connection",{connection_id:G.connection_id,hostname:G.hostname,error:X})}V>0&&Y===0?kt("Подключения восстановлены",`Успешно восстановлено ${V} ${V===1?"подключение":"подключений"}`):V>0&&Y>0?kt("Частичное восстановление",`Восстановлено: ${V}, ошибок: ${Y}`):Y>0&&rt("Ошибка восстановления",`Не удалось восстановить ${Y} ${Y===1?"подключение":"подключений"}`),x.info("app","Multiple connections restore completed",{total:T.length,success:V,failed:Y})},Ai=async T=>{x.info("app","Checking machine availability",{machineId:T.id,machineName:T.name,port:T.port,isSavedMachine:T.hypervisor==="Saved"}),C(V=>new Map(V.set(T.id,"checking")));try{const V=T.port,Y=await Qx.checkAvailability(T,V),G=Y.available?"running":"stopped";C(X=>new Map(X.set(T.id,G))),x.info("app","Machine availability check completed",{machineId:T.id,machineName:T.name,port:Y.port,available:Y.available,responseTimeMs:Y.responseTimeMs,newStatus:G})}catch(V){x.error("app","Failed to check machine availability",{machineId:T.id,machineName:T.name,error:V}),C(Y=>new Map(Y.set(T.id,"error")))}},aa=()=>{if(!Ue.isAuthenticated()){I(!1);return}if((w==null?void 0:w.role)==="GUEST"){rt("Access Denied","Your account has limited access (GUEST role). You can only view connections but cannot create new ones. Please contact your administrator to upgrade to USER role."),x.warn("app","Connection attempt blocked for GUEST role",{username:w.username});return}e&&m(!0)},ia=(T,V)=>{if(!Ue.isAuthenticated()){I(!1);return}if((w==null?void 0:w.role)==="GUEST"){rt("Access Denied","Your account has limited access (GUEST role). You can only view connections but cannot create new ones. Please contact your administrator to upgrade to USER role."),x.warn("app","Smart connection attempt blocked for GUEST role",{username:w.username,machineId:T.id});return}if(v.get(T.id)){xt("Already connected",`You are already connected to ${T.name}`);return}Mt.getState().selectMachine(T),m(!0),V&&(kt("Protocol selected",`Using ${V.label} for ${T.name}`),x.info("app","Smart connection initiated",{machineId:T.id,protocol:V.value,description:V.description}))},wr=async(T,V,Y,G)=>{if(e){b(!0);try{const X=await dn.createConnection(e,{username:T,password:V,protocol:Y,...G&&{enableSftp:G.enableSftp,sftpRootDirectory:G.sftpRootDirectory}}),pe=new Date(X.expires_at),Ee=new Date,De=pe.getTime()-Ee.getTime();x.info("app","Connection TTL setup",{machineId:e.id,expiresAt:pe.toISOString(),ttlMinutes:Math.round(De/6e4),ttlMs:De});const dt=setTimeout(()=>{x.info("app","Connection TTL expired, auto-disconnecting",{machineId:e.id,connectionId:X.connection_id,expiresAt:pe.toISOString()}),E(St=>{const lr=new Map(St);return lr.delete(e.id),lr}),xt("Session expired",`Connection to ${e.name} has expired after ${X.ttl_minutes} minutes`)},De),wt={machineId:e.id,connectionUrl:X.connection_url,connectionId:X.connection_id,connectedAt:Ee,expiresAt:pe,ttlTimerId:dt,enableSftp:G==null?void 0:G.enableSftp};E(St=>new Map(St.set(e.id,wt))),kt("Connected",`Connected to ${e.name}. Session expires in ${X.ttl_minutes} minutes`),x.info("app","Connection established",{machineId:e.id,connectionId:X.connection_id,expiresAt:pe.toISOString()})}catch(X){x.error("app","Failed to connect to machine",{error:X});const pe=await un.handleApiError(X);throw rt("Connection failed",pe.userMessage),X}finally{b(!1)}}},Nn=async()=>{if(!e)return;const T=v.get(e.id);if(T!=null&&T.ttlTimerId&&(clearTimeout(T.ttlTimerId),x.debug("app","TTL timer cleared for manual disconnect",{machineId:e.id})),T)try{await dn.deleteConnection(T.connectionId),x.info("app","Connection deleted from server",{machineId:e.id,connectionId:T.connectionId})}catch(V){x.error("app","Failed to delete connection from server",{machineId:e.id,connectionId:T.connectionId,error:V})}E(V=>{const Y=new Map(V);return Y.delete(e.id),Y}),x.info("app","Disconnected from machine",{machineId:e.id})},oa=async(T=60)=>{if(!e)return;const V=v.get(e.id);if(!V){xt("No Active Connection","There is no active connection to extend.");return}try{x.info("app","Extending connection TTL",{machineId:e.id,connectionId:V.connectionId,additionalMinutes:T});const Y=await dn.extendConnectionTTL(V.connectionId,T);E(G=>{const X=new Map(G),pe=X.get(e.id);return pe&&(pe.expiresAt=new Date(Y.new_expires_at)),X}),kt("Connection Extended",`Connection extended by ${Y.additional_minutes} minutes.`),x.info("app","Connection TTL extended successfully",{machineId:e.id,connectionId:V.connectionId,newExpiresAt:Y.new_expires_at})}catch(Y){x.error("app","Failed to extend connection TTL",{machineId:e.id,connectionId:V.connectionId,error:Y});const G=await un.handleApiError(Y);rt("Failed to Extend Connection",G.userMessage)}},ss=T=>{O(T),x.debug("app","Bulk selection changed",{count:T.length})},rn=()=>{O([]),x.debug("app","Bulk selection cleared")},nn=async()=>{if(A.length===0){xt("No Machines Selected","Please select machines to perform health check.");return}const T=Ca.getRoleLimits((w==null?void 0:w.role)||"GUEST");if(A.length>T.maxHealthCheck){rt("Selection Limit Exceeded",`Your role (${w==null?void 0:w.role}) can check max ${T.maxHealthCheck} machines at once. Please reduce selection.`);return}x.info("app","Starting bulk health check",{machineCount:A.length,userRole:w==null?void 0:w.role}),le({total:A.length,checked:0,available:0,unavailable:0,currentMachine:void 0}),H(!0);try{const V=await Ca.bulkHealthCheck({machine_ids:A,timeout:5,check_port:!0});x.info("app","Bulk health check completed",{total:V.total,available:V.available,unavailable:V.unavailable,executionTime:V.execution_time_ms}),le({total:V.total,checked:V.total,available:V.available,unavailable:V.unavailable,currentMachine:void 0}),Ze(V),kt("Health Check Complete",`Checked ${V.total} machines: ${V.available} available, ${V.unavailable} unavailable`),setTimeout(()=>{H(!1),tt(!0),rn()},1500)}catch(V){x.error("app","Bulk health check failed",{error:V});const Y=await un.handleApiError(V);rt("Health Check Failed",Y.userMessage),H(!1)}},as=async()=>{if(!Fe)return;const T=Fe.results.filter(V=>!V.available).map(V=>V.machine_id);if(T.length===0){xt("No Failed Machines","All machines are available.");return}x.info("app","Retrying failed health checks",{count:T.length}),O(T),tt(!1),setTimeout(()=>nn(),500)},sn=()=>{if(A.length===0){xt("No Machines Selected","Please select machines to execute SSH command.");return}if((w==null?void 0:w.role)==="GUEST"){rt("Access Denied","GUEST role cannot execute SSH commands. Please contact your administrator.");return}const T=Ca.getRoleLimits((w==null?void 0:w.role)||"USER");if(A.length>T.maxSSHCommand){rt("Selection Limit Exceeded",`Your role (${w==null?void 0:w.role}) can execute commands on max ${T.maxSSHCommand} machines at once.`);return}vt(!0)},is=async(T,V,Y,G)=>{x.info("app","Starting bulk SSH command",{machineCount:A.length,command:T.substring(0,50),mode:V,userRole:w==null?void 0:w.role}),vt(!1);try{let X=A;const pe={};if(V==="saved"){if(X=A.filter(De=>r.some(dt=>dt.id===De)),X.length===0){xt("No Saved Machines","SSH commands with saved credentials require machines to be saved in the database.");return}if(X.length<A.length){const De=A.length-X.length;x.warn("app",`Skipped ${De} mock/non-saved machines (no saved credentials)`,{selectedMachineIds:A,machineIdsToUse:X})}}else A.forEach(De=>{const dt=t.find(wt=>wt.id===De);if(dt){const wt=r.find(lr=>lr.id===De),St=(wt==null?void 0:wt.hostname)||dt.name;pe[De]=St}});const Ee=await Ca.bulkSSHCommand({machine_ids:X,machine_hostnames:Object.keys(pe).length>0?pe:void 0,command:T,credentials_mode:V,global_credentials:Y,machine_credentials:G,timeout:30});x.info("app","Bulk SSH command completed",{total:Ee.total,success:Ee.success,failed:Ee.failed}),Q(Ee),kt("SSH Command Complete",`Executed on ${Ee.total} machines: ${Ee.success} success, ${Ee.failed} failed`),ye(!0),rn()}catch(X){x.error("app","Bulk SSH command failed",{error:X});const pe=await un.handleApiError(X);rt("SSH Command Failed",pe.userMessage)}},os=async()=>{if(!or)return;const T=or.results.filter(V=>V.status!=="success").map(V=>V.machine_id);if(T.length===0){xt("No Failed Machines","All machines executed successfully.");return}x.info("app","Retrying failed SSH commands",{count:T.length}),O(T),ye(!1),setTimeout(()=>sn(),500)};return S?i.jsxs("div",{className:"flex h-screen bg-kaspersky-bg font-kaspersky",children:[i.jsx(Cx,{onConnect:ia,machineStatuses:N,onMachineSelected:Ai,machineConnections:v,userRole:w==null?void 0:w.role,onBulkSelectionChange:ss}),i.jsxs("div",{className:"flex-1 flex flex-col",children:[i.jsxs("div",{className:"bg-white shadow-sm px-6 py-3 flex justify-between items-center select-none",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[w&&i.jsxs("span",{className:"text-sm text-gray-600",children:["Logged in as: ",i.jsx("strong",{children:w.username})," (",w.role,")"]}),v.size>0&&i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 bg-green-100 border border-green-300 rounded-md",children:[i.jsx("svg",{className:"w-4 h-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})}),i.jsxs("span",{className:"text-sm text-green-700 font-medium",children:[v.size," active connection",v.size!==1?"s":""]})]}),g&&i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 bg-yellow-100 border border-yellow-300 rounded-md",children:[i.jsx("svg",{className:"w-4 h-4 text-yellow-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.732-.833-2.5 0L4.268 18.5c-.77.833.192 2.5 1.732 2.5z"})}),i.jsx("span",{className:"text-sm text-yellow-700 font-medium",children:"Session expires soon"})]})]}),i.jsx("button",{onClick:En,className:"text-sm text-red-600 hover:text-red-700 transition-colors select-none",children:"Logout"})]}),e?i.jsxs("div",{className:"flex-1 flex flex-col",children:[i.jsxs("div",{className:"flex-1 flex",children:[i.jsx("div",{className:`${Kt?"w-1/4":"flex-1"} min-w-[320px] flex flex-col ${Kt?"border-r border-gray-200":""} transition-all duration-500`,children:i.jsx(jx,{machine:e,machineStatus:N.get(e.id),isConnected:!!Kt,connectionInfo:Kt?{connectionId:Kt.connectionId,connectedAt:Kt.connectedAt,expiresAt:Kt.expiresAt}:void 0,onDelete:()=>{Mt.getState().selectMachine(null),kt("Machine deleted","Saved machine has been successfully deleted")},onExtendConnection:oa})}),v.size>0&&i.jsx("div",{className:"flex-1 flex flex-col animate-slide-in relative",children:Array.from(v.entries()).map(([T,V])=>{const Y=(e==null?void 0:e.id)===T,G=Mt.getState().machines.find(X=>X.id===T);return G?i.jsx("div",{className:`absolute inset-0 flex flex-col ${Y?"z-10":"z-0 pointer-events-none opacity-0"} transition-opacity duration-300`,children:i.jsx(zx,{machine:G,connectionUrl:V.connectionUrl,enableSftp:V.enableSftp,onError:X=>{x.error("app","Guacamole viewer error",{error:X,machineId:G.id}),E(pe=>{const Ee=new Map(pe);return Ee.delete(G.id),Ee})},onDisconnect:async()=>{const X=v.get(G.id);if(X!=null&&X.ttlTimerId&&clearTimeout(X.ttlTimerId),X)try{await dn.deleteConnection(X.connectionId),x.info("app","Connection deleted from server",{machineId:G.id,connectionId:X.connectionId})}catch(pe){x.error("app","Failed to delete connection from server",{machineId:G.id,error:pe})}E(pe=>{const Ee=new Map(pe);return Ee.delete(G.id),Ee}),x.info("app","Disconnected from machine",{machineId:G.id})}})},`connection-${T}-${V.connectionId}`):null})})]}),i.jsx(_x,{machine:e,onConnect:aa,isConnected:!!Kt,onDisconnect:Nn,userRole:w==null?void 0:w.role})]}):i.jsx("div",{className:"flex-1 flex items-center justify-center text-kaspersky-text select-none",children:i.jsx("p",{children:"Select a machine from the sidebar"})})]}),i.jsx(Dx,{isOpen:d,machine:e,onClose:()=>m(!1),onSubmit:wr}),i.jsx(Mx,{isOpen:n,onClose:()=>s(!1),onSuccess:()=>{kt("Machine saved","Machine has been successfully added to your profile"),l()}}),i.jsx(Ax,{isOpen:a,onClose:()=>{},onSuccess:()=>{kt("Machine saved","Machine has been successfully added to your profile"),l()}}),i.jsx(Px,{isOpen:Be,connections:mt,onRestore:Pi,onRestoreMultiple:Mi,onClose:()=>He(!1),onSkip:()=>He(!1)}),i.jsx(Bx,{selectedCount:A.length,onHealthCheck:nn,onSSHCommand:sn,onClearSelection:rn,userRole:w==null?void 0:w.role}),i.jsx(Vx,{isOpen:R,progress:de,isComplete:de.checked===de.total&&de.total>0,onClose:()=>{H(!1),tt(!0)}}),i.jsx(Kx,{isOpen:oe,results:Fe,onClose:()=>{tt(!1),Ze(null)},onRetryFailed:as}),i.jsx(Wx,{isOpen:Vt,selectedMachines:A.map(T=>t.find(V=>V.id===T)).filter(T=>T!==void 0),onClose:()=>vt(!1),onExecute:is,userRole:w==null?void 0:w.role}),i.jsx(Yx,{isOpen:ue,results:or,onClose:()=>{ye(!1),Q(null)},onRetryFailed:os})]}):i.jsx(Tx,{onLogin:na})}function qx(){return i.jsx(Fx,{children:i.jsx(Ux,{children:i.jsx(Xx,{})})})}class Jr{static generateNonce(){const t=new Uint8Array(16);return crypto.getRandomValues(t),Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}static setNonce(t){this.nonce=t}static getNonce(){return this.nonce}static getConfig(){const t=this.PRODUCTION_CONFIG,r="https://mc.exbytestudios.com";try{const n=new URL(r),s=n.protocol.replace(":",""),a=`${s}://${n.hostname}${n.port?":"+n.port:""}`,u=`${s==="https"?"wss":"ws"}://${n.hostname}${n.port?":"+n.port:""}`;t.connectSrc.includes(a)||(t.connectSrc=[...t.connectSrc,a,u]),t.frameSrc.includes(a)||(t.frameSrc=[...t.frameSrc,a]),console.log("✅ CSP updated with API domain:",a)}catch(n){console.error("❌ Failed to parse VITE_API_URL for CSP:",n)}return t}static generateCSPString(t=this.getConfig()){const r=s=>s.map(a=>a==="'nonce-{NONCE}'"&&this.nonce?`'nonce-${this.nonce}'`:a);return[`default-src ${r(t.defaultSrc).join(" ")};`,`script-src ${r(t.scriptSrc).join(" ")};`,`style-src ${r(t.styleSrc).join(" ")};`,`img-src ${r(t.imgSrc).join(" ")};`,`font-src ${r(t.fontSrc).join(" ")};`,`connect-src ${r(t.connectSrc).join(" ")};`,`frame-src ${r(t.frameSrc).join(" ")};`,`object-src ${r(t.objectSrc).join(" ")};`,`base-uri ${r(t.baseUri).join(" ")};`,`form-action ${r(t.formAction).join(" ")};`,`frame-ancestors ${r(t.frameAncestors).join(" ")};`].join(" ").trim()}static applyCSP(t=this.getConfig()){if(typeof document>"u")return;this.nonce||(this.nonce=this.generateNonce());const r=document.querySelector('meta[http-equiv="Content-Security-Policy"]');r&&r.remove();const n=document.createElement("meta");if(n.setAttribute("http-equiv","Content-Security-Policy"),n.setAttribute("content",this.generateCSPString(t)),document.head.appendChild(n),this.nonce){const s=document.createElement("meta");s.setAttribute("name","csp-nonce"),s.setAttribute("content",this.nonce),document.head.appendChild(s)}}static setupCSPReporting(){typeof document>"u"||document.addEventListener("securitypolicyviolation",t=>{console.warn("CSP Violation:",{directive:t.violatedDirective,blockedURI:t.blockedURI,lineNumber:t.lineNumber,columnNumber:t.columnNumber,sourceFile:t.sourceFile,sample:t.sample})})}static validateConfig(t){const r=[];return t.scriptSrc.includes("'unsafe-inline'")&&r.push("script-src contains 'unsafe-inline' - security risk"),t.scriptSrc.includes("'unsafe-eval'")&&r.push("script-src contains 'unsafe-eval' - security risk"),(t.objectSrc.includes("'self'")||t.objectSrc.length===0)&&r.push("object-src should be 'none' for security"),t.frameAncestors.includes("'self'")&&r.push("frame-ancestors should be 'none' for clickjacking protection"),r}}ke(Jr,"nonce",null),ke(Jr,"DEVELOPMENT_CONFIG",{defaultSrc:["'self'"],scriptSrc:["'self'","'unsafe-inline'","'unsafe-eval'","http://localhost:*"],styleSrc:["'self'","'unsafe-inline'","http://localhost:*"],imgSrc:["'self'","data:","blob:","http://localhost:*"],fontSrc:["'self'","data:","http://localhost:*"],connectSrc:["'self'","http://localhost:*","https://localhost:*","ws://localhost:*","wss://localhost:*"],frameSrc:["'self'","http://localhost:8080","https://localhost:8080"],objectSrc:["'none'"],baseUri:["'self'"],formAction:["'self'"],frameAncestors:["'none'"]}),ke(Jr,"PRODUCTION_CONFIG",{defaultSrc:["'self'"],scriptSrc:["'self'","'nonce-{NONCE}'"],styleSrc:["'self'","'nonce-{NONCE}'","https://fonts.googleapis.com"],imgSrc:["'self'","data:","blob:"],fontSrc:["'self'","data:","https://fonts.gstatic.com"],connectSrc:["'self'","https://mc.exbytestudios.com","wss://mc.exbytestudios.com"],frameSrc:["'self'","https://mc.exbytestudios.com"],objectSrc:["'none'"],baseUri:["'self'"],formAction:["'self'"],frameAncestors:["'none'"]});Jr.generateCSPString;Jr.applyCSP;Jr.setupCSPReporting;console.log("🚀 main.tsx загружается...");console.log("🔒 Применяем Content Security Policy...");Jr.applyCSP();Jr.setupCSPReporting();try{const e=co.createRoot(document.getElementById("root"));console.log("✅ ReactDOM.createRoot успешно создан"),e.render(i.jsx(_u.StrictMode,{children:i.jsx(qx,{})})),console.log("✅ App успешно отрендерен")}catch(e){console.error("❌ Ошибка при рендеринге:",e)}export{Ge as B,ui as C,qm as I,Oa as P,C0 as T,Zt as X,yu as a,ze as c,i as j,x as l,$ as r};