(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();function ac(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yo={exports:{}},il={},Zo={exports:{}},D={};/** * @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 tr=Symbol.for("react.element"),cc=Symbol.for("react.portal"),dc=Symbol.for("react.fragment"),fc=Symbol.for("react.strict_mode"),hc=Symbol.for("react.profiler"),pc=Symbol.for("react.provider"),mc=Symbol.for("react.context"),gc=Symbol.for("react.forward_ref"),vc=Symbol.for("react.suspense"),xc=Symbol.for("react.memo"),yc=Symbol.for("react.lazy"),Us=Symbol.iterator;function jc(e){return e===null||typeof e!="object"?null:(e=Us&&e[Us]||e["@@iterator"],typeof e=="function"?e:null)}var Jo={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qo=Object.assign,bo={};function pn(e,t,n){this.props=e,this.context=t,this.refs=bo,this.updater=n||Jo}pn.prototype.isReactComponent={};pn.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")};pn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function eu(){}eu.prototype=pn.prototype;function Vi(e,t,n){this.props=e,this.context=t,this.refs=bo,this.updater=n||Jo}var Wi=Vi.prototype=new eu;Wi.constructor=Vi;qo(Wi,pn.prototype);Wi.isPureReactComponent=!0;var As=Array.isArray,tu=Object.prototype.hasOwnProperty,Qi={current:null},nu={key:!0,ref:!0,__self:!0,__source:!0};function ru(e,t,n){var r,l={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)tu.call(t,r)&&!nu.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(u===1)l.children=n;else if(1>>1,J=k[Q];if(0>>1;Ql(F,L))Il(U,F)?(k[Q]=U,k[I]=L,Q=I):(k[Q]=F,k[Ge]=L,Q=Ge);else if(Il(U,L))k[Q]=U,k[I]=L,Q=I;else break e}}return P}function l(k,P){var L=k.sortIndex-P.sortIndex;return L!==0?L:k.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,u=s.now();e.unstable_now=function(){return s.now()-u}}var a=[],d=[],f=1,c=null,g=3,x=!1,v=!1,w=!1,R=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(k){for(var P=n(d);P!==null;){if(P.callback===null)r(d);else if(P.startTime<=k)r(d),P.sortIndex=P.expirationTime,t(a,P);else break;P=n(d)}}function y(k){if(w=!1,m(k),!v)if(n(a)!==null)v=!0,fe(S);else{var P=n(d);P!==null&&te(y,P.startTime-k)}}function S(k,P){v=!1,w&&(w=!1,p(E),E=-1),x=!0;var L=g;try{for(m(P),c=n(a);c!==null&&(!(c.expirationTime>P)||k&&!le());){var Q=c.callback;if(typeof Q=="function"){c.callback=null,g=c.priorityLevel;var J=Q(c.expirationTime<=P);P=e.unstable_now(),typeof J=="function"?c.callback=J:c===n(a)&&r(a),m(P)}else r(a);c=n(a)}if(c!==null)var At=!0;else{var Ge=n(d);Ge!==null&&te(y,Ge.startTime-P),At=!1}return At}finally{c=null,g=L,x=!1}}var _=!1,C=null,E=-1,A=5,T=-1;function le(){return!(e.unstable_now()-Tk||125Q?(k.sortIndex=L,t(d,k),n(a)===null&&k===n(d)&&(w?(p(E),E=-1):w=!0,te(y,L-Q))):(k.sortIndex=J,t(a,k),v||x||(v=!0,fe(S))),k},e.unstable_shouldYield=le,e.unstable_wrapCallback=function(k){var P=g;return function(){var L=g;g=P;try{return k.apply(this,arguments)}finally{g=L}}}})(uu);ou.exports=uu;var Fc=ou.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 Dc=z,Ne=Fc;function j(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yl=Object.prototype.hasOwnProperty,Oc=/^[: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]*$/,Bs={},Vs={};function Rc(e){return Yl.call(Vs,e)?!0:Yl.call(Bs,e)?!1:Oc.test(e)?Vs[e]=!0:(Bs[e]=!0,!1)}function Mc(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ic(e,t,n,r){if(t===null||typeof t>"u"||Mc(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ge(e,t,n,r,l,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var oe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){oe[e]=new ge(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];oe[t]=new ge(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){oe[e]=new ge(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){oe[e]=new ge(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){oe[e]=new ge(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){oe[e]=new ge(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){oe[e]=new ge(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){oe[e]=new ge(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){oe[e]=new ge(e,5,!1,e.toLowerCase(),null,!1,!1)});var Xi=/[\-:]([a-z])/g;function Gi(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(Xi,Gi);oe[t]=new ge(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(Xi,Gi);oe[t]=new ge(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(Xi,Gi);oe[t]=new ge(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){oe[e]=new ge(e,1,!1,e.toLowerCase(),null,!1,!1)});oe.xlinkHref=new ge("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){oe[e]=new ge(e,1,!1,e.toLowerCase(),null,!0,!0)});function Yi(e,t,n,r){var l=oe.hasOwnProperty(t)?oe[t]:null;(l!==null?l.type!==0:r||!(2u||l[s]!==i[u]){var a=` `+l[s].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=s&&0<=u);break}}}finally{_l=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Nn(e):""}function $c(e){switch(e.tag){case 5:return Nn(e.type);case 16:return Nn("Lazy");case 13:return Nn("Suspense");case 19:return Nn("SuspenseList");case 0:case 2:case 15:return e=Nl(e.type,!1),e;case 11:return e=Nl(e.type.render,!1),e;case 1:return e=Nl(e.type,!0),e;default:return""}}function bl(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 Vt:return"Fragment";case Bt:return"Portal";case Zl:return"Profiler";case Zi:return"StrictMode";case Jl:return"Suspense";case ql:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case du:return(e.displayName||"Context")+".Consumer";case cu:return(e._context.displayName||"Context")+".Provider";case Ji:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qi:return t=e.displayName||null,t!==null?t:bl(e.type)||"Memo";case st:t=e._payload,e=e._init;try{return bl(e(t))}catch{}}return null}function Uc(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 bl(t);case 8:return t===Zi?"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 jt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function hu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ac(e){var t=hu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ur(e){e._valueTracker||(e._valueTracker=Ac(e))}function pu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=hu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Rr(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 ei(e,t){var n=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Qs(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=jt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function mu(e,t){t=t.checked,t!=null&&Yi(e,"checked",t,!1)}function ti(e,t){mu(e,t);var n=jt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ni(e,t.type,n):t.hasOwnProperty("defaultValue")&&ni(e,t.type,jt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ks(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ni(e,t,n){(t!=="number"||Rr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Cn=Array.isArray;function en(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=ar.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Un(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zn={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},Hc=["Webkit","ms","Moz","O"];Object.keys(zn).forEach(function(e){Hc.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zn[t]=zn[e]})});function yu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||zn.hasOwnProperty(e)&&zn[e]?(""+t).trim():t+"px"}function ju(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=yu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Bc=G({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 ii(e,t){if(t){if(Bc[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(j(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(j(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(j(61))}if(t.style!=null&&typeof t.style!="object")throw Error(j(62))}}function si(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 oi=null;function bi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ui=null,tn=null,nn=null;function Ys(e){if(e=lr(e)){if(typeof ui!="function")throw Error(j(280));var t=e.stateNode;t&&(t=cl(t),ui(e.stateNode,e.type,t))}}function wu(e){tn?nn?nn.push(e):nn=[e]:tn=e}function Su(){if(tn){var e=tn,t=nn;if(nn=tn=null,Ys(e),t)for(e=0;e>>=0,e===0?32:31-(bc(e)/ed|0)|0}var cr=64,dr=4194304;function En(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 Ur(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var u=s&~l;u!==0?r=En(u):(i&=s,i!==0&&(r=En(i)))}else s=n&~l,s!==0?r=En(s):i!==0&&(r=En(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function nr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ue(t),e[t]=n}function ld(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Ln),lo=" ",io=!1;function Bu(e,t){switch(e){case"keyup":return Fd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wt=!1;function Od(e,t){switch(e){case"compositionend":return Vu(t);case"keypress":return t.which!==32?null:(io=!0,lo);case"textInput":return e=t.data,e===lo&&io?null:e;default:return null}}function Rd(e,t){if(Wt)return e==="compositionend"||!os&&Bu(e,t)?(e=Au(),Cr=ls=ct=null,Wt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ao(n)}}function Xu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gu(){for(var e=window,t=Rr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rr(e.document)}return t}function us(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 Wd(e){var t=Gu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Xu(n.ownerDocument.documentElement,n)){if(r!==null&&us(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=co(n,i);var s=co(n,r);l&&s&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Qt=null,pi=null,Dn=null,mi=!1;function fo(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mi||Qt==null||Qt!==Rr(r)||(r=Qt,"selectionStart"in r&&us(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dn&&Qn(Dn,r)||(Dn=r,r=Br(pi,"onSelect"),0Gt||(e.current=wi[Gt],wi[Gt]=null,Gt--)}function H(e,t){Gt++,wi[Gt]=e.current,e.current=t}var wt={},de=kt(wt),ye=kt(!1),Dt=wt;function un(e,t){var n=e.type.contextTypes;if(!n)return wt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function je(e){return e=e.childContextTypes,e!=null}function Wr(){V(ye),V(de)}function yo(e,t,n){if(de.current!==wt)throw Error(j(168));H(de,t),H(ye,n)}function ra(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(j(108,Uc(e)||"Unknown",l));return G({},n,r)}function Qr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wt,Dt=de.current,H(de,e),H(ye,ye.current),!0}function jo(e,t,n){var r=e.stateNode;if(!r)throw Error(j(169));n?(e=ra(e,t,Dt),r.__reactInternalMemoizedMergedChildContext=e,V(ye),V(de),H(de,e)):V(ye),H(ye,n)}var Ze=null,dl=!1,Ul=!1;function la(e){Ze===null?Ze=[e]:Ze.push(e)}function nf(e){dl=!0,la(e)}function _t(){if(!Ul&&Ze!==null){Ul=!0;var e=0,t=$;try{var n=Ze;for($=1;e>=s,l-=s,Je=1<<32-Ue(t)+l|n<E?(A=C,C=null):A=C.sibling;var T=g(p,C,m[E],y);if(T===null){C===null&&(C=A);break}e&&C&&T.alternate===null&&t(p,C),h=i(T,h,E),_===null?S=T:_.sibling=T,_=T,C=A}if(E===m.length)return n(p,C),W&&Ct(p,E),S;if(C===null){for(;EE?(A=C,C=null):A=C.sibling;var le=g(p,C,T.value,y);if(le===null){C===null&&(C=A);break}e&&C&&le.alternate===null&&t(p,C),h=i(le,h,E),_===null?S=le:_.sibling=le,_=le,C=A}if(T.done)return n(p,C),W&&Ct(p,E),S;if(C===null){for(;!T.done;E++,T=m.next())T=c(p,T.value,y),T!==null&&(h=i(T,h,E),_===null?S=T:_.sibling=T,_=T);return W&&Ct(p,E),S}for(C=r(p,C);!T.done;E++,T=m.next())T=x(C,p,E,T.value,y),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?E:T.key),h=i(T,h,E),_===null?S=T:_.sibling=T,_=T);return e&&C.forEach(function(Pe){return t(p,Pe)}),W&&Ct(p,E),S}function R(p,h,m,y){if(typeof m=="object"&&m!==null&&m.type===Vt&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case or:e:{for(var S=m.key,_=h;_!==null;){if(_.key===S){if(S=m.type,S===Vt){if(_.tag===7){n(p,_.sibling),h=l(_,m.props.children),h.return=p,p=h;break e}}else if(_.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===st&&ko(S)===_.type){n(p,_.sibling),h=l(_,m.props),h.ref=Sn(p,_,m),h.return=p,p=h;break e}n(p,_);break}else t(p,_);_=_.sibling}m.type===Vt?(h=Ft(m.props.children,p.mode,y,m.key),h.return=p,p=h):(y=Or(m.type,m.key,m.props,null,p.mode,y),y.ref=Sn(p,h,m),y.return=p,p=y)}return s(p);case Bt:e:{for(_=m.key;h!==null;){if(h.key===_)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){n(p,h.sibling),h=l(h,m.children||[]),h.return=p,p=h;break e}else{n(p,h);break}else t(p,h);h=h.sibling}h=Xl(m,p.mode,y),h.return=p,p=h}return s(p);case st:return _=m._init,R(p,h,_(m._payload),y)}if(Cn(m))return v(p,h,m,y);if(vn(m))return w(p,h,m,y);xr(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(n(p,h.sibling),h=l(h,m),h.return=p,p=h):(n(p,h),h=Kl(m,p.mode,y),h.return=p,p=h),s(p)):n(p,h)}return R}var cn=ua(!0),aa=ua(!1),Gr=kt(null),Yr=null,Jt=null,fs=null;function hs(){fs=Jt=Yr=null}function ps(e){var t=Gr.current;V(Gr),e._currentValue=t}function _i(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ln(e,t){Yr=e,fs=Jt=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(xe=!0),e.firstContext=null)}function De(e){var t=e._currentValue;if(fs!==e)if(e={context:e,memoizedValue:t,next:null},Jt===null){if(Yr===null)throw Error(j(308));Jt=e,Yr.dependencies={lanes:0,firstContext:e}}else Jt=Jt.next=e;return t}var zt=null;function ms(e){zt===null?zt=[e]:zt.push(e)}function ca(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,ms(t)):(n.next=l.next,l.next=n),t.interleaved=n,nt(e,r)}function nt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ot=!1;function gs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function da(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 be(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function gt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,O&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,nt(e,n)}return l=r.interleaved,l===null?(t.next=t,ms(r)):(t.next=l.next,l.next=t),r.interleaved=t,nt(e,n)}function Pr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ts(e,n)}}function _o(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Zr(e,t,n,r){var l=e.updateQueue;ot=!1;var i=l.firstBaseUpdate,s=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var a=u,d=a.next;a.next=null,s===null?i=d:s.next=d,s=a;var f=e.alternate;f!==null&&(f=f.updateQueue,u=f.lastBaseUpdate,u!==s&&(u===null?f.firstBaseUpdate=d:u.next=d,f.lastBaseUpdate=a))}if(i!==null){var c=l.baseState;s=0,f=d=a=null,u=i;do{var g=u.lane,x=u.eventTime;if((r&g)===g){f!==null&&(f=f.next={eventTime:x,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var v=e,w=u;switch(g=t,x=n,w.tag){case 1:if(v=w.payload,typeof v=="function"){c=v.call(x,c,g);break e}c=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,g=typeof v=="function"?v.call(x,c,g):v,g==null)break e;c=G({},c,g);break e;case 2:ot=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,g=l.effects,g===null?l.effects=[u]:g.push(u))}else x={eventTime:x,lane:g,tag:u.tag,payload:u.payload,callback:u.callback,next:null},f===null?(d=f=x,a=c):f=f.next=x,s|=g;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;g=u,u=g.next,g.next=null,l.lastBaseUpdate=g,l.shared.pending=null}}while(!0);if(f===null&&(a=c),l.baseState=a,l.firstBaseUpdate=d,l.lastBaseUpdate=f,t=l.shared.interleaved,t!==null){l=t;do s|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Mt|=s,e.lanes=s,e.memoizedState=c}}function No(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Hl.transition;Hl.transition={};try{e(!1),t()}finally{$=n,Hl.transition=r}}function Pa(){return Oe().memoizedState}function of(e,t,n){var r=xt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},za(e))Ta(t,n);else if(n=ca(e,t,n,r),n!==null){var l=pe();Ae(n,e,r,l),La(n,t,r)}}function uf(e,t,n){var r=xt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(za(e))Ta(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,u=i(s,n);if(l.hasEagerState=!0,l.eagerState=u,He(u,s)){var a=t.interleaved;a===null?(l.next=l,ms(t)):(l.next=a.next,a.next=l),t.interleaved=l;return}}catch{}finally{}n=ca(e,t,l,r),n!==null&&(l=pe(),Ae(n,e,r,l),La(n,t,r))}}function za(e){var t=e.alternate;return e===X||t!==null&&t===X}function Ta(e,t){On=qr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function La(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ts(e,n)}}var br={readContext:De,useCallback:ue,useContext:ue,useEffect:ue,useImperativeHandle:ue,useInsertionEffect:ue,useLayoutEffect:ue,useMemo:ue,useReducer:ue,useRef:ue,useState:ue,useDebugValue:ue,useDeferredValue:ue,useTransition:ue,useMutableSource:ue,useSyncExternalStore:ue,useId:ue,unstable_isNewReconciler:!1},af={readContext:De,useCallback:function(e,t){return We().memoizedState=[e,t===void 0?null:t],e},useContext:De,useEffect:Eo,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Tr(4194308,4,ka.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Tr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Tr(4,2,e,t)},useMemo:function(e,t){var n=We();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=We();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=of.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=We();return e={current:e},t.memoizedState=e},useState:Co,useDebugValue:_s,useDeferredValue:function(e){return We().memoizedState=e},useTransition:function(){var e=Co(!1),t=e[0];return e=sf.bind(null,e[1]),We().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=X,l=We();if(W){if(n===void 0)throw Error(j(407));n=n()}else{if(n=t(),re===null)throw Error(j(349));Rt&30||ma(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Eo(va.bind(null,r,i,e),[e]),r.flags|=2048,bn(9,ga.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=We(),t=re.identifierPrefix;if(W){var n=qe,r=Je;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Jn++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Qe]=t,e[Gn]=r,Ha(e,t,!1,!1),t.stateNode=e;e:{switch(s=si(n,r),n){case"dialog":B("cancel",e),B("close",e),l=r;break;case"iframe":case"object":case"embed":B("load",e),l=r;break;case"video":case"audio":for(l=0;lhn&&(t.flags|=128,r=!0,kn(i,!1),t.lanes=4194304)}else{if(!r)if(e=Jr(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!W)return ae(t),null}else 2*Z()-i.renderingStartTime>hn&&n!==1073741824&&(t.flags|=128,r=!0,kn(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Z(),t.sibling=null,n=K.current,H(K,r?n&1|2:n&1),t):(ae(t),null);case 22:case 23:return Ts(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Se&1073741824&&(ae(t),t.subtreeFlags&6&&(t.flags|=8192)):ae(t),null;case 24:return null;case 25:return null}throw Error(j(156,t.tag))}function vf(e,t){switch(cs(t),t.tag){case 1:return je(t.type)&&Wr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return dn(),V(ye),V(de),ys(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return xs(t),null;case 13:if(V(K),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));an()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(K),null;case 4:return dn(),null;case 10:return ps(t.type._context),null;case 22:case 23:return Ts(),null;case 24:return null;default:return null}}var jr=!1,ce=!1,xf=typeof WeakSet=="function"?WeakSet:Set,N=null;function qt(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Y(e,t,r)}else n.current=null}function Di(e,t,n){try{n()}catch(r){Y(e,t,r)}}var $o=!1;function yf(e,t){if(gi=Ar,e=Gu(),us(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,u=-1,a=-1,d=0,f=0,c=e,g=null;t:for(;;){for(var x;c!==n||l!==0&&c.nodeType!==3||(u=s+l),c!==i||r!==0&&c.nodeType!==3||(a=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(x=c.firstChild)!==null;)g=c,c=x;for(;;){if(c===e)break t;if(g===n&&++d===l&&(u=s),g===i&&++f===r&&(a=s),(x=c.nextSibling)!==null)break;c=g,g=c.parentNode}c=x}n=u===-1||a===-1?null:{start:u,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(vi={focusedElem:e,selectionRange:n},Ar=!1,N=t;N!==null;)if(t=N,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,N=e;else for(;N!==null;){t=N;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,R=v.memoizedState,p=t.stateNode,h=p.getSnapshotBeforeUpdate(t.elementType===t.type?w:Me(t.type,w),R);p.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(y){Y(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,N=e;break}N=t.return}return v=$o,$o=!1,v}function Rn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&Di(t,n,i)}l=l.next}while(l!==r)}}function pl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Oi(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Wa(e){var t=e.alternate;t!==null&&(e.alternate=null,Wa(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Qe],delete t[Gn],delete t[ji],delete t[ef],delete t[tf])),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 Qa(e){return e.tag===5||e.tag===3||e.tag===4}function Uo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qa(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 Ri(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vr));else if(r!==4&&(e=e.child,e!==null))for(Ri(e,t,n),e=e.sibling;e!==null;)Ri(e,t,n),e=e.sibling}function Mi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Mi(e,t,n),e=e.sibling;e!==null;)Mi(e,t,n),e=e.sibling}var ie=null,Ie=!1;function it(e,t,n){for(n=n.child;n!==null;)Ka(e,t,n),n=n.sibling}function Ka(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount=="function")try{Ke.onCommitFiberUnmount(sl,n)}catch{}switch(n.tag){case 5:ce||qt(n,t);case 6:var r=ie,l=Ie;ie=null,it(e,t,n),ie=r,Ie=l,ie!==null&&(Ie?(e=ie,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ie.removeChild(n.stateNode));break;case 18:ie!==null&&(Ie?(e=ie,n=n.stateNode,e.nodeType===8?$l(e.parentNode,n):e.nodeType===1&&$l(e,n),Vn(e)):$l(ie,n.stateNode));break;case 4:r=ie,l=Ie,ie=n.stateNode.containerInfo,Ie=!0,it(e,t,n),ie=r,Ie=l;break;case 0:case 11:case 14:case 15:if(!ce&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Di(n,t,s),l=l.next}while(l!==r)}it(e,t,n);break;case 1:if(!ce&&(qt(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){Y(n,t,u)}it(e,t,n);break;case 21:it(e,t,n);break;case 22:n.mode&1?(ce=(r=ce)||n.memoizedState!==null,it(e,t,n),ce=r):it(e,t,n);break;default:it(e,t,n)}}function Ao(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new xf),t.forEach(function(r){var l=Pf.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Re(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=s),r&=~i}if(r=l,r=Z()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*wf(r/1960))-r,10e?16:e,dt===null)var r=!1;else{if(e=dt,dt=null,nl=0,O&6)throw Error(j(331));var l=O;for(O|=4,N=e.current;N!==null;){var i=N,s=i.child;if(N.flags&16){var u=i.deletions;if(u!==null){for(var a=0;aZ()-Ps?Lt(e,0):Es|=n),we(e,t)}function ec(e,t){t===0&&(e.mode&1?(t=dr,dr<<=1,!(dr&130023424)&&(dr=4194304)):t=1);var n=pe();e=nt(e,t),e!==null&&(nr(e,t,n),we(e,n))}function Ef(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ec(e,n)}function Pf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(j(314))}r!==null&&r.delete(t),ec(e,n)}var tc;tc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ye.current)xe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return xe=!1,mf(e,t,n);xe=!!(e.flags&131072)}else xe=!1,W&&t.flags&1048576&&ia(t,Xr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Lr(e,t),e=t.pendingProps;var l=un(t,de.current);ln(t,n),l=ws(null,t,r,e,l,n);var i=Ss();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,je(r)?(i=!0,Qr(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,gs(t),l.updater=hl,t.stateNode=l,l._reactInternals=t,Ci(t,r,e,n),t=zi(null,t,r,!0,i,n)):(t.tag=0,W&&i&&as(t),he(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Lr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Tf(r),e=Me(r,e),l){case 0:t=Pi(null,t,r,e,n);break e;case 1:t=Ro(null,t,r,e,n);break e;case 11:t=Do(null,t,r,e,n);break e;case 14:t=Oo(null,t,r,Me(r.type,e),n);break e}throw Error(j(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Me(r,l),Pi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Me(r,l),Ro(e,t,r,l,n);case 3:e:{if($a(t),e===null)throw Error(j(387));r=t.pendingProps,i=t.memoizedState,l=i.element,da(e,t),Zr(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=fn(Error(j(423)),t),t=Mo(e,t,r,n,l);break e}else if(r!==l){l=fn(Error(j(424)),t),t=Mo(e,t,r,n,l);break e}else for(ke=mt(t.stateNode.containerInfo.firstChild),_e=t,W=!0,$e=null,n=aa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(an(),r===l){t=rt(e,t,n);break e}he(e,t,r,n)}t=t.child}return t;case 5:return fa(t),e===null&&ki(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,s=l.children,xi(r,l)?s=null:i!==null&&xi(r,i)&&(t.flags|=32),Ia(e,t),he(e,t,s,n),t.child;case 6:return e===null&&ki(t),null;case 13:return Ua(e,t,n);case 4:return vs(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=cn(t,null,r,n):he(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Me(r,l),Do(e,t,r,l,n);case 7:return he(e,t,t.pendingProps,n),t.child;case 8:return he(e,t,t.pendingProps.children,n),t.child;case 12:return he(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,s=l.value,H(Gr,r._currentValue),r._currentValue=s,i!==null)if(He(i.value,s)){if(i.children===l.children&&!ye.current){t=rt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var u=i.dependencies;if(u!==null){s=i.child;for(var a=u.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=be(-1,n&-n),a.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var f=d.pending;f===null?a.next=a:(a.next=f.next,f.next=a),d.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),_i(i.return,n,t),u.lanes|=n;break}a=a.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(j(341));s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),_i(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}he(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,ln(t,n),l=De(l),r=r(l),t.flags|=1,he(e,t,r,n),t.child;case 14:return r=t.type,l=Me(r,t.pendingProps),l=Me(r.type,l),Oo(e,t,r,l,n);case 15:return Ra(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Me(r,l),Lr(e,t),t.tag=1,je(r)?(e=!0,Qr(t)):e=!1,ln(t,n),Fa(t,r,l),Ci(t,r,l,n),zi(null,t,r,!0,e,n);case 19:return Aa(e,t,n);case 22:return Ma(e,t,n)}throw Error(j(156,t.tag))};function nc(e,t){return zu(e,t)}function zf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Le(e,t,n,r){return new zf(e,t,n,r)}function Fs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Tf(e){if(typeof e=="function")return Fs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ji)return 11;if(e===qi)return 14}return 2}function yt(e,t){var n=e.alternate;return n===null?(n=Le(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Or(e,t,n,r,l,i){var s=2;if(r=e,typeof e=="function")Fs(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Vt:return Ft(n.children,l,i,t);case Zi:s=8,l|=8;break;case Zl:return e=Le(12,n,t,l|2),e.elementType=Zl,e.lanes=i,e;case Jl:return e=Le(13,n,t,l),e.elementType=Jl,e.lanes=i,e;case ql:return e=Le(19,n,t,l),e.elementType=ql,e.lanes=i,e;case fu:return gl(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case cu:s=10;break e;case du:s=9;break e;case Ji:s=11;break e;case qi:s=14;break e;case st:s=16,r=null;break e}throw Error(j(130,e==null?e:typeof e,""))}return t=Le(s,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Ft(e,t,n,r){return e=Le(7,e,r,t),e.lanes=n,e}function gl(e,t,n,r){return e=Le(22,e,r,t),e.elementType=fu,e.lanes=n,e.stateNode={isHidden:!1},e}function Kl(e,t,n){return e=Le(6,e,null,t),e.lanes=n,e}function Xl(e,t,n){return t=Le(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Lf(e,t,n,r,l){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=El(0),this.expirationTimes=El(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=El(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ds(e,t,n,r,l,i,s,u,a){return e=new Lf(e,t,n,u,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Le(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},gs(i),e}function Ff(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sc)}catch(e){console.error(e)}}sc(),su.exports=Ce;var If=su.exports,Go=If;Gl.createRoot=Go.createRoot,Gl.hydrateRoot=Go.hydrateRoot;const oc=["HyperLiquid","Bitget","Binance","OKX"];function Hi(e){return e==null||e<=0?"-":e>=100?e.toFixed(2):e>=1?e.toFixed(4):e.toFixed(6)}function Bi(e){return e==null?"":e>0?"text-green":e<0?"text-red":""}function $f(){const[e,t]=z.useState("--:--:--"),[n,r]=z.useState("● 未连接"),[l,i]=z.useState(!1),[s,u]=z.useState(""),[a,d]=z.useState([]),[f,c]=z.useState(""),[g,x]=z.useState([]),[v,w]=z.useState([]),[R,p]=z.useState([]),[h,m]=z.useState({}),[y,S]=z.useState([]),[_,C]=z.useState([]),[E,A]=z.useState([]),[T,le]=z.useState([]),[Pe,Be]=z.useState([]),[Nt,M]=z.useState([]),fe=z.useRef({});z.useEffect(()=>{const F=()=>t(new Date().toLocaleTimeString("zh-CN",{hour12:!1}));F();const I=setInterval(F,1e3);return()=>clearInterval(I)},[]),z.useEffect(()=>{let F=new EventSource("/events");return F.addEventListener("connected",()=>{r("● 已连接"),i(!0)}),F.onerror=()=>{r("● 已断开 (重连中...)"),i(!1),setTimeout(()=>{F=new EventSource("/events")},3e3)},F.onmessage=I=>{try{const U=JSON.parse(I.data);switch(U.event){case"prices":L(U.data);break;case"arb":x(U.data||[]);break;case"positions":w(U.data||[]);break;case"blacklist":p(U.data||[]);break;case"momentum":C(U.data||[]);break;case"trend":A(U.data||[]);break;case"cumulative":Be(U.data||[]);break;case"stats":m(U.data||{}),U.data&&U.data.blacklist&&p(U.data.blacklist);break;case"trade_close":te();break}}catch{}},()=>F.close()},[]);const te=z.useCallback(async()=>{try{const I=await(await fetch("/api/trades")).json();S(I.trades||[])}catch{}},[]);z.useEffect(()=>{te();const F=setInterval(te,1e4);return()=>clearInterval(F)},[te]);const k=z.useCallback(async()=>{try{const I=await(await fetch("/api/trend-history")).json();le(I.events||[])}catch{}},[]);z.useEffect(()=>{k();const F=setInterval(k,5e3);return()=>clearInterval(F)},[k]);const P=z.useCallback(async()=>{try{const I=await(await fetch("/api/cm-history")).json();M(I.events||[])}catch{}},[]);z.useEffect(()=>{P();const F=setInterval(P,5e3);return()=>clearInterval(F)},[P]);function L(F){if(!F||F.length===0)return;d(F),c(new Date().toLocaleTimeString("zh-CN",{hour12:!1}));const I=fe.current;for(const U of F)for(const Is of oc){const wl=U.coin+"."+Is,$s=U[Is]||0;I[wl]?I[wl].last=$s:I[wl]={last:$s}}}function Q(){const F=new Set,I=[];if(!a)return I;for(const U of a)F.has(U.coin)||(F.add(U.coin),I.push(U.coin));return I}function J(F,I){var U;return(U=fe.current[F+"."+I])==null?void 0:U.last}function At(F,I){return F==null||I==null?"":I>F?"text-green":I`${i}:${s}`).join(" "));let l="";return e.exchange_funds&&(l=Object.entries(e.exchange_funds).map(([i,s])=>`${i}: $${s.balance.toFixed(2)}`).join(" | ")),o.jsxs("section",{className:"card",id:"stats-card",children:[o.jsx("h2",{children:"📊 统计数据"}),o.jsxs("div",{className:"stats-row",children:[o.jsxs("div",{className:"stat",children:[o.jsx("label",{children:"总交易"}),o.jsx("span",{id:"stat-total",children:e.total_trades||0})]}),o.jsxs("div",{className:"stat",children:[o.jsx("label",{children:"收敛"}),o.jsx("span",{className:"pct-green",children:e.converged||0})]}),o.jsxs("div",{className:"stat",children:[o.jsx("label",{children:"发散"}),o.jsx("span",{className:"pct-red",children:e.diverged||0})]}),o.jsxs("div",{className:"stat",children:[o.jsx("label",{children:"持平"}),o.jsx("span",{className:"pct-gray",children:e.flat||0})]}),o.jsxs("div",{className:"stat",children:[o.jsx("label",{children:"持仓"}),o.jsxs("span",{className:"pct-yellow",children:[e.open_positions||0," / ",o.jsx("span",{children:"5"})]})]}),o.jsxs("div",{className:"stat",children:[o.jsx("label",{children:"币种"}),o.jsx("span",{className:"pct-blue",children:e.coins||0})]}),o.jsxs("div",{className:"stat",id:"conn-stats",children:[o.jsx("label",{children:"连接"}),o.jsx("span",{id:"conn-detail",style:{fontSize:11},children:r})]})]}),l&&o.jsx("div",{className:"stats-row",style:{marginTop:2,fontSize:11,opacity:.85},children:o.jsxs("div",{className:"stat",style:{gridColumn:"1 / -1"},children:[o.jsx("label",{children:"资金"}),o.jsx("span",{style:{fontWeight:600},children:l})]})}),t&&o.jsxs("div",{className:"stats-row detail-stats",style:{marginTop:4,fontSize:12,opacity:.85},children:[o.jsxs("div",{className:"stat",children:[o.jsx("label",{children:"总PnL"}),o.jsx("span",{children:(t.total_pnl_usd!=null?"$"+t.total_pnl_usd.toFixed(2):"—")+(t.capital_pnl!=null?" ("+t.capital_pnl.toFixed(4)+"%)":"")})]}),o.jsxs("div",{className:"stat",children:[o.jsx("label",{children:"本金"}),o.jsx("span",{children:n!=null?"$"+n.toFixed(0):"—"})]}),o.jsxs("div",{className:"stat",children:[o.jsx("label",{children:"胜率"}),o.jsx("span",{children:t.win_rate!=null?t.win_rate.toFixed(1)+"%":"—"})]}),o.jsxs("div",{className:"stat",children:[o.jsx("label",{children:"最多盈利"}),o.jsx("span",{className:"text-green",children:t.max_profit!=null?t.max_profit.toFixed(4)+"%":"—"})]}),o.jsxs("div",{className:"stat",children:[o.jsx("label",{children:"最多亏损"}),o.jsx("span",{className:"text-red",children:t.max_loss!=null?t.max_loss.toFixed(4)+"%":"—"})]}),o.jsxs("div",{className:"stat",children:[o.jsx("label",{children:"平均持仓"}),o.jsx("span",{children:t.avg_dur||"—"})]})]})]})}function Af({positions:e}){const[t,n]=z.useState(!1),[r,l]=z.useState(null),[i,s]=z.useState([]);function u(d){d&&(n(!0),l(null),s([]),fetch("/api/trade/"+d).then(f=>f.json()).then(f=>{l(f.trade),s(f.orders||[])}).catch(()=>{l({ID:d})}))}function a(){n(!1)}return z.useEffect(()=>{if(!t)return;function d(f){f.key==="Escape"&&a()}return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[t]),o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"card",id:"positions-card",children:[o.jsx("h2",{children:"🔒 当前持仓"}),o.jsx("div",{className:"table-wrap",children:o.jsxs("table",{id:"positions-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"币种"}),o.jsx("th",{children:"方向"}),o.jsx("th",{children:"规模"}),o.jsx("th",{children:"入价差"}),o.jsx("th",{children:"现价差"}),o.jsx("th",{children:"估盈亏"}),o.jsx("th",{children:"加仓"}),o.jsx("th",{children:"时长"})]})}),o.jsx("tbody",{id:"positions-body",children:e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:"8",className:"loading",children:"无持仓"})}):[...e].sort((d,f)=>d.coin.localeCompare(f.coin)).map(d=>o.jsxs("tr",{className:"trade-row",onClick:()=>u(d.db_trade_id),children:[o.jsx("td",{children:o.jsx("strong",{children:d.coin})}),o.jsx("td",{children:d.direction}),o.jsxs("td",{className:"text-right",children:["$",(d.amount_usd||0).toFixed(0)]}),o.jsxs("td",{className:"text-right",children:[(d.entry_spread||0).toFixed(4),"%"]}),o.jsx("td",{className:"text-right",children:d.current_spread!=null?d.current_spread.toFixed(4)+"%":"-"}),o.jsx("td",{className:"text-right "+Bi(d.pnl_est),children:o.jsx("strong",{children:d.pnl_est!=null?"$"+d.pnl_est.toFixed(4):"-"})}),o.jsx("td",{className:"text-right",children:d.scales||0}),o.jsx("td",{children:d.duration||"-"})]},d.coin))})]})})]}),t&&o.jsx(uc,{trade:r,orders:i,onClose:a})]})}function Hf({blacklist:e}){return o.jsxs("section",{className:"card",id:"bl-card",children:[o.jsx("h2",{children:"⛔ 黑名单"}),o.jsx("div",{className:"stats-row",id:"bl-body",children:!e||e.length===0?o.jsx("span",{className:"text-dim",children:"暂无"}):e.map((t,n)=>{const r=t.remaining_sec||0,l=r>0?`${Math.floor(r/60)}m${r%60}s`:"";return o.jsxs("span",{className:"bl-item",title:`${t.coin}: ${l}`,children:["⛔ ",t.coin,l?` (${l})`:""]},n)})})]})}function Bf({coins:e,prices:t,getPrevPrice:n,priceClass:r,pricesAge:l}){return o.jsxs("section",{className:"card",id:"prices-card",children:[o.jsxs("h2",{children:["💰 实时价格 ",o.jsx("span",{className:"text-dim",style:{fontSize:11},children:l})]}),o.jsx("div",{className:"table-wrap",children:o.jsxs("table",{id:"price-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"币种"}),o.jsx("th",{children:"HyperLiquid"}),o.jsx("th",{children:"Bitget"}),o.jsx("th",{children:"Binance"}),o.jsx("th",{children:"OKX"}),o.jsx("th",{children:"毛价差"}),o.jsx("th",{children:"BG→HL净利"}),o.jsx("th",{children:"HL→BG净利"})]})}),o.jsx("tbody",{id:"price-body",children:e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:"8",className:"loading",children:"等待数据..."})}):e.map(i=>{const s=t.find(v=>v.coin===i);if(!s)return o.jsxs("tr",{children:[o.jsx("td",{children:i}),o.jsx("td",{className:"text-dim",children:"-"}),o.jsx("td",{className:"text-dim",children:"-"}),o.jsx("td",{className:"text-dim",children:"-"}),o.jsx("td",{className:"text-dim",children:"-"}),o.jsx("td",{className:"text-dim",children:"-"})]},i);const u=oc.map(v=>{const w=s[v],R=n(i,v),p=R?r(R,w||0):"";return o.jsx("td",{className:p,children:Hi(w)},v)}),a=s.bg_hl_spread,d=a>.2?"text-green":a<-.2?"text-red":"",f=s.net_bg_to_hl,c=s.net_hl_to_bg,g=f!=null?Bi(f):"",x=c!=null?Bi(c):"";return o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("strong",{children:i})}),u,o.jsx("td",{className:d,children:a!=null?a.toFixed(4)+"%":"-"}),o.jsx("td",{className:g,children:f!=null?f.toFixed(2)+"%":"-"}),o.jsx("td",{className:x,children:c!=null?c.toFixed(2)+"%":"-"})]},i)})})]})})]})}function Vf({opps:e}){return o.jsxs("section",{className:"card",id:"arb-card",children:[o.jsx("h2",{children:"🎯 套利机会 (BG↔HL)"}),o.jsx("div",{className:"table-wrap",children:o.jsxs("table",{id:"arb-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"币种"}),o.jsx("th",{children:"方向"}),o.jsx("th",{children:"买价"}),o.jsx("th",{children:"卖价"}),o.jsx("th",{children:"净利%"})]})}),o.jsx("tbody",{id:"arb-body",children:!e||e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:"5",className:"text-dim",children:"暂无套利机会"})}):e.map((t,n)=>{const r=t.net_profit>.1?"text-green":t.net_profit>.05?"text-yellow":"";return o.jsxs("tr",{children:[o.jsx("td",{children:t.coin}),o.jsx("td",{children:t.direction}),o.jsx("td",{className:"text-right",children:Hi(t.buy_price)}),o.jsx("td",{className:"text-right",children:Hi(t.sell_price)}),o.jsx("td",{className:"text-right "+r,children:o.jsx("strong",{children:(t.net_profit||0).toFixed(4)})})]},n)})})]})})]})}function Wf({trades:e,onRefresh:t}){const[n,r]=z.useState(null),[l,i]=z.useState([]),[s,u]=z.useState(!1);function a(f){u(!0),r(null),i([]),fetch("/api/trade/"+f).then(c=>c.json()).then(c=>{r(c.trade),i(c.orders||[])}).catch(()=>{r({ID:f})})}function d(){u(!1)}return z.useEffect(()=>{if(!s)return;function f(c){c.key==="Escape"&&d()}return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[s]),o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"card card-wide",id:"trades-card",children:[o.jsx("h2",{children:"📋 历史交易"}),o.jsx("div",{className:"table-wrap",children:o.jsxs("table",{id:"trades-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"时间"}),o.jsx("th",{children:"币种"}),o.jsx("th",{children:"方向"}),o.jsx("th",{children:"入价差"}),o.jsx("th",{children:"出价差"}),o.jsx("th",{children:"净利%"}),o.jsx("th",{children:"结果"}),o.jsx("th",{children:"原因"})]})}),o.jsx("tbody",{id:"trades-body",children:e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:"8",className:"text-dim",children:"暂无交易记录"})}):e.slice(0,20).map(f=>{const c=f.NetPnl>0?"text-green":f.NetPnl<0?"text-red":"",g=f.Convergence==="价差收敛"?"text-green":f.Convergence==="价差发散"?"text-red":"text-yellow";return o.jsxs("tr",{className:"trade-row",onClick:()=>a(f.ID),children:[o.jsx("td",{className:"text-dim",children:f.ClosedAt?new Date(f.ClosedAt).toLocaleTimeString("zh-CN",{hour12:!1}):"-"}),o.jsx("td",{children:o.jsx("strong",{children:f.Coin})}),o.jsx("td",{children:f.Direction}),o.jsx("td",{className:"text-right",children:f.EntrySpread!=null?f.EntrySpread.toFixed(4):"-"}),o.jsx("td",{className:"text-right",children:f.ExitSpread!=null?f.ExitSpread.toFixed(4):"-"}),o.jsx("td",{className:"text-right "+c,children:o.jsx("strong",{children:f.NetPnl!=null?f.NetPnl.toFixed(4)+"%":"-"})}),o.jsx("td",{className:g,children:f.Convergence||"-"}),o.jsx("td",{children:f.ExitReason||"-"})]},f.ID)})})]})})]}),s&&o.jsx(uc,{trade:n,orders:l,onClose:d})]})}function uc({trade:e,orders:t,onClose:n}){function r(g){g.target===g.currentTarget&&n()}if(!e)return o.jsx("div",{className:"modal-overlay",onClick:r,children:o.jsxs("div",{className:"modal-content",children:[o.jsxs("div",{className:"modal-header",children:[o.jsx("h2",{children:"📋 交易详情"}),o.jsx("button",{className:"modal-close",onClick:n,children:"✕"})]}),o.jsx("div",{id:"trade-detail-body",children:o.jsx("div",{className:"loading",children:"加载中..."})})]})});const l=new Date(e.OpenedAt),i=e.ClosedAt?new Date(e.ClosedAt):null,s=i?Math.round((i-l)/1e3)+"s":"-",u=e.NetPnl>0?"text-green":e.NetPnl<0?"text-red":"",a=[...t||[]].sort((g,x)=>{const v=(g.Exchange||"").localeCompare(x.Exchange||"");return v!==0?v:new Date(g.CreatedAt)-new Date(x.CreatedAt)}),d=e.AmountUSD&&e.LongPnl!=null?e.AmountUSD*e.LongPnl/100:null,f=e.AmountUSD&&e.ShortPnl!=null?e.AmountUSD*e.ShortPnl/100:null,c=e.AmountUSD&&e.NetPnl!=null?2*e.AmountUSD*e.NetPnl/100:null;return o.jsx("div",{className:"modal-overlay",onClick:r,children:o.jsxs("div",{className:"modal-content",children:[o.jsxs("div",{className:"modal-header",children:[o.jsx("h2",{children:"📋 交易详情"}),o.jsx("button",{className:"modal-close",onClick:n,children:"✕"})]}),o.jsxs("div",{id:"trade-detail-body",children:[o.jsxs("div",{className:"detail-grid",children:[o.jsxs("div",{className:"detail-section",children:[o.jsx("h3",{children:"概览"}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"币种"}),o.jsxs("span",{className:"value",children:[o.jsx("strong",{children:e.Coin}),"/USDT"]})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"方向"}),o.jsx("span",{className:"value",children:e.Direction||"-"})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"状态"}),o.jsx("span",{className:"value",children:e.Status==="closed"?"已平仓":e.Status})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"加仓次数"}),o.jsxs("span",{className:"value",children:[e.ScaleCount||0," 次"]})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"总规模"}),o.jsxs("span",{className:"value",children:["$",(e.AmountUSD||0).toFixed(0)]})]})]}),o.jsxs("div",{className:"detail-section",children:[o.jsx("h3",{children:"时间"}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"开仓"}),o.jsx("span",{className:"value",children:l.toLocaleString("zh-CN",{hour12:!1})})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"平仓"}),o.jsx("span",{className:"value",children:i?i.toLocaleString("zh-CN",{hour12:!1}):"-"})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"持仓时长"}),o.jsx("span",{className:"value",children:s})]})]}),o.jsxs("div",{className:"detail-section",children:[o.jsx("h3",{children:"价差"}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"入场价差"}),o.jsx("span",{className:"value",children:e.EntrySpread!=null?e.EntrySpread.toFixed(4)+"%":"-"})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"出场价差"}),o.jsx("span",{className:"value",children:e.ExitSpread!=null?e.ExitSpread.toFixed(4)+"%":"-"})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"收敛情况"}),o.jsx("span",{className:"value "+(e.Convergence==="价差收敛"?"text-green":e.Convergence==="价差发散"?"text-red":""),children:e.Convergence||"-"})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"平仓原因"}),o.jsx("span",{className:"value",children:e.ExitReason||"-"})]})]}),o.jsxs("div",{className:"detail-section",children:[o.jsx("h3",{children:"手续费"}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"开仓费"}),o.jsxs("span",{className:"value",children:["$",(e.FeeEntry||0).toFixed(4)]})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"平仓费"}),o.jsxs("span",{className:"value",children:["$",(e.FeeExit||0).toFixed(4)]})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"总手续费"}),o.jsxs("span",{className:"value",children:["$",((e.FeeEntry||0)+(e.FeeExit||0)).toFixed(4)]})]})]}),o.jsxs("div",{className:"detail-section",children:[o.jsxs("h3",{children:["多仓 ",e.LongExchange||"-"]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"入场价"}),o.jsxs("span",{className:"value",children:["$",(e.LongEntry||0).toFixed(6)]})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"出场价"}),o.jsxs("span",{className:"value",children:["$",(e.LongExit||0).toFixed(6)]})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"盈亏"}),o.jsxs("span",{className:"value "+(e.LongPnl>0?"text-green":e.LongPnl<0?"text-red":""),children:[e.LongPnl!=null?e.LongPnl.toFixed(4)+"%":"-"," ",d!=null?o.jsxs("span",{style:{fontSize:11,opacity:.8},children:["($",d.toFixed(4),")"]}):null]})]})]}),o.jsxs("div",{className:"detail-section",children:[o.jsxs("h3",{children:["空仓 ",e.ShortExchange||"-"]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"入场价"}),o.jsxs("span",{className:"value",children:["$",(e.ShortEntry||0).toFixed(6)]})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"出场价"}),o.jsxs("span",{className:"value",children:["$",(e.ShortExit||0).toFixed(6)]})]}),o.jsxs("div",{className:"detail-row",children:[o.jsx("span",{className:"label",children:"盈亏"}),o.jsxs("span",{className:"value "+(e.ShortPnl>0?"text-green":e.ShortPnl<0?"text-red":""),children:[e.ShortPnl!=null?e.ShortPnl.toFixed(4)+"%":"-"," ",f!=null?o.jsxs("span",{style:{fontSize:11,opacity:.8},children:["($",f.toFixed(4),")"]}):null]})]})]}),o.jsxs("div",{className:"detail-section detail-section-full",children:[o.jsx("h3",{children:"净收益"}),o.jsxs("div",{className:"detail-row",style:{fontSize:16},children:[o.jsx("span",{className:"label",children:"总计"}),o.jsxs("span",{className:"value "+u,style:{fontWeight:700},children:[e.NetPnl!=null?e.NetPnl.toFixed(4)+"%":"-"," ",c!=null?o.jsxs("span",{style:{fontSize:12,opacity:.8},children:["($",c.toFixed(4),")"]}):null]})]})]})]}),t.length>0&&o.jsxs("div",{className:"detail-section detail-section-full",style:{borderTop:"1px solid var(--border)"},children:[o.jsxs("h3",{children:["订单明细 (",t.length,")"]}),o.jsxs("table",{className:"detail-orders",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"交易所"}),o.jsx("th",{children:"类型"}),o.jsx("th",{children:"方向"}),o.jsx("th",{children:"价格"}),o.jsx("th",{children:"仓位"}),o.jsx("th",{children:"手续费"}),o.jsx("th",{children:"订单ID"})]})}),o.jsx("tbody",{children:a.map((g,x)=>o.jsxs("tr",{children:[o.jsx("td",{children:g.Exchange}),o.jsx("td",{children:g.Type==="entry"?"开仓":g.Type==="exit"?"平仓":g.Type==="scale"?"加仓":g.Type}),o.jsx("td",{children:g.Side==="buy"?"买":"卖"}),o.jsxs("td",{children:["$",(g.Price||0).toFixed(6)]}),o.jsx("td",{className:"text-right",children:g.Size!=null?Number(g.Size).toFixed(4):"-"}),o.jsx("td",{children:g.Fee!=null?"$"+g.Fee.toFixed(4):"-"}),o.jsx("td",{children:g.OrderID?g.OrderID.substring(0,12)+"...":"-"})]},x))})]})]})]})]})})}function Qf(){const e=z.useRef(null),[t,n]=z.useState([]),[r,l]=z.useState(0);return z.useEffect(()=>{async function i(){try{const d=((await(await fetch("/api/trades?limit=1000")).json()).trades||[]).filter(c=>c.ClosedAt&&c.NetPnl!=null).sort((c,g)=>new Date(c.ClosedAt)-new Date(g.ClosedAt));n(d);const f=d.reduce((c,g)=>c+2*(g.AmountUSD||0)*(g.NetPnl||0)/100,0);l(f)}catch{}}i();const s=setInterval(i,1e4);return()=>clearInterval(s)},[]),z.useEffect(()=>{const i=e.current;if(!i||t.length<2)return;const s=i.parentElement.getBoundingClientRect(),u=window.devicePixelRatio||1,a=s.width,d=s.height;i.width=a*u,i.height=d*u,i.style.width=a+"px",i.style.height=d+"px";const f=i.getContext("2d");f.scale(u,u);const c={top:20,right:20,bottom:35,left:55},g=a-c.left-c.right,x=d-c.top-c.bottom,v=[];let w=0;if(t.length>0){const M=new Date(t[0].ClosedAt).getTime()-1e3;v.push({x:M,y:0})}for(const M of t)w+=2*(M.AmountUSD||0)*(M.NetPnl||0)/100,v.push({x:new Date(M.ClosedAt).getTime(),y:w});const R=v[0].x,p=v[v.length-1].x,h=v.map(M=>M.y),m=Math.min(0,...h),y=Math.max(0,...h),S=Math.max(y-m,.01),_=S*.15,C=M=>c.left+(M-R)/Math.max(p-R,1)*g,E=M=>c.top+x-(M-(m-_))/(S+2*_)*x;f.clearRect(0,0,a,d),f.strokeStyle="rgba(48,54,61,0.5)",f.lineWidth=1,f.font="11px sans-serif",f.fillStyle="#8b949e";const A=5;for(let M=0;M<=A;M++){const fe=m-_+(S+2*_)*M/A,te=E(fe);f.beginPath(),f.moveTo(c.left,te),f.lineTo(a-c.right,te),f.stroke(),f.fillText("$"+fe.toFixed(2),2,te+4)}if(m<0&&y>0){const M=E(0);f.strokeStyle="rgba(248,81,73,0.3)",f.lineWidth=1,f.setLineDash([4,4]),f.beginPath(),f.moveTo(c.left,M),f.lineTo(a-c.right,M),f.stroke(),f.setLineDash([])}const T=Math.min(6,v.length);for(let M=0;M=0?"#3fb950":"#f85149",f.fill(),f.strokeStyle="#0d1117",f.lineWidth=2,f.stroke(),f.fillStyle="#c9d1d9",f.font="bold 13px sans-serif",f.textAlign="center",f.fillText("$"+Pe.y.toFixed(2),Be,Nt-12)},[t]),o.jsxs("section",{className:"card card-wide",id:"pnl-chart-card",children:[o.jsxs("h2",{children:["📈 总PnL成长曲线 ",o.jsx("span",{className:"text-dim",style:{fontSize:11},children:t.length>0?`$${r.toFixed(2)}`:""})]}),o.jsx("div",{className:"chart-container",style:{height:260},children:t.length<1?o.jsx("div",{className:"loading",style:{paddingTop:100},children:"暂无数据..."}):o.jsx("canvas",{ref:e})})]})}function Kf({momentum:e}){const[t,n]=z.useState("score"),[r,l]=z.useState("desc");function i(c){t===c?l(r==="asc"?"desc":"asc"):(n(c),l("desc"))}function s(c){return t!==c?"":r==="asc"?" ▲":" ▼"}const u=[...e].sort((c,g)=>{let x,v;switch(t){case"coin":x=c.coin,v=g.coin;break;case"bg_1s":x=c.bg_1s||0,v=g.bg_1s||0;break;case"bg_5s":x=c.bg_5s||0,v=g.bg_5s||0;break;case"bg_15s":x=c.bg_15s||0,v=g.bg_15s||0;break;case"hl_1s":x=c.hl_1s||0,v=g.hl_1s||0;break;case"hl_5s":x=c.hl_5s||0,v=g.hl_5s||0;break;case"hl_15s":x=c.hl_15s||0,v=g.hl_15s||0;break;case"bn_1s":x=c.bn_1s||0,v=g.bn_1s||0;break;case"bn_5s":x=c.bn_5s||0,v=g.bn_5s||0;break;case"bn_15s":x=c.bn_15s||0,v=g.bn_15s||0;break;case"okx_1s":x=c.okx_1s||0,v=g.okx_1s||0;break;case"okx_5s":x=c.okx_5s||0,v=g.okx_5s||0;break;case"okx_15s":x=c.okx_15s||0,v=g.okx_15s||0;break;default:x=c.score||0,v=g.score||0}return typeof x=="string"?r==="asc"?x.localeCompare(v):v.localeCompare(x):r==="asc"?x-v:v-x});function a(c){switch(c){case"up":return"↑";case"down":return"↓";case"flat":return"→";case"mixed":return"↕";default:return"-"}}function d(c){switch(c){case"up":return"text-green";case"down":return"text-red";case"mixed":return"text-yellow";default:return""}}function f(c){return c==null||c===0?"":c>0?"text-green":"text-red"}return o.jsxs("section",{className:"card card-wide",id:"momentum-card",children:[o.jsx("h2",{children:"⚡ 动量扫描 (价格变动%)"}),o.jsx("div",{className:"table-wrap",style:{maxHeight:400},children:o.jsxs("table",{id:"momentum-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsxs("th",{onClick:()=>i("coin"),style:{cursor:"pointer"},children:["币种",s("coin")]}),o.jsxs("th",{onClick:()=>i("score"),style:{cursor:"pointer"},children:["分数",s("score")]}),o.jsx("th",{children:"方向"}),o.jsxs("th",{onClick:()=>i("bg_1s"),style:{cursor:"pointer"},children:["BG 1s",s("bg_1s")]}),o.jsxs("th",{onClick:()=>i("bg_5s"),style:{cursor:"pointer"},children:["BG 5s",s("bg_5s")]}),o.jsxs("th",{onClick:()=>i("bg_15s"),style:{cursor:"pointer"},children:["BG 15s",s("bg_15s")]}),o.jsxs("th",{onClick:()=>i("hl_1s"),style:{cursor:"pointer"},children:["HL 1s",s("hl_1s")]}),o.jsxs("th",{onClick:()=>i("hl_5s"),style:{cursor:"pointer"},children:["HL 5s",s("hl_5s")]}),o.jsxs("th",{onClick:()=>i("hl_15s"),style:{cursor:"pointer"},children:["HL 15s",s("hl_15s")]}),o.jsxs("th",{onClick:()=>i("bn_1s"),style:{cursor:"pointer"},children:["BN 1s",s("bn_1s")]}),o.jsxs("th",{onClick:()=>i("bn_5s"),style:{cursor:"pointer"},children:["BN 5s",s("bn_5s")]}),o.jsxs("th",{onClick:()=>i("bn_15s"),style:{cursor:"pointer"},children:["BN 15s",s("bn_15s")]}),o.jsxs("th",{onClick:()=>i("okx_1s"),style:{cursor:"pointer"},children:["OKX 1s",s("okx_1s")]}),o.jsxs("th",{onClick:()=>i("okx_5s"),style:{cursor:"pointer"},children:["OKX 5s",s("okx_5s")]}),o.jsxs("th",{onClick:()=>i("okx_15s"),style:{cursor:"pointer"},children:["OKX 15s",s("okx_15s")]})]})}),o.jsx("tbody",{children:u.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:"15",className:"text-dim",style:{textAlign:"center",padding:20},children:"正在收集动量数据... (需要至少 15 秒数据)"})}):u.slice(0,50).map(c=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("strong",{children:c.coin})}),o.jsxs("td",{className:"text-right",style:{fontWeight:700},children:[c.score.toFixed(4),"%"]}),o.jsx("td",{className:d(c.direction),style:{textAlign:"center",fontSize:18},children:a(c.direction)}),o.jsx("td",{className:"text-right "+f(c.bg_1s),children:c.bg_1s!=null?c.bg_1s.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+f(c.bg_5s),children:c.bg_5s!=null?c.bg_5s.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+f(c.bg_15s),children:c.bg_15s!=null?c.bg_15s.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+f(c.hl_1s),children:c.hl_1s!=null?c.hl_1s.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+f(c.hl_5s),children:c.hl_5s!=null?c.hl_5s.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+f(c.hl_15s),children:c.hl_15s!=null?c.hl_15s.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+f(c.bn_1s),children:c.bn_1s!=null?c.bn_1s.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+f(c.bn_5s),children:c.bn_5s!=null?c.bn_5s.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+f(c.bn_15s),children:c.bn_15s!=null?c.bn_15s.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+f(c.okx_1s),children:c.okx_1s!=null?c.okx_1s.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+f(c.okx_5s),children:c.okx_5s!=null?c.okx_5s.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+f(c.okx_15s),children:c.okx_15s!=null?c.okx_15s.toFixed(3)+"%":"-"})]},c.coin))})]})})]})}function Xf({trend:e}){function t(s){switch(s){case"alert":return"⚠ 异动";case"confirmed":return"🚀 趋势";case"exhausting":return"🔄 衰减";default:return s}}function n(s){switch(s){case"alert":return"trend-alert";case"confirmed":return"trend-confirmed";case"exhausting":return"trend-exhausting";default:return""}}function r(s){return s==="up"?"↑":"↓"}function l(s){return s==="up"?"text-green":"text-red"}function i(s){return s==null||s===0?"":s>0?"text-green":"text-red"}return o.jsxs("section",{className:"card card-wide",id:"trend-card",children:[o.jsx("h2",{children:"📈 趋势检测 (价格异动)"}),o.jsx("div",{className:"table-wrap",style:{maxHeight:300},children:o.jsxs("table",{id:"trend-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"币种"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"方向"}),o.jsx("th",{children:"异动分"}),o.jsx("th",{children:"波动率"}),o.jsx("th",{children:"一致数"}),o.jsx("th",{children:"BG 15s"}),o.jsx("th",{children:"HL 15s"}),o.jsx("th",{children:"BN 15s"}),o.jsx("th",{children:"OKX 15s"}),o.jsx("th",{children:"时长"})]})}),o.jsx("tbody",{children:e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:"11",className:"text-dim",style:{textAlign:"center",padding:20},children:"等待检测数据... (需要至少 3 个交易所数据)"})}):e.slice(0,30).map(s=>o.jsxs("tr",{className:n(s.state),children:[o.jsx("td",{children:o.jsx("strong",{children:s.coin})}),o.jsx("td",{className:"trend-state",children:t(s.state)}),o.jsx("td",{className:l(s.direction),style:{textAlign:"center",fontSize:18},children:r(s.direction)}),o.jsxs("td",{className:"text-right",style:{fontWeight:700},children:[(s.anomaly_score||0).toFixed(1),"σ"]}),o.jsxs("td",{className:"text-right",children:[(s.volatility||0).toFixed(4),"%"]}),o.jsxs("td",{className:"text-right",children:[s.ex_changes||0,"/4"]}),o.jsx("td",{className:"text-right "+i(s.bg_change),children:s.bg_change!=null?s.bg_change.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+i(s.hl_change),children:s.hl_change!=null?s.hl_change.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+i(s.bn_change),children:s.bn_change!=null?s.bn_change.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+i(s.okx_change),children:s.okx_change!=null?s.okx_change.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-dim",children:s.duration||"-"})]},s.coin))})]})})]})}function Gf({data:e}){function t(i){switch(i){case"rising":return"↑ 上涨";case"falling":return"↓ 下跌";default:return"− 中性"}}function n(i){switch(i){case"rising":return"text-green";case"falling":return"text-red";default:return"text-dim"}}function r(i){return i==="up"?"text-green":"text-red"}function l(i){return i==null||i===0?"":i>0?"text-green":"text-red"}return o.jsxs("section",{className:"card card-wide",id:"cm-card",children:[o.jsx("h2",{children:"📊 累积变动 (1min 共识)"}),o.jsx("div",{className:"table-wrap",style:{maxHeight:300},children:o.jsxs("table",{id:"cm-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"币种"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"方向"}),o.jsx("th",{children:"分数"}),o.jsx("th",{children:"均值%"}),o.jsx("th",{children:"一致"}),o.jsx("th",{children:"BG 1m"}),o.jsx("th",{children:"HL 1m"}),o.jsx("th",{children:"BN 1m"}),o.jsx("th",{children:"OKX 1m"}),o.jsx("th",{children:"BG 5m"}),o.jsx("th",{children:"HL 5m"}),o.jsx("th",{children:"BN 5m"}),o.jsx("th",{children:"OKX 5m"})]})}),o.jsx("tbody",{children:!e||e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:"14",className:"text-dim",style:{textAlign:"center",padding:20},children:"等待累积数据... (需要至少 1 分钟数据)"})}):e.slice(0,30).map(i=>o.jsxs("tr",{className:n(i.state),children:[o.jsx("td",{children:o.jsx("strong",{children:i.coin})}),o.jsx("td",{children:t(i.state)}),o.jsx("td",{className:r(i.direction),style:{textAlign:"center",fontSize:16},children:i.direction==="up"?"↑":"↓"}),o.jsx("td",{className:"text-right",style:{fontWeight:700},children:(i.score||0).toFixed(2)}),o.jsxs("td",{className:"text-right",children:[(i.avg_change||0).toFixed(3),"%"]}),o.jsxs("td",{className:"text-right",children:[i.ex_agree||0,"/",i.ex_total||0]}),o.jsx("td",{className:"text-right "+l(i.bg_1m),children:i.bg_1m!=null?i.bg_1m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.hl_1m),children:i.hl_1m!=null?i.hl_1m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.bn_1m),children:i.bn_1m!=null?i.bn_1m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.okx_1m),children:i.okx_1m!=null?i.okx_1m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.bg_5m),children:i.bg_5m!=null?i.bg_5m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.hl_5m),children:i.hl_5m!=null?i.hl_5m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.bn_5m),children:i.bn_5m!=null?i.bn_5m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.okx_5m),children:i.okx_5m!=null?i.okx_5m.toFixed(3)+"%":"-"})]},i.coin))})]})})]})}function Yf({history:e}){function t(i){switch(i){case"rising":return"↑ 上涨";case"falling":return"↓ 下跌";default:return"− 中性"}}function n(i){switch(i){case"rising":return"text-green";case"falling":return"text-red";default:return"text-dim"}}function r(i){return i==="up"?"text-green":"text-red"}function l(i){return i==null||i===0?"":i>0?"text-green":"text-red"}return o.jsxs("section",{className:"card card-wide",id:"cm-history-card",children:[o.jsx("h2",{children:"📋 累积变动事件记录"}),o.jsx("div",{className:"table-wrap",style:{maxHeight:400},children:o.jsxs("table",{id:"cm-history-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"时间"}),o.jsx("th",{children:"币种"}),o.jsx("th",{children:"转换"}),o.jsx("th",{children:"方向"}),o.jsx("th",{children:"分数"}),o.jsx("th",{children:"均值%"}),o.jsx("th",{children:"一致"}),o.jsx("th",{children:"BG 1m"}),o.jsx("th",{children:"HL 1m"}),o.jsx("th",{children:"BN 1m"}),o.jsx("th",{children:"OKX 1m"}),o.jsx("th",{children:"BG 5m"}),o.jsx("th",{children:"HL 5m"}),o.jsx("th",{children:"BN 5m"}),o.jsx("th",{children:"OKX 5m"})]})}),o.jsx("tbody",{children:e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:"15",className:"text-dim",style:{textAlign:"center",padding:20},children:"暂无累积变动事件记录"})}):e.slice(0,100).map((i,s)=>o.jsxs("tr",{children:[o.jsx("td",{className:"text-dim",children:i.created_at?new Date(i.created_at).toLocaleTimeString("zh-CN",{hour12:!1}):"-"}),o.jsx("td",{children:o.jsx("strong",{children:i.coin})}),o.jsxs("td",{className:n(i.new_state),children:[i.prev_state," → ",t(i.new_state)]}),o.jsx("td",{className:r(i.direction),style:{textAlign:"center",fontSize:16},children:i.direction==="up"?"↑":"↓"}),o.jsx("td",{className:"text-right",children:(i.score||0).toFixed(2)}),o.jsxs("td",{className:"text-right",children:[(i.avg_change||0).toFixed(3),"%"]}),o.jsxs("td",{className:"text-right",children:[i.ex_agree||0,"/",i.ex_total||0]}),o.jsx("td",{className:"text-right "+l(i.bg_1m),children:i.bg_1m!=null?i.bg_1m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.hl_1m),children:i.hl_1m!=null?i.hl_1m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.bn_1m),children:i.bn_1m!=null?i.bn_1m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.okx_1m),children:i.okx_1m!=null?i.okx_1m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.bg_5m),children:i.bg_5m!=null?i.bg_5m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.hl_5m),children:i.hl_5m!=null?i.hl_5m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.bn_5m),children:i.bn_5m!=null?i.bn_5m.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+l(i.okx_5m),children:i.okx_5m!=null?i.okx_5m.toFixed(3)+"%":"-"})]},(i.id||s)+"-cm"))})]})})]})}function Zf({history:e}){function t(s){switch(s){case"alert":return"⚠ 异动";case"confirmed":return"🚀 趋势";case"exhausting":return"🔄 衰减";case"idle":return"✓ 结束";default:return s}}function n(s){switch(s){case"alert":return"text-yellow";case"confirmed":return"text-green";case"exhausting":return"text-dim";case"idle":return"text-dim";default:return""}}function r(s){return s==="up"?"↑":"↓"}function l(s){return s==="up"?"text-green":"text-red"}function i(s){return s==null||s===0?"":s>0?"text-green":"text-red"}return o.jsxs("section",{className:"card card-wide",id:"trend-history-card",children:[o.jsx("h2",{children:"📋 趋势事件记录"}),o.jsx("div",{className:"table-wrap",style:{maxHeight:400},children:o.jsxs("table",{id:"trend-history-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"时间"}),o.jsx("th",{children:"币种"}),o.jsx("th",{children:"转换"}),o.jsx("th",{children:"方向"}),o.jsx("th",{children:"异动分"}),o.jsx("th",{children:"波动率"}),o.jsx("th",{children:"一致"}),o.jsx("th",{children:"BG"}),o.jsx("th",{children:"HL"}),o.jsx("th",{children:"BN"}),o.jsx("th",{children:"OKX"})]})}),o.jsx("tbody",{children:e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:"11",className:"text-dim",style:{textAlign:"center",padding:20},children:"暂无趋势事件记录"})}):e.slice(0,100).map((s,u)=>o.jsxs("tr",{children:[o.jsx("td",{className:"text-dim",children:s.timestamp?new Date(s.timestamp).toLocaleTimeString("zh-CN",{hour12:!1}):s.created_at?new Date(s.created_at).toLocaleTimeString("zh-CN",{hour12:!1}):"-"}),o.jsx("td",{children:o.jsx("strong",{children:s.coin})}),o.jsxs("td",{className:n(s.new_state),children:[s.prev_state," → ",t(s.new_state)]}),o.jsx("td",{className:l(s.direction),style:{textAlign:"center",fontSize:16},children:r(s.direction)}),o.jsxs("td",{className:"text-right",children:[(s.z_score||0).toFixed(1),"σ"]}),o.jsxs("td",{className:"text-right",children:[(s.volatility||0).toFixed(4),"%"]}),o.jsxs("td",{className:"text-right",children:[s.ex_agree||0,"/",s.ex_total||0]}),o.jsx("td",{className:"text-right "+i(s.bg_change),children:s.bg_change!=null?s.bg_change.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+i(s.hl_change),children:s.hl_change!=null?s.hl_change.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+i(s.bn_change),children:s.bn_change!=null?s.bn_change.toFixed(3)+"%":"-"}),o.jsx("td",{className:"text-right "+i(s.okx_change),children:s.okx_change!=null?s.okx_change.toFixed(3)+"%":"-"})]},(s.timestamp||s.id||u)+"-"+u))})]})})]})}Gl.createRoot(document.getElementById("root")).render(o.jsx(Nc.StrictMode,{children:o.jsx($f,{})}));