llonebot-dist 7.9.0 → 7.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(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 o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).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 Cf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Du={exports:{}},
|
|
1
|
+
(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 o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).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 Cf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Du={exports:{}},Dl={},Ou={exports:{}},ne={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var os=Symbol.for("react.element"),Ef=Symbol.for("react.portal"),Mf=Symbol.for("react.fragment"),Tf=Symbol.for("react.strict_mode"),If=Symbol.for("react.profiler"),Pf=Symbol.for("react.provider"),zf=Symbol.for("react.context"),Lf=Symbol.for("react.forward_ref"),Rf=Symbol.for("react.suspense"),_f=Symbol.for("react.memo"),Af=Symbol.for("react.lazy"),ic=Symbol.iterator;function Ff(e){return e===null||typeof e!="object"?null:(e=ic&&e[ic]||e["@@iterator"],typeof e=="function"?e:null)}var qu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wu=Object.assign,Hu={};function ir(e,t,n){this.props=e,this.context=t,this.refs=Hu,this.updater=n||qu}ir.prototype.isReactComponent={};ir.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")};ir.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Bu(){}Bu.prototype=ir.prototype;function Bo(e,t,n){this.props=e,this.context=t,this.refs=Hu,this.updater=n||qu}var Vo=Bo.prototype=new Bu;Vo.constructor=Bo;Wu(Vo,ir.prototype);Vo.isPureReactComponent=!0;var oc=Array.isArray,Vu=Object.prototype.hasOwnProperty,Qo={current:null},Qu={key:!0,ref:!0,__self:!0,__source:!0};function Gu(e,t,n){var r,l={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Vu.call(t,r)&&!Qu.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];l.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)l[r]===void 0&&(l[r]=a[r]);return{$$typeof:os,type:e,key:i,ref:o,props:l,_owner:Qo.current}}function $f(e,t){return{$$typeof:os,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Go(e){return typeof e=="object"&&e!==null&&e.$$typeof===os}function Uf(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ac=/\/+/g;function hi(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Uf(""+e.key):t.toString(36)}function Ws(e,t,n,r,l){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case os:case Ef:o=!0}}if(o)return o=e,l=l(o),e=r===""?"."+hi(o,0):r,oc(l)?(n="",e!=null&&(n=e.replace(ac,"$&/")+"/"),Ws(l,t,n,"",function(u){return u})):l!=null&&(Go(l)&&(l=$f(l,n+(!l.key||o&&o.key===l.key?"":(""+l.key).replace(ac,"$&/")+"/")+e)),t.push(l)),1;if(o=0,r=r===""?".":r+":",oc(e))for(var a=0;a<e.length;a++){i=e[a];var c=r+hi(i,a);o+=Ws(i,t,n,c,l)}else if(c=Ff(e),typeof c=="function")for(e=c.call(e),a=0;!(i=e.next()).done;)i=i.value,c=r+hi(i,a++),o+=Ws(i,t,n,c,l);else if(i==="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 o}function ys(e,t,n){if(e==null)return e;var r=[],l=0;return Ws(e,r,"","",function(i){return t.call(n,i,l++)}),r}function Df(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var He={current:null},Hs={transition:null},Of={ReactCurrentDispatcher:He,ReactCurrentBatchConfig:Hs,ReactCurrentOwner:Qo};function Ku(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:ys,forEach:function(e,t,n){ys(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ys(e,function(){t++}),t},toArray:function(e){return ys(e,function(t){return t})||[]},only:function(e){if(!Go(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=ir;ne.Fragment=Mf;ne.Profiler=If;ne.PureComponent=Bo;ne.StrictMode=Tf;ne.Suspense=Rf;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Of;ne.act=Ku;ne.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Wu({},e.props),l=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Qo.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)Vu.call(t,c)&&!Qu.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:os,type:e.type,key:l,ref:i,props:r,_owner:o}};ne.createContext=function(e){return e={$$typeof:zf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Pf,_context:e},e.Consumer=e};ne.createElement=Gu;ne.createFactory=function(e){var t=Gu.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:Lf,render:e}};ne.isValidElement=Go;ne.lazy=function(e){return{$$typeof:Af,_payload:{_status:-1,_result:e},_init:Df}};ne.memo=function(e,t){return{$$typeof:_f,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=Hs.transition;Hs.transition={};try{e()}finally{Hs.transition=t}};ne.unstable_act=Ku;ne.useCallback=function(e,t){return He.current.useCallback(e,t)};ne.useContext=function(e){return He.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return He.current.useDeferredValue(e)};ne.useEffect=function(e,t){return He.current.useEffect(e,t)};ne.useId=function(){return He.current.useId()};ne.useImperativeHandle=function(e,t,n){return He.current.useImperativeHandle(e,t,n)};ne.useInsertionEffect=function(e,t){return He.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return He.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return He.current.useMemo(e,t)};ne.useReducer=function(e,t,n){return He.current.useReducer(e,t,n)};ne.useRef=function(e){return He.current.useRef(e)};ne.useState=function(e){return He.current.useState(e)};ne.useSyncExternalStore=function(e,t,n){return He.current.useSyncExternalStore(e,t,n)};ne.useTransition=function(){return He.current.useTransition()};ne.version="18.3.1";Ou.exports=ne;var p=Ou.exports;const ce=Cf(p);/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var qf=p,Wf=Symbol.for("react.element"),Hf=Symbol.for("react.fragment"),Bf=Object.prototype.hasOwnProperty,Vf=qf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Qf={key:!0,ref:!0,__self:!0,__source:!0};function Yu(e,t,n){var r,l={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Bf.call(t,r)&&!Qf.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:Wf,type:e,key:i,ref:o,props:l,_owner:Vf.current}}
|
|
17
|
+
*/var qf=p,Wf=Symbol.for("react.element"),Hf=Symbol.for("react.fragment"),Bf=Object.prototype.hasOwnProperty,Vf=qf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Qf={key:!0,ref:!0,__self:!0,__source:!0};function Yu(e,t,n){var r,l={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Bf.call(t,r)&&!Qf.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:Wf,type:e,key:i,ref:o,props:l,_owner:Vf.current}}Dl.Fragment=Hf;Dl.jsx=Yu;Dl.jsxs=Yu;Du.exports=Dl;var s=Du.exports,Hi={},Xu={exports:{}},rt={},Ju={exports:{}},Zu={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(
|
|
25
|
+
*/(function(e){function t(P,W){var K=P.length;P.push(W);e:for(;0<K;){var J=K-1>>>1,ae=P[J];if(0<l(ae,W))P[J]=W,P[K]=ae,K=J;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var W=P[0],K=P.pop();if(K!==W){P[0]=K;e:for(var J=0,ae=P.length,ge=ae>>>1;J<ge;){var Ce=2*(J+1)-1,Q=P[Ce],I=Ce+1,F=P[I];if(0>l(Q,K))I<ae&&0>l(F,Q)?(P[J]=F,P[I]=K,J=I):(P[J]=Q,P[Ce]=K,J=Ce);else if(I<ae&&0>l(F,K))P[J]=F,P[I]=K,J=I;else break e}}return W}function l(P,W){var K=P.sortIndex-W.sortIndex;return K!==0?K:P.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var c=[],u=[],d=1,m=null,f=3,y=!1,w=!1,k=!1,j=typeof setTimeout=="function"?setTimeout:null,g=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 x(P){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=P)r(u),W.sortIndex=W.expirationTime,t(c,W);else break;W=n(u)}}function v(P){if(k=!1,x(P),!w)if(n(c)!==null)w=!0,U(N);else{var W=n(u);W!==null&&D(v,W.startTime-P)}}function N(P,W){w=!1,k&&(k=!1,g(M),M=-1),y=!0;var K=f;try{for(x(W),m=n(c);m!==null&&(!(m.expirationTime>W)||P&&!V());){var J=m.callback;if(typeof J=="function"){m.callback=null,f=m.priorityLevel;var ae=J(m.expirationTime<=W);W=e.unstable_now(),typeof ae=="function"?m.callback=ae:m===n(c)&&r(c),x(W)}else r(c);m=n(c)}if(m!==null)var ge=!0;else{var Ce=n(u);Ce!==null&&D(v,Ce.startTime-W),ge=!1}return ge}finally{m=null,f=K,y=!1}}var S=!1,T=null,M=-1,q=5,R=-1;function V(){return!(e.unstable_now()-R<q)}function C(){if(T!==null){var P=e.unstable_now();R=P;var W=!0;try{W=T(!0,P)}finally{W?b():(S=!1,T=null)}}else S=!1}var b;if(typeof h=="function")b=function(){h(C)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,_=E.port2;E.port1.onmessage=C,b=function(){_.postMessage(null)}}else b=function(){j(C,0)};function U(P){T=P,S||(S=!0,b())}function D(P,W){M=j(function(){P(e.unstable_now())},W)}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(P){P.callback=null},e.unstable_continueExecution=function(){w||y||(w=!0,U(N))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(P){switch(f){case 1:case 2:case 3:var W=3;break;default:W=f}var K=f;f=W;try{return P()}finally{f=K}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,W){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var K=f;f=P;try{return W()}finally{f=K}},e.unstable_scheduleCallback=function(P,W,K){var J=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?J+K:J):K=J,P){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=K+ae,P={id:d++,callback:W,priorityLevel:P,startTime:K,expirationTime:ae,sortIndex:-1},K>J?(P.sortIndex=K,t(u,P),n(c)===null&&P===n(u)&&(k?(g(M),M=-1):k=!0,D(v,K-J))):(P.sortIndex=ae,t(c,P),w||y||(w=!0,U(N))),P},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(P){var W=f;return function(){var K=f;f=W;try{return P.apply(this,arguments)}finally{f=K}}}})(Zu);Ju.exports=Zu;var Gf=Ju.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Kf=p,
|
|
33
|
+
*/var Kf=p,nt=Gf;function $(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ed=new Set,Or={};function En(e,t){Jn(e,t),Jn(e+"Capture",t)}function Jn(e,t){for(Or[e]=t,e=0;e<t.length;e++)ed.add(t[e])}var $t=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bi=Object.prototype.hasOwnProperty,Yf=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,cc={},uc={};function Xf(e){return Bi.call(uc,e)?!0:Bi.call(cc,e)?!1:Yf.test(e)?uc[e]=!0:(cc[e]=!0,!1)}function Jf(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 Zf(e,t,n,r){if(t===null||typeof t>"u"||Jf(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 Be(e,t,n,r,l,i,o){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=o}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ae[e]=new Be(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ae[t]=new Be(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ae[e]=new Be(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ae[e]=new Be(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){Ae[e]=new Be(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ae[e]=new Be(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ae[e]=new Be(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ae[e]=new Be(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ae[e]=new Be(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ko=/[\-:]([a-z])/g;function Yo(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(Ko,Yo);Ae[t]=new Be(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(Ko,Yo);Ae[t]=new Be(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(Ko,Yo);Ae[t]=new Be(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ae[e]=new Be(e,1,!1,e.toLowerCase(),null,!1,!1)});Ae.xlinkHref=new Be("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ae[e]=new Be(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xo(e,t,n,r){var l=Ae.hasOwnProperty(t)?Ae[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Zf(t,n,l,r)&&(n=null),r||l===null?Xf(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var qt=Kf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,vs=Symbol.for("react.element"),Rn=Symbol.for("react.portal"),_n=Symbol.for("react.fragment"),Jo=Symbol.for("react.strict_mode"),Vi=Symbol.for("react.profiler"),td=Symbol.for("react.provider"),nd=Symbol.for("react.context"),Zo=Symbol.for("react.forward_ref"),Qi=Symbol.for("react.suspense"),Gi=Symbol.for("react.suspense_list"),ea=Symbol.for("react.memo"),Ht=Symbol.for("react.lazy"),rd=Symbol.for("react.offscreen"),dc=Symbol.iterator;function gr(e){return e===null||typeof e!="object"?null:(e=dc&&e[dc]||e["@@iterator"],typeof e=="function"?e:null)}var we=Object.assign,fi;function Sr(e){if(fi===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);fi=t&&t[1]||""}return`
|
|
34
34
|
`+fi+e}var pi=!1;function xi(e,t){if(!e||pi)return"";pi=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var l=u.stack.split(`
|
|
35
35
|
`),i=r.stack.split(`
|
|
36
36
|
`),o=l.length-1,a=i.length-1;1<=o&&0<=a&&l[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(l[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||l[o]!==i[a]){var c=`
|
|
37
|
-
`+l[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=a);break}}}finally{pi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?br(e):""}function ep(e){switch(e.tag){case 5:return br(e.type);case 16:return br("Lazy");case 13:return br("Suspense");case 19:return br("SuspenseList");case 0:case 2:case 15:return e=xi(e.type,!1),e;case 11:return e=xi(e.type.render,!1),e;case 1:return e=xi(e.type,!0),e;default:return""}}function Ki(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 _n:return"Fragment";case Rn:return"Portal";case Vi:return"Profiler";case Jo:return"StrictMode";case Qi:return"Suspense";case Gi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case nd:return(e.displayName||"Context")+".Consumer";case td:return(e._context.displayName||"Context")+".Provider";case Zo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ea:return t=e.displayName||null,t!==null?t:Ki(e.type)||"Memo";case Ht:t=e._payload,e=e._init;try{return Ki(e(t))}catch{}}return null}function tp(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 Ki(t);case 8:return t===Jo?"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 ln(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function np(e){var t=sd(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(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function vs(e){e._valueTracker||(e._valueTracker=np(e))}function ld(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=sd(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function il(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 Yi(e,t){var n=t.checked;return ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ln(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 id(e,t){t=t.checked,t!=null&&Xo(e,"checked",t,!1)}function Xi(e,t){id(e,t);var n=ln(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")?Ji(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ji(e,t.type,ln(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hc(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 Ji(e,t,n){(t!=="number"||il(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Sr=Array.isArray;function Vn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ln(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Zi(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return ke({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function fc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(F(92));if(Sr(n)){if(1<n.length)throw Error(F(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ln(n)}}function od(e,t){var n=ln(t.value),r=ln(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function pc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ad(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 eo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ad(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ws,cd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ws=ws||document.createElement("div"),ws.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ws.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Or(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mr={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},rp=["Webkit","ms","Moz","O"];Object.keys(Mr).forEach(function(e){rp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mr[t]=Mr[e]})});function ud(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mr.hasOwnProperty(e)&&Mr[e]?(""+t).trim():t+"px"}function dd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=ud(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var sp=ke({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function to(e,t){if(t){if(sp[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function no(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 ro=null;function ta(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var so=null,Qn=null,Gn=null;function xc(e){if(e=cs(e)){if(typeof so!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Hl(t),so(e.stateNode,e.type,t))}}function md(e){Qn?Gn?Gn.push(e):Gn=[e]:Qn=e}function hd(){if(Qn){var e=Qn,t=Gn;if(Gn=Qn=null,xc(e),t)for(e=0;e<t.length;e++)xc(t[e])}}function fd(e,t){return e(t)}function pd(){}var gi=!1;function xd(e,t,n){if(gi)return e(t,n);gi=!0;try{return fd(e,t,n)}finally{gi=!1,(Qn!==null||Gn!==null)&&(pd(),hd())}}function qr(e,t){var n=e.stateNode;if(n===null)return null;var r=Hl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(F(231,t,typeof n));return n}var lo=!1;if($t)try{var gr={};Object.defineProperty(gr,"passive",{get:function(){lo=!0}}),window.addEventListener("test",gr,gr),window.removeEventListener("test",gr,gr)}catch{lo=!1}function lp(e,t,n,r,l,i,o,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Ir=!1,ol=null,al=!1,io=null,ip={onError:function(e){Ir=!0,ol=e}};function op(e,t,n,r,l,i,o,a,c){Ir=!1,ol=null,lp.apply(ip,arguments)}function ap(e,t,n,r,l,i,o,a,c){if(op.apply(this,arguments),Ir){if(Ir){var u=ol;Ir=!1,ol=null}else throw Error(F(198));al||(al=!0,io=u)}}function Tn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function gd(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 gc(e){if(Tn(e)!==e)throw Error(F(188))}function cp(e){var t=e.alternate;if(!t){if(t=Tn(e),t===null)throw Error(F(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var i=l.alternate;if(i===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===i.child){for(i=l.child;i;){if(i===n)return gc(l),e;if(i===r)return gc(l),t;i=i.sibling}throw Error(F(188))}if(n.return!==r.return)n=l,r=i;else{for(var o=!1,a=l.child;a;){if(a===n){o=!0,n=l,r=i;break}if(a===r){o=!0,r=l,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=l;break}if(a===r){o=!0,r=i,n=l;break}a=a.sibling}if(!o)throw Error(F(189))}}if(n.alternate!==r)throw Error(F(190))}if(n.tag!==3)throw Error(F(188));return n.stateNode.current===n?e:t}function yd(e){return e=cp(e),e!==null?vd(e):null}function vd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=vd(e);if(t!==null)return t;e=e.sibling}return null}var wd=st.unstable_scheduleCallback,yc=st.unstable_cancelCallback,up=st.unstable_shouldYield,dp=st.unstable_requestPaint,be=st.unstable_now,mp=st.unstable_getCurrentPriorityLevel,na=st.unstable_ImmediatePriority,kd=st.unstable_UserBlockingPriority,cl=st.unstable_NormalPriority,hp=st.unstable_LowPriority,jd=st.unstable_IdlePriority,Dl=null,Tt=null;function fp(e){if(Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(Dl,e,void 0,(e.current.flags&128)===128)}catch{}}var wt=Math.clz32?Math.clz32:gp,pp=Math.log,xp=Math.LN2;function gp(e){return e>>>=0,e===0?32:31-(pp(e)/xp|0)|0}var ks=64,js=4194304;function Cr(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 ul(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~l;a!==0?r=Cr(a):(i&=o,i!==0&&(r=Cr(i)))}else o=n&~l,o!==0?r=Cr(o):i!==0&&(r=Cr(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;0<t;)n=31-wt(t),l=1<<n,r|=e[n],t&=~l;return r}function yp(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 vp(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-wt(i),a=1<<o,c=l[o];c===-1?(!(a&n)||a&r)&&(l[o]=yp(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}function oo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Nd(){var e=ks;return ks<<=1,!(ks&4194240)&&(ks=64),e}function yi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function os(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wt(t),e[t]=n}function wp(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var l=31-wt(n),i=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~i}}function ra(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wt(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var me=0;function bd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Sd,sa,Cd,Ed,Td,ao=!1,Ns=[],Yt=null,Xt=null,Jt=null,Wr=new Map,Hr=new Map,Vt=[],kp="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 vc(e,t){switch(e){case"focusin":case"focusout":Yt=null;break;case"dragenter":case"dragleave":Xt=null;break;case"mouseover":case"mouseout":Jt=null;break;case"pointerover":case"pointerout":Wr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hr.delete(t.pointerId)}}function yr(e,t,n,r,l,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[l]},t!==null&&(t=cs(t),t!==null&&sa(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function jp(e,t,n,r,l){switch(t){case"focusin":return Yt=yr(Yt,e,t,n,r,l),!0;case"dragenter":return Xt=yr(Xt,e,t,n,r,l),!0;case"mouseover":return Jt=yr(Jt,e,t,n,r,l),!0;case"pointerover":var i=l.pointerId;return Wr.set(i,yr(Wr.get(i)||null,e,t,n,r,l)),!0;case"gotpointercapture":return i=l.pointerId,Hr.set(i,yr(Hr.get(i)||null,e,t,n,r,l)),!0}return!1}function Md(e){var t=xn(e.target);if(t!==null){var n=Tn(t);if(n!==null){if(t=n.tag,t===13){if(t=gd(n),t!==null){e.blockedOn=t,Td(e.priority,function(){Cd(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=co(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ro=r,n.target.dispatchEvent(r),ro=null}else return t=cs(n),t!==null&&sa(t),e.blockedOn=n,!1;t.shift()}return!0}function wc(e,t,n){Hs(e)&&n.delete(t)}function Np(){ao=!1,Yt!==null&&Hs(Yt)&&(Yt=null),Xt!==null&&Hs(Xt)&&(Xt=null),Jt!==null&&Hs(Jt)&&(Jt=null),Wr.forEach(wc),Hr.forEach(wc)}function vr(e,t){e.blockedOn===t&&(e.blockedOn=null,ao||(ao=!0,st.unstable_scheduleCallback(st.unstable_NormalPriority,Np)))}function Br(e){function t(l){return vr(l,e)}if(0<Ns.length){vr(Ns[0],e);for(var n=1;n<Ns.length;n++){var r=Ns[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Yt!==null&&vr(Yt,e),Xt!==null&&vr(Xt,e),Jt!==null&&vr(Jt,e),Wr.forEach(t),Hr.forEach(t),n=0;n<Vt.length;n++)r=Vt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Vt.length&&(n=Vt[0],n.blockedOn===null);)Md(n),n.blockedOn===null&&Vt.shift()}var Kn=qt.ReactCurrentBatchConfig,dl=!0;function bp(e,t,n,r){var l=me,i=Kn.transition;Kn.transition=null;try{me=1,la(e,t,n,r)}finally{me=l,Kn.transition=i}}function Sp(e,t,n,r){var l=me,i=Kn.transition;Kn.transition=null;try{me=4,la(e,t,n,r)}finally{me=l,Kn.transition=i}}function la(e,t,n,r){if(dl){var l=co(e,t,n,r);if(l===null)Ti(e,t,r,ml,n),vc(e,r);else if(jp(l,e,t,n,r))r.stopPropagation();else if(vc(e,r),t&4&&-1<kp.indexOf(e)){for(;l!==null;){var i=cs(l);if(i!==null&&Sd(i),i=co(e,t,n,r),i===null&&Ti(e,t,r,ml,n),i===l)break;l=i}l!==null&&r.stopPropagation()}else Ti(e,t,r,null,n)}}var ml=null;function co(e,t,n,r){if(ml=null,e=ta(r),e=xn(e),e!==null)if(t=Tn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=gd(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ml=e,null}function Id(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(mp()){case na:return 1;case kd:return 4;case cl:case hp:return 16;case jd:return 536870912;default:return 16}default:return 16}}var Gt=null,ia=null,Bs=null;function Pd(){if(Bs)return Bs;var e,t=ia,n=t.length,r,l="value"in Gt?Gt.value:Gt.textContent,i=l.length;for(e=0;e<n&&t[e]===l[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===l[i-r];r++);return Bs=l.slice(e,1<r?1-r:void 0)}function Vs(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 bs(){return!0}function kc(){return!1}function it(e){function t(n,r,l,i,o){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?bs:kc,this.isPropagationStopped=kc,this}return ke(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=bs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=bs)},persist:function(){},isPersistent:bs}),t}var or={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oa=it(or),as=ke({},or,{view:0,detail:0}),Cp=it(as),vi,wi,wr,Ol=ke({},as,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:aa,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!==wr&&(wr&&e.type==="mousemove"?(vi=e.screenX-wr.screenX,wi=e.screenY-wr.screenY):wi=vi=0,wr=e),vi)},movementY:function(e){return"movementY"in e?e.movementY:wi}}),jc=it(Ol),Ep=ke({},Ol,{dataTransfer:0}),Tp=it(Ep),Mp=ke({},as,{relatedTarget:0}),ki=it(Mp),Ip=ke({},or,{animationName:0,elapsedTime:0,pseudoElement:0}),Pp=it(Ip),zp=ke({},or,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lp=it(zp),Rp=ke({},or,{data:0}),Nc=it(Rp),_p={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ap={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"},Fp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $p(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fp[e])?!!t[e]:!1}function aa(){return $p}var Up=ke({},as,{key:function(e){if(e.key){var t=_p[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Vs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ap[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:aa,charCode:function(e){return e.type==="keypress"?Vs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Dp=it(Up),Op=ke({},Ol,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bc=it(Op),qp=ke({},as,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:aa}),Wp=it(qp),Hp=ke({},or,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bp=it(Hp),Vp=ke({},Ol,{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}),Qp=it(Vp),Gp=[9,13,27,32],ca=$t&&"CompositionEvent"in window,Pr=null;$t&&"documentMode"in document&&(Pr=document.documentMode);var Kp=$t&&"TextEvent"in window&&!Pr,zd=$t&&(!ca||Pr&&8<Pr&&11>=Pr),Sc=" ",Cc=!1;function Ld(e,t){switch(e){case"keyup":return Gp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var An=!1;function Yp(e,t){switch(e){case"compositionend":return Rd(t);case"keypress":return t.which!==32?null:(Cc=!0,Sc);case"textInput":return e=t.data,e===Sc&&Cc?null:e;default:return null}}function Xp(e,t){if(An)return e==="compositionend"||!ca&&Ld(e,t)?(e=Pd(),Bs=ia=Gt=null,An=!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 zd&&t.locale!=="ko"?null:t.data;default:return null}}var Jp={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"?!!Jp[e.type]:t==="textarea"}function _d(e,t,n,r){md(r),t=hl(t,"onChange"),0<t.length&&(n=new oa("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var zr=null,Vr=null;function Zp(e){Vd(e,0)}function ql(e){var t=Un(e);if(ld(t))return e}function ex(e,t){if(e==="change")return t}var Ad=!1;if($t){var ji;if($t){var Ni="oninput"in document;if(!Ni){var Tc=document.createElement("div");Tc.setAttribute("oninput","return;"),Ni=typeof Tc.oninput=="function"}ji=Ni}else ji=!1;Ad=ji&&(!document.documentMode||9<document.documentMode)}function Mc(){zr&&(zr.detachEvent("onpropertychange",Fd),Vr=zr=null)}function Fd(e){if(e.propertyName==="value"&&ql(Vr)){var t=[];_d(t,Vr,e,ta(e)),xd(Zp,t)}}function tx(e,t,n){e==="focusin"?(Mc(),zr=t,Vr=n,zr.attachEvent("onpropertychange",Fd)):e==="focusout"&&Mc()}function nx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ql(Vr)}function rx(e,t){if(e==="click")return ql(t)}function sx(e,t){if(e==="input"||e==="change")return ql(t)}function lx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jt=typeof Object.is=="function"?Object.is:lx;function Qr(e,t){if(jt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!Bi.call(t,l)||!jt(e[l],t[l]))return!1}return!0}function Ic(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pc(e,t){var n=Ic(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ic(n)}}function $d(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$d(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ud(){for(var e=window,t=il();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=il(e.document)}return t}function ua(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 ix(e){var t=Ud(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&$d(n.ownerDocument.documentElement,n)){if(r!==null&&ua(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=Pc(n,i);var o=Pc(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ox=$t&&"documentMode"in document&&11>=document.documentMode,Fn=null,uo=null,Lr=null,mo=!1;function zc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mo||Fn==null||Fn!==il(r)||(r=Fn,"selectionStart"in r&&ua(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}),Lr&&Qr(Lr,r)||(Lr=r,r=hl(uo,"onSelect"),0<r.length&&(t=new oa("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Fn)))}function Ss(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $n={animationend:Ss("Animation","AnimationEnd"),animationiteration:Ss("Animation","AnimationIteration"),animationstart:Ss("Animation","AnimationStart"),transitionend:Ss("Transition","TransitionEnd")},bi={},Dd={};$t&&(Dd=document.createElement("div").style,"AnimationEvent"in window||(delete $n.animationend.animation,delete $n.animationiteration.animation,delete $n.animationstart.animation),"TransitionEvent"in window||delete $n.transitionend.transition);function Wl(e){if(bi[e])return bi[e];if(!$n[e])return e;var t=$n[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Dd)return bi[e]=t[n];return e}var Od=Wl("animationend"),qd=Wl("animationiteration"),Wd=Wl("animationstart"),Hd=Wl("transitionend"),Bd=new Map,Lc="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 an(e,t){Bd.set(e,t),En(t,[e])}for(var Si=0;Si<Lc.length;Si++){var Ci=Lc[Si],ax=Ci.toLowerCase(),cx=Ci[0].toUpperCase()+Ci.slice(1);an(ax,"on"+cx)}an(Od,"onAnimationEnd");an(qd,"onAnimationIteration");an(Wd,"onAnimationStart");an("dblclick","onDoubleClick");an("focusin","onFocus");an("focusout","onBlur");an(Hd,"onTransitionEnd");Jn("onMouseEnter",["mouseout","mouseover"]);Jn("onMouseLeave",["mouseout","mouseover"]);Jn("onPointerEnter",["pointerout","pointerover"]);Jn("onPointerLeave",["pointerout","pointerover"]);En("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));En("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));En("onBeforeInput",["compositionend","keypress","textInput","paste"]);En("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));En("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));En("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Er="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(" "),ux=new Set("cancel close invalid load scroll toggle".split(" ").concat(Er));function Rc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,ap(r,t,void 0,e),e.currentTarget=null}function Vd(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==i&&l.isPropagationStopped())break e;Rc(l,a,u),i=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,u=a.currentTarget,a=a.listener,c!==i&&l.isPropagationStopped())break e;Rc(l,a,u),i=c}}}if(al)throw e=io,al=!1,io=null,e}function pe(e,t){var n=t[go];n===void 0&&(n=t[go]=new Set);var r=e+"__bubble";n.has(r)||(Qd(t,e,2,!1),n.add(r))}function Ei(e,t,n){var r=0;t&&(r|=4),Qd(n,e,r,t)}var Cs="_reactListening"+Math.random().toString(36).slice(2);function Gr(e){if(!e[Cs]){e[Cs]=!0,ed.forEach(function(n){n!=="selectionchange"&&(ux.has(n)||Ei(n,!1,e),Ei(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cs]||(t[Cs]=!0,Ei("selectionchange",!1,t))}}function Qd(e,t,n,r){switch(Id(t)){case 1:var l=bp;break;case 4:l=Sp;break;default:l=la}n=l.bind(null,t,n,e),l=void 0,!lo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Ti(e,t,n,r,l){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===l||a.nodeType===8&&a.parentNode===l)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===l||c.nodeType===8&&c.parentNode===l))return;o=o.return}for(;a!==null;){if(o=xn(a),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}a=a.parentNode}}r=r.return}xd(function(){var u=i,d=ta(n),m=[];e:{var f=Bd.get(e);if(f!==void 0){var v=oa,k=e;switch(e){case"keypress":if(Vs(n)===0)break e;case"keydown":case"keyup":v=Dp;break;case"focusin":k="focus",v=ki;break;case"focusout":k="blur",v=ki;break;case"beforeblur":case"afterblur":v=ki;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=jc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=Tp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=Wp;break;case Od:case qd:case Wd:v=Pp;break;case Hd:v=Bp;break;case"scroll":v=Cp;break;case"wheel":v=Qp;break;case"copy":case"cut":case"paste":v=Lp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=bc}var w=(t&4)!==0,j=!w&&e==="scroll",x=w?f!==null?f+"Capture":null:f;w=[];for(var h=u,g;h!==null;){g=h;var y=g.stateNode;if(g.tag===5&&y!==null&&(g=y,x!==null&&(y=qr(h,x),y!=null&&w.push(Kr(h,y,g)))),j)break;h=h.return}0<w.length&&(f=new v(f,k,null,n,d),m.push({event:f,listeners:w}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",f&&n!==ro&&(k=n.relatedTarget||n.fromElement)&&(xn(k)||k[Ut]))break e;if((v||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,v?(k=n.relatedTarget||n.toElement,v=u,k=k?xn(k):null,k!==null&&(j=Tn(k),k!==j||k.tag!==5&&k.tag!==6)&&(k=null)):(v=null,k=u),v!==k)){if(w=jc,y="onMouseLeave",x="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(w=bc,y="onPointerLeave",x="onPointerEnter",h="pointer"),j=v==null?f:Un(v),g=k==null?f:Un(k),f=new w(y,h+"leave",v,n,d),f.target=j,f.relatedTarget=g,y=null,xn(d)===u&&(w=new w(x,h+"enter",k,n,d),w.target=g,w.relatedTarget=j,y=w),j=y,v&&k)t:{for(w=v,x=k,h=0,g=w;g;g=Pn(g))h++;for(g=0,y=x;y;y=Pn(y))g++;for(;0<h-g;)w=Pn(w),h--;for(;0<g-h;)x=Pn(x),g--;for(;h--;){if(w===x||x!==null&&w===x.alternate)break t;w=Pn(w),x=Pn(x)}w=null}else w=null;v!==null&&_c(m,f,v,w,!1),k!==null&&j!==null&&_c(m,j,k,w,!0)}}e:{if(f=u?Un(u):window,v=f.nodeName&&f.nodeName.toLowerCase(),v==="select"||v==="input"&&f.type==="file")var N=ex;else if(Ec(f))if(Ad)N=sx;else{N=nx;var S=tx}else(v=f.nodeName)&&v.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(N=rx);if(N&&(N=N(e,u))){_d(m,N,n,d);break e}S&&S(e,f,u),e==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&Ji(f,"number",f.value)}switch(S=u?Un(u):window,e){case"focusin":(Ec(S)||S.contentEditable==="true")&&(Fn=S,uo=u,Lr=null);break;case"focusout":Lr=uo=Fn=null;break;case"mousedown":mo=!0;break;case"contextmenu":case"mouseup":case"dragend":mo=!1,zc(m,n,d);break;case"selectionchange":if(ox)break;case"keydown":case"keyup":zc(m,n,d)}var P;if(ca)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else An?Ld(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(zd&&n.locale!=="ko"&&(An||T!=="onCompositionStart"?T==="onCompositionEnd"&&An&&(P=Pd()):(Gt=d,ia="value"in Gt?Gt.value:Gt.textContent,An=!0)),S=hl(u,T),0<S.length&&(T=new Nc(T,e,null,n,d),m.push({event:T,listeners:S}),P?T.data=P:(P=Rd(n),P!==null&&(T.data=P)))),(P=Kp?Yp(e,n):Xp(e,n))&&(u=hl(u,"onBeforeInput"),0<u.length&&(d=new Nc("onBeforeInput","beforeinput",null,n,d),m.push({event:d,listeners:u}),d.data=P))}Vd(m,t)})}function Kr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function hl(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,i=l.stateNode;l.tag===5&&i!==null&&(l=i,i=qr(e,n),i!=null&&r.unshift(Kr(e,i,l)),i=qr(e,t),i!=null&&r.push(Kr(e,i,l))),e=e.return}return r}function Pn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _c(e,t,n,r,l){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,c=a.alternate,u=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&u!==null&&(a=u,l?(c=qr(n,i),c!=null&&o.unshift(Kr(n,c,a))):l||(c=qr(n,i),c!=null&&o.push(Kr(n,c,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var dx=/\r\n?/g,mx=/\u0000|\uFFFD/g;function Ac(e){return(typeof e=="string"?e:""+e).replace(dx,`
|
|
38
|
-
`).replace(mx,"")}function Es(e,t,n){if(t=Ac(t),Ac(e)!==t&&n)throw Error(F(425))}function fl(){}var ho=null,fo=null;function po(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 xo=typeof setTimeout=="function"?setTimeout:void 0,hx=typeof clearTimeout=="function"?clearTimeout:void 0,Fc=typeof Promise=="function"?Promise:void 0,fx=typeof queueMicrotask=="function"?queueMicrotask:typeof Fc<"u"?function(e){return Fc.resolve(null).then(e).catch(px)}:xo;function px(e){setTimeout(function(){throw e})}function Mi(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),Br(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);Br(t)}function Zt(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 $c(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ar=Math.random().toString(36).slice(2),Et="__reactFiber$"+ar,Yr="__reactProps$"+ar,Ut="__reactContainer$"+ar,go="__reactEvents$"+ar,xx="__reactListeners$"+ar,gx="__reactHandles$"+ar;function xn(e){var t=e[Et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ut]||n[Et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$c(e);e!==null;){if(n=e[Et])return n;e=$c(e)}return t}e=n,n=e.parentNode}return null}function cs(e){return e=e[Et]||e[Ut],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Un(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function Hl(e){return e[Yr]||null}var yo=[],Dn=-1;function cn(e){return{current:e}}function xe(e){0>Dn||(e.current=yo[Dn],yo[Dn]=null,Dn--)}function he(e,t){Dn++,yo[Dn]=e.current,e.current=t}var on={},Oe=cn(on),Xe=cn(!1),jn=on;function Zn(e,t){var n=e.type.contextTypes;if(!n)return on;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 pl(){xe(Xe),xe(Oe)}function Uc(e,t,n){if(Oe.current!==on)throw Error(F(168));he(Oe,t),he(Xe,n)}function Gd(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(F(108,tp(e)||"Unknown",l));return ke({},n,r)}function xl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||on,jn=Oe.current,he(Oe,e),he(Xe,Xe.current),!0}function Dc(e,t,n){var r=e.stateNode;if(!r)throw Error(F(169));n?(e=Gd(e,t,jn),r.__reactInternalMemoizedMergedChildContext=e,xe(Xe),xe(Oe),he(Oe,e)):xe(Xe),he(Xe,n)}var Lt=null,Bl=!1,Ii=!1;function Kd(e){Lt===null?Lt=[e]:Lt.push(e)}function yx(e){Bl=!0,Kd(e)}function un(){if(!Ii&&Lt!==null){Ii=!0;var e=0,t=me;try{var n=Lt;for(me=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Lt=null,Bl=!1}catch(l){throw Lt!==null&&(Lt=Lt.slice(e+1)),wd(na,un),l}finally{me=t,Ii=!1}}return null}var On=[],qn=0,gl=null,yl=0,at=[],ct=0,Nn=null,Rt=1,_t="";function fn(e,t){On[qn++]=yl,On[qn++]=gl,gl=e,yl=t}function Yd(e,t,n){at[ct++]=Rt,at[ct++]=_t,at[ct++]=Nn,Nn=e;var r=Rt;e=_t;var l=32-wt(r)-1;r&=~(1<<l),n+=1;var i=32-wt(t)+l;if(30<i){var o=l-l%5;i=(r&(1<<o)-1).toString(32),r>>=o,l-=o,Rt=1<<32-wt(t)+l|n<<l|r,_t=i+e}else Rt=1<<i|n<<l|r,_t=e}function da(e){e.return!==null&&(fn(e,1),Yd(e,1,0))}function ma(e){for(;e===gl;)gl=On[--qn],On[qn]=null,yl=On[--qn],On[qn]=null;for(;e===Nn;)Nn=at[--ct],at[ct]=null,_t=at[--ct],at[ct]=null,Rt=at[--ct],at[ct]=null}var rt=null,nt=null,ge=!1,vt=null;function Xd(e,t){var n=ut(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Oc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,rt=e,nt=Zt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,rt=e,nt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Nn!==null?{id:Rt,overflow:_t}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ut(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,rt=e,nt=null,!0):!1;default:return!1}}function vo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function wo(e){if(ge){var t=nt;if(t){var n=t;if(!Oc(e,t)){if(vo(e))throw Error(F(418));t=Zt(n.nextSibling);var r=rt;t&&Oc(e,t)?Xd(r,n):(e.flags=e.flags&-4097|2,ge=!1,rt=e)}}else{if(vo(e))throw Error(F(418));e.flags=e.flags&-4097|2,ge=!1,rt=e}}}function qc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;rt=e}function Ts(e){if(e!==rt)return!1;if(!ge)return qc(e),ge=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!po(e.type,e.memoizedProps)),t&&(t=nt)){if(vo(e))throw Jd(),Error(F(418));for(;t;)Xd(e,t),t=Zt(t.nextSibling)}if(qc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){nt=Zt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}nt=null}}else nt=rt?Zt(e.stateNode.nextSibling):null;return!0}function Jd(){for(var e=nt;e;)e=Zt(e.nextSibling)}function er(){nt=rt=null,ge=!1}function ha(e){vt===null?vt=[e]:vt.push(e)}var vx=qt.ReactCurrentBatchConfig;function kr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(F(309));var r=n.stateNode}if(!r)throw Error(F(147,e));var l=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=l.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(F(284));if(!n._owner)throw Error(F(290,e))}return e}function Ms(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Wc(e){var t=e._init;return t(e._payload)}function Zd(e){function t(x,h){if(e){var g=x.deletions;g===null?(x.deletions=[h],x.flags|=16):g.push(h)}}function n(x,h){if(!e)return null;for(;h!==null;)t(x,h),h=h.sibling;return null}function r(x,h){for(x=new Map;h!==null;)h.key!==null?x.set(h.key,h):x.set(h.index,h),h=h.sibling;return x}function l(x,h){return x=rn(x,h),x.index=0,x.sibling=null,x}function i(x,h,g){return x.index=g,e?(g=x.alternate,g!==null?(g=g.index,g<h?(x.flags|=2,h):g):(x.flags|=2,h)):(x.flags|=1048576,h)}function o(x){return e&&x.alternate===null&&(x.flags|=2),x}function a(x,h,g,y){return h===null||h.tag!==6?(h=Fi(g,x.mode,y),h.return=x,h):(h=l(h,g),h.return=x,h)}function c(x,h,g,y){var N=g.type;return N===_n?d(x,h,g.props.children,y,g.key):h!==null&&(h.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ht&&Wc(N)===h.type)?(y=l(h,g.props),y.ref=kr(x,h,g),y.return=x,y):(y=Zs(g.type,g.key,g.props,null,x.mode,y),y.ref=kr(x,h,g),y.return=x,y)}function u(x,h,g,y){return h===null||h.tag!==4||h.stateNode.containerInfo!==g.containerInfo||h.stateNode.implementation!==g.implementation?(h=$i(g,x.mode,y),h.return=x,h):(h=l(h,g.children||[]),h.return=x,h)}function d(x,h,g,y,N){return h===null||h.tag!==7?(h=wn(g,x.mode,y,N),h.return=x,h):(h=l(h,g),h.return=x,h)}function m(x,h,g){if(typeof h=="string"&&h!==""||typeof h=="number")return h=Fi(""+h,x.mode,g),h.return=x,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case ys:return g=Zs(h.type,h.key,h.props,null,x.mode,g),g.ref=kr(x,null,h),g.return=x,g;case Rn:return h=$i(h,x.mode,g),h.return=x,h;case Ht:var y=h._init;return m(x,y(h._payload),g)}if(Sr(h)||xr(h))return h=wn(h,x.mode,g,null),h.return=x,h;Ms(x,h)}return null}function f(x,h,g,y){var N=h!==null?h.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return N!==null?null:a(x,h,""+g,y);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ys:return g.key===N?c(x,h,g,y):null;case Rn:return g.key===N?u(x,h,g,y):null;case Ht:return N=g._init,f(x,h,N(g._payload),y)}if(Sr(g)||xr(g))return N!==null?null:d(x,h,g,y,null);Ms(x,g)}return null}function v(x,h,g,y,N){if(typeof y=="string"&&y!==""||typeof y=="number")return x=x.get(g)||null,a(h,x,""+y,N);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ys:return x=x.get(y.key===null?g:y.key)||null,c(h,x,y,N);case Rn:return x=x.get(y.key===null?g:y.key)||null,u(h,x,y,N);case Ht:var S=y._init;return v(x,h,g,S(y._payload),N)}if(Sr(y)||xr(y))return x=x.get(g)||null,d(h,x,y,N,null);Ms(h,y)}return null}function k(x,h,g,y){for(var N=null,S=null,P=h,T=h=0,O=null;P!==null&&T<g.length;T++){P.index>T?(O=P,P=null):O=P.sibling;var R=f(x,P,g[T],y);if(R===null){P===null&&(P=O);break}e&&P&&R.alternate===null&&t(x,P),h=i(R,h,T),S===null?N=R:S.sibling=R,S=R,P=O}if(T===g.length)return n(x,P),ge&&fn(x,T),N;if(P===null){for(;T<g.length;T++)P=m(x,g[T],y),P!==null&&(h=i(P,h,T),S===null?N=P:S.sibling=P,S=P);return ge&&fn(x,T),N}for(P=r(x,P);T<g.length;T++)O=v(P,x,T,g[T],y),O!==null&&(e&&O.alternate!==null&&P.delete(O.key===null?T:O.key),h=i(O,h,T),S===null?N=O:S.sibling=O,S=O);return e&&P.forEach(function(V){return t(x,V)}),ge&&fn(x,T),N}function w(x,h,g,y){var N=xr(g);if(typeof N!="function")throw Error(F(150));if(g=N.call(g),g==null)throw Error(F(151));for(var S=N=null,P=h,T=h=0,O=null,R=g.next();P!==null&&!R.done;T++,R=g.next()){P.index>T?(O=P,P=null):O=P.sibling;var V=f(x,P,R.value,y);if(V===null){P===null&&(P=O);break}e&&P&&V.alternate===null&&t(x,P),h=i(V,h,T),S===null?N=V:S.sibling=V,S=V,P=O}if(R.done)return n(x,P),ge&&fn(x,T),N;if(P===null){for(;!R.done;T++,R=g.next())R=m(x,R.value,y),R!==null&&(h=i(R,h,T),S===null?N=R:S.sibling=R,S=R);return ge&&fn(x,T),N}for(P=r(x,P);!R.done;T++,R=g.next())R=v(P,x,T,R.value,y),R!==null&&(e&&R.alternate!==null&&P.delete(R.key===null?T:R.key),h=i(R,h,T),S===null?N=R:S.sibling=R,S=R);return e&&P.forEach(function(C){return t(x,C)}),ge&&fn(x,T),N}function j(x,h,g,y){if(typeof g=="object"&&g!==null&&g.type===_n&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ys:e:{for(var N=g.key,S=h;S!==null;){if(S.key===N){if(N=g.type,N===_n){if(S.tag===7){n(x,S.sibling),h=l(S,g.props.children),h.return=x,x=h;break e}}else if(S.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ht&&Wc(N)===S.type){n(x,S.sibling),h=l(S,g.props),h.ref=kr(x,S,g),h.return=x,x=h;break e}n(x,S);break}else t(x,S);S=S.sibling}g.type===_n?(h=wn(g.props.children,x.mode,y,g.key),h.return=x,x=h):(y=Zs(g.type,g.key,g.props,null,x.mode,y),y.ref=kr(x,h,g),y.return=x,x=y)}return o(x);case Rn:e:{for(S=g.key;h!==null;){if(h.key===S)if(h.tag===4&&h.stateNode.containerInfo===g.containerInfo&&h.stateNode.implementation===g.implementation){n(x,h.sibling),h=l(h,g.children||[]),h.return=x,x=h;break e}else{n(x,h);break}else t(x,h);h=h.sibling}h=$i(g,x.mode,y),h.return=x,x=h}return o(x);case Ht:return S=g._init,j(x,h,S(g._payload),y)}if(Sr(g))return k(x,h,g,y);if(xr(g))return w(x,h,g,y);Ms(x,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,h!==null&&h.tag===6?(n(x,h.sibling),h=l(h,g),h.return=x,x=h):(n(x,h),h=Fi(g,x.mode,y),h.return=x,x=h),o(x)):n(x,h)}return j}var tr=Zd(!0),em=Zd(!1),vl=cn(null),wl=null,Wn=null,fa=null;function pa(){fa=Wn=wl=null}function xa(e){var t=vl.current;xe(vl),e._currentValue=t}function ko(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 Yn(e,t){wl=e,fa=Wn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ye=!0),e.firstContext=null)}function mt(e){var t=e._currentValue;if(fa!==e)if(e={context:e,memoizedValue:t,next:null},Wn===null){if(wl===null)throw Error(F(308));Wn=e,wl.dependencies={lanes:0,firstContext:e}}else Wn=Wn.next=e;return t}var gn=null;function ga(e){gn===null?gn=[e]:gn.push(e)}function tm(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,ga(t)):(n.next=l.next,l.next=n),t.interleaved=n,Dt(e,r)}function Dt(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 Bt=!1;function ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nm(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 At(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function en(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ie&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Dt(e,n)}return l=r.interleaved,l===null?(t.next=t,ga(r)):(t.next=l.next,l.next=t),r.interleaved=t,Dt(e,n)}function Qs(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,ra(e,n)}}function Hc(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 o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=o:i=i.next=o,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 kl(e,t,n,r){var l=e.updateQueue;Bt=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var c=a,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=c))}if(i!==null){var m=l.baseState;o=0,d=u=c=null,a=i;do{var f=a.lane,v=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var k=e,w=a;switch(f=t,v=n,w.tag){case 1:if(k=w.payload,typeof k=="function"){m=k.call(v,m,f);break e}m=k;break e;case 3:k.flags=k.flags&-65537|128;case 0:if(k=w.payload,f=typeof k=="function"?k.call(v,m,f):k,f==null)break e;m=ke({},m,f);break e;case 2:Bt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=l.effects,f===null?l.effects=[a]:f.push(a))}else v={eventTime:v,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=v,c=m):d=d.next=v,o|=f;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;f=a,a=f.next,f.next=null,l.lastBaseUpdate=f,l.shared.pending=null}}while(!0);if(d===null&&(c=m),l.baseState=c,l.firstBaseUpdate=u,l.lastBaseUpdate=d,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Sn|=o,e.lanes=o,e.memoizedState=m}}function Bc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(F(191,l));l.call(r)}}}var us={},Mt=cn(us),Xr=cn(us),Jr=cn(us);function yn(e){if(e===us)throw Error(F(174));return e}function va(e,t){switch(he(Jr,t),he(Xr,e),he(Mt,us),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:eo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=eo(t,e)}xe(Mt),he(Mt,t)}function nr(){xe(Mt),xe(Xr),xe(Jr)}function rm(e){yn(Jr.current);var t=yn(Mt.current),n=eo(t,e.type);t!==n&&(he(Xr,e),he(Mt,n))}function wa(e){Xr.current===e&&(xe(Mt),xe(Xr))}var ve=cn(0);function jl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pi=[];function ka(){for(var e=0;e<Pi.length;e++)Pi[e]._workInProgressVersionPrimary=null;Pi.length=0}var Gs=qt.ReactCurrentDispatcher,zi=qt.ReactCurrentBatchConfig,bn=0,we=null,Te=null,ze=null,Nl=!1,Rr=!1,Zr=0,wx=0;function $e(){throw Error(F(321))}function ja(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jt(e[n],t[n]))return!1;return!0}function Na(e,t,n,r,l,i){if(bn=i,we=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Gs.current=e===null||e.memoizedState===null?bx:Sx,e=n(r,l),Rr){i=0;do{if(Rr=!1,Zr=0,25<=i)throw Error(F(301));i+=1,ze=Te=null,t.updateQueue=null,Gs.current=Cx,e=n(r,l)}while(Rr)}if(Gs.current=bl,t=Te!==null&&Te.next!==null,bn=0,ze=Te=we=null,Nl=!1,t)throw Error(F(300));return e}function ba(){var e=Zr!==0;return Zr=0,e}function St(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ze===null?we.memoizedState=ze=e:ze=ze.next=e,ze}function ht(){if(Te===null){var e=we.alternate;e=e!==null?e.memoizedState:null}else e=Te.next;var t=ze===null?we.memoizedState:ze.next;if(t!==null)ze=t,Te=e;else{if(e===null)throw Error(F(310));Te=e,e={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},ze===null?we.memoizedState=ze=e:ze=ze.next=e}return ze}function es(e,t){return typeof t=="function"?t(e):t}function Li(e){var t=ht(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var r=Te,l=r.baseQueue,i=n.pending;if(i!==null){if(l!==null){var o=l.next;l.next=i.next,i.next=o}r.baseQueue=l=i,n.pending=null}if(l!==null){i=l.next,r=r.baseState;var a=o=null,c=null,u=i;do{var d=u.lane;if((bn&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var m={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=m,o=r):c=c.next=m,we.lanes|=d,Sn|=d}u=u.next}while(u!==null&&u!==i);c===null?o=r:c.next=a,jt(r,t.memoizedState)||(Ye=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do i=l.lane,we.lanes|=i,Sn|=i,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ri(e){var t=ht(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,i=t.memoizedState;if(l!==null){n.pending=null;var o=l=l.next;do i=e(i,o.action),o=o.next;while(o!==l);jt(i,t.memoizedState)||(Ye=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function sm(){}function lm(e,t){var n=we,r=ht(),l=t(),i=!jt(r.memoizedState,l);if(i&&(r.memoizedState=l,Ye=!0),r=r.queue,Sa(am.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||ze!==null&&ze.memoizedState.tag&1){if(n.flags|=2048,ts(9,om.bind(null,n,r,l,t),void 0,null),Le===null)throw Error(F(349));bn&30||im(n,t,l)}return l}function im(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=we.updateQueue,t===null?(t={lastEffect:null,stores:null},we.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function om(e,t,n,r){t.value=n,t.getSnapshot=r,cm(t)&&um(e)}function am(e,t,n){return n(function(){cm(t)&&um(e)})}function cm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jt(e,n)}catch{return!0}}function um(e){var t=Dt(e,1);t!==null&&kt(t,e,1,-1)}function Vc(e){var t=St();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:es,lastRenderedState:e},t.queue=e,e=e.dispatch=Nx.bind(null,we,e),[t.memoizedState,e]}function ts(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=we.updateQueue,t===null?(t={lastEffect:null,stores:null},we.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function dm(){return ht().memoizedState}function Ks(e,t,n,r){var l=St();we.flags|=e,l.memoizedState=ts(1|t,n,void 0,r===void 0?null:r)}function Vl(e,t,n,r){var l=ht();r=r===void 0?null:r;var i=void 0;if(Te!==null){var o=Te.memoizedState;if(i=o.destroy,r!==null&&ja(r,o.deps)){l.memoizedState=ts(t,n,i,r);return}}we.flags|=e,l.memoizedState=ts(1|t,n,i,r)}function Qc(e,t){return Ks(8390656,8,e,t)}function Sa(e,t){return Vl(2048,8,e,t)}function mm(e,t){return Vl(4,2,e,t)}function hm(e,t){return Vl(4,4,e,t)}function fm(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function pm(e,t,n){return n=n!=null?n.concat([e]):null,Vl(4,4,fm.bind(null,t,e),n)}function Ca(){}function xm(e,t){var n=ht();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ja(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gm(e,t){var n=ht();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ja(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ym(e,t,n){return bn&21?(jt(n,t)||(n=Nd(),we.lanes|=n,Sn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ye=!0),e.memoizedState=n)}function kx(e,t){var n=me;me=n!==0&&4>n?n:4,e(!0);var r=zi.transition;zi.transition={};try{e(!1),t()}finally{me=n,zi.transition=r}}function vm(){return ht().memoizedState}function jx(e,t,n){var r=nn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},wm(e))km(t,n);else if(n=tm(e,t,n,r),n!==null){var l=Be();kt(n,e,r,l),jm(n,t,r)}}function Nx(e,t,n){var r=nn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(wm(e))km(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(l.hasEagerState=!0,l.eagerState=a,jt(a,o)){var c=t.interleaved;c===null?(l.next=l,ga(t)):(l.next=c.next,c.next=l),t.interleaved=l;return}}catch{}finally{}n=tm(e,t,l,r),n!==null&&(l=Be(),kt(n,e,r,l),jm(n,t,r))}}function wm(e){var t=e.alternate;return e===we||t!==null&&t===we}function km(e,t){Rr=Nl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ra(e,n)}}var bl={readContext:mt,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},bx={readContext:mt,useCallback:function(e,t){return St().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:Qc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ks(4194308,4,fm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ks(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ks(4,2,e,t)},useMemo:function(e,t){var n=St();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=St();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=jx.bind(null,we,e),[r.memoizedState,e]},useRef:function(e){var t=St();return e={current:e},t.memoizedState=e},useState:Vc,useDebugValue:Ca,useDeferredValue:function(e){return St().memoizedState=e},useTransition:function(){var e=Vc(!1),t=e[0];return e=kx.bind(null,e[1]),St().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=we,l=St();if(ge){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),Le===null)throw Error(F(349));bn&30||im(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Qc(am.bind(null,r,i,e),[e]),r.flags|=2048,ts(9,om.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=St(),t=Le.identifierPrefix;if(ge){var n=_t,r=Rt;n=(r&~(1<<32-wt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Zr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=wx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Sx={readContext:mt,useCallback:xm,useContext:mt,useEffect:Sa,useImperativeHandle:pm,useInsertionEffect:mm,useLayoutEffect:hm,useMemo:gm,useReducer:Li,useRef:dm,useState:function(){return Li(es)},useDebugValue:Ca,useDeferredValue:function(e){var t=ht();return ym(t,Te.memoizedState,e)},useTransition:function(){var e=Li(es)[0],t=ht().memoizedState;return[e,t]},useMutableSource:sm,useSyncExternalStore:lm,useId:vm,unstable_isNewReconciler:!1},Cx={readContext:mt,useCallback:xm,useContext:mt,useEffect:Sa,useImperativeHandle:pm,useInsertionEffect:mm,useLayoutEffect:hm,useMemo:gm,useReducer:Ri,useRef:dm,useState:function(){return Ri(es)},useDebugValue:Ca,useDeferredValue:function(e){var t=ht();return Te===null?t.memoizedState=e:ym(t,Te.memoizedState,e)},useTransition:function(){var e=Ri(es)[0],t=ht().memoizedState;return[e,t]},useMutableSource:sm,useSyncExternalStore:lm,useId:vm,unstable_isNewReconciler:!1};function gt(e,t){if(e&&e.defaultProps){t=ke({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function jo(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ke({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ql={isMounted:function(e){return(e=e._reactInternals)?Tn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Be(),l=nn(e),i=At(r,l);i.payload=t,n!=null&&(i.callback=n),t=en(e,i,l),t!==null&&(kt(t,e,l,r),Qs(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Be(),l=nn(e),i=At(r,l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=en(e,i,l),t!==null&&(kt(t,e,l,r),Qs(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Be(),r=nn(e),l=At(n,r);l.tag=2,t!=null&&(l.callback=t),t=en(e,l,r),t!==null&&(kt(t,e,r,n),Qs(t,e,r))}};function Gc(e,t,n,r,l,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Qr(n,r)||!Qr(l,i):!0}function Nm(e,t,n){var r=!1,l=on,i=t.contextType;return typeof i=="object"&&i!==null?i=mt(i):(l=Je(t)?jn:Oe.current,r=t.contextTypes,i=(r=r!=null)?Zn(e,l):on),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ql,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=i),t}function Kc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ql.enqueueReplaceState(t,t.state,null)}function No(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},ya(e);var i=t.contextType;typeof i=="object"&&i!==null?l.context=mt(i):(i=Je(t)?jn:Oe.current,l.context=Zn(e,i)),l.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(jo(e,t,i,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&Ql.enqueueReplaceState(l,l.state,null),kl(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function rr(e,t){try{var n="",r=t;do n+=ep(r),r=r.return;while(r);var l=n}catch(i){l=`
|
|
37
|
+
`+l[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=a);break}}}finally{pi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Sr(e):""}function ep(e){switch(e.tag){case 5:return Sr(e.type);case 16:return Sr("Lazy");case 13:return Sr("Suspense");case 19:return Sr("SuspenseList");case 0:case 2:case 15:return e=xi(e.type,!1),e;case 11:return e=xi(e.type.render,!1),e;case 1:return e=xi(e.type,!0),e;default:return""}}function Ki(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 _n:return"Fragment";case Rn:return"Portal";case Vi:return"Profiler";case Jo:return"StrictMode";case Qi:return"Suspense";case Gi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case nd:return(e.displayName||"Context")+".Consumer";case td:return(e._context.displayName||"Context")+".Provider";case Zo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ea:return t=e.displayName||null,t!==null?t:Ki(e.type)||"Memo";case Ht:t=e._payload,e=e._init;try{return Ki(e(t))}catch{}}return null}function tp(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 Ki(t);case 8:return t===Jo?"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 ln(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function np(e){var t=sd(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(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ws(e){e._valueTracker||(e._valueTracker=np(e))}function ld(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=sd(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ol(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 Yi(e,t){var n=t.checked;return we({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ln(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 id(e,t){t=t.checked,t!=null&&Xo(e,"checked",t,!1)}function Xi(e,t){id(e,t);var n=ln(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")?Ji(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ji(e,t.type,ln(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hc(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 Ji(e,t,n){(t!=="number"||ol(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Cr=Array.isArray;function Vn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ln(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Zi(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error($(91));return we({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function fc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error($(92));if(Cr(n)){if(1<n.length)throw Error($(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ln(n)}}function od(e,t){var n=ln(t.value),r=ln(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function pc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ad(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 eo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ad(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ks,cd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ks=ks||document.createElement("div"),ks.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ks.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function qr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ir={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},rp=["Webkit","ms","Moz","O"];Object.keys(Ir).forEach(function(e){rp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ir[t]=Ir[e]})});function ud(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ir.hasOwnProperty(e)&&Ir[e]?(""+t).trim():t+"px"}function dd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=ud(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var sp=we({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 to(e,t){if(t){if(sp[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error($(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error($(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error($(61))}if(t.style!=null&&typeof t.style!="object")throw Error($(62))}}function no(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 ro=null;function ta(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var so=null,Qn=null,Gn=null;function xc(e){if(e=us(e)){if(typeof so!="function")throw Error($(280));var t=e.stateNode;t&&(t=Bl(t),so(e.stateNode,e.type,t))}}function md(e){Qn?Gn?Gn.push(e):Gn=[e]:Qn=e}function hd(){if(Qn){var e=Qn,t=Gn;if(Gn=Qn=null,xc(e),t)for(e=0;e<t.length;e++)xc(t[e])}}function fd(e,t){return e(t)}function pd(){}var gi=!1;function xd(e,t,n){if(gi)return e(t,n);gi=!0;try{return fd(e,t,n)}finally{gi=!1,(Qn!==null||Gn!==null)&&(pd(),hd())}}function Wr(e,t){var n=e.stateNode;if(n===null)return null;var r=Bl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error($(231,t,typeof n));return n}var lo=!1;if($t)try{var yr={};Object.defineProperty(yr,"passive",{get:function(){lo=!0}}),window.addEventListener("test",yr,yr),window.removeEventListener("test",yr,yr)}catch{lo=!1}function lp(e,t,n,r,l,i,o,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Pr=!1,al=null,cl=!1,io=null,ip={onError:function(e){Pr=!0,al=e}};function op(e,t,n,r,l,i,o,a,c){Pr=!1,al=null,lp.apply(ip,arguments)}function ap(e,t,n,r,l,i,o,a,c){if(op.apply(this,arguments),Pr){if(Pr){var u=al;Pr=!1,al=null}else throw Error($(198));cl||(cl=!0,io=u)}}function Mn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function gd(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 gc(e){if(Mn(e)!==e)throw Error($(188))}function cp(e){var t=e.alternate;if(!t){if(t=Mn(e),t===null)throw Error($(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var i=l.alternate;if(i===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===i.child){for(i=l.child;i;){if(i===n)return gc(l),e;if(i===r)return gc(l),t;i=i.sibling}throw Error($(188))}if(n.return!==r.return)n=l,r=i;else{for(var o=!1,a=l.child;a;){if(a===n){o=!0,n=l,r=i;break}if(a===r){o=!0,r=l,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=l;break}if(a===r){o=!0,r=i,n=l;break}a=a.sibling}if(!o)throw Error($(189))}}if(n.alternate!==r)throw Error($(190))}if(n.tag!==3)throw Error($(188));return n.stateNode.current===n?e:t}function yd(e){return e=cp(e),e!==null?vd(e):null}function vd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=vd(e);if(t!==null)return t;e=e.sibling}return null}var wd=nt.unstable_scheduleCallback,yc=nt.unstable_cancelCallback,up=nt.unstable_shouldYield,dp=nt.unstable_requestPaint,be=nt.unstable_now,mp=nt.unstable_getCurrentPriorityLevel,na=nt.unstable_ImmediatePriority,kd=nt.unstable_UserBlockingPriority,ul=nt.unstable_NormalPriority,hp=nt.unstable_LowPriority,jd=nt.unstable_IdlePriority,Ol=null,Mt=null;function fp(e){if(Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(Ol,e,void 0,(e.current.flags&128)===128)}catch{}}var wt=Math.clz32?Math.clz32:gp,pp=Math.log,xp=Math.LN2;function gp(e){return e>>>=0,e===0?32:31-(pp(e)/xp|0)|0}var js=64,Ns=4194304;function Er(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 dl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~l;a!==0?r=Er(a):(i&=o,i!==0&&(r=Er(i)))}else o=n&~l,o!==0?r=Er(o):i!==0&&(r=Er(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;0<t;)n=31-wt(t),l=1<<n,r|=e[n],t&=~l;return r}function yp(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 vp(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-wt(i),a=1<<o,c=l[o];c===-1?(!(a&n)||a&r)&&(l[o]=yp(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}function oo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Nd(){var e=js;return js<<=1,!(js&4194240)&&(js=64),e}function yi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function as(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wt(t),e[t]=n}function wp(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var l=31-wt(n),i=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~i}}function ra(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wt(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var me=0;function bd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Sd,sa,Cd,Ed,Md,ao=!1,bs=[],Yt=null,Xt=null,Jt=null,Hr=new Map,Br=new Map,Vt=[],kp="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 vc(e,t){switch(e){case"focusin":case"focusout":Yt=null;break;case"dragenter":case"dragleave":Xt=null;break;case"mouseover":case"mouseout":Jt=null;break;case"pointerover":case"pointerout":Hr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Br.delete(t.pointerId)}}function vr(e,t,n,r,l,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[l]},t!==null&&(t=us(t),t!==null&&sa(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function jp(e,t,n,r,l){switch(t){case"focusin":return Yt=vr(Yt,e,t,n,r,l),!0;case"dragenter":return Xt=vr(Xt,e,t,n,r,l),!0;case"mouseover":return Jt=vr(Jt,e,t,n,r,l),!0;case"pointerover":var i=l.pointerId;return Hr.set(i,vr(Hr.get(i)||null,e,t,n,r,l)),!0;case"gotpointercapture":return i=l.pointerId,Br.set(i,vr(Br.get(i)||null,e,t,n,r,l)),!0}return!1}function Td(e){var t=xn(e.target);if(t!==null){var n=Mn(t);if(n!==null){if(t=n.tag,t===13){if(t=gd(n),t!==null){e.blockedOn=t,Md(e.priority,function(){Cd(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Bs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=co(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ro=r,n.target.dispatchEvent(r),ro=null}else return t=us(n),t!==null&&sa(t),e.blockedOn=n,!1;t.shift()}return!0}function wc(e,t,n){Bs(e)&&n.delete(t)}function Np(){ao=!1,Yt!==null&&Bs(Yt)&&(Yt=null),Xt!==null&&Bs(Xt)&&(Xt=null),Jt!==null&&Bs(Jt)&&(Jt=null),Hr.forEach(wc),Br.forEach(wc)}function wr(e,t){e.blockedOn===t&&(e.blockedOn=null,ao||(ao=!0,nt.unstable_scheduleCallback(nt.unstable_NormalPriority,Np)))}function Vr(e){function t(l){return wr(l,e)}if(0<bs.length){wr(bs[0],e);for(var n=1;n<bs.length;n++){var r=bs[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Yt!==null&&wr(Yt,e),Xt!==null&&wr(Xt,e),Jt!==null&&wr(Jt,e),Hr.forEach(t),Br.forEach(t),n=0;n<Vt.length;n++)r=Vt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Vt.length&&(n=Vt[0],n.blockedOn===null);)Td(n),n.blockedOn===null&&Vt.shift()}var Kn=qt.ReactCurrentBatchConfig,ml=!0;function bp(e,t,n,r){var l=me,i=Kn.transition;Kn.transition=null;try{me=1,la(e,t,n,r)}finally{me=l,Kn.transition=i}}function Sp(e,t,n,r){var l=me,i=Kn.transition;Kn.transition=null;try{me=4,la(e,t,n,r)}finally{me=l,Kn.transition=i}}function la(e,t,n,r){if(ml){var l=co(e,t,n,r);if(l===null)Mi(e,t,r,hl,n),vc(e,r);else if(jp(l,e,t,n,r))r.stopPropagation();else if(vc(e,r),t&4&&-1<kp.indexOf(e)){for(;l!==null;){var i=us(l);if(i!==null&&Sd(i),i=co(e,t,n,r),i===null&&Mi(e,t,r,hl,n),i===l)break;l=i}l!==null&&r.stopPropagation()}else Mi(e,t,r,null,n)}}var hl=null;function co(e,t,n,r){if(hl=null,e=ta(r),e=xn(e),e!==null)if(t=Mn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=gd(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return hl=e,null}function Id(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(mp()){case na:return 1;case kd:return 4;case ul:case hp:return 16;case jd:return 536870912;default:return 16}default:return 16}}var Gt=null,ia=null,Vs=null;function Pd(){if(Vs)return Vs;var e,t=ia,n=t.length,r,l="value"in Gt?Gt.value:Gt.textContent,i=l.length;for(e=0;e<n&&t[e]===l[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===l[i-r];r++);return Vs=l.slice(e,1<r?1-r:void 0)}function Qs(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 Ss(){return!0}function kc(){return!1}function st(e){function t(n,r,l,i,o){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ss:kc,this.isPropagationStopped=kc,this}return we(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ss)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ss)},persist:function(){},isPersistent:Ss}),t}var or={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oa=st(or),cs=we({},or,{view:0,detail:0}),Cp=st(cs),vi,wi,kr,ql=we({},cs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:aa,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!==kr&&(kr&&e.type==="mousemove"?(vi=e.screenX-kr.screenX,wi=e.screenY-kr.screenY):wi=vi=0,kr=e),vi)},movementY:function(e){return"movementY"in e?e.movementY:wi}}),jc=st(ql),Ep=we({},ql,{dataTransfer:0}),Mp=st(Ep),Tp=we({},cs,{relatedTarget:0}),ki=st(Tp),Ip=we({},or,{animationName:0,elapsedTime:0,pseudoElement:0}),Pp=st(Ip),zp=we({},or,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lp=st(zp),Rp=we({},or,{data:0}),Nc=st(Rp),_p={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ap={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"},Fp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $p(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fp[e])?!!t[e]:!1}function aa(){return $p}var Up=we({},cs,{key:function(e){if(e.key){var t=_p[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Qs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ap[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:aa,charCode:function(e){return e.type==="keypress"?Qs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Qs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Dp=st(Up),Op=we({},ql,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bc=st(Op),qp=we({},cs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:aa}),Wp=st(qp),Hp=we({},or,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bp=st(Hp),Vp=we({},ql,{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}),Qp=st(Vp),Gp=[9,13,27,32],ca=$t&&"CompositionEvent"in window,zr=null;$t&&"documentMode"in document&&(zr=document.documentMode);var Kp=$t&&"TextEvent"in window&&!zr,zd=$t&&(!ca||zr&&8<zr&&11>=zr),Sc=" ",Cc=!1;function Ld(e,t){switch(e){case"keyup":return Gp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var An=!1;function Yp(e,t){switch(e){case"compositionend":return Rd(t);case"keypress":return t.which!==32?null:(Cc=!0,Sc);case"textInput":return e=t.data,e===Sc&&Cc?null:e;default:return null}}function Xp(e,t){if(An)return e==="compositionend"||!ca&&Ld(e,t)?(e=Pd(),Vs=ia=Gt=null,An=!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 zd&&t.locale!=="ko"?null:t.data;default:return null}}var Jp={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"?!!Jp[e.type]:t==="textarea"}function _d(e,t,n,r){md(r),t=fl(t,"onChange"),0<t.length&&(n=new oa("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Lr=null,Qr=null;function Zp(e){Vd(e,0)}function Wl(e){var t=Un(e);if(ld(t))return e}function ex(e,t){if(e==="change")return t}var Ad=!1;if($t){var ji;if($t){var Ni="oninput"in document;if(!Ni){var Mc=document.createElement("div");Mc.setAttribute("oninput","return;"),Ni=typeof Mc.oninput=="function"}ji=Ni}else ji=!1;Ad=ji&&(!document.documentMode||9<document.documentMode)}function Tc(){Lr&&(Lr.detachEvent("onpropertychange",Fd),Qr=Lr=null)}function Fd(e){if(e.propertyName==="value"&&Wl(Qr)){var t=[];_d(t,Qr,e,ta(e)),xd(Zp,t)}}function tx(e,t,n){e==="focusin"?(Tc(),Lr=t,Qr=n,Lr.attachEvent("onpropertychange",Fd)):e==="focusout"&&Tc()}function nx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wl(Qr)}function rx(e,t){if(e==="click")return Wl(t)}function sx(e,t){if(e==="input"||e==="change")return Wl(t)}function lx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jt=typeof Object.is=="function"?Object.is:lx;function Gr(e,t){if(jt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!Bi.call(t,l)||!jt(e[l],t[l]))return!1}return!0}function Ic(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pc(e,t){var n=Ic(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ic(n)}}function $d(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$d(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ud(){for(var e=window,t=ol();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ol(e.document)}return t}function ua(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 ix(e){var t=Ud(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&$d(n.ownerDocument.documentElement,n)){if(r!==null&&ua(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=Pc(n,i);var o=Pc(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ox=$t&&"documentMode"in document&&11>=document.documentMode,Fn=null,uo=null,Rr=null,mo=!1;function zc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mo||Fn==null||Fn!==ol(r)||(r=Fn,"selectionStart"in r&&ua(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}),Rr&&Gr(Rr,r)||(Rr=r,r=fl(uo,"onSelect"),0<r.length&&(t=new oa("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Fn)))}function Cs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $n={animationend:Cs("Animation","AnimationEnd"),animationiteration:Cs("Animation","AnimationIteration"),animationstart:Cs("Animation","AnimationStart"),transitionend:Cs("Transition","TransitionEnd")},bi={},Dd={};$t&&(Dd=document.createElement("div").style,"AnimationEvent"in window||(delete $n.animationend.animation,delete $n.animationiteration.animation,delete $n.animationstart.animation),"TransitionEvent"in window||delete $n.transitionend.transition);function Hl(e){if(bi[e])return bi[e];if(!$n[e])return e;var t=$n[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Dd)return bi[e]=t[n];return e}var Od=Hl("animationend"),qd=Hl("animationiteration"),Wd=Hl("animationstart"),Hd=Hl("transitionend"),Bd=new Map,Lc="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 an(e,t){Bd.set(e,t),En(t,[e])}for(var Si=0;Si<Lc.length;Si++){var Ci=Lc[Si],ax=Ci.toLowerCase(),cx=Ci[0].toUpperCase()+Ci.slice(1);an(ax,"on"+cx)}an(Od,"onAnimationEnd");an(qd,"onAnimationIteration");an(Wd,"onAnimationStart");an("dblclick","onDoubleClick");an("focusin","onFocus");an("focusout","onBlur");an(Hd,"onTransitionEnd");Jn("onMouseEnter",["mouseout","mouseover"]);Jn("onMouseLeave",["mouseout","mouseover"]);Jn("onPointerEnter",["pointerout","pointerover"]);Jn("onPointerLeave",["pointerout","pointerover"]);En("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));En("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));En("onBeforeInput",["compositionend","keypress","textInput","paste"]);En("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));En("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));En("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mr="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(" "),ux=new Set("cancel close invalid load scroll toggle".split(" ").concat(Mr));function Rc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,ap(r,t,void 0,e),e.currentTarget=null}function Vd(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==i&&l.isPropagationStopped())break e;Rc(l,a,u),i=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,u=a.currentTarget,a=a.listener,c!==i&&l.isPropagationStopped())break e;Rc(l,a,u),i=c}}}if(cl)throw e=io,cl=!1,io=null,e}function fe(e,t){var n=t[go];n===void 0&&(n=t[go]=new Set);var r=e+"__bubble";n.has(r)||(Qd(t,e,2,!1),n.add(r))}function Ei(e,t,n){var r=0;t&&(r|=4),Qd(n,e,r,t)}var Es="_reactListening"+Math.random().toString(36).slice(2);function Kr(e){if(!e[Es]){e[Es]=!0,ed.forEach(function(n){n!=="selectionchange"&&(ux.has(n)||Ei(n,!1,e),Ei(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Es]||(t[Es]=!0,Ei("selectionchange",!1,t))}}function Qd(e,t,n,r){switch(Id(t)){case 1:var l=bp;break;case 4:l=Sp;break;default:l=la}n=l.bind(null,t,n,e),l=void 0,!lo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Mi(e,t,n,r,l){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===l||a.nodeType===8&&a.parentNode===l)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===l||c.nodeType===8&&c.parentNode===l))return;o=o.return}for(;a!==null;){if(o=xn(a),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}a=a.parentNode}}r=r.return}xd(function(){var u=i,d=ta(n),m=[];e:{var f=Bd.get(e);if(f!==void 0){var y=oa,w=e;switch(e){case"keypress":if(Qs(n)===0)break e;case"keydown":case"keyup":y=Dp;break;case"focusin":w="focus",y=ki;break;case"focusout":w="blur",y=ki;break;case"beforeblur":case"afterblur":y=ki;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=jc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=Mp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Wp;break;case Od:case qd:case Wd:y=Pp;break;case Hd:y=Bp;break;case"scroll":y=Cp;break;case"wheel":y=Qp;break;case"copy":case"cut":case"paste":y=Lp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=bc}var k=(t&4)!==0,j=!k&&e==="scroll",g=k?f!==null?f+"Capture":null:f;k=[];for(var h=u,x;h!==null;){x=h;var v=x.stateNode;if(x.tag===5&&v!==null&&(x=v,g!==null&&(v=Wr(h,g),v!=null&&k.push(Yr(h,v,x)))),j)break;h=h.return}0<k.length&&(f=new y(f,w,null,n,d),m.push({event:f,listeners:k}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",f&&n!==ro&&(w=n.relatedTarget||n.fromElement)&&(xn(w)||w[Ut]))break e;if((y||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,y?(w=n.relatedTarget||n.toElement,y=u,w=w?xn(w):null,w!==null&&(j=Mn(w),w!==j||w.tag!==5&&w.tag!==6)&&(w=null)):(y=null,w=u),y!==w)){if(k=jc,v="onMouseLeave",g="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(k=bc,v="onPointerLeave",g="onPointerEnter",h="pointer"),j=y==null?f:Un(y),x=w==null?f:Un(w),f=new k(v,h+"leave",y,n,d),f.target=j,f.relatedTarget=x,v=null,xn(d)===u&&(k=new k(g,h+"enter",w,n,d),k.target=x,k.relatedTarget=j,v=k),j=v,y&&w)t:{for(k=y,g=w,h=0,x=k;x;x=Pn(x))h++;for(x=0,v=g;v;v=Pn(v))x++;for(;0<h-x;)k=Pn(k),h--;for(;0<x-h;)g=Pn(g),x--;for(;h--;){if(k===g||g!==null&&k===g.alternate)break t;k=Pn(k),g=Pn(g)}k=null}else k=null;y!==null&&_c(m,f,y,k,!1),w!==null&&j!==null&&_c(m,j,w,k,!0)}}e:{if(f=u?Un(u):window,y=f.nodeName&&f.nodeName.toLowerCase(),y==="select"||y==="input"&&f.type==="file")var N=ex;else if(Ec(f))if(Ad)N=sx;else{N=nx;var S=tx}else(y=f.nodeName)&&y.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(N=rx);if(N&&(N=N(e,u))){_d(m,N,n,d);break e}S&&S(e,f,u),e==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&Ji(f,"number",f.value)}switch(S=u?Un(u):window,e){case"focusin":(Ec(S)||S.contentEditable==="true")&&(Fn=S,uo=u,Rr=null);break;case"focusout":Rr=uo=Fn=null;break;case"mousedown":mo=!0;break;case"contextmenu":case"mouseup":case"dragend":mo=!1,zc(m,n,d);break;case"selectionchange":if(ox)break;case"keydown":case"keyup":zc(m,n,d)}var T;if(ca)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else An?Ld(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(zd&&n.locale!=="ko"&&(An||M!=="onCompositionStart"?M==="onCompositionEnd"&&An&&(T=Pd()):(Gt=d,ia="value"in Gt?Gt.value:Gt.textContent,An=!0)),S=fl(u,M),0<S.length&&(M=new Nc(M,e,null,n,d),m.push({event:M,listeners:S}),T?M.data=T:(T=Rd(n),T!==null&&(M.data=T)))),(T=Kp?Yp(e,n):Xp(e,n))&&(u=fl(u,"onBeforeInput"),0<u.length&&(d=new Nc("onBeforeInput","beforeinput",null,n,d),m.push({event:d,listeners:u}),d.data=T))}Vd(m,t)})}function Yr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fl(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,i=l.stateNode;l.tag===5&&i!==null&&(l=i,i=Wr(e,n),i!=null&&r.unshift(Yr(e,i,l)),i=Wr(e,t),i!=null&&r.push(Yr(e,i,l))),e=e.return}return r}function Pn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _c(e,t,n,r,l){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,c=a.alternate,u=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&u!==null&&(a=u,l?(c=Wr(n,i),c!=null&&o.unshift(Yr(n,c,a))):l||(c=Wr(n,i),c!=null&&o.push(Yr(n,c,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var dx=/\r\n?/g,mx=/\u0000|\uFFFD/g;function Ac(e){return(typeof e=="string"?e:""+e).replace(dx,`
|
|
38
|
+
`).replace(mx,"")}function Ms(e,t,n){if(t=Ac(t),Ac(e)!==t&&n)throw Error($(425))}function pl(){}var ho=null,fo=null;function po(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 xo=typeof setTimeout=="function"?setTimeout:void 0,hx=typeof clearTimeout=="function"?clearTimeout:void 0,Fc=typeof Promise=="function"?Promise:void 0,fx=typeof queueMicrotask=="function"?queueMicrotask:typeof Fc<"u"?function(e){return Fc.resolve(null).then(e).catch(px)}:xo;function px(e){setTimeout(function(){throw e})}function Ti(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),Vr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);Vr(t)}function Zt(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 $c(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ar=Math.random().toString(36).slice(2),Et="__reactFiber$"+ar,Xr="__reactProps$"+ar,Ut="__reactContainer$"+ar,go="__reactEvents$"+ar,xx="__reactListeners$"+ar,gx="__reactHandles$"+ar;function xn(e){var t=e[Et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ut]||n[Et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$c(e);e!==null;){if(n=e[Et])return n;e=$c(e)}return t}e=n,n=e.parentNode}return null}function us(e){return e=e[Et]||e[Ut],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Un(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error($(33))}function Bl(e){return e[Xr]||null}var yo=[],Dn=-1;function cn(e){return{current:e}}function pe(e){0>Dn||(e.current=yo[Dn],yo[Dn]=null,Dn--)}function he(e,t){Dn++,yo[Dn]=e.current,e.current=t}var on={},De=cn(on),Ke=cn(!1),jn=on;function Zn(e,t){var n=e.type.contextTypes;if(!n)return on;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 Ye(e){return e=e.childContextTypes,e!=null}function xl(){pe(Ke),pe(De)}function Uc(e,t,n){if(De.current!==on)throw Error($(168));he(De,t),he(Ke,n)}function Gd(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($(108,tp(e)||"Unknown",l));return we({},n,r)}function gl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||on,jn=De.current,he(De,e),he(Ke,Ke.current),!0}function Dc(e,t,n){var r=e.stateNode;if(!r)throw Error($(169));n?(e=Gd(e,t,jn),r.__reactInternalMemoizedMergedChildContext=e,pe(Ke),pe(De),he(De,e)):pe(Ke),he(Ke,n)}var Lt=null,Vl=!1,Ii=!1;function Kd(e){Lt===null?Lt=[e]:Lt.push(e)}function yx(e){Vl=!0,Kd(e)}function un(){if(!Ii&&Lt!==null){Ii=!0;var e=0,t=me;try{var n=Lt;for(me=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Lt=null,Vl=!1}catch(l){throw Lt!==null&&(Lt=Lt.slice(e+1)),wd(na,un),l}finally{me=t,Ii=!1}}return null}var On=[],qn=0,yl=null,vl=0,ot=[],at=0,Nn=null,Rt=1,_t="";function fn(e,t){On[qn++]=vl,On[qn++]=yl,yl=e,vl=t}function Yd(e,t,n){ot[at++]=Rt,ot[at++]=_t,ot[at++]=Nn,Nn=e;var r=Rt;e=_t;var l=32-wt(r)-1;r&=~(1<<l),n+=1;var i=32-wt(t)+l;if(30<i){var o=l-l%5;i=(r&(1<<o)-1).toString(32),r>>=o,l-=o,Rt=1<<32-wt(t)+l|n<<l|r,_t=i+e}else Rt=1<<i|n<<l|r,_t=e}function da(e){e.return!==null&&(fn(e,1),Yd(e,1,0))}function ma(e){for(;e===yl;)yl=On[--qn],On[qn]=null,vl=On[--qn],On[qn]=null;for(;e===Nn;)Nn=ot[--at],ot[at]=null,_t=ot[--at],ot[at]=null,Rt=ot[--at],ot[at]=null}var tt=null,et=null,xe=!1,vt=null;function Xd(e,t){var n=ct(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Oc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,tt=e,et=Zt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,tt=e,et=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Nn!==null?{id:Rt,overflow:_t}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ct(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,tt=e,et=null,!0):!1;default:return!1}}function vo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function wo(e){if(xe){var t=et;if(t){var n=t;if(!Oc(e,t)){if(vo(e))throw Error($(418));t=Zt(n.nextSibling);var r=tt;t&&Oc(e,t)?Xd(r,n):(e.flags=e.flags&-4097|2,xe=!1,tt=e)}}else{if(vo(e))throw Error($(418));e.flags=e.flags&-4097|2,xe=!1,tt=e}}}function qc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;tt=e}function Ts(e){if(e!==tt)return!1;if(!xe)return qc(e),xe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!po(e.type,e.memoizedProps)),t&&(t=et)){if(vo(e))throw Jd(),Error($(418));for(;t;)Xd(e,t),t=Zt(t.nextSibling)}if(qc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error($(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){et=Zt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}et=null}}else et=tt?Zt(e.stateNode.nextSibling):null;return!0}function Jd(){for(var e=et;e;)e=Zt(e.nextSibling)}function er(){et=tt=null,xe=!1}function ha(e){vt===null?vt=[e]:vt.push(e)}var vx=qt.ReactCurrentBatchConfig;function jr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error($(309));var r=n.stateNode}if(!r)throw Error($(147,e));var l=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=l.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error($(284));if(!n._owner)throw Error($(290,e))}return e}function Is(e,t){throw e=Object.prototype.toString.call(t),Error($(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Wc(e){var t=e._init;return t(e._payload)}function Zd(e){function t(g,h){if(e){var x=g.deletions;x===null?(g.deletions=[h],g.flags|=16):x.push(h)}}function n(g,h){if(!e)return null;for(;h!==null;)t(g,h),h=h.sibling;return null}function r(g,h){for(g=new Map;h!==null;)h.key!==null?g.set(h.key,h):g.set(h.index,h),h=h.sibling;return g}function l(g,h){return g=rn(g,h),g.index=0,g.sibling=null,g}function i(g,h,x){return g.index=x,e?(x=g.alternate,x!==null?(x=x.index,x<h?(g.flags|=2,h):x):(g.flags|=2,h)):(g.flags|=1048576,h)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,h,x,v){return h===null||h.tag!==6?(h=Fi(x,g.mode,v),h.return=g,h):(h=l(h,x),h.return=g,h)}function c(g,h,x,v){var N=x.type;return N===_n?d(g,h,x.props.children,v,x.key):h!==null&&(h.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ht&&Wc(N)===h.type)?(v=l(h,x.props),v.ref=jr(g,h,x),v.return=g,v):(v=el(x.type,x.key,x.props,null,g.mode,v),v.ref=jr(g,h,x),v.return=g,v)}function u(g,h,x,v){return h===null||h.tag!==4||h.stateNode.containerInfo!==x.containerInfo||h.stateNode.implementation!==x.implementation?(h=$i(x,g.mode,v),h.return=g,h):(h=l(h,x.children||[]),h.return=g,h)}function d(g,h,x,v,N){return h===null||h.tag!==7?(h=wn(x,g.mode,v,N),h.return=g,h):(h=l(h,x),h.return=g,h)}function m(g,h,x){if(typeof h=="string"&&h!==""||typeof h=="number")return h=Fi(""+h,g.mode,x),h.return=g,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case vs:return x=el(h.type,h.key,h.props,null,g.mode,x),x.ref=jr(g,null,h),x.return=g,x;case Rn:return h=$i(h,g.mode,x),h.return=g,h;case Ht:var v=h._init;return m(g,v(h._payload),x)}if(Cr(h)||gr(h))return h=wn(h,g.mode,x,null),h.return=g,h;Is(g,h)}return null}function f(g,h,x,v){var N=h!==null?h.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return N!==null?null:a(g,h,""+x,v);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case vs:return x.key===N?c(g,h,x,v):null;case Rn:return x.key===N?u(g,h,x,v):null;case Ht:return N=x._init,f(g,h,N(x._payload),v)}if(Cr(x)||gr(x))return N!==null?null:d(g,h,x,v,null);Is(g,x)}return null}function y(g,h,x,v,N){if(typeof v=="string"&&v!==""||typeof v=="number")return g=g.get(x)||null,a(h,g,""+v,N);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case vs:return g=g.get(v.key===null?x:v.key)||null,c(h,g,v,N);case Rn:return g=g.get(v.key===null?x:v.key)||null,u(h,g,v,N);case Ht:var S=v._init;return y(g,h,x,S(v._payload),N)}if(Cr(v)||gr(v))return g=g.get(x)||null,d(h,g,v,N,null);Is(h,v)}return null}function w(g,h,x,v){for(var N=null,S=null,T=h,M=h=0,q=null;T!==null&&M<x.length;M++){T.index>M?(q=T,T=null):q=T.sibling;var R=f(g,T,x[M],v);if(R===null){T===null&&(T=q);break}e&&T&&R.alternate===null&&t(g,T),h=i(R,h,M),S===null?N=R:S.sibling=R,S=R,T=q}if(M===x.length)return n(g,T),xe&&fn(g,M),N;if(T===null){for(;M<x.length;M++)T=m(g,x[M],v),T!==null&&(h=i(T,h,M),S===null?N=T:S.sibling=T,S=T);return xe&&fn(g,M),N}for(T=r(g,T);M<x.length;M++)q=y(T,g,M,x[M],v),q!==null&&(e&&q.alternate!==null&&T.delete(q.key===null?M:q.key),h=i(q,h,M),S===null?N=q:S.sibling=q,S=q);return e&&T.forEach(function(V){return t(g,V)}),xe&&fn(g,M),N}function k(g,h,x,v){var N=gr(x);if(typeof N!="function")throw Error($(150));if(x=N.call(x),x==null)throw Error($(151));for(var S=N=null,T=h,M=h=0,q=null,R=x.next();T!==null&&!R.done;M++,R=x.next()){T.index>M?(q=T,T=null):q=T.sibling;var V=f(g,T,R.value,v);if(V===null){T===null&&(T=q);break}e&&T&&V.alternate===null&&t(g,T),h=i(V,h,M),S===null?N=V:S.sibling=V,S=V,T=q}if(R.done)return n(g,T),xe&&fn(g,M),N;if(T===null){for(;!R.done;M++,R=x.next())R=m(g,R.value,v),R!==null&&(h=i(R,h,M),S===null?N=R:S.sibling=R,S=R);return xe&&fn(g,M),N}for(T=r(g,T);!R.done;M++,R=x.next())R=y(T,g,M,R.value,v),R!==null&&(e&&R.alternate!==null&&T.delete(R.key===null?M:R.key),h=i(R,h,M),S===null?N=R:S.sibling=R,S=R);return e&&T.forEach(function(C){return t(g,C)}),xe&&fn(g,M),N}function j(g,h,x,v){if(typeof x=="object"&&x!==null&&x.type===_n&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case vs:e:{for(var N=x.key,S=h;S!==null;){if(S.key===N){if(N=x.type,N===_n){if(S.tag===7){n(g,S.sibling),h=l(S,x.props.children),h.return=g,g=h;break e}}else if(S.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ht&&Wc(N)===S.type){n(g,S.sibling),h=l(S,x.props),h.ref=jr(g,S,x),h.return=g,g=h;break e}n(g,S);break}else t(g,S);S=S.sibling}x.type===_n?(h=wn(x.props.children,g.mode,v,x.key),h.return=g,g=h):(v=el(x.type,x.key,x.props,null,g.mode,v),v.ref=jr(g,h,x),v.return=g,g=v)}return o(g);case Rn:e:{for(S=x.key;h!==null;){if(h.key===S)if(h.tag===4&&h.stateNode.containerInfo===x.containerInfo&&h.stateNode.implementation===x.implementation){n(g,h.sibling),h=l(h,x.children||[]),h.return=g,g=h;break e}else{n(g,h);break}else t(g,h);h=h.sibling}h=$i(x,g.mode,v),h.return=g,g=h}return o(g);case Ht:return S=x._init,j(g,h,S(x._payload),v)}if(Cr(x))return w(g,h,x,v);if(gr(x))return k(g,h,x,v);Is(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,h!==null&&h.tag===6?(n(g,h.sibling),h=l(h,x),h.return=g,g=h):(n(g,h),h=Fi(x,g.mode,v),h.return=g,g=h),o(g)):n(g,h)}return j}var tr=Zd(!0),em=Zd(!1),wl=cn(null),kl=null,Wn=null,fa=null;function pa(){fa=Wn=kl=null}function xa(e){var t=wl.current;pe(wl),e._currentValue=t}function ko(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 Yn(e,t){kl=e,fa=Wn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ge=!0),e.firstContext=null)}function dt(e){var t=e._currentValue;if(fa!==e)if(e={context:e,memoizedValue:t,next:null},Wn===null){if(kl===null)throw Error($(308));Wn=e,kl.dependencies={lanes:0,firstContext:e}}else Wn=Wn.next=e;return t}var gn=null;function ga(e){gn===null?gn=[e]:gn.push(e)}function tm(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,ga(t)):(n.next=l.next,l.next=n),t.interleaved=n,Dt(e,r)}function Dt(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 Bt=!1;function ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nm(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 At(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function en(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,oe&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Dt(e,n)}return l=r.interleaved,l===null?(t.next=t,ga(r)):(t.next=l.next,l.next=t),r.interleaved=t,Dt(e,n)}function Gs(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,ra(e,n)}}function Hc(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 o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=o:i=i.next=o,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 jl(e,t,n,r){var l=e.updateQueue;Bt=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var c=a,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=c))}if(i!==null){var m=l.baseState;o=0,d=u=c=null,a=i;do{var f=a.lane,y=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:y,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,k=a;switch(f=t,y=n,k.tag){case 1:if(w=k.payload,typeof w=="function"){m=w.call(y,m,f);break e}m=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=k.payload,f=typeof w=="function"?w.call(y,m,f):w,f==null)break e;m=we({},m,f);break e;case 2:Bt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=l.effects,f===null?l.effects=[a]:f.push(a))}else y={eventTime:y,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=y,c=m):d=d.next=y,o|=f;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;f=a,a=f.next,f.next=null,l.lastBaseUpdate=f,l.shared.pending=null}}while(!0);if(d===null&&(c=m),l.baseState=c,l.firstBaseUpdate=u,l.lastBaseUpdate=d,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Sn|=o,e.lanes=o,e.memoizedState=m}}function Bc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error($(191,l));l.call(r)}}}var ds={},Tt=cn(ds),Jr=cn(ds),Zr=cn(ds);function yn(e){if(e===ds)throw Error($(174));return e}function va(e,t){switch(he(Zr,t),he(Jr,e),he(Tt,ds),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:eo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=eo(t,e)}pe(Tt),he(Tt,t)}function nr(){pe(Tt),pe(Jr),pe(Zr)}function rm(e){yn(Zr.current);var t=yn(Tt.current),n=eo(t,e.type);t!==n&&(he(Jr,e),he(Tt,n))}function wa(e){Jr.current===e&&(pe(Tt),pe(Jr))}var ye=cn(0);function Nl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pi=[];function ka(){for(var e=0;e<Pi.length;e++)Pi[e]._workInProgressVersionPrimary=null;Pi.length=0}var Ks=qt.ReactCurrentDispatcher,zi=qt.ReactCurrentBatchConfig,bn=0,ve=null,Me=null,Pe=null,bl=!1,_r=!1,es=0,wx=0;function Fe(){throw Error($(321))}function ja(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jt(e[n],t[n]))return!1;return!0}function Na(e,t,n,r,l,i){if(bn=i,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ks.current=e===null||e.memoizedState===null?bx:Sx,e=n(r,l),_r){i=0;do{if(_r=!1,es=0,25<=i)throw Error($(301));i+=1,Pe=Me=null,t.updateQueue=null,Ks.current=Cx,e=n(r,l)}while(_r)}if(Ks.current=Sl,t=Me!==null&&Me.next!==null,bn=0,Pe=Me=ve=null,bl=!1,t)throw Error($(300));return e}function ba(){var e=es!==0;return es=0,e}function St(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pe===null?ve.memoizedState=Pe=e:Pe=Pe.next=e,Pe}function mt(){if(Me===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Me.next;var t=Pe===null?ve.memoizedState:Pe.next;if(t!==null)Pe=t,Me=e;else{if(e===null)throw Error($(310));Me=e,e={memoizedState:Me.memoizedState,baseState:Me.baseState,baseQueue:Me.baseQueue,queue:Me.queue,next:null},Pe===null?ve.memoizedState=Pe=e:Pe=Pe.next=e}return Pe}function ts(e,t){return typeof t=="function"?t(e):t}function Li(e){var t=mt(),n=t.queue;if(n===null)throw Error($(311));n.lastRenderedReducer=e;var r=Me,l=r.baseQueue,i=n.pending;if(i!==null){if(l!==null){var o=l.next;l.next=i.next,i.next=o}r.baseQueue=l=i,n.pending=null}if(l!==null){i=l.next,r=r.baseState;var a=o=null,c=null,u=i;do{var d=u.lane;if((bn&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var m={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=m,o=r):c=c.next=m,ve.lanes|=d,Sn|=d}u=u.next}while(u!==null&&u!==i);c===null?o=r:c.next=a,jt(r,t.memoizedState)||(Ge=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do i=l.lane,ve.lanes|=i,Sn|=i,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ri(e){var t=mt(),n=t.queue;if(n===null)throw Error($(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,i=t.memoizedState;if(l!==null){n.pending=null;var o=l=l.next;do i=e(i,o.action),o=o.next;while(o!==l);jt(i,t.memoizedState)||(Ge=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function sm(){}function lm(e,t){var n=ve,r=mt(),l=t(),i=!jt(r.memoizedState,l);if(i&&(r.memoizedState=l,Ge=!0),r=r.queue,Sa(am.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Pe!==null&&Pe.memoizedState.tag&1){if(n.flags|=2048,ns(9,om.bind(null,n,r,l,t),void 0,null),Le===null)throw Error($(349));bn&30||im(n,t,l)}return l}function im(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function om(e,t,n,r){t.value=n,t.getSnapshot=r,cm(t)&&um(e)}function am(e,t,n){return n(function(){cm(t)&&um(e)})}function cm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jt(e,n)}catch{return!0}}function um(e){var t=Dt(e,1);t!==null&&kt(t,e,1,-1)}function Vc(e){var t=St();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ts,lastRenderedState:e},t.queue=e,e=e.dispatch=Nx.bind(null,ve,e),[t.memoizedState,e]}function ns(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function dm(){return mt().memoizedState}function Ys(e,t,n,r){var l=St();ve.flags|=e,l.memoizedState=ns(1|t,n,void 0,r===void 0?null:r)}function Ql(e,t,n,r){var l=mt();r=r===void 0?null:r;var i=void 0;if(Me!==null){var o=Me.memoizedState;if(i=o.destroy,r!==null&&ja(r,o.deps)){l.memoizedState=ns(t,n,i,r);return}}ve.flags|=e,l.memoizedState=ns(1|t,n,i,r)}function Qc(e,t){return Ys(8390656,8,e,t)}function Sa(e,t){return Ql(2048,8,e,t)}function mm(e,t){return Ql(4,2,e,t)}function hm(e,t){return Ql(4,4,e,t)}function fm(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function pm(e,t,n){return n=n!=null?n.concat([e]):null,Ql(4,4,fm.bind(null,t,e),n)}function Ca(){}function xm(e,t){var n=mt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ja(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gm(e,t){var n=mt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ja(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ym(e,t,n){return bn&21?(jt(n,t)||(n=Nd(),ve.lanes|=n,Sn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ge=!0),e.memoizedState=n)}function kx(e,t){var n=me;me=n!==0&&4>n?n:4,e(!0);var r=zi.transition;zi.transition={};try{e(!1),t()}finally{me=n,zi.transition=r}}function vm(){return mt().memoizedState}function jx(e,t,n){var r=nn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},wm(e))km(t,n);else if(n=tm(e,t,n,r),n!==null){var l=We();kt(n,e,r,l),jm(n,t,r)}}function Nx(e,t,n){var r=nn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(wm(e))km(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(l.hasEagerState=!0,l.eagerState=a,jt(a,o)){var c=t.interleaved;c===null?(l.next=l,ga(t)):(l.next=c.next,c.next=l),t.interleaved=l;return}}catch{}finally{}n=tm(e,t,l,r),n!==null&&(l=We(),kt(n,e,r,l),jm(n,t,r))}}function wm(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function km(e,t){_r=bl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ra(e,n)}}var Sl={readContext:dt,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useInsertionEffect:Fe,useLayoutEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useMutableSource:Fe,useSyncExternalStore:Fe,useId:Fe,unstable_isNewReconciler:!1},bx={readContext:dt,useCallback:function(e,t){return St().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:Qc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ys(4194308,4,fm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ys(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ys(4,2,e,t)},useMemo:function(e,t){var n=St();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=St();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=jx.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=St();return e={current:e},t.memoizedState=e},useState:Vc,useDebugValue:Ca,useDeferredValue:function(e){return St().memoizedState=e},useTransition:function(){var e=Vc(!1),t=e[0];return e=kx.bind(null,e[1]),St().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,l=St();if(xe){if(n===void 0)throw Error($(407));n=n()}else{if(n=t(),Le===null)throw Error($(349));bn&30||im(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Qc(am.bind(null,r,i,e),[e]),r.flags|=2048,ns(9,om.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=St(),t=Le.identifierPrefix;if(xe){var n=_t,r=Rt;n=(r&~(1<<32-wt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=es++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=wx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Sx={readContext:dt,useCallback:xm,useContext:dt,useEffect:Sa,useImperativeHandle:pm,useInsertionEffect:mm,useLayoutEffect:hm,useMemo:gm,useReducer:Li,useRef:dm,useState:function(){return Li(ts)},useDebugValue:Ca,useDeferredValue:function(e){var t=mt();return ym(t,Me.memoizedState,e)},useTransition:function(){var e=Li(ts)[0],t=mt().memoizedState;return[e,t]},useMutableSource:sm,useSyncExternalStore:lm,useId:vm,unstable_isNewReconciler:!1},Cx={readContext:dt,useCallback:xm,useContext:dt,useEffect:Sa,useImperativeHandle:pm,useInsertionEffect:mm,useLayoutEffect:hm,useMemo:gm,useReducer:Ri,useRef:dm,useState:function(){return Ri(ts)},useDebugValue:Ca,useDeferredValue:function(e){var t=mt();return Me===null?t.memoizedState=e:ym(t,Me.memoizedState,e)},useTransition:function(){var e=Ri(ts)[0],t=mt().memoizedState;return[e,t]},useMutableSource:sm,useSyncExternalStore:lm,useId:vm,unstable_isNewReconciler:!1};function gt(e,t){if(e&&e.defaultProps){t=we({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function jo(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:we({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gl={isMounted:function(e){return(e=e._reactInternals)?Mn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=We(),l=nn(e),i=At(r,l);i.payload=t,n!=null&&(i.callback=n),t=en(e,i,l),t!==null&&(kt(t,e,l,r),Gs(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=We(),l=nn(e),i=At(r,l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=en(e,i,l),t!==null&&(kt(t,e,l,r),Gs(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=We(),r=nn(e),l=At(n,r);l.tag=2,t!=null&&(l.callback=t),t=en(e,l,r),t!==null&&(kt(t,e,r,n),Gs(t,e,r))}};function Gc(e,t,n,r,l,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Gr(n,r)||!Gr(l,i):!0}function Nm(e,t,n){var r=!1,l=on,i=t.contextType;return typeof i=="object"&&i!==null?i=dt(i):(l=Ye(t)?jn:De.current,r=t.contextTypes,i=(r=r!=null)?Zn(e,l):on),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Gl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=i),t}function Kc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Gl.enqueueReplaceState(t,t.state,null)}function No(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},ya(e);var i=t.contextType;typeof i=="object"&&i!==null?l.context=dt(i):(i=Ye(t)?jn:De.current,l.context=Zn(e,i)),l.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(jo(e,t,i,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&Gl.enqueueReplaceState(l,l.state,null),jl(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function rr(e,t){try{var n="",r=t;do n+=ep(r),r=r.return;while(r);var l=n}catch(i){l=`
|
|
39
39
|
Error generating stack: `+i.message+`
|
|
40
|
-
`+i.stack}return{value:e,source:t,stack:l,digest:null}}function _i(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function bo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ex=typeof WeakMap=="function"?WeakMap:Map;function bm(e,t,n){n=At(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Cl||(Cl=!0,Ro=r),bo(e,t)},n}function Sm(e,t,n){n=At(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){bo(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){bo(e,t),typeof r!="function"&&(tn===null?tn=new Set([this]):tn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Yc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ex;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Ox.bind(null,e,t,n),t.then(e,e))}function Xc(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 Jc(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=At(-1,1),t.tag=2,en(n,t,1))),n.lanes|=1),e)}var Tx=qt.ReactCurrentOwner,Ye=!1;function He(e,t,n,r){t.child=e===null?em(t,null,n,r):tr(t,e.child,n,r)}function Zc(e,t,n,r,l){n=n.render;var i=t.ref;return Yn(t,l),r=Na(e,t,n,r,i,l),n=ba(),e!==null&&!Ye?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ot(e,t,l)):(ge&&n&&da(t),t.flags|=1,He(e,t,r,l),t.child)}function eu(e,t,n,r,l){if(e===null){var i=n.type;return typeof i=="function"&&!Ra(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Cm(e,t,i,r,l)):(e=Zs(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&l)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Qr,n(o,r)&&e.ref===t.ref)return Ot(e,t,l)}return t.flags|=1,e=rn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Cm(e,t,n,r,l){if(e!==null){var i=e.memoizedProps;if(Qr(i,r)&&e.ref===t.ref)if(Ye=!1,t.pendingProps=r=i,(e.lanes&l)!==0)e.flags&131072&&(Ye=!0);else return t.lanes=e.lanes,Ot(e,t,l)}return So(e,t,n,r,l)}function Em(e,t,n){var r=t.pendingProps,l=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},he(Bn,tt),tt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,he(Bn,tt),tt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,he(Bn,tt),tt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,he(Bn,tt),tt|=r;return He(e,t,l,n),t.child}function Tm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function So(e,t,n,r,l){var i=Je(n)?jn:Oe.current;return i=Zn(t,i),Yn(t,l),n=Na(e,t,n,r,i,l),r=ba(),e!==null&&!Ye?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ot(e,t,l)):(ge&&r&&da(t),t.flags|=1,He(e,t,n,l),t.child)}function tu(e,t,n,r,l){if(Je(n)){var i=!0;xl(t)}else i=!1;if(Yn(t,l),t.stateNode===null)Ys(e,t),Nm(t,n,r),No(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=mt(u):(u=Je(n)?jn:Oe.current,u=Zn(t,u));var d=n.getDerivedStateFromProps,m=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";m||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==u)&&Kc(t,o,r,u),Bt=!1;var f=t.memoizedState;o.state=f,kl(t,r,o,l),c=t.memoizedState,a!==r||f!==c||Xe.current||Bt?(typeof d=="function"&&(jo(t,n,d,r),c=t.memoizedState),(a=Bt||Gc(t,n,a,r,f,c,u))?(m||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,nm(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:gt(t.type,a),o.props=u,m=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=mt(c):(c=Je(n)?jn:Oe.current,c=Zn(t,c));var v=n.getDerivedStateFromProps;(d=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==m||f!==c)&&Kc(t,o,r,c),Bt=!1,f=t.memoizedState,o.state=f,kl(t,r,o,l);var k=t.memoizedState;a!==m||f!==k||Xe.current||Bt?(typeof v=="function"&&(jo(t,n,v,r),k=t.memoizedState),(u=Bt||Gc(t,n,u,r,f,k,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,k,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,k,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=k),o.props=r,o.state=k,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Co(e,t,n,r,i,l)}function Co(e,t,n,r,l,i){Tm(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return l&&Dc(t,n,!1),Ot(e,t,i);r=t.stateNode,Tx.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=tr(t,e.child,null,i),t.child=tr(t,null,a,i)):He(e,t,a,i),t.memoizedState=r.state,l&&Dc(t,n,!0),t.child}function Mm(e){var t=e.stateNode;t.pendingContext?Uc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Uc(e,t.context,!1),va(e,t.containerInfo)}function nu(e,t,n,r,l){return er(),ha(l),t.flags|=256,He(e,t,n,r),t.child}var Eo={dehydrated:null,treeContext:null,retryLane:0};function To(e){return{baseLanes:e,cachePool:null,transitions:null}}function Im(e,t,n){var r=t.pendingProps,l=ve.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(l&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),he(ve,l&1),e===null)return wo(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):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Yl(o,r,0,null),e=wn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=To(n),t.memoizedState=Eo,e):Ea(t,o));if(l=e.memoizedState,l!==null&&(a=l.dehydrated,a!==null))return Mx(e,t,o,r,a,l,n);if(i){i=r.fallback,o=t.mode,l=e.child,a=l.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=rn(l,c),r.subtreeFlags=l.subtreeFlags&14680064),a!==null?i=rn(a,i):(i=wn(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?To(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Eo,r}return i=e.child,e=i.sibling,r=rn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ea(e,t){return t=Yl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Is(e,t,n,r){return r!==null&&ha(r),tr(t,e.child,null,n),e=Ea(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mx(e,t,n,r,l,i,o){if(n)return t.flags&256?(t.flags&=-257,r=_i(Error(F(422))),Is(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,l=t.mode,r=Yl({mode:"visible",children:r.children},l,0,null),i=wn(i,l,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&tr(t,e.child,null,o),t.child.memoizedState=To(o),t.memoizedState=Eo,i);if(!(t.mode&1))return Is(e,t,o,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(F(419)),r=_i(i,r,void 0),Is(e,t,o,r)}if(a=(o&e.childLanes)!==0,Ye||a){if(r=Le,r!==null){switch(o&-o){case 4:l=2;break;case 16:l=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:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|o)?0:l,l!==0&&l!==i.retryLane&&(i.retryLane=l,Dt(e,l),kt(r,e,l,-1))}return La(),r=_i(Error(F(421))),Is(e,t,o,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=qx.bind(null,e),l._reactRetry=t,null):(e=i.treeContext,nt=Zt(l.nextSibling),rt=t,ge=!0,vt=null,e!==null&&(at[ct++]=Rt,at[ct++]=_t,at[ct++]=Nn,Rt=e.id,_t=e.overflow,Nn=t),t=Ea(t,r.children),t.flags|=4096,t)}function ru(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ko(e.return,t,n)}function Ai(e,t,n,r,l){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=l)}function Pm(e,t,n){var r=t.pendingProps,l=r.revealOrder,i=r.tail;if(He(e,t,r.children,n),r=ve.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ru(e,n,t);else if(e.tag===19)ru(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(he(ve,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&jl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Ai(t,!1,l,n,i);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&jl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Ai(t,!0,n,null,i);break;case"together":Ai(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ys(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ot(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Sn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,n=rn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=rn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ix(e,t,n){switch(t.tag){case 3:Mm(t),er();break;case 5:rm(t);break;case 1:Je(t.type)&&xl(t);break;case 4:va(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;he(vl,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(he(ve,ve.current&1),t.flags|=128,null):n&t.child.childLanes?Im(e,t,n):(he(ve,ve.current&1),e=Ot(e,t,n),e!==null?e.sibling:null);he(ve,ve.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Pm(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),he(ve,ve.current),r)break;return null;case 22:case 23:return t.lanes=0,Em(e,t,n)}return Ot(e,t,n)}var zm,Mo,Lm,Rm;zm=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Mo=function(){};Lm=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,yn(Mt.current);var i=null;switch(n){case"input":l=Yi(e,l),r=Yi(e,r),i=[];break;case"select":l=ke({},l,{value:void 0}),r=ke({},r,{value:void 0}),i=[];break;case"textarea":l=Zi(e,l),r=Zi(e,r),i=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=fl)}to(n,r);var o;n=null;for(u in l)if(!r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&l[u]!=null)if(u==="style"){var a=l[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Dr.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(a=l!=null?l[u]:void 0,r.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Dr.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&pe("scroll",e),i||a===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Rm=function(e,t,n,r){n!==r&&(t.flags|=4)};function jr(e,t){if(!ge)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ue(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Px(e,t,n){var r=t.pendingProps;switch(ma(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(t),null;case 1:return Je(t.type)&&pl(),Ue(t),null;case 3:return r=t.stateNode,nr(),xe(Xe),xe(Oe),ka(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ts(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,vt!==null&&(Fo(vt),vt=null))),Mo(e,t),Ue(t),null;case 5:wa(t);var l=yn(Jr.current);if(n=t.type,e!==null&&t.stateNode!=null)Lm(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(F(166));return Ue(t),null}if(e=yn(Mt.current),Ts(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Et]=t,r[Yr]=i,e=(t.mode&1)!==0,n){case"dialog":pe("cancel",r),pe("close",r);break;case"iframe":case"object":case"embed":pe("load",r);break;case"video":case"audio":for(l=0;l<Er.length;l++)pe(Er[l],r);break;case"source":pe("error",r);break;case"img":case"image":case"link":pe("error",r),pe("load",r);break;case"details":pe("toggle",r);break;case"input":mc(r,i),pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},pe("invalid",r);break;case"textarea":fc(r,i),pe("invalid",r)}to(n,i),l=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Es(r.textContent,a,e),l=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Es(r.textContent,a,e),l=["children",""+a]):Dr.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&pe("scroll",r)}switch(n){case"input":vs(r),hc(r,i,!0);break;case"textarea":vs(r),pc(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=fl)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ad(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Et]=t,e[Yr]=r,zm(e,t,!1,!1),t.stateNode=e;e:{switch(o=no(n,r),n){case"dialog":pe("cancel",e),pe("close",e),l=r;break;case"iframe":case"object":case"embed":pe("load",e),l=r;break;case"video":case"audio":for(l=0;l<Er.length;l++)pe(Er[l],e);l=r;break;case"source":pe("error",e),l=r;break;case"img":case"image":case"link":pe("error",e),pe("load",e),l=r;break;case"details":pe("toggle",e),l=r;break;case"input":mc(e,r),l=Yi(e,r),pe("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=ke({},r,{value:void 0}),pe("invalid",e);break;case"textarea":fc(e,r),l=Zi(e,r),pe("invalid",e);break;default:l=r}to(n,l),a=l;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?dd(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&cd(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Or(e,c):typeof c=="number"&&Or(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Dr.hasOwnProperty(i)?c!=null&&i==="onScroll"&&pe("scroll",e):c!=null&&Xo(e,i,c,o))}switch(n){case"input":vs(e),hc(e,r,!1);break;case"textarea":vs(e),pc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ln(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Vn(e,!!r.multiple,i,!1):r.defaultValue!=null&&Vn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=fl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ue(t),null;case 6:if(e&&t.stateNode!=null)Rm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(F(166));if(n=yn(Jr.current),yn(Mt.current),Ts(t)){if(r=t.stateNode,n=t.memoizedProps,r[Et]=t,(i=r.nodeValue!==n)&&(e=rt,e!==null))switch(e.tag){case 3:Es(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Es(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Et]=t,t.stateNode=r}return Ue(t),null;case 13:if(xe(ve),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ge&&nt!==null&&t.mode&1&&!(t.flags&128))Jd(),er(),t.flags|=98560,i=!1;else if(i=Ts(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(F(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(F(317));i[Et]=t}else er(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ue(t),i=!1}else vt!==null&&(Fo(vt),vt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ve.current&1?Me===0&&(Me=3):La())),t.updateQueue!==null&&(t.flags|=4),Ue(t),null);case 4:return nr(),Mo(e,t),e===null&&Gr(t.stateNode.containerInfo),Ue(t),null;case 10:return xa(t.type._context),Ue(t),null;case 17:return Je(t.type)&&pl(),Ue(t),null;case 19:if(xe(ve),i=t.memoizedState,i===null)return Ue(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)jr(i,!1);else{if(Me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=jl(e),o!==null){for(t.flags|=128,jr(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return he(ve,ve.current&1|2),t.child}e=e.sibling}i.tail!==null&&be()>sr&&(t.flags|=128,r=!0,jr(i,!1),t.lanes=4194304)}else{if(!r)if(e=jl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),jr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!ge)return Ue(t),null}else 2*be()-i.renderingStartTime>sr&&n!==1073741824&&(t.flags|=128,r=!0,jr(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=be(),t.sibling=null,n=ve.current,he(ve,r?n&1|2:n&1),t):(Ue(t),null);case 22:case 23:return za(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tt&1073741824&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function zx(e,t){switch(ma(t),t.tag){case 1:return Je(t.type)&&pl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nr(),xe(Xe),xe(Oe),ka(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wa(t),null;case 13:if(xe(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));er()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(ve),null;case 4:return nr(),null;case 10:return xa(t.type._context),null;case 22:case 23:return za(),null;case 24:return null;default:return null}}var Ps=!1,De=!1,Lx=typeof WeakSet=="function"?WeakSet:Set,G=null;function Hn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){je(e,t,r)}else n.current=null}function Io(e,t,n){try{n()}catch(r){je(e,t,r)}}var su=!1;function Rx(e,t){if(ho=dl,e=Ud(),ua(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 o=0,a=-1,c=-1,u=0,d=0,m=e,f=null;t:for(;;){for(var v;m!==n||l!==0&&m.nodeType!==3||(a=o+l),m!==i||r!==0&&m.nodeType!==3||(c=o+r),m.nodeType===3&&(o+=m.nodeValue.length),(v=m.firstChild)!==null;)f=m,m=v;for(;;){if(m===e)break t;if(f===n&&++u===l&&(a=o),f===i&&++d===r&&(c=o),(v=m.nextSibling)!==null)break;m=f,f=m.parentNode}m=v}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(fo={focusedElem:e,selectionRange:n},dl=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var k=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var w=k.memoizedProps,j=k.memoizedState,x=t.stateNode,h=x.getSnapshotBeforeUpdate(t.elementType===t.type?w:gt(t.type,w),j);x.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(y){je(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return k=su,su=!1,k}function _r(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&&Io(t,n,i)}l=l.next}while(l!==r)}}function Gl(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 Po(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 _m(e){var t=e.alternate;t!==null&&(e.alternate=null,_m(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Et],delete t[Yr],delete t[go],delete t[xx],delete t[gx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Am(e){return e.tag===5||e.tag===3||e.tag===4}function lu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Am(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zo(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=fl));else if(r!==4&&(e=e.child,e!==null))for(zo(e,t,n),e=e.sibling;e!==null;)zo(e,t,n),e=e.sibling}function Lo(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(Lo(e,t,n),e=e.sibling;e!==null;)Lo(e,t,n),e=e.sibling}var Re=null,yt=!1;function Wt(e,t,n){for(n=n.child;n!==null;)Fm(e,t,n),n=n.sibling}function Fm(e,t,n){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Dl,n)}catch{}switch(n.tag){case 5:De||Hn(n,t);case 6:var r=Re,l=yt;Re=null,Wt(e,t,n),Re=r,yt=l,Re!==null&&(yt?(e=Re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Re.removeChild(n.stateNode));break;case 18:Re!==null&&(yt?(e=Re,n=n.stateNode,e.nodeType===8?Mi(e.parentNode,n):e.nodeType===1&&Mi(e,n),Br(e)):Mi(Re,n.stateNode));break;case 4:r=Re,l=yt,Re=n.stateNode.containerInfo,yt=!0,Wt(e,t,n),Re=r,yt=l;break;case 0:case 11:case 14:case 15:if(!De&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Io(n,t,o),l=l.next}while(l!==r)}Wt(e,t,n);break;case 1:if(!De&&(Hn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){je(n,t,a)}Wt(e,t,n);break;case 21:Wt(e,t,n);break;case 22:n.mode&1?(De=(r=De)||n.memoizedState!==null,Wt(e,t,n),De=r):Wt(e,t,n);break;default:Wt(e,t,n)}}function iu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Lx),t.forEach(function(r){var l=Wx.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function xt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Re=a.stateNode,yt=!1;break e;case 3:Re=a.stateNode.containerInfo,yt=!0;break e;case 4:Re=a.stateNode.containerInfo,yt=!0;break e}a=a.return}if(Re===null)throw Error(F(160));Fm(i,o,l),Re=null,yt=!1;var c=l.alternate;c!==null&&(c.return=null),l.return=null}catch(u){je(l,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$m(t,e),t=t.sibling}function $m(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xt(t,e),bt(e),r&4){try{_r(3,e,e.return),Gl(3,e)}catch(w){je(e,e.return,w)}try{_r(5,e,e.return)}catch(w){je(e,e.return,w)}}break;case 1:xt(t,e),bt(e),r&512&&n!==null&&Hn(n,n.return);break;case 5:if(xt(t,e),bt(e),r&512&&n!==null&&Hn(n,n.return),e.flags&32){var l=e.stateNode;try{Or(l,"")}catch(w){je(e,e.return,w)}}if(r&4&&(l=e.stateNode,l!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&id(l,i),no(a,o);var u=no(a,i);for(o=0;o<c.length;o+=2){var d=c[o],m=c[o+1];d==="style"?dd(l,m):d==="dangerouslySetInnerHTML"?cd(l,m):d==="children"?Or(l,m):Xo(l,d,m,u)}switch(a){case"input":Xi(l,i);break;case"textarea":od(l,i);break;case"select":var f=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!i.multiple;var v=i.value;v!=null?Vn(l,!!i.multiple,v,!1):f!==!!i.multiple&&(i.defaultValue!=null?Vn(l,!!i.multiple,i.defaultValue,!0):Vn(l,!!i.multiple,i.multiple?[]:"",!1))}l[Yr]=i}catch(w){je(e,e.return,w)}}break;case 6:if(xt(t,e),bt(e),r&4){if(e.stateNode===null)throw Error(F(162));l=e.stateNode,i=e.memoizedProps;try{l.nodeValue=i}catch(w){je(e,e.return,w)}}break;case 3:if(xt(t,e),bt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Br(t.containerInfo)}catch(w){je(e,e.return,w)}break;case 4:xt(t,e),bt(e);break;case 13:xt(t,e),bt(e),l=e.child,l.flags&8192&&(i=l.memoizedState!==null,l.stateNode.isHidden=i,!i||l.alternate!==null&&l.alternate.memoizedState!==null||(Ia=be())),r&4&&iu(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(De=(u=De)||d,xt(t,e),De=u):xt(t,e),bt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(G=e,d=e.child;d!==null;){for(m=G=d;G!==null;){switch(f=G,v=f.child,f.tag){case 0:case 11:case 14:case 15:_r(4,f,f.return);break;case 1:Hn(f,f.return);var k=f.stateNode;if(typeof k.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,k.props=t.memoizedProps,k.state=t.memoizedState,k.componentWillUnmount()}catch(w){je(r,n,w)}}break;case 5:Hn(f,f.return);break;case 22:if(f.memoizedState!==null){au(m);continue}}v!==null?(v.return=f,G=v):au(m)}d=d.sibling}e:for(d=null,m=e;;){if(m.tag===5){if(d===null){d=m;try{l=m.stateNode,u?(i=l.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=m.stateNode,c=m.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=ud("display",o))}catch(w){je(e,e.return,w)}}}else if(m.tag===6){if(d===null)try{m.stateNode.nodeValue=u?"":m.memoizedProps}catch(w){je(e,e.return,w)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;d===m&&(d=null),m=m.return}d===m&&(d=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:xt(t,e),bt(e),r&4&&iu(e);break;case 21:break;default:xt(t,e),bt(e)}}function bt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Am(n)){var r=n;break e}n=n.return}throw Error(F(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(Or(l,""),r.flags&=-33);var i=lu(e);Lo(e,i,l);break;case 3:case 4:var o=r.stateNode.containerInfo,a=lu(e);zo(e,a,o);break;default:throw Error(F(161))}}catch(c){je(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _x(e,t,n){G=e,Um(e)}function Um(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var l=G,i=l.child;if(l.tag===22&&r){var o=l.memoizedState!==null||Ps;if(!o){var a=l.alternate,c=a!==null&&a.memoizedState!==null||De;a=Ps;var u=De;if(Ps=o,(De=c)&&!u)for(G=l;G!==null;)o=G,c=o.child,o.tag===22&&o.memoizedState!==null?cu(l):c!==null?(c.return=o,G=c):cu(l);for(;i!==null;)G=i,Um(i),i=i.sibling;G=l,Ps=a,De=u}ou(e)}else l.subtreeFlags&8772&&i!==null?(i.return=l,G=i):ou(e)}}function ou(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:De||Gl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!De)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:gt(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Bc(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Bc(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var m=d.dehydrated;m!==null&&Br(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}De||t.flags&512&&Po(t)}catch(f){je(t,t.return,f)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function au(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function cu(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Gl(4,t)}catch(c){je(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(c){je(t,l,c)}}var i=t.return;try{Po(t)}catch(c){je(t,i,c)}break;case 5:var o=t.return;try{Po(t)}catch(c){je(t,o,c)}}}catch(c){je(t,t.return,c)}if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}var Ax=Math.ceil,Sl=qt.ReactCurrentDispatcher,Ta=qt.ReactCurrentOwner,dt=qt.ReactCurrentBatchConfig,ie=0,Le=null,Ee=null,Ae=0,tt=0,Bn=cn(0),Me=0,ns=null,Sn=0,Kl=0,Ma=0,Ar=null,Ke=null,Ia=0,sr=1/0,zt=null,Cl=!1,Ro=null,tn=null,zs=!1,Kt=null,El=0,Fr=0,_o=null,Xs=-1,Js=0;function Be(){return ie&6?be():Xs!==-1?Xs:Xs=be()}function nn(e){return e.mode&1?ie&2&&Ae!==0?Ae&-Ae:vx.transition!==null?(Js===0&&(Js=Nd()),Js):(e=me,e!==0||(e=window.event,e=e===void 0?16:Id(e.type)),e):1}function kt(e,t,n,r){if(50<Fr)throw Fr=0,_o=null,Error(F(185));os(e,n,r),(!(ie&2)||e!==Le)&&(e===Le&&(!(ie&2)&&(Kl|=n),Me===4&&Qt(e,Ae)),Ze(e,r),n===1&&ie===0&&!(t.mode&1)&&(sr=be()+500,Bl&&un()))}function Ze(e,t){var n=e.callbackNode;vp(e,t);var r=ul(e,e===Le?Ae:0);if(r===0)n!==null&&yc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&yc(n),t===1)e.tag===0?yx(uu.bind(null,e)):Kd(uu.bind(null,e)),fx(function(){!(ie&6)&&un()}),n=null;else{switch(bd(r)){case 1:n=na;break;case 4:n=kd;break;case 16:n=cl;break;case 536870912:n=jd;break;default:n=cl}n=Qm(n,Dm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Dm(e,t){if(Xs=-1,Js=0,ie&6)throw Error(F(327));var n=e.callbackNode;if(Xn()&&e.callbackNode!==n)return null;var r=ul(e,e===Le?Ae:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Tl(e,r);else{t=r;var l=ie;ie|=2;var i=qm();(Le!==e||Ae!==t)&&(zt=null,sr=be()+500,vn(e,t));do try{Ux();break}catch(a){Om(e,a)}while(!0);pa(),Sl.current=i,ie=l,Ee!==null?t=0:(Le=null,Ae=0,t=Me)}if(t!==0){if(t===2&&(l=oo(e),l!==0&&(r=l,t=Ao(e,l))),t===1)throw n=ns,vn(e,0),Qt(e,r),Ze(e,be()),n;if(t===6)Qt(e,r);else{if(l=e.current.alternate,!(r&30)&&!Fx(l)&&(t=Tl(e,r),t===2&&(i=oo(e),i!==0&&(r=i,t=Ao(e,i))),t===1))throw n=ns,vn(e,0),Qt(e,r),Ze(e,be()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(F(345));case 2:pn(e,Ke,zt);break;case 3:if(Qt(e,r),(r&130023424)===r&&(t=Ia+500-be(),10<t)){if(ul(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){Be(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=xo(pn.bind(null,e,Ke,zt),t);break}pn(e,Ke,zt);break;case 4:if(Qt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var o=31-wt(r);i=1<<o,o=t[o],o>l&&(l=o),r&=~i}if(r=l,r=be()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ax(r/1960))-r,10<r){e.timeoutHandle=xo(pn.bind(null,e,Ke,zt),r);break}pn(e,Ke,zt);break;case 5:pn(e,Ke,zt);break;default:throw Error(F(329))}}}return Ze(e,be()),e.callbackNode===n?Dm.bind(null,e):null}function Ao(e,t){var n=Ar;return e.current.memoizedState.isDehydrated&&(vn(e,t).flags|=256),e=Tl(e,t),e!==2&&(t=Ke,Ke=n,t!==null&&Fo(t)),e}function Fo(e){Ke===null?Ke=e:Ke.push.apply(Ke,e)}function Fx(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],i=l.getSnapshot;l=l.value;try{if(!jt(i(),l))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Qt(e,t){for(t&=~Ma,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-wt(t),r=1<<n;e[n]=-1,t&=~r}}function uu(e){if(ie&6)throw Error(F(327));Xn();var t=ul(e,0);if(!(t&1))return Ze(e,be()),null;var n=Tl(e,t);if(e.tag!==0&&n===2){var r=oo(e);r!==0&&(t=r,n=Ao(e,r))}if(n===1)throw n=ns,vn(e,0),Qt(e,t),Ze(e,be()),n;if(n===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,pn(e,Ke,zt),Ze(e,be()),null}function Pa(e,t){var n=ie;ie|=1;try{return e(t)}finally{ie=n,ie===0&&(sr=be()+500,Bl&&un())}}function Cn(e){Kt!==null&&Kt.tag===0&&!(ie&6)&&Xn();var t=ie;ie|=1;var n=dt.transition,r=me;try{if(dt.transition=null,me=1,e)return e()}finally{me=r,dt.transition=n,ie=t,!(ie&6)&&un()}}function za(){tt=Bn.current,xe(Bn)}function vn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,hx(n)),Ee!==null)for(n=Ee.return;n!==null;){var r=n;switch(ma(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&pl();break;case 3:nr(),xe(Xe),xe(Oe),ka();break;case 5:wa(r);break;case 4:nr();break;case 13:xe(ve);break;case 19:xe(ve);break;case 10:xa(r.type._context);break;case 22:case 23:za()}n=n.return}if(Le=e,Ee=e=rn(e.current,null),Ae=tt=t,Me=0,ns=null,Ma=Kl=Sn=0,Ke=Ar=null,gn!==null){for(t=0;t<gn.length;t++)if(n=gn[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=l,r.next=o}n.pending=r}gn=null}return e}function Om(e,t){do{var n=Ee;try{if(pa(),Gs.current=bl,Nl){for(var r=we.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}Nl=!1}if(bn=0,ze=Te=we=null,Rr=!1,Zr=0,Ta.current=null,n===null||n.return===null){Me=1,ns=t,Ee=null;break}e:{var i=e,o=n.return,a=n,c=t;if(t=Ae,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=a,m=d.tag;if(!(d.mode&1)&&(m===0||m===11||m===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var v=Xc(o);if(v!==null){v.flags&=-257,Jc(v,o,a,i,t),v.mode&1&&Yc(i,u,t),t=v,c=u;var k=t.updateQueue;if(k===null){var w=new Set;w.add(c),t.updateQueue=w}else k.add(c);break e}else{if(!(t&1)){Yc(i,u,t),La();break e}c=Error(F(426))}}else if(ge&&a.mode&1){var j=Xc(o);if(j!==null){!(j.flags&65536)&&(j.flags|=256),Jc(j,o,a,i,t),ha(rr(c,a));break e}}i=c=rr(c,a),Me!==4&&(Me=2),Ar===null?Ar=[i]:Ar.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=bm(i,c,t);Hc(i,x);break e;case 1:a=c;var h=i.type,g=i.stateNode;if(!(i.flags&128)&&(typeof h.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(tn===null||!tn.has(g)))){i.flags|=65536,t&=-t,i.lanes|=t;var y=Sm(i,a,t);Hc(i,y);break e}}i=i.return}while(i!==null)}Hm(n)}catch(N){t=N,Ee===n&&n!==null&&(Ee=n=n.return);continue}break}while(!0)}function qm(){var e=Sl.current;return Sl.current=bl,e===null?bl:e}function La(){(Me===0||Me===3||Me===2)&&(Me=4),Le===null||!(Sn&268435455)&&!(Kl&268435455)||Qt(Le,Ae)}function Tl(e,t){var n=ie;ie|=2;var r=qm();(Le!==e||Ae!==t)&&(zt=null,vn(e,t));do try{$x();break}catch(l){Om(e,l)}while(!0);if(pa(),ie=n,Sl.current=r,Ee!==null)throw Error(F(261));return Le=null,Ae=0,Me}function $x(){for(;Ee!==null;)Wm(Ee)}function Ux(){for(;Ee!==null&&!up();)Wm(Ee)}function Wm(e){var t=Vm(e.alternate,e,tt);e.memoizedProps=e.pendingProps,t===null?Hm(e):Ee=t,Ta.current=null}function Hm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=zx(n,t),n!==null){n.flags&=32767,Ee=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Me=6,Ee=null;return}}else if(n=Px(n,t,tt),n!==null){Ee=n;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);Me===0&&(Me=5)}function pn(e,t,n){var r=me,l=dt.transition;try{dt.transition=null,me=1,Dx(e,t,n,r)}finally{dt.transition=l,me=r}return null}function Dx(e,t,n,r){do Xn();while(Kt!==null);if(ie&6)throw Error(F(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(F(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(wp(e,i),e===Le&&(Ee=Le=null,Ae=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||zs||(zs=!0,Qm(cl,function(){return Xn(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=dt.transition,dt.transition=null;var o=me;me=1;var a=ie;ie|=4,Ta.current=null,Rx(e,n),$m(n,e),ix(fo),dl=!!ho,fo=ho=null,e.current=n,_x(n),dp(),ie=a,me=o,dt.transition=i}else e.current=n;if(zs&&(zs=!1,Kt=e,El=l),i=e.pendingLanes,i===0&&(tn=null),fp(n.stateNode),Ze(e,be()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(Cl)throw Cl=!1,e=Ro,Ro=null,e;return El&1&&e.tag!==0&&Xn(),i=e.pendingLanes,i&1?e===_o?Fr++:(Fr=0,_o=e):Fr=0,un(),null}function Xn(){if(Kt!==null){var e=bd(El),t=dt.transition,n=me;try{if(dt.transition=null,me=16>e?16:e,Kt===null)var r=!1;else{if(e=Kt,Kt=null,El=0,ie&6)throw Error(F(331));var l=ie;for(ie|=4,G=e.current;G!==null;){var i=G,o=i.child;if(G.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(G=u;G!==null;){var d=G;switch(d.tag){case 0:case 11:case 15:_r(8,d,i)}var m=d.child;if(m!==null)m.return=d,G=m;else for(;G!==null;){d=G;var f=d.sibling,v=d.return;if(_m(d),d===u){G=null;break}if(f!==null){f.return=v,G=f;break}G=v}}}var k=i.alternate;if(k!==null){var w=k.child;if(w!==null){k.child=null;do{var j=w.sibling;w.sibling=null,w=j}while(w!==null)}}G=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,G=o;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:_r(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,G=x;break e}G=i.return}}var h=e.current;for(G=h;G!==null;){o=G;var g=o.child;if(o.subtreeFlags&2064&&g!==null)g.return=o,G=g;else e:for(o=h;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Gl(9,a)}}catch(N){je(a,a.return,N)}if(a===o){G=null;break e}var y=a.sibling;if(y!==null){y.return=a.return,G=y;break e}G=a.return}}if(ie=l,un(),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(Dl,e)}catch{}r=!0}return r}finally{me=n,dt.transition=t}}return!1}function du(e,t,n){t=rr(n,t),t=bm(e,t,1),e=en(e,t,1),t=Be(),e!==null&&(os(e,1,t),Ze(e,t))}function je(e,t,n){if(e.tag===3)du(e,e,n);else for(;t!==null;){if(t.tag===3){du(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(tn===null||!tn.has(r))){e=rr(n,e),e=Sm(t,e,1),t=en(t,e,1),e=Be(),t!==null&&(os(t,1,e),Ze(t,e));break}}t=t.return}}function Ox(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Be(),e.pingedLanes|=e.suspendedLanes&n,Le===e&&(Ae&n)===n&&(Me===4||Me===3&&(Ae&130023424)===Ae&&500>be()-Ia?vn(e,0):Ma|=n),Ze(e,t)}function Bm(e,t){t===0&&(e.mode&1?(t=js,js<<=1,!(js&130023424)&&(js=4194304)):t=1);var n=Be();e=Dt(e,t),e!==null&&(os(e,t,n),Ze(e,n))}function qx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bm(e,n)}function Wx(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(F(314))}r!==null&&r.delete(t),Bm(e,n)}var Vm;Vm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xe.current)Ye=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ye=!1,Ix(e,t,n);Ye=!!(e.flags&131072)}else Ye=!1,ge&&t.flags&1048576&&Yd(t,yl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ys(e,t),e=t.pendingProps;var l=Zn(t,Oe.current);Yn(t,n),l=Na(null,t,r,e,l,n);var i=ba();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,xl(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,ya(t),l.updater=Ql,t.stateNode=l,l._reactInternals=t,No(t,r,e,n),t=Co(null,t,r,!0,i,n)):(t.tag=0,ge&&i&&da(t),He(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ys(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Bx(r),e=gt(r,e),l){case 0:t=So(null,t,r,e,n);break e;case 1:t=tu(null,t,r,e,n);break e;case 11:t=Zc(null,t,r,e,n);break e;case 14:t=eu(null,t,r,gt(r.type,e),n);break e}throw Error(F(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:gt(r,l),So(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:gt(r,l),tu(e,t,r,l,n);case 3:e:{if(Mm(t),e===null)throw Error(F(387));r=t.pendingProps,i=t.memoizedState,l=i.element,nm(e,t),kl(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=rr(Error(F(423)),t),t=nu(e,t,r,n,l);break e}else if(r!==l){l=rr(Error(F(424)),t),t=nu(e,t,r,n,l);break e}else for(nt=Zt(t.stateNode.containerInfo.firstChild),rt=t,ge=!0,vt=null,n=em(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(er(),r===l){t=Ot(e,t,n);break e}He(e,t,r,n)}t=t.child}return t;case 5:return rm(t),e===null&&wo(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,po(r,l)?o=null:i!==null&&po(r,i)&&(t.flags|=32),Tm(e,t),He(e,t,o,n),t.child;case 6:return e===null&&wo(t),null;case 13:return Im(e,t,n);case 4:return va(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=tr(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:gt(r,l),Zc(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,o=l.value,he(vl,r._currentValue),r._currentValue=o,i!==null)if(jt(i.value,o)){if(i.children===l.children&&!Xe.current){t=Ot(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=At(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),ko(i.return,n,t),a.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(F(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ko(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}He(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Yn(t,n),l=mt(l),r=r(l),t.flags|=1,He(e,t,r,n),t.child;case 14:return r=t.type,l=gt(r,t.pendingProps),l=gt(r.type,l),eu(e,t,r,l,n);case 15:return Cm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:gt(r,l),Ys(e,t),t.tag=1,Je(r)?(e=!0,xl(t)):e=!1,Yn(t,n),Nm(t,r,l),No(t,r,l,n),Co(null,t,r,!0,e,n);case 19:return Pm(e,t,n);case 22:return Em(e,t,n)}throw Error(F(156,t.tag))};function Qm(e,t){return wd(e,t)}function Hx(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 ut(e,t,n,r){return new Hx(e,t,n,r)}function Ra(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bx(e){if(typeof e=="function")return Ra(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zo)return 11;if(e===ea)return 14}return 2}function rn(e,t){var n=e.alternate;return n===null?(n=ut(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 Zs(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")Ra(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case _n:return wn(n.children,l,i,t);case Jo:o=8,l|=8;break;case Vi:return e=ut(12,n,t,l|2),e.elementType=Vi,e.lanes=i,e;case Qi:return e=ut(13,n,t,l),e.elementType=Qi,e.lanes=i,e;case Gi:return e=ut(19,n,t,l),e.elementType=Gi,e.lanes=i,e;case rd:return Yl(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case td:o=10;break e;case nd:o=9;break e;case Zo:o=11;break e;case ea:o=14;break e;case Ht:o=16,r=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=ut(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function wn(e,t,n,r){return e=ut(7,e,r,t),e.lanes=n,e}function Yl(e,t,n,r){return e=ut(22,e,r,t),e.elementType=rd,e.lanes=n,e.stateNode={isHidden:!1},e}function Fi(e,t,n){return e=ut(6,e,null,t),e.lanes=n,e}function $i(e,t,n){return t=ut(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Vx(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=yi(0),this.expirationTimes=yi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yi(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function _a(e,t,n,r,l,i,o,a,c){return e=new Vx(e,t,n,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ut(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ya(i),e}function Qx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Rn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Gm(e){if(!e)return on;e=e._reactInternals;e:{if(Tn(e)!==e||e.tag!==1)throw Error(F(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Je(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(F(171))}if(e.tag===1){var n=e.type;if(Je(n))return Gd(e,n,t)}return t}function Km(e,t,n,r,l,i,o,a,c){return e=_a(n,r,!0,e,l,i,o,a,c),e.context=Gm(null),n=e.current,r=Be(),l=nn(n),i=At(r,l),i.callback=t??null,en(n,i,l),e.current.lanes=l,os(e,l,r),Ze(e,r),e}function Xl(e,t,n,r){var l=t.current,i=Be(),o=nn(l);return n=Gm(n),t.context===null?t.context=n:t.pendingContext=n,t=At(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=en(l,t,o),e!==null&&(kt(e,l,o,i),Qs(e,l,o)),o}function Ml(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 mu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Aa(e,t){mu(e,t),(e=e.alternate)&&mu(e,t)}function Gx(){return null}var Ym=typeof reportError=="function"?reportError:function(e){console.error(e)};function Fa(e){this._internalRoot=e}Jl.prototype.render=Fa.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));Xl(e,t,null,null)};Jl.prototype.unmount=Fa.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Cn(function(){Xl(null,e,null,null)}),t[Ut]=null}};function Jl(e){this._internalRoot=e}Jl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ed();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vt.length&&t!==0&&t<Vt[n].priority;n++);Vt.splice(n,0,e),n===0&&Md(e)}};function $a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Zl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hu(){}function Kx(e,t,n,r,l){if(l){if(typeof r=="function"){var i=r;r=function(){var u=Ml(o);i.call(u)}}var o=Km(t,r,e,0,null,!1,!1,"",hu);return e._reactRootContainer=o,e[Ut]=o.current,Gr(e.nodeType===8?e.parentNode:e),Cn(),o}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var a=r;r=function(){var u=Ml(c);a.call(u)}}var c=_a(e,0,!1,null,null,!1,!1,"",hu);return e._reactRootContainer=c,e[Ut]=c.current,Gr(e.nodeType===8?e.parentNode:e),Cn(function(){Xl(t,c,n,r)}),c}function ei(e,t,n,r,l){var i=n._reactRootContainer;if(i){var o=i;if(typeof l=="function"){var a=l;l=function(){var c=Ml(o);a.call(c)}}Xl(t,o,e,l)}else o=Kx(n,t,e,l,r);return Ml(o)}Sd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Cr(t.pendingLanes);n!==0&&(ra(t,n|1),Ze(t,be()),!(ie&6)&&(sr=be()+500,un()))}break;case 13:Cn(function(){var r=Dt(e,1);if(r!==null){var l=Be();kt(r,e,1,l)}}),Aa(e,1)}};sa=function(e){if(e.tag===13){var t=Dt(e,134217728);if(t!==null){var n=Be();kt(t,e,134217728,n)}Aa(e,134217728)}};Cd=function(e){if(e.tag===13){var t=nn(e),n=Dt(e,t);if(n!==null){var r=Be();kt(n,e,t,r)}Aa(e,t)}};Ed=function(){return me};Td=function(e,t){var n=me;try{return me=e,t()}finally{me=n}};so=function(e,t,n){switch(t){case"input":if(Xi(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=Hl(r);if(!l)throw Error(F(90));ld(r),Xi(r,l)}}}break;case"textarea":od(e,n);break;case"select":t=n.value,t!=null&&Vn(e,!!n.multiple,t,!1)}};fd=Pa;pd=Cn;var Yx={usingClientEntryPoint:!1,Events:[cs,Un,Hl,md,hd,Pa]},Nr={findFiberByHostInstance:xn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xx={bundleType:Nr.bundleType,version:Nr.version,rendererPackageName:Nr.rendererPackageName,rendererConfig:Nr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=yd(e),e===null?null:e.stateNode},findFiberByHostInstance:Nr.findFiberByHostInstance||Gx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ls=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ls.isDisabled&&Ls.supportsFiber)try{Dl=Ls.inject(Xx),Tt=Ls}catch{}}lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yx;lt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$a(t))throw Error(F(200));return Qx(e,t,null,n)};lt.createRoot=function(e,t){if(!$a(e))throw Error(F(299));var n=!1,r="",l=Ym;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=_a(e,1,!1,null,null,n,!1,r,l),e[Ut]=t.current,Gr(e.nodeType===8?e.parentNode:e),new Fa(t)};lt.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(F(188)):(e=Object.keys(e).join(","),Error(F(268,e)));return e=yd(t),e=e===null?null:e.stateNode,e};lt.flushSync=function(e){return Cn(e)};lt.hydrate=function(e,t,n){if(!Zl(t))throw Error(F(200));return ei(null,e,t,!0,n)};lt.hydrateRoot=function(e,t,n){if(!$a(e))throw Error(F(405));var r=n!=null&&n.hydratedSources||null,l=!1,i="",o=Ym;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Km(t,null,e,1,n??null,l,!1,i,o),e[Ut]=t.current,Gr(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new Jl(t)};lt.render=function(e,t,n){if(!Zl(t))throw Error(F(200));return ei(null,e,t,!1,n)};lt.unmountComponentAtNode=function(e){if(!Zl(e))throw Error(F(40));return e._reactRootContainer?(Cn(function(){ei(null,null,e,!1,function(){e._reactRootContainer=null,e[Ut]=null})}),!0):!1};lt.unstable_batchedUpdates=Pa;lt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Zl(n))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return ei(e,t,n,!1,r)};lt.version="18.3.1-next-f1338f8080-20240426";function Xm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xm)}catch(e){console.error(e)}}Xm(),Xu.exports=lt;var Ie=Xu.exports,fu=Ie;Hi.createRoot=fu.createRoot,Hi.hydrateRoot=fu.hydrateRoot;/**
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:l,digest:null}}function _i(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function bo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ex=typeof WeakMap=="function"?WeakMap:Map;function bm(e,t,n){n=At(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){El||(El=!0,Ro=r),bo(e,t)},n}function Sm(e,t,n){n=At(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){bo(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){bo(e,t),typeof r!="function"&&(tn===null?tn=new Set([this]):tn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Yc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ex;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Ox.bind(null,e,t,n),t.then(e,e))}function Xc(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 Jc(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=At(-1,1),t.tag=2,en(n,t,1))),n.lanes|=1),e)}var Mx=qt.ReactCurrentOwner,Ge=!1;function qe(e,t,n,r){t.child=e===null?em(t,null,n,r):tr(t,e.child,n,r)}function Zc(e,t,n,r,l){n=n.render;var i=t.ref;return Yn(t,l),r=Na(e,t,n,r,i,l),n=ba(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ot(e,t,l)):(xe&&n&&da(t),t.flags|=1,qe(e,t,r,l),t.child)}function eu(e,t,n,r,l){if(e===null){var i=n.type;return typeof i=="function"&&!Ra(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Cm(e,t,i,r,l)):(e=el(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&l)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Gr,n(o,r)&&e.ref===t.ref)return Ot(e,t,l)}return t.flags|=1,e=rn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Cm(e,t,n,r,l){if(e!==null){var i=e.memoizedProps;if(Gr(i,r)&&e.ref===t.ref)if(Ge=!1,t.pendingProps=r=i,(e.lanes&l)!==0)e.flags&131072&&(Ge=!0);else return t.lanes=e.lanes,Ot(e,t,l)}return So(e,t,n,r,l)}function Em(e,t,n){var r=t.pendingProps,l=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},he(Bn,Ze),Ze|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,he(Bn,Ze),Ze|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,he(Bn,Ze),Ze|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,he(Bn,Ze),Ze|=r;return qe(e,t,l,n),t.child}function Mm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function So(e,t,n,r,l){var i=Ye(n)?jn:De.current;return i=Zn(t,i),Yn(t,l),n=Na(e,t,n,r,i,l),r=ba(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ot(e,t,l)):(xe&&r&&da(t),t.flags|=1,qe(e,t,n,l),t.child)}function tu(e,t,n,r,l){if(Ye(n)){var i=!0;gl(t)}else i=!1;if(Yn(t,l),t.stateNode===null)Xs(e,t),Nm(t,n,r),No(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=dt(u):(u=Ye(n)?jn:De.current,u=Zn(t,u));var d=n.getDerivedStateFromProps,m=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";m||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==u)&&Kc(t,o,r,u),Bt=!1;var f=t.memoizedState;o.state=f,jl(t,r,o,l),c=t.memoizedState,a!==r||f!==c||Ke.current||Bt?(typeof d=="function"&&(jo(t,n,d,r),c=t.memoizedState),(a=Bt||Gc(t,n,a,r,f,c,u))?(m||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,nm(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:gt(t.type,a),o.props=u,m=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=dt(c):(c=Ye(n)?jn:De.current,c=Zn(t,c));var y=n.getDerivedStateFromProps;(d=typeof y=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==m||f!==c)&&Kc(t,o,r,c),Bt=!1,f=t.memoizedState,o.state=f,jl(t,r,o,l);var w=t.memoizedState;a!==m||f!==w||Ke.current||Bt?(typeof y=="function"&&(jo(t,n,y,r),w=t.memoizedState),(u=Bt||Gc(t,n,u,r,f,w,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,w,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,w,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=w),o.props=r,o.state=w,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Co(e,t,n,r,i,l)}function Co(e,t,n,r,l,i){Mm(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return l&&Dc(t,n,!1),Ot(e,t,i);r=t.stateNode,Mx.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=tr(t,e.child,null,i),t.child=tr(t,null,a,i)):qe(e,t,a,i),t.memoizedState=r.state,l&&Dc(t,n,!0),t.child}function Tm(e){var t=e.stateNode;t.pendingContext?Uc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Uc(e,t.context,!1),va(e,t.containerInfo)}function nu(e,t,n,r,l){return er(),ha(l),t.flags|=256,qe(e,t,n,r),t.child}var Eo={dehydrated:null,treeContext:null,retryLane:0};function Mo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Im(e,t,n){var r=t.pendingProps,l=ye.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(l&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),he(ye,l&1),e===null)return wo(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):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Xl(o,r,0,null),e=wn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Mo(n),t.memoizedState=Eo,e):Ea(t,o));if(l=e.memoizedState,l!==null&&(a=l.dehydrated,a!==null))return Tx(e,t,o,r,a,l,n);if(i){i=r.fallback,o=t.mode,l=e.child,a=l.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=rn(l,c),r.subtreeFlags=l.subtreeFlags&14680064),a!==null?i=rn(a,i):(i=wn(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Mo(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Eo,r}return i=e.child,e=i.sibling,r=rn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ea(e,t){return t=Xl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ps(e,t,n,r){return r!==null&&ha(r),tr(t,e.child,null,n),e=Ea(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tx(e,t,n,r,l,i,o){if(n)return t.flags&256?(t.flags&=-257,r=_i(Error($(422))),Ps(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,l=t.mode,r=Xl({mode:"visible",children:r.children},l,0,null),i=wn(i,l,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&tr(t,e.child,null,o),t.child.memoizedState=Mo(o),t.memoizedState=Eo,i);if(!(t.mode&1))return Ps(e,t,o,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error($(419)),r=_i(i,r,void 0),Ps(e,t,o,r)}if(a=(o&e.childLanes)!==0,Ge||a){if(r=Le,r!==null){switch(o&-o){case 4:l=2;break;case 16:l=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:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|o)?0:l,l!==0&&l!==i.retryLane&&(i.retryLane=l,Dt(e,l),kt(r,e,l,-1))}return La(),r=_i(Error($(421))),Ps(e,t,o,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=qx.bind(null,e),l._reactRetry=t,null):(e=i.treeContext,et=Zt(l.nextSibling),tt=t,xe=!0,vt=null,e!==null&&(ot[at++]=Rt,ot[at++]=_t,ot[at++]=Nn,Rt=e.id,_t=e.overflow,Nn=t),t=Ea(t,r.children),t.flags|=4096,t)}function ru(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ko(e.return,t,n)}function Ai(e,t,n,r,l){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=l)}function Pm(e,t,n){var r=t.pendingProps,l=r.revealOrder,i=r.tail;if(qe(e,t,r.children,n),r=ye.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ru(e,n,t);else if(e.tag===19)ru(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(he(ye,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Nl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Ai(t,!1,l,n,i);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Nl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Ai(t,!0,n,null,i);break;case"together":Ai(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Xs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ot(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Sn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error($(153));if(t.child!==null){for(e=t.child,n=rn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=rn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ix(e,t,n){switch(t.tag){case 3:Tm(t),er();break;case 5:rm(t);break;case 1:Ye(t.type)&&gl(t);break;case 4:va(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;he(wl,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(he(ye,ye.current&1),t.flags|=128,null):n&t.child.childLanes?Im(e,t,n):(he(ye,ye.current&1),e=Ot(e,t,n),e!==null?e.sibling:null);he(ye,ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Pm(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),he(ye,ye.current),r)break;return null;case 22:case 23:return t.lanes=0,Em(e,t,n)}return Ot(e,t,n)}var zm,To,Lm,Rm;zm=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};To=function(){};Lm=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,yn(Tt.current);var i=null;switch(n){case"input":l=Yi(e,l),r=Yi(e,r),i=[];break;case"select":l=we({},l,{value:void 0}),r=we({},r,{value:void 0}),i=[];break;case"textarea":l=Zi(e,l),r=Zi(e,r),i=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=pl)}to(n,r);var o;n=null;for(u in l)if(!r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&l[u]!=null)if(u==="style"){var a=l[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Or.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(a=l!=null?l[u]:void 0,r.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Or.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&fe("scroll",e),i||a===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Rm=function(e,t,n,r){n!==r&&(t.flags|=4)};function Nr(e,t){if(!xe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function $e(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Px(e,t,n){var r=t.pendingProps;switch(ma(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(t),null;case 1:return Ye(t.type)&&xl(),$e(t),null;case 3:return r=t.stateNode,nr(),pe(Ke),pe(De),ka(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ts(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,vt!==null&&(Fo(vt),vt=null))),To(e,t),$e(t),null;case 5:wa(t);var l=yn(Zr.current);if(n=t.type,e!==null&&t.stateNode!=null)Lm(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error($(166));return $e(t),null}if(e=yn(Tt.current),Ts(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Et]=t,r[Xr]=i,e=(t.mode&1)!==0,n){case"dialog":fe("cancel",r),fe("close",r);break;case"iframe":case"object":case"embed":fe("load",r);break;case"video":case"audio":for(l=0;l<Mr.length;l++)fe(Mr[l],r);break;case"source":fe("error",r);break;case"img":case"image":case"link":fe("error",r),fe("load",r);break;case"details":fe("toggle",r);break;case"input":mc(r,i),fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},fe("invalid",r);break;case"textarea":fc(r,i),fe("invalid",r)}to(n,i),l=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ms(r.textContent,a,e),l=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ms(r.textContent,a,e),l=["children",""+a]):Or.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&fe("scroll",r)}switch(n){case"input":ws(r),hc(r,i,!0);break;case"textarea":ws(r),pc(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=pl)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ad(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Et]=t,e[Xr]=r,zm(e,t,!1,!1),t.stateNode=e;e:{switch(o=no(n,r),n){case"dialog":fe("cancel",e),fe("close",e),l=r;break;case"iframe":case"object":case"embed":fe("load",e),l=r;break;case"video":case"audio":for(l=0;l<Mr.length;l++)fe(Mr[l],e);l=r;break;case"source":fe("error",e),l=r;break;case"img":case"image":case"link":fe("error",e),fe("load",e),l=r;break;case"details":fe("toggle",e),l=r;break;case"input":mc(e,r),l=Yi(e,r),fe("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=we({},r,{value:void 0}),fe("invalid",e);break;case"textarea":fc(e,r),l=Zi(e,r),fe("invalid",e);break;default:l=r}to(n,l),a=l;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?dd(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&cd(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&qr(e,c):typeof c=="number"&&qr(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Or.hasOwnProperty(i)?c!=null&&i==="onScroll"&&fe("scroll",e):c!=null&&Xo(e,i,c,o))}switch(n){case"input":ws(e),hc(e,r,!1);break;case"textarea":ws(e),pc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ln(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Vn(e,!!r.multiple,i,!1):r.defaultValue!=null&&Vn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=pl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return $e(t),null;case 6:if(e&&t.stateNode!=null)Rm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error($(166));if(n=yn(Zr.current),yn(Tt.current),Ts(t)){if(r=t.stateNode,n=t.memoizedProps,r[Et]=t,(i=r.nodeValue!==n)&&(e=tt,e!==null))switch(e.tag){case 3:Ms(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ms(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Et]=t,t.stateNode=r}return $e(t),null;case 13:if(pe(ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xe&&et!==null&&t.mode&1&&!(t.flags&128))Jd(),er(),t.flags|=98560,i=!1;else if(i=Ts(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error($(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error($(317));i[Et]=t}else er(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;$e(t),i=!1}else vt!==null&&(Fo(vt),vt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ye.current&1?Te===0&&(Te=3):La())),t.updateQueue!==null&&(t.flags|=4),$e(t),null);case 4:return nr(),To(e,t),e===null&&Kr(t.stateNode.containerInfo),$e(t),null;case 10:return xa(t.type._context),$e(t),null;case 17:return Ye(t.type)&&xl(),$e(t),null;case 19:if(pe(ye),i=t.memoizedState,i===null)return $e(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)Nr(i,!1);else{if(Te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Nl(e),o!==null){for(t.flags|=128,Nr(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return he(ye,ye.current&1|2),t.child}e=e.sibling}i.tail!==null&&be()>sr&&(t.flags|=128,r=!0,Nr(i,!1),t.lanes=4194304)}else{if(!r)if(e=Nl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Nr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!xe)return $e(t),null}else 2*be()-i.renderingStartTime>sr&&n!==1073741824&&(t.flags|=128,r=!0,Nr(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=be(),t.sibling=null,n=ye.current,he(ye,r?n&1|2:n&1),t):($e(t),null);case 22:case 23:return za(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ze&1073741824&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),null;case 24:return null;case 25:return null}throw Error($(156,t.tag))}function zx(e,t){switch(ma(t),t.tag){case 1:return Ye(t.type)&&xl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nr(),pe(Ke),pe(De),ka(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wa(t),null;case 13:if(pe(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($(340));er()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(ye),null;case 4:return nr(),null;case 10:return xa(t.type._context),null;case 22:case 23:return za(),null;case 24:return null;default:return null}}var zs=!1,Ue=!1,Lx=typeof WeakSet=="function"?WeakSet:Set,G=null;function Hn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ke(e,t,r)}else n.current=null}function Io(e,t,n){try{n()}catch(r){ke(e,t,r)}}var su=!1;function Rx(e,t){if(ho=ml,e=Ud(),ua(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 o=0,a=-1,c=-1,u=0,d=0,m=e,f=null;t:for(;;){for(var y;m!==n||l!==0&&m.nodeType!==3||(a=o+l),m!==i||r!==0&&m.nodeType!==3||(c=o+r),m.nodeType===3&&(o+=m.nodeValue.length),(y=m.firstChild)!==null;)f=m,m=y;for(;;){if(m===e)break t;if(f===n&&++u===l&&(a=o),f===i&&++d===r&&(c=o),(y=m.nextSibling)!==null)break;m=f,f=m.parentNode}m=y}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(fo={focusedElem:e,selectionRange:n},ml=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var k=w.memoizedProps,j=w.memoizedState,g=t.stateNode,h=g.getSnapshotBeforeUpdate(t.elementType===t.type?k:gt(t.type,k),j);g.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($(163))}}catch(v){ke(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return w=su,su=!1,w}function Ar(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&&Io(t,n,i)}l=l.next}while(l!==r)}}function Kl(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 Po(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 _m(e){var t=e.alternate;t!==null&&(e.alternate=null,_m(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Et],delete t[Xr],delete t[go],delete t[xx],delete t[gx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Am(e){return e.tag===5||e.tag===3||e.tag===4}function lu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Am(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zo(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=pl));else if(r!==4&&(e=e.child,e!==null))for(zo(e,t,n),e=e.sibling;e!==null;)zo(e,t,n),e=e.sibling}function Lo(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(Lo(e,t,n),e=e.sibling;e!==null;)Lo(e,t,n),e=e.sibling}var Re=null,yt=!1;function Wt(e,t,n){for(n=n.child;n!==null;)Fm(e,t,n),n=n.sibling}function Fm(e,t,n){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(Ol,n)}catch{}switch(n.tag){case 5:Ue||Hn(n,t);case 6:var r=Re,l=yt;Re=null,Wt(e,t,n),Re=r,yt=l,Re!==null&&(yt?(e=Re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Re.removeChild(n.stateNode));break;case 18:Re!==null&&(yt?(e=Re,n=n.stateNode,e.nodeType===8?Ti(e.parentNode,n):e.nodeType===1&&Ti(e,n),Vr(e)):Ti(Re,n.stateNode));break;case 4:r=Re,l=yt,Re=n.stateNode.containerInfo,yt=!0,Wt(e,t,n),Re=r,yt=l;break;case 0:case 11:case 14:case 15:if(!Ue&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Io(n,t,o),l=l.next}while(l!==r)}Wt(e,t,n);break;case 1:if(!Ue&&(Hn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ke(n,t,a)}Wt(e,t,n);break;case 21:Wt(e,t,n);break;case 22:n.mode&1?(Ue=(r=Ue)||n.memoizedState!==null,Wt(e,t,n),Ue=r):Wt(e,t,n);break;default:Wt(e,t,n)}}function iu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Lx),t.forEach(function(r){var l=Wx.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function xt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Re=a.stateNode,yt=!1;break e;case 3:Re=a.stateNode.containerInfo,yt=!0;break e;case 4:Re=a.stateNode.containerInfo,yt=!0;break e}a=a.return}if(Re===null)throw Error($(160));Fm(i,o,l),Re=null,yt=!1;var c=l.alternate;c!==null&&(c.return=null),l.return=null}catch(u){ke(l,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$m(t,e),t=t.sibling}function $m(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xt(t,e),bt(e),r&4){try{Ar(3,e,e.return),Kl(3,e)}catch(k){ke(e,e.return,k)}try{Ar(5,e,e.return)}catch(k){ke(e,e.return,k)}}break;case 1:xt(t,e),bt(e),r&512&&n!==null&&Hn(n,n.return);break;case 5:if(xt(t,e),bt(e),r&512&&n!==null&&Hn(n,n.return),e.flags&32){var l=e.stateNode;try{qr(l,"")}catch(k){ke(e,e.return,k)}}if(r&4&&(l=e.stateNode,l!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&id(l,i),no(a,o);var u=no(a,i);for(o=0;o<c.length;o+=2){var d=c[o],m=c[o+1];d==="style"?dd(l,m):d==="dangerouslySetInnerHTML"?cd(l,m):d==="children"?qr(l,m):Xo(l,d,m,u)}switch(a){case"input":Xi(l,i);break;case"textarea":od(l,i);break;case"select":var f=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?Vn(l,!!i.multiple,y,!1):f!==!!i.multiple&&(i.defaultValue!=null?Vn(l,!!i.multiple,i.defaultValue,!0):Vn(l,!!i.multiple,i.multiple?[]:"",!1))}l[Xr]=i}catch(k){ke(e,e.return,k)}}break;case 6:if(xt(t,e),bt(e),r&4){if(e.stateNode===null)throw Error($(162));l=e.stateNode,i=e.memoizedProps;try{l.nodeValue=i}catch(k){ke(e,e.return,k)}}break;case 3:if(xt(t,e),bt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vr(t.containerInfo)}catch(k){ke(e,e.return,k)}break;case 4:xt(t,e),bt(e);break;case 13:xt(t,e),bt(e),l=e.child,l.flags&8192&&(i=l.memoizedState!==null,l.stateNode.isHidden=i,!i||l.alternate!==null&&l.alternate.memoizedState!==null||(Ia=be())),r&4&&iu(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ue=(u=Ue)||d,xt(t,e),Ue=u):xt(t,e),bt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(G=e,d=e.child;d!==null;){for(m=G=d;G!==null;){switch(f=G,y=f.child,f.tag){case 0:case 11:case 14:case 15:Ar(4,f,f.return);break;case 1:Hn(f,f.return);var w=f.stateNode;if(typeof w.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(k){ke(r,n,k)}}break;case 5:Hn(f,f.return);break;case 22:if(f.memoizedState!==null){au(m);continue}}y!==null?(y.return=f,G=y):au(m)}d=d.sibling}e:for(d=null,m=e;;){if(m.tag===5){if(d===null){d=m;try{l=m.stateNode,u?(i=l.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=m.stateNode,c=m.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=ud("display",o))}catch(k){ke(e,e.return,k)}}}else if(m.tag===6){if(d===null)try{m.stateNode.nodeValue=u?"":m.memoizedProps}catch(k){ke(e,e.return,k)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;d===m&&(d=null),m=m.return}d===m&&(d=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:xt(t,e),bt(e),r&4&&iu(e);break;case 21:break;default:xt(t,e),bt(e)}}function bt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Am(n)){var r=n;break e}n=n.return}throw Error($(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(qr(l,""),r.flags&=-33);var i=lu(e);Lo(e,i,l);break;case 3:case 4:var o=r.stateNode.containerInfo,a=lu(e);zo(e,a,o);break;default:throw Error($(161))}}catch(c){ke(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _x(e,t,n){G=e,Um(e)}function Um(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var l=G,i=l.child;if(l.tag===22&&r){var o=l.memoizedState!==null||zs;if(!o){var a=l.alternate,c=a!==null&&a.memoizedState!==null||Ue;a=zs;var u=Ue;if(zs=o,(Ue=c)&&!u)for(G=l;G!==null;)o=G,c=o.child,o.tag===22&&o.memoizedState!==null?cu(l):c!==null?(c.return=o,G=c):cu(l);for(;i!==null;)G=i,Um(i),i=i.sibling;G=l,zs=a,Ue=u}ou(e)}else l.subtreeFlags&8772&&i!==null?(i.return=l,G=i):ou(e)}}function ou(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ue||Kl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ue)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:gt(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Bc(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Bc(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var m=d.dehydrated;m!==null&&Vr(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error($(163))}Ue||t.flags&512&&Po(t)}catch(f){ke(t,t.return,f)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function au(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function cu(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Kl(4,t)}catch(c){ke(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(c){ke(t,l,c)}}var i=t.return;try{Po(t)}catch(c){ke(t,i,c)}break;case 5:var o=t.return;try{Po(t)}catch(c){ke(t,o,c)}}}catch(c){ke(t,t.return,c)}if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}var Ax=Math.ceil,Cl=qt.ReactCurrentDispatcher,Ma=qt.ReactCurrentOwner,ut=qt.ReactCurrentBatchConfig,oe=0,Le=null,Ee=null,_e=0,Ze=0,Bn=cn(0),Te=0,rs=null,Sn=0,Yl=0,Ta=0,Fr=null,Qe=null,Ia=0,sr=1/0,zt=null,El=!1,Ro=null,tn=null,Ls=!1,Kt=null,Ml=0,$r=0,_o=null,Js=-1,Zs=0;function We(){return oe&6?be():Js!==-1?Js:Js=be()}function nn(e){return e.mode&1?oe&2&&_e!==0?_e&-_e:vx.transition!==null?(Zs===0&&(Zs=Nd()),Zs):(e=me,e!==0||(e=window.event,e=e===void 0?16:Id(e.type)),e):1}function kt(e,t,n,r){if(50<$r)throw $r=0,_o=null,Error($(185));as(e,n,r),(!(oe&2)||e!==Le)&&(e===Le&&(!(oe&2)&&(Yl|=n),Te===4&&Qt(e,_e)),Xe(e,r),n===1&&oe===0&&!(t.mode&1)&&(sr=be()+500,Vl&&un()))}function Xe(e,t){var n=e.callbackNode;vp(e,t);var r=dl(e,e===Le?_e:0);if(r===0)n!==null&&yc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&yc(n),t===1)e.tag===0?yx(uu.bind(null,e)):Kd(uu.bind(null,e)),fx(function(){!(oe&6)&&un()}),n=null;else{switch(bd(r)){case 1:n=na;break;case 4:n=kd;break;case 16:n=ul;break;case 536870912:n=jd;break;default:n=ul}n=Qm(n,Dm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Dm(e,t){if(Js=-1,Zs=0,oe&6)throw Error($(327));var n=e.callbackNode;if(Xn()&&e.callbackNode!==n)return null;var r=dl(e,e===Le?_e:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Tl(e,r);else{t=r;var l=oe;oe|=2;var i=qm();(Le!==e||_e!==t)&&(zt=null,sr=be()+500,vn(e,t));do try{Ux();break}catch(a){Om(e,a)}while(!0);pa(),Cl.current=i,oe=l,Ee!==null?t=0:(Le=null,_e=0,t=Te)}if(t!==0){if(t===2&&(l=oo(e),l!==0&&(r=l,t=Ao(e,l))),t===1)throw n=rs,vn(e,0),Qt(e,r),Xe(e,be()),n;if(t===6)Qt(e,r);else{if(l=e.current.alternate,!(r&30)&&!Fx(l)&&(t=Tl(e,r),t===2&&(i=oo(e),i!==0&&(r=i,t=Ao(e,i))),t===1))throw n=rs,vn(e,0),Qt(e,r),Xe(e,be()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error($(345));case 2:pn(e,Qe,zt);break;case 3:if(Qt(e,r),(r&130023424)===r&&(t=Ia+500-be(),10<t)){if(dl(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){We(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=xo(pn.bind(null,e,Qe,zt),t);break}pn(e,Qe,zt);break;case 4:if(Qt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var o=31-wt(r);i=1<<o,o=t[o],o>l&&(l=o),r&=~i}if(r=l,r=be()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ax(r/1960))-r,10<r){e.timeoutHandle=xo(pn.bind(null,e,Qe,zt),r);break}pn(e,Qe,zt);break;case 5:pn(e,Qe,zt);break;default:throw Error($(329))}}}return Xe(e,be()),e.callbackNode===n?Dm.bind(null,e):null}function Ao(e,t){var n=Fr;return e.current.memoizedState.isDehydrated&&(vn(e,t).flags|=256),e=Tl(e,t),e!==2&&(t=Qe,Qe=n,t!==null&&Fo(t)),e}function Fo(e){Qe===null?Qe=e:Qe.push.apply(Qe,e)}function Fx(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],i=l.getSnapshot;l=l.value;try{if(!jt(i(),l))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Qt(e,t){for(t&=~Ta,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-wt(t),r=1<<n;e[n]=-1,t&=~r}}function uu(e){if(oe&6)throw Error($(327));Xn();var t=dl(e,0);if(!(t&1))return Xe(e,be()),null;var n=Tl(e,t);if(e.tag!==0&&n===2){var r=oo(e);r!==0&&(t=r,n=Ao(e,r))}if(n===1)throw n=rs,vn(e,0),Qt(e,t),Xe(e,be()),n;if(n===6)throw Error($(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,pn(e,Qe,zt),Xe(e,be()),null}function Pa(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(sr=be()+500,Vl&&un())}}function Cn(e){Kt!==null&&Kt.tag===0&&!(oe&6)&&Xn();var t=oe;oe|=1;var n=ut.transition,r=me;try{if(ut.transition=null,me=1,e)return e()}finally{me=r,ut.transition=n,oe=t,!(oe&6)&&un()}}function za(){Ze=Bn.current,pe(Bn)}function vn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,hx(n)),Ee!==null)for(n=Ee.return;n!==null;){var r=n;switch(ma(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&xl();break;case 3:nr(),pe(Ke),pe(De),ka();break;case 5:wa(r);break;case 4:nr();break;case 13:pe(ye);break;case 19:pe(ye);break;case 10:xa(r.type._context);break;case 22:case 23:za()}n=n.return}if(Le=e,Ee=e=rn(e.current,null),_e=Ze=t,Te=0,rs=null,Ta=Yl=Sn=0,Qe=Fr=null,gn!==null){for(t=0;t<gn.length;t++)if(n=gn[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=l,r.next=o}n.pending=r}gn=null}return e}function Om(e,t){do{var n=Ee;try{if(pa(),Ks.current=Sl,bl){for(var r=ve.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}bl=!1}if(bn=0,Pe=Me=ve=null,_r=!1,es=0,Ma.current=null,n===null||n.return===null){Te=1,rs=t,Ee=null;break}e:{var i=e,o=n.return,a=n,c=t;if(t=_e,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=a,m=d.tag;if(!(d.mode&1)&&(m===0||m===11||m===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var y=Xc(o);if(y!==null){y.flags&=-257,Jc(y,o,a,i,t),y.mode&1&&Yc(i,u,t),t=y,c=u;var w=t.updateQueue;if(w===null){var k=new Set;k.add(c),t.updateQueue=k}else w.add(c);break e}else{if(!(t&1)){Yc(i,u,t),La();break e}c=Error($(426))}}else if(xe&&a.mode&1){var j=Xc(o);if(j!==null){!(j.flags&65536)&&(j.flags|=256),Jc(j,o,a,i,t),ha(rr(c,a));break e}}i=c=rr(c,a),Te!==4&&(Te=2),Fr===null?Fr=[i]:Fr.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=bm(i,c,t);Hc(i,g);break e;case 1:a=c;var h=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof h.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(tn===null||!tn.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var v=Sm(i,a,t);Hc(i,v);break e}}i=i.return}while(i!==null)}Hm(n)}catch(N){t=N,Ee===n&&n!==null&&(Ee=n=n.return);continue}break}while(!0)}function qm(){var e=Cl.current;return Cl.current=Sl,e===null?Sl:e}function La(){(Te===0||Te===3||Te===2)&&(Te=4),Le===null||!(Sn&268435455)&&!(Yl&268435455)||Qt(Le,_e)}function Tl(e,t){var n=oe;oe|=2;var r=qm();(Le!==e||_e!==t)&&(zt=null,vn(e,t));do try{$x();break}catch(l){Om(e,l)}while(!0);if(pa(),oe=n,Cl.current=r,Ee!==null)throw Error($(261));return Le=null,_e=0,Te}function $x(){for(;Ee!==null;)Wm(Ee)}function Ux(){for(;Ee!==null&&!up();)Wm(Ee)}function Wm(e){var t=Vm(e.alternate,e,Ze);e.memoizedProps=e.pendingProps,t===null?Hm(e):Ee=t,Ma.current=null}function Hm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=zx(n,t),n!==null){n.flags&=32767,Ee=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Te=6,Ee=null;return}}else if(n=Px(n,t,Ze),n!==null){Ee=n;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);Te===0&&(Te=5)}function pn(e,t,n){var r=me,l=ut.transition;try{ut.transition=null,me=1,Dx(e,t,n,r)}finally{ut.transition=l,me=r}return null}function Dx(e,t,n,r){do Xn();while(Kt!==null);if(oe&6)throw Error($(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error($(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(wp(e,i),e===Le&&(Ee=Le=null,_e=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ls||(Ls=!0,Qm(ul,function(){return Xn(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ut.transition,ut.transition=null;var o=me;me=1;var a=oe;oe|=4,Ma.current=null,Rx(e,n),$m(n,e),ix(fo),ml=!!ho,fo=ho=null,e.current=n,_x(n),dp(),oe=a,me=o,ut.transition=i}else e.current=n;if(Ls&&(Ls=!1,Kt=e,Ml=l),i=e.pendingLanes,i===0&&(tn=null),fp(n.stateNode),Xe(e,be()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(El)throw El=!1,e=Ro,Ro=null,e;return Ml&1&&e.tag!==0&&Xn(),i=e.pendingLanes,i&1?e===_o?$r++:($r=0,_o=e):$r=0,un(),null}function Xn(){if(Kt!==null){var e=bd(Ml),t=ut.transition,n=me;try{if(ut.transition=null,me=16>e?16:e,Kt===null)var r=!1;else{if(e=Kt,Kt=null,Ml=0,oe&6)throw Error($(331));var l=oe;for(oe|=4,G=e.current;G!==null;){var i=G,o=i.child;if(G.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(G=u;G!==null;){var d=G;switch(d.tag){case 0:case 11:case 15:Ar(8,d,i)}var m=d.child;if(m!==null)m.return=d,G=m;else for(;G!==null;){d=G;var f=d.sibling,y=d.return;if(_m(d),d===u){G=null;break}if(f!==null){f.return=y,G=f;break}G=y}}}var w=i.alternate;if(w!==null){var k=w.child;if(k!==null){w.child=null;do{var j=k.sibling;k.sibling=null,k=j}while(k!==null)}}G=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,G=o;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ar(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,G=g;break e}G=i.return}}var h=e.current;for(G=h;G!==null;){o=G;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,G=x;else e:for(o=h;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Kl(9,a)}}catch(N){ke(a,a.return,N)}if(a===o){G=null;break e}var v=a.sibling;if(v!==null){v.return=a.return,G=v;break e}G=a.return}}if(oe=l,un(),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(Ol,e)}catch{}r=!0}return r}finally{me=n,ut.transition=t}}return!1}function du(e,t,n){t=rr(n,t),t=bm(e,t,1),e=en(e,t,1),t=We(),e!==null&&(as(e,1,t),Xe(e,t))}function ke(e,t,n){if(e.tag===3)du(e,e,n);else for(;t!==null;){if(t.tag===3){du(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(tn===null||!tn.has(r))){e=rr(n,e),e=Sm(t,e,1),t=en(t,e,1),e=We(),t!==null&&(as(t,1,e),Xe(t,e));break}}t=t.return}}function Ox(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=We(),e.pingedLanes|=e.suspendedLanes&n,Le===e&&(_e&n)===n&&(Te===4||Te===3&&(_e&130023424)===_e&&500>be()-Ia?vn(e,0):Ta|=n),Xe(e,t)}function Bm(e,t){t===0&&(e.mode&1?(t=Ns,Ns<<=1,!(Ns&130023424)&&(Ns=4194304)):t=1);var n=We();e=Dt(e,t),e!==null&&(as(e,t,n),Xe(e,n))}function qx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bm(e,n)}function Wx(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($(314))}r!==null&&r.delete(t),Bm(e,n)}var Vm;Vm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ke.current)Ge=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ge=!1,Ix(e,t,n);Ge=!!(e.flags&131072)}else Ge=!1,xe&&t.flags&1048576&&Yd(t,vl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Xs(e,t),e=t.pendingProps;var l=Zn(t,De.current);Yn(t,n),l=Na(null,t,r,e,l,n);var i=ba();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,Ye(r)?(i=!0,gl(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,ya(t),l.updater=Gl,t.stateNode=l,l._reactInternals=t,No(t,r,e,n),t=Co(null,t,r,!0,i,n)):(t.tag=0,xe&&i&&da(t),qe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Xs(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Bx(r),e=gt(r,e),l){case 0:t=So(null,t,r,e,n);break e;case 1:t=tu(null,t,r,e,n);break e;case 11:t=Zc(null,t,r,e,n);break e;case 14:t=eu(null,t,r,gt(r.type,e),n);break e}throw Error($(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:gt(r,l),So(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:gt(r,l),tu(e,t,r,l,n);case 3:e:{if(Tm(t),e===null)throw Error($(387));r=t.pendingProps,i=t.memoizedState,l=i.element,nm(e,t),jl(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=rr(Error($(423)),t),t=nu(e,t,r,n,l);break e}else if(r!==l){l=rr(Error($(424)),t),t=nu(e,t,r,n,l);break e}else for(et=Zt(t.stateNode.containerInfo.firstChild),tt=t,xe=!0,vt=null,n=em(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(er(),r===l){t=Ot(e,t,n);break e}qe(e,t,r,n)}t=t.child}return t;case 5:return rm(t),e===null&&wo(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,po(r,l)?o=null:i!==null&&po(r,i)&&(t.flags|=32),Mm(e,t),qe(e,t,o,n),t.child;case 6:return e===null&&wo(t),null;case 13:return Im(e,t,n);case 4:return va(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=tr(t,null,r,n):qe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:gt(r,l),Zc(e,t,r,l,n);case 7:return qe(e,t,t.pendingProps,n),t.child;case 8:return qe(e,t,t.pendingProps.children,n),t.child;case 12:return qe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,he(wl,r._currentValue),r._currentValue=o,i!==null)if(jt(i.value,o)){if(i.children===l.children&&!Ke.current){t=Ot(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=At(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),ko(i.return,n,t),a.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error($(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ko(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}qe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Yn(t,n),l=dt(l),r=r(l),t.flags|=1,qe(e,t,r,n),t.child;case 14:return r=t.type,l=gt(r,t.pendingProps),l=gt(r.type,l),eu(e,t,r,l,n);case 15:return Cm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:gt(r,l),Xs(e,t),t.tag=1,Ye(r)?(e=!0,gl(t)):e=!1,Yn(t,n),Nm(t,r,l),No(t,r,l,n),Co(null,t,r,!0,e,n);case 19:return Pm(e,t,n);case 22:return Em(e,t,n)}throw Error($(156,t.tag))};function Qm(e,t){return wd(e,t)}function Hx(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 ct(e,t,n,r){return new Hx(e,t,n,r)}function Ra(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bx(e){if(typeof e=="function")return Ra(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zo)return 11;if(e===ea)return 14}return 2}function rn(e,t){var n=e.alternate;return n===null?(n=ct(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 el(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")Ra(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case _n:return wn(n.children,l,i,t);case Jo:o=8,l|=8;break;case Vi:return e=ct(12,n,t,l|2),e.elementType=Vi,e.lanes=i,e;case Qi:return e=ct(13,n,t,l),e.elementType=Qi,e.lanes=i,e;case Gi:return e=ct(19,n,t,l),e.elementType=Gi,e.lanes=i,e;case rd:return Xl(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case td:o=10;break e;case nd:o=9;break e;case Zo:o=11;break e;case ea:o=14;break e;case Ht:o=16,r=null;break e}throw Error($(130,e==null?e:typeof e,""))}return t=ct(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function wn(e,t,n,r){return e=ct(7,e,r,t),e.lanes=n,e}function Xl(e,t,n,r){return e=ct(22,e,r,t),e.elementType=rd,e.lanes=n,e.stateNode={isHidden:!1},e}function Fi(e,t,n){return e=ct(6,e,null,t),e.lanes=n,e}function $i(e,t,n){return t=ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Vx(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=yi(0),this.expirationTimes=yi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yi(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function _a(e,t,n,r,l,i,o,a,c){return e=new Vx(e,t,n,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ct(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ya(i),e}function Qx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Rn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Gm(e){if(!e)return on;e=e._reactInternals;e:{if(Mn(e)!==e||e.tag!==1)throw Error($(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ye(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error($(171))}if(e.tag===1){var n=e.type;if(Ye(n))return Gd(e,n,t)}return t}function Km(e,t,n,r,l,i,o,a,c){return e=_a(n,r,!0,e,l,i,o,a,c),e.context=Gm(null),n=e.current,r=We(),l=nn(n),i=At(r,l),i.callback=t??null,en(n,i,l),e.current.lanes=l,as(e,l,r),Xe(e,r),e}function Jl(e,t,n,r){var l=t.current,i=We(),o=nn(l);return n=Gm(n),t.context===null?t.context=n:t.pendingContext=n,t=At(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=en(l,t,o),e!==null&&(kt(e,l,o,i),Gs(e,l,o)),o}function Il(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 mu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Aa(e,t){mu(e,t),(e=e.alternate)&&mu(e,t)}function Gx(){return null}var Ym=typeof reportError=="function"?reportError:function(e){console.error(e)};function Fa(e){this._internalRoot=e}Zl.prototype.render=Fa.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error($(409));Jl(e,t,null,null)};Zl.prototype.unmount=Fa.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Cn(function(){Jl(null,e,null,null)}),t[Ut]=null}};function Zl(e){this._internalRoot=e}Zl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ed();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vt.length&&t!==0&&t<Vt[n].priority;n++);Vt.splice(n,0,e),n===0&&Td(e)}};function $a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ei(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hu(){}function Kx(e,t,n,r,l){if(l){if(typeof r=="function"){var i=r;r=function(){var u=Il(o);i.call(u)}}var o=Km(t,r,e,0,null,!1,!1,"",hu);return e._reactRootContainer=o,e[Ut]=o.current,Kr(e.nodeType===8?e.parentNode:e),Cn(),o}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var a=r;r=function(){var u=Il(c);a.call(u)}}var c=_a(e,0,!1,null,null,!1,!1,"",hu);return e._reactRootContainer=c,e[Ut]=c.current,Kr(e.nodeType===8?e.parentNode:e),Cn(function(){Jl(t,c,n,r)}),c}function ti(e,t,n,r,l){var i=n._reactRootContainer;if(i){var o=i;if(typeof l=="function"){var a=l;l=function(){var c=Il(o);a.call(c)}}Jl(t,o,e,l)}else o=Kx(n,t,e,l,r);return Il(o)}Sd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Er(t.pendingLanes);n!==0&&(ra(t,n|1),Xe(t,be()),!(oe&6)&&(sr=be()+500,un()))}break;case 13:Cn(function(){var r=Dt(e,1);if(r!==null){var l=We();kt(r,e,1,l)}}),Aa(e,1)}};sa=function(e){if(e.tag===13){var t=Dt(e,134217728);if(t!==null){var n=We();kt(t,e,134217728,n)}Aa(e,134217728)}};Cd=function(e){if(e.tag===13){var t=nn(e),n=Dt(e,t);if(n!==null){var r=We();kt(n,e,t,r)}Aa(e,t)}};Ed=function(){return me};Md=function(e,t){var n=me;try{return me=e,t()}finally{me=n}};so=function(e,t,n){switch(t){case"input":if(Xi(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=Bl(r);if(!l)throw Error($(90));ld(r),Xi(r,l)}}}break;case"textarea":od(e,n);break;case"select":t=n.value,t!=null&&Vn(e,!!n.multiple,t,!1)}};fd=Pa;pd=Cn;var Yx={usingClientEntryPoint:!1,Events:[us,Un,Bl,md,hd,Pa]},br={findFiberByHostInstance:xn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xx={bundleType:br.bundleType,version:br.version,rendererPackageName:br.rendererPackageName,rendererConfig:br.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=yd(e),e===null?null:e.stateNode},findFiberByHostInstance:br.findFiberByHostInstance||Gx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rs.isDisabled&&Rs.supportsFiber)try{Ol=Rs.inject(Xx),Mt=Rs}catch{}}rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yx;rt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$a(t))throw Error($(200));return Qx(e,t,null,n)};rt.createRoot=function(e,t){if(!$a(e))throw Error($(299));var n=!1,r="",l=Ym;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=_a(e,1,!1,null,null,n,!1,r,l),e[Ut]=t.current,Kr(e.nodeType===8?e.parentNode:e),new Fa(t)};rt.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($(188)):(e=Object.keys(e).join(","),Error($(268,e)));return e=yd(t),e=e===null?null:e.stateNode,e};rt.flushSync=function(e){return Cn(e)};rt.hydrate=function(e,t,n){if(!ei(t))throw Error($(200));return ti(null,e,t,!0,n)};rt.hydrateRoot=function(e,t,n){if(!$a(e))throw Error($(405));var r=n!=null&&n.hydratedSources||null,l=!1,i="",o=Ym;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Km(t,null,e,1,n??null,l,!1,i,o),e[Ut]=t.current,Kr(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new Zl(t)};rt.render=function(e,t,n){if(!ei(t))throw Error($(200));return ti(null,e,t,!1,n)};rt.unmountComponentAtNode=function(e){if(!ei(e))throw Error($(40));return e._reactRootContainer?(Cn(function(){ti(null,null,e,!1,function(){e._reactRootContainer=null,e[Ut]=null})}),!0):!1};rt.unstable_batchedUpdates=Pa;rt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ei(n))throw Error($(200));if(e==null||e._reactInternals===void 0)throw Error($(38));return ti(e,t,n,!1,r)};rt.version="18.3.1-next-f1338f8080-20240426";function Xm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xm)}catch(e){console.error(e)}}Xm(),Xu.exports=rt;var Ie=Xu.exports,fu=Ie;Hi.createRoot=fu.createRoot,Hi.hydrateRoot=fu.hydrateRoot;/**
|
|
41
41
|
* @license lucide-react v0.294.0 - ISC
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the ISC license.
|
|
@@ -132,12 +132,12 @@ Error generating stack: `+i.message+`
|
|
|
132
132
|
*
|
|
133
133
|
* This source code is licensed under the ISC license.
|
|
134
134
|
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const
|
|
135
|
+
*/const ni=B("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
136
136
|
* @license lucide-react v0.294.0 - ISC
|
|
137
137
|
*
|
|
138
138
|
* This source code is licensed under the ISC license.
|
|
139
139
|
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const
|
|
140
|
+
*/const Ur=B("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
141
141
|
* @license lucide-react v0.294.0 - ISC
|
|
142
142
|
*
|
|
143
143
|
* This source code is licensed under the ISC license.
|
|
@@ -147,7 +147,7 @@ Error generating stack: `+i.message+`
|
|
|
147
147
|
*
|
|
148
148
|
* This source code is licensed under the ISC license.
|
|
149
149
|
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const
|
|
150
|
+
*/const ri=B("Crown",[["path",{d:"m2 4 3 12h14l3-12-6 7-4-7-4 7-6-7zm3 16h14",key:"zkxr6b"}]]);/**
|
|
151
151
|
* @license lucide-react v0.294.0 - ISC
|
|
152
152
|
*
|
|
153
153
|
* This source code is licensed under the ISC license.
|
|
@@ -167,7 +167,7 @@ Error generating stack: `+i.message+`
|
|
|
167
167
|
*
|
|
168
168
|
* This source code is licensed under the ISC license.
|
|
169
169
|
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const
|
|
170
|
+
*/const Pl=B("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
171
171
|
* @license lucide-react v0.294.0 - ISC
|
|
172
172
|
*
|
|
173
173
|
* This source code is licensed under the ISC license.
|
|
@@ -207,7 +207,7 @@ Error generating stack: `+i.message+`
|
|
|
207
207
|
*
|
|
208
208
|
* This source code is licensed under the ISC license.
|
|
209
209
|
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const
|
|
210
|
+
*/const zl=B("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
211
211
|
* @license lucide-react v0.294.0 - ISC
|
|
212
212
|
*
|
|
213
213
|
* This source code is licensed under the ISC license.
|
|
@@ -217,7 +217,7 @@ Error generating stack: `+i.message+`
|
|
|
217
217
|
*
|
|
218
218
|
* This source code is licensed under the ISC license.
|
|
219
219
|
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const
|
|
220
|
+
*/const _s=B("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
221
221
|
* @license lucide-react v0.294.0 - ISC
|
|
222
222
|
*
|
|
223
223
|
* This source code is licensed under the ISC license.
|
|
@@ -297,7 +297,7 @@ Error generating stack: `+i.message+`
|
|
|
297
297
|
*
|
|
298
298
|
* This source code is licensed under the ISC license.
|
|
299
299
|
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const
|
|
300
|
+
*/const tl=B("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
|
|
301
301
|
* @license lucide-react v0.294.0 - ISC
|
|
302
302
|
*
|
|
303
303
|
* This source code is licensed under the ISC license.
|
|
@@ -322,12 +322,12 @@ Error generating stack: `+i.message+`
|
|
|
322
322
|
*
|
|
323
323
|
* This source code is licensed under the ISC license.
|
|
324
324
|
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const
|
|
325
|
+
*/const ss=B("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
326
326
|
* @license lucide-react v0.294.0 - ISC
|
|
327
327
|
*
|
|
328
328
|
* This source code is licensed under the ISC license.
|
|
329
329
|
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const
|
|
330
|
+
*/const Ll=B("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
331
331
|
* @license lucide-react v0.294.0 - ISC
|
|
332
332
|
*
|
|
333
333
|
* This source code is licensed under the ISC license.
|
|
@@ -342,7 +342,7 @@ Error generating stack: `+i.message+`
|
|
|
342
342
|
*
|
|
343
343
|
* This source code is licensed under the ISC license.
|
|
344
344
|
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
-
*/const
|
|
345
|
+
*/const ms=B("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
|
|
346
346
|
* @license lucide-react v0.294.0 - ISC
|
|
347
347
|
*
|
|
348
348
|
* This source code is licensed under the ISC license.
|
|
@@ -372,7 +372,7 @@ Error generating stack: `+i.message+`
|
|
|
372
372
|
*
|
|
373
373
|
* This source code is licensed under the ISC license.
|
|
374
374
|
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
-
*/const
|
|
375
|
+
*/const nl=B("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
376
376
|
* @license lucide-react v0.294.0 - ISC
|
|
377
377
|
*
|
|
378
378
|
* This source code is licensed under the ISC license.
|
|
@@ -397,7 +397,7 @@ Error generating stack: `+i.message+`
|
|
|
397
397
|
*
|
|
398
398
|
* This source code is licensed under the ISC license.
|
|
399
399
|
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
-
*/const
|
|
400
|
+
*/const si=B("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
401
401
|
* @license lucide-react v0.294.0 - ISC
|
|
402
402
|
*
|
|
403
403
|
* This source code is licensed under the ISC license.
|
|
@@ -412,42 +412,42 @@ Error generating stack: `+i.message+`
|
|
|
412
412
|
*
|
|
413
413
|
* This source code is licensed under the ISC license.
|
|
414
414
|
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
-
*/const
|
|
415
|
+
*/const M0=B("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
416
416
|
* @license lucide-react v0.294.0 - ISC
|
|
417
417
|
*
|
|
418
418
|
* This source code is licensed under the ISC license.
|
|
419
419
|
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
-
*/const
|
|
420
|
+
*/const ht=B("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
421
421
|
* @license lucide-react v0.294.0 - ISC
|
|
422
422
|
*
|
|
423
423
|
* This source code is licensed under the ISC license.
|
|
424
424
|
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
-
*/const
|
|
425
|
+
*/const T0=B("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),I0=({message:e,type:t="success",duration:n=3e3,onClose:r})=>{const[l,i]=p.useState(!0);p.useEffect(()=>{const c=setTimeout(()=>{i(!1),setTimeout(r,300)},n);return()=>clearTimeout(c)},[n,r]);const o={success:s.jsx(a0,{className:"w-5 h-5"}),error:s.jsx(M0,{className:"w-5 h-5"}),warning:s.jsx(Jm,{className:"w-5 h-5"})},a={success:"bg-green-50/90 backdrop-blur-md border-green-200/50 text-green-800",error:"bg-red-50/90 backdrop-blur-md border-red-200/50 text-red-800",warning:"bg-yellow-50/90 backdrop-blur-md border-yellow-200/50 text-yellow-800"};return s.jsxs("div",{className:`fixed top-4 right-4 flex items-center gap-3 px-4 py-3 rounded-2xl border shadow-lg transition-all duration-300 ${a[t]} ${l?"translate-x-0 opacity-100":"translate-x-full opacity-0"}`,style:{minWidth:"300px",maxWidth:"500px",zIndex:99999},children:[s.jsx("div",{className:"flex-shrink-0",children:o[t]}),s.jsx("p",{className:"flex-1 text-sm font-medium",children:e}),s.jsx("button",{onClick:()=>{i(!1),setTimeout(r,300)},className:"flex-shrink-0 hover:opacity-70 transition-opacity",children:s.jsx(ht,{size:18})})]})};let P0=0;const rl=[];let Rl=[];const ph=()=>{rl.forEach(e=>e([...Rl]))},Y=(e,t="success",n=3e3)=>{const r=P0++;Rl.push({id:r,message:e,type:t,duration:n}),ph()},Di=()=>{const[e,t]=p.useState([]);p.useEffect(()=>{const l=i=>t(i);return rl.push(l),()=>{const i=rl.indexOf(l);i>-1&&rl.splice(i,1)}},[]);const n=l=>{Rl=Rl.filter(i=>i.id!==l),ph()},r=s.jsx(s.Fragment,{children:e.map((l,i)=>s.jsx("div",{style:{top:`${1+i*4.5}rem`,zIndex:99999},className:"fixed right-4",children:s.jsx(I0,{message:l.message,type:l.type,duration:l.duration,onClose:()=>n(l.id)})},l.id))});return Ie.createPortal(r,document.body)},vu=({children:e})=>{const t=p.useRef(null);return t.current||(t.current=document.createElement("div")),p.useEffect(()=>{const n=document.body,r=t.current;return n.appendChild(r),()=>{n.removeChild(r)}},[]),Ie.createPortal(e,t.current)},wu=e=>{let t;const n=new Set,r=(u,d)=>{const m=typeof u=="function"?u(t):u;if(!Object.is(m,t)){const f=t;t=d??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(y=>y(t,f))}},l=()=>t,a={setState:r,getState:l,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=t=e(r,l,a);return a},z0=e=>e?wu(e):wu,L0=e=>e;function R0(e,t=L0){const n=ce.useSyncExternalStore(e.subscribe,ce.useCallback(()=>t(e.getState()),[e,t]),ce.useCallback(()=>t(e.getInitialState()),[e,t]));return ce.useDebugValue(n),n}const _0=e=>{const t=z0(e),n=r=>R0(t,r);return Object.assign(n,t),n},qa=e=>_0;function A0(e,t){let n;try{n=e()}catch{return}return{getItem:l=>{var i;const o=c=>c===null?null:JSON.parse(c,void 0),a=(i=n.getItem(l))!=null?i:null;return a instanceof Promise?a.then(o):o(a)},setItem:(l,i)=>n.setItem(l,JSON.stringify(i,void 0)),removeItem:l=>n.removeItem(l)}}const Oo=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Oo(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Oo(r)(n)}}}},F0=(e,t)=>(n,r,l)=>{let i={storage:A0(()=>window.localStorage),partialize:j=>j,version:0,merge:(j,g)=>({...g,...j}),...t},o=!1,a=0;const c=new Set,u=new Set;let d=i.storage;if(!d)return e((...j)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...j)},r,l);const m=()=>{const j=i.partialize({...r()});return d.setItem(i.name,{state:j,version:i.version})},f=l.setState;l.setState=(j,g)=>(f(j,g),m());const y=e((...j)=>(n(...j),m()),r,l);l.getInitialState=()=>y;let w;const k=()=>{var j,g;if(!d)return;const h=++a;o=!1,c.forEach(v=>{var N;return v((N=r())!=null?N:y)});const x=((g=i.onRehydrateStorage)==null?void 0:g.call(i,(j=r())!=null?j:y))||void 0;return Oo(d.getItem.bind(d))(i.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==i.version){if(i.migrate){const N=i.migrate(v.state,v.version);return N instanceof Promise?N.then(S=>[!0,S]):[!0,N]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var N;if(h!==a)return;const[S,T]=v;if(w=i.merge(T,(N=r())!=null?N:y),n(w,!0),S)return m()}).then(()=>{h===a&&(x==null||x(w,void 0),w=r(),o=!0,u.forEach(v=>v(w)))}).catch(v=>{h===a&&(x==null||x(void 0,v))})};return l.persist={setOptions:j=>{i={...i,...j},j.storage&&(d=j.storage)},clearStorage:()=>{d==null||d.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>k(),hasHydrated:()=>o,onHydrate:j=>(c.add(j),()=>{c.delete(j)}),onFinishHydration:j=>(u.add(j),()=>{u.delete(j)})},i.skipHydration||k(),w||y},Wa=F0,xh=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,Oi=e=>e==="auto"?xh():e==="dark",sl=e=>{e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},qo=qa()(Wa((e,t)=>({mode:"auto",isDark:xh(),setMode:n=>{const r=Oi(n);sl(r),e({mode:n,isDark:r})},cycleMode:()=>{const n=t().mode,r=n==="light"?"dark":n==="dark"?"auto":"light",l=Oi(r);sl(l),e({mode:r,isDark:l})}}),{name:"llbot-theme",partialize:e=>({mode:e.mode}),onRehydrateStorage:()=>e=>{if(e){const t=Oi(e.mode);sl(t),e.isDark=t}}}));typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{qo.getState().mode==="auto"&&(sl(t.matches),qo.setState({isDark:t.matches}))});const As=()=>{const e=p.useRef(null),t=p.useRef([]),n=p.useRef(),r=p.useRef(0),l=p.useRef(null);return p.useEffect(()=>{const i=e.current;if(!i)return;const o=i.getContext("2d",{alpha:!0});if(!o)return;const c=1e3/30,u=()=>{if(l.current)return l.current;const h=Math.max(window.innerWidth,document.documentElement.clientWidth),x=Math.max(window.innerHeight,document.documentElement.clientHeight);return{width:h,height:x}},d=()=>{const h=u();(!l.current||h.width>i.width||h.height>i.height)&&(i.width=h.width,i.height=h.height,l.current||(l.current=h),t.current.forEach(x=>{x.offscreenCanvas=f(x)}))},m=["rgba(139, 92, 246, 0.6)","rgba(59, 130, 246, 0.6)","rgba(236, 72, 153, 0.6)","rgba(16, 185, 129, 0.6)","rgba(245, 158, 11, 0.6)","rgba(168, 85, 247, 0.6)","rgba(14, 165, 233, 0.6)","rgba(251, 113, 133, 0.6)"],f=h=>{const x=Math.ceil(h.baseRadius*2.5),v=document.createElement("canvas");v.width=x,v.height=x;const N=v.getContext("2d");if(!N)return v;const S=x/2,T=x/2,M=h.baseRadius,q=N.createRadialGradient(S,T,0,S,T,M);return q.addColorStop(0,h.color.replace("0.6","0.8")),q.addColorStop(.5,h.color),q.addColorStop(1,h.color.replace("0.6","0")),N.fillStyle=q,N.beginPath(),N.arc(S,T,M,0,Math.PI*2),N.fill(),v},y=()=>{const h=[];for(let v=0;v<8;v++){const N=Math.random()*80+60,S={x:Math.random()*i.width,y:Math.random()*i.height,vx:(Math.random()-.5)*.8,vy:(Math.random()-.5)*.8,radius:N,baseRadius:N,scale:1,scaleSpeed:Math.random()*.002+.001,color:m[Math.floor(Math.random()*m.length)]};S.offscreenCanvas=f(S),h.push(S)}t.current=h},w=(h,x)=>{const v=x.x-h.x,N=x.y-h.y,S=Math.sqrt(v*v+N*N);if(S<h.radius+x.radius){const T=Math.atan2(N,v),M=Math.sin(T),q=Math.cos(T),R=h.vx*q+h.vy*M,V=h.vy*q-h.vx*M,C=x.vx*q+x.vy*M,b=x.vy*q-x.vx*M;h.vx=C*q-V*M,h.vy=V*q+C*M,x.vx=R*q-b*M,x.vy=b*q+R*M;const E=(h.radius+x.radius-S)/2;h.x-=E*q,h.y-=E*M,x.x+=E*q,x.y+=E*M}},k=h=>{n.current=requestAnimationFrame(k);const x=h-r.current;x<c||(r.current=h-x%c,o.clearRect(0,0,i.width,i.height),t.current.forEach((v,N)=>{v.x+=v.vx,v.y+=v.vy,v.scale+=v.scaleSpeed,(v.scale>1.2||v.scale<.8)&&(v.scaleSpeed=-v.scaleSpeed),v.radius=v.baseRadius*v.scale,(v.x-v.radius<0||v.x+v.radius>i.width)&&(v.vx=-v.vx,v.x=Math.max(v.radius,Math.min(i.width-v.radius,v.x))),(v.y-v.radius<0||v.y+v.radius>i.height)&&(v.vy=-v.vy,v.y=Math.max(v.radius,Math.min(i.height-v.radius,v.y)));for(let S=N+1;S<t.current.length;S++)w(v,t.current[S]);if(v.offscreenCanvas){const S=v.offscreenCanvas.width*v.scale;o.drawImage(v.offscreenCanvas,v.x-S/2,v.y-S/2,S,S)}}))};let j=null;const g=()=>{j&&clearTimeout(j),j=setTimeout(d,200)};return d(),window.addEventListener("resize",g),y(),n.current=requestAnimationFrame(k),()=>{window.removeEventListener("resize",g),j&&clearTimeout(j),n.current&&cancelAnimationFrame(n.current)}},[]),s.jsx("canvas",{ref:e,className:"fixed inset-0 w-full h-full pointer-events-none",style:{zIndex:0}})},Ha=qa()(Wa(e=>({autoHideSidebarInWebQQ:!1,showWebQQFullscreenButton:!0,setAutoHideSidebarInWebQQ:t=>e({autoHideSidebarInWebQQ:t}),setShowWebQQFullscreenButton:t=>e({showWebQQFullscreenButton:t})}),{name:"llbot-settings"})),$0=({visible:e,onClose:t})=>{const{mode:n,setMode:r}=qo(),{autoHideSidebarInWebQQ:l,setAutoHideSidebarInWebQQ:i,showWebQQFullscreenButton:o,setShowWebQQFullscreenButton:a}=Ha();if(!e)return null;const c=[{value:"light",label:"亮色",icon:hh},{value:"dark",label:"暗色",icon:sh},{value:"auto",label:"跟随系统",icon:v0}];return s.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),s.jsxs("div",{className:"relative bg-theme-card rounded-2xl shadow-2xl w-full max-w-md mx-4 overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-theme-divider",children:[s.jsx("h2",{className:"text-xl font-semibold text-theme",children:"设置"}),s.jsx("button",{onClick:t,className:"p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors",children:s.jsx(ht,{size:20})})]}),s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-3",children:"主题模式"}),s.jsx("div",{className:"grid grid-cols-3 gap-3",children:c.map(u=>{const d=u.icon,m=n===u.value;return s.jsxs("button",{onClick:()=>r(u.value),className:`
|
|
426
426
|
flex flex-col items-center gap-2 p-4 rounded-xl border-2 transition-all
|
|
427
427
|
${m?"border-pink-500 bg-pink-50 dark:bg-pink-900/20":"border-theme-divider hover:border-theme-muted hover:bg-theme-item"}
|
|
428
|
-
`,children:[s.jsx(d,{size:24,className:m?"text-pink-500":"text-theme-muted"}),s.jsx("span",{className:`text-sm font-medium ${m?"text-pink-500":"text-theme"}`,children:u.label})]},u.value)})})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-3",children:"WebQQ 设置"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[l?s.jsx(sn,{size:20,className:"text-theme-muted"}):s.jsx(Ft,{size:20,className:"text-theme-muted"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"进入 WebQQ 自动隐藏侧边栏"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后进入 WebQQ 页面时自动收起侧边栏"})]})]}),s.jsx("input",{type:"checkbox",checked:l,onChange:u=>i(u.target.checked),className:"switch-toggle"})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ft,{size:20,className:"text-theme-muted"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"显示全屏按钮"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"在 WebQQ 页面右下角显示全屏按钮"})]})]}),s.jsx("input",{type:"checkbox",checked:o,onChange:u=>a(u.target.checked),className:"switch-toggle"})]})]})]})]}),s.jsx("div",{className:"flex justify-end gap-3 p-6 border-t border-theme-divider",children:s.jsx("button",{onClick:t,className:"px-6 py-2.5 bg-theme-item hover:bg-theme-item-hover text-theme rounded-xl transition-colors font-medium",children:"关闭"})})]})]})};function U0(e){const t=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],r=new TextEncoder().encode(e),l=r.length*8,i=Math.ceil((l+65)/512)*64,o=new Uint8Array(i);o.set(r),o[r.length]=128;const a=new DataView(o.buffer);a.setUint32(i-4,l&4294967295,!1);let c=1779033703,u=3144134277,d=1013904242,m=2773480762,f=1359893119,v=2600822924,k=528734635,w=1541459225;for(let j=0;j<i;j+=64){const x=new Uint32Array(64);for(let R=0;R<16;R++)x[R]=a.getUint32(j+R*4,!1);for(let R=16;R<64;R++){const V=(x[R-15]>>>7|x[R-15]<<25)^(x[R-15]>>>18|x[R-15]<<14)^x[R-15]>>>3,C=(x[R-2]>>>17|x[R-2]<<15)^(x[R-2]>>>19|x[R-2]<<13)^x[R-2]>>>10;x[R]=x[R-16]+V+x[R-7]+C>>>0}let h=c,g=u,y=d,N=m,S=f,P=v,T=k,O=w;for(let R=0;R<64;R++){const V=(S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7),C=S&P^~S&T,b=O+V+C+t[R]+x[R]>>>0,E=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),_=h&g^h&y^g&y,U=E+_>>>0;O=T,T=P,P=S,S=N+b>>>0,N=y,y=g,g=h,h=b+U>>>0}c=c+h>>>0,u=u+g>>>0,d=d+y>>>0,m=m+N>>>0,f=f+S>>>0,v=v+P>>>0,k=k+T>>>0,w=w+O>>>0}return[c.toString(16).padStart(8,"0"),u.toString(16).padStart(8,"0"),d.toString(16).padStart(8,"0"),m.toString(16).padStart(8,"0"),f.toString(16).padStart(8,"0"),v.toString(16).padStart(8,"0"),k.toString(16).padStart(8,"0"),w.toString(16).padStart(8,"0")].join("")}async function D0(e){try{return U0(e)}catch(t){if(console.error("[PasswordHash] 纯JS SHA-256实现失败:",t),typeof crypto<"u"&&crypto.subtle)try{const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(r)).map(i=>i.toString(16).padStart(2,"0")).join("")}catch(n){console.error("[PasswordHash] Web Crypto API失败:",n)}throw new Error("无法计算SHA-256哈希")}}async function ku(e){return await D0(e)}function O0(e,t,n=30){const r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3);const l=`expires=${r.toUTCString()}`,o=window.location.protocol==="https:"?"; Secure":"",a=window.location.hostname,u=/^\d+\.\d+\.\d+\.\d+$/.test(a)?"":"; SameSite=Lax",d=`${e}=${t}; ${l}; path=/${u}${o}`;document.cookie=d}function gh(e){const t=e+"=",n=document.cookie.split(";");for(let r=0;r<n.length;r++){let l=n[r];for(;l.charAt(0)===" ";)l=l.substring(1,l.length);if(l.indexOf(t)===0)return l.substring(t.length,l.length)}return console.log("[Cookie] 未找到Cookie:",{name:e,allCookies:document.cookie}),null}const yh="webui_token",q0=30;let Tr=null;function W0(e){Tr=e}function ms(){return gh(yh)}function ju(e){O0(yh,e,q0)}async function Ne(e,t={}){const n=async r=>{const l={...t.headers};return r&&(l["x-webui-token"]=r),fetch(e,{...t,headers:l})};try{let r=await n(ms());if(r.status===401&&Tr){console.log("401 - Password not set, prompting to set password...");const l=await Tr("请设置密码");if(!l||!l.trim())throw new Error("密码不能为空");if(!(await fetch("/api/set-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:l.trim()})})).ok)throw new Error("设置密码失败");const o=await ku(l.trim());ju(o),r=await n(o)}if(r.status===403&&Tr){console.log("403 - Token verification failed, prompting for password...");let l=null;try{l=await r.clone().json()}catch{}l!=null&&l.locked&&Y(l.message||"账户已被锁定","error");let i=0;const o=5;for(;r.status===403&&i<o;)try{const a=i>0?"密码错误,请重新输入":"请输入密码",c=await Tr(a);if(!c||!c.trim())throw new Error("密码不能为空");const u=await ku(c.trim());if(ju(u),r=await n(u),r.status===200){console.log("Authentication successful!");break}try{if(l=await r.clone().json(),l!=null&&l.locked)throw new Error(l.message||"账户已被锁定")}catch{}i++}catch(a){throw console.error("Password prompt error:",a),a}if(r.status===403)throw new Error((l==null?void 0:l.message)||"认证失败")}if(!r.ok){let l=`HTTP error! status: ${r.status}`;try{l=(await r.json()).message||l}catch{}throw new Error(l)}return await r.json()}catch(r){throw console.error("API fetch error:",r),r}}let qi=null;const ss=({value:e,onChange:t})=>{const[n,r]=p.useState(qi||[]),[l,i]=p.useState(!1),[o,a]=p.useState(!1),[c,u]=p.useState(""),d=p.useRef(null);p.useEffect(()=>{qi||Ne("/api/network-interfaces").then(j=>{j.success&&(qi=j.data,r(j.data))})},[]),p.useEffect(()=>{const j=x=>{d.current&&!d.current.contains(x.target)&&i(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]),p.useEffect(()=>{e===""||e==="127.0.0.1"||n.includes(e)?(a(!1),u("")):e&&(a(!0),u(e))},[e,n]);const m=[{value:"",label:"全部 (0.0.0.0 和 ::)"},{value:"127.0.0.1",label:"仅本地 (127.0.0.1)"},...n.map(j=>({value:j,label:j}))],f=()=>{if(o)return`自定义: ${c}`;const j=m.find(x=>x.value===e);return(j==null?void 0:j.label)||"仅本地 (127.0.0.1)"},v=j=>{a(!1),u(""),i(!1),t(j.value)},k=()=>{a(!0),i(!1),c||u(e||"")},w=j=>{u(j),t(j)};return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1 z-[9999]",ref:d,children:[s.jsxs("button",{type:"button",onClick:()=>i(!l),className:"input-field w-full pr-8 text-left flex items-center justify-between cursor-pointer",children:[s.jsx("span",{className:"truncate",children:f()}),s.jsx(eh,{size:16,className:`text-theme-hint transition-transform ${l?"rotate-180":""}`})]}),l&&s.jsx("div",{className:"absolute z-[9999] mt-1 w-full bg-white dark:bg-neutral-800 border border-theme-divider rounded-xl shadow-lg overflow-hidden",children:s.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[m.map((j,x)=>s.jsxs("div",{onMouseDown:h=>{h.preventDefault(),h.stopPropagation(),v(j)},className:`px-3 py-2.5 cursor-pointer flex items-center justify-between hover:bg-pink-50 dark:hover:bg-pink-900/30 transition-colors ${!o&&e===j.value?"bg-pink-50 dark:bg-pink-900/30 text-pink-600":"text-theme"}`,children:[s.jsx("span",{children:j.label}),!o&&e===j.value&&s.jsx(xu,{size:16,className:"text-pink-500"})]},`${j.value}-${x}`)),s.jsxs("div",{onMouseDown:j=>{j.preventDefault(),j.stopPropagation(),k()},className:`px-3 py-2.5 cursor-pointer flex items-center justify-between hover:bg-pink-50 dark:hover:bg-pink-900/30 transition-colors border-t border-theme-divider ${o?"bg-pink-50 dark:bg-pink-900/30 text-pink-600":"text-theme"}`,children:[s.jsx("span",{children:"自定义"}),o&&s.jsx(xu,{size:16,className:"text-pink-500"})]})]})})]}),o&&s.jsx("input",{type:"text",value:c,onChange:j=>w(j.target.value),placeholder:"输入地址",className:"input-field flex-1",autoFocus:!0})]})},H0=({value:e,onChange:t,maxDays:n=1,showSeconds:r=!0})=>{const[l,i]=p.useState(0),[o,a]=p.useState(0),[c,u]=p.useState(0),[d,m]=p.useState(0);p.useEffect(()=>{let g=e||0;const y=Math.floor(g/86400);g%=86400;const N=Math.floor(g/3600);g%=3600;const S=Math.floor(g/60),P=g%60;m(y),u(N),a(S),i(P)},[e]);const f=(g,y,N,S)=>{const P=S+N*60+y*3600+g*86400;t(P)},v=g=>{const y=Math.min(n,Math.max(0,g));m(y),f(y,c,o,l)},k=g=>{const y=Math.min(23,Math.max(0,g));u(y),f(d,y,o,l)},w=g=>{const y=Math.min(59,Math.max(0,g));a(y),f(d,c,y,l)},j=g=>{const y=Math.min(59,Math.max(0,g));i(y),f(d,c,o,y)},x=r?4:3,h="w-full px-2 py-2 text-center bg-theme-input border border-theme-input rounded-lg text-theme focus:outline-none focus:ring-2 focus:ring-pink-500/20 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none";return s.jsxs("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${x}, 1fr)`},children:[n>0&&s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:n,value:d,onChange:g=>v(parseInt(g.target.value)||0),className:h}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"天"})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:23,value:c,onChange:g=>k(parseInt(g.target.value)||0),className:h}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"小时"})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:59,value:o,onChange:g=>w(parseInt(g.target.value)||0),className:h}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"分钟"})]}),r&&s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:59,value:l,onChange:g=>j(parseInt(g.target.value)||0),className:h}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"秒"})]})]})},B0=({activeTab:e,onTabChange:t,accountInfo:n,isOpen:r=!0,onClose:l,collapsed:i=!1,onToggleCollapse:o,onOpenSettings:a})=>{const c=[{id:"dashboard",icon:f0,label:"Dashboard"},{id:"onebot",icon:el,label:"OneBot 11"},{id:"satori",icon:Ua,label:"Satori"},{id:"milky",icon:rh,label:"Milky"},{id:"logs",icon:tl,label:"日志"},{id:"other",icon:N0,label:"其他配置"},{id:"webqq",icon:nh,label:"WebQQ"},{id:"about",icon:h0,label:"关于"}],u=d=>{t(d),l&&window.innerWidth<768&&l()};return s.jsxs(s.Fragment,{children:[r&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:l}),s.jsxs("div",{className:`
|
|
428
|
+
`,children:[s.jsx(d,{size:24,className:m?"text-pink-500":"text-theme-muted"}),s.jsx("span",{className:`text-sm font-medium ${m?"text-pink-500":"text-theme"}`,children:u.label})]},u.value)})})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-3",children:"WebQQ 设置"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[l?s.jsx(sn,{size:20,className:"text-theme-muted"}):s.jsx(Ft,{size:20,className:"text-theme-muted"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"进入 WebQQ 自动隐藏侧边栏"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后进入 WebQQ 页面时自动收起侧边栏"})]})]}),s.jsx("input",{type:"checkbox",checked:l,onChange:u=>i(u.target.checked),className:"switch-toggle"})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ft,{size:20,className:"text-theme-muted"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"显示全屏按钮"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"在 WebQQ 页面右下角显示全屏按钮"})]})]}),s.jsx("input",{type:"checkbox",checked:o,onChange:u=>a(u.target.checked),className:"switch-toggle"})]})]})]})]}),s.jsx("div",{className:"flex justify-end gap-3 p-6 border-t border-theme-divider",children:s.jsx("button",{onClick:t,className:"px-6 py-2.5 bg-theme-item hover:bg-theme-item-hover text-theme rounded-xl transition-colors font-medium",children:"关闭"})})]})]})};function U0(e){const t=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],r=new TextEncoder().encode(e),l=r.length*8,i=Math.ceil((l+65)/512)*64,o=new Uint8Array(i);o.set(r),o[r.length]=128;const a=new DataView(o.buffer);a.setUint32(i-4,l&4294967295,!1);let c=1779033703,u=3144134277,d=1013904242,m=2773480762,f=1359893119,y=2600822924,w=528734635,k=1541459225;for(let j=0;j<i;j+=64){const g=new Uint32Array(64);for(let R=0;R<16;R++)g[R]=a.getUint32(j+R*4,!1);for(let R=16;R<64;R++){const V=(g[R-15]>>>7|g[R-15]<<25)^(g[R-15]>>>18|g[R-15]<<14)^g[R-15]>>>3,C=(g[R-2]>>>17|g[R-2]<<15)^(g[R-2]>>>19|g[R-2]<<13)^g[R-2]>>>10;g[R]=g[R-16]+V+g[R-7]+C>>>0}let h=c,x=u,v=d,N=m,S=f,T=y,M=w,q=k;for(let R=0;R<64;R++){const V=(S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7),C=S&T^~S&M,b=q+V+C+t[R]+g[R]>>>0,E=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),_=h&x^h&v^x&v,U=E+_>>>0;q=M,M=T,T=S,S=N+b>>>0,N=v,v=x,x=h,h=b+U>>>0}c=c+h>>>0,u=u+x>>>0,d=d+v>>>0,m=m+N>>>0,f=f+S>>>0,y=y+T>>>0,w=w+M>>>0,k=k+q>>>0}return[c.toString(16).padStart(8,"0"),u.toString(16).padStart(8,"0"),d.toString(16).padStart(8,"0"),m.toString(16).padStart(8,"0"),f.toString(16).padStart(8,"0"),y.toString(16).padStart(8,"0"),w.toString(16).padStart(8,"0"),k.toString(16).padStart(8,"0")].join("")}async function D0(e){try{return U0(e)}catch(t){if(console.error("[PasswordHash] 纯JS SHA-256实现失败:",t),typeof crypto<"u"&&crypto.subtle)try{const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(r)).map(i=>i.toString(16).padStart(2,"0")).join("")}catch(n){console.error("[PasswordHash] Web Crypto API失败:",n)}throw new Error("无法计算SHA-256哈希")}}async function ku(e){return await D0(e)}function O0(e,t,n=30){const r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3);const l=`expires=${r.toUTCString()}`,o=window.location.protocol==="https:"?"; Secure":"",a=window.location.hostname,u=/^\d+\.\d+\.\d+\.\d+$/.test(a)?"":"; SameSite=Lax",d=`${e}=${t}; ${l}; path=/${u}${o}`;document.cookie=d}function gh(e){const t=e+"=",n=document.cookie.split(";");for(let r=0;r<n.length;r++){let l=n[r];for(;l.charAt(0)===" ";)l=l.substring(1,l.length);if(l.indexOf(t)===0)return l.substring(t.length,l.length)}return console.log("[Cookie] 未找到Cookie:",{name:e,allCookies:document.cookie}),null}const yh="webui_token",q0=30;let Tr=null;function W0(e){Tr=e}function hs(){return gh(yh)}function ju(e){O0(yh,e,q0)}async function je(e,t={}){const n=async r=>{const l={...t.headers};return r&&(l["x-webui-token"]=r),fetch(e,{...t,headers:l})};try{let r=await n(hs());if(r.status===401&&Tr){console.log("401 - Password not set, prompting to set password...");const l=await Tr("请设置密码");if(!l||!l.trim())throw new Error("密码不能为空");if(!(await fetch("/api/set-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:l.trim()})})).ok)throw new Error("设置密码失败");const o=await ku(l.trim());ju(o),r=await n(o)}if(r.status===403&&Tr){console.log("403 - Token verification failed, prompting for password...");let l=null;try{l=await r.clone().json()}catch{}l!=null&&l.locked&&Y(l.message||"账户已被锁定","error");let i=0;const o=5;for(;r.status===403&&i<o;)try{const a=i>0?"密码错误,请重新输入":"请输入密码",c=await Tr(a);if(!c||!c.trim())throw new Error("密码不能为空");const u=await ku(c.trim());if(ju(u),r=await n(u),r.status===200){console.log("Authentication successful!");break}try{if(l=await r.clone().json(),l!=null&&l.locked)throw new Error(l.message||"账户已被锁定")}catch{}i++}catch(a){throw console.error("Password prompt error:",a),a}if(r.status===403)throw new Error((l==null?void 0:l.message)||"认证失败")}if(!r.ok){let l=`HTTP error! status: ${r.status}`;try{l=(await r.json()).message||l}catch{}throw new Error(l)}return await r.json()}catch(r){throw console.error("API fetch error:",r),r}}let qi=null;const ls=({value:e,onChange:t})=>{const[n,r]=p.useState(qi||[]),[l,i]=p.useState(!1),[o,a]=p.useState(!1),[c,u]=p.useState(""),d=p.useRef(null);p.useEffect(()=>{qi||je("/api/network-interfaces").then(j=>{j.success&&(qi=j.data,r(j.data))})},[]),p.useEffect(()=>{const j=g=>{d.current&&!d.current.contains(g.target)&&i(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]),p.useEffect(()=>{e===""||e==="127.0.0.1"||n.includes(e)?(a(!1),u("")):e&&(a(!0),u(e))},[e,n]);const m=[{value:"",label:"全部 (0.0.0.0 和 ::)"},{value:"127.0.0.1",label:"仅本地 (127.0.0.1)"},...n.map(j=>({value:j,label:j}))],f=()=>{if(o)return`自定义: ${c}`;const j=m.find(g=>g.value===e);return(j==null?void 0:j.label)||"仅本地 (127.0.0.1)"},y=j=>{a(!1),u(""),i(!1),t(j.value)},w=()=>{a(!0),i(!1),c||u(e||"")},k=j=>{u(j),t(j)};return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1 z-[9999]",ref:d,children:[s.jsxs("button",{type:"button",onClick:()=>i(!l),className:"input-field w-full pr-8 text-left flex items-center justify-between cursor-pointer",children:[s.jsx("span",{className:"truncate",children:f()}),s.jsx(eh,{size:16,className:`text-theme-hint transition-transform ${l?"rotate-180":""}`})]}),l&&s.jsx("div",{className:"absolute z-[9999] mt-1 w-full bg-white dark:bg-neutral-800 border border-theme-divider rounded-xl shadow-lg overflow-hidden",children:s.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[m.map((j,g)=>s.jsxs("div",{onMouseDown:h=>{h.preventDefault(),h.stopPropagation(),y(j)},className:`px-3 py-2.5 cursor-pointer flex items-center justify-between hover:bg-pink-50 dark:hover:bg-pink-900/30 transition-colors ${!o&&e===j.value?"bg-pink-50 dark:bg-pink-900/30 text-pink-600":"text-theme"}`,children:[s.jsx("span",{children:j.label}),!o&&e===j.value&&s.jsx(xu,{size:16,className:"text-pink-500"})]},`${j.value}-${g}`)),s.jsxs("div",{onMouseDown:j=>{j.preventDefault(),j.stopPropagation(),w()},className:`px-3 py-2.5 cursor-pointer flex items-center justify-between hover:bg-pink-50 dark:hover:bg-pink-900/30 transition-colors border-t border-theme-divider ${o?"bg-pink-50 dark:bg-pink-900/30 text-pink-600":"text-theme"}`,children:[s.jsx("span",{children:"自定义"}),o&&s.jsx(xu,{size:16,className:"text-pink-500"})]})]})})]}),o&&s.jsx("input",{type:"text",value:c,onChange:j=>k(j.target.value),placeholder:"输入地址",className:"input-field flex-1",autoFocus:!0})]})},H0=({value:e,onChange:t,maxDays:n=1,showSeconds:r=!0})=>{const[l,i]=p.useState(0),[o,a]=p.useState(0),[c,u]=p.useState(0),[d,m]=p.useState(0);p.useEffect(()=>{let x=e||0;const v=Math.floor(x/86400);x%=86400;const N=Math.floor(x/3600);x%=3600;const S=Math.floor(x/60),T=x%60;m(v),u(N),a(S),i(T)},[e]);const f=(x,v,N,S)=>{const T=S+N*60+v*3600+x*86400;t(T)},y=x=>{const v=Math.min(n,Math.max(0,x));m(v),f(v,c,o,l)},w=x=>{const v=Math.min(23,Math.max(0,x));u(v),f(d,v,o,l)},k=x=>{const v=Math.min(59,Math.max(0,x));a(v),f(d,c,v,l)},j=x=>{const v=Math.min(59,Math.max(0,x));i(v),f(d,c,o,v)},g=r?4:3,h="w-full px-2 py-2 text-center bg-theme-input border border-theme-input rounded-lg text-theme focus:outline-none focus:ring-2 focus:ring-pink-500/20 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none";return s.jsxs("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${g}, 1fr)`},children:[n>0&&s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:n,value:d,onChange:x=>y(parseInt(x.target.value)||0),className:h}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"天"})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:23,value:c,onChange:x=>w(parseInt(x.target.value)||0),className:h}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"小时"})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:59,value:o,onChange:x=>k(parseInt(x.target.value)||0),className:h}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"分钟"})]}),r&&s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:59,value:l,onChange:x=>j(parseInt(x.target.value)||0),className:h}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"秒"})]})]})},B0=({activeTab:e,onTabChange:t,accountInfo:n,isOpen:r=!0,onClose:l,collapsed:i=!1,onToggleCollapse:o,onOpenSettings:a})=>{const c=[{id:"dashboard",icon:f0,label:"Dashboard"},{id:"onebot",icon:tl,label:"OneBot 11"},{id:"satori",icon:Ua,label:"Satori"},{id:"milky",icon:rh,label:"Milky"},{id:"logs",icon:nl,label:"日志"},{id:"other",icon:N0,label:"其他配置"},{id:"webqq",icon:nh,label:"WebQQ"},{id:"about",icon:h0,label:"关于"}],u=d=>{t(d),l&&window.innerWidth<768&&l()};return s.jsxs(s.Fragment,{children:[r&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:l}),s.jsxs("div",{className:`
|
|
429
429
|
fixed top-0 left-0 z-50
|
|
430
430
|
w-64 bg-theme-card backdrop-blur-2xl h-screen flex flex-col shadow-xl border-r border-theme
|
|
431
431
|
transform transition-all duration-300 ease-in-out
|
|
432
432
|
${r?"translate-x-0":"-translate-x-full"}
|
|
433
433
|
${i?"md:-translate-x-full":"md:translate-x-0"}
|
|
434
|
-
`,children:[s.jsx("div",{className:"p-6 border-b border-theme-divider relative",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl overflow-hidden shadow-lg flex-shrink-0",children:s.jsx("img",{src:"/logo.jpg",alt:"Logo",className:"w-full h-full object-cover"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h1",{className:"text-xl font-bold text-theme truncate",children:"LLBot"}),s.jsx("p",{className:"text-xs text-theme-muted",children:"WebUI"})]}),s.jsx("button",{onClick:l,className:"md:hidden p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors",children:s.jsx(ft,{size:20})}),o&&s.jsx("button",{onClick:o,className:"hidden md:block p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors",title:"收起侧边栏",children:s.jsx(c0,{size:20})})]})}),s.jsx("nav",{className:"flex-1 p-4 space-y-1 overflow-y-auto",children:c.map(d=>{const m=d.icon,f=e===d.id;return s.jsxs("button",{onClick:()=>u(d.id),className:`w-full flex items-center space-x-3 px-4 py-3 rounded-2xl transition-all duration-200 ${f?"gradient-primary text-white shadow-lg scale-105":"text-theme hover:bg-theme-item-hover"}`,children:[s.jsx(m,{size:20}),s.jsx("span",{className:"font-medium",children:d.label})]},d.id)})}),s.jsx("div",{className:"p-4 border-t border-theme-divider",children:s.jsxs("div",{className:"flex items-center space-x-3 px-3 py-2",children:[n&&s.jsxs(s.Fragment,{children:[s.jsx("img",{src:`https://thirdqq.qlogo.cn/g?b=qq&nk=${n.uin}&s=640`,alt:"头像",className:"w-10 h-10 rounded-full object-cover ring-2 ring-white/50 dark:ring-neutral-600",onError:d=>{const m=d.target;m.style.display="none";const f=m.nextElementSibling;f&&(f.style.display="flex")}}),s.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-pink-400 to-rose-500 rounded-full items-center justify-center text-white font-semibold hidden",style:{display:"none"},children:n.nick.charAt(0).toUpperCase()}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-theme truncate",children:n.nick}),s.jsx("p",{className:"text-xs text-theme-muted truncate",children:n.uin})]})]}),!n&&s.jsx("div",{className:"flex-1"}),s.jsx("button",{onClick:a,className:"p-2 rounded-lg transition-all duration-200 text-theme-muted hover:bg-theme-item hover:text-theme",title:"设置",children:s.jsx(uh,{size:18})})]})})]}),i&&o&&s.jsx("button",{onClick:o,className:"hidden md:flex fixed left-2 top-4 z-40 w-8 h-8 items-center justify-center bg-theme-card/80 backdrop-blur-sm border border-theme-divider rounded-md text-theme-muted hover:text-theme hover:bg-theme-card transition-all shadow-md hover:shadow-lg",title:"展开侧边栏",children:s.jsx(ti,{size:18})})]})},V0=!1,Q0=()=>({friendCount:128,groupCount:45,messageReceived:12580,messageSent:3842,startupTime:Math.floor(Date.now()/1e3)-3600*5-1234,lastMessageTime:Math.floor(Date.now()/1e3)-30,bot:{memory:(80+Math.random()*40)*1024*1024,totalMemory:16*1024*1024*1024,memoryPercent:2+Math.random()*3,cpu:3+Math.random()*10},qq:{memory:(200+Math.random()*100)*1024*1024,totalMemory:16*1024*1024*1024,memoryPercent:5+Math.random()*8,cpu:5+Math.random()*15}}),Nu=e=>!e||e<=0?"0 MB":e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":e<1024*1024*1024?(e/1024/1024).toFixed(0)+" MB":(e/1024/1024/1024).toFixed(2)+" GB",G0=e=>{const n=Math.floor(Date.now()/1e3)-e,r=Math.floor(n/86400),l=Math.floor(n%86400/3600),i=Math.floor(n%3600/60),o=n%60;return r>0?`${r}天 ${l}时 ${i}分`:l>0?`${l}时 ${i}分 ${o}秒`:i>0?`${i}分 ${o}秒`:`${o}秒`},K0=e=>e?new Date(e*1e3).toLocaleString("zh-CN"):"暂无",As=({icon:e,label:t,value:n,gradient:r})=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-theme-item hover:bg-theme-item-hover transition-all duration-200 hover:scale-[1.02]",children:[s.jsx("div",{className:`w-10 h-10 rounded-xl ${r} flex items-center justify-center shadow-md`,children:e}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-theme-muted",children:t}),s.jsx("p",{className:"text-lg font-bold text-theme truncate",children:n})]})]}),bu=({value:e,size:t=100,strokeWidth:n=8,gradientId:r,gradientColors:l,label:i,displayValue:o,icon:a})=>{const c=(t-n)/2,u=c*2*Math.PI,d=Math.min(Math.max(e,0),100),m=u-d/100*u;return s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsxs("div",{className:"relative",style:{width:t,height:t},children:[s.jsxs("svg",{width:t,height:t,className:"transform -rotate-90",children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:r,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[s.jsx("stop",{offset:"0%",stopColor:l[0]}),s.jsx("stop",{offset:"100%",stopColor:l[1]})]})}),s.jsx("circle",{cx:t/2,cy:t/2,r:c,fill:"none",stroke:"rgba(128,128,128,0.15)",strokeWidth:n}),s.jsx("circle",{cx:t/2,cy:t/2,r:c,fill:"none",stroke:`url(#${r})`,strokeWidth:n,strokeDasharray:u,strokeDashoffset:m,strokeLinecap:"round",className:"transition-all duration-1000 ease-out"})]}),s.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center shadow-md",style:{background:`linear-gradient(135deg, ${l[0]}, ${l[1]})`},children:a}),s.jsxs("span",{className:"text-sm font-bold text-theme mt-1",children:[d.toFixed(1),"%"]})]})]}),s.jsx("p",{className:"text-xs font-semibold text-theme mt-2",children:i}),s.jsx("p",{className:"text-xs text-theme-muted",children:o})]})},Su=({title:e,version:t,icon:n,gradient:r,cpu:l,memory:i,totalMemory:o,memoryPercent:a,cpuGradientId:c,memGradientId:u,cpuColors:d,memColors:m})=>s.jsxs("div",{className:"card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("div",{className:`w-8 h-8 rounded-lg ${r} flex items-center justify-center shadow-md`,children:n}),s.jsx("h4",{className:"text-sm font-semibold text-theme",children:e}),t&&s.jsx("span",{className:"ml-auto text-xs text-theme-muted bg-theme-item px-2 py-0.5 rounded-full",children:t})]}),s.jsxs("div",{className:"flex justify-around",children:[s.jsx(bu,{value:l,gradientId:c,gradientColors:d,label:"CPU",displayValue:`${l.toFixed(1)}%`,icon:s.jsx(Ua,{size:16,className:"text-white"})}),s.jsx(bu,{value:a,gradientId:u,gradientColors:m,label:"内存",displayValue:`${Nu(i)} / ${Nu(o)}`,icon:s.jsx(d0,{size:16,className:"text-white"})})]})]}),Y0=({llbotVersion:e,qqVersion:t})=>{const[n,r]=p.useState(null),[l,i]=p.useState(!0),[o,a]=p.useState(""),c=p.useRef(),u=async()=>{try{const d=V0?Q0():(await Ne("/api/dashboard/stats")).data;d&&r(d)}catch(d){console.error("Failed to fetch dashboard stats:",d)}finally{i(!1)}};return p.useEffect(()=>(u(),c.current=window.setInterval(u,5e3),()=>{c.current&&clearInterval(c.current)}),[]),p.useEffect(()=>{if(!(n!=null&&n.startupTime))return;const d=()=>a(G0(n.startupTime));d();const m=setInterval(d,1e3);return()=>clearInterval(m)},[n==null?void 0:n.startupTime]),l?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"w-12 h-12 border-4 border-pink-500 border-t-transparent rounded-full animate-spin"})}):n?s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"card p-4 flex flex-col",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl gradient-primary-br flex items-center justify-center shadow-md",children:s.jsx($r,{size:20,className:"text-white"})}),s.jsx("h3",{className:"text-base font-semibold text-theme",children:"运行时间"}),s.jsxs("div",{className:"ml-auto flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-500/20 text-green-500 dark:text-green-400 text-xs font-medium",children:[s.jsx(M0,{size:12}),"运行中"]})]}),s.jsxs("div",{className:"flex-1 flex flex-col justify-center space-y-2",children:[s.jsxs("div",{className:"p-3 rounded-xl bg-theme-item",children:[s.jsx("p",{className:"text-xs text-theme-muted",children:"已运行"}),s.jsx("p",{className:"text-xl font-bold bg-gradient-to-r from-pink-500 to-rose-500 bg-clip-text text-transparent",children:o})]}),s.jsxs("div",{className:"px-3 py-2",children:[s.jsx("p",{className:"text-xs text-theme-muted",children:"启动时间"}),s.jsx("p",{className:"text-sm font-medium text-theme",children:K0(n.startupTime)})]})]})]}),s.jsxs("div",{className:"card p-4 space-y-3",children:[s.jsx(As,{icon:s.jsx(ri,{size:20,className:"text-white"}),label:"好友数量",value:n.friendCount.toLocaleString(),gradient:"bg-gradient-to-br from-sky-500 to-blue-500"}),s.jsx(As,{icon:s.jsx(C0,{size:20,className:"text-white"}),label:"群组数量",value:n.groupCount.toLocaleString(),gradient:"bg-gradient-to-br from-violet-500 to-purple-500"})]}),s.jsxs("div",{className:"card p-4 space-y-3",children:[s.jsx(As,{icon:s.jsx(nh,{size:20,className:"text-white"}),label:"收到消息",value:n.messageReceived.toLocaleString(),gradient:"bg-gradient-to-br from-green-500 to-emerald-500"}),s.jsx(As,{icon:s.jsx(rs,{size:20,className:"text-white"}),label:"发送消息",value:n.messageSent.toLocaleString(),gradient:"bg-gradient-to-br from-orange-500 to-amber-500"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(Su,{title:"QQ 资源",version:t,icon:s.jsx(Da,{size:16,className:"text-white"}),gradient:"bg-gradient-to-br from-cyan-500 to-teal-500",cpu:n.qq.cpu,memory:n.qq.memory,totalMemory:n.qq.totalMemory,memoryPercent:n.qq.memoryPercent,cpuGradientId:"qqCpuGradient",memGradientId:"qqMemGradient",cpuColors:["#06b6d4","#14b8a6"],memColors:["#0ea5e9","#22d3ee"]}),s.jsx(Su,{title:"LLBot 资源",version:e,icon:s.jsx(i0,{size:16,className:"text-white"}),gradient:"bg-gradient-to-br from-fuchsia-500 to-pink-500",cpu:n.bot.cpu,memory:n.bot.memory,totalMemory:n.bot.totalMemory,memoryPercent:n.bot.memoryPercent,cpuGradientId:"botCpuGradient",memGradientId:"botMemGradient",cpuColors:["#d946ef","#ec4899"],memColors:["#a855f7","#d946ef"]})]})]}):s.jsx("div",{className:"card p-8 text-center",children:s.jsx("p",{className:"text-theme-muted",children:"无法加载统计数据"})})},Fs=72,$s=1e3,Cu=10,X0=()=>{var C;const[e,t]=p.useState([]),[n,r]=p.useState(!1),[l,i]=p.useState(!0),[o,a]=p.useState(""),[c,u]=p.useState("all"),[d,m]=p.useState(!1),[f,v]=p.useState(0),k=p.useRef(null),w=p.useRef([]),j=p.useCallback(()=>{k.current&&l&&(k.current.scrollTop=k.current.scrollHeight)},[l]);p.useEffect(()=>{let b=null,E=!0;return(()=>{const U=gh("webui_token")||"",D=`/api/logs/stream?token=${encodeURIComponent(U)}`;b=new EventSource(D),b.addEventListener("connected",()=>{E&&m(!0)}),b.onmessage=I=>{if(E)try{const q=JSON.parse(I.data);n?w.current.push(q):t(K=>{const Z=[...K,q];return Z.length>$s?Z.slice(-$s):Z})}catch(q){console.error("[LogViewer] Failed to parse log:",q)}},b.onerror=()=>{E&&m(!1)}})(),()=>{E=!1,b&&b.close()}},[n]),p.useEffect(()=>{j()},[e,j]);const x=p.useCallback(b=>{v(b.currentTarget.scrollTop)},[]),h=()=>{r(!1),t(b=>{const E=[...b,...w.current];return w.current=[],E.length>$s?E.slice(-$s):E})},g=()=>{t([]),w.current=[]},y=b=>{switch(b.toLowerCase()){case"error":return{bg:"bg-red-50/50 dark:bg-red-900/20",badge:"text-red-600 dark:text-red-400 bg-red-100/70 dark:bg-red-900/50"};case"warn":return{bg:"bg-amber-50/50 dark:bg-amber-900/20",badge:"text-amber-600 dark:text-amber-400 bg-amber-100/70 dark:bg-amber-900/50"};case"info":return{bg:"bg-blue-50/50 dark:bg-blue-900/20",badge:"text-pink-500 dark:text-pink-400 bg-pink-100/70 dark:bg-pink-900/50"};case"debug":return{bg:"bg-gray-50/50 dark:bg-neutral-700/50",badge:"text-gray-500 dark:text-neutral-400 bg-gray-100/70 dark:bg-neutral-600/50"};default:return{bg:"bg-green-50/50 dark:bg-green-900/20",badge:"text-green-600 dark:text-green-400 bg-green-100/70 dark:bg-green-900/50"}}},N=p.useMemo(()=>{let b=e;if(c!=="all"&&(b=b.filter(E=>E.type.toLowerCase()===c)),o){const E=o.toLowerCase();b=b.filter(_=>_.content.toLowerCase().includes(E)||_.type.toLowerCase().includes(E))}return b},[e,o,c]),S=((C=k.current)==null?void 0:C.clientHeight)||500,P=N.length*Fs,T=Math.max(0,Math.floor(f/Fs)-Cu),O=Math.min(N.length,Math.ceil((f+S)/Fs)+Cu),R=N.slice(T,O),V=T*Fs;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"card p-4",children:[s.jsxs("div",{className:"hidden md:flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-emerald-500 to-teal-600 flex items-center justify-center shadow-md",children:s.jsx(tl,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base font-semibold text-theme",children:"实时日志"}),s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:`flex items-center gap-1 px-2 py-0.5 rounded-full ${d?"bg-green-100 dark:bg-green-900/50 text-green-600 dark:text-green-400":"bg-red-100 dark:bg-red-900/50 text-red-600 dark:text-red-400"}`,children:[s.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${d?"bg-green-500":"bg-red-500"}`}),d?"已连接":"未连接"]}),s.jsx("span",{className:"text-theme-muted",children:n?`已暂停 (${w.current.length} 条待显示)`:`${e.length} 条日志`})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex rounded-lg overflow-hidden border border-gray-200 dark:border-neutral-600",children:[{value:"all",label:"全部"},{value:"info",label:"Info"},{value:"warn",label:"Warn"},{value:"error",label:"Error"}].map(b=>s.jsx("button",{onClick:()=>u(b.value),className:`px-3 py-1.5 text-xs font-medium transition-all ${c===b.value?"gradient-primary-br text-white":"bg-theme-input text-theme-secondary hover:bg-theme-item-hover"}`,children:b.label},b.value))}),s.jsx("input",{type:"text",placeholder:"搜索日志...",value:o,onChange:b=>a(b.target.value),className:"px-3 py-1.5 text-sm bg-theme-input border border-theme-input rounded-lg focus:ring-2 focus:ring-pink-500 focus:border-transparent w-40 text-theme placeholder:text-theme-hint"}),s.jsx("button",{onClick:()=>i(!l),className:`p-2 rounded-lg transition-all ${l?"gradient-primary text-white shadow-md":"bg-theme-input text-theme-secondary hover:bg-theme-item-hover"}`,title:l?"自动滚动已开启":"自动滚动已关闭",children:s.jsx($o,{size:18})}),s.jsx("button",{onClick:n?h:()=>r(!0),className:`p-2 rounded-lg transition-all ${n?"bg-gradient-to-br from-green-500 to-emerald-500 text-white shadow-md":"bg-gradient-to-br from-amber-500 to-orange-500 text-white shadow-md"}`,title:n?"继续":"暂停",children:n?s.jsx(Do,{size:18}):s.jsx(Uo,{size:18})}),s.jsx("button",{onClick:g,className:"p-2 bg-gradient-to-br from-red-500 to-pink-500 text-white rounded-lg shadow-md hover:shadow-lg transition-all",title:"清空日志",children:s.jsx(It,{size:18})})]})]}),s.jsxs("div",{className:"md:hidden space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-emerald-500 to-teal-600 flex items-center justify-center shadow-md flex-shrink-0",children:s.jsx(tl,{size:20,className:"text-white"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"text-base font-semibold text-theme",children:"实时日志"}),s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:`flex items-center gap-1 px-2 py-0.5 rounded-full flex-shrink-0 ${d?"bg-green-100 dark:bg-green-900/50 text-green-600 dark:text-green-400":"bg-red-100 dark:bg-red-900/50 text-red-600 dark:text-red-400"}`,children:[s.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${d?"bg-green-500":"bg-red-500"}`}),d?"已连接":"未连接"]}),s.jsx("span",{className:"text-theme-muted truncate",children:n?`已暂停 (${w.current.length} 条待显示)`:`${e.length} 条日志`})]})]})]}),s.jsx("input",{type:"text",placeholder:"搜索日志...",value:o,onChange:b=>a(b.target.value),className:"w-full px-3 py-2 text-sm bg-theme-input border border-theme-input rounded-lg focus:ring-2 focus:ring-pink-500 focus:border-transparent text-theme placeholder:text-theme-hint"}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex rounded-lg overflow-hidden border border-gray-200 dark:border-neutral-600",children:[{value:"all",label:"全部"},{value:"info",label:"Info"},{value:"warn",label:"Warn"},{value:"error",label:"Error"}].map(b=>s.jsx("button",{onClick:()=>u(b.value),className:`px-2 py-1.5 text-xs font-medium transition-all ${c===b.value?"gradient-primary-br text-white":"bg-theme-input text-theme-secondary hover:bg-theme-item-hover"}`,children:b.label},b.value))}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>i(!l),className:`p-1.5 rounded-lg transition-all ${l?"gradient-primary text-white shadow-md":"bg-theme-input text-theme-secondary hover:bg-theme-item-hover"}`,title:l?"自动滚动已开启":"自动滚动已关闭",children:s.jsx($o,{size:16})}),s.jsx("button",{onClick:n?h:()=>r(!0),className:`p-1.5 rounded-lg transition-all ${n?"bg-gradient-to-br from-green-500 to-emerald-500 text-white shadow-md":"bg-gradient-to-br from-amber-500 to-orange-500 text-white shadow-md"}`,title:n?"继续":"暂停",children:n?s.jsx(Do,{size:16}):s.jsx(Uo,{size:16})}),s.jsx("button",{onClick:g,className:"p-1.5 bg-gradient-to-br from-red-500 to-pink-500 text-white rounded-lg shadow-md hover:shadow-lg transition-all",title:"清空日志",children:s.jsx(It,{size:16})})]})]})]})]}),s.jsx("div",{className:"card p-4",children:s.jsx("div",{ref:k,onScroll:x,className:"h-[calc(100vh-240px)] overflow-auto pr-2",children:N.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-theme-hint",children:[s.jsx(tl,{size:48,className:"mb-3 opacity-50"}),s.jsx("p",{className:"text-sm",children:"等待日志..."})]}):s.jsx("div",{style:{height:P,position:"relative"},children:s.jsx("div",{style:{transform:`translateY(${V}px)`},className:"space-y-1.5",children:R.map((b,E)=>{const _=y(b.type);return s.jsx("div",{className:`p-2.5 rounded-lg ${_.bg} hover:shadow-sm transition-shadow`,children:s.jsx("div",{className:"flex items-start gap-2",children:s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[s.jsx("span",{className:"text-xs text-theme-hint font-mono",children:b.dateTimeStr}),s.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded ${_.badge}`,children:b.type.toUpperCase()})]}),s.jsx("p",{className:"text-sm text-theme-secondary whitespace-pre-wrap break-all font-mono",children:b.content})]})})},`${b.timestamp}-${T+E}`)})})})})})]})},J0=({config:e,onChange:t,onSave:n})=>{const[r,l]=p.useState(null),[i,o]=p.useState(-1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),[m,f]=p.useState(!1),[v,k]=p.useState(!1),[w,j]=p.useState(""),[x,h]=p.useState(!1),g={ws:{icon:el,name:"WebSocket正向",desc:"提供WebSocket服务器"},"ws-reverse":{icon:yu,name:"WebSocket反向",desc:"作为客户端连接到WebSocket服务"},http:{icon:Il,name:"HTTP服务",desc:"提供HTTP API服务"},"http-post":{icon:rs,name:"HTTP上报",desc:"上报事件到HTTP服务器"}},y=(C,b)=>{l(C),o(b),f(!1),k(!1),j(C.name||""),h(!1),c(!0)},N=C=>{C.stopPropagation(),k(!0)},S=()=>{if(!r)return;const C={...r,name:w.trim()};l(C),k(!1)},P=()=>{j((r==null?void 0:r.name)||""),k(!1)},T=()=>{var D;if(!r)return;const C=r.type==="ws"||r.type==="http",b=r.host;if(C&&(!b||b==="0.0.0.0"||b==="::")&&!((D=r.token)!=null&&D.trim())){Y("监听全部地址时必须设置 Token","error");return}let _;if(m)_=[...e.connect,r];else{if(i<0)return;_=[...e.connect],_[i]=r}const U={...e,connect:_};t(U),c(!1),f(!1),n(U)},O=()=>{if(m){c(!1),f(!1);return}if(i<0)return;const C=e.connect.filter((E,_)=>_!==i),b={...e,connect:C};t(b),c(!1),n(b)},R=C=>{const b={enable:!0,token:"",messageFormat:"array",reportSelfMessage:!1,reportOfflineMessage:!1,debug:!1};let E;switch(C){case"ws":E={...b,type:"ws",host:"",port:3001,heartInterval:6e4};break;case"ws-reverse":E={...b,type:"ws-reverse",url:"",heartInterval:6e4};break;case"http":E={...b,type:"http",host:"",port:3e3};break;case"http-post":E={...b,type:"http-post",url:"",enableHeart:!1,heartInterval:6e4};break}d(!1),l(E),o(-1),f(!0),h(!1),c(!0)},V=(C,b)=>{r&&l({...r,[C]:b})};return s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"card p-6",children:s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl gradient-primary-br flex items-center justify-center",children:s.jsx(el,{size:24,className:"text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"OneBot 11 协议"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"启用或禁用 OneBot 11 适配器"})]}),s.jsx("input",{type:"checkbox",checked:e.enable,onChange:C=>{const b={...e,enable:C.target.checked};t(b),n(b)},className:"switch-toggle-lg"})]})}),e.enable&&e.connect&&Array.isArray(e.connect)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.connect.map((C,b)=>{const E=g[C.type],_=E.icon;return s.jsxs("div",{className:`card p-6 cursor-pointer hover:scale-105 transition-all ${C.enable?"ring-2 ring-pink-500":""}`,onClick:()=>y(C,b),children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center ${C.enable?"gradient-primary-br text-white":"bg-gray-200 dark:bg-neutral-600 text-theme-secondary"}`,children:s.jsx(_,{size:24})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-lg font-semibold text-theme",children:C.name||E.name}),s.jsx("p",{className:"text-sm text-theme-secondary",children:E.desc})]})]}),s.jsx(uh,{size:20,className:"text-theme-hint"})]}),s.jsxs("div",{className:"flex items-center justify-between mt-4 pt-4 border-t border-theme-divider",children:[s.jsx("span",{className:`text-xs font-medium px-3 py-1 rounded-full ${C.enable?"bg-green-100 dark:bg-green-900/50 text-green-800 dark:text-green-400":"bg-gray-100 dark:bg-neutral-700 text-gray-600 dark:text-neutral-400"}`,children:C.enable?"已启用":"未启用"}),C.enable&&s.jsxs(s.Fragment,{children:[(C.type==="ws"||C.type==="http")&&s.jsxs("span",{className:"text-sm text-theme-secondary",children:["端口: ",C.port]}),(C.type==="ws-reverse"||C.type==="http-post")&&s.jsxs("span",{className:"text-sm text-theme-secondary truncate max-w-[180px]",title:C.url||"未配置",children:["URL: ",C.url||"未配置"]})]})]})]},b)})}),s.jsx("div",{className:"flex justify-center mt-6",children:s.jsxs("button",{onClick:()=>d(!0),className:"btn-primary flex items-center gap-2",children:[s.jsx(ih,{size:20}),"添加适配器"]})})]}),a&&r&&s.jsx(vu,{children:s.jsx("div",{className:"fixed inset-0 bg-black/30 dark:bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",style:{zIndex:9e3},children:s.jsxs("div",{className:"bg-white/60 dark:bg-neutral-800/90 backdrop-blur-xl rounded-3xl shadow-2xl w-full max-w-2xl max-h-[80vh] flex flex-col border border-white/50 dark:border-neutral-700/50",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-white/20 dark:border-neutral-700/50",children:[s.jsx("div",{className:"flex items-center gap-3 flex-1",children:v?s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 flex-1",children:[s.jsx("input",{type:"text",value:w,onChange:C=>j(C.target.value),onKeyDown:C=>{C.key==="Enter"&&S(),C.key==="Escape"&&P()},placeholder:"输入自定义名称",className:"flex-1 px-3 py-2 border border-theme-input rounded-xl focus:outline-none focus:ring-2 focus:ring-pink-500 bg-theme-input text-theme",autoFocus:!0}),s.jsxs("div",{className:"flex gap-2 sm:flex-shrink-0",children:[s.jsx("button",{onClick:S,className:"flex-1 sm:flex-none px-4 py-2 bg-pink-500 text-white rounded-xl hover:bg-pink-600 transition-colors whitespace-nowrap",children:"确定"}),s.jsx("button",{onClick:P,className:"flex-1 sm:flex-none px-4 py-2 bg-theme-item text-theme-secondary rounded-xl hover:bg-theme-item-hover transition-colors whitespace-nowrap",children:"取消"})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("h3",{className:"text-xl font-semibold text-theme",children:[m?"新建 - ":"",r.name||g[r.type].name]}),s.jsx("button",{onClick:N,className:"p-2 text-theme-hint hover:text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors",title:"编辑名称",children:s.jsx(k0,{size:18})})]})}),s.jsx("button",{onClick:()=>{c(!1),f(!1),k(!1)},className:"text-theme-hint hover:text-theme",children:s.jsx(ft,{size:24})})]}),s.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto flex-1",children:[s.jsx("div",{children:s.jsxs("label",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"启用此适配器"}),s.jsx("input",{type:"checkbox",checked:r.enable,onChange:C=>V("enable",C.target.checked),className:"switch-toggle"})]})}),r.type==="ws"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"监听地址"}),s.jsx(ss,{value:r.host||"",onChange:C=>V("host",C)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"端口"}),s.jsx("input",{type:"number",value:r.port,onChange:C=>V("port",parseInt(C.target.value)),className:"input-field"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"心跳间隔 (ms)"}),s.jsx("input",{type:"number",value:r.heartInterval,onChange:C=>V("heartInterval",parseInt(C.target.value)),className:"input-field"})]})]}),r.type==="ws-reverse"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"连接地址"}),s.jsx("input",{type:"text",value:r.url,onChange:C=>V("url",C.target.value),placeholder:"ws://example.com:8080",className:"input-field"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"心跳间隔 (ms)"}),s.jsx("input",{type:"number",value:r.heartInterval,onChange:C=>V("heartInterval",parseInt(C.target.value)),className:"input-field"})]})]}),r.type==="http"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"监听地址"}),s.jsx(ss,{value:r.host||"",onChange:C=>V("host",C)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"端口"}),s.jsx("input",{type:"number",value:r.port,onChange:C=>V("port",parseInt(C.target.value)),className:"input-field"})]})]}),r.type==="http-post"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"上报地址"}),s.jsx("input",{type:"text",value:r.url,onChange:C=>V("url",C.target.value),placeholder:"http://example.com:8080/webhook",className:"input-field"})]}),s.jsx("div",{children:s.jsxs("label",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"启用心跳"}),s.jsx("input",{type:"checkbox",checked:r.enableHeart,onChange:C=>V("enableHeart",C.target.checked),className:"switch-toggle"})]})}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"心跳间隔 (ms)"}),s.jsx("input",{type:"number",value:r.heartInterval,onChange:C=>V("heartInterval",parseInt(C.target.value)),className:"input-field"})]})]}),s.jsxs("div",{className:"border-t border-theme-divider pt-6",children:[s.jsx("h4",{className:"text-md font-semibold text-theme mb-4",children:"通用配置"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Token"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:x?"text":"password",value:r.token,onChange:C=>V("token",C.target.value),placeholder:"访问令牌",className:"input-field pr-12"}),s.jsx("button",{type:"button",onClick:()=>h(!x),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1",children:x?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"消息格式"}),s.jsxs("div",{className:"flex gap-4 text-theme-secondary",children:[s.jsxs("label",{className:"flex items-center",children:[s.jsx("input",{type:"radio",value:"array",checked:r.messageFormat==="array",onChange:C=>V("messageFormat",C.target.value),className:"mr-2"}),"消息段 (array)"]}),s.jsxs("label",{className:"flex items-center",children:[s.jsx("input",{type:"radio",value:"string",checked:r.messageFormat==="string",onChange:C=>V("messageFormat",C.target.value),className:"mr-2"}),"CQ码 (string)"]})]})]}),s.jsx("div",{children:s.jsxs("label",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"上报自己发送的消息"}),s.jsx("input",{type:"checkbox",checked:r.reportSelfMessage,onChange:C=>V("reportSelfMessage",C.target.checked),className:"switch-toggle"})]})}),s.jsx("div",{children:s.jsxs("label",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"上报离线消息"}),s.jsx("input",{type:"checkbox",checked:r.reportOfflineMessage,onChange:C=>V("reportOfflineMessage",C.target.checked),className:"switch-toggle"})]})}),s.jsx("div",{children:s.jsxs("label",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"调试模式"}),s.jsx("input",{type:"checkbox",checked:r.debug,onChange:C=>V("debug",C.target.checked),className:"switch-toggle"})]})})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-6 border-t border-white/20 dark:border-neutral-700/50",children:[!m&&s.jsxs("button",{onClick:O,className:"px-6 py-2.5 bg-red-500 hover:bg-red-600 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[s.jsx(It,{size:18}),"删除"]}),m&&s.jsx("div",{}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:()=>c(!1),className:"px-6 py-2.5 text-theme-secondary hover:bg-theme-item rounded-xl font-medium transition-colors",children:"取消"}),s.jsx("button",{onClick:T,className:"btn-primary",children:"保存"})]})]})]})})}),u&&s.jsx(vu,{children:s.jsx("div",{className:"fixed inset-0 bg-black/30 dark:bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",style:{zIndex:9e3},children:s.jsxs("div",{className:"bg-white/60 dark:bg-neutral-800/90 backdrop-blur-xl rounded-3xl shadow-2xl w-full max-w-md border border-white/50 dark:border-neutral-700/50",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-white/20 dark:border-neutral-700/50",children:[s.jsx("h3",{className:"text-xl font-semibold text-theme",children:"选择适配器类型"}),s.jsx("button",{onClick:()=>d(!1),className:"text-theme-hint hover:text-theme",children:s.jsx(ft,{size:24})})]}),s.jsxs("div",{className:"p-6 space-y-3",children:[s.jsxs("button",{onClick:()=>R("ws"),className:"w-full p-4 rounded-2xl bg-gradient-to-br from-pink-50 to-rose-50 dark:from-pink-900/30 dark:to-rose-900/30 hover:from-pink-100 hover:to-rose-100 dark:hover:from-pink-900/50 dark:hover:to-rose-900/50 transition-all flex items-center gap-4 group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl gradient-primary-br text-white flex items-center justify-center group-hover:scale-110 transition-transform",children:s.jsx(el,{size:24})}),s.jsxs("div",{className:"text-left",children:[s.jsx("h4",{className:"text-lg font-semibold text-theme",children:"WebSocket正向"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"作为WebSocket服务器"})]})]}),s.jsxs("button",{onClick:()=>R("ws-reverse"),className:"w-full p-4 rounded-2xl bg-gradient-to-br from-green-50 to-teal-50 dark:from-green-900/30 dark:to-teal-900/30 hover:from-green-100 hover:to-teal-100 dark:hover:from-green-900/50 dark:hover:to-teal-900/50 transition-all flex items-center gap-4 group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-green-500 to-teal-600 text-white flex items-center justify-center group-hover:scale-110 transition-transform",children:s.jsx(yu,{size:24})}),s.jsxs("div",{className:"text-left",children:[s.jsx("h4",{className:"text-lg font-semibold text-theme",children:"WebSocket反向"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"作为客户端连接到WebSocket服务端"})]})]}),s.jsxs("button",{onClick:()=>R("http"),className:"w-full p-4 rounded-2xl bg-gradient-to-br from-orange-50 to-red-50 dark:from-orange-900/30 dark:to-red-900/30 hover:from-orange-100 hover:to-red-100 dark:hover:from-orange-900/50 dark:hover:to-red-900/50 transition-all flex items-center gap-4 group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-orange-500 to-red-600 text-white flex items-center justify-center group-hover:scale-110 transition-transform",children:s.jsx(Il,{size:24})}),s.jsxs("div",{className:"text-left",children:[s.jsx("h4",{className:"text-lg font-semibold text-theme",children:"HTTP服务"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"提供HTTP API服务"})]})]}),s.jsxs("button",{onClick:()=>R("http-post"),className:"w-full p-4 rounded-2xl bg-gradient-to-br from-pink-50 to-rose-50 dark:from-pink-900/30 dark:to-rose-900/30 hover:from-pink-100 hover:to-rose-100 dark:hover:from-pink-900/50 dark:hover:to-rose-900/50 transition-all flex items-center gap-4 group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-pink-500 to-rose-600 text-white flex items-center justify-center group-hover:scale-110 transition-transform",children:s.jsx(rs,{size:24})}),s.jsxs("div",{className:"text-left",children:[s.jsx("h4",{className:"text-lg font-semibold text-theme",children:"HTTP上报"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"上报事件到HTTP服务器"})]})]})]}),s.jsx("div",{className:"flex justify-end p-6 border-t border-white/20 dark:border-neutral-700/50",children:s.jsx("button",{onClick:()=>d(!1),className:"px-6 py-2.5 text-theme-secondary hover:bg-theme-item rounded-xl font-medium transition-colors",children:"取消"})})]})})})]})};async function Z0(e){const t=await Ne("/api/email/test",{method:"POST",headers:{"Content-Type":"application/json"},body:e?JSON.stringify({config:e}):void 0});if(!t.success)throw new Error(t.message||"Failed to send test email");return t}const eg=e=>{const{value:t,onChange:n}=e,[r,l]=p.useState(!1),[i,o]=p.useState({}),a=()=>{const d={};t.smtp.host.trim()||(d.host="SMTP 服务器不能为空"),(t.smtp.port<1||t.smtp.port>65535)&&(d.port="端口必须在 1-65535 之间");const m=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return(!t.from||!m.test(t.from))&&(d.from="发件人邮箱格式不正确"),(!t.to||!m.test(t.to))&&(d.to="收件人邮箱格式不正确"),o(d),Object.keys(d).length===0},c=async()=>{if(!a()){Y("请检查表单错误后再测试","error");return}try{l(!0);const d={...t,smtp:{...t.smtp,port:t.smtp.port||587}},m=await Z0(d);Y(m.message||"测试邮件发送成功","success")}catch(d){Y(d.message||"测试邮件发送失败","error")}finally{l(!1)}},u=(d,m)=>{const f=d.split(".");let v={...t};f.length===1?v={...t,[d]:m}:f.length===2?v={...t,[f[0]]:{...t[f[0]],[f[1]]:m}}:f.length===3&&(v={...t,[f[0]]:{...t[f[0]],[f[1]]:{...t[f[0]][f[1]],[f[2]]:m}}}),n(v),i[d]&&o({...i,[d]:""})};return s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center",children:s.jsx(Rs,{size:20,className:"text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"邮件通知"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"机器人掉线时发送邮件通知"})]}),s.jsxs("a",{href:"https://luckylillia.com/guide/config_email",target:"_blank",rel:"noopener noreferrer",className:"px-3 py-2 text-sm font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30 rounded-lg transition-colors flex items-center gap-2",children:[s.jsx(l0,{size:16}),"设置向导"]}),s.jsx("input",{type:"checkbox",checked:t.enabled,onChange:d=>u("enabled",d.target.checked),className:"switch-toggle"})]}),t.enabled&&s.jsxs("div",{className:"space-y-4 border-t border-theme-divider pt-4",children:[s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(zl,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"SMTP 服务器"})]}),s.jsx("input",{type:"text",value:t.smtp.host,onChange:d=>u("smtp.host",d.target.value),className:`input-field ${i.host?"border-red-500":""}`,placeholder:"smtp.gmail.com"}),i.host&&s.jsx("p",{className:"text-xs text-red-500 mt-1",children:i.host})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(zl,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"端口"})]}),s.jsx("input",{type:"number",value:t.smtp.port,onChange:d=>{const m=d.target.value;u("smtp.port",m===""?"":parseInt(m)||587)},className:`input-field ${i.port?"border-red-500":""}`,placeholder:"587",min:"1",max:"65535",style:{appearance:"textfield"},onWheel:d=>d.currentTarget.blur()}),i.port&&s.jsx("p",{className:"text-xs text-red-500 mt-1",children:i.port})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Pl,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"加密方式"})]}),s.jsxs("select",{value:t.smtp.secure?"ssl":"starttls",onChange:d=>{const m=d.target.value==="ssl";u("smtp.secure",m)},className:"input-field",children:[s.jsx("option",{value:"starttls",children:"STARTTLS(常用端口 587)"}),s.jsx("option",{value:"ssl",children:"SSL/TLS(常用端口 465)"})]}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:t.smtp.secure?"SSL/TLS 直接加密连接":"STARTTLS 升级加密连接"})]})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Rs,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"用户名"})]}),s.jsx("input",{type:"text",value:t.smtp.auth.user,onChange:d=>u("smtp.auth.user",d.target.value),className:"input-field",placeholder:"your-email@gmail.com"})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Pl,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"密码"})]}),s.jsx("input",{type:"password",value:t.smtp.auth.pass,onChange:d=>u("smtp.auth.pass",d.target.value),className:"input-field",placeholder:"应用专用密码"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"建议使用应用专用密码(Gmail、Outlook 等)"})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Rs,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"发件人邮箱"})]}),s.jsx("input",{type:"email",value:t.from,onChange:d=>u("from",d.target.value),className:`input-field ${i.from?"border-red-500":""}`,placeholder:"sender@example.com"}),i.from&&s.jsx("p",{className:"text-xs text-red-500 mt-1",children:i.from})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Rs,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"收件人邮箱"})]}),s.jsx("input",{type:"email",value:t.to,onChange:d=>u("to",d.target.value),className:`input-field ${i.to?"border-red-500":""}`,placeholder:"receiver@example.com"}),i.to&&s.jsx("p",{className:"text-xs text-red-500 mt-1",children:i.to})]}),s.jsx("div",{className:"pt-2",children:s.jsx("button",{onClick:c,disabled:r,className:`w-full px-6 py-2.5 rounded-xl font-medium transition-colors flex items-center gap-2 justify-center
|
|
434
|
+
`,children:[s.jsx("div",{className:"p-6 border-b border-theme-divider relative",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl overflow-hidden shadow-lg flex-shrink-0",children:s.jsx("img",{src:"/logo.jpg",alt:"Logo",className:"w-full h-full object-cover"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h1",{className:"text-xl font-bold text-theme truncate",children:"LLBot"}),s.jsx("p",{className:"text-xs text-theme-muted",children:"WebUI"})]}),s.jsx("button",{onClick:l,className:"md:hidden p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors",children:s.jsx(ht,{size:20})}),o&&s.jsx("button",{onClick:o,className:"hidden md:block p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors",title:"收起侧边栏",children:s.jsx(c0,{size:20})})]})}),s.jsx("nav",{className:"flex-1 p-4 space-y-1 overflow-y-auto",children:c.map(d=>{const m=d.icon,f=e===d.id;return s.jsxs("button",{onClick:()=>u(d.id),className:`w-full flex items-center space-x-3 px-4 py-3 rounded-2xl transition-all duration-200 ${f?"gradient-primary text-white shadow-lg scale-105":"text-theme hover:bg-theme-item-hover"}`,children:[s.jsx(m,{size:20}),s.jsx("span",{className:"font-medium",children:d.label})]},d.id)})}),s.jsx("div",{className:"p-4 border-t border-theme-divider",children:s.jsxs("div",{className:"flex items-center space-x-3 px-3 py-2",children:[n&&s.jsxs(s.Fragment,{children:[s.jsx("img",{src:`https://thirdqq.qlogo.cn/g?b=qq&nk=${n.uin}&s=640`,alt:"头像",className:"w-10 h-10 rounded-full object-cover ring-2 ring-white/50 dark:ring-neutral-600",onError:d=>{const m=d.target;m.style.display="none";const f=m.nextElementSibling;f&&(f.style.display="flex")}}),s.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-pink-400 to-rose-500 rounded-full items-center justify-center text-white font-semibold hidden",style:{display:"none"},children:n.nick.charAt(0).toUpperCase()}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-theme truncate",children:n.nick}),s.jsx("p",{className:"text-xs text-theme-muted truncate",children:n.uin})]})]}),!n&&s.jsx("div",{className:"flex-1"}),s.jsx("button",{onClick:a,className:"p-2 rounded-lg transition-all duration-200 text-theme-muted hover:bg-theme-item hover:text-theme",title:"设置",children:s.jsx(uh,{size:18})})]})})]}),i&&o&&s.jsx("button",{onClick:o,className:"hidden md:flex fixed left-2 top-4 z-40 w-8 h-8 items-center justify-center bg-theme-card/80 backdrop-blur-sm border border-theme-divider rounded-md text-theme-muted hover:text-theme hover:bg-theme-card transition-all shadow-md hover:shadow-lg",title:"展开侧边栏",children:s.jsx(ni,{size:18})})]})},V0=!1,Q0=()=>({friendCount:128,groupCount:45,messageReceived:12580,messageSent:3842,startupTime:Math.floor(Date.now()/1e3)-3600*5-1234,lastMessageTime:Math.floor(Date.now()/1e3)-30,bot:{memory:(80+Math.random()*40)*1024*1024,totalMemory:16*1024*1024*1024,memoryPercent:2+Math.random()*3,cpu:3+Math.random()*10},qq:{memory:(200+Math.random()*100)*1024*1024,totalMemory:16*1024*1024*1024,memoryPercent:5+Math.random()*8,cpu:5+Math.random()*15}}),Nu=e=>!e||e<=0?"0 MB":e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":e<1024*1024*1024?(e/1024/1024).toFixed(0)+" MB":(e/1024/1024/1024).toFixed(2)+" GB",G0=e=>{const n=Math.floor(Date.now()/1e3)-e,r=Math.floor(n/86400),l=Math.floor(n%86400/3600),i=Math.floor(n%3600/60),o=n%60;return r>0?`${r}天 ${l}时 ${i}分`:l>0?`${l}时 ${i}分 ${o}秒`:i>0?`${i}分 ${o}秒`:`${o}秒`},K0=e=>e?new Date(e*1e3).toLocaleString("zh-CN"):"暂无",Fs=({icon:e,label:t,value:n,gradient:r})=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-theme-item hover:bg-theme-item-hover transition-all duration-200 hover:scale-[1.02]",children:[s.jsx("div",{className:`w-10 h-10 rounded-xl ${r} flex items-center justify-center shadow-md`,children:e}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-theme-muted",children:t}),s.jsx("p",{className:"text-lg font-bold text-theme truncate",children:n})]})]}),bu=({value:e,size:t=100,strokeWidth:n=8,gradientId:r,gradientColors:l,label:i,displayValue:o,icon:a})=>{const c=(t-n)/2,u=c*2*Math.PI,d=Math.min(Math.max(e,0),100),m=u-d/100*u;return s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsxs("div",{className:"relative",style:{width:t,height:t},children:[s.jsxs("svg",{width:t,height:t,className:"transform -rotate-90",children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:r,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[s.jsx("stop",{offset:"0%",stopColor:l[0]}),s.jsx("stop",{offset:"100%",stopColor:l[1]})]})}),s.jsx("circle",{cx:t/2,cy:t/2,r:c,fill:"none",stroke:"rgba(128,128,128,0.15)",strokeWidth:n}),s.jsx("circle",{cx:t/2,cy:t/2,r:c,fill:"none",stroke:`url(#${r})`,strokeWidth:n,strokeDasharray:u,strokeDashoffset:m,strokeLinecap:"round",className:"transition-all duration-1000 ease-out"})]}),s.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center shadow-md",style:{background:`linear-gradient(135deg, ${l[0]}, ${l[1]})`},children:a}),s.jsxs("span",{className:"text-sm font-bold text-theme mt-1",children:[d.toFixed(1),"%"]})]})]}),s.jsx("p",{className:"text-xs font-semibold text-theme mt-2",children:i}),s.jsx("p",{className:"text-xs text-theme-muted",children:o})]})},Su=({title:e,version:t,icon:n,gradient:r,cpu:l,memory:i,totalMemory:o,memoryPercent:a,cpuGradientId:c,memGradientId:u,cpuColors:d,memColors:m})=>s.jsxs("div",{className:"card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("div",{className:`w-8 h-8 rounded-lg ${r} flex items-center justify-center shadow-md`,children:n}),s.jsx("h4",{className:"text-sm font-semibold text-theme",children:e}),t&&s.jsx("span",{className:"ml-auto text-xs text-theme-muted bg-theme-item px-2 py-0.5 rounded-full",children:t})]}),s.jsxs("div",{className:"flex justify-around",children:[s.jsx(bu,{value:l,gradientId:c,gradientColors:d,label:"CPU",displayValue:`${l.toFixed(1)}%`,icon:s.jsx(Ua,{size:16,className:"text-white"})}),s.jsx(bu,{value:a,gradientId:u,gradientColors:m,label:"内存",displayValue:`${Nu(i)} / ${Nu(o)}`,icon:s.jsx(d0,{size:16,className:"text-white"})})]})]}),Y0=({llbotVersion:e,qqVersion:t})=>{const[n,r]=p.useState(null),[l,i]=p.useState(!0),[o,a]=p.useState(""),c=p.useRef(),u=async()=>{try{const d=V0?Q0():(await je("/api/dashboard/stats")).data;d&&r(d)}catch(d){console.error("Failed to fetch dashboard stats:",d)}finally{i(!1)}};return p.useEffect(()=>(u(),c.current=window.setInterval(u,5e3),()=>{c.current&&clearInterval(c.current)}),[]),p.useEffect(()=>{if(!(n!=null&&n.startupTime))return;const d=()=>a(G0(n.startupTime));d();const m=setInterval(d,1e3);return()=>clearInterval(m)},[n==null?void 0:n.startupTime]),l?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"w-12 h-12 border-4 border-pink-500 border-t-transparent rounded-full animate-spin"})}):n?s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"card p-4 flex flex-col",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl gradient-primary-br flex items-center justify-center shadow-md",children:s.jsx(Ur,{size:20,className:"text-white"})}),s.jsx("h3",{className:"text-base font-semibold text-theme",children:"运行时间"}),s.jsxs("div",{className:"ml-auto flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-500/20 text-green-500 dark:text-green-400 text-xs font-medium",children:[s.jsx(T0,{size:12}),"运行中"]})]}),s.jsxs("div",{className:"flex-1 flex flex-col justify-center space-y-2",children:[s.jsxs("div",{className:"p-3 rounded-xl bg-theme-item",children:[s.jsx("p",{className:"text-xs text-theme-muted",children:"已运行"}),s.jsx("p",{className:"text-xl font-bold bg-gradient-to-r from-pink-500 to-rose-500 bg-clip-text text-transparent",children:o})]}),s.jsxs("div",{className:"px-3 py-2",children:[s.jsx("p",{className:"text-xs text-theme-muted",children:"启动时间"}),s.jsx("p",{className:"text-sm font-medium text-theme",children:K0(n.startupTime)})]})]})]}),s.jsxs("div",{className:"card p-4 space-y-3",children:[s.jsx(Fs,{icon:s.jsx(si,{size:20,className:"text-white"}),label:"好友数量",value:n.friendCount.toLocaleString(),gradient:"bg-gradient-to-br from-sky-500 to-blue-500"}),s.jsx(Fs,{icon:s.jsx(C0,{size:20,className:"text-white"}),label:"群组数量",value:n.groupCount.toLocaleString(),gradient:"bg-gradient-to-br from-violet-500 to-purple-500"})]}),s.jsxs("div",{className:"card p-4 space-y-3",children:[s.jsx(Fs,{icon:s.jsx(nh,{size:20,className:"text-white"}),label:"收到消息",value:n.messageReceived.toLocaleString(),gradient:"bg-gradient-to-br from-green-500 to-emerald-500"}),s.jsx(Fs,{icon:s.jsx(ss,{size:20,className:"text-white"}),label:"发送消息",value:n.messageSent.toLocaleString(),gradient:"bg-gradient-to-br from-orange-500 to-amber-500"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(Su,{title:"QQ 资源",version:t,icon:s.jsx(Da,{size:16,className:"text-white"}),gradient:"bg-gradient-to-br from-cyan-500 to-teal-500",cpu:n.qq.cpu,memory:n.qq.memory,totalMemory:n.qq.totalMemory,memoryPercent:n.qq.memoryPercent,cpuGradientId:"qqCpuGradient",memGradientId:"qqMemGradient",cpuColors:["#06b6d4","#14b8a6"],memColors:["#0ea5e9","#22d3ee"]}),s.jsx(Su,{title:"LLBot 资源",version:e,icon:s.jsx(i0,{size:16,className:"text-white"}),gradient:"bg-gradient-to-br from-fuchsia-500 to-pink-500",cpu:n.bot.cpu,memory:n.bot.memory,totalMemory:n.bot.totalMemory,memoryPercent:n.bot.memoryPercent,cpuGradientId:"botCpuGradient",memGradientId:"botMemGradient",cpuColors:["#d946ef","#ec4899"],memColors:["#a855f7","#d946ef"]})]})]}):s.jsx("div",{className:"card p-8 text-center",children:s.jsx("p",{className:"text-theme-muted",children:"无法加载统计数据"})})},$s=72,Us=1e3,Cu=10,X0=()=>{var C;const[e,t]=p.useState([]),[n,r]=p.useState(!1),[l,i]=p.useState(!0),[o,a]=p.useState(""),[c,u]=p.useState("all"),[d,m]=p.useState(!1),[f,y]=p.useState(0),w=p.useRef(null),k=p.useRef([]),j=p.useCallback(()=>{w.current&&l&&(w.current.scrollTop=w.current.scrollHeight)},[l]);p.useEffect(()=>{let b=null,E=!0;return(()=>{const U=gh("webui_token")||"",D=`/api/logs/stream?token=${encodeURIComponent(U)}`;b=new EventSource(D),b.addEventListener("connected",()=>{E&&m(!0)}),b.onmessage=P=>{if(E)try{const W=JSON.parse(P.data);n?k.current.push(W):t(K=>{const J=[...K,W];return J.length>Us?J.slice(-Us):J})}catch(W){console.error("[LogViewer] Failed to parse log:",W)}},b.onerror=()=>{E&&m(!1)}})(),()=>{E=!1,b&&b.close()}},[n]),p.useEffect(()=>{j()},[e,j]);const g=p.useCallback(b=>{y(b.currentTarget.scrollTop)},[]),h=()=>{r(!1),t(b=>{const E=[...b,...k.current];return k.current=[],E.length>Us?E.slice(-Us):E})},x=()=>{t([]),k.current=[]},v=b=>{switch(b.toLowerCase()){case"error":return{bg:"bg-red-50/50 dark:bg-red-900/20",badge:"text-red-600 dark:text-red-400 bg-red-100/70 dark:bg-red-900/50"};case"warn":return{bg:"bg-amber-50/50 dark:bg-amber-900/20",badge:"text-amber-600 dark:text-amber-400 bg-amber-100/70 dark:bg-amber-900/50"};case"info":return{bg:"bg-blue-50/50 dark:bg-blue-900/20",badge:"text-pink-500 dark:text-pink-400 bg-pink-100/70 dark:bg-pink-900/50"};case"debug":return{bg:"bg-gray-50/50 dark:bg-neutral-700/50",badge:"text-gray-500 dark:text-neutral-400 bg-gray-100/70 dark:bg-neutral-600/50"};default:return{bg:"bg-green-50/50 dark:bg-green-900/20",badge:"text-green-600 dark:text-green-400 bg-green-100/70 dark:bg-green-900/50"}}},N=p.useMemo(()=>{let b=e;if(c!=="all"&&(b=b.filter(E=>E.type.toLowerCase()===c)),o){const E=o.toLowerCase();b=b.filter(_=>_.content.toLowerCase().includes(E)||_.type.toLowerCase().includes(E))}return b},[e,o,c]),S=((C=w.current)==null?void 0:C.clientHeight)||500,T=N.length*$s,M=Math.max(0,Math.floor(f/$s)-Cu),q=Math.min(N.length,Math.ceil((f+S)/$s)+Cu),R=N.slice(M,q),V=M*$s;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"card p-4",children:[s.jsxs("div",{className:"hidden md:flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-emerald-500 to-teal-600 flex items-center justify-center shadow-md",children:s.jsx(nl,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base font-semibold text-theme",children:"实时日志"}),s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:`flex items-center gap-1 px-2 py-0.5 rounded-full ${d?"bg-green-100 dark:bg-green-900/50 text-green-600 dark:text-green-400":"bg-red-100 dark:bg-red-900/50 text-red-600 dark:text-red-400"}`,children:[s.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${d?"bg-green-500":"bg-red-500"}`}),d?"已连接":"未连接"]}),s.jsx("span",{className:"text-theme-muted",children:n?`已暂停 (${k.current.length} 条待显示)`:`${e.length} 条日志`})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex rounded-lg overflow-hidden border border-gray-200 dark:border-neutral-600",children:[{value:"all",label:"全部"},{value:"info",label:"Info"},{value:"warn",label:"Warn"},{value:"error",label:"Error"}].map(b=>s.jsx("button",{onClick:()=>u(b.value),className:`px-3 py-1.5 text-xs font-medium transition-all ${c===b.value?"gradient-primary-br text-white":"bg-theme-input text-theme-secondary hover:bg-theme-item-hover"}`,children:b.label},b.value))}),s.jsx("input",{type:"text",placeholder:"搜索日志...",value:o,onChange:b=>a(b.target.value),className:"px-3 py-1.5 text-sm bg-theme-input border border-theme-input rounded-lg focus:ring-2 focus:ring-pink-500 focus:border-transparent w-40 text-theme placeholder:text-theme-hint"}),s.jsx("button",{onClick:()=>i(!l),className:`p-2 rounded-lg transition-all ${l?"gradient-primary text-white shadow-md":"bg-theme-input text-theme-secondary hover:bg-theme-item-hover"}`,title:l?"自动滚动已开启":"自动滚动已关闭",children:s.jsx($o,{size:18})}),s.jsx("button",{onClick:n?h:()=>r(!0),className:`p-2 rounded-lg transition-all ${n?"bg-gradient-to-br from-green-500 to-emerald-500 text-white shadow-md":"bg-gradient-to-br from-amber-500 to-orange-500 text-white shadow-md"}`,title:n?"继续":"暂停",children:n?s.jsx(Do,{size:18}):s.jsx(Uo,{size:18})}),s.jsx("button",{onClick:x,className:"p-2 bg-gradient-to-br from-red-500 to-pink-500 text-white rounded-lg shadow-md hover:shadow-lg transition-all",title:"清空日志",children:s.jsx(It,{size:18})})]})]}),s.jsxs("div",{className:"md:hidden space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-emerald-500 to-teal-600 flex items-center justify-center shadow-md flex-shrink-0",children:s.jsx(nl,{size:20,className:"text-white"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"text-base font-semibold text-theme",children:"实时日志"}),s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:`flex items-center gap-1 px-2 py-0.5 rounded-full flex-shrink-0 ${d?"bg-green-100 dark:bg-green-900/50 text-green-600 dark:text-green-400":"bg-red-100 dark:bg-red-900/50 text-red-600 dark:text-red-400"}`,children:[s.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${d?"bg-green-500":"bg-red-500"}`}),d?"已连接":"未连接"]}),s.jsx("span",{className:"text-theme-muted truncate",children:n?`已暂停 (${k.current.length} 条待显示)`:`${e.length} 条日志`})]})]})]}),s.jsx("input",{type:"text",placeholder:"搜索日志...",value:o,onChange:b=>a(b.target.value),className:"w-full px-3 py-2 text-sm bg-theme-input border border-theme-input rounded-lg focus:ring-2 focus:ring-pink-500 focus:border-transparent text-theme placeholder:text-theme-hint"}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex rounded-lg overflow-hidden border border-gray-200 dark:border-neutral-600",children:[{value:"all",label:"全部"},{value:"info",label:"Info"},{value:"warn",label:"Warn"},{value:"error",label:"Error"}].map(b=>s.jsx("button",{onClick:()=>u(b.value),className:`px-2 py-1.5 text-xs font-medium transition-all ${c===b.value?"gradient-primary-br text-white":"bg-theme-input text-theme-secondary hover:bg-theme-item-hover"}`,children:b.label},b.value))}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>i(!l),className:`p-1.5 rounded-lg transition-all ${l?"gradient-primary text-white shadow-md":"bg-theme-input text-theme-secondary hover:bg-theme-item-hover"}`,title:l?"自动滚动已开启":"自动滚动已关闭",children:s.jsx($o,{size:16})}),s.jsx("button",{onClick:n?h:()=>r(!0),className:`p-1.5 rounded-lg transition-all ${n?"bg-gradient-to-br from-green-500 to-emerald-500 text-white shadow-md":"bg-gradient-to-br from-amber-500 to-orange-500 text-white shadow-md"}`,title:n?"继续":"暂停",children:n?s.jsx(Do,{size:16}):s.jsx(Uo,{size:16})}),s.jsx("button",{onClick:x,className:"p-1.5 bg-gradient-to-br from-red-500 to-pink-500 text-white rounded-lg shadow-md hover:shadow-lg transition-all",title:"清空日志",children:s.jsx(It,{size:16})})]})]})]})]}),s.jsx("div",{className:"card p-4",children:s.jsx("div",{ref:w,onScroll:g,className:"h-[calc(100vh-240px)] overflow-auto pr-2",children:N.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-theme-hint",children:[s.jsx(nl,{size:48,className:"mb-3 opacity-50"}),s.jsx("p",{className:"text-sm",children:"等待日志..."})]}):s.jsx("div",{style:{height:T,position:"relative"},children:s.jsx("div",{style:{transform:`translateY(${V}px)`},className:"space-y-1.5",children:R.map((b,E)=>{const _=v(b.type);return s.jsx("div",{className:`p-2.5 rounded-lg ${_.bg} hover:shadow-sm transition-shadow`,children:s.jsx("div",{className:"flex items-start gap-2",children:s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[s.jsx("span",{className:"text-xs text-theme-hint font-mono",children:b.dateTimeStr}),s.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded ${_.badge}`,children:b.type.toUpperCase()})]}),s.jsx("p",{className:"text-sm text-theme-secondary whitespace-pre-wrap break-all font-mono",children:b.content})]})})},`${b.timestamp}-${M+E}`)})})})})})]})},J0=({config:e,onChange:t,onSave:n})=>{const[r,l]=p.useState(null),[i,o]=p.useState(-1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),[m,f]=p.useState(!1),[y,w]=p.useState(!1),[k,j]=p.useState(""),[g,h]=p.useState(!1),x={ws:{icon:tl,name:"WebSocket正向",desc:"提供WebSocket服务器"},"ws-reverse":{icon:yu,name:"WebSocket反向",desc:"作为客户端连接到WebSocket服务"},http:{icon:Pl,name:"HTTP服务",desc:"提供HTTP API服务"},"http-post":{icon:ss,name:"HTTP上报",desc:"上报事件到HTTP服务器"}},v=(C,b)=>{l(C),o(b),f(!1),w(!1),j(C.name||""),h(!1),c(!0)},N=C=>{C.stopPropagation(),w(!0)},S=()=>{if(!r)return;const C={...r,name:k.trim()};l(C),w(!1)},T=()=>{j((r==null?void 0:r.name)||""),w(!1)},M=()=>{var D;if(!r)return;const C=r.type==="ws"||r.type==="http",b=r.host;if(C&&(!b||b==="0.0.0.0"||b==="::")&&!((D=r.token)!=null&&D.trim())){Y("监听全部地址时必须设置 Token","error");return}let _;if(m)_=[...e.connect,r];else{if(i<0)return;_=[...e.connect],_[i]=r}const U={...e,connect:_};t(U),c(!1),f(!1),n(U)},q=()=>{if(m){c(!1),f(!1);return}if(i<0)return;const C=e.connect.filter((E,_)=>_!==i),b={...e,connect:C};t(b),c(!1),n(b)},R=C=>{const b={enable:!0,token:"",messageFormat:"array",reportSelfMessage:!1,reportOfflineMessage:!1,debug:!1};let E;switch(C){case"ws":E={...b,type:"ws",host:"",port:3001,heartInterval:6e4};break;case"ws-reverse":E={...b,type:"ws-reverse",url:"",heartInterval:6e4};break;case"http":E={...b,type:"http",host:"",port:3e3};break;case"http-post":E={...b,type:"http-post",url:"",enableHeart:!1,heartInterval:6e4};break}d(!1),l(E),o(-1),f(!0),h(!1),c(!0)},V=(C,b)=>{r&&l({...r,[C]:b})};return s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"card p-6",children:s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl gradient-primary-br flex items-center justify-center",children:s.jsx(tl,{size:24,className:"text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"OneBot 11 协议"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"启用或禁用 OneBot 11 适配器"})]}),s.jsx("input",{type:"checkbox",checked:e.enable,onChange:C=>{const b={...e,enable:C.target.checked};t(b),n(b)},className:"switch-toggle-lg"})]})}),e.enable&&e.connect&&Array.isArray(e.connect)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.connect.map((C,b)=>{const E=x[C.type],_=E.icon;return s.jsxs("div",{className:`card p-6 cursor-pointer hover:scale-105 transition-all ${C.enable?"ring-2 ring-pink-500":""}`,onClick:()=>v(C,b),children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center ${C.enable?"gradient-primary-br text-white":"bg-gray-200 dark:bg-neutral-600 text-theme-secondary"}`,children:s.jsx(_,{size:24})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-lg font-semibold text-theme",children:C.name||E.name}),s.jsx("p",{className:"text-sm text-theme-secondary",children:E.desc})]})]}),s.jsx(uh,{size:20,className:"text-theme-hint"})]}),s.jsxs("div",{className:"flex items-center justify-between mt-4 pt-4 border-t border-theme-divider",children:[s.jsx("span",{className:`text-xs font-medium px-3 py-1 rounded-full ${C.enable?"bg-green-100 dark:bg-green-900/50 text-green-800 dark:text-green-400":"bg-gray-100 dark:bg-neutral-700 text-gray-600 dark:text-neutral-400"}`,children:C.enable?"已启用":"未启用"}),C.enable&&s.jsxs(s.Fragment,{children:[(C.type==="ws"||C.type==="http")&&s.jsxs("span",{className:"text-sm text-theme-secondary",children:["端口: ",C.port]}),(C.type==="ws-reverse"||C.type==="http-post")&&s.jsxs("span",{className:"text-sm text-theme-secondary truncate max-w-[180px]",title:C.url||"未配置",children:["URL: ",C.url||"未配置"]})]})]})]},b)})}),s.jsx("div",{className:"flex justify-center mt-6",children:s.jsxs("button",{onClick:()=>d(!0),className:"btn-primary flex items-center gap-2",children:[s.jsx(ih,{size:20}),"添加适配器"]})})]}),a&&r&&s.jsx(vu,{children:s.jsx("div",{className:"fixed inset-0 bg-black/30 dark:bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",style:{zIndex:9e3},children:s.jsxs("div",{className:"bg-white/60 dark:bg-neutral-800/90 backdrop-blur-xl rounded-3xl shadow-2xl w-full max-w-2xl max-h-[80vh] flex flex-col border border-white/50 dark:border-neutral-700/50",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-white/20 dark:border-neutral-700/50",children:[s.jsx("div",{className:"flex items-center gap-3 flex-1",children:y?s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 flex-1",children:[s.jsx("input",{type:"text",value:k,onChange:C=>j(C.target.value),onKeyDown:C=>{C.key==="Enter"&&S(),C.key==="Escape"&&T()},placeholder:"输入自定义名称",className:"flex-1 px-3 py-2 border border-theme-input rounded-xl focus:outline-none focus:ring-2 focus:ring-pink-500 bg-theme-input text-theme",autoFocus:!0}),s.jsxs("div",{className:"flex gap-2 sm:flex-shrink-0",children:[s.jsx("button",{onClick:S,className:"flex-1 sm:flex-none px-4 py-2 bg-pink-500 text-white rounded-xl hover:bg-pink-600 transition-colors whitespace-nowrap",children:"确定"}),s.jsx("button",{onClick:T,className:"flex-1 sm:flex-none px-4 py-2 bg-theme-item text-theme-secondary rounded-xl hover:bg-theme-item-hover transition-colors whitespace-nowrap",children:"取消"})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("h3",{className:"text-xl font-semibold text-theme",children:[m?"新建 - ":"",r.name||x[r.type].name]}),s.jsx("button",{onClick:N,className:"p-2 text-theme-hint hover:text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors",title:"编辑名称",children:s.jsx(k0,{size:18})})]})}),s.jsx("button",{onClick:()=>{c(!1),f(!1),w(!1)},className:"text-theme-hint hover:text-theme",children:s.jsx(ht,{size:24})})]}),s.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto flex-1",children:[s.jsx("div",{children:s.jsxs("label",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"启用此适配器"}),s.jsx("input",{type:"checkbox",checked:r.enable,onChange:C=>V("enable",C.target.checked),className:"switch-toggle"})]})}),r.type==="ws"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"监听地址"}),s.jsx(ls,{value:r.host||"",onChange:C=>V("host",C)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"端口"}),s.jsx("input",{type:"number",value:r.port,onChange:C=>V("port",parseInt(C.target.value)),className:"input-field"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"心跳间隔 (ms)"}),s.jsx("input",{type:"number",value:r.heartInterval,onChange:C=>V("heartInterval",parseInt(C.target.value)),className:"input-field"})]})]}),r.type==="ws-reverse"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"连接地址"}),s.jsx("input",{type:"text",value:r.url,onChange:C=>V("url",C.target.value),placeholder:"ws://example.com:8080",className:"input-field"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"心跳间隔 (ms)"}),s.jsx("input",{type:"number",value:r.heartInterval,onChange:C=>V("heartInterval",parseInt(C.target.value)),className:"input-field"})]})]}),r.type==="http"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"监听地址"}),s.jsx(ls,{value:r.host||"",onChange:C=>V("host",C)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"端口"}),s.jsx("input",{type:"number",value:r.port,onChange:C=>V("port",parseInt(C.target.value)),className:"input-field"})]})]}),r.type==="http-post"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"上报地址"}),s.jsx("input",{type:"text",value:r.url,onChange:C=>V("url",C.target.value),placeholder:"http://example.com:8080/webhook",className:"input-field"})]}),s.jsx("div",{children:s.jsxs("label",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"启用心跳"}),s.jsx("input",{type:"checkbox",checked:r.enableHeart,onChange:C=>V("enableHeart",C.target.checked),className:"switch-toggle"})]})}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"心跳间隔 (ms)"}),s.jsx("input",{type:"number",value:r.heartInterval,onChange:C=>V("heartInterval",parseInt(C.target.value)),className:"input-field"})]})]}),s.jsxs("div",{className:"border-t border-theme-divider pt-6",children:[s.jsx("h4",{className:"text-md font-semibold text-theme mb-4",children:"通用配置"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Token"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:g?"text":"password",value:r.token,onChange:C=>V("token",C.target.value),placeholder:"访问令牌",className:"input-field pr-12"}),s.jsx("button",{type:"button",onClick:()=>h(!g),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1",children:g?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"消息格式"}),s.jsxs("div",{className:"flex gap-4 text-theme-secondary",children:[s.jsxs("label",{className:"flex items-center",children:[s.jsx("input",{type:"radio",value:"array",checked:r.messageFormat==="array",onChange:C=>V("messageFormat",C.target.value),className:"mr-2"}),"消息段 (array)"]}),s.jsxs("label",{className:"flex items-center",children:[s.jsx("input",{type:"radio",value:"string",checked:r.messageFormat==="string",onChange:C=>V("messageFormat",C.target.value),className:"mr-2"}),"CQ码 (string)"]})]})]}),s.jsx("div",{children:s.jsxs("label",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"上报自己发送的消息"}),s.jsx("input",{type:"checkbox",checked:r.reportSelfMessage,onChange:C=>V("reportSelfMessage",C.target.checked),className:"switch-toggle"})]})}),s.jsx("div",{children:s.jsxs("label",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"上报离线消息"}),s.jsx("input",{type:"checkbox",checked:r.reportOfflineMessage,onChange:C=>V("reportOfflineMessage",C.target.checked),className:"switch-toggle"})]})}),s.jsx("div",{children:s.jsxs("label",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"调试模式"}),s.jsx("input",{type:"checkbox",checked:r.debug,onChange:C=>V("debug",C.target.checked),className:"switch-toggle"})]})})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-6 border-t border-white/20 dark:border-neutral-700/50",children:[!m&&s.jsxs("button",{onClick:q,className:"px-6 py-2.5 bg-red-500 hover:bg-red-600 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[s.jsx(It,{size:18}),"删除"]}),m&&s.jsx("div",{}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:()=>c(!1),className:"px-6 py-2.5 text-theme-secondary hover:bg-theme-item rounded-xl font-medium transition-colors",children:"取消"}),s.jsx("button",{onClick:M,className:"btn-primary",children:"保存"})]})]})]})})}),u&&s.jsx(vu,{children:s.jsx("div",{className:"fixed inset-0 bg-black/30 dark:bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",style:{zIndex:9e3},children:s.jsxs("div",{className:"bg-white/60 dark:bg-neutral-800/90 backdrop-blur-xl rounded-3xl shadow-2xl w-full max-w-md border border-white/50 dark:border-neutral-700/50",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-white/20 dark:border-neutral-700/50",children:[s.jsx("h3",{className:"text-xl font-semibold text-theme",children:"选择适配器类型"}),s.jsx("button",{onClick:()=>d(!1),className:"text-theme-hint hover:text-theme",children:s.jsx(ht,{size:24})})]}),s.jsxs("div",{className:"p-6 space-y-3",children:[s.jsxs("button",{onClick:()=>R("ws"),className:"w-full p-4 rounded-2xl bg-gradient-to-br from-pink-50 to-rose-50 dark:from-pink-900/30 dark:to-rose-900/30 hover:from-pink-100 hover:to-rose-100 dark:hover:from-pink-900/50 dark:hover:to-rose-900/50 transition-all flex items-center gap-4 group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl gradient-primary-br text-white flex items-center justify-center group-hover:scale-110 transition-transform",children:s.jsx(tl,{size:24})}),s.jsxs("div",{className:"text-left",children:[s.jsx("h4",{className:"text-lg font-semibold text-theme",children:"WebSocket正向"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"作为WebSocket服务器"})]})]}),s.jsxs("button",{onClick:()=>R("ws-reverse"),className:"w-full p-4 rounded-2xl bg-gradient-to-br from-green-50 to-teal-50 dark:from-green-900/30 dark:to-teal-900/30 hover:from-green-100 hover:to-teal-100 dark:hover:from-green-900/50 dark:hover:to-teal-900/50 transition-all flex items-center gap-4 group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-green-500 to-teal-600 text-white flex items-center justify-center group-hover:scale-110 transition-transform",children:s.jsx(yu,{size:24})}),s.jsxs("div",{className:"text-left",children:[s.jsx("h4",{className:"text-lg font-semibold text-theme",children:"WebSocket反向"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"作为客户端连接到WebSocket服务端"})]})]}),s.jsxs("button",{onClick:()=>R("http"),className:"w-full p-4 rounded-2xl bg-gradient-to-br from-orange-50 to-red-50 dark:from-orange-900/30 dark:to-red-900/30 hover:from-orange-100 hover:to-red-100 dark:hover:from-orange-900/50 dark:hover:to-red-900/50 transition-all flex items-center gap-4 group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-orange-500 to-red-600 text-white flex items-center justify-center group-hover:scale-110 transition-transform",children:s.jsx(Pl,{size:24})}),s.jsxs("div",{className:"text-left",children:[s.jsx("h4",{className:"text-lg font-semibold text-theme",children:"HTTP服务"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"提供HTTP API服务"})]})]}),s.jsxs("button",{onClick:()=>R("http-post"),className:"w-full p-4 rounded-2xl bg-gradient-to-br from-pink-50 to-rose-50 dark:from-pink-900/30 dark:to-rose-900/30 hover:from-pink-100 hover:to-rose-100 dark:hover:from-pink-900/50 dark:hover:to-rose-900/50 transition-all flex items-center gap-4 group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-pink-500 to-rose-600 text-white flex items-center justify-center group-hover:scale-110 transition-transform",children:s.jsx(ss,{size:24})}),s.jsxs("div",{className:"text-left",children:[s.jsx("h4",{className:"text-lg font-semibold text-theme",children:"HTTP上报"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"上报事件到HTTP服务器"})]})]})]}),s.jsx("div",{className:"flex justify-end p-6 border-t border-white/20 dark:border-neutral-700/50",children:s.jsx("button",{onClick:()=>d(!1),className:"px-6 py-2.5 text-theme-secondary hover:bg-theme-item rounded-xl font-medium transition-colors",children:"取消"})})]})})})]})};async function Z0(e){const t=await je("/api/email/test",{method:"POST",headers:{"Content-Type":"application/json"},body:e?JSON.stringify({config:e}):void 0});if(!t.success)throw new Error(t.message||"Failed to send test email");return t}const eg=e=>{const{value:t,onChange:n}=e,[r,l]=p.useState(!1),[i,o]=p.useState({}),a=()=>{const d={};t.smtp.host.trim()||(d.host="SMTP 服务器不能为空"),(t.smtp.port<1||t.smtp.port>65535)&&(d.port="端口必须在 1-65535 之间");const m=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return(!t.from||!m.test(t.from))&&(d.from="发件人邮箱格式不正确"),(!t.to||!m.test(t.to))&&(d.to="收件人邮箱格式不正确"),o(d),Object.keys(d).length===0},c=async()=>{if(!a()){Y("请检查表单错误后再测试","error");return}try{l(!0);const d={...t,smtp:{...t.smtp,port:t.smtp.port||587}},m=await Z0(d);Y(m.message||"测试邮件发送成功","success")}catch(d){Y(d.message||"测试邮件发送失败","error")}finally{l(!1)}},u=(d,m)=>{const f=d.split(".");let y={...t};f.length===1?y={...t,[d]:m}:f.length===2?y={...t,[f[0]]:{...t[f[0]],[f[1]]:m}}:f.length===3&&(y={...t,[f[0]]:{...t[f[0]],[f[1]]:{...t[f[0]][f[1]],[f[2]]:m}}}),n(y),i[d]&&o({...i,[d]:""})};return s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center",children:s.jsx(_s,{size:20,className:"text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"邮件通知"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"机器人掉线时发送邮件通知"})]}),s.jsxs("a",{href:"https://luckylillia.com/guide/config_email",target:"_blank",rel:"noopener noreferrer",className:"px-3 py-2 text-sm font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30 rounded-lg transition-colors flex items-center gap-2",children:[s.jsx(l0,{size:16}),"设置向导"]}),s.jsx("input",{type:"checkbox",checked:t.enabled,onChange:d=>u("enabled",d.target.checked),className:"switch-toggle"})]}),t.enabled&&s.jsxs("div",{className:"space-y-4 border-t border-theme-divider pt-4",children:[s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Ll,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"SMTP 服务器"})]}),s.jsx("input",{type:"text",value:t.smtp.host,onChange:d=>u("smtp.host",d.target.value),className:`input-field ${i.host?"border-red-500":""}`,placeholder:"smtp.gmail.com"}),i.host&&s.jsx("p",{className:"text-xs text-red-500 mt-1",children:i.host})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Ll,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"端口"})]}),s.jsx("input",{type:"number",value:t.smtp.port,onChange:d=>{const m=d.target.value;u("smtp.port",m===""?"":parseInt(m)||587)},className:`input-field ${i.port?"border-red-500":""}`,placeholder:"587",min:"1",max:"65535",style:{appearance:"textfield"},onWheel:d=>d.currentTarget.blur()}),i.port&&s.jsx("p",{className:"text-xs text-red-500 mt-1",children:i.port})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(zl,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"加密方式"})]}),s.jsxs("select",{value:t.smtp.secure?"ssl":"starttls",onChange:d=>{const m=d.target.value==="ssl";u("smtp.secure",m)},className:"input-field",children:[s.jsx("option",{value:"starttls",children:"STARTTLS(常用端口 587)"}),s.jsx("option",{value:"ssl",children:"SSL/TLS(常用端口 465)"})]}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:t.smtp.secure?"SSL/TLS 直接加密连接":"STARTTLS 升级加密连接"})]})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(_s,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"用户名"})]}),s.jsx("input",{type:"text",value:t.smtp.auth.user,onChange:d=>u("smtp.auth.user",d.target.value),className:"input-field",placeholder:"your-email@gmail.com"})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(zl,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"密码"})]}),s.jsx("input",{type:"password",value:t.smtp.auth.pass,onChange:d=>u("smtp.auth.pass",d.target.value),className:"input-field",placeholder:"应用专用密码"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"建议使用应用专用密码(Gmail、Outlook 等)"})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(_s,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"发件人邮箱"})]}),s.jsx("input",{type:"email",value:t.from,onChange:d=>u("from",d.target.value),className:`input-field ${i.from?"border-red-500":""}`,placeholder:"sender@example.com"}),i.from&&s.jsx("p",{className:"text-xs text-red-500 mt-1",children:i.from})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(_s,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"收件人邮箱"})]}),s.jsx("input",{type:"email",value:t.to,onChange:d=>u("to",d.target.value),className:`input-field ${i.to?"border-red-500":""}`,placeholder:"receiver@example.com"}),i.to&&s.jsx("p",{className:"text-xs text-red-500 mt-1",children:i.to})]}),s.jsx("div",{className:"pt-2",children:s.jsx("button",{onClick:c,disabled:r,className:`w-full px-6 py-2.5 rounded-xl font-medium transition-colors flex items-center gap-2 justify-center
|
|
435
435
|
bg-theme-item hover:bg-theme-item-hover text-theme
|
|
436
|
-
disabled:opacity-50 disabled:cursor-not-allowed`,children:r?s.jsxs(s.Fragment,{children:[s.jsx(p0,{className:"animate-spin",size:16}),"发送中..."]}):s.jsxs(s.Fragment,{children:[s.jsx(rs,{size:16}),"发送测试邮件"]})})})]})]})},tg=({config:e,emailConfig:t,onChange:n,onEmailChange:r,onOpenChangePassword:l})=>{var c,u;const i=(d,m)=>{n({...e,[d]:m})},o=d=>{const m={...d,smtp:{...d.smtp,port:d.smtp.port||587}};r(m)},a={enabled:!1,smtp:{host:"",port:587,secure:!1,auth:{user:"",pass:""}},from:"",to:""};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"card p-6 relative z-[100]",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center",children:s.jsx(zl,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"WebUI 服务"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"WebUI 访问地址和端口配置,如果是 Docker 不建议更改此项,否则可能无法访问"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Il,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"监听地址"})]}),s.jsx(ss,{value:((c=e.webui)==null?void 0:c.host)??"127.0.0.1",onChange:d=>{var m,f;n({...e,webui:{enable:((m=e.webui)==null?void 0:m.enable)??!0,port:((f=e.webui)==null?void 0:f.port)||6099,host:d}})}}),s.jsx("p",{className:"text-xs text-theme-muted mt-2",children:"选择 WebUI 监听的网络地址"})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(zl,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"端口"})]}),s.jsx("input",{type:"number",value:((u=e.webui)==null?void 0:u.port)||6099,onChange:d=>{var m,f;return n({...e,webui:{enable:((m=e.webui)==null?void 0:m.enable)??!0,host:((f=e.webui)==null?void 0:f.host)||"127.0.0.1",port:parseInt(d.target.value)}})},min:"1",max:"65535",className:"input-field",placeholder:"6099"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"WebUI 服务端口(1-65535)"})]})]})]}),s.jsx(eg,{value:t||a,onChange:o}),s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl gradient-primary-br flex items-center justify-center",children:s.jsx(Il,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"系统功能"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"基础功能开关配置"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(u0,{size:20,className:"text-green-600"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"日志记录"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后记录详细的运行日志"})]})]}),s.jsx("input",{type:"checkbox",checked:e.log,onChange:d=>i("log",d.target.checked),className:"switch-toggle"})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(lh,{size:20,className:"text-pink-500"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"本地文件转URL"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后可将本地文件转换为URL链接"})]})]}),s.jsx("input",{type:"checkbox",checked:e.enableLocalFile2Url,onChange:d=>i("enableLocalFile2Url",d.target.checked),className:"switch-toggle"})]})]})]}),s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-orange-500 to-red-600 flex items-center justify-center",children:s.jsx(It,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"文件管理"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"自动清理文件相关配置"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(It,{size:20,className:"text-red-600"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"自动删除收到的文件"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后将自动清理接收的临时文件"})]})]}),s.jsx("input",{type:"checkbox",checked:e.autoDeleteFile,onChange:d=>i("autoDeleteFile",d.target.checked),className:"switch-toggle"})]}),e.autoDeleteFile&&s.jsx("div",{className:"pl-4",children:s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx($r,{size:16,className:"text-theme-secondary"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"自动删除时间(秒)"})]}),s.jsx("input",{type:"number",value:e.autoDeleteFileSecond,onChange:d=>i("autoDeleteFileSecond",parseInt(d.target.value)),min:"1",max:"3600",className:"input-field",placeholder:"60"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"文件接收后多少秒自动删除(1-3600秒)"})]})})]})]}),s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-pink-400 to-rose-500 flex items-center justify-center",children:s.jsx($r,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"缓存设置"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"消息缓存相关配置"})]})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx($r,{size:16,className:"text-pink-500"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"消息缓存过期时间"})]}),s.jsx(H0,{value:e.msgCacheExpire||120,onChange:d=>i("msgCacheExpire",d),maxDays:1,showSeconds:!1}),s.jsx("p",{className:"text-xs text-theme-muted mt-2",children:"消息在缓存中保留的时间,最长1天"})]})]}),s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-green-500 to-teal-600 flex items-center justify-center",children:s.jsx(gu,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"扩展功能"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"第三方服务配置"})]})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(gu,{size:16,className:"text-green-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"音乐签名地址"})]}),s.jsx("input",{type:"text",value:e.musicSignUrl,onChange:d=>i("musicSignUrl",d.target.value),placeholder:"https://example.com/sign",className:"input-field"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"用于音乐卡片签名的服务地址"})]})]}),s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-red-500 to-pink-600 flex items-center justify-center",children:s.jsx(ds,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"安全设置"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"WebUI 访问控制"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Pl,{size:20,className:"text-red-600"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"WebUI 访问密码"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"用于保护 WebUI 访问的密码"})]})]}),s.jsxs("button",{onClick:l,className:"px-4 py-2 gradient-primary text-white rounded-lg text-sm font-medium hover:shadow-lg transition-all flex items-center gap-2",children:[s.jsx(w0,{size:16}),"修改密码"]})]})]})]})};function vh(e,t){const n=e.trim();return n?t!==void 0&&n.length<t?{isValid:!1,error:`密码长度不能少于${t}位`}:/[\r\n]/.test(n)?{isValid:!1,error:"密码不能包含换行符!"}:/[^\x20-\x7E\t]/.test(n)?{isValid:!1,error:"密码不能包含中文等特殊字符!"}:/[\x00-\x08\x0A-\x1F\x7F]/.test(n)?{isValid:!1,error:"密码包含不可见的控制字符!"}:{isValid:!0}:{isValid:!1,error:"密码不能为空"}}const ng=({visible:e,onClose:t,onSuccess:n})=>{const[r,l]=p.useState(""),[i,o]=p.useState(""),[a,c]=p.useState(!1),[u,d]=p.useState(!1),[m,f]=p.useState(!1),[v,k]=p.useState(""),w=p.useRef(null);p.useEffect(()=>{e&&w.current&&setTimeout(()=>{var h;return(h=w.current)==null?void 0:h.focus()},100)},[e]),p.useEffect(()=>{e&&(l(""),o(""),c(!1),d(!1),k(""))},[e]);const j=async()=>{const h=vh(r,6);if(!h.isValid){k(h.error||"密码验证失败");return}if(r!==i){k("两次输入的密码不一致");return}f(!0),k("");try{const g=await Ne("/api/set-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r})});g.success?(Y("密码修改成功","success"),n(),t()):k(g.message||"密码修改失败")}catch(g){k(g.message||"密码修改失败")}finally{f(!1)}},x=h=>{h.key==="Enter"&&j()};return e?s.jsx(s.Fragment,{children:s.jsx("div",{className:"fixed inset-0 bg-black/30 backdrop-blur-sm flex items-center justify-center p-4",style:{zIndex:9e3},onClick:h=>h.target===h.currentTarget&&t(),children:s.jsxs("div",{className:"bg-white/90 dark:bg-neutral-800/90 backdrop-blur-xl rounded-3xl shadow-2xl w-full max-w-md transform transition-all",children:[s.jsxs("div",{className:"flex items-center gap-3 p-6 border-b border-white/20 dark:border-neutral-700/50",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-red-500 to-pink-600 flex items-center justify-center",children:s.jsx(Pl,{size:20,className:"text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-xl font-semibold text-theme",children:"修改 WebUI 密码"}),s.jsx("p",{className:"text-sm text-theme-secondary mt-0.5",children:"请输入新密码"})]}),s.jsx("button",{onClick:t,className:"text-theme-hint hover:text-theme transition-colors",children:s.jsx(ft,{size:24})})]}),s.jsxs("div",{className:"p-6 space-y-4",children:[v&&s.jsx("div",{className:"p-3 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-xl text-red-600 dark:text-red-400 text-sm",children:v}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"新密码"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{ref:w,type:a?"text":"password",value:r,onChange:h=>{l(h.target.value),k("")},onKeyPress:x,placeholder:"请输入新密码(支持数字、字母、符号)",className:"input-field pr-12",autoComplete:"new-password"}),s.jsx("button",{type:"button",onClick:()=>c(!a),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors",children:a?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"密码长度至少6位"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"确认密码"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:u?"text":"password",value:i,onChange:h=>{o(h.target.value),k("")},onKeyPress:x,placeholder:"请再次输入新密码",className:"input-field pr-12",autoComplete:"new-password"}),s.jsx("button",{type:"button",onClick:()=>d(!u),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors",children:u?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]})]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-white/20 dark:border-neutral-700/50",children:[s.jsx("button",{onClick:t,disabled:m,className:"px-6 py-2.5 text-theme-secondary hover:bg-theme-item rounded-lg font-medium transition-colors disabled:opacity-50",children:"取消"}),s.jsx("button",{onClick:j,disabled:m||!r.trim()||!i.trim(),className:"px-6 py-2.5 gradient-primary text-white rounded-lg font-medium hover:shadow-lg transition-all disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none",children:m?"修改中...":"确定修改"})]})]})})}):null},Us=({visible:e,onConfirm:t,onClose:n,error:r})=>{const[l,i]=p.useState(""),[o,a]=p.useState(!1),[c,u]=p.useState(""),d=p.useRef(null);p.useEffect(()=>{e&&d.current&&setTimeout(()=>{var v;return(v=d.current)==null?void 0:v.focus()},100)},[e]),p.useEffect(()=>{e&&(i(""),a(!1),u(""))},[e]);const m=()=>{const v=vh(l);if(!v.isValid){u(v.error||"密码验证失败");return}u(""),t(l.trim())},f=v=>{v.key==="Enter"&&m()};return p.useEffect(()=>{if(!e)return;const v=k=>{k.key==="Escape"&&(k.preventDefault(),k.stopPropagation())};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[e]),e?s.jsx(s.Fragment,{children:s.jsx("div",{className:"fixed inset-0 bg-black/30 dark:bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",style:{zIndex:9e3},onClick:v=>v.target===v.currentTarget&&(n==null?void 0:n()),children:s.jsxs("div",{className:"bg-white/90 dark:bg-neutral-800/90 backdrop-blur-xl rounded-3xl shadow-2xl w-full max-w-md transform transition-all",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-white/20 dark:border-neutral-700/50",children:[s.jsx("h3",{className:"text-xl font-semibold text-theme",children:r||"WebUI 密码"}),n&&s.jsx("button",{onClick:n,className:"text-theme-hint hover:text-theme transition-colors",children:s.jsx(ft,{size:24})})]}),s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"relative",children:[s.jsx("input",{ref:d,type:o?"text":"password",value:l,onChange:v=>{i(v.target.value),c&&u("")},onKeyPress:f,placeholder:"请输入密码(支持数字、字母、符号)",className:`w-full px-4 py-3 pr-12 border rounded-xl focus:outline-none focus:ring-2 transition-all bg-theme-input backdrop-blur-sm text-theme placeholder:text-theme-hint ${c?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-theme-input focus:ring-pink-500 focus:border-transparent"}`,autoComplete:"off"}),s.jsx("button",{type:"button",onClick:()=>a(!o),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors",children:o?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]}),c&&s.jsx("p",{className:"text-sm text-red-500 px-1",children:c})]})}),s.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-white/20 dark:border-neutral-700/50",children:[n&&s.jsx("button",{onClick:n,className:"px-6 py-2.5 text-theme-secondary hover:bg-theme-item rounded-lg font-medium transition-colors",children:"取消"}),s.jsx("button",{onClick:m,disabled:!l.trim(),className:"px-6 py-2.5 gradient-primary text-white rounded-lg font-medium hover:shadow-lg transition-all disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none",children:"确定"})]})]})})}):null},rg=({onLoginSuccess:e})=>{const[t,n]=p.useState("quick"),[r,l]=p.useState(!1),[i,o]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(""),[m,f]=p.useState([]),[v,k]=p.useState(null),w=p.useRef(null),j=p.useRef(null),x=p.useRef(null),h=p.useRef(!1),g=p.useRef(!1),y={scanning:"扫描成功,请在手机上确认",success:"登录成功",expired:"二维码已过期,请刷新",error:"登录失败,请重试","":""},N=p.useCallback(()=>{h.current=!1,x.current&&(clearTimeout(x.current),x.current=null)},[]),S=p.useCallback(async()=>{if(h.current)return;h.current=!0;const E=60;let _=0;const U=async()=>{if(_>=E){N(),Y("登录超时,请重试","error"),t==="qr"&&d("error");return}_++;try{const D=await Ne("/api/login-info");if(D.success&&D.data.online===!0){N(),Y("登录成功!正在跳转到主页面...","success"),t==="qr"&&d("success"),setTimeout(()=>e(),1e3);return}x.current=setTimeout(U,3e3)}catch{x.current=setTimeout(U,3e3)}};await U()},[t,e,N]),P=p.useCallback(E=>{if(!w.current)return;const U=w.current.getContext("2d");if(!U)return;const D=new Image;D.onload=()=>{U.clearRect(0,0,200,200),U.drawImage(D,0,0,200,200)},D.src=E},[]),T=p.useCallback(async()=>{if(w.current)try{const E=await Ne("/api/login-qrcode");if(E.success&&E.data){P(E.data.pngBase64QrcodeData);const _=E.data.expireTime*1e3;j.current&&clearInterval(j.current),j.current=setTimeout(()=>{c(!0),d("expired"),N()},_),c(!1),d(""),Y("请使用手机QQ扫码登录","warning"),await S()}else throw new Error(E.message||"获取二维码失败")}catch(E){Y(E.message||"获取二维码失败","error")}},[P,S,N]),O=p.useCallback(async()=>{await T(),Y("二维码已刷新","success")},[T]),R=p.useCallback(async()=>{if(!g.current){g.current=!0;try{const E=await Ne("/api/quick-login-list");if(E.success&&E.data&&E.data.LocalLoginInfoList){const _=E.data.LocalLoginInfoList.filter(U=>U.isQuickLogin&&!U.isUserLogin);f(_),_.length>0?k(U=>U??_[0]):n("qr")}else f([])}catch{Y("获取快速登录列表失败","error"),f([])}}},[]),V=p.useCallback(async()=>{if(v){o(!0);try{const _=(await Ne("/api/quick-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uin:v.uin})})).data;if(_.result==="0")Y(`正在登录 ${v.nickName}...`,"success"),await S();else throw new Error(_.loginErrorInfo.errMsg||"登录失败")}catch(E){Y(E.message,"error"),n("qr")}finally{o(!1)}}},[v,S]),C=()=>l(!r),b=E=>{k(E),l(!1)};return p.useEffect(()=>(g.current||R(),()=>{j.current&&clearInterval(j.current),N()}),[]),p.useEffect(()=>{t==="qr"?setTimeout(()=>T(),100):j.current&&clearInterval(j.current),t==="quick"&&m.length===0&&!g.current&&R()},[t,m.length,T]),s.jsx("div",{className:"relative min-h-screen flex flex-col items-center justify-center p-5",children:s.jsxs("div",{className:"bg-white/50 dark:bg-neutral-800/70 backdrop-blur-2xl rounded-3xl p-10 shadow-xl border border-white/30 dark:border-neutral-700/50 min-w-[320px] text-center relative z-10",children:[t==="quick"&&s.jsxs("div",{className:"flex flex-col items-center gap-6",children:[!r&&v&&s.jsxs("div",{className:"flex flex-col items-center cursor-pointer p-4 rounded-2xl transition-colors hover:bg-pink-50 dark:hover:bg-pink-900/30",onClick:C,children:[s.jsx("div",{className:"w-20 h-20 rounded-full overflow-hidden mb-3 shadow-lg",children:s.jsx("img",{src:v.faceUrl,alt:v.nickName,className:"w-full h-full object-cover"})}),s.jsx("div",{className:"text-base text-theme mb-2",children:v.nickName})]}),r&&s.jsx("div",{className:"grid grid-cols-2 gap-4 my-5 w-full max-w-md",children:m.map(E=>s.jsxs("div",{className:"flex flex-col items-center p-4 rounded-2xl cursor-pointer transition-all border-2 border-transparent hover:bg-pink-50 dark:hover:bg-pink-900/30 hover:border-pink-500",onClick:()=>b(E),children:[s.jsx("div",{className:"w-[60px] h-[60px] rounded-full overflow-hidden mb-2 shadow-md",children:s.jsx("img",{src:E.faceUrl,alt:E.nickName,className:"w-full h-full object-cover"})}),s.jsx("div",{className:"text-sm text-theme text-center truncate w-full px-1",children:E.nickName})]},E.uin))}),!r&&s.jsx("button",{onClick:V,disabled:!v||i,className:"w-[280px] h-11 gradient-primary text-white rounded-full font-medium text-base disabled:opacity-50 disabled:cursor-not-allowed hover:shadow-lg transition-all flex items-center justify-center gap-2",children:i?s.jsxs(s.Fragment,{children:[s.jsx(Se,{size:20,className:"animate-spin"}),"登录中..."]}):"登录"}),s.jsxs("div",{className:"flex gap-6 justify-center",children:[!r&&s.jsx("button",{onClick:C,className:"text-pink-500 text-sm hover:underline",children:"切换账号"}),s.jsx("button",{onClick:()=>n("qr"),className:"text-pink-500 text-sm hover:underline",children:"扫码登录"})]})]}),t==="qr"&&s.jsxs("div",{className:"flex flex-col items-center gap-5",children:[s.jsx("div",{className:"relative inline-block",children:s.jsxs("div",{className:"relative p-5 bg-white rounded-2xl shadow-lg",children:[s.jsx("canvas",{ref:w,width:"200",height:"200",className:"block rounded-lg"}),a&&s.jsxs("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center text-white cursor-pointer rounded-2xl transition-opacity hover:opacity-90",onClick:O,children:[s.jsx(oh,{size:32,className:"mb-2"}),s.jsx("div",{children:"点击刷新"})]})]})}),s.jsx("div",{className:"text-theme-secondary",children:"请使用手机QQ扫码登录"}),u&&s.jsx("div",{className:`text-sm px-4 py-2 rounded-lg ${u==="success"?"bg-green-100 text-green-800":u==="error"||u==="expired"?"bg-red-100 text-red-800":"bg-blue-100 text-blue-800"}`,children:y[u]})]}),s.jsx("div",{className:"mt-6",children:t==="qr"&&m.length>0&&s.jsx("button",{onClick:()=>n("quick"),className:"text-pink-500 text-sm hover:underline",children:"快速登录"})})]})})};let wh=null,kh=null;function jh(e,t){wh=e,kh=t}function cr(){return wh}function si(){return kh}function Rl(e){return`https://q1.qlogo.cn/g?b=qq&nk=${e}&s=640`}function ls(e){return`https://p.qlogo.cn/gh/${e}/${e}/640/`}async function Nh(){const e=await Ne("/api/login-info");if(!e.success)throw new Error(e.message||"获取登录信息失败");const t=e.data;return jh(t.uid,t.uin),t}async function _l(){const e=await re("ntFriendApi","getBuddyV2",[!0]),t=await re("ntFriendApi","getBuddyList",[]),n=new Map;for(const l of t)n.set(l.uid,l);const r=(e.data||[]).map(l=>{const i=(l.buddyUids||[]).map(o=>n.get(o)).filter(o=>o).map(o=>{var a,c,u,d;return{uid:o.uid,uin:o.uin,nickname:((a=o.coreInfo)==null?void 0:a.nick)||"",remark:((c=o.coreInfo)==null?void 0:c.remark)||"",avatar:Rl(o.uin),online:((u=o.status)==null?void 0:u.status)===10||!1,topTime:((d=o.relationFlags)==null?void 0:d.topTime)||"0"}});return{categoryId:l.categoryId,categoryName:l.categroyName||"我的好友",categorySort:l.categorySortId,onlineCount:l.onlineCount||0,memberCount:l.categroyMbCount||i.length,friends:i}});return r.sort((l,i)=>l.categorySort-i.categorySort),r}async function Al(){return(await re("ntGroupApi","getGroups",[!1])).map(t=>({groupCode:t.groupCode,groupName:t.groupName,remarkName:t.remarkName||"",avatar:ls(t.groupCode),memberCount:t.memberCount,isTop:t.isTop||!1,msgMask:t.cmdUinMsgMask||1}))}async function Wo(){const e=await re("ntUserApi","getRecentContactListSnapShot",[50]),[t,n]=await Promise.all([Al(),_l()]),r=new Map,l=[];t.forEach(c=>{c.msgMask!==2&&(r.set(`2_${c.groupCode}`,c.isTop),c.isTop&&l.push(c))});const i=[];n.forEach(c=>{c.friends.forEach(u=>{const d=!!u.topTime&&u.topTime!=="0";r.set(`1_${u.uin}`,d),d&&i.push(u)})});const o=new Set,a=e.info.changedList.filter(c=>{const u=c.peerUin||c.peerUid;return u&&u!=="0"&&u!==""}).map(c=>{const u=c.chatType,d=u===2,m=d?c.peerUin||c.peerUid:c.peerUin;o.add(`${u}_${m}`);const f=`${u}_${m}`,v=r.get(f)||!1;return{chatType:u,peerId:m,peerName:c.peerName||c.remark||c.peerUin,peerAvatar:d?ls(m):Rl(c.peerUin),lastMessage:sg(c.abstractContent),lastTime:parseInt(c.msgTime)*1e3,unreadCount:parseInt(c.unreadCnt)||0,pinned:v}}).filter(c=>{if(c.chatType===2){const u=t.find(d=>d.groupCode===c.peerId);if(u&&u.msgMask===2)return!1}return!0});return l.forEach(c=>{const u=`2_${c.groupCode}`;o.has(u)||a.push({chatType:2,peerId:c.groupCode,peerName:c.groupName,peerAvatar:ls(c.groupCode),lastMessage:"",lastTime:Date.now(),unreadCount:0,pinned:!0})}),i.forEach(c=>{const u=`1_${c.uin}`;o.has(u)||a.push({chatType:1,peerId:c.uin,peerName:c.remark||c.nickname,peerAvatar:Rl(c.uin),lastMessage:"",lastTime:Date.now(),unreadCount:0,pinned:!0})}),a.sort((c,u)=>c.pinned&&!u.pinned?-1:!c.pinned&&u.pinned?1:u.lastTime-c.lastTime),a}function sg(e){return!e||!Array.isArray(e)?"":e.map(t=>t.type===1?t.content||"":t.type===2?"[图片]":t.type===3?"[表情]":t.type===6?"[文件]":"").join("")}async function sl(e,t,n,r=20,l){const i=new URLSearchParams({chatType:String(e),peerId:t,limit:r.toString()});n&&i.append("beforeMsgSeq",n),l&&i.append("afterMsgSeq",l);const o=await Ne(`/api/webqq/messages?${i}`);if(!o.success)throw new Error(o.message||"获取消息历史失败");return o.data||{messages:[],hasMore:!1}}async function Ho(e){const t=await Ne("/api/webqq/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.success)throw new Error(t.message||"发送消息失败");return t.data||{msgId:""}}async function bh(e){const t=new FormData;t.append("image",e);const n=await Ne("/api/webqq/upload",{method:"POST",body:t});if(!n.success)throw new Error(n.message||"上传图片失败");return n.data}async function Sh(e){const t=await Ne("/api/webqq/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageUrl:e})});if(!t.success)throw new Error(t.message||"上传图片失败");return t.data}async function Ch(e){const t=new FormData;t.append("file",e);const n=await Ne("/api/webqq/upload-file",{method:"POST",body:t});if(!n.success)throw new Error(n.message||"上传文件失败");return n.data}async function lg(e){const t=await Ne(`/api/webqq/members?groupCode=${e}`);if(!t.success)throw new Error(t.message||"获取群成员失败");return t.data||[]}async function ig(e){const t=await Ne(`/api/webqq/user-info?uid=${encodeURIComponent(e)}`);if(!t.success)throw new Error(t.message||"获取用户信息失败");return t.data}async function re(e,t,n=[]){const r=await Ne(`/api/ntcall/${e}/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({args:n})});if(!r.success)throw new Error(r.message||"NT API 调用失败");return r.data}async function Eh(e,t,n,r){return await re("ntFileApi","getVideoUrl",[{chatType:e,peerUid:t,guildId:""},n,r])}async function Th(e,t,n){await re("ntMsgApi","recallMsg",[{chatType:e,peerUid:t,guildId:""},[n]])}async function Mh(e,t){var n,r;try{if(t){const i=await re("ntGroupApi","getGroupMember",[t,e,!1]);if(i)return i.cardName||i.nick||"未知用户"}const l=await re("ntUserApi","getUserSimpleInfo",[e,!1]);return((n=l==null?void 0:l.coreInfo)==null?void 0:n.remark)||((r=l==null?void 0:l.coreInfo)==null?void 0:r.nick)||"未知用户"}catch{return"未知用户"}}async function Fl(e,t,n){e===2&&n?await re("pmhq","sendGroupPoke",[Number(n),Number(t)]):await re("pmhq","sendFriendPoke",[Number(t)])}async function Ih(e,t,n,r){return await re("ntMsgApi","translatePtt2Text",[e,{chatType:t,peerUid:n,guildId:""},r])||""}async function Ph(e,t,n=!1){const r=await re("ntGroupApi","kickMember",[e,[t],n,""]);if((r==null?void 0:r.errCode)!==0)throw new Error((r==null?void 0:r.errMsg)||"踢出失败")}async function zh(e,t,n){await re("ntGroupApi","banMember",[e,[{uid:t,timeStamp:n}]])}async function Lh(e,t,n){await re("pmhq","setSpecialTitle",[parseInt(e),t,n])}function Rh(e,t,n){const r=ms();let l=`/api/webqq/audio-proxy?fileUuid=${encodeURIComponent(e)}&isGroup=${t}&token=${encodeURIComponent(r||"")}`;return n&&(l+=`&filePath=${encodeURIComponent(n)}`),l}async function _h(e){const t=await re("ntGroupApi","quitGroup",[e]);if((t==null?void 0:t.result)!==0)throw new Error((t==null?void 0:t.errMsg)||"退群失败")}async function $l(e,t,n){var v;let r=e;if(!r&&t&&(r=await re("ntUserApi","getUidByUin",[t])),!r)throw new Error("无法获取用户信息");const i=(await re("ntUserApi","fetchUserDetailInfo",[r])).detail[r];if(!i)throw new Error("用户不存在");let o=t||i.uin;o||(o=await re("ntUserApi","getUinByUid",[r]));const a=i.simpleInfo,c=a==null?void 0:a.coreInfo,u=a==null?void 0:a.baseInfo,d=i.commonExt;let m=((v=d==null?void 0:d.qqLevel)==null?void 0:v.level)||0;if(m===0&&o)try{m=await re("pmhq","fetchUserLevel",[parseInt(o)])}catch{}const f={uid:r,uin:o||"",nickname:(c==null?void 0:c.nick)||"",remark:(c==null?void 0:c.remark)||"",signature:(u==null?void 0:u.longNick)||"",sex:(u==null?void 0:u.sex)??0,birthday:u!=null&&u.birthday_year?`${u.birthday_year}-${u.birthday_month}-${u.birthday_day}`:"",location:"",qid:(u==null?void 0:u.qid)||"",level:m,regTime:(d==null?void 0:d.regTime)||void 0,avatar:`https://q1.qlogo.cn/g?b=qq&nk=${o}&s=640`};if(n)try{const k=await re("ntGroupApi","getGroupMember",[n,r,!1]);k&&(f.groupCard=k.cardName||"",f.groupRole=k.role===4?"owner":k.role===3?"admin":"member",f.groupTitle=k.memberSpecialTitle||"",f.groupLevel=k.memberRealLevel||k.memberLevel||0,f.joinTime=k.joinTime,f.lastSpeakTime=k.lastSpeakTime)}catch{}return f}function Ah(e,t,n){const r=ms(),l=r?`/api/webqq/events?token=${encodeURIComponent(r)}`:"/api/webqq/events";let i,o=0,a=null,c=!1;const u=()=>(i=new EventSource(l),i.addEventListener("message",m=>{try{const f=JSON.parse(m.data);e(f)}catch(f){console.error("解析 SSE 消息失败:",f)}}),i.addEventListener("connected",()=>{console.log("[SSE] 连接已建立"),o=0}),i.onopen=()=>{console.log("[SSE] 连接打开"),o>0&&(console.log("[SSE] 重连成功"),n==null||n()),o=0},i.onerror=m=>{if(console.error("[SSE] 连接错误:",m),c)return;i.close();const f=Math.min(1e3*Math.pow(2,o),3e4);o++,console.log(`[SSE] 将在 ${f}ms 后尝试第 ${o} 次重连...`),a=setTimeout(()=>{c||(console.log("[SSE] 正在重连..."),u())},f),t==null||t(m)},i);return i=u(),{close:()=>{c=!0,a&&(clearTimeout(a),a=null),i.close(),console.log("[SSE] 连接已关闭")},get readyState(){return i.readyState},get url(){return i.url},addEventListener:i.addEventListener.bind(i),removeEventListener:i.removeEventListener.bind(i),dispatchEvent:i.dispatchEvent.bind(i),onerror:i.onerror,onmessage:i.onmessage,onopen:i.onopen,CONNECTING:EventSource.CONNECTING,OPEN:EventSource.OPEN,CLOSED:EventSource.CLOSED,withCredentials:i.withCredentials}}function Fh(e,t){if(!t.trim())return e;const n=t.toLowerCase();return e.filter(r=>r.groupName.toLowerCase().includes(n)||r.groupCode.includes(t))}function $h(e,t){if(!t.trim())return e;const n=t.toLowerCase();return e.filter(r=>r.nickname.toLowerCase().includes(n)||r.card.toLowerCase().includes(n)||r.uin.includes(t))}function Uh(e){const t=e.toLowerCase().split(".").pop()||"";return["jpg","jpeg","png","gif"].includes(t)}function og(e){return!e||e.trim().length===0}async function Dh(e){var r,l,i;const t=await re("ntGroupApi","getGroupAllInfo",[e]);console.log("[WebQQ] 群资料:",{groupCode:t.groupCode,groupName:t.groupName,fingerMemo:t.fingerMemo,fingerMemoLength:(r=t.fingerMemo)==null?void 0:r.length,groupMemo:t.groupMemo,groupMemoLength:(l=t.groupMemo)==null?void 0:l.length,richFingerMemo:t.richFingerMemo});let n="";if(t.ownerUid)try{const o=await re("ntUserApi","getUinByUid",[t.ownerUid]),a=await re("ntUserApi","getUserSimpleInfo",[t.ownerUid,!1]);n=((i=a==null?void 0:a.coreInfo)==null?void 0:i.nick)||o||""}catch{}return{groupCode:t.groupCode,groupName:t.groupName,remarkName:t.remarkName||"",avatar:ls(t.groupCode),memberCount:t.memberNum,maxMemberCount:t.maxMemberNum,ownerUin:t.ownerUid?await re("ntUserApi","getUinByUid",[t.ownerUid]).catch(()=>""):"",ownerName:n,createTime:t.cmdUinJoinTime||void 0,description:t.richFingerMemo||t.fingerMemo||"",announcement:t.groupMemo||""}}function li(e){const t=new Date(e),n=new Date;if(t.toDateString()===n.toDateString())return t.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});const l=new Date(n);return l.setDate(l.getDate()-1),t.toDateString()===l.toDateString()?`昨天 ${t.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})}`:t.toLocaleDateString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}async function Oh(e){const t=await re("ntFriendApi","delBuddy",[e]);if((t==null?void 0:t.result)!==0)throw new Error((t==null?void 0:t.errMsg)||"删除好友失败")}async function ag(e,t,n){if(e===2){const r=await re("ntGroupApi","setTop",[t,n]);if((r==null?void 0:r.result)!==0)throw new Error((r==null?void 0:r.errMsg)||"设置置顶失败")}else{const r=await re("ntFriendApi","setTop",[t,n]);if((r==null?void 0:r.result)!==0)throw new Error((r==null?void 0:r.errMsg)||"设置置顶失败")}}var Ct=(e=>(e[e.AllowNotify=1]="AllowNotify",e[e.BoxNotNotify=2]="BoxNotNotify",e[e.NotAllow=3]="NotAllow",e[e.AllowNotNotify=4]="AllowNotNotify",e))(Ct||{});async function qh(e,t){const n=await re("ntGroupApi","setGroupMsgMask",[e,t]);if((n==null?void 0:n.result)!==0)throw new Error((n==null?void 0:n.errMsg)||"设置消息接收方式失败")}const Eu=Object.freeze(Object.defineProperty({__proto__:null,GroupMsgMask:Ct,createEventSource:Ah,deleteFriend:Oh,filterGroups:Fh,filterMembers:$h,formatMessageTime:li,getAudioProxyUrl:Rh,getFriends:_l,getGroupAvatar:ls,getGroupMembers:lg,getGroupProfile:Dh,getGroups:Al,getLoginInfo:Nh,getMessages:sl,getRecentChats:Wo,getSelfUid:cr,getSelfUin:si,getUserAvatar:Rl,getUserDisplayName:Mh,getUserInfo:ig,getUserProfile:$l,getVideoUrl:Eh,isEmptyMessage:og,isValidImageFormat:Uh,kickGroupMember:Ph,muteGroupMember:zh,ntCall:re,quitGroup:_h,recallMessage:Th,sendMessage:Ho,sendPoke:Fl,setGroupMsgMask:qh,setMemberTitle:Lh,setRecentChatTop:ag,setSelfInfo:jh,translatePttToText:Ih,uploadFile:Ch,uploadImage:bh,uploadImageByUrl:Sh},Symbol.toStringTag,{value:"Module"})),cg="modulepreload",ug=function(e){return"/"+e},Tu={},Mu=function(t,n,r){let l=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));l=Promise.allSettled(n.map(c=>{if(c=ug(c),c in Tu)return;Tu[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const m=document.createElement("link");if(m.rel=u?"stylesheet":cg,u||(m.as="script"),m.crossOrigin="",m.href=c,a&&m.setAttribute("nonce",a),document.head.appendChild(m),u)return new Promise((f,v)=>{m.addEventListener("load",f),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return l.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})},dg=60*60*1e3,Iu=30*60*1e3,Ds=new Map;let Ba=new Set,Va=new Set;const Pu=()=>{Ba=new Set,Va=new Set},Qa=(e,t)=>Ba.has(`${e}_${t}`),mg=(e,t)=>{Ba.add(`${e}_${t}`)},hg=e=>Va.has(e),fg=e=>{Va.add(e)},_e=qa()(Wa((e,t)=>({friendCategories:[],groups:[],recentChats:[],groupLastTimeMap:{},contactsLoading:!1,contactsError:null,currentChat:null,activeTab:"recent",groupAssistantMode:"normal",unreadCounts:{},expandedCategories:[],membersCache:{},showMemberPanel:!1,scrollPositions:{},contactsCacheTimestamp:0,setFriendCategories:n=>e({friendCategories:n}),setGroups:n=>e({groups:n}),setRecentChats:n=>e({recentChats:n}),setContactsLoading:n=>e({contactsLoading:n}),setContactsError:n=>e({contactsError:n}),setCurrentChat:n=>e({currentChat:n}),setActiveTab:n=>e({activeTab:n}),setGroupAssistantMode:n=>e({groupAssistantMode:n}),enterGroupAssistant:()=>e({groupAssistantMode:"assistant"}),exitGroupAssistant:()=>e({groupAssistantMode:"normal"}),setUnreadCount:(n,r)=>e(l=>({unreadCounts:{...l.unreadCounts,[n]:r}})),incrementUnreadCount:n=>e(r=>({unreadCounts:{...r.unreadCounts,[n]:(r.unreadCounts[n]||0)+1}})),clearUnreadCount:n=>e(r=>{const{[n]:l,...i}=r.unreadCounts;return{unreadCounts:i}}),initUnreadCounts:n=>{const r={};n.forEach(l=>{l.unreadCount>0&&(r[`${l.chatType}_${l.peerId}`]=l.unreadCount)}),e({unreadCounts:r})},toggleCategory:n=>e(r=>{const l=new Set(r.expandedCategories);return l.has(n)?l.delete(n):l.add(n),{expandedCategories:Array.from(l)}}),setExpandedCategories:n=>e({expandedCategories:n}),getCachedMembers:n=>{const l=t().membersCache[n];return l&&Date.now()-l.timestamp<Iu?l.members:null},setCachedMembers:(n,r)=>e(l=>{const i=Date.now(),o={};for(const[a,c]of Object.entries(l.membersCache))i-c.timestamp<Iu&&(o[a]=c);return{membersCache:{...o,[n]:{members:r,timestamp:i}}}}),fetchGroupMembers:async(n,r=!1)=>{const l=t();if(console.log("[Store] fetchGroupMembers called:",n,"forceRefresh:",r),!r){const a=l.getCachedMembers(n);if(a)return console.log("[Store] Cache hit, returning cached members"),a}const i=Ds.get(n);if(i)return console.log("[Store] Already loading, returning existing promise"),i;console.log("[Store] Fetching from API");const o=(async()=>{const{getGroupMembers:a}=await Mu(async()=>{const{getGroupMembers:u}=await Promise.resolve().then(()=>Eu);return{getGroupMembers:u}},void 0),c=await a(n);return console.log("[Store] API success, caching members"),t().setCachedMembers(n,c),Ds.delete(n),c})().catch(a=>{throw console.log("[Store] API error:",a.message),Ds.delete(n),a});return Ds.set(n,o),o},setShowMemberPanel:n=>e({showMemberPanel:n}),getScrollPosition:(n,r)=>{const l=t(),i=`${n}_${r}`;return l.scrollPositions[i]||null},setScrollPosition:(n,r,l)=>e(i=>({scrollPositions:{...i.scrollPositions,[`${n}_${r}`]:l}})),clearScrollPosition:(n,r)=>e(l=>{const{[`${n}_${r}`]:i,...o}=l.scrollPositions;return{scrollPositions:o}}),isContactsCacheValid:()=>{const n=t();return n.contactsCacheTimestamp>0&&Date.now()-n.contactsCacheTimestamp<dg&&(n.friendCategories.length>0||n.groups.length>0)},loadContacts:async()=>{const n=t();if(n.isContactsCacheValid()){n.refreshContacts();return}e({contactsLoading:!0,contactsError:null});try{const[r,l,i]=await Promise.all([_l(),Al(),Wo()]),o=i.filter(m=>m.peerId&&m.peerId!=="0"&&m.peerId!==""),a=new Map;n.recentChats.forEach(m=>{m.peerId&&m.peerId!=="0"&&m.peerId!==""&&a.set(`${m.chatType}_${m.peerId}`,m)}),o.forEach(m=>{const f=`${m.chatType}_${m.peerId}`,v=a.get(f);v?m.lastTime>v.lastTime&&a.set(f,m):a.set(f,m)});const c=Array.from(a.values()).sort((m,f)=>f.lastTime-m.lastTime);e({friendCategories:r,groups:l,recentChats:c,contactsCacheTimestamp:Date.now(),contactsLoading:!1});const d={...t().unreadCounts};o.forEach(m=>{const f=`${m.chatType}_${m.peerId}`;!(f in d)&&m.unreadCount>0&&(d[f]=m.unreadCount)}),e({unreadCounts:d})}catch(r){e({contactsError:r.message||"加载联系人失败",contactsLoading:!1})}},refreshContacts:async()=>{try{const[n,r,l]=await Promise.all([_l(),Al(),Wo()]),i=l.filter(m=>m.peerId&&m.peerId!=="0"&&m.peerId!==""),o=t(),a=new Map;o.recentChats.forEach(m=>{m.peerId&&m.peerId!=="0"&&m.peerId!==""&&a.set(`${m.chatType}_${m.peerId}`,m)}),i.forEach(m=>{const f=`${m.chatType}_${m.peerId}`,v=a.get(f);v?m.lastTime>v.lastTime&&a.set(f,m):a.set(f,m)});const c=Array.from(a.values()).sort((m,f)=>f.lastTime-m.lastTime);e({friendCategories:n,groups:r,recentChats:c,contactsCacheTimestamp:Date.now()});const d={...t().unreadCounts};i.forEach(m=>{const f=`${m.chatType}_${m.peerId}`;!(f in d)&&m.unreadCount>0&&(d[f]=m.unreadCount)}),e({unreadCounts:d})}catch(n){console.error("Failed to refresh contacts:",n)}},updateRecentChat:(n,r,l,i,o,a)=>e(c=>{const u=c.recentChats.filter((k,w,j)=>j.findIndex(x=>x.chatType===k.chatType&&x.peerId===k.peerId)===w),d=u.find(k=>k.chatType===n&&k.peerId===r),m=c.currentChat,f=(m==null?void 0:m.chatType)===n&&(m==null?void 0:m.peerId)===r,v=n===2?{...c.groupLastTimeMap,[r]:i}:c.groupLastTimeMap;if(d){const k=u.filter(h=>!(h.chatType===n&&h.peerId===r)),w={...d,lastMessage:l,lastTime:i,unreadCount:f?0:d.unreadCount+1};if(d.pinned){const h=k.filter(y=>y.pinned),g=k.filter(y=>!y.pinned);return{recentChats:[w,...h,...g],groupLastTimeMap:v}}const j=k.filter(h=>h.pinned),x=k.filter(h=>!h.pinned);return{recentChats:[...j,w,...x],groupLastTimeMap:v}}else{let k=o||r,w=a||"";if(n===1||n===100){for(const x of c.friendCategories){const h=x.friends.find(g=>g.uin===r);if(h){k=h.remark||h.nickname,w=h.avatar;break}}w||(w=`https://q1.qlogo.cn/g?b=qq&nk=${r}&s=640`)}else if(n===2){const x=c.groups.find(h=>h.groupCode===r);if(x){if(x.msgMask===2)return{groupLastTimeMap:v};k=x.groupName,w=x.avatar}w||(w=`https://p.qlogo.cn/gh/${r}/${r}/640/`)}return{recentChats:[{chatType:n,peerId:r,peerName:k,peerAvatar:w,lastMessage:l,lastTime:i,unreadCount:f?0:1},...u],groupLastTimeMap:v}}}),togglePinChat:async(n,r)=>{const i=t().recentChats.find(a=>a.chatType===n&&a.peerId===r);if(!i)return;const o=!i.pinned;try{const{setRecentChatTop:a}=await Mu(async()=>{const{setRecentChatTop:c}=await Promise.resolve().then(()=>Eu);return{setRecentChatTop:c}},void 0);await a(n,r,o),e(c=>{const u=c.recentChats.map(d=>d.chatType===n&&d.peerId===r?{...d,pinned:o}:d);return u.sort((d,m)=>d.pinned&&!m.pinned?-1:!d.pinned&&m.pinned?1:m.lastTime-d.lastTime),{recentChats:u}})}catch(a){throw console.error("设置置顶失败:",a),a}},removeRecentChat:(n,r)=>e(l=>({recentChats:l.recentChats.filter(i=>!(i.chatType===n&&i.peerId===r))})),removeFriend:n=>e(r=>({friendCategories:r.friendCategories.map(i=>({...i,friends:i.friends.filter(o=>o.uid!==n),memberCount:i.friends.filter(o=>o.uid!==n).length}))}))}),{name:"webqq-storage",partialize:e=>({friendCategories:e.friendCategories,groups:e.groups,recentChats:e.recentChats,groupLastTimeMap:e.groupLastTimeMap,expandedCategories:e.expandedCategories,membersCache:e.membersCache,showMemberPanel:e.showMemberPanel,scrollPositions:e.scrollPositions,contactsCacheTimestamp:e.contactsCacheTimestamp,unreadCounts:e.unreadCounts,activeTab:e.activeTab,currentChat:e.currentChat}),onRehydrateStorage:()=>e=>{if(e&&e.recentChats){const t=new Set;e.recentChats=e.recentChats.filter(n=>{if(!n.peerId||n.peerId==="0"||n.peerId==="")return!1;const r=`${n.chatType}_${n.peerId}`;return t.has(r)?!1:(t.add(r),!0)})}}}));function Ga(e,t,n){const[r,l]=p.useState({left:-9999,top:-9999,ready:!1});return p.useEffect(()=>{l({left:-9999,top:-9999,ready:!1});const i=requestAnimationFrame(()=>{if(!n.current){l({left:e,top:t,ready:!0});return}const o=n.current.getBoundingClientRect(),a=10;let c=e,u=t;e+o.width>window.innerWidth-a&&(c=e-o.width),c<a&&(c=a),t+o.height>window.innerHeight-a&&(u=t-o.height),u<a&&(u=a),l({left:c,top:u,ready:!0})});return()=>cancelAnimationFrame(i)},[e,t]),r}const Wh=({groupCode:e,onClose:t})=>{var u;const{groups:n,setGroups:r}=_e(),[l,i]=p.useState(!1),o=p.useRef(null),a=async d=>{try{await qh(e,d);const m=n.map(f=>f.groupCode===e?{...f,msgMask:d}:f);r(m)}catch(m){console.error("设置消息接收方式失败:",m),alert(`设置失败: ${m.message||"未知错误"}`)}t()},c=(u=n.find(d=>d.groupCode===e))==null?void 0:u.msgMask;return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onMouseEnter:()=>i(!0),className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-theme",children:[s.jsx(pu,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:"消息接收方式"}),s.jsx(ti,{size:14,className:"flex-shrink-0"})]}),l&&s.jsxs("div",{ref:o,className:"absolute left-full top-0 ml-1 bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[140px] z-[10000]",onMouseLeave:()=>i(!1),children:[s.jsxs("button",{onClick:()=>a(Ct.AllowNotify),className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-theme",children:[s.jsx(pu,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:"接收并提醒"}),c===Ct.AllowNotify&&s.jsx("span",{className:"flex-shrink-0 text-pink-500",children:"✓"})]}),s.jsxs("button",{onClick:()=>a(Ct.AllowNotNotify),className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-theme",children:[s.jsx(s0,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:"接收但不提醒"}),c===Ct.AllowNotNotify&&s.jsx("span",{className:"flex-shrink-0 text-pink-500",children:"✓"})]}),s.jsxs("button",{onClick:()=>a(Ct.BoxNotNotify),className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-theme",children:[s.jsx(e0,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:"收进群助手"}),c===Ct.BoxNotNotify&&s.jsx("span",{className:"flex-shrink-0 text-pink-500",children:"✓"})]}),s.jsxs("button",{onClick:()=>a(Ct.NotAllow),className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-theme",children:[s.jsx(r0,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:"屏蔽群消息"}),c===Ct.NotAllow&&s.jsx("span",{className:"flex-shrink-0 text-pink-500",children:"✓"})]})]})]})},pg=({friend:e,isSelected:t,onClick:n})=>{const{togglePinChat:r}=_e(),[l,i]=p.useState(null),o=p.useRef(null),a=Ga((l==null?void 0:l.x)||0,(l==null?void 0:l.y)||0,o),c=m=>{m.preventDefault(),m.stopPropagation(),i({x:m.clientX,y:m.clientY})},u=()=>i(null),d=async()=>{try{await r(1,e.uin)}catch(m){console.error("置顶失败:",m),alert(`置顶失败: ${m.message||"未知错误"}`)}u()};return p.useEffect(()=>{if(!l)return;const m=()=>u();return document.addEventListener("click",m),()=>document.removeEventListener("click",m)},[l]),s.jsxs(s.Fragment,{children:[s.jsxs("div",{onClick:n,onContextMenu:c,className:`flex items-center gap-3 px-3 py-2.5 cursor-pointer transition-colors ${t?"bg-pink-500/20":"hover:bg-theme-item-hover"}`,children:[s.jsxs("div",{className:"relative flex-shrink-0",children:[s.jsx("img",{src:e.avatar,alt:e.nickname,className:"w-10 h-10 rounded-full object-cover",onError:m=>{m.currentTarget.src=`https://q1.qlogo.cn/g?b=qq&nk=${e.uin}&s=640`}}),e.online&&s.jsx("div",{className:"absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white dark:border-neutral-800"})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-theme truncate",children:e.remark||e.nickname}),e.remark&&s.jsx("div",{className:"text-xs text-theme-hint truncate",children:e.nickname})]})]}),l&&Ie.createPortal(s.jsx("div",{ref:o,className:"fixed bg-white dark:bg-neutral-800 rounded-lg shadow-lg border border-neutral-200 dark:border-neutral-700 py-1 min-w-[120px] z-[9999]",style:{left:`${a.left}px`,top:`${a.top}px`,opacity:a.ready?1:0,pointerEvents:a.ready?"auto":"none"},onClick:m=>m.stopPropagation(),children:s.jsxs("button",{onClick:d,className:"w-full px-3 py-2 text-left text-sm hover:bg-neutral-100 dark:hover:bg-neutral-700 flex items-center gap-2 text-theme",children:[s.jsx(Oa,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:e.topTime&&e.topTime!=="0"?"取消置顶":"置顶"})]})}),document.body)]})},xg=({group:e,isSelected:t,onClick:n,showPinnedStyle:r=!1,unreadCount:l=0})=>{const{togglePinChat:i}=_e(),[o,a]=p.useState(null),c=p.useRef(null),u=Ga((o==null?void 0:o.x)||0,(o==null?void 0:o.y)||0,c),d=v=>{v.preventDefault(),v.stopPropagation(),a({x:v.clientX,y:v.clientY})},m=()=>{a(null)},f=async()=>{try{await i(2,e.groupCode)}catch(v){console.error("置顶失败:",v),alert(`置顶失败: ${v.message||"未知错误"}`)}m()};return p.useEffect(()=>{if(!o)return;const v=()=>m();return document.addEventListener("click",v),()=>document.removeEventListener("click",v)},[o]),s.jsxs(s.Fragment,{children:[s.jsxs("div",{onClick:n,onContextMenu:d,className:`flex items-center gap-3 px-3 py-2.5 cursor-pointer transition-colors ${t?"bg-pink-500/20":r&&e.isTop?"bg-theme-item-hover":"hover:bg-theme-item-hover"}`,children:[s.jsxs("div",{className:"relative flex-shrink-0",children:[s.jsx("img",{src:e.avatar,alt:e.groupName,className:"w-10 h-10 rounded-full object-cover",onError:v=>{v.currentTarget.src=`https://p.qlogo.cn/gh/${e.groupCode}/${e.groupCode}/640/`}}),l>0&&s.jsx("div",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] bg-red-500 text-white text-xs font-medium rounded-full flex items-center justify-center px-1",children:l})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-theme truncate",children:e.groupName}),s.jsxs("div",{className:"text-xs text-theme-hint",children:[e.memberCount," 人"]})]})]}),o&&Ie.createPortal(s.jsxs("div",{ref:c,className:"fixed bg-white dark:bg-neutral-800 rounded-lg shadow-lg border border-neutral-200 dark:border-neutral-700 py-1 min-w-[160px] z-[9999]",style:{left:`${u.left}px`,top:`${u.top}px`,opacity:u.ready?1:0,pointerEvents:u.ready?"auto":"none"},onClick:v=>v.stopPropagation(),children:[s.jsxs("button",{onClick:f,className:"w-full px-3 py-2 text-left text-sm hover:bg-neutral-100 dark:hover:bg-neutral-700 flex items-center gap-2 text-theme",children:[s.jsx(Oa,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:e.isTop?"取消置顶":"置顶"})]}),s.jsx(Wh,{groupCode:e.groupCode,onClose:m})]}),document.body)]})},gg=({activeTab:e,onTabChange:t,friendCategories:n,groups:r,recentChats:l,unreadCounts:i,selectedPeerId:o,onSelectFriend:a,onSelectGroup:c,onSelectRecent:u})=>{const[d,m]=p.useState(""),{groupAssistantMode:f,enterGroupAssistant:v,exitGroupAssistant:k}=_e(),w=_e(g=>g.groupLastTimeMap),j=p.useMemo(()=>{if(!d.trim())return n;const g=d.toLowerCase();return n.map(y=>({...y,friends:y.friends.filter(N=>N.nickname.toLowerCase().includes(g)||N.remark.toLowerCase().includes(g)||N.uin.includes(d))})).filter(y=>y.friends.length>0)},[n,d]),x=p.useMemo(()=>Fh(r,d),[r,d]),h=[{id:"recent",icon:$r,label:"最近"},{id:"friends",icon:ri,label:"好友"},{id:"groups",icon:Da,label:"群组"}];return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx("div",{className:"flex border-b border-theme-divider px-2 pt-2",children:h.map(g=>{const y=g.icon,N=e===g.id;return s.jsxs("button",{onClick:()=>t(g.id),className:`flex-1 flex items-center justify-center gap-1.5 py-2.5 text-sm font-medium transition-colors rounded-t-lg ${N?"text-pink-600 dark:text-pink-400 bg-pink-50/50 dark:bg-pink-900/30":"text-theme-muted hover:text-theme hover:bg-theme-item"}`,children:[s.jsx(y,{size:16}),g.label]},g.id)})}),e!=="recent"&&s.jsx("div",{className:"p-3",children:s.jsxs("div",{className:"relative",children:[s.jsx(ch,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-theme-hint"}),s.jsx("input",{type:"text",value:d,onChange:g=>m(g.target.value),placeholder:e==="friends"?"搜索好友...":"搜索群组...",className:"w-full pl-9 pr-3 py-2 text-sm bg-theme-input border border-theme-input rounded-lg focus:outline-none focus:ring-2 focus:ring-pink-500/20 focus:border-pink-500/50 text-theme placeholder:text-theme-hint"})]})}),s.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="recent"&&f==="normal"&&s.jsx(vg,{items:l,unreadCounts:i,selectedPeerId:o,onSelect:u,onEnterGroupAssistant:v}),e==="recent"&&f==="assistant"&&s.jsx(kg,{groups:r,groupLastTimeMap:w,unreadCounts:i,selectedPeerId:o,onSelect:c,onBack:k}),e==="friends"&&s.jsx(yg,{categories:j,selectedPeerId:o,onSelect:a}),e==="groups"&&s.jsx(Hh,{items:x,unreadCounts:i,groupLastTimeMap:w,selectedPeerId:o,onSelect:c})]})]})},yg=({categories:e,selectedPeerId:t,onSelect:n})=>{const{expandedCategories:r,toggleCategory:l}=_e(),i=p.useMemo(()=>new Set(r),[r]),o=p.useMemo(()=>e.map(a=>({...a,friends:[...a.friends].sort((c,u)=>{const d=!!(c.topTime&&c.topTime!=="0"),m=!!(u.topTime&&u.topTime!=="0");return d&&!m?-1:!d&&m?1:0})})),[e]);return o.length===0?s.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:"暂无好友"}):s.jsx("div",{className:"py-1",children:o.map(a=>{const c=i.has(a.categoryId);return s.jsxs("div",{children:[s.jsxs("div",{onClick:()=>l(a.categoryId),className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-theme-item-hover text-theme-secondary",children:[c?s.jsx(eh,{size:14}):s.jsx(ti,{size:14}),s.jsx("span",{className:"text-xs font-medium",children:a.categoryName}),s.jsxs("span",{className:"text-xs text-theme-hint",children:[a.onlineCount,"/",a.memberCount]})]}),c&&a.friends.map(u=>s.jsx(pg,{friend:u,isSelected:t===u.uin,onClick:()=>n(u)},u.uid))]},a.categoryId)})})},Hh=({items:e,unreadCounts:t,selectedPeerId:n,onSelect:r,groupLastTimeMap:l,showPinnedStyle:i=!1})=>{const o=p.useMemo(()=>[...e].sort((c,u)=>{if(c.isTop&&!u.isTop)return-1;if(!c.isTop&&u.isTop)return 1;if(l){const d=l[c.groupCode]||0,m=l[u.groupCode]||0;if(d!==m)return m-d}return 0}),[e,l]);return o.length===0?s.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:"暂无群组"}):s.jsx("div",{className:"py-1",children:o.map(a=>{const c=t.get(`2_${a.groupCode}`)||0;return s.jsx(xg,{group:a,isSelected:n===a.groupCode,onClick:()=>r(a),showPinnedStyle:i,unreadCount:c},a.groupCode)})})},vg=({items:e,unreadCounts:t,selectedPeerId:n,onSelect:r,onEnterGroupAssistant:l})=>{const{togglePinChat:i,removeRecentChat:o,friendCategories:a,groups:c}=_e(),[u,d]=p.useState(null),m=p.useRef(null),f=Ga((u==null?void 0:u.x)||0,(u==null?void 0:u.y)||0,m),v=p.useMemo(()=>{const y=c.filter(S=>S.msgMask===2);let N=0;return y.forEach(S=>{const P=t.get(`2_${S.groupCode}`)||0;N+=P}),N},[c,t]),k=p.useMemo(()=>c.filter(y=>y.msgMask===2).length,[c]),w=y=>{if(y.chatType===2){const N=c.find(S=>S.groupCode===y.peerId);if(N!=null&&N.remarkName&&N.remarkName!==N.groupName)return N.remarkName}else if(y.chatType===1||y.chatType===100)for(const N of a){const S=N.friends.find(P=>P.uin===y.peerId);if(S!=null&&S.remark&&S.remark!==S.nickname)return S.remark}return y.peerName},j=(y,N)=>{y.preventDefault(),d({x:y.clientX,y:y.clientY,item:N})},x=()=>{d(null)},h=async()=>{if(u){try{await i(u.item.chatType,u.item.peerId)}catch(y){console.error("置顶失败:",y),alert(`置顶失败: ${y.message||"未知错误"}`)}x()}},g=()=>{u&&(o(u.item.chatType,u.item.peerId),x())};return e.length===0?s.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:"暂无最近会话"}):s.jsxs("div",{className:"py-1",onClick:x,children:[k>0&&s.jsxs("div",{onClick:l,className:"flex items-center gap-3 px-3 py-2.5 cursor-pointer transition-colors hover:bg-theme-item-hover",children:[s.jsxs("div",{className:"relative flex-shrink-0",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-blue-400 to-blue-600 flex items-center justify-center",children:s.jsx(Da,{size:20,className:"text-white"})}),v>0&&s.jsx("div",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] bg-red-500 text-white text-xs font-medium rounded-full flex items-center justify-center px-1",children:v})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsx("span",{className:"text-sm font-medium text-theme",children:"群助手"})}),s.jsxs("div",{className:"text-xs text-theme-hint truncate mt-0.5",children:[k," 个群聊"]})]})]}),e.map(y=>s.jsx(wg,{item:y,displayName:w(y),unreadCount:t.get(`${y.chatType}_${y.peerId}`)||y.unreadCount,isSelected:n===y.peerId,onClick:()=>r(y),onContextMenu:N=>j(N,y)},`${y.chatType}_${y.peerId}`)),u&&Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40",onClick:x,onContextMenu:y=>{y.preventDefault(),x()}}),s.jsxs("div",{ref:m,className:"fixed z-50 bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[160px]",style:{left:f.left,top:f.top,visibility:f.ready?"visible":"hidden"},onContextMenu:y=>y.preventDefault(),children:[s.jsxs("button",{onClick:h,className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-theme",children:[s.jsx(Oa,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:u.item.pinned?"取消置顶":"置顶"})]}),u.item.chatType===2&&s.jsx(Wh,{groupCode:u.item.peerId,onClose:x}),s.jsxs("button",{onClick:g,className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-red-500",children:[s.jsx(It,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:"删除"})]})]})]}),document.body)]})},wg=({item:e,displayName:t,unreadCount:n,isSelected:r,onClick:l,onContextMenu:i})=>s.jsxs("div",{onClick:l,onContextMenu:i,className:`flex items-center gap-3 px-3 py-2.5 cursor-pointer transition-colors ${r?"bg-pink-500/20":e.pinned?"bg-theme-item-hover":"hover:bg-theme-item-hover"}`,children:[s.jsxs("div",{className:"relative flex-shrink-0",children:[s.jsx("img",{src:e.peerAvatar,alt:t,className:"w-10 h-10 rounded-full object-cover"}),n>0&&s.jsx("div",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] bg-red-500 text-white text-xs font-medium rounded-full flex items-center justify-center px-1",children:n})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-theme truncate",children:t}),s.jsx("span",{className:"text-xs text-theme-hint flex-shrink-0 ml-2",children:li(e.lastTime)})]}),s.jsx("div",{className:"text-xs text-theme-hint truncate mt-0.5",children:e.lastMessage})]})]}),kg=({groups:e,groupLastTimeMap:t,unreadCounts:n,selectedPeerId:r,onSelect:l,onBack:i})=>{const o=p.useMemo(()=>e.filter(a=>a.msgMask===2),[e]);return s.jsxs("div",{className:"py-1",children:[s.jsxs("div",{onClick:i,className:"flex items-center gap-3 px-3 py-2.5 cursor-pointer transition-colors hover:bg-theme-item-hover border-b border-theme-divider",children:[s.jsx(ti,{size:16,className:"transform rotate-180 text-theme-secondary"}),s.jsx("span",{className:"text-sm font-medium text-theme",children:"返回最近会话"})]}),s.jsxs("div",{className:"px-3 py-2 text-xs text-theme-hint",children:["群助手 (",o.length,")"]}),o.length===0?s.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:"暂无群聊"}):s.jsx(Hh,{items:o,unreadCounts:n,groupLastTimeMap:t,selectedPeerId:r,onSelect:l,showPinnedStyle:!0})]})};function zn(e,t,n){let r=n.initialDeps??[],l,i=!0;function o(){var a,c,u;let d;n.key&&((a=n.debug)!=null&&a.call(n))&&(d=Date.now());const m=e();if(!(m.length!==r.length||m.some((k,w)=>r[w]!==k)))return l;r=m;let v;if(n.key&&((c=n.debug)!=null&&c.call(n))&&(v=Date.now()),l=t(...m),n.key&&((u=n.debug)!=null&&u.call(n))){const k=Math.round((Date.now()-d)*100)/100,w=Math.round((Date.now()-v)*100)/100,j=w/16,x=(h,g)=>{for(h=String(h);h.length<g;)h=" "+h;return h};console.info(`%c⏱ ${x(w,5)} /${x(k,5)} ms`,`
|
|
436
|
+
disabled:opacity-50 disabled:cursor-not-allowed`,children:r?s.jsxs(s.Fragment,{children:[s.jsx(p0,{className:"animate-spin",size:16}),"发送中..."]}):s.jsxs(s.Fragment,{children:[s.jsx(ss,{size:16}),"发送测试邮件"]})})})]})]})},tg=({config:e,emailConfig:t,onChange:n,onEmailChange:r,onOpenChangePassword:l})=>{var c,u;const i=(d,m)=>{n({...e,[d]:m})},o=d=>{const m={...d,smtp:{...d.smtp,port:d.smtp.port||587}};r(m)},a={enabled:!1,smtp:{host:"",port:587,secure:!1,auth:{user:"",pass:""}},from:"",to:""};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"card p-6 relative z-[100]",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center",children:s.jsx(Ll,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"WebUI 服务"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"WebUI 访问地址和端口配置,如果是 Docker 不建议更改此项,否则可能无法访问"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Pl,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"监听地址"})]}),s.jsx(ls,{value:((c=e.webui)==null?void 0:c.host)??"127.0.0.1",onChange:d=>{var m,f;n({...e,webui:{enable:((m=e.webui)==null?void 0:m.enable)??!0,port:((f=e.webui)==null?void 0:f.port)||6099,host:d}})}}),s.jsx("p",{className:"text-xs text-theme-muted mt-2",children:"选择 WebUI 监听的网络地址"})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Ll,{size:16,className:"text-blue-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"端口"})]}),s.jsx("input",{type:"number",value:((u=e.webui)==null?void 0:u.port)||6099,onChange:d=>{var m,f;return n({...e,webui:{enable:((m=e.webui)==null?void 0:m.enable)??!0,host:((f=e.webui)==null?void 0:f.host)||"127.0.0.1",port:parseInt(d.target.value)}})},min:"1",max:"65535",className:"input-field",placeholder:"6099"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"WebUI 服务端口(1-65535)"})]})]})]}),s.jsx(eg,{value:t||a,onChange:o}),s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl gradient-primary-br flex items-center justify-center",children:s.jsx(Pl,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"系统功能"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"基础功能开关配置"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(u0,{size:20,className:"text-green-600"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"日志记录"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后记录详细的运行日志"})]})]}),s.jsx("input",{type:"checkbox",checked:e.log,onChange:d=>i("log",d.target.checked),className:"switch-toggle"})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(lh,{size:20,className:"text-pink-500"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"本地文件转URL"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后可将本地文件转换为URL链接"})]})]}),s.jsx("input",{type:"checkbox",checked:e.enableLocalFile2Url,onChange:d=>i("enableLocalFile2Url",d.target.checked),className:"switch-toggle"})]})]})]}),s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-orange-500 to-red-600 flex items-center justify-center",children:s.jsx(It,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"文件管理"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"自动清理文件相关配置"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(It,{size:20,className:"text-red-600"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"自动删除收到的文件"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后将自动清理接收的临时文件"})]})]}),s.jsx("input",{type:"checkbox",checked:e.autoDeleteFile,onChange:d=>i("autoDeleteFile",d.target.checked),className:"switch-toggle"})]}),e.autoDeleteFile&&s.jsx("div",{className:"pl-4",children:s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Ur,{size:16,className:"text-theme-secondary"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"自动删除时间(秒)"})]}),s.jsx("input",{type:"number",value:e.autoDeleteFileSecond,onChange:d=>i("autoDeleteFileSecond",parseInt(d.target.value)),min:"1",max:"3600",className:"input-field",placeholder:"60"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"文件接收后多少秒自动删除(1-3600秒)"})]})})]})]}),s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-pink-400 to-rose-500 flex items-center justify-center",children:s.jsx(Ur,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"缓存设置"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"消息缓存相关配置"})]})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Ur,{size:16,className:"text-pink-500"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"消息缓存过期时间"})]}),s.jsx(H0,{value:e.msgCacheExpire||120,onChange:d=>i("msgCacheExpire",d),maxDays:1,showSeconds:!1}),s.jsx("p",{className:"text-xs text-theme-muted mt-2",children:"消息在缓存中保留的时间,最长1天"})]})]}),s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-green-500 to-teal-600 flex items-center justify-center",children:s.jsx(gu,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"扩展功能"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"第三方服务配置"})]})]}),s.jsxs("label",{className:"block",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(gu,{size:16,className:"text-green-600"}),s.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"音乐签名地址"})]}),s.jsx("input",{type:"text",value:e.musicSignUrl,onChange:d=>i("musicSignUrl",d.target.value),placeholder:"https://example.com/sign",className:"input-field"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"用于音乐卡片签名的服务地址"})]})]}),s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-red-500 to-pink-600 flex items-center justify-center",children:s.jsx(ms,{size:20,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"安全设置"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"WebUI 访问控制"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(zl,{size:20,className:"text-red-600"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"WebUI 访问密码"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"用于保护 WebUI 访问的密码"})]})]}),s.jsxs("button",{onClick:l,className:"px-4 py-2 gradient-primary text-white rounded-lg text-sm font-medium hover:shadow-lg transition-all flex items-center gap-2",children:[s.jsx(w0,{size:16}),"修改密码"]})]})]})]})};function vh(e,t){const n=e.trim();return n?t!==void 0&&n.length<t?{isValid:!1,error:`密码长度不能少于${t}位`}:/[\r\n]/.test(n)?{isValid:!1,error:"密码不能包含换行符!"}:/[^\x20-\x7E\t]/.test(n)?{isValid:!1,error:"密码不能包含中文等特殊字符!"}:/[\x00-\x08\x0A-\x1F\x7F]/.test(n)?{isValid:!1,error:"密码包含不可见的控制字符!"}:{isValid:!0}:{isValid:!1,error:"密码不能为空"}}const ng=({visible:e,onClose:t,onSuccess:n})=>{const[r,l]=p.useState(""),[i,o]=p.useState(""),[a,c]=p.useState(!1),[u,d]=p.useState(!1),[m,f]=p.useState(!1),[y,w]=p.useState(""),k=p.useRef(null);p.useEffect(()=>{e&&k.current&&setTimeout(()=>{var h;return(h=k.current)==null?void 0:h.focus()},100)},[e]),p.useEffect(()=>{e&&(l(""),o(""),c(!1),d(!1),w(""))},[e]);const j=async()=>{const h=vh(r,6);if(!h.isValid){w(h.error||"密码验证失败");return}if(r!==i){w("两次输入的密码不一致");return}f(!0),w("");try{const x=await je("/api/set-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r})});x.success?(Y("密码修改成功","success"),n(),t()):w(x.message||"密码修改失败")}catch(x){w(x.message||"密码修改失败")}finally{f(!1)}},g=h=>{h.key==="Enter"&&j()};return e?s.jsx(s.Fragment,{children:s.jsx("div",{className:"fixed inset-0 bg-black/30 backdrop-blur-sm flex items-center justify-center p-4",style:{zIndex:9e3},onClick:h=>h.target===h.currentTarget&&t(),children:s.jsxs("div",{className:"bg-white/90 dark:bg-neutral-800/90 backdrop-blur-xl rounded-3xl shadow-2xl w-full max-w-md transform transition-all",children:[s.jsxs("div",{className:"flex items-center gap-3 p-6 border-b border-white/20 dark:border-neutral-700/50",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-red-500 to-pink-600 flex items-center justify-center",children:s.jsx(zl,{size:20,className:"text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-xl font-semibold text-theme",children:"修改 WebUI 密码"}),s.jsx("p",{className:"text-sm text-theme-secondary mt-0.5",children:"请输入新密码"})]}),s.jsx("button",{onClick:t,className:"text-theme-hint hover:text-theme transition-colors",children:s.jsx(ht,{size:24})})]}),s.jsxs("div",{className:"p-6 space-y-4",children:[y&&s.jsx("div",{className:"p-3 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-xl text-red-600 dark:text-red-400 text-sm",children:y}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"新密码"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{ref:k,type:a?"text":"password",value:r,onChange:h=>{l(h.target.value),w("")},onKeyPress:g,placeholder:"请输入新密码(支持数字、字母、符号)",className:"input-field pr-12",autoComplete:"new-password"}),s.jsx("button",{type:"button",onClick:()=>c(!a),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors",children:a?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"密码长度至少6位"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"确认密码"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:u?"text":"password",value:i,onChange:h=>{o(h.target.value),w("")},onKeyPress:g,placeholder:"请再次输入新密码",className:"input-field pr-12",autoComplete:"new-password"}),s.jsx("button",{type:"button",onClick:()=>d(!u),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors",children:u?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]})]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-white/20 dark:border-neutral-700/50",children:[s.jsx("button",{onClick:t,disabled:m,className:"px-6 py-2.5 text-theme-secondary hover:bg-theme-item rounded-lg font-medium transition-colors disabled:opacity-50",children:"取消"}),s.jsx("button",{onClick:j,disabled:m||!r.trim()||!i.trim(),className:"px-6 py-2.5 gradient-primary text-white rounded-lg font-medium hover:shadow-lg transition-all disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none",children:m?"修改中...":"确定修改"})]})]})})}):null},Ds=({visible:e,onConfirm:t,onClose:n,error:r})=>{const[l,i]=p.useState(""),[o,a]=p.useState(!1),[c,u]=p.useState(""),d=p.useRef(null);p.useEffect(()=>{e&&d.current&&setTimeout(()=>{var y;return(y=d.current)==null?void 0:y.focus()},100)},[e]),p.useEffect(()=>{e&&(i(""),a(!1),u(""))},[e]);const m=()=>{const y=vh(l);if(!y.isValid){u(y.error||"密码验证失败");return}u(""),t(l.trim())},f=y=>{y.key==="Enter"&&m()};return p.useEffect(()=>{if(!e)return;const y=w=>{w.key==="Escape"&&(w.preventDefault(),w.stopPropagation())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[e]),e?s.jsx(s.Fragment,{children:s.jsx("div",{className:"fixed inset-0 bg-black/30 dark:bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",style:{zIndex:9e3},onClick:y=>y.target===y.currentTarget&&(n==null?void 0:n()),children:s.jsxs("div",{className:"bg-white/90 dark:bg-neutral-800/90 backdrop-blur-xl rounded-3xl shadow-2xl w-full max-w-md transform transition-all",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-white/20 dark:border-neutral-700/50",children:[s.jsx("h3",{className:"text-xl font-semibold text-theme",children:r||"WebUI 密码"}),n&&s.jsx("button",{onClick:n,className:"text-theme-hint hover:text-theme transition-colors",children:s.jsx(ht,{size:24})})]}),s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"relative",children:[s.jsx("input",{ref:d,type:o?"text":"password",value:l,onChange:y=>{i(y.target.value),c&&u("")},onKeyPress:f,placeholder:"请输入密码(支持数字、字母、符号)",className:`w-full px-4 py-3 pr-12 border rounded-xl focus:outline-none focus:ring-2 transition-all bg-theme-input backdrop-blur-sm text-theme placeholder:text-theme-hint ${c?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-theme-input focus:ring-pink-500 focus:border-transparent"}`,autoComplete:"off"}),s.jsx("button",{type:"button",onClick:()=>a(!o),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors",children:o?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]}),c&&s.jsx("p",{className:"text-sm text-red-500 px-1",children:c})]})}),s.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-white/20 dark:border-neutral-700/50",children:[n&&s.jsx("button",{onClick:n,className:"px-6 py-2.5 text-theme-secondary hover:bg-theme-item rounded-lg font-medium transition-colors",children:"取消"}),s.jsx("button",{onClick:m,disabled:!l.trim(),className:"px-6 py-2.5 gradient-primary text-white rounded-lg font-medium hover:shadow-lg transition-all disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none",children:"确定"})]})]})})}):null},rg=({onLoginSuccess:e})=>{const[t,n]=p.useState("quick"),[r,l]=p.useState(!1),[i,o]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(""),[m,f]=p.useState([]),[y,w]=p.useState(null),k=p.useRef(null),j=p.useRef(null),g=p.useRef(null),h=p.useRef(!1),x=p.useRef(!1),v={scanning:"扫描成功,请在手机上确认",success:"登录成功",expired:"二维码已过期,请刷新",error:"登录失败,请重试","":""},N=p.useCallback(()=>{h.current=!1,g.current&&(clearTimeout(g.current),g.current=null)},[]),S=p.useCallback(async()=>{if(h.current)return;h.current=!0;const E=60;let _=0;const U=async()=>{if(_>=E){N(),Y("登录超时,请重试","error"),t==="qr"&&d("error");return}_++;try{const D=await je("/api/login-info");if(D.success&&D.data.online===!0){N(),Y("登录成功!正在跳转到主页面...","success"),t==="qr"&&d("success"),setTimeout(()=>e(),1e3);return}g.current=setTimeout(U,3e3)}catch{g.current=setTimeout(U,3e3)}};await U()},[t,e,N]),T=p.useCallback(E=>{if(!k.current)return;const U=k.current.getContext("2d");if(!U)return;const D=new Image;D.onload=()=>{U.clearRect(0,0,200,200),U.drawImage(D,0,0,200,200)},D.src=E},[]),M=p.useCallback(async()=>{if(k.current)try{const E=await je("/api/login-qrcode");if(E.success&&E.data){T(E.data.pngBase64QrcodeData);const _=E.data.expireTime*1e3;j.current&&clearInterval(j.current),j.current=setTimeout(()=>{c(!0),d("expired"),N()},_),c(!1),d(""),Y("请使用手机QQ扫码登录","warning"),await S()}else throw new Error(E.message||"获取二维码失败")}catch(E){Y(E.message||"获取二维码失败","error")}},[T,S,N]),q=p.useCallback(async()=>{await M(),Y("二维码已刷新","success")},[M]),R=p.useCallback(async()=>{if(!x.current){x.current=!0;try{const E=await je("/api/quick-login-list");if(E.success&&E.data&&E.data.LocalLoginInfoList){const _=E.data.LocalLoginInfoList.filter(U=>U.isQuickLogin&&!U.isUserLogin);f(_),_.length>0?w(U=>U??_[0]):n("qr")}else f([])}catch{Y("获取快速登录列表失败","error"),f([])}}},[]),V=p.useCallback(async()=>{if(y){o(!0);try{const _=(await je("/api/quick-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uin:y.uin})})).data;if(_.result==="0")Y(`正在登录 ${y.nickName}...`,"success"),await S();else throw new Error(_.loginErrorInfo.errMsg||"登录失败")}catch(E){Y(E.message,"error"),n("qr")}finally{o(!1)}}},[y,S]),C=()=>l(!r),b=E=>{w(E),l(!1)};return p.useEffect(()=>(x.current||R(),()=>{j.current&&clearInterval(j.current),N()}),[]),p.useEffect(()=>{t==="qr"?setTimeout(()=>M(),100):j.current&&clearInterval(j.current),t==="quick"&&m.length===0&&!x.current&&R()},[t,m.length,M]),s.jsx("div",{className:"relative min-h-screen flex flex-col items-center justify-center p-5",children:s.jsxs("div",{className:"bg-white/50 dark:bg-neutral-800/70 backdrop-blur-2xl rounded-3xl p-10 shadow-xl border border-white/30 dark:border-neutral-700/50 min-w-[320px] text-center relative z-10",children:[t==="quick"&&s.jsxs("div",{className:"flex flex-col items-center gap-6",children:[!r&&y&&s.jsxs("div",{className:"flex flex-col items-center cursor-pointer p-4 rounded-2xl transition-colors hover:bg-pink-50 dark:hover:bg-pink-900/30",onClick:C,children:[s.jsx("div",{className:"w-20 h-20 rounded-full overflow-hidden mb-3 shadow-lg",children:s.jsx("img",{src:y.faceUrl,alt:y.nickName,className:"w-full h-full object-cover"})}),s.jsx("div",{className:"text-base text-theme mb-2",children:y.nickName})]}),r&&s.jsx("div",{className:"grid grid-cols-2 gap-4 my-5 w-full max-w-md",children:m.map(E=>s.jsxs("div",{className:"flex flex-col items-center p-4 rounded-2xl cursor-pointer transition-all border-2 border-transparent hover:bg-pink-50 dark:hover:bg-pink-900/30 hover:border-pink-500",onClick:()=>b(E),children:[s.jsx("div",{className:"w-[60px] h-[60px] rounded-full overflow-hidden mb-2 shadow-md",children:s.jsx("img",{src:E.faceUrl,alt:E.nickName,className:"w-full h-full object-cover"})}),s.jsx("div",{className:"text-sm text-theme text-center truncate w-full px-1",children:E.nickName})]},E.uin))}),!r&&s.jsx("button",{onClick:V,disabled:!y||i,className:"w-[280px] h-11 gradient-primary text-white rounded-full font-medium text-base disabled:opacity-50 disabled:cursor-not-allowed hover:shadow-lg transition-all flex items-center justify-center gap-2",children:i?s.jsxs(s.Fragment,{children:[s.jsx(Se,{size:20,className:"animate-spin"}),"登录中..."]}):"登录"}),s.jsxs("div",{className:"flex gap-6 justify-center",children:[!r&&s.jsx("button",{onClick:C,className:"text-pink-500 text-sm hover:underline",children:"切换账号"}),s.jsx("button",{onClick:()=>n("qr"),className:"text-pink-500 text-sm hover:underline",children:"扫码登录"})]})]}),t==="qr"&&s.jsxs("div",{className:"flex flex-col items-center gap-5",children:[s.jsx("div",{className:"relative inline-block",children:s.jsxs("div",{className:"relative p-5 bg-white rounded-2xl shadow-lg",children:[s.jsx("canvas",{ref:k,width:"200",height:"200",className:"block rounded-lg"}),a&&s.jsxs("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center text-white cursor-pointer rounded-2xl transition-opacity hover:opacity-90",onClick:q,children:[s.jsx(oh,{size:32,className:"mb-2"}),s.jsx("div",{children:"点击刷新"})]})]})}),s.jsx("div",{className:"text-theme-secondary",children:"请使用手机QQ扫码登录"}),u&&s.jsx("div",{className:`text-sm px-4 py-2 rounded-lg ${u==="success"?"bg-green-100 text-green-800":u==="error"||u==="expired"?"bg-red-100 text-red-800":"bg-blue-100 text-blue-800"}`,children:v[u]})]}),s.jsx("div",{className:"mt-6",children:t==="qr"&&m.length>0&&s.jsx("button",{onClick:()=>n("quick"),className:"text-pink-500 text-sm hover:underline",children:"快速登录"})})]})})};let wh=null,kh=null;function jh(e,t){wh=e,kh=t}function cr(){return wh}function li(){return kh}function _l(e){return`https://q1.qlogo.cn/g?b=qq&nk=${e}&s=640`}function is(e){return`https://p.qlogo.cn/gh/${e}/${e}/640/`}async function Nh(){const e=await je("/api/login-info");if(!e.success)throw new Error(e.message||"获取登录信息失败");const t=e.data;return jh(t.uid,t.uin),t}async function Al(){const e=await te("ntFriendApi","getBuddyV2",[!0]),t=await te("ntFriendApi","getBuddyList",[]),n=new Map;for(const l of t)n.set(l.uid,l);const r=(e.data||[]).map(l=>{const i=(l.buddyUids||[]).map(o=>n.get(o)).filter(o=>o).map(o=>{var a,c,u,d;return{uid:o.uid,uin:o.uin,nickname:((a=o.coreInfo)==null?void 0:a.nick)||"",remark:((c=o.coreInfo)==null?void 0:c.remark)||"",avatar:_l(o.uin),online:((u=o.status)==null?void 0:u.status)===10||!1,topTime:((d=o.relationFlags)==null?void 0:d.topTime)||"0"}});return{categoryId:l.categoryId,categoryName:l.categroyName||"我的好友",categorySort:l.categorySortId,onlineCount:l.onlineCount||0,memberCount:l.categroyMbCount||i.length,friends:i}});return r.sort((l,i)=>l.categorySort-i.categorySort),r}async function Fl(){return(await te("ntGroupApi","getGroups",[!1])).map(t=>({groupCode:t.groupCode,groupName:t.groupName,remarkName:t.remarkName||"",avatar:is(t.groupCode),memberCount:t.memberCount,isTop:t.isTop||!1,msgMask:t.cmdUinMsgMask||1}))}async function Wo(){const e=await te("ntUserApi","getRecentContactListSnapShot",[50]),[t,n]=await Promise.all([Fl(),Al()]),r=new Map,l=[];t.forEach(c=>{c.msgMask!==2&&(r.set(`2_${c.groupCode}`,c.isTop),c.isTop&&l.push(c))});const i=[];n.forEach(c=>{c.friends.forEach(u=>{const d=!!u.topTime&&u.topTime!=="0";r.set(`1_${u.uin}`,d),d&&i.push(u)})});const o=new Set,a=e.info.changedList.filter(c=>{const u=c.peerUin||c.peerUid;return u&&u!=="0"&&u!==""}).map(c=>{const u=c.chatType,d=u===2,m=d?c.peerUin||c.peerUid:c.peerUin;o.add(`${u}_${m}`);const f=`${u}_${m}`,y=r.get(f)||!1;return{chatType:u,peerId:m,peerName:c.peerName||c.remark||c.peerUin,peerAvatar:d?is(m):_l(c.peerUin),lastMessage:sg(c.abstractContent),lastTime:parseInt(c.msgTime)*1e3,unreadCount:parseInt(c.unreadCnt)||0,pinned:y}});return l.forEach(c=>{const u=`2_${c.groupCode}`;o.has(u)||a.push({chatType:2,peerId:c.groupCode,peerName:c.groupName,peerAvatar:is(c.groupCode),lastMessage:"",lastTime:Date.now(),unreadCount:0,pinned:!0})}),i.forEach(c=>{const u=`1_${c.uin}`;o.has(u)||a.push({chatType:1,peerId:c.uin,peerName:c.remark||c.nickname,peerAvatar:_l(c.uin),lastMessage:"",lastTime:Date.now(),unreadCount:0,pinned:!0})}),a.sort((c,u)=>c.pinned&&!u.pinned?-1:!c.pinned&&u.pinned?1:u.lastTime-c.lastTime),a}function sg(e){const t=r=>{var i,o,a;if(!r)return"";if(typeof r=="string")return r;const l=r.content||r.text||r.recentAbstract||((i=r.textElement)==null?void 0:i.content)||((a=(o=r.grayTipElement)==null?void 0:o.jsonGrayTipElement)==null?void 0:a.recentAbstract);return typeof l=="string"&&l.trim()?l:r.picElement||r.imageElement||r.type===2||r.elementType===2?"[图片]":r.faceElement||r.marketFaceElement||r.type===3||r.elementType===6?"[表情]":r.fileElement||r.type===6||r.elementType===3?"[文件]":r.pttElement||r.voiceElement||r.elementType===4?"[语音]":r.videoElement||r.elementType===5?"[视频]":""};return e?Array.isArray(e)?e.map(t).filter(Boolean).join("")||"[消息]":t(e)||"[消息]":"[消息]"}async function ll(e,t,n,r=20,l){const i=new URLSearchParams({chatType:String(e),peerId:t,limit:r.toString()});n&&i.append("beforeMsgSeq",n),l&&i.append("afterMsgSeq",l);const o=await je(`/api/webqq/messages?${i}`);if(!o.success)throw new Error(o.message||"获取消息历史失败");return o.data||{messages:[],hasMore:!1}}async function Ho(e){const t=await je("/api/webqq/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.success)throw new Error(t.message||"发送消息失败");return t.data||{msgId:""}}async function bh(e){const t=new FormData;t.append("image",e);const n=await je("/api/webqq/upload",{method:"POST",body:t});if(!n.success)throw new Error(n.message||"上传图片失败");return n.data}async function Sh(e){const t=await je("/api/webqq/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageUrl:e})});if(!t.success)throw new Error(t.message||"上传图片失败");return t.data}async function Ch(e){const t=new FormData;t.append("file",e);const n=await je("/api/webqq/upload-file",{method:"POST",body:t});if(!n.success)throw new Error(n.message||"上传文件失败");return n.data}async function lg(e){const t=await je(`/api/webqq/members?groupCode=${e}`);if(!t.success)throw new Error(t.message||"获取群成员失败");return t.data||[]}async function ig(e){const t=await je(`/api/webqq/user-info?uid=${encodeURIComponent(e)}`);if(!t.success)throw new Error(t.message||"获取用户信息失败");return t.data}async function te(e,t,n=[]){const r=await je(`/api/ntcall/${e}/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({args:n})});if(!r.success)throw new Error(r.message||"NT API 调用失败");return r.data}async function Eh(e,t,n,r){return await te("ntFileApi","getVideoUrl",[{chatType:e,peerUid:t,guildId:""},n,r])}async function Mh(e,t,n){await te("ntMsgApi","recallMsg",[{chatType:e,peerUid:t,guildId:""},[n]])}async function Th(e,t){var n,r;try{if(t){const i=await te("ntGroupApi","getGroupMember",[t,e,!1]);if(i)return i.cardName||i.nick||"未知用户"}const l=await te("ntUserApi","getUserSimpleInfo",[e,!1]);return((n=l==null?void 0:l.coreInfo)==null?void 0:n.remark)||((r=l==null?void 0:l.coreInfo)==null?void 0:r.nick)||"未知用户"}catch{return"未知用户"}}async function $l(e,t,n){e===2&&n?await te("pmhq","sendGroupPoke",[Number(n),Number(t)]):await te("pmhq","sendFriendPoke",[Number(t)])}async function Ih(e,t,n,r){return await te("ntMsgApi","translatePtt2Text",[e,{chatType:t,peerUid:n,guildId:""},r])||""}async function Ph(e,t,n=!1){const r=await te("ntGroupApi","kickMember",[e,[t],n,""]);if((r==null?void 0:r.errCode)!==0)throw new Error((r==null?void 0:r.errMsg)||"踢出失败")}async function zh(e,t,n){await te("ntGroupApi","banMember",[e,[{uid:t,timeStamp:n}]])}async function Lh(e,t,n){await te("pmhq","setSpecialTitle",[parseInt(e),t,n])}function Rh(e,t,n){const r=hs();let l=`/api/webqq/audio-proxy?fileUuid=${encodeURIComponent(e)}&isGroup=${t}&token=${encodeURIComponent(r||"")}`;return n&&(l+=`&filePath=${encodeURIComponent(n)}`),l}async function _h(e){const t=await te("ntGroupApi","quitGroup",[e]);if((t==null?void 0:t.result)!==0)throw new Error((t==null?void 0:t.errMsg)||"退群失败")}async function Ul(e,t,n){var y;let r=e;if(!r&&t&&(r=await te("ntUserApi","getUidByUin",[t])),!r)throw new Error("无法获取用户信息");const i=(await te("ntUserApi","fetchUserDetailInfo",[r])).detail[r];if(!i)throw new Error("用户不存在");let o=t||i.uin;o||(o=await te("ntUserApi","getUinByUid",[r]));const a=i.simpleInfo,c=a==null?void 0:a.coreInfo,u=a==null?void 0:a.baseInfo,d=i.commonExt;let m=((y=d==null?void 0:d.qqLevel)==null?void 0:y.level)||0;if(m===0&&o)try{m=await te("pmhq","fetchUserLevel",[parseInt(o)])}catch{}const f={uid:r,uin:o||"",nickname:(c==null?void 0:c.nick)||"",remark:(c==null?void 0:c.remark)||"",signature:(u==null?void 0:u.longNick)||"",sex:(u==null?void 0:u.sex)??0,birthday:u!=null&&u.birthday_year?`${u.birthday_year}-${u.birthday_month}-${u.birthday_day}`:"",location:"",qid:(u==null?void 0:u.qid)||"",level:m,regTime:(d==null?void 0:d.regTime)||void 0,avatar:`https://q1.qlogo.cn/g?b=qq&nk=${o}&s=640`};if(n)try{const w=await te("ntGroupApi","getGroupMember",[n,r,!1]);w&&(f.groupCard=w.cardName||"",f.groupRole=w.role===4?"owner":w.role===3?"admin":"member",f.groupTitle=w.memberSpecialTitle||"",f.groupLevel=w.memberRealLevel||w.memberLevel||0,f.joinTime=w.joinTime,f.lastSpeakTime=w.lastSpeakTime)}catch{}return f}function Ah(e,t,n){const r=hs(),l=r?`/api/webqq/events?token=${encodeURIComponent(r)}`:"/api/webqq/events";let i,o=0,a=null,c=!1;const u=()=>(i=new EventSource(l),i.addEventListener("message",m=>{try{const f=JSON.parse(m.data);e(f)}catch(f){console.error("解析 SSE 消息失败:",f)}}),i.addEventListener("connected",()=>{console.log("[SSE] 连接已建立"),o=0}),i.onopen=()=>{console.log("[SSE] 连接打开"),o>0&&(console.log("[SSE] 重连成功"),n==null||n()),o=0},i.onerror=m=>{if(console.error("[SSE] 连接错误:",m),c)return;i.close();const f=Math.min(1e3*Math.pow(2,o),3e4);o++,console.log(`[SSE] 将在 ${f}ms 后尝试第 ${o} 次重连...`),a=setTimeout(()=>{c||(console.log("[SSE] 正在重连..."),u())},f),t==null||t(m)},i);return i=u(),{close:()=>{c=!0,a&&(clearTimeout(a),a=null),i.close(),console.log("[SSE] 连接已关闭")},get readyState(){return i.readyState},get url(){return i.url},addEventListener:i.addEventListener.bind(i),removeEventListener:i.removeEventListener.bind(i),dispatchEvent:i.dispatchEvent.bind(i),onerror:i.onerror,onmessage:i.onmessage,onopen:i.onopen,CONNECTING:EventSource.CONNECTING,OPEN:EventSource.OPEN,CLOSED:EventSource.CLOSED,withCredentials:i.withCredentials}}function Fh(e,t){if(!t.trim())return e;const n=t.toLowerCase();return e.filter(r=>r.groupName.toLowerCase().includes(n)||r.groupCode.includes(t))}function $h(e,t){if(!t.trim())return e;const n=t.toLowerCase();return e.filter(r=>r.nickname.toLowerCase().includes(n)||r.card.toLowerCase().includes(n)||r.uin.includes(t))}function Uh(e){const t=e.toLowerCase().split(".").pop()||"";return["jpg","jpeg","png","gif"].includes(t)}function og(e){return!e||e.trim().length===0}async function Dh(e){var r,l,i;const t=await te("ntGroupApi","getGroupAllInfo",[e]);console.log("[WebQQ] 群资料:",{groupCode:t.groupCode,groupName:t.groupName,fingerMemo:t.fingerMemo,fingerMemoLength:(r=t.fingerMemo)==null?void 0:r.length,groupMemo:t.groupMemo,groupMemoLength:(l=t.groupMemo)==null?void 0:l.length,richFingerMemo:t.richFingerMemo});let n="";if(t.ownerUid)try{const o=await te("ntUserApi","getUinByUid",[t.ownerUid]),a=await te("ntUserApi","getUserSimpleInfo",[t.ownerUid,!1]);n=((i=a==null?void 0:a.coreInfo)==null?void 0:i.nick)||o||""}catch{}return{groupCode:t.groupCode,groupName:t.groupName,remarkName:t.remarkName||"",avatar:is(t.groupCode),memberCount:t.memberNum,maxMemberCount:t.maxMemberNum,ownerUin:t.ownerUid?await te("ntUserApi","getUinByUid",[t.ownerUid]).catch(()=>""):"",ownerName:n,createTime:t.cmdUinJoinTime||void 0,description:t.richFingerMemo||t.fingerMemo||"",announcement:t.groupMemo||""}}function ii(e){const t=new Date(e),n=new Date;if(t.toDateString()===n.toDateString())return t.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});const l=new Date(n);return l.setDate(l.getDate()-1),t.toDateString()===l.toDateString()?`昨天 ${t.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})}`:t.toLocaleDateString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}async function Oh(e){const t=await te("ntFriendApi","delBuddy",[e]);if((t==null?void 0:t.result)!==0)throw new Error((t==null?void 0:t.errMsg)||"删除好友失败")}async function ag(e,t,n){if(e===2){const r=await te("ntGroupApi","setTop",[t,n]);if((r==null?void 0:r.result)!==0)throw new Error((r==null?void 0:r.errMsg)||"设置置顶失败")}else{const r=await te("ntFriendApi","setTop",[t,n]);if((r==null?void 0:r.result)!==0)throw new Error((r==null?void 0:r.errMsg)||"设置置顶失败")}}var Ct=(e=>(e[e.AllowNotify=1]="AllowNotify",e[e.BoxNotNotify=2]="BoxNotNotify",e[e.NotAllow=3]="NotAllow",e[e.AllowNotNotify=4]="AllowNotNotify",e))(Ct||{});async function qh(e,t){const n=await te("ntGroupApi","setGroupMsgMask",[e,t]);if((n==null?void 0:n.result)!==0)throw new Error((n==null?void 0:n.errMsg)||"设置消息接收方式失败")}const Eu=Object.freeze(Object.defineProperty({__proto__:null,GroupMsgMask:Ct,createEventSource:Ah,deleteFriend:Oh,filterGroups:Fh,filterMembers:$h,formatMessageTime:ii,getAudioProxyUrl:Rh,getFriends:Al,getGroupAvatar:is,getGroupMembers:lg,getGroupProfile:Dh,getGroups:Fl,getLoginInfo:Nh,getMessages:ll,getRecentChats:Wo,getSelfUid:cr,getSelfUin:li,getUserAvatar:_l,getUserDisplayName:Th,getUserInfo:ig,getUserProfile:Ul,getVideoUrl:Eh,isEmptyMessage:og,isValidImageFormat:Uh,kickGroupMember:Ph,muteGroupMember:zh,ntCall:te,quitGroup:_h,recallMessage:Mh,sendMessage:Ho,sendPoke:$l,setGroupMsgMask:qh,setMemberTitle:Lh,setRecentChatTop:ag,setSelfInfo:jh,translatePttToText:Ih,uploadFile:Ch,uploadImage:bh,uploadImageByUrl:Sh},Symbol.toStringTag,{value:"Module"})),cg="modulepreload",ug=function(e){return"/"+e},Mu={},Tu=function(t,n,r){let l=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));l=Promise.allSettled(n.map(c=>{if(c=ug(c),c in Mu)return;Mu[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const m=document.createElement("link");if(m.rel=u?"stylesheet":cg,u||(m.as="script"),m.crossOrigin="",m.href=c,a&&m.setAttribute("nonce",a),document.head.appendChild(m),u)return new Promise((f,y)=>{m.addEventListener("load",f),m.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return l.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})},dg=60*60*1e3,Iu=30*60*1e3,Os=new Map;let Ba=new Set,Va=new Set;const Pu=()=>{Ba=new Set,Va=new Set},Qa=(e,t)=>Ba.has(`${e}_${t}`),mg=(e,t)=>{Ba.add(`${e}_${t}`)},hg=e=>Va.has(e),fg=e=>{Va.add(e)},ze=qa()(Wa((e,t)=>({friendCategories:[],groups:[],recentChats:[],groupLastTimeMap:{},groupLastMessageMap:{},contactsLoading:!1,contactsError:null,currentChat:null,activeTab:"recent",groupAssistantMode:"normal",unreadCounts:{},expandedCategories:[],membersCache:{},showMemberPanel:!1,scrollPositions:{},contactsCacheTimestamp:0,setFriendCategories:n=>e({friendCategories:n}),setGroups:n=>e({groups:n}),setRecentChats:n=>e({recentChats:n}),setContactsLoading:n=>e({contactsLoading:n}),setContactsError:n=>e({contactsError:n}),setCurrentChat:n=>e({currentChat:n}),setActiveTab:n=>e({activeTab:n}),setGroupAssistantMode:n=>e({groupAssistantMode:n}),enterGroupAssistant:()=>e({groupAssistantMode:"assistant"}),exitGroupAssistant:()=>e({groupAssistantMode:"normal"}),setUnreadCount:(n,r)=>e(l=>({unreadCounts:{...l.unreadCounts,[n]:r}})),incrementUnreadCount:n=>e(r=>({unreadCounts:{...r.unreadCounts,[n]:(r.unreadCounts[n]||0)+1}})),clearUnreadCount:n=>e(r=>{const{[n]:l,...i}=r.unreadCounts;return{unreadCounts:i}}),initUnreadCounts:n=>{const r={};n.forEach(l=>{l.unreadCount>0&&(r[`${l.chatType}_${l.peerId}`]=l.unreadCount)}),e({unreadCounts:r})},toggleCategory:n=>e(r=>{const l=new Set(r.expandedCategories);return l.has(n)?l.delete(n):l.add(n),{expandedCategories:Array.from(l)}}),setExpandedCategories:n=>e({expandedCategories:n}),getCachedMembers:n=>{const l=t().membersCache[n];return l&&Date.now()-l.timestamp<Iu?l.members:null},setCachedMembers:(n,r)=>e(l=>{const i=Date.now(),o={};for(const[a,c]of Object.entries(l.membersCache))i-c.timestamp<Iu&&(o[a]=c);return{membersCache:{...o,[n]:{members:r,timestamp:i}}}}),fetchGroupMembers:async(n,r=!1)=>{const l=t();if(console.log("[Store] fetchGroupMembers called:",n,"forceRefresh:",r),!r){const a=l.getCachedMembers(n);if(a)return console.log("[Store] Cache hit, returning cached members"),a}const i=Os.get(n);if(i)return console.log("[Store] Already loading, returning existing promise"),i;console.log("[Store] Fetching from API");const o=(async()=>{const{getGroupMembers:a}=await Tu(async()=>{const{getGroupMembers:u}=await Promise.resolve().then(()=>Eu);return{getGroupMembers:u}},void 0),c=await a(n);return console.log("[Store] API success, caching members"),t().setCachedMembers(n,c),Os.delete(n),c})().catch(a=>{throw console.log("[Store] API error:",a.message),Os.delete(n),a});return Os.set(n,o),o},setShowMemberPanel:n=>e({showMemberPanel:n}),getScrollPosition:(n,r)=>{const l=t(),i=`${n}_${r}`;return l.scrollPositions[i]||null},setScrollPosition:(n,r,l)=>e(i=>({scrollPositions:{...i.scrollPositions,[`${n}_${r}`]:l}})),clearScrollPosition:(n,r)=>e(l=>{const{[`${n}_${r}`]:i,...o}=l.scrollPositions;return{scrollPositions:o}}),isContactsCacheValid:()=>{const n=t();return n.contactsCacheTimestamp>0&&Date.now()-n.contactsCacheTimestamp<dg&&(n.friendCategories.length>0||n.groups.length>0)},loadContacts:async()=>{const n=t();if(n.isContactsCacheValid()){n.refreshContacts();return}e({contactsLoading:!0,contactsError:null});try{const[r,l,i]=await Promise.all([Al(),Fl(),Wo()]),o=i.filter(y=>y.peerId&&y.peerId!=="0"&&y.peerId!==""),a=new Map;n.recentChats.forEach(y=>{y.peerId&&y.peerId!=="0"&&y.peerId!==""&&a.set(`${y.chatType}_${y.peerId}`,y)}),o.forEach(y=>{const w=`${y.chatType}_${y.peerId}`,k=a.get(w);k?(y.lastTime>k.lastTime||y.lastTime===k.lastTime&&!k.lastMessage&&y.lastMessage)&&a.set(w,y):a.set(w,y)});const c=Array.from(a.values()).sort((y,w)=>w.lastTime-y.lastTime),u={},d={};o.forEach(y=>{y.chatType===2&&(u[y.peerId]=y.lastTime,y.lastMessage&&(d[y.peerId]=y.lastMessage))}),e({friendCategories:r,groups:l,recentChats:c,groupLastTimeMap:u,groupLastMessageMap:d,contactsCacheTimestamp:Date.now(),contactsLoading:!1});const f={...t().unreadCounts};o.forEach(y=>{const w=`${y.chatType}_${y.peerId}`;!(w in f)&&y.unreadCount>0&&(f[w]=y.unreadCount)}),e({unreadCounts:f})}catch(r){e({contactsError:r.message||"加载联系人失败",contactsLoading:!1})}},refreshContacts:async()=>{try{const[n,r,l]=await Promise.all([Al(),Fl(),Wo()]),i=l.filter(y=>y.peerId&&y.peerId!=="0"&&y.peerId!==""),o=t(),a=new Map;o.recentChats.forEach(y=>{y.peerId&&y.peerId!=="0"&&y.peerId!==""&&a.set(`${y.chatType}_${y.peerId}`,y)}),i.forEach(y=>{const w=`${y.chatType}_${y.peerId}`,k=a.get(w);k?(y.lastTime>k.lastTime||y.lastTime===k.lastTime&&!k.lastMessage&&y.lastMessage)&&a.set(w,y):a.set(w,y)});const c=Array.from(a.values()).sort((y,w)=>w.lastTime-y.lastTime),u={...o.groupLastTimeMap},d={...o.groupLastMessageMap};i.forEach(y=>{y.chatType===2&&(u[y.peerId]=y.lastTime,y.lastMessage&&(d[y.peerId]=y.lastMessage))}),e({friendCategories:n,groups:r,recentChats:c,groupLastTimeMap:u,groupLastMessageMap:d,contactsCacheTimestamp:Date.now()});const f={...t().unreadCounts};i.forEach(y=>{const w=`${y.chatType}_${y.peerId}`;!(w in f)&&y.unreadCount>0&&(f[w]=y.unreadCount)}),e({unreadCounts:f})}catch(n){console.error("Failed to refresh contacts:",n)}},updateRecentChat:(n,r,l,i,o,a)=>e(c=>{const u=c.recentChats.filter((k,j,g)=>g.findIndex(h=>h.chatType===k.chatType&&h.peerId===k.peerId)===j),d=u.find(k=>k.chatType===n&&k.peerId===r),m=c.currentChat,f=(m==null?void 0:m.chatType)===n&&(m==null?void 0:m.peerId)===r,y=n===2?{...c.groupLastTimeMap,[r]:i}:c.groupLastTimeMap,w=n===2?{...c.groupLastMessageMap,[r]:l||"[消息]"}:c.groupLastMessageMap;if(d){const k=u.filter(x=>!(x.chatType===n&&x.peerId===r)),j={...d,lastMessage:l,lastTime:i,unreadCount:f?0:d.unreadCount+1};if(d.pinned){const x=k.filter(N=>N.pinned),v=k.filter(N=>!N.pinned);return{recentChats:[j,...x,...v],groupLastTimeMap:y,groupLastMessageMap:w}}const g=k.filter(x=>x.pinned),h=k.filter(x=>!x.pinned);return{recentChats:[...g,j,...h],groupLastTimeMap:y,groupLastMessageMap:w}}else{let k=o||r,j=a||"";if(n===1||n===100){for(const h of c.friendCategories){const x=h.friends.find(v=>v.uin===r);if(x){k=x.remark||x.nickname,j=x.avatar;break}}j||(j=`https://q1.qlogo.cn/g?b=qq&nk=${r}&s=640`)}else if(n===2){const h=c.groups.find(x=>x.groupCode===r);if(h){if(h.msgMask===2)return{groupLastTimeMap:y,groupLastMessageMap:w};k=h.groupName,j=h.avatar}j||(j=`https://p.qlogo.cn/gh/${r}/${r}/640/`)}return{recentChats:[{chatType:n,peerId:r,peerName:k,peerAvatar:j,lastMessage:l,lastTime:i,unreadCount:f?0:1},...u],groupLastTimeMap:y,groupLastMessageMap:w}}}),togglePinChat:async(n,r)=>{const i=t().recentChats.find(a=>a.chatType===n&&a.peerId===r);if(!i)return;const o=!i.pinned;try{const{setRecentChatTop:a}=await Tu(async()=>{const{setRecentChatTop:c}=await Promise.resolve().then(()=>Eu);return{setRecentChatTop:c}},void 0);await a(n,r,o),e(c=>{const u=c.recentChats.map(d=>d.chatType===n&&d.peerId===r?{...d,pinned:o}:d);return u.sort((d,m)=>d.pinned&&!m.pinned?-1:!d.pinned&&m.pinned?1:m.lastTime-d.lastTime),{recentChats:u}})}catch(a){throw console.error("设置置顶失败:",a),a}},removeRecentChat:(n,r)=>e(l=>({recentChats:l.recentChats.filter(i=>!(i.chatType===n&&i.peerId===r))})),removeFriend:n=>e(r=>({friendCategories:r.friendCategories.map(i=>({...i,friends:i.friends.filter(o=>o.uid!==n),memberCount:i.friends.filter(o=>o.uid!==n).length}))}))}),{name:"webqq-storage",partialize:e=>({friendCategories:e.friendCategories,groups:e.groups,recentChats:e.recentChats,groupLastTimeMap:e.groupLastTimeMap,groupLastMessageMap:e.groupLastMessageMap,expandedCategories:e.expandedCategories,membersCache:e.membersCache,showMemberPanel:e.showMemberPanel,scrollPositions:e.scrollPositions,contactsCacheTimestamp:e.contactsCacheTimestamp,unreadCounts:e.unreadCounts,activeTab:e.activeTab,currentChat:e.currentChat}),onRehydrateStorage:()=>e=>{if(e&&e.recentChats){const t=new Set;e.recentChats=e.recentChats.filter(n=>{if(!n.peerId||n.peerId==="0"||n.peerId==="")return!1;const r=`${n.chatType}_${n.peerId}`;return t.has(r)?!1:(t.add(r),!0)})}}}));function Ga(e,t,n){const[r,l]=p.useState({left:-9999,top:-9999,ready:!1});return p.useEffect(()=>{l({left:-9999,top:-9999,ready:!1});const i=requestAnimationFrame(()=>{if(!n.current){l({left:e,top:t,ready:!0});return}const o=n.current.getBoundingClientRect(),a=10;let c=e,u=t;e+o.width>window.innerWidth-a&&(c=e-o.width),c<a&&(c=a),t+o.height>window.innerHeight-a&&(u=t-o.height),u<a&&(u=a),l({left:c,top:u,ready:!0})});return()=>cancelAnimationFrame(i)},[e,t]),r}const Wh=({groupCode:e,onClose:t})=>{var u;const{groups:n,setGroups:r}=ze(),[l,i]=p.useState(!1),o=p.useRef(null),a=async d=>{try{await qh(e,d);const m=n.map(f=>f.groupCode===e?{...f,msgMask:d}:f);r(m)}catch(m){console.error("设置消息接收方式失败:",m),alert(`设置失败: ${m.message||"未知错误"}`)}t()},c=(u=n.find(d=>d.groupCode===e))==null?void 0:u.msgMask;return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onMouseEnter:()=>i(!0),className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-theme",children:[s.jsx(pu,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:"消息接收方式"}),s.jsx(ni,{size:14,className:"flex-shrink-0"})]}),l&&s.jsxs("div",{ref:o,className:"absolute left-full top-0 ml-1 bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[140px] z-[10000]",onMouseLeave:()=>i(!1),children:[s.jsxs("button",{onClick:()=>a(Ct.AllowNotify),className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-theme",children:[s.jsx(pu,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:"接收并提醒"}),c===Ct.AllowNotify&&s.jsx("span",{className:"flex-shrink-0 text-pink-500",children:"✓"})]}),s.jsxs("button",{onClick:()=>a(Ct.AllowNotNotify),className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-theme",children:[s.jsx(s0,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:"接收但不提醒"}),c===Ct.AllowNotNotify&&s.jsx("span",{className:"flex-shrink-0 text-pink-500",children:"✓"})]}),s.jsxs("button",{onClick:()=>a(Ct.BoxNotNotify),className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-theme",children:[s.jsx(e0,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:"收进群助手"}),c===Ct.BoxNotNotify&&s.jsx("span",{className:"flex-shrink-0 text-pink-500",children:"✓"})]}),s.jsxs("button",{onClick:()=>a(Ct.NotAllow),className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-theme",children:[s.jsx(r0,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:"屏蔽群消息"}),c===Ct.NotAllow&&s.jsx("span",{className:"flex-shrink-0 text-pink-500",children:"✓"})]})]})]})},pg=({friend:e,isSelected:t,onClick:n})=>{const{togglePinChat:r}=ze(),[l,i]=p.useState(null),o=p.useRef(null),a=Ga((l==null?void 0:l.x)||0,(l==null?void 0:l.y)||0,o),c=m=>{m.preventDefault(),m.stopPropagation(),i({x:m.clientX,y:m.clientY})},u=()=>i(null),d=async()=>{try{await r(1,e.uin)}catch(m){console.error("置顶失败:",m),alert(`置顶失败: ${m.message||"未知错误"}`)}u()};return p.useEffect(()=>{if(!l)return;const m=()=>u();return document.addEventListener("click",m),()=>document.removeEventListener("click",m)},[l]),s.jsxs(s.Fragment,{children:[s.jsxs("div",{onClick:n,onContextMenu:c,className:`flex items-center gap-3 px-3 py-2.5 cursor-pointer transition-colors ${t?"bg-pink-500/20":"hover:bg-theme-item-hover"}`,children:[s.jsxs("div",{className:"relative flex-shrink-0",children:[s.jsx("img",{src:e.avatar,alt:e.nickname,className:"w-10 h-10 rounded-full object-cover",onError:m=>{m.currentTarget.src=`https://q1.qlogo.cn/g?b=qq&nk=${e.uin}&s=640`}}),e.online&&s.jsx("div",{className:"absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white dark:border-neutral-800"})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-theme truncate",children:e.remark||e.nickname}),e.remark&&s.jsx("div",{className:"text-xs text-theme-hint truncate",children:e.nickname})]})]}),l&&Ie.createPortal(s.jsx("div",{ref:o,className:"fixed bg-white dark:bg-neutral-800 rounded-lg shadow-lg border border-neutral-200 dark:border-neutral-700 py-1 min-w-[120px] z-[9999]",style:{left:`${a.left}px`,top:`${a.top}px`,opacity:a.ready?1:0,pointerEvents:a.ready?"auto":"none"},onClick:m=>m.stopPropagation(),children:s.jsxs("button",{onClick:d,className:"w-full px-3 py-2 text-left text-sm hover:bg-neutral-100 dark:hover:bg-neutral-700 flex items-center gap-2 text-theme",children:[s.jsx(Oa,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:e.topTime&&e.topTime!=="0"?"取消置顶":"置顶"})]})}),document.body)]})},xg=({group:e,isSelected:t,onClick:n,showPinnedStyle:r=!1,unreadCount:l=0,subtitle:i})=>{const{togglePinChat:o}=ze(),[a,c]=p.useState(null),u=p.useRef(null),d=Ga((a==null?void 0:a.x)||0,(a==null?void 0:a.y)||0,u),m=w=>{w.preventDefault(),w.stopPropagation(),c({x:w.clientX,y:w.clientY})},f=()=>{c(null)},y=async()=>{try{await o(2,e.groupCode)}catch(w){console.error("置顶失败:",w),alert(`置顶失败: ${w.message||"未知错误"}`)}f()};return p.useEffect(()=>{if(!a)return;const w=()=>f();return document.addEventListener("click",w),()=>document.removeEventListener("click",w)},[a]),s.jsxs(s.Fragment,{children:[s.jsxs("div",{onClick:n,onContextMenu:m,className:`flex items-center gap-3 px-3 py-2.5 cursor-pointer transition-colors ${t?"bg-pink-500/20":r&&e.isTop?"bg-theme-item-hover":"hover:bg-theme-item-hover"}`,children:[s.jsxs("div",{className:"relative flex-shrink-0",children:[s.jsx("img",{src:e.avatar,alt:e.groupName,className:"w-10 h-10 rounded-full object-cover",onError:w=>{w.currentTarget.src=`https://p.qlogo.cn/gh/${e.groupCode}/${e.groupCode}/640/`}}),l>0&&s.jsx("div",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] bg-red-500 text-white text-xs font-medium rounded-full flex items-center justify-center px-1",children:l})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-theme truncate",children:e.groupName}),s.jsx("div",{className:"text-xs text-theme-hint truncate",children:i||`${e.memberCount} 人`})]})]}),a&&Ie.createPortal(s.jsxs("div",{ref:u,className:"fixed bg-white dark:bg-neutral-800 rounded-lg shadow-lg border border-neutral-200 dark:border-neutral-700 py-1 min-w-[160px] z-[9999]",style:{left:`${d.left}px`,top:`${d.top}px`,opacity:d.ready?1:0,pointerEvents:d.ready?"auto":"none"},onClick:w=>w.stopPropagation(),children:[s.jsxs("button",{onClick:y,className:"w-full px-3 py-2 text-left text-sm hover:bg-neutral-100 dark:hover:bg-neutral-700 flex items-center gap-2 text-theme",children:[s.jsx(Oa,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:e.isTop?"取消置顶":"置顶"})]}),s.jsx(Wh,{groupCode:e.groupCode,onClose:f})]}),document.body)]})},gg=({activeTab:e,onTabChange:t,friendCategories:n,groups:r,recentChats:l,unreadCounts:i,selectedPeerId:o,onSelectFriend:a,onSelectGroup:c,onSelectRecent:u})=>{const[d,m]=p.useState(""),{groupAssistantMode:f,enterGroupAssistant:y,exitGroupAssistant:w}=ze(),k=ze(v=>v.groupLastTimeMap),j=ze(v=>v.groupLastMessageMap),g=p.useMemo(()=>{if(!d.trim())return n;const v=d.toLowerCase();return n.map(N=>({...N,friends:N.friends.filter(S=>S.nickname.toLowerCase().includes(v)||S.remark.toLowerCase().includes(v)||S.uin.includes(d))})).filter(N=>N.friends.length>0)},[n,d]),h=p.useMemo(()=>Fh(r,d),[r,d]),x=[{id:"recent",icon:Ur,label:"最近"},{id:"friends",icon:si,label:"好友"},{id:"groups",icon:Da,label:"群组"}];return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx("div",{className:"flex border-b border-theme-divider px-2 pt-2",children:x.map(v=>{const N=v.icon,S=e===v.id;return s.jsxs("button",{onClick:()=>t(v.id),className:`flex-1 flex items-center justify-center gap-1.5 py-2.5 text-sm font-medium transition-colors rounded-t-lg ${S?"text-pink-600 dark:text-pink-400 bg-pink-50/50 dark:bg-pink-900/30":"text-theme-muted hover:text-theme hover:bg-theme-item"}`,children:[s.jsx(N,{size:16}),v.label]},v.id)})}),e!=="recent"&&s.jsx("div",{className:"p-3",children:s.jsxs("div",{className:"relative",children:[s.jsx(ch,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-theme-hint"}),s.jsx("input",{type:"text",value:d,onChange:v=>m(v.target.value),placeholder:e==="friends"?"搜索好友...":"搜索群组...",className:"w-full pl-9 pr-3 py-2 text-sm bg-theme-input border border-theme-input rounded-lg focus:outline-none focus:ring-2 focus:ring-pink-500/20 focus:border-pink-500/50 text-theme placeholder:text-theme-hint"})]})}),s.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="recent"&&f==="normal"&&s.jsx(vg,{items:l,unreadCounts:i,selectedPeerId:o,onSelect:u,onEnterGroupAssistant:y}),e==="recent"&&f==="assistant"&&s.jsx(kg,{groups:r,recentChats:l,groupLastTimeMap:k,groupLastMessageMap:j,unreadCounts:i,selectedPeerId:o,onSelect:c,onBack:w}),e==="friends"&&s.jsx(yg,{categories:g,selectedPeerId:o,onSelect:a}),e==="groups"&&s.jsx(Hh,{items:h,unreadCounts:i,groupLastTimeMap:k,selectedPeerId:o,onSelect:c})]})]})},yg=({categories:e,selectedPeerId:t,onSelect:n})=>{const{expandedCategories:r,toggleCategory:l}=ze(),i=p.useMemo(()=>new Set(r),[r]),o=p.useMemo(()=>e.map(a=>({...a,friends:[...a.friends].sort((c,u)=>{const d=!!(c.topTime&&c.topTime!=="0"),m=!!(u.topTime&&u.topTime!=="0");return d&&!m?-1:!d&&m?1:0})})),[e]);return o.length===0?s.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:"暂无好友"}):s.jsx("div",{className:"py-1",children:o.map(a=>{const c=i.has(a.categoryId);return s.jsxs("div",{children:[s.jsxs("div",{onClick:()=>l(a.categoryId),className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-theme-item-hover text-theme-secondary",children:[c?s.jsx(eh,{size:14}):s.jsx(ni,{size:14}),s.jsx("span",{className:"text-xs font-medium",children:a.categoryName}),s.jsxs("span",{className:"text-xs text-theme-hint",children:[a.onlineCount,"/",a.memberCount]})]}),c&&a.friends.map(u=>s.jsx(pg,{friend:u,isSelected:t===u.uin,onClick:()=>n(u)},u.uid))]},a.categoryId)})})},Hh=({items:e,unreadCounts:t,selectedPeerId:n,onSelect:r,groupLastTimeMap:l,subtitleMap:i,showPinnedStyle:o=!1})=>{const a=p.useMemo(()=>[...e].sort((u,d)=>{if(u.isTop&&!d.isTop)return-1;if(!u.isTop&&d.isTop)return 1;if(l){const m=l[u.groupCode]||0,f=l[d.groupCode]||0;if(m!==f)return f-m}return 0}),[e,l]);return a.length===0?s.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:"暂无群组"}):s.jsx("div",{className:"py-1",children:a.map(c=>{const u=t.get(`2_${c.groupCode}`)||0;return s.jsx(xg,{group:c,isSelected:n===c.groupCode,onClick:()=>r(c),showPinnedStyle:o,unreadCount:u,subtitle:i==null?void 0:i[c.groupCode]},c.groupCode)})})},vg=({items:e,unreadCounts:t,selectedPeerId:n,onSelect:r,onEnterGroupAssistant:l})=>{const{togglePinChat:i,removeRecentChat:o,friendCategories:a,groups:c}=ze(),[u,d]=p.useState(null),m=p.useRef(null),f=Ga((u==null?void 0:u.x)||0,(u==null?void 0:u.y)||0,m),y=p.useMemo(()=>{const N=c.filter(T=>T.msgMask===2);let S=0;return N.forEach(T=>{const M=t.get(`2_${T.groupCode}`)||0;S+=M}),S},[c,t]),w=p.useMemo(()=>c.filter(N=>N.msgMask===2).length,[c]),k=p.useMemo(()=>e.filter(N=>{if(N.chatType!==2)return!0;const S=c.find(T=>T.groupCode===N.peerId);return(S==null?void 0:S.msgMask)!==2}),[e,c]),j=N=>{if(N.chatType===2){const S=c.find(T=>T.groupCode===N.peerId);if(S!=null&&S.remarkName&&S.remarkName!==S.groupName)return S.remarkName}else if(N.chatType===1||N.chatType===100)for(const S of a){const T=S.friends.find(M=>M.uin===N.peerId);if(T!=null&&T.remark&&T.remark!==T.nickname)return T.remark}return N.peerName},g=(N,S)=>{N.preventDefault(),d({x:N.clientX,y:N.clientY,item:S})},h=()=>{d(null)},x=async()=>{if(u){try{await i(u.item.chatType,u.item.peerId)}catch(N){console.error("置顶失败:",N),alert(`置顶失败: ${N.message||"未知错误"}`)}h()}},v=()=>{u&&(o(u.item.chatType,u.item.peerId),h())};return k.length===0&&w===0?s.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:"暂无最近会话"}):s.jsxs("div",{className:"py-1",onClick:h,children:[w>0&&s.jsxs("div",{onClick:l,className:"flex items-center gap-3 px-3 py-2.5 cursor-pointer transition-colors hover:bg-theme-item-hover",children:[s.jsxs("div",{className:"relative flex-shrink-0",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-blue-400 to-blue-600 flex items-center justify-center",children:s.jsx(Da,{size:20,className:"text-white"})}),y>0&&s.jsx("div",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] bg-red-500 text-white text-xs font-medium rounded-full flex items-center justify-center px-1",children:y})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsx("span",{className:"text-sm font-medium text-theme",children:"群助手"})}),s.jsxs("div",{className:"text-xs text-theme-hint truncate mt-0.5",children:[w," 个群聊"]})]})]}),k.map(N=>s.jsx(wg,{item:N,displayName:j(N),unreadCount:t.get(`${N.chatType}_${N.peerId}`)||N.unreadCount,isSelected:n===N.peerId,onClick:()=>r(N),onContextMenu:S=>g(S,N)},`${N.chatType}_${N.peerId}`)),u&&Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40",onClick:h,onContextMenu:N=>{N.preventDefault(),h()}}),s.jsxs("div",{ref:m,className:"fixed z-50 bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[160px]",style:{left:f.left,top:f.top,visibility:f.ready?"visible":"hidden"},onContextMenu:N=>N.preventDefault(),children:[s.jsxs("button",{onClick:x,className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-theme",children:[s.jsx(Oa,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:u.item.pinned?"取消置顶":"置顶"})]}),u.item.chatType===2&&s.jsx(Wh,{groupCode:u.item.peerId,onClose:h}),s.jsxs("button",{onClick:v,className:"w-full px-3 py-2 text-left text-sm hover:bg-theme-item-hover flex items-center gap-2 text-red-500",children:[s.jsx(It,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"flex-1",children:"删除"})]})]})]}),document.body)]})},wg=({item:e,displayName:t,unreadCount:n,isSelected:r,onClick:l,onContextMenu:i})=>s.jsxs("div",{onClick:l,onContextMenu:i,className:`flex items-center gap-3 px-3 py-2.5 cursor-pointer transition-colors ${r?"bg-pink-500/20":e.pinned?"bg-theme-item-hover":"hover:bg-theme-item-hover"}`,children:[s.jsxs("div",{className:"relative flex-shrink-0",children:[s.jsx("img",{src:e.peerAvatar,alt:t,className:"w-10 h-10 rounded-full object-cover"}),n>0&&s.jsx("div",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] bg-red-500 text-white text-xs font-medium rounded-full flex items-center justify-center px-1",children:n})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-theme truncate",children:t}),s.jsx("span",{className:"text-xs text-theme-hint flex-shrink-0 ml-2",children:ii(e.lastTime)})]}),s.jsx("div",{className:"text-xs text-theme-hint truncate mt-0.5",children:e.lastMessage})]})]}),kg=({groups:e,recentChats:t,groupLastTimeMap:n,groupLastMessageMap:r,unreadCounts:l,selectedPeerId:i,onSelect:o,onBack:a})=>{const c=p.useMemo(()=>e.filter(d=>d.msgMask===2),[e]),u=p.useMemo(()=>{const d={...r};return t.forEach(m=>{m.chatType===2&&m.lastMessage&&(d[m.peerId]=m.lastMessage)}),d},[r,t]);return s.jsxs("div",{className:"py-1",children:[s.jsxs("div",{onClick:a,className:"flex items-center gap-3 px-3 py-2.5 cursor-pointer transition-colors hover:bg-theme-item-hover border-b border-theme-divider",children:[s.jsx(ni,{size:16,className:"transform rotate-180 text-theme-secondary"}),s.jsx("span",{className:"text-sm font-medium text-theme",children:"返回最近会话"})]}),s.jsxs("div",{className:"px-3 py-2 text-xs text-theme-hint",children:["群助手 (",c.length,")"]}),c.length===0?s.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:"暂无群聊"}):s.jsx(Hh,{items:c,unreadCounts:l,groupLastTimeMap:n,subtitleMap:u,selectedPeerId:i,onSelect:o,showPinnedStyle:!0})]})};function zn(e,t,n){let r=n.initialDeps??[],l,i=!0;function o(){var a,c,u;let d;n.key&&((a=n.debug)!=null&&a.call(n))&&(d=Date.now());const m=e();if(!(m.length!==r.length||m.some((w,k)=>r[k]!==w)))return l;r=m;let y;if(n.key&&((c=n.debug)!=null&&c.call(n))&&(y=Date.now()),l=t(...m),n.key&&((u=n.debug)!=null&&u.call(n))){const w=Math.round((Date.now()-d)*100)/100,k=Math.round((Date.now()-y)*100)/100,j=k/16,g=(h,x)=>{for(h=String(h);h.length<x;)h=" "+h;return h};console.info(`%c⏱ ${g(k,5)} /${g(w,5)} ms`,`
|
|
437
437
|
font-size: .6rem;
|
|
438
438
|
font-weight: bold;
|
|
439
|
-
color: hsl(${Math.max(0,Math.min(120-120*j,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(l),i=!1,l}return o.updateDeps=a=>{r=a},o}function zu(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const jg=(e,t)=>Math.abs(e-t)<1.01,Ng=(e,t,n)=>{let r;return function(...l){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,l),n)}},Lu=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},bg=e=>e,Sg=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let l=t;l<=n;l++)r.push(l);return r},Cg=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const l=o=>{const{width:a,height:c}=o;t({width:Math.round(a),height:Math.round(c)})};if(l(Lu(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(o=>{const a=()=>{const c=o[0];if(c!=null&&c.borderBoxSize){const u=c.borderBoxSize[0];if(u){l({width:u.inlineSize,height:u.blockSize});return}}l(Lu(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Ru={passive:!0},_u=typeof window>"u"?!0:"onscrollend"in window,Eg=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let l=0;const i=e.options.useScrollendEvent&&_u?()=>{}:Ng(r,()=>{t(l,!1)},e.options.isScrollingResetDelay),o=d=>()=>{const{horizontal:m,isRtl:f}=e.options;l=m?n.scrollLeft*(f&&-1||1):n.scrollTop,i(),t(l,d)},a=o(!0),c=o(!1);n.addEventListener("scroll",a,Ru);const u=e.options.useScrollendEvent&&_u;return u&&n.addEventListener("scrollend",c,Ru),()=>{n.removeEventListener("scroll",a),u&&n.removeEventListener("scrollend",c)}},Tg=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Mg=(e,{adjustments:t=0,behavior:n},r)=>{var l,i;const o=e+t;(i=(l=r.scrollElement)==null?void 0:l.scrollTo)==null||i.call(l,{[r.options.horizontal?"left":"top"]:o,behavior:n})};class Ig{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(l=>{l.forEach(i=>{const o=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var l;(l=r())==null||l.disconnect(),n=null},observe:l=>{var i;return(i=r())==null?void 0:i.observe(l,{box:"border-box"})},unobserve:l=>{var i;return(i=r())==null?void 0:i.unobserve(l)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,l])=>{typeof l>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:bg,rangeExtractor:Sg,onChange:()=>{},measureElement:Tg,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,l;(l=(r=this.options).onChange)==null||l.call(r,this,n)},this.maybeNotify=zn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=i,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const l=new Map,i=new Map;for(let o=r-1;o>=0;o--){const a=n[o];if(l.has(a.lane))continue;const c=i.get(a.lane);if(c==null||a.end>c.end?i.set(a.lane,a):a.end<c.end&&l.set(a.lane,!0),l.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((o,a)=>o.end===a.end?o.index-a.index:o.end-a.end)[0]:void 0},this.getMeasurementOptions=zn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,l,i,o,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:l,getItemKey:i,enabled:o,lanes:a}),{key:!1}),this.getMeasurements=zn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:l,getItemKey:i,enabled:o,lanes:a},c)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const f of this.laneAssignments.keys())f>=n&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const d=this.measurementsCache.slice(0,u),m=new Array(a).fill(void 0);for(let f=0;f<u;f++){const v=d[f];v&&(m[v.lane]=f)}for(let f=u;f<n;f++){const v=i(f),k=this.laneAssignments.get(f);let w,j;if(k!==void 0&&this.options.lanes>1){w=k;const y=m[w],N=y!==void 0?d[y]:void 0;j=N?N.end+this.options.gap:r+l}else{const y=this.options.lanes===1?d[f-1]:this.getFurthestMeasurement(d,f);j=y?y.end+this.options.gap:r+l,w=y?y.lane:f%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(f,w)}const x=c.get(v),h=typeof x=="number"?x:this.options.estimateSize(f),g=j+h;d[f]={index:f,start:j,size:h,end:g,key:v,lane:w},m[w]=f}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=zn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,l,i)=>this.range=n.length>0&&r>0?Pg({measurements:n,outerSize:r,scrollOffset:l,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=zn(()=>{let n=null,r=null;const l=this.calculateRange();return l&&(n=l.startIndex,r=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,l,i,o)=>i===null||o===null?[]:n({startIndex:i,endIndex:o,overscan:r,count:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,l=n.getAttribute(r);return l?parseInt(l,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const l=this.indexFromElement(n),i=this.measurementsCache[l];if(!i)return;const o=i.key,a=this.elementsCache.get(o);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(o,n)),n.isConnected&&this.resizeItem(l,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const l=this.measurementsCache[n];if(!l)return;const i=this.itemSizeCache.get(l.key)??l.size,o=r-i;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,o,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,l)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(l))});return}this._measureElement(n,void 0)},this.getVirtualItems=zn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const l=[];for(let i=0,o=n.length;i<o;i++){const a=n[i],c=r[a];l.push(c)}return l},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return zu(r[Bh(0,r.length-1,l=>zu(r[l]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,l=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),o=this.getScrollOffset();r==="auto"&&(r=n>=o+i?"end":"start"),r==="center"?n+=(l-i)/2:r==="end"&&(n-=i);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const l=this.measurementsCache[n];if(!l)return;const i=this.getSize(),o=this.getScrollOffset();if(r==="auto")if(l.end>=o+i-this.options.scrollPaddingEnd)r="end";else if(l.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,l.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:l}={})=>{l==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:l})},this.scrollToIndex=(n,{align:r="auto",behavior:l}={})=>{l==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let i=0;const o=10,a=u=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(n,u);if(!d){console.warn("Failed to get offset for index:",n);return}const[m,f]=d;this._scrollToOffset(m,{adjustments:void 0,behavior:l}),this.targetWindow.requestAnimationFrame(()=>{const v=()=>{if(this.currentScrollToIndex!==n)return;const k=this.getScrollOffset(),w=this.getOffsetForIndex(n,f);if(!w){console.warn("Failed to get offset for index:",n);return}jg(w[0],k)||c(f)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(v):v()})},c=u=>{this.targetWindow&&this.currentScrollToIndex===n&&(i++,i<o?this.targetWindow.requestAnimationFrame(()=>a(u)):console.warn(`Failed to scroll to index ${n} after ${o} attempts.`))};a(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let l;if(r.length===0)l=this.options.paddingStart;else if(this.options.lanes===1)l=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let o=r.length-1;for(;o>=0&&i.some(a=>a===null);){const a=r[o];i[a.lane]===null&&(i[a.lane]=a.end),o--}l=Math.max(...i.filter(a=>a!==null))}return Math.max(l-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:l})=>{this.options.scrollToFn(n,{behavior:l,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const Bh=(e,t,n,r)=>{for(;e<=t;){const l=(e+t)/2|0,i=n(l);if(i<r)e=l+1;else if(i>r)t=l-1;else return l}return e>0?e-1:0};function Pg({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const l=e.length-1,i=c=>e[c].start;if(e.length<=r)return{startIndex:0,endIndex:l};let o=Bh(0,l,i,n),a=o;if(r===1)for(;a<l&&e[a].end<n+t;)a++;else if(r>1){const c=Array(r).fill(0);for(;a<l&&c.some(d=>d<n+t);){const d=e[a];c[d.lane]=d.end,a++}const u=Array(r).fill(n+t);for(;o>=0&&u.some(d=>d>=n);){const d=e[o];u[d.lane]=d.start,o--}o=Math.max(0,o-o%r),a=Math.min(l,a+(r-1-a%r))}return{startIndex:o,endIndex:a}}const Au=typeof document<"u"?p.useLayoutEffect:p.useEffect;function zg({useFlushSync:e=!0,...t}){const n=p.useReducer(()=>({}),{})[1],r={...t,onChange:(i,o)=>{var a;e&&o?Ie.flushSync(n):n(),(a=t.onChange)==null||a.call(t,i,o)}},[l]=p.useState(()=>new Ig(r));return l.setOptions(r),Au(()=>l._didMount(),[]),Au(()=>l._willUpdate()),l}function Vh(e){return zg({observeElementRect:Cg,observeElementOffset:Eg,scrollToFn:Mg,...e})}const Lg="webqq-messages",Rg=1,lr="messages",Qh=100;let Os=null;function Gh(){return Os?Promise.resolve(Os):new Promise((e,t)=>{const n=indexedDB.open(Lg,Rg);n.onerror=()=>t(n.error),n.onsuccess=()=>{Os=n.result,e(Os)},n.onupgradeneeded=r=>{const l=r.target.result;l.objectStoreNames.contains(lr)||l.createObjectStore(lr,{keyPath:"chatKey"})}})}async function hs(e,t){try{const n=await Gh(),r=`${e}_${t}`;return new Promise(l=>{const a=n.transaction(lr,"readonly").objectStore(lr).get(r);a.onsuccess=()=>{const c=a.result;c&&c.messages?l(c.messages):l(null)},a.onerror=()=>l(null)})}catch{return null}}async function kn(e,t,n){try{const r=await Gh(),l=`${e}_${t}`,i=n.slice(-Qh);return new Promise((o,a)=>{const d=r.transaction(lr,"readwrite").objectStore(lr).put({chatKey:l,messages:i,timestamp:Date.now()});d.onsuccess=()=>o(),d.onerror=()=>a(d.error)})}catch(r){console.error("Failed to cache messages:",r)}}async function Kh(e,t,n){try{const r=await hs(e,t);if(r){const l=[...r.slice(-(Qh-1)),n];await kn(e,t,l)}}catch(r){console.error("Failed to append message:",r)}}async function _g(e,t,n){try{const r=await hs(e,t);if(r){const l=r.filter(i=>i.msgId!==n);await kn(e,t,l)}}catch(r){console.error("Failed to remove message:",r)}}async function Ag(e,t,n,r,l){try{const i=await hs(e,t);if(!i)return;const o=i.map(a=>{if(a.msgSeq!==n)return a;const c=a.emojiLikesList||[];if(l){const u=c.findIndex(d=>d.emojiId===r);if(u>=0){const d=[...c];return d[u]={...d[u],likesCnt:String(parseInt(d[u].likesCnt)+1)},{...a,emojiLikesList:d}}else return{...a,emojiLikesList:[...c,{emojiId:r,emojiType:parseInt(r)>999?"2":"1",likesCnt:"1",isClicked:!1}]}}else{const u=c.findIndex(d=>d.emojiId===r);if(u>=0){const d=[...c],m=parseInt(d[u].likesCnt)-1;return m<=0?d.splice(u,1):d[u]={...d[u],likesCnt:String(m)},{...a,emojiLikesList:d}}}return a});await kn(e,t,o)}catch(i){console.error("Failed to update emoji reaction:",i)}}async function Fg(e,t,n,r){try{const l=await hs(e,t);if(!l)return!1;let i=!1;const o=l.map(a=>a.msgId===n||r&&a.msgSeq===r?(i=!0,{...a,recallTime:String(Math.floor(Date.now()/1e3))}):a);return i&&await kn(e,t,o),i}catch(l){return console.error("Failed to mark message as recalled:",l),!1}}const $g=({level:e})=>{const t=e%4,n=Math.floor(e/4)%4,r=Math.floor(e/16)%4,l=Math.floor(e/64)%4,i=Math.floor(e/256),o=[];for(let a=0;a<i;a++)o.push(s.jsx("span",{className:"text-amber-400 text-xs font-bold",title:"金企鹅",children:"🐧"},`penguin-${a}`));for(let a=0;a<l;a++)o.push(s.jsx(ni,{size:14,className:"text-amber-500"},`crown-${a}`));for(let a=0;a<r;a++)o.push(s.jsx(hh,{size:14,className:"text-orange-400"},`sun-${a}`));for(let a=0;a<n;a++)o.push(s.jsx(sh,{size:14,className:"text-blue-400"},`moon-${a}`));for(let a=0;a<t;a++)o.push(s.jsx(mh,{size:14,className:"text-yellow-400 fill-yellow-400"},`star-${a}`));return s.jsx("div",{className:"flex items-center gap-0.5 flex-wrap",children:o})},Yh=({profile:e,loading:t,position:n,onClose:r,isFriend:l,onFriendDeleted:i})=>{const o=p.useRef(null),[a,c]=p.useState({left:n.x,top:n.y}),[u,d]=p.useState(!1),[m,f]=p.useState(!1);if(p.useEffect(()=>{if(!o.current)return;const g=320,y=o.current.offsetHeight||400;let N=n.x,S=n.y;N+g>window.innerWidth-20&&(N=window.innerWidth-g-20),N<20&&(N=20),S+y>window.innerHeight-20&&(S=window.innerHeight-y-20),S<20&&(S=20),c({left:N,top:S})},[n,e,t]),!e&&!t)return null;const v=g=>g===1?"男":g===2?"女":"",k=g=>{if(!g)return"";const y=new Date(g*1e3),N=new Date,S=N.getFullYear()-y.getFullYear(),P=N.getMonth()-y.getMonth(),T=S+(P<0?-1:0);if(T<1){const O=S*12+P;return O>0?`${O}个月`:"不足1个月"}return`${T}年`},w=g=>g==="owner"?"群主":g==="admin"?"管理员":"",j=g=>g==="owner"?"bg-amber-500 text-white":g==="admin"?"bg-green-500 text-white":"",x=async()=>{if(e){f(!0);try{await Oh(e.uid),Y("已删除好友","success"),i==null||i(e.uid),r()}catch(g){Y(g.message||"删除好友失败","error")}finally{f(!1),d(!1)}}},h=g=>g?new Date(g*1e3).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"";return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40",onClick:r}),s.jsxs("div",{ref:o,className:"fixed z-50 border border-theme-divider rounded-xl shadow-xl overflow-hidden bg-popup backdrop-blur-sm",style:{left:a.left,top:a.top,width:320,maxHeight:"calc(100vh - 40px)"},onClick:g=>g.stopPropagation(),children:[t?s.jsx("div",{className:"flex items-center justify-center h-40",children:s.jsx(Se,{size:24,className:"animate-spin text-pink-500"})}):e&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bg-gradient-to-r from-pink-400 to-amber-300 p-4 relative",children:[l&&!e.groupRole&&s.jsx("button",{onClick:()=>d(!0),className:"absolute top-2 right-2 p-1.5 rounded-full bg-white/20 hover:bg-white/40 text-white transition-colors",title:"删除好友",children:s.jsx(It,{size:16})}),s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("img",{src:e.avatar,alt:e.nickname,className:"w-16 h-16 rounded-full border-3 border-white/80 object-cover flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0 text-white pt-1",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"font-bold text-lg truncate",children:e.nickname}),e.groupRole&&w(e.groupRole)&&s.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded flex-shrink-0 ${j(e.groupRole)}`,children:w(e.groupRole)})]}),e.remark&&e.remark!==e.nickname&&s.jsxs("div",{className:"text-white/80 text-sm truncate mb-1",children:["备注: ",e.remark]}),s.jsx("div",{className:"text-white/90 text-sm",children:e.uin}),e.qid&&s.jsxs("div",{className:"text-white/70 text-xs mt-0.5",children:["QID: ",e.qid]})]})]})]}),s.jsxs("div",{className:"p-4 overflow-y-auto",style:{maxHeight:"calc(100vh - 40px - 120px)"},children:[e.signature&&s.jsx("div",{className:"text-theme-secondary text-sm mb-3 bg-theme-item/50 rounded-lg px-3 py-2 max-h-24 overflow-y-auto break-words",children:e.signature}),s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[v(e.sex)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"性别"}),s.jsx("span",{className:"text-theme",children:v(e.sex)})]}),e.birthday&&e.birthday!=="0-0-0"&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"生日"}),s.jsx("span",{className:"text-theme",children:e.birthday})]}),k(e.regTime)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"Q龄"}),s.jsx("span",{className:"text-theme",children:k(e.regTime)})]}),e.level>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"等级"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-theme",children:["Lv.",e.level]}),s.jsx($g,{level:e.level})]})]})]}),(e.groupCard||e.groupTitle||e.groupLevel)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-theme-divider my-3"}),s.jsx("div",{className:"text-xs text-theme-hint mb-2",children:"群信息"}),s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.groupCard&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"群名片"}),s.jsx("span",{className:"text-theme truncate",children:e.groupCard})]}),e.groupTitle&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"群头衔"}),s.jsx("span",{className:"text-pink-500",children:e.groupTitle})]}),e.groupLevel!==void 0&&e.groupLevel>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"群等级"}),s.jsxs("span",{className:"text-theme",children:["Lv.",e.groupLevel]})]}),e.joinTime&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"入群时间"}),s.jsx("span",{className:"text-theme",children:h(e.joinTime)})]}),e.lastSpeakTime&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"最后发言"}),s.jsx("span",{className:"text-theme",children:h(e.lastSpeakTime)})]})]})]})]})]}),u&&e&&s.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center rounded-xl",children:s.jsxs("div",{className:"bg-popup m-4 p-4 rounded-lg shadow-lg max-w-[280px]",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("span",{className:"font-medium text-theme",children:"删除好友"}),s.jsx("button",{onClick:()=>d(!1),className:"text-theme-muted hover:text-theme",children:s.jsx(ft,{size:18})})]}),s.jsxs("p",{className:"text-sm text-theme-secondary mb-4",children:["确定要删除好友 ",s.jsx("span",{className:"font-medium text-theme",children:e.remark||e.nickname})," 吗?删除后将无法恢复。"]}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx("button",{onClick:()=>d(!1),className:"px-3 py-1.5 text-sm rounded-lg bg-theme-item hover:bg-theme-hover text-theme transition-colors",disabled:m,children:"取消"}),s.jsxs("button",{onClick:x,className:"px-3 py-1.5 text-sm rounded-lg bg-red-500 hover:bg-red-600 text-white transition-colors flex items-center gap-1",disabled:m,children:[m&&s.jsx(Se,{size:14,className:"animate-spin"}),"删除"]})]})]})})]})]}),document.body)},Ug=({profile:e,loading:t,position:n,onClose:r,onQuitGroup:l})=>{const i=p.useRef(null),[o,a]=p.useState({left:n.x,top:n.y}),[c,u]=p.useState(!1),d=si(),m=(e==null?void 0:e.ownerUin)===d;if(p.useEffect(()=>{if(!i.current)return;const w=320,j=i.current.offsetHeight||300;let x=n.x,h=n.y;x+w>window.innerWidth-20&&(x=window.innerWidth-w-20),x<20&&(x=20),h+j>window.innerHeight-20&&(h=window.innerHeight-j-20),h<20&&(h=20),a({left:x,top:h})},[n,e,t]),!e&&!t)return null;const f=w=>w?new Date(w*1e3).toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}):"",v=()=>{u(!0)},k=()=>{e&&l&&l(e.groupCode,m),u(!1),r()};return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40",onClick:r}),s.jsx("div",{ref:i,className:"fixed z-50 border border-theme-divider rounded-xl shadow-xl overflow-hidden bg-popup backdrop-blur-sm",style:{left:o.left,top:o.top,width:320,maxHeight:"calc(100vh - 40px)"},onClick:w=>w.stopPropagation(),children:t?s.jsx("div",{className:"flex items-center justify-center h-40",children:s.jsx(Se,{size:24,className:"animate-spin text-pink-500"})}):e&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bg-gradient-to-r from-blue-400 to-cyan-300 p-4 relative",children:[l&&s.jsx("button",{onClick:v,className:"absolute top-3 right-3 p-1.5 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors",title:m?"解散该群":"退出该群",children:s.jsx(x0,{size:16})}),s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("img",{src:e.avatar,alt:e.groupName,className:"w-16 h-16 rounded-lg border-3 border-white/80 object-cover flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0 text-white pt-1 pr-6",children:[s.jsx("div",{className:"font-bold text-lg truncate mb-1",children:e.groupName}),e.remarkName&&e.remarkName!==e.groupName&&s.jsxs("div",{className:"text-white/80 text-sm truncate mb-1",children:["备注: ",e.remarkName]}),s.jsx("div",{className:"text-white/90 text-sm",children:e.groupCode})]})]})]}),s.jsxs("div",{className:"p-4 overflow-y-auto",style:{maxHeight:"calc(100vh - 40px - 140px)"},children:[s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[s.jsxs("span",{className:"text-theme-hint flex items-center gap-1",children:[s.jsx(ri,{size:14}),"成员"]}),s.jsxs("span",{className:"text-theme",children:[e.memberCount,e.maxMemberCount?` / ${e.maxMemberCount}`:""]}),e.ownerName&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-theme-hint flex items-center gap-1",children:[s.jsx(ni,{size:14}),"群主"]}),s.jsx("span",{className:"text-theme truncate",children:e.ownerName})]}),e.createTime&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-theme-hint flex items-center gap-1",children:[s.jsx(o0,{size:14}),"创建"]}),s.jsx("span",{className:"text-theme",children:f(e.createTime)})]})]}),e.description&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-theme-divider my-3"}),s.jsx("div",{className:"text-xs text-theme-hint mb-2",children:"群简介"}),s.jsx("div",{className:"text-theme-secondary text-sm bg-theme-item/50 rounded-lg px-3 py-2 break-words whitespace-pre-wrap",style:{maxHeight:"120px",overflowY:"auto"},children:e.description})]}),e.announcement&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-theme-divider my-3"}),s.jsxs("div",{className:"text-xs text-theme-hint mb-2 flex items-center gap-1",children:[s.jsx(ds,{size:12}),"群公告"]}),s.jsx("div",{className:"text-theme-secondary text-sm bg-theme-item/50 rounded-lg px-3 py-2 break-words whitespace-pre-wrap",style:{maxHeight:"120px",overflowY:"auto"},children:e.announcement})]})]})]})}),c&&e&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-[60] bg-black/50",onClick:()=>u(!1)}),s.jsxs("div",{className:"fixed z-[70] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-theme-card border border-theme-divider rounded-xl shadow-xl p-6 min-w-[320px]",children:[s.jsx("h3",{className:"text-lg font-medium text-theme mb-4",children:m?"确认解散群聊":"确认退出群聊"}),s.jsx("p",{className:"text-theme-secondary mb-6",children:m?s.jsxs(s.Fragment,{children:["确定要解散群 ",s.jsx("span",{className:"font-medium text-theme",children:e.groupName})," 吗?此操作不可撤销,所有群成员将被移出。"]}):s.jsxs(s.Fragment,{children:["确定要退出群 ",s.jsx("span",{className:"font-medium text-theme",children:e.groupName})," 吗?"]})}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx("button",{onClick:()=>u(!1),className:"px-4 py-2 text-sm text-theme-secondary hover:bg-theme-item rounded-lg transition-colors",children:"取消"}),s.jsx("button",{onClick:k,className:"px-4 py-2 text-sm bg-red-500 hover:bg-red-600 text-white rounded-lg transition-colors",children:m?"确认解散":"确认退出"})]})]})]})]}),document.body)},Dg=({url:e,onClose:t})=>e?Ie.createPortal(s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:t,children:[s.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-white/80 hover:text-white bg-black/50 rounded-full",children:s.jsx(ft,{size:24})}),s.jsx("img",{src:e,alt:"预览",className:"max-w-[90vw] max-h-[90vh] object-contain",onClick:n=>n.stopPropagation()})]}),document.body):null,Og=({videoInfo:e,onClose:t})=>{const[n,r]=p.useState(null),[l,i]=p.useState(!1),[o,a]=p.useState(null);return p.useEffect(()=>{if(!e){r(null),a(null);return}i(!0),a(null),Eh(e.chatType,e.peerUid,e.msgId,e.elementId).then(r).catch(c=>a(c.message||"获取视频失败")).finally(()=>i(!1))},[e]),e?Ie.createPortal(s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:t,children:[s.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-white/80 hover:text-white bg-black/50 rounded-full z-10",children:s.jsx(ft,{size:24})}),l&&s.jsxs("div",{className:"text-white flex items-center gap-2",children:[s.jsx(Se,{size:24,className:"animate-spin"}),"加载中..."]}),o&&s.jsx("div",{className:"text-red-400",children:o}),n&&!l&&s.jsx("video",{src:n,controls:!0,autoPlay:!0,className:"max-w-[90vw] max-h-[90vh]",onClick:c=>c.stopPropagation()})]}),document.body):null},Xh=ce.createContext(null),Jh=ce.createContext(null),Zh=ce.createContext(null),qg=e=>e?e.startsWith("blob:")?e:e.includes("qpic.cn")||e.includes("multimedia.nt.qq.com.cn")?`/api/webqq/image-proxy?url=${encodeURIComponent(e)}&token=${encodeURIComponent(ms()||"")}`:e:"",Wi=p.memo(({element:e,message:t})=>{var v;const[n,r]=p.useState(!1),[l,i]=p.useState(!1),[o,a]=p.useState(!1),[c,u]=p.useState(!1),d=ce.useContext(Xh),m=ce.useContext(Jh),f=ce.useContext(Zh);if(e.textElement)return s.jsx("span",{className:"whitespace-pre-wrap break-all",style:{overflowWrap:"anywhere",wordBreak:"break-all"},children:e.textElement.content});if(e.picElement){const k=e.picElement;let w=k.originImageUrl?k.originImageUrl.startsWith("http")?k.originImageUrl:`https://gchat.qpic.cn${k.originImageUrl}`:"";const j=qg(w),x=200,h=300;let g=k.picWidth||200,y=k.picHeight||200;y>x&&(g=g*x/y,y=x),g>h&&(y=y*h/g,g=h);const N=S=>{t&&(S.preventDefault(),S.stopPropagation(),f==null||f.showMenu(S,t,e.elementId))};return s.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-theme-item cursor-pointer",style:{width:g,height:y},onClick:()=>d==null?void 0:d.showPreview(j),onContextMenu:N,children:[!n&&!l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-theme-hint",children:s.jsx(Se,{size:24,className:"animate-spin"})}),l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-theme-hint text-xs",children:"图片加载失败"}),s.jsx("img",{src:j,alt:"图片",loading:"lazy",className:`w-full h-full object-cover transition-opacity ${n?"opacity-100":"opacity-0"}`,onLoad:()=>r(!0),onError:()=>i(!0)})]})}if(e.faceElement){const k=e.faceElement.faceIndex,w=e.faceElement.faceText;return s.jsx("img",{src:`/face/${k}.png`,alt:w||`[表情${k}]`,title:w||`表情${k}`,className:"inline-block align-text-bottom",style:{width:24,height:24},onError:j=>{var g;const x=j.target;x.style.display="none";const h=document.createElement("span");h.textContent=w||`[表情${k}]`,(g=x.parentNode)==null||g.insertBefore(h,x)}})}if(e.fileElement)return s.jsxs("span",{children:["[文件: ",e.fileElement.fileName,"]"]});if(e.pttElement)return s.jsx(Bg,{element:e,message:t});if(e.videoElement){const k=e.videoElement,w=200,j=300;let x=k.thumbWidth||200,h=k.thumbHeight||150;h>w&&(x=x*w/h,h=w),x>j&&(h=h*j/x,x=j);let g="";if(k.thumbPath){let O;k.thumbPath instanceof Map?O=k.thumbPath.values().next().value:typeof k.thumbPath=="object"&&(O=Object.values(k.thumbPath)[0]),O&&(g=`/api/webqq/file-proxy?path=${encodeURIComponent(O)}&token=${encodeURIComponent(ms()||"")}`)}const y=k.fileTime||0,N=Math.floor(y/60),S=y%60,P=`${N}:${S.toString().padStart(2,"0")}`,T=()=>{t&&e.elementId&&(m==null||m.showPreview(t.chatType,t.peerUid,t.msgId,e.elementId))};return s.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-theme-item cursor-pointer group",style:{width:x,height:h},onClick:T,children:[s.jsx("div",{className:"absolute inset-0 bg-gray-200 dark:bg-gray-700"}),g?s.jsxs(s.Fragment,{children:[!o&&!c&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-theme-hint",children:s.jsx(Se,{size:24,className:"animate-spin"})}),s.jsx("img",{src:g,alt:"视频缩略图",loading:"lazy",className:`absolute inset-0 w-full h-full object-cover transition-opacity ${o?"opacity-100":"opacity-0"}`,onLoad:()=>a(!0),onError:()=>u(!0)})]}):s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-theme-hint text-xs",children:"视频"}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsx("div",{className:"w-12 h-12 rounded-full bg-black/50 flex items-center justify-center group-hover:bg-black/70 transition-colors",children:s.jsx("div",{className:"w-0 h-0 border-t-8 border-t-transparent border-l-12 border-l-white border-b-8 border-b-transparent ml-1",style:{borderLeftWidth:"14px"}})})}),s.jsx("div",{className:"absolute bottom-1 right-1 px-1.5 py-0.5 bg-black/60 rounded text-white text-xs",children:P})]})}if(e.grayTipElement){const k=e.grayTipElement;if((v=k.jsonGrayTipElement)!=null&&v.jsonStr)try{const w=JSON.parse(k.jsonGrayTipElement.jsonStr);if(w.items){const j=w.items.map(x=>x.txt||"").join("");return s.jsx("span",{className:"text-theme-hint text-xs",children:j||"[戳一戳]"})}}catch{}return s.jsx("span",{className:"text-theme-hint text-xs",children:"[系统提示]"})}if(e.arkElement)return s.jsx("span",{children:"[卡片消息]"});if(e.marketFaceElement){const{emojiId:k,faceName:w,supportSize:j}=e.marketFaceElement,{width:x=200,height:h=200}=(j==null?void 0:j[0])??{},y=`https://gxh.vip.qq.com/club/item/parcel/item/${k.substring(0,2)}/${k}/raw${Math.min(x,300)}.gif`;return s.jsx("img",{src:y,alt:w||"[表情包]",title:w,className:"inline-block align-text-bottom rounded",style:{maxWidth:Math.min(x,200),maxHeight:Math.min(h,200)},onError:N=>{var T;const S=N.target;S.style.display="none";const P=document.createElement("span");P.textContent=`[${w||"表情包"}]`,(T=S.parentNode)==null||T.insertBefore(P,S)}})}return null}),Wg=e=>!!(e.textElement||e.picElement||e.fileElement||e.pttElement||e.videoElement||e.faceElement||e.grayTipElement||e.arkElement||e.marketFaceElement),Hg=e=>!e.elements||e.elements.length===0?!1:e.elements.every(t=>t.grayTipElement||t.replyElement),Bg=({element:e,message:t})=>{const[n,r]=p.useState(null),[l,i]=p.useState(!1),[o,a]=p.useState(!1),[c,u]=p.useState(!1),[d,m]=p.useState(!1),f=p.useRef(null),v=e.pttElement,k=v.duration||0,w=Math.floor(k/60),j=k%60,x=w>0?`${w}:${j.toString().padStart(2,"0")}`:`${j}"`,h=v.text,g=80,N=Math.min(200,Math.max(g,g+k*3)),S=async()=>{if(!(!t||!v.fileUuid||d)){if(c&&f.current){f.current.pause(),u(!1);return}if(f.current&&f.current.readyState>=2){f.current.play(),u(!0);return}m(!0);try{const T=t.chatType===2;console.log("pttElement:",v);const O=Rh(v.fileUuid,T,v.filePath);console.log("音频代理URL:",O);const R=new Audio;f.current=R,R.onended=()=>u(!1),R.onerror=V=>{fetch(O).then(C=>C.text()).then(C=>{console.error("音频加载错误,响应内容:",C.substring(0,200))}).catch(()=>{}),console.error("音频加载错误:",V,R.error,"URL:",O),u(!1),m(!1)},R.onloadeddata=async()=>{m(!1);try{await R.play(),u(!0)}catch(V){console.error("播放失败:",V)}},R.src=O}catch(T){console.error("获取语音URL失败:",T),m(!1)}}},P=async()=>{if(!(!t||l||n!==null)){i(!0),a(!1);try{const T=await Ih(t.msgId,t.chatType,t.peerUid,e);r(T||"(无法识别)")}catch(T){console.error("语音转文字失败:",T),a(!0),r("转换失败")}finally{i(!1)}}};return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-green-100 dark:bg-green-900/40 rounded-full cursor-pointer hover:bg-green-200 dark:hover:bg-green-900/60 transition-colors",style:{width:N},onClick:S,title:"点击播放",children:[d?s.jsx(Se,{size:16,className:"text-green-600 dark:text-green-400 flex-shrink-0 animate-spin"}):c?s.jsx(Uo,{size:16,className:"text-green-600 dark:text-green-400 flex-shrink-0"}):s.jsx(Do,{size:16,className:"text-green-600 dark:text-green-400 flex-shrink-0"}),s.jsx("div",{className:"flex-1 flex items-center gap-0.5",children:[1,2,3,4,5].map(T=>s.jsx("div",{className:`w-0.5 bg-green-400 dark:bg-green-500 rounded-full transition-all ${c?"animate-pulse":""}`,style:{height:`${8+Math.random()*8}px`}},T))}),s.jsx("span",{className:"text-xs text-green-700 dark:text-green-300 flex-shrink-0",children:x})]}),!h&&n===null&&s.jsx("button",{onClick:P,disabled:l,className:"w-6 h-6 flex items-center justify-center rounded-full bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-500 dark:text-gray-300 hover:text-gray-700 dark:hover:text-white text-xs font-medium transition-colors disabled:opacity-50",title:"语音转文字",children:l?s.jsx(Se,{size:12,className:"animate-spin"}):"文"})]}),(h||n)&&s.jsx("div",{className:`text-sm px-3 py-1.5 bg-gray-100 dark:bg-gray-800 rounded-lg max-w-[250px] ${o?"text-red-500":"text-theme-secondary"}`,children:h||n})]})},ef=ce.createContext(null),tf=ce.createContext(null),nf=ce.createContext(null),rf=ce.createContext(null),sf=ce.createContext(null),Vg=e=>{var t,n;for(const r of e.elements)if((n=(t=r.grayTipElement)==null?void 0:t.jsonGrayTipElement)!=null&&n.jsonStr)try{const l=JSON.parse(r.grayTipElement.jsonGrayTipElement.jsonStr);if(l.items){const i=l.items.some(o=>o.type==="qq"&&o.uid);return{items:l.items,hasUid:i}}}catch{}return null},hn=new Map,Qg=p.memo(({message:e,groupCode:t})=>{const n=hn.get(e.msgId),[r,l]=p.useState(n??"[系统提示]"),i=cr();return p.useEffect(()=>{var d,m;if(hn.has(e.msgId)){l(hn.get(e.msgId));return}const o=Vg(e);if(!o){for(const f of e.elements)if((m=(d=f.grayTipElement)==null?void 0:d.xmlElement)!=null&&m.content){const v=f.grayTipElement.xmlElement.content.replace(/<[^>]+>/g,"");hn.set(e.msgId,v),l(v);return}hn.set(e.msgId,"[系统提示]"),l("[系统提示]");return}const{items:a,hasUid:c}=o;if(!c){const v=a.map(k=>k.txt||"").join("")||"[系统提示]";hn.set(e.msgId,v),l(v);return}(async()=>{const f=[];let v=0;for(const w of a)if(w.type==="qq"&&w.uid)if(w.uid===i)f.push(s.jsx("span",{className:"text-blue-500",children:"你"},v++));else{const j=await Mh(w.uid,t);f.push(s.jsx("span",{className:"text-blue-500",children:j},v++))}else w.type==="nor"&&w.txt&&f.push(s.jsx("span",{children:w.txt},v++));const k=f.length>0?f:"[系统提示]";hn.set(e.msgId,k),l(k)})()},[e.msgId,i,t]),s.jsx("div",{className:"flex justify-center py-2",children:s.jsx("span",{className:"text-xs text-theme-hint bg-theme-item/50 px-3 py-1 rounded-full",children:r})})}),Gg=p.memo(({message:e,allMessages:t,isHighlighted:n})=>{var R,V;if(Hg(e)){const C=e.chatType===2?e.peerUin:void 0;return s.jsx(Qg,{message:e,groupCode:C})}const r=cr(),l=r?e.senderUid===r:!1,i=ce.useContext(ef),o=ce.useContext(tf),a=ce.useContext(nf),c=ce.useContext(rf),u=ce.useContext(sf);let d=e.sendMemberName||e.sendNickName||e.senderUin;if(e.chatType===1&&!l&&u){const C=u.getFriend(e.senderUin);C&&(d=C.remark||C.nickname||d)}const m=`https://q1.qlogo.cn/g?b=qq&nk=${e.senderUin}&s=640`,f=parseInt(e.msgTime)*1e3;let v,k,w;if(e.chatType===2){const C=e.msgAttrs;if(C){const E=(_=>{if(C instanceof Map)return C.get(_);if(typeof C=="object")return C[_.toString()]})(2);E!=null&&E.groupHonor&&(v=E.groupHonor.level,k=E.groupHonor.uniqueTitle||void 0)}if(c){const b=c.getMembers(e.peerUin),E=b==null?void 0:b.find(_=>_.uid===e.senderUid||_.uin===e.senderUin);E&&(w=E.role,v===void 0&&E.level&&(v=E.level),!k&&E.specialTitle&&(k=E.specialTitle))}}if(!e.elements||!Array.isArray(e.elements))return null;const j=e.recallTime&&e.recallTime!=="0",x=(R=e.elements.find(C=>C.replyElement))==null?void 0:R.replyElement,h=e.elements.filter(C=>!C.replyElement);if(!(h.some(Wg)||x))return null;const y=h.length===1&&h[0].pttElement&&!x,N=x?t.find(C=>C.msgId===x.replayMsgId||C.msgSeq===x.replayMsgSeq):null,S=C=>{C.preventDefault(),C.stopPropagation(),i==null||i.showMenu(C,e)},P=C=>{C.preventDefault(),C.stopPropagation(),o==null||o.showMenu(C,{senderUid:e.senderUid,senderUin:e.senderUin,senderName:d,chatType:e.chatType,groupCode:e.chatType===2?e.peerUin:void 0})},T=C=>{("ontouchstart"in window||navigator.maxTouchPoints>0)&&(C.preventDefault(),C.stopPropagation(),o==null||o.showMenu(C,{senderUid:e.senderUid,senderUin:e.senderUin,senderName:d,chatType:e.chatType,groupCode:e.chatType===2?e.peerUin:void 0}))},O=()=>{x&&(a==null||a.scrollToMessage(x.replayMsgId,x.replayMsgSeq))};return s.jsxs("div",{className:`flex gap-2 w-full ${l?"flex-row-reverse":""} ${n?"animate-pulse bg-pink-100 dark:bg-pink-900/30 rounded-lg -mx-2 px-2":""}`,children:[s.jsx("img",{src:m,alt:d,loading:"lazy",className:"w-8 h-8 rounded-full object-cover flex-shrink-0 cursor-pointer hover:opacity-80 transition-opacity",onClick:T,onContextMenu:P}),s.jsxs("div",{className:`flex flex-col ${l?"items-end":"items-start"} max-w-[calc(100%-48px)] md:max-w-[70%] min-w-0 overflow-hidden`,children:[s.jsxs("div",{className:`flex items-center gap-1.5 mb-1 ${l?"flex-row-reverse":""}`,children:[s.jsx("span",{className:"text-xs text-theme-hint",children:d}),v!==void 0&&v>0&&s.jsxs("span",{className:"text-xs px-1 py-0.5 bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-300 rounded",children:["Lv.",v]}),w==="owner"&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-amber-100 dark:bg-amber-900/50 text-amber-600 dark:text-amber-300 rounded",children:k||"群主"}),w==="admin"&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-blue-100 dark:bg-blue-900/50 text-blue-600 dark:text-blue-300 rounded",children:k||"管理员"}),w==="member"&&k&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-pink-100 dark:bg-pink-900/50 text-pink-600 dark:text-pink-300 rounded",children:k})]}),y?s.jsxs("div",{onContextMenu:S,className:j?"opacity-50":"",children:[h.map((C,b)=>s.jsx(Wi,{element:C,message:e},b)),j&&s.jsx("div",{className:"text-xs text-theme-muted italic mt-1",children:"已撤回"})]}):s.jsxs("div",{className:"relative",children:[s.jsxs("div",{className:`rounded-2xl px-4 py-2 min-w-[80px] max-w-full break-words overflow-hidden bg-theme-item text-theme shadow-sm ${l?"rounded-tr-sm":"rounded-tl-sm"} ${j?"opacity-50":""}`,onContextMenu:S,children:[x&&s.jsx("div",{className:"text-xs mb-2 pb-2 border-b border-theme-divider cursor-pointer hover:opacity-80 transition-opacity",onClick:O,children:s.jsx("div",{className:"bg-theme-input rounded px-2 py-1",children:N?s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"font-medium text-theme-secondary",children:[N.sendMemberName||N.sendNickName||N.senderUin,":"]}),s.jsx("div",{className:"text-theme-muted",children:(V=N.elements)==null?void 0:V.filter(C=>!C.replyElement).map((C,b)=>s.jsx(Wi,{element:C},b))})]}):s.jsx("span",{className:"text-theme-muted",children:x.sourceMsgText||"[消息]"})})}),h.map((C,b)=>s.jsx(Wi,{element:C,message:e},b))]}),j&&s.jsx("div",{className:"text-xs text-theme-muted italic mt-1",children:"已撤回"})]}),s.jsx(Yg,{message:e,isSelf:l}),s.jsx("span",{className:"text-xs text-theme-hint mt-1",children:li(f)})]})]})});function Kg(e,t){return t==="2"?`/face/emoji-${parseInt(e).toString(16)}.png`:`/face/${e}.png`}const Yg=p.memo(({message:e,isSelf:t})=>{const[n,r]=p.useState(null);if(!e.emojiLikesList||e.emojiLikesList.length===0)return null;const l=async(i,o)=>{if(!n){r(i);try{const a={chatType:e.chatType,peerUid:e.peerUin,guildId:""};await re("ntMsgApi","setEmojiLike",[a,e.msgSeq,i,!o])}catch(a){Y(a.message||"操作失败","error")}finally{r(null)}}};return s.jsx("div",{className:`flex flex-wrap gap-1 mt-1 ${t?"justify-end":"justify-start"}`,children:e.emojiLikesList.map((i,o)=>{const a=Kg(i.emojiId,i.emojiType);return s.jsxs("button",{onClick:()=>l(i.emojiId,i.isClicked),disabled:n===i.emojiId,className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-xs transition-all cursor-pointer hover:scale-105 active:scale-95 ${i.isClicked?"bg-pink-100 dark:bg-pink-900/40 border border-pink-300 dark:border-pink-700":"bg-theme-item border border-theme-divider hover:border-pink-300 dark:hover:border-pink-700"} ${n===i.emojiId?"opacity-50":""}`,title:i.isClicked?"点击取消":"点击跟贴",children:[s.jsx("img",{src:a,alt:`表情${i.emojiId}`,className:"w-4 h-4",onError:c=>{if(i.emojiType==="2"){const u=c.target,d=String.fromCodePoint(parseInt(i.emojiId));u.style.display="none",u.insertAdjacentHTML("afterend",`<span class="text-sm">${d}</span>`)}}}),s.jsx("span",{className:"text-theme-secondary",children:i.likesCnt})]},`${i.emojiId}-${o}`)})})}),Xg=p.memo(({message:e,onRetry:t})=>{const n=si(),r=n?`https://q1.qlogo.cn/g?b=qq&nk=${n}&s=640`:"";return s.jsxs("div",{className:"flex gap-2 flex-row-reverse w-full",children:[r&&s.jsx("img",{src:r,alt:"我",loading:"lazy",className:"w-8 h-8 rounded-full object-cover flex-shrink-0"}),s.jsxs("div",{className:"flex flex-col items-end max-w-[calc(100%-48px)] md:max-w-[70%] min-w-0 overflow-hidden",children:[s.jsx("span",{className:"text-xs text-theme-hint mb-1",children:"我"}),s.jsxs("div",{className:"flex items-end gap-1",children:[e.status==="failed"&&s.jsx("button",{onClick:t,className:"p-1 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/30 rounded",title:"重新发送",children:s.jsx(oh,{size:14})}),s.jsx("div",{className:"rounded-2xl px-4 py-2 bg-theme-item text-theme rounded-tr-sm min-w-[80px] max-w-full break-words overflow-hidden shadow-sm",children:e.items.map((l,i)=>l.type==="text"&&l.content?s.jsx("span",{className:"whitespace-pre-wrap break-words",children:l.content},i):l.type==="face"&&l.faceId!==void 0?s.jsx("img",{src:`/face/${l.faceId}.png`,alt:`[表情${l.faceId}]`,className:"inline-block align-text-bottom",style:{width:24,height:24}},i):l.type==="image"&&l.imageUrl?s.jsx("img",{src:l.imageUrl,alt:"图片",loading:"lazy",className:"max-w-full rounded-lg",style:{maxHeight:"200px"}},i):l.type==="at"&&l.atName?s.jsxs("span",{className:"text-blue-500",children:["@",l.atName]},i):null)}),e.status==="sending"&&s.jsx(Se,{size:14,className:"animate-spin text-theme-hint"}),e.status==="failed"&&s.jsx(Jm,{size:14,className:"text-red-500"})]}),s.jsx("span",{className:"text-xs text-theme-hint mt-1",children:li(e.timestamp)})]})]})}),Jg=({name:e,onMute:t,onClose:n})=>{const[r,l]=p.useState(0),[i,o]=p.useState(0),[a,c]=p.useState(0),[u,d]=p.useState(0),m=()=>{const v=r+i*60+a*3600+u*86400;v>0&&t(v)},f=r+i*60+a*3600+u*86400;return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-50 bg-black/30",onClick:n}),s.jsxs("div",{className:"fixed z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-theme-card backdrop-blur-xl border border-theme-divider rounded-xl shadow-xl p-6 min-w-[340px]",children:[s.jsxs("h3",{className:"text-lg font-medium text-theme mb-4",children:["禁言 ",e]}),s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"text-sm text-theme-secondary mb-3",children:"设置禁言时长:"}),s.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:59,value:r,onChange:v=>l(Math.min(59,Math.max(0,parseInt(v.target.value)||0))),className:"w-full px-2 py-2 text-center bg-theme-input border border-theme-input rounded-lg text-theme focus:outline-none focus:ring-2 focus:ring-pink-500/20"}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"秒"})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:59,value:i,onChange:v=>o(Math.min(59,Math.max(0,parseInt(v.target.value)||0))),className:"w-full px-2 py-2 text-center bg-theme-input border border-theme-input rounded-lg text-theme focus:outline-none focus:ring-2 focus:ring-pink-500/20"}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"分钟"})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:23,value:a,onChange:v=>c(Math.min(23,Math.max(0,parseInt(v.target.value)||0))),className:"w-full px-2 py-2 text-center bg-theme-input border border-theme-input rounded-lg text-theme focus:outline-none focus:ring-2 focus:ring-pink-500/20"}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"小时"})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:29,value:u,onChange:v=>d(Math.min(29,Math.max(0,parseInt(v.target.value)||0))),className:"w-full px-2 py-2 text-center bg-theme-input border border-theme-input rounded-lg text-theme focus:outline-none focus:ring-2 focus:ring-pink-500/20"}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"天"})]})]}),s.jsx("p",{className:"text-xs text-theme-secondary mt-2 text-center",children:"最长29天23小时59分59秒"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("button",{onClick:()=>t(0),className:"px-4 py-2 text-sm text-green-500 hover:bg-green-50 dark:hover:bg-green-900/30 rounded-lg transition-colors",children:"解除禁言"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:n,className:"px-4 py-2 text-sm text-theme-secondary hover:bg-theme-item rounded-lg transition-colors",children:"取消"}),s.jsx("button",{onClick:m,disabled:f===0,className:"px-4 py-2 text-sm bg-orange-500 text-white hover:bg-orange-600 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"确认禁言"})]})]})]})]}),document.body)},Zg=({name:e,groupName:t,onConfirm:n,onClose:r})=>Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:r}),s.jsxs("div",{className:"fixed z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-theme-card border border-theme-divider rounded-xl shadow-xl p-6 min-w-[320px]",children:[s.jsx("h3",{className:"text-lg font-medium text-theme mb-4",children:"确认踢出"}),s.jsxs("p",{className:"text-theme-secondary mb-6",children:["确定要将 ",s.jsx("span",{className:"font-medium text-theme",children:e})," 移出群 ",s.jsx("span",{className:"font-medium text-theme",children:t})," 吗?"]}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx("button",{onClick:r,className:"px-4 py-2 text-sm text-theme-secondary hover:bg-theme-item rounded-lg transition-colors",children:"取消"}),s.jsx("button",{onClick:n,className:"px-4 py-2 text-sm bg-red-500 text-white hover:bg-red-600 rounded-lg transition-colors",children:"确认踢出"})]})]})]}),document.body),ey=({name:e,onConfirm:t,onClose:n})=>{const[r,l]=p.useState("");return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-50 bg-black/30",onClick:n}),s.jsxs("div",{className:"fixed z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-theme-card backdrop-blur-xl border border-theme-divider rounded-xl shadow-xl p-6 min-w-[320px]",children:[s.jsx("h3",{className:"text-lg font-medium text-theme mb-4",children:"设置头衔"}),s.jsxs("p",{className:"text-sm text-theme-secondary mb-3",children:["为 ",e," 设置专属头衔:"]}),s.jsx("input",{type:"text",maxLength:12,value:r,onChange:i=>l(i.target.value),placeholder:"留空清除头衔",className:"w-full px-3 py-2 bg-theme-input border border-theme-input rounded-lg text-theme focus:outline-none focus:ring-2 focus:ring-pink-500/20 placeholder:text-theme-hint",autoFocus:!0,onKeyDown:i=>{i.key==="Enter"&&t(r.trim())}}),s.jsx("p",{className:"text-xs text-theme-secondary mt-2",children:"中文最多6字,英文最多12字,按回车确认"}),s.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[s.jsx("button",{onClick:n,className:"px-4 py-2 text-sm text-theme-secondary hover:bg-theme-item rounded-lg transition-colors",children:"取消"}),s.jsx("button",{onClick:()=>t(r.trim()),className:"px-4 py-2 text-sm bg-pink-500 text-white hover:bg-pink-600 rounded-lg transition-colors",children:"确认"})]})]})]}),document.body)};function lf(e,t,n){const[r,l]=p.useState({left:-9999,top:-9999,ready:!1});return p.useEffect(()=>{l({left:-9999,top:-9999,ready:!1});const i=requestAnimationFrame(()=>{if(!n.current){l({left:e,top:t,ready:!0});return}const o=n.current.getBoundingClientRect(),a=10;let c=e,u=t;e+o.width>window.innerWidth-a&&(c=e-o.width),c<a&&(c=a),t+o.height>window.innerHeight-a&&(u=t-o.height),u<a&&(u=a),l({left:c,top:u,ready:!0})});return()=>cancelAnimationFrame(i)},[e,t]),r}const ty=({contextMenu:e,session:t,getCachedMembers:n,onClose:r,onReply:l,onEmojiReaction:i,onRecall:o})=>{const a=e.message,c=cr(),u=c&&a.senderUid===c,d=a.chatType===2,m=d&&t?n(t.peerId):null,f=m&&c?m.find(T=>T.uid===c):null,v=f==null?void 0:f.role,k=v==="owner",w=v==="admin"||v==="owner",j=m?m.find(T=>T.uid===a.senderUid):null,x=j==null?void 0:j.role,g=u||d&&(k||w&&!(x==="admin"||x==="owner")),y=!!e.elementId,N=p.useRef(null),S=lf(e.x,e.y,N),P=async()=>{if(e.elementId){r();try{const T=await re("ntFileApi","downloadMedia",[a.msgId,a.chatType,a.peerUid,e.elementId,"",""]);if(!T){Y("图片下载失败","error");return}const O=await re("ntMsgApi","addFavEmoji",[T]);O.result===0?Y(O.isExist?"表情已存在":"已添加到表情","success"):Y(O.errMsg||"添加失败","error")}catch(T){Y(T.message||"添加失败","error")}}};return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40",onClick:r,onContextMenu:T=>{T.preventDefault(),r()}}),s.jsxs("div",{ref:N,className:"fixed z-50 bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[100px]",style:{left:S.left,top:S.top,visibility:S.ready?"visible":"hidden"},onContextMenu:T=>T.preventDefault(),children:[s.jsxs("button",{onClick:()=>{l(a),r()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(ah,{size:14})," 回复"]}),t.chatType===2&&s.jsxs("button",{onClick:()=>{i(a,e.x,e.y),r()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(dh,{size:14})," 贴表情"]}),y&&s.jsxs("button",{onClick:P,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(mh,{size:14})," 添加到表情"]}),g&&s.jsxs("button",{onClick:async()=>{r();try{await Th(a.chatType,a.peerUid,a.msgId),o(a.msgId),Y("消息已撤回","success")}catch(T){Y(T.message||"撤回失败","error")}},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-500 hover:bg-theme-item-hover transition-colors",children:[s.jsx(It,{size:14})," 撤回"]})]})]}),document.body)},ny=({avatarContextMenu:e,getCachedMembers:t,onClose:n,onInsertAt:r,onShowProfile:l,onSetTitle:i,onMute:o,onKick:a,onAdminChanged:c,groupName:u})=>{const d=cr(),m=e.groupCode?t(e.groupCode):null,f=m&&d?m.find(R=>R.uid===d):null,v=f==null?void 0:f.role,k=v==="owner",w=v==="admin",j=m?m.find(R=>R.uid===e.senderUid):null,x=j==null?void 0:j.role,h=x==="admin",g=k||w&&x==="member",y=k||w&&x==="member",N=e.senderUid===d,S=k&&!N,P=p.useRef(null),T=lf(e.x,e.y,P),O=async()=>{const R=e;n();try{const V=h?2:3;await re("ntGroupApi","setMemberRole",[R.groupCode,R.senderUid,V]),Y(h?"已取消管理员":"已设为管理员","success"),c==null||c()}catch(V){Y(V.message||"操作失败","error")}};return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40",onClick:n,onContextMenu:R=>{R.preventDefault(),n()}}),s.jsxs("div",{ref:P,className:"fixed z-50 bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[120px]",style:{left:T.left,top:T.top,visibility:T.ready?"visible":"hidden"},onContextMenu:R=>R.preventDefault(),children:[e.chatType===2&&s.jsxs("button",{onClick:()=>{r(e.senderUid,e.senderUin,e.senderName),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(Zm,{size:14})," 召唤ta"]}),s.jsxs("button",{onClick:async()=>{const R=e;n();try{R.chatType===2&&R.groupCode?await Fl(R.chatType,parseInt(R.senderUin),parseInt(R.groupCode)):await Fl(R.chatType,parseInt(R.senderUin))}catch(V){Y(V.message||"戳一戳失败","error")}},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(th,{size:14})," 戳一戳"]}),s.jsxs("button",{onClick:()=>{l(e.senderUid,e.senderUin,e.x,e.y,e.groupCode),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(fh,{size:14})," 查看资料"]}),e.chatType===2&&e.groupCode&&k&&s.jsxs("button",{onClick:()=>{i(e.senderUid,e.senderName,e.groupCode),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(n0,{size:14})," 设置头衔"]}),e.chatType===2&&e.groupCode&&S&&s.jsxs("button",{onClick:O,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[h?s.jsx(j0,{size:14}):s.jsx(ds,{size:14}),h?"取消管理员":"设为管理员"]}),e.chatType===2&&e.groupCode&&!N&&g&&s.jsxs("button",{onClick:()=>{o(e.senderUid,e.senderName,e.groupCode),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-orange-500 hover:bg-theme-item-hover transition-colors",children:[s.jsx(E0,{size:14})," 禁言"]}),e.chatType===2&&e.groupCode&&!N&&y&&s.jsxs("button",{onClick:()=>{a(e.senderUid,e.senderName,e.groupCode,u||e.groupCode),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-500 hover:bg-theme-item-hover transition-colors",children:[s.jsx(S0,{size:14})," 踢出群"]})]})]}),document.body)},of=p.forwardRef(({placeholder:e="输入消息...",disabled:t=!1,onEnter:n,onPaste:r,onChange:l,onMentionChange:i},o)=>{const a=p.useRef(null),c=p.useRef(!1),u=p.useRef(null),[d,m]=p.useState(!1),f=p.useCallback(()=>{const b=a.current;if(!b)return[];const E=[],_=b.childNodes;for(let U=0;U<_.length;U++){const D=_[U];if(D.nodeType===Node.TEXT_NODE){const q=(D.textContent||"").replace(/\u200B/g,"");q&&E.push({type:"text",content:q})}else if(D.nodeType===Node.ELEMENT_NODE){const I=D;if(I.dataset.type==="face")E.push({type:"face",faceId:parseInt(I.dataset.faceId||"0")});else if(I.dataset.type==="image")E.push({type:"image",imageUrl:I.dataset.imageUrl,imageFile:I.__file});else if(I.dataset.type==="at")E.push({type:"at",atUid:I.dataset.atUid,atUin:I.dataset.atUin,atName:I.dataset.atName});else if(I.tagName==="BR")E.push({type:"text",content:`
|
|
440
|
-
`});else{const K=(
|
|
441
|
-
`||
|
|
439
|
+
color: hsl(${Math.max(0,Math.min(120-120*j,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(l),i=!1,l}return o.updateDeps=a=>{r=a},o}function zu(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const jg=(e,t)=>Math.abs(e-t)<1.01,Ng=(e,t,n)=>{let r;return function(...l){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,l),n)}},Lu=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},bg=e=>e,Sg=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let l=t;l<=n;l++)r.push(l);return r},Cg=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const l=o=>{const{width:a,height:c}=o;t({width:Math.round(a),height:Math.round(c)})};if(l(Lu(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(o=>{const a=()=>{const c=o[0];if(c!=null&&c.borderBoxSize){const u=c.borderBoxSize[0];if(u){l({width:u.inlineSize,height:u.blockSize});return}}l(Lu(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Ru={passive:!0},_u=typeof window>"u"?!0:"onscrollend"in window,Eg=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let l=0;const i=e.options.useScrollendEvent&&_u?()=>{}:Ng(r,()=>{t(l,!1)},e.options.isScrollingResetDelay),o=d=>()=>{const{horizontal:m,isRtl:f}=e.options;l=m?n.scrollLeft*(f&&-1||1):n.scrollTop,i(),t(l,d)},a=o(!0),c=o(!1);n.addEventListener("scroll",a,Ru);const u=e.options.useScrollendEvent&&_u;return u&&n.addEventListener("scrollend",c,Ru),()=>{n.removeEventListener("scroll",a),u&&n.removeEventListener("scrollend",c)}},Mg=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Tg=(e,{adjustments:t=0,behavior:n},r)=>{var l,i;const o=e+t;(i=(l=r.scrollElement)==null?void 0:l.scrollTo)==null||i.call(l,{[r.options.horizontal?"left":"top"]:o,behavior:n})};class Ig{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(l=>{l.forEach(i=>{const o=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var l;(l=r())==null||l.disconnect(),n=null},observe:l=>{var i;return(i=r())==null?void 0:i.observe(l,{box:"border-box"})},unobserve:l=>{var i;return(i=r())==null?void 0:i.unobserve(l)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,l])=>{typeof l>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:bg,rangeExtractor:Sg,onChange:()=>{},measureElement:Mg,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,l;(l=(r=this.options).onChange)==null||l.call(r,this,n)},this.maybeNotify=zn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=i,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const l=new Map,i=new Map;for(let o=r-1;o>=0;o--){const a=n[o];if(l.has(a.lane))continue;const c=i.get(a.lane);if(c==null||a.end>c.end?i.set(a.lane,a):a.end<c.end&&l.set(a.lane,!0),l.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((o,a)=>o.end===a.end?o.index-a.index:o.end-a.end)[0]:void 0},this.getMeasurementOptions=zn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,l,i,o,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:l,getItemKey:i,enabled:o,lanes:a}),{key:!1}),this.getMeasurements=zn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:l,getItemKey:i,enabled:o,lanes:a},c)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const f of this.laneAssignments.keys())f>=n&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const d=this.measurementsCache.slice(0,u),m=new Array(a).fill(void 0);for(let f=0;f<u;f++){const y=d[f];y&&(m[y.lane]=f)}for(let f=u;f<n;f++){const y=i(f),w=this.laneAssignments.get(f);let k,j;if(w!==void 0&&this.options.lanes>1){k=w;const v=m[k],N=v!==void 0?d[v]:void 0;j=N?N.end+this.options.gap:r+l}else{const v=this.options.lanes===1?d[f-1]:this.getFurthestMeasurement(d,f);j=v?v.end+this.options.gap:r+l,k=v?v.lane:f%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(f,k)}const g=c.get(y),h=typeof g=="number"?g:this.options.estimateSize(f),x=j+h;d[f]={index:f,start:j,size:h,end:x,key:y,lane:k},m[k]=f}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=zn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,l,i)=>this.range=n.length>0&&r>0?Pg({measurements:n,outerSize:r,scrollOffset:l,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=zn(()=>{let n=null,r=null;const l=this.calculateRange();return l&&(n=l.startIndex,r=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,l,i,o)=>i===null||o===null?[]:n({startIndex:i,endIndex:o,overscan:r,count:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,l=n.getAttribute(r);return l?parseInt(l,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const l=this.indexFromElement(n),i=this.measurementsCache[l];if(!i)return;const o=i.key,a=this.elementsCache.get(o);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(o,n)),n.isConnected&&this.resizeItem(l,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const l=this.measurementsCache[n];if(!l)return;const i=this.itemSizeCache.get(l.key)??l.size,o=r-i;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,o,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,l)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(l))});return}this._measureElement(n,void 0)},this.getVirtualItems=zn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const l=[];for(let i=0,o=n.length;i<o;i++){const a=n[i],c=r[a];l.push(c)}return l},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return zu(r[Bh(0,r.length-1,l=>zu(r[l]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,l=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),o=this.getScrollOffset();r==="auto"&&(r=n>=o+i?"end":"start"),r==="center"?n+=(l-i)/2:r==="end"&&(n-=i);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const l=this.measurementsCache[n];if(!l)return;const i=this.getSize(),o=this.getScrollOffset();if(r==="auto")if(l.end>=o+i-this.options.scrollPaddingEnd)r="end";else if(l.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,l.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:l}={})=>{l==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:l})},this.scrollToIndex=(n,{align:r="auto",behavior:l}={})=>{l==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let i=0;const o=10,a=u=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(n,u);if(!d){console.warn("Failed to get offset for index:",n);return}const[m,f]=d;this._scrollToOffset(m,{adjustments:void 0,behavior:l}),this.targetWindow.requestAnimationFrame(()=>{const y=()=>{if(this.currentScrollToIndex!==n)return;const w=this.getScrollOffset(),k=this.getOffsetForIndex(n,f);if(!k){console.warn("Failed to get offset for index:",n);return}jg(k[0],w)||c(f)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(y):y()})},c=u=>{this.targetWindow&&this.currentScrollToIndex===n&&(i++,i<o?this.targetWindow.requestAnimationFrame(()=>a(u)):console.warn(`Failed to scroll to index ${n} after ${o} attempts.`))};a(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let l;if(r.length===0)l=this.options.paddingStart;else if(this.options.lanes===1)l=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let o=r.length-1;for(;o>=0&&i.some(a=>a===null);){const a=r[o];i[a.lane]===null&&(i[a.lane]=a.end),o--}l=Math.max(...i.filter(a=>a!==null))}return Math.max(l-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:l})=>{this.options.scrollToFn(n,{behavior:l,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const Bh=(e,t,n,r)=>{for(;e<=t;){const l=(e+t)/2|0,i=n(l);if(i<r)e=l+1;else if(i>r)t=l-1;else return l}return e>0?e-1:0};function Pg({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const l=e.length-1,i=c=>e[c].start;if(e.length<=r)return{startIndex:0,endIndex:l};let o=Bh(0,l,i,n),a=o;if(r===1)for(;a<l&&e[a].end<n+t;)a++;else if(r>1){const c=Array(r).fill(0);for(;a<l&&c.some(d=>d<n+t);){const d=e[a];c[d.lane]=d.end,a++}const u=Array(r).fill(n+t);for(;o>=0&&u.some(d=>d>=n);){const d=e[o];u[d.lane]=d.start,o--}o=Math.max(0,o-o%r),a=Math.min(l,a+(r-1-a%r))}return{startIndex:o,endIndex:a}}const Au=typeof document<"u"?p.useLayoutEffect:p.useEffect;function zg({useFlushSync:e=!0,...t}){const n=p.useReducer(()=>({}),{})[1],r={...t,onChange:(i,o)=>{var a;e&&o?Ie.flushSync(n):n(),(a=t.onChange)==null||a.call(t,i,o)}},[l]=p.useState(()=>new Ig(r));return l.setOptions(r),Au(()=>l._didMount(),[]),Au(()=>l._willUpdate()),l}function Vh(e){return zg({observeElementRect:Cg,observeElementOffset:Eg,scrollToFn:Tg,...e})}const Lg="webqq-messages",Rg=1,lr="messages",Qh=100;let qs=null;function Gh(){return qs?Promise.resolve(qs):new Promise((e,t)=>{const n=indexedDB.open(Lg,Rg);n.onerror=()=>t(n.error),n.onsuccess=()=>{qs=n.result,e(qs)},n.onupgradeneeded=r=>{const l=r.target.result;l.objectStoreNames.contains(lr)||l.createObjectStore(lr,{keyPath:"chatKey"})}})}async function fs(e,t){try{const n=await Gh(),r=`${e}_${t}`;return new Promise(l=>{const a=n.transaction(lr,"readonly").objectStore(lr).get(r);a.onsuccess=()=>{const c=a.result;c&&c.messages?l(c.messages):l(null)},a.onerror=()=>l(null)})}catch{return null}}async function kn(e,t,n){try{const r=await Gh(),l=`${e}_${t}`,i=n.slice(-Qh);return new Promise((o,a)=>{const d=r.transaction(lr,"readwrite").objectStore(lr).put({chatKey:l,messages:i,timestamp:Date.now()});d.onsuccess=()=>o(),d.onerror=()=>a(d.error)})}catch(r){console.error("Failed to cache messages:",r)}}async function Kh(e,t,n){try{const r=await fs(e,t);if(r){const l=[...r.slice(-(Qh-1)),n];await kn(e,t,l)}}catch(r){console.error("Failed to append message:",r)}}async function _g(e,t,n){try{const r=await fs(e,t);if(r){const l=r.filter(i=>i.msgId!==n);await kn(e,t,l)}}catch(r){console.error("Failed to remove message:",r)}}async function Ag(e,t,n,r,l){try{const i=await fs(e,t);if(!i)return;const o=i.map(a=>{if(a.msgSeq!==n)return a;const c=a.emojiLikesList||[];if(l){const u=c.findIndex(d=>d.emojiId===r);if(u>=0){const d=[...c];return d[u]={...d[u],likesCnt:String(parseInt(d[u].likesCnt)+1)},{...a,emojiLikesList:d}}else return{...a,emojiLikesList:[...c,{emojiId:r,emojiType:parseInt(r)>999?"2":"1",likesCnt:"1",isClicked:!1}]}}else{const u=c.findIndex(d=>d.emojiId===r);if(u>=0){const d=[...c],m=parseInt(d[u].likesCnt)-1;return m<=0?d.splice(u,1):d[u]={...d[u],likesCnt:String(m)},{...a,emojiLikesList:d}}}return a});await kn(e,t,o)}catch(i){console.error("Failed to update emoji reaction:",i)}}async function Fg(e,t,n,r){try{const l=await fs(e,t);if(!l)return!1;let i=!1;const o=l.map(a=>a.msgId===n||r&&a.msgSeq===r?(i=!0,{...a,recallTime:String(Math.floor(Date.now()/1e3))}):a);return i&&await kn(e,t,o),i}catch(l){return console.error("Failed to mark message as recalled:",l),!1}}const $g=({level:e})=>{const t=e%4,n=Math.floor(e/4)%4,r=Math.floor(e/16)%4,l=Math.floor(e/64)%4,i=Math.floor(e/256),o=[];for(let a=0;a<i;a++)o.push(s.jsx("span",{className:"text-amber-400 text-xs font-bold",title:"金企鹅",children:"🐧"},`penguin-${a}`));for(let a=0;a<l;a++)o.push(s.jsx(ri,{size:14,className:"text-amber-500"},`crown-${a}`));for(let a=0;a<r;a++)o.push(s.jsx(hh,{size:14,className:"text-orange-400"},`sun-${a}`));for(let a=0;a<n;a++)o.push(s.jsx(sh,{size:14,className:"text-blue-400"},`moon-${a}`));for(let a=0;a<t;a++)o.push(s.jsx(mh,{size:14,className:"text-yellow-400 fill-yellow-400"},`star-${a}`));return s.jsx("div",{className:"flex items-center gap-0.5 flex-wrap",children:o})},Yh=({profile:e,loading:t,position:n,onClose:r,isFriend:l,onFriendDeleted:i})=>{const o=p.useRef(null),[a,c]=p.useState({left:n.x,top:n.y}),[u,d]=p.useState(!1),[m,f]=p.useState(!1);if(p.useEffect(()=>{if(!o.current)return;const x=320,v=o.current.offsetHeight||400;let N=n.x,S=n.y;N+x>window.innerWidth-20&&(N=window.innerWidth-x-20),N<20&&(N=20),S+v>window.innerHeight-20&&(S=window.innerHeight-v-20),S<20&&(S=20),c({left:N,top:S})},[n,e,t]),!e&&!t)return null;const y=x=>x===1?"男":x===2?"女":"",w=x=>{if(!x)return"";const v=new Date(x*1e3),N=new Date,S=N.getFullYear()-v.getFullYear(),T=N.getMonth()-v.getMonth(),M=S+(T<0?-1:0);if(M<1){const q=S*12+T;return q>0?`${q}个月`:"不足1个月"}return`${M}年`},k=x=>x==="owner"?"群主":x==="admin"?"管理员":"",j=x=>x==="owner"?"bg-amber-500 text-white":x==="admin"?"bg-green-500 text-white":"",g=async()=>{if(e){f(!0);try{await Oh(e.uid),Y("已删除好友","success"),i==null||i(e.uid),r()}catch(x){Y(x.message||"删除好友失败","error")}finally{f(!1),d(!1)}}},h=x=>x?new Date(x*1e3).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"";return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40",onClick:r}),s.jsxs("div",{ref:o,className:"fixed z-50 border border-theme-divider rounded-xl shadow-xl overflow-hidden bg-popup backdrop-blur-sm",style:{left:a.left,top:a.top,width:320,maxHeight:"calc(100vh - 40px)"},onClick:x=>x.stopPropagation(),children:[t?s.jsx("div",{className:"flex items-center justify-center h-40",children:s.jsx(Se,{size:24,className:"animate-spin text-pink-500"})}):e&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bg-gradient-to-r from-pink-400 to-amber-300 p-4 relative",children:[l&&!e.groupRole&&s.jsx("button",{onClick:()=>d(!0),className:"absolute top-2 right-2 p-1.5 rounded-full bg-white/20 hover:bg-white/40 text-white transition-colors",title:"删除好友",children:s.jsx(It,{size:16})}),s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("img",{src:e.avatar,alt:e.nickname,className:"w-16 h-16 rounded-full border-3 border-white/80 object-cover flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0 text-white pt-1",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"font-bold text-lg truncate",children:e.nickname}),e.groupRole&&k(e.groupRole)&&s.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded flex-shrink-0 ${j(e.groupRole)}`,children:k(e.groupRole)})]}),e.remark&&e.remark!==e.nickname&&s.jsxs("div",{className:"text-white/80 text-sm truncate mb-1",children:["备注: ",e.remark]}),s.jsx("div",{className:"text-white/90 text-sm",children:e.uin}),e.qid&&s.jsxs("div",{className:"text-white/70 text-xs mt-0.5",children:["QID: ",e.qid]})]})]})]}),s.jsxs("div",{className:"p-4 overflow-y-auto",style:{maxHeight:"calc(100vh - 40px - 120px)"},children:[e.signature&&s.jsx("div",{className:"text-theme-secondary text-sm mb-3 bg-theme-item/50 rounded-lg px-3 py-2 max-h-24 overflow-y-auto break-words",children:e.signature}),s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[y(e.sex)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"性别"}),s.jsx("span",{className:"text-theme",children:y(e.sex)})]}),e.birthday&&e.birthday!=="0-0-0"&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"生日"}),s.jsx("span",{className:"text-theme",children:e.birthday})]}),w(e.regTime)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"Q龄"}),s.jsx("span",{className:"text-theme",children:w(e.regTime)})]}),e.level>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"等级"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-theme",children:["Lv.",e.level]}),s.jsx($g,{level:e.level})]})]})]}),(e.groupCard||e.groupTitle||e.groupLevel)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-theme-divider my-3"}),s.jsx("div",{className:"text-xs text-theme-hint mb-2",children:"群信息"}),s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.groupCard&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"群名片"}),s.jsx("span",{className:"text-theme truncate",children:e.groupCard})]}),e.groupTitle&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"群头衔"}),s.jsx("span",{className:"text-pink-500",children:e.groupTitle})]}),e.groupLevel!==void 0&&e.groupLevel>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"群等级"}),s.jsxs("span",{className:"text-theme",children:["Lv.",e.groupLevel]})]}),e.joinTime&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"入群时间"}),s.jsx("span",{className:"text-theme",children:h(e.joinTime)})]}),e.lastSpeakTime&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-theme-hint",children:"最后发言"}),s.jsx("span",{className:"text-theme",children:h(e.lastSpeakTime)})]})]})]})]})]}),u&&e&&s.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center rounded-xl",children:s.jsxs("div",{className:"bg-popup m-4 p-4 rounded-lg shadow-lg max-w-[280px]",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("span",{className:"font-medium text-theme",children:"删除好友"}),s.jsx("button",{onClick:()=>d(!1),className:"text-theme-muted hover:text-theme",children:s.jsx(ht,{size:18})})]}),s.jsxs("p",{className:"text-sm text-theme-secondary mb-4",children:["确定要删除好友 ",s.jsx("span",{className:"font-medium text-theme",children:e.remark||e.nickname})," 吗?删除后将无法恢复。"]}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx("button",{onClick:()=>d(!1),className:"px-3 py-1.5 text-sm rounded-lg bg-theme-item hover:bg-theme-hover text-theme transition-colors",disabled:m,children:"取消"}),s.jsxs("button",{onClick:g,className:"px-3 py-1.5 text-sm rounded-lg bg-red-500 hover:bg-red-600 text-white transition-colors flex items-center gap-1",disabled:m,children:[m&&s.jsx(Se,{size:14,className:"animate-spin"}),"删除"]})]})]})})]})]}),document.body)},Ug=({profile:e,loading:t,position:n,onClose:r,onQuitGroup:l})=>{const i=p.useRef(null),[o,a]=p.useState({left:n.x,top:n.y}),[c,u]=p.useState(!1),d=li(),m=(e==null?void 0:e.ownerUin)===d;if(p.useEffect(()=>{if(!i.current)return;const k=320,j=i.current.offsetHeight||300;let g=n.x,h=n.y;g+k>window.innerWidth-20&&(g=window.innerWidth-k-20),g<20&&(g=20),h+j>window.innerHeight-20&&(h=window.innerHeight-j-20),h<20&&(h=20),a({left:g,top:h})},[n,e,t]),!e&&!t)return null;const f=k=>k?new Date(k*1e3).toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}):"",y=()=>{u(!0)},w=()=>{e&&l&&l(e.groupCode,m),u(!1),r()};return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40",onClick:r}),s.jsx("div",{ref:i,className:"fixed z-50 border border-theme-divider rounded-xl shadow-xl overflow-hidden bg-popup backdrop-blur-sm",style:{left:o.left,top:o.top,width:320,maxHeight:"calc(100vh - 40px)"},onClick:k=>k.stopPropagation(),children:t?s.jsx("div",{className:"flex items-center justify-center h-40",children:s.jsx(Se,{size:24,className:"animate-spin text-pink-500"})}):e&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bg-gradient-to-r from-blue-400 to-cyan-300 p-4 relative",children:[l&&s.jsx("button",{onClick:y,className:"absolute top-3 right-3 p-1.5 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors",title:m?"解散该群":"退出该群",children:s.jsx(x0,{size:16})}),s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("img",{src:e.avatar,alt:e.groupName,className:"w-16 h-16 rounded-lg border-3 border-white/80 object-cover flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0 text-white pt-1 pr-6",children:[s.jsx("div",{className:"font-bold text-lg truncate mb-1",children:e.groupName}),e.remarkName&&e.remarkName!==e.groupName&&s.jsxs("div",{className:"text-white/80 text-sm truncate mb-1",children:["备注: ",e.remarkName]}),s.jsx("div",{className:"text-white/90 text-sm",children:e.groupCode})]})]})]}),s.jsxs("div",{className:"p-4 overflow-y-auto",style:{maxHeight:"calc(100vh - 40px - 140px)"},children:[s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[s.jsxs("span",{className:"text-theme-hint flex items-center gap-1",children:[s.jsx(si,{size:14}),"成员"]}),s.jsxs("span",{className:"text-theme",children:[e.memberCount,e.maxMemberCount?` / ${e.maxMemberCount}`:""]}),e.ownerName&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-theme-hint flex items-center gap-1",children:[s.jsx(ri,{size:14}),"群主"]}),s.jsx("span",{className:"text-theme truncate",children:e.ownerName})]}),e.createTime&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-theme-hint flex items-center gap-1",children:[s.jsx(o0,{size:14}),"创建"]}),s.jsx("span",{className:"text-theme",children:f(e.createTime)})]})]}),e.description&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-theme-divider my-3"}),s.jsx("div",{className:"text-xs text-theme-hint mb-2",children:"群简介"}),s.jsx("div",{className:"text-theme-secondary text-sm bg-theme-item/50 rounded-lg px-3 py-2 break-words whitespace-pre-wrap",style:{maxHeight:"120px",overflowY:"auto"},children:e.description})]}),e.announcement&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-theme-divider my-3"}),s.jsxs("div",{className:"text-xs text-theme-hint mb-2 flex items-center gap-1",children:[s.jsx(ms,{size:12}),"群公告"]}),s.jsx("div",{className:"text-theme-secondary text-sm bg-theme-item/50 rounded-lg px-3 py-2 break-words whitespace-pre-wrap",style:{maxHeight:"120px",overflowY:"auto"},children:e.announcement})]})]})]})}),c&&e&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-[60] bg-black/50",onClick:()=>u(!1)}),s.jsxs("div",{className:"fixed z-[70] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-theme-card border border-theme-divider rounded-xl shadow-xl p-6 min-w-[320px]",children:[s.jsx("h3",{className:"text-lg font-medium text-theme mb-4",children:m?"确认解散群聊":"确认退出群聊"}),s.jsx("p",{className:"text-theme-secondary mb-6",children:m?s.jsxs(s.Fragment,{children:["确定要解散群 ",s.jsx("span",{className:"font-medium text-theme",children:e.groupName})," 吗?此操作不可撤销,所有群成员将被移出。"]}):s.jsxs(s.Fragment,{children:["确定要退出群 ",s.jsx("span",{className:"font-medium text-theme",children:e.groupName})," 吗?"]})}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx("button",{onClick:()=>u(!1),className:"px-4 py-2 text-sm text-theme-secondary hover:bg-theme-item rounded-lg transition-colors",children:"取消"}),s.jsx("button",{onClick:w,className:"px-4 py-2 text-sm bg-red-500 hover:bg-red-600 text-white rounded-lg transition-colors",children:m?"确认解散":"确认退出"})]})]})]})]}),document.body)},Dg=({url:e,onClose:t})=>e?Ie.createPortal(s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:t,children:[s.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-white/80 hover:text-white bg-black/50 rounded-full",children:s.jsx(ht,{size:24})}),s.jsx("img",{src:e,alt:"预览",className:"max-w-[90vw] max-h-[90vh] object-contain",onClick:n=>n.stopPropagation()})]}),document.body):null,Og=({videoInfo:e,onClose:t})=>{const[n,r]=p.useState(null),[l,i]=p.useState(!1),[o,a]=p.useState(null);return p.useEffect(()=>{if(!e){r(null),a(null);return}i(!0),a(null),Eh(e.chatType,e.peerUid,e.msgId,e.elementId).then(r).catch(c=>a(c.message||"获取视频失败")).finally(()=>i(!1))},[e]),e?Ie.createPortal(s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:t,children:[s.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-white/80 hover:text-white bg-black/50 rounded-full z-10",children:s.jsx(ht,{size:24})}),l&&s.jsxs("div",{className:"text-white flex items-center gap-2",children:[s.jsx(Se,{size:24,className:"animate-spin"}),"加载中..."]}),o&&s.jsx("div",{className:"text-red-400",children:o}),n&&!l&&s.jsx("video",{src:n,controls:!0,autoPlay:!0,className:"max-w-[90vw] max-h-[90vh]",onClick:c=>c.stopPropagation()})]}),document.body):null},Xh=ce.createContext(null),Jh=ce.createContext(null),Zh=ce.createContext(null),qg=e=>e?e.startsWith("blob:")?e:e.includes("qpic.cn")||e.includes("multimedia.nt.qq.com.cn")?`/api/webqq/image-proxy?url=${encodeURIComponent(e)}&token=${encodeURIComponent(hs()||"")}`:e:"",Wi=p.memo(({element:e,message:t})=>{var y;const[n,r]=p.useState(!1),[l,i]=p.useState(!1),[o,a]=p.useState(!1),[c,u]=p.useState(!1),d=ce.useContext(Xh),m=ce.useContext(Jh),f=ce.useContext(Zh);if(e.textElement)return s.jsx("span",{className:"whitespace-pre-wrap break-all",style:{overflowWrap:"anywhere",wordBreak:"break-all"},children:e.textElement.content});if(e.picElement){const w=e.picElement;let k=w.originImageUrl?w.originImageUrl.startsWith("http")?w.originImageUrl:`https://gchat.qpic.cn${w.originImageUrl}`:"";const j=qg(k),g=200,h=300;let x=w.picWidth||200,v=w.picHeight||200;v>g&&(x=x*g/v,v=g),x>h&&(v=v*h/x,x=h);const N=S=>{t&&(S.preventDefault(),S.stopPropagation(),f==null||f.showMenu(S,t,e.elementId))};return s.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-theme-item cursor-pointer",style:{width:x,height:v},onClick:()=>d==null?void 0:d.showPreview(j),onContextMenu:N,children:[!n&&!l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-theme-hint",children:s.jsx(Se,{size:24,className:"animate-spin"})}),l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-theme-hint text-xs",children:"图片加载失败"}),s.jsx("img",{src:j,alt:"图片",loading:"lazy",className:`w-full h-full object-cover transition-opacity ${n?"opacity-100":"opacity-0"}`,onLoad:()=>r(!0),onError:()=>i(!0)})]})}if(e.faceElement){const w=e.faceElement.faceIndex,k=e.faceElement.faceText;return s.jsx("img",{src:`/face/${w}.png`,alt:k||`[表情${w}]`,title:k||`表情${w}`,className:"inline-block align-text-bottom",style:{width:24,height:24},onError:j=>{var x;const g=j.target;g.style.display="none";const h=document.createElement("span");h.textContent=k||`[表情${w}]`,(x=g.parentNode)==null||x.insertBefore(h,g)}})}if(e.fileElement)return s.jsxs("span",{children:["[文件: ",e.fileElement.fileName,"]"]});if(e.pttElement)return s.jsx(Bg,{element:e,message:t});if(e.videoElement){const w=e.videoElement,k=200,j=300;let g=w.thumbWidth||200,h=w.thumbHeight||150;h>k&&(g=g*k/h,h=k),g>j&&(h=h*j/g,g=j);let x="";if(w.thumbPath){let q;w.thumbPath instanceof Map?q=w.thumbPath.values().next().value:typeof w.thumbPath=="object"&&(q=Object.values(w.thumbPath)[0]),q&&(x=`/api/webqq/file-proxy?path=${encodeURIComponent(q)}&token=${encodeURIComponent(hs()||"")}`)}const v=w.fileTime||0,N=Math.floor(v/60),S=v%60,T=`${N}:${S.toString().padStart(2,"0")}`,M=()=>{t&&e.elementId&&(m==null||m.showPreview(t.chatType,t.peerUid,t.msgId,e.elementId))};return s.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-theme-item cursor-pointer group",style:{width:g,height:h},onClick:M,children:[s.jsx("div",{className:"absolute inset-0 bg-gray-200 dark:bg-gray-700"}),x?s.jsxs(s.Fragment,{children:[!o&&!c&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-theme-hint",children:s.jsx(Se,{size:24,className:"animate-spin"})}),s.jsx("img",{src:x,alt:"视频缩略图",loading:"lazy",className:`absolute inset-0 w-full h-full object-cover transition-opacity ${o?"opacity-100":"opacity-0"}`,onLoad:()=>a(!0),onError:()=>u(!0)})]}):s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-theme-hint text-xs",children:"视频"}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsx("div",{className:"w-12 h-12 rounded-full bg-black/50 flex items-center justify-center group-hover:bg-black/70 transition-colors",children:s.jsx("div",{className:"w-0 h-0 border-t-8 border-t-transparent border-l-12 border-l-white border-b-8 border-b-transparent ml-1",style:{borderLeftWidth:"14px"}})})}),s.jsx("div",{className:"absolute bottom-1 right-1 px-1.5 py-0.5 bg-black/60 rounded text-white text-xs",children:T})]})}if(e.grayTipElement){const w=e.grayTipElement;if((y=w.jsonGrayTipElement)!=null&&y.jsonStr)try{const k=JSON.parse(w.jsonGrayTipElement.jsonStr);if(k.items){const j=k.items.map(g=>g.txt||"").join("");return s.jsx("span",{className:"text-theme-hint text-xs",children:j||"[戳一戳]"})}}catch{}return s.jsx("span",{className:"text-theme-hint text-xs",children:"[系统提示]"})}if(e.arkElement)return s.jsx("span",{children:"[卡片消息]"});if(e.marketFaceElement){const{emojiId:w,faceName:k,supportSize:j}=e.marketFaceElement,{width:g=200,height:h=200}=(j==null?void 0:j[0])??{},v=`https://gxh.vip.qq.com/club/item/parcel/item/${w.substring(0,2)}/${w}/raw${Math.min(g,300)}.gif`;return s.jsx("img",{src:v,alt:k||"[表情包]",title:k,className:"inline-block align-text-bottom rounded",style:{maxWidth:Math.min(g,200),maxHeight:Math.min(h,200)},onError:N=>{var M;const S=N.target;S.style.display="none";const T=document.createElement("span");T.textContent=`[${k||"表情包"}]`,(M=S.parentNode)==null||M.insertBefore(T,S)}})}return null}),Wg=e=>!!(e.textElement||e.picElement||e.fileElement||e.pttElement||e.videoElement||e.faceElement||e.grayTipElement||e.arkElement||e.marketFaceElement),Hg=e=>!e.elements||e.elements.length===0?!1:e.elements.every(t=>t.grayTipElement||t.replyElement),Bg=({element:e,message:t})=>{const[n,r]=p.useState(null),[l,i]=p.useState(!1),[o,a]=p.useState(!1),[c,u]=p.useState(!1),[d,m]=p.useState(!1),f=p.useRef(null),y=e.pttElement,w=y.duration||0,k=Math.floor(w/60),j=w%60,g=k>0?`${k}:${j.toString().padStart(2,"0")}`:`${j}"`,h=y.text,x=80,N=Math.min(200,Math.max(x,x+w*3)),S=async()=>{if(!(!t||!y.fileUuid||d)){if(c&&f.current){f.current.pause(),u(!1);return}if(f.current&&f.current.readyState>=2){f.current.play(),u(!0);return}m(!0);try{const M=t.chatType===2;console.log("pttElement:",y);const q=Rh(y.fileUuid,M,y.filePath);console.log("音频代理URL:",q);const R=new Audio;f.current=R,R.onended=()=>u(!1),R.onerror=V=>{fetch(q).then(C=>C.text()).then(C=>{console.error("音频加载错误,响应内容:",C.substring(0,200))}).catch(()=>{}),console.error("音频加载错误:",V,R.error,"URL:",q),u(!1),m(!1)},R.onloadeddata=async()=>{m(!1);try{await R.play(),u(!0)}catch(V){console.error("播放失败:",V)}},R.src=q}catch(M){console.error("获取语音URL失败:",M),m(!1)}}},T=async()=>{if(!(!t||l||n!==null)){i(!0),a(!1);try{const M=await Ih(t.msgId,t.chatType,t.peerUid,e);r(M||"(无法识别)")}catch(M){console.error("语音转文字失败:",M),a(!0),r("转换失败")}finally{i(!1)}}};return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-green-100 dark:bg-green-900/40 rounded-full cursor-pointer hover:bg-green-200 dark:hover:bg-green-900/60 transition-colors",style:{width:N},onClick:S,title:"点击播放",children:[d?s.jsx(Se,{size:16,className:"text-green-600 dark:text-green-400 flex-shrink-0 animate-spin"}):c?s.jsx(Uo,{size:16,className:"text-green-600 dark:text-green-400 flex-shrink-0"}):s.jsx(Do,{size:16,className:"text-green-600 dark:text-green-400 flex-shrink-0"}),s.jsx("div",{className:"flex-1 flex items-center gap-0.5",children:[1,2,3,4,5].map(M=>s.jsx("div",{className:`w-0.5 bg-green-400 dark:bg-green-500 rounded-full transition-all ${c?"animate-pulse":""}`,style:{height:`${8+Math.random()*8}px`}},M))}),s.jsx("span",{className:"text-xs text-green-700 dark:text-green-300 flex-shrink-0",children:g})]}),!h&&n===null&&s.jsx("button",{onClick:T,disabled:l,className:"w-6 h-6 flex items-center justify-center rounded-full bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-500 dark:text-gray-300 hover:text-gray-700 dark:hover:text-white text-xs font-medium transition-colors disabled:opacity-50",title:"语音转文字",children:l?s.jsx(Se,{size:12,className:"animate-spin"}):"文"})]}),(h||n)&&s.jsx("div",{className:`text-sm px-3 py-1.5 bg-gray-100 dark:bg-gray-800 rounded-lg max-w-[250px] ${o?"text-red-500":"text-theme-secondary"}`,children:h||n})]})},ef=ce.createContext(null),tf=ce.createContext(null),nf=ce.createContext(null),rf=ce.createContext(null),sf=ce.createContext(null),Vg=e=>{var t,n;for(const r of e.elements)if((n=(t=r.grayTipElement)==null?void 0:t.jsonGrayTipElement)!=null&&n.jsonStr)try{const l=JSON.parse(r.grayTipElement.jsonGrayTipElement.jsonStr);if(l.items){const i=l.items.some(o=>o.type==="qq"&&o.uid);return{items:l.items,hasUid:i}}}catch{}return null},hn=new Map,Qg=p.memo(({message:e,groupCode:t})=>{const n=hn.get(e.msgId),[r,l]=p.useState(n??"[系统提示]"),i=cr();return p.useEffect(()=>{var d,m;if(hn.has(e.msgId)){l(hn.get(e.msgId));return}const o=Vg(e);if(!o){for(const f of e.elements)if((m=(d=f.grayTipElement)==null?void 0:d.xmlElement)!=null&&m.content){const y=f.grayTipElement.xmlElement.content.replace(/<[^>]+>/g,"");hn.set(e.msgId,y),l(y);return}hn.set(e.msgId,"[系统提示]"),l("[系统提示]");return}const{items:a,hasUid:c}=o;if(!c){const y=a.map(w=>w.txt||"").join("")||"[系统提示]";hn.set(e.msgId,y),l(y);return}(async()=>{const f=[];let y=0;for(const k of a)if(k.type==="qq"&&k.uid)if(k.uid===i)f.push(s.jsx("span",{className:"text-blue-500",children:"你"},y++));else{const j=await Th(k.uid,t);f.push(s.jsx("span",{className:"text-blue-500",children:j},y++))}else k.type==="nor"&&k.txt&&f.push(s.jsx("span",{children:k.txt},y++));const w=f.length>0?f:"[系统提示]";hn.set(e.msgId,w),l(w)})()},[e.msgId,i,t]),s.jsx("div",{className:"flex justify-center py-2",children:s.jsx("span",{className:"text-xs text-theme-hint bg-theme-item/50 px-3 py-1 rounded-full",children:r})})}),Gg=p.memo(({message:e,allMessages:t,isHighlighted:n})=>{var R,V;if(Hg(e)){const C=e.chatType===2?e.peerUin:void 0;return s.jsx(Qg,{message:e,groupCode:C})}const r=cr(),l=r?e.senderUid===r:!1,i=ce.useContext(ef),o=ce.useContext(tf),a=ce.useContext(nf),c=ce.useContext(rf),u=ce.useContext(sf);let d=e.sendMemberName||e.sendNickName||e.senderUin;if(e.chatType===1&&!l&&u){const C=u.getFriend(e.senderUin);C&&(d=C.remark||C.nickname||d)}const m=`https://q1.qlogo.cn/g?b=qq&nk=${e.senderUin}&s=640`,f=parseInt(e.msgTime)*1e3;let y,w,k;if(e.chatType===2){const C=e.msgAttrs;if(C){const E=(_=>{if(C instanceof Map)return C.get(_);if(typeof C=="object")return C[_.toString()]})(2);E!=null&&E.groupHonor&&(y=E.groupHonor.level,w=E.groupHonor.uniqueTitle||void 0)}if(c){const b=c.getMembers(e.peerUin),E=b==null?void 0:b.find(_=>_.uid===e.senderUid||_.uin===e.senderUin);E&&(k=E.role,y===void 0&&E.level&&(y=E.level),!w&&E.specialTitle&&(w=E.specialTitle))}}if(!e.elements||!Array.isArray(e.elements))return null;const j=e.recallTime&&e.recallTime!=="0",g=(R=e.elements.find(C=>C.replyElement))==null?void 0:R.replyElement,h=e.elements.filter(C=>!C.replyElement);if(!(h.some(Wg)||g))return null;const v=h.length===1&&h[0].pttElement&&!g,N=g?t.find(C=>C.msgId===g.replayMsgId||C.msgSeq===g.replayMsgSeq):null,S=C=>{C.preventDefault(),C.stopPropagation(),i==null||i.showMenu(C,e)},T=C=>{C.preventDefault(),C.stopPropagation(),o==null||o.showMenu(C,{senderUid:e.senderUid,senderUin:e.senderUin,senderName:d,chatType:e.chatType,groupCode:e.chatType===2?e.peerUin:void 0})},M=C=>{("ontouchstart"in window||navigator.maxTouchPoints>0)&&(C.preventDefault(),C.stopPropagation(),o==null||o.showMenu(C,{senderUid:e.senderUid,senderUin:e.senderUin,senderName:d,chatType:e.chatType,groupCode:e.chatType===2?e.peerUin:void 0}))},q=()=>{g&&(a==null||a.scrollToMessage(g.replayMsgId,g.replayMsgSeq))};return s.jsxs("div",{className:`flex gap-2 w-full ${l?"flex-row-reverse":""} ${n?"animate-pulse bg-pink-100 dark:bg-pink-900/30 rounded-lg -mx-2 px-2":""}`,children:[s.jsx("img",{src:m,alt:d,loading:"lazy",className:"w-8 h-8 rounded-full object-cover flex-shrink-0 cursor-pointer hover:opacity-80 transition-opacity",onClick:M,onContextMenu:T}),s.jsxs("div",{className:`flex flex-col ${l?"items-end":"items-start"} max-w-[calc(100%-48px)] md:max-w-[70%] min-w-0 overflow-hidden`,children:[s.jsxs("div",{className:`flex items-center gap-1.5 mb-1 ${l?"flex-row-reverse":""}`,children:[s.jsx("span",{className:"text-xs text-theme-hint",children:d}),y!==void 0&&y>0&&s.jsxs("span",{className:"text-xs px-1 py-0.5 bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-300 rounded",children:["Lv.",y]}),k==="owner"&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-amber-100 dark:bg-amber-900/50 text-amber-600 dark:text-amber-300 rounded",children:w||"群主"}),k==="admin"&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-blue-100 dark:bg-blue-900/50 text-blue-600 dark:text-blue-300 rounded",children:w||"管理员"}),k==="member"&&w&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-pink-100 dark:bg-pink-900/50 text-pink-600 dark:text-pink-300 rounded",children:w})]}),v?s.jsxs("div",{onContextMenu:S,className:j?"opacity-50":"",children:[h.map((C,b)=>s.jsx(Wi,{element:C,message:e},b)),j&&s.jsx("div",{className:"text-xs text-theme-muted italic mt-1",children:"已撤回"})]}):s.jsxs("div",{className:"relative",children:[s.jsxs("div",{className:`rounded-2xl px-4 py-2 min-w-[80px] max-w-full break-words overflow-hidden bg-theme-item text-theme shadow-sm ${l?"rounded-tr-sm":"rounded-tl-sm"} ${j?"opacity-50":""}`,onContextMenu:S,children:[g&&s.jsx("div",{className:"text-xs mb-2 pb-2 border-b border-theme-divider cursor-pointer hover:opacity-80 transition-opacity",onClick:q,children:s.jsx("div",{className:"bg-theme-input rounded px-2 py-1",children:N?s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"font-medium text-theme-secondary",children:[N.sendMemberName||N.sendNickName||N.senderUin,":"]}),s.jsx("div",{className:"text-theme-muted",children:(V=N.elements)==null?void 0:V.filter(C=>!C.replyElement).map((C,b)=>s.jsx(Wi,{element:C},b))})]}):s.jsx("span",{className:"text-theme-muted",children:g.sourceMsgText||"[消息]"})})}),h.map((C,b)=>s.jsx(Wi,{element:C,message:e},b))]}),j&&s.jsx("div",{className:"text-xs text-theme-muted italic mt-1",children:"已撤回"})]}),s.jsx(Yg,{message:e,isSelf:l}),s.jsx("span",{className:"text-xs text-theme-hint mt-1",children:ii(f)})]})]})});function Kg(e,t){return t==="2"?`/face/emoji-${parseInt(e).toString(16)}.png`:`/face/${e}.png`}const Yg=p.memo(({message:e,isSelf:t})=>{const[n,r]=p.useState(null);if(!e.emojiLikesList||e.emojiLikesList.length===0)return null;const l=async(i,o)=>{if(!n){r(i);try{const a={chatType:e.chatType,peerUid:e.peerUin,guildId:""};await te("ntMsgApi","setEmojiLike",[a,e.msgSeq,i,!o])}catch(a){Y(a.message||"操作失败","error")}finally{r(null)}}};return s.jsx("div",{className:`flex flex-wrap gap-1 mt-1 ${t?"justify-end":"justify-start"}`,children:e.emojiLikesList.map((i,o)=>{const a=Kg(i.emojiId,i.emojiType);return s.jsxs("button",{onClick:()=>l(i.emojiId,i.isClicked),disabled:n===i.emojiId,className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-xs transition-all cursor-pointer hover:scale-105 active:scale-95 ${i.isClicked?"bg-pink-100 dark:bg-pink-900/40 border border-pink-300 dark:border-pink-700":"bg-theme-item border border-theme-divider hover:border-pink-300 dark:hover:border-pink-700"} ${n===i.emojiId?"opacity-50":""}`,title:i.isClicked?"点击取消":"点击跟贴",children:[s.jsx("img",{src:a,alt:`表情${i.emojiId}`,className:"w-4 h-4",onError:c=>{if(i.emojiType==="2"){const u=c.target,d=String.fromCodePoint(parseInt(i.emojiId));u.style.display="none",u.insertAdjacentHTML("afterend",`<span class="text-sm">${d}</span>`)}}}),s.jsx("span",{className:"text-theme-secondary",children:i.likesCnt})]},`${i.emojiId}-${o}`)})})}),Xg=p.memo(({message:e,onRetry:t})=>{const n=li(),r=n?`https://q1.qlogo.cn/g?b=qq&nk=${n}&s=640`:"";return s.jsxs("div",{className:"flex gap-2 flex-row-reverse w-full",children:[r&&s.jsx("img",{src:r,alt:"我",loading:"lazy",className:"w-8 h-8 rounded-full object-cover flex-shrink-0"}),s.jsxs("div",{className:"flex flex-col items-end max-w-[calc(100%-48px)] md:max-w-[70%] min-w-0 overflow-hidden",children:[s.jsx("span",{className:"text-xs text-theme-hint mb-1",children:"我"}),s.jsxs("div",{className:"flex items-end gap-1",children:[e.status==="failed"&&s.jsx("button",{onClick:t,className:"p-1 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/30 rounded",title:"重新发送",children:s.jsx(oh,{size:14})}),s.jsx("div",{className:"rounded-2xl px-4 py-2 bg-theme-item text-theme rounded-tr-sm min-w-[80px] max-w-full break-words overflow-hidden shadow-sm",children:e.items.map((l,i)=>l.type==="text"&&l.content?s.jsx("span",{className:"whitespace-pre-wrap break-words",children:l.content},i):l.type==="face"&&l.faceId!==void 0?s.jsx("img",{src:`/face/${l.faceId}.png`,alt:`[表情${l.faceId}]`,className:"inline-block align-text-bottom",style:{width:24,height:24}},i):l.type==="image"&&l.imageUrl?s.jsx("img",{src:l.imageUrl,alt:"图片",loading:"lazy",className:"max-w-full rounded-lg",style:{maxHeight:"200px"}},i):l.type==="at"&&l.atName?s.jsxs("span",{className:"text-blue-500",children:["@",l.atName]},i):null)}),e.status==="sending"&&s.jsx(Se,{size:14,className:"animate-spin text-theme-hint"}),e.status==="failed"&&s.jsx(Jm,{size:14,className:"text-red-500"})]}),s.jsx("span",{className:"text-xs text-theme-hint mt-1",children:ii(e.timestamp)})]})]})}),Jg=({name:e,onMute:t,onClose:n})=>{const[r,l]=p.useState(0),[i,o]=p.useState(0),[a,c]=p.useState(0),[u,d]=p.useState(0),m=()=>{const y=r+i*60+a*3600+u*86400;y>0&&t(y)},f=r+i*60+a*3600+u*86400;return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-50 bg-black/30",onClick:n}),s.jsxs("div",{className:"fixed z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-theme-card backdrop-blur-xl border border-theme-divider rounded-xl shadow-xl p-6 min-w-[340px]",children:[s.jsxs("h3",{className:"text-lg font-medium text-theme mb-4",children:["禁言 ",e]}),s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"text-sm text-theme-secondary mb-3",children:"设置禁言时长:"}),s.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:59,value:r,onChange:y=>l(Math.min(59,Math.max(0,parseInt(y.target.value)||0))),className:"w-full px-2 py-2 text-center bg-theme-input border border-theme-input rounded-lg text-theme focus:outline-none focus:ring-2 focus:ring-pink-500/20"}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"秒"})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:59,value:i,onChange:y=>o(Math.min(59,Math.max(0,parseInt(y.target.value)||0))),className:"w-full px-2 py-2 text-center bg-theme-input border border-theme-input rounded-lg text-theme focus:outline-none focus:ring-2 focus:ring-pink-500/20"}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"分钟"})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:23,value:a,onChange:y=>c(Math.min(23,Math.max(0,parseInt(y.target.value)||0))),className:"w-full px-2 py-2 text-center bg-theme-input border border-theme-input rounded-lg text-theme focus:outline-none focus:ring-2 focus:ring-pink-500/20"}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"小时"})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("input",{type:"number",min:0,max:29,value:u,onChange:y=>d(Math.min(29,Math.max(0,parseInt(y.target.value)||0))),className:"w-full px-2 py-2 text-center bg-theme-input border border-theme-input rounded-lg text-theme focus:outline-none focus:ring-2 focus:ring-pink-500/20"}),s.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"天"})]})]}),s.jsx("p",{className:"text-xs text-theme-secondary mt-2 text-center",children:"最长29天23小时59分59秒"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("button",{onClick:()=>t(0),className:"px-4 py-2 text-sm text-green-500 hover:bg-green-50 dark:hover:bg-green-900/30 rounded-lg transition-colors",children:"解除禁言"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:n,className:"px-4 py-2 text-sm text-theme-secondary hover:bg-theme-item rounded-lg transition-colors",children:"取消"}),s.jsx("button",{onClick:m,disabled:f===0,className:"px-4 py-2 text-sm bg-orange-500 text-white hover:bg-orange-600 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"确认禁言"})]})]})]})]}),document.body)},Zg=({name:e,groupName:t,onConfirm:n,onClose:r})=>Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:r}),s.jsxs("div",{className:"fixed z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-theme-card border border-theme-divider rounded-xl shadow-xl p-6 min-w-[320px]",children:[s.jsx("h3",{className:"text-lg font-medium text-theme mb-4",children:"确认踢出"}),s.jsxs("p",{className:"text-theme-secondary mb-6",children:["确定要将 ",s.jsx("span",{className:"font-medium text-theme",children:e})," 移出群 ",s.jsx("span",{className:"font-medium text-theme",children:t})," 吗?"]}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx("button",{onClick:r,className:"px-4 py-2 text-sm text-theme-secondary hover:bg-theme-item rounded-lg transition-colors",children:"取消"}),s.jsx("button",{onClick:n,className:"px-4 py-2 text-sm bg-red-500 text-white hover:bg-red-600 rounded-lg transition-colors",children:"确认踢出"})]})]})]}),document.body),ey=({name:e,onConfirm:t,onClose:n})=>{const[r,l]=p.useState("");return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-50 bg-black/30",onClick:n}),s.jsxs("div",{className:"fixed z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-theme-card backdrop-blur-xl border border-theme-divider rounded-xl shadow-xl p-6 min-w-[320px]",children:[s.jsx("h3",{className:"text-lg font-medium text-theme mb-4",children:"设置头衔"}),s.jsxs("p",{className:"text-sm text-theme-secondary mb-3",children:["为 ",e," 设置专属头衔:"]}),s.jsx("input",{type:"text",maxLength:12,value:r,onChange:i=>l(i.target.value),placeholder:"留空清除头衔",className:"w-full px-3 py-2 bg-theme-input border border-theme-input rounded-lg text-theme focus:outline-none focus:ring-2 focus:ring-pink-500/20 placeholder:text-theme-hint",autoFocus:!0,onKeyDown:i=>{i.key==="Enter"&&t(r.trim())}}),s.jsx("p",{className:"text-xs text-theme-secondary mt-2",children:"中文最多6字,英文最多12字,按回车确认"}),s.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[s.jsx("button",{onClick:n,className:"px-4 py-2 text-sm text-theme-secondary hover:bg-theme-item rounded-lg transition-colors",children:"取消"}),s.jsx("button",{onClick:()=>t(r.trim()),className:"px-4 py-2 text-sm bg-pink-500 text-white hover:bg-pink-600 rounded-lg transition-colors",children:"确认"})]})]})]}),document.body)};function lf(e,t,n){const[r,l]=p.useState({left:-9999,top:-9999,ready:!1});return p.useEffect(()=>{l({left:-9999,top:-9999,ready:!1});const i=requestAnimationFrame(()=>{if(!n.current){l({left:e,top:t,ready:!0});return}const o=n.current.getBoundingClientRect(),a=10;let c=e,u=t;e+o.width>window.innerWidth-a&&(c=e-o.width),c<a&&(c=a),t+o.height>window.innerHeight-a&&(u=t-o.height),u<a&&(u=a),l({left:c,top:u,ready:!0})});return()=>cancelAnimationFrame(i)},[e,t]),r}const ty=({contextMenu:e,session:t,getCachedMembers:n,onClose:r,onReply:l,onEmojiReaction:i,onRecall:o})=>{const a=e.message,c=cr(),u=c&&a.senderUid===c,d=a.chatType===2,m=d&&t?n(t.peerId):null,f=m&&c?m.find(M=>M.uid===c):null,y=f==null?void 0:f.role,w=y==="owner",k=y==="admin"||y==="owner",j=m?m.find(M=>M.uid===a.senderUid):null,g=j==null?void 0:j.role,x=u||d&&(w||k&&!(g==="admin"||g==="owner")),v=!!e.elementId,N=p.useRef(null),S=lf(e.x,e.y,N),T=async()=>{if(e.elementId){r();try{const M=await te("ntFileApi","downloadMedia",[a.msgId,a.chatType,a.peerUid,e.elementId,"",""]);if(!M){Y("图片下载失败","error");return}const q=await te("ntMsgApi","addFavEmoji",[M]);q.result===0?Y(q.isExist?"表情已存在":"已添加到表情","success"):Y(q.errMsg||"添加失败","error")}catch(M){Y(M.message||"添加失败","error")}}};return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40",onClick:r,onContextMenu:M=>{M.preventDefault(),r()}}),s.jsxs("div",{ref:N,className:"fixed z-50 bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[100px]",style:{left:S.left,top:S.top,visibility:S.ready?"visible":"hidden"},onContextMenu:M=>M.preventDefault(),children:[s.jsxs("button",{onClick:()=>{l(a),r()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(ah,{size:14})," 回复"]}),t.chatType===2&&s.jsxs("button",{onClick:()=>{i(a,e.x,e.y),r()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(dh,{size:14})," 贴表情"]}),v&&s.jsxs("button",{onClick:T,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(mh,{size:14})," 添加到表情"]}),x&&s.jsxs("button",{onClick:async()=>{r();try{await Mh(a.chatType,a.peerUid,a.msgId),o(a.msgId),Y("消息已撤回","success")}catch(M){Y(M.message||"撤回失败","error")}},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-500 hover:bg-theme-item-hover transition-colors",children:[s.jsx(It,{size:14})," 撤回"]})]})]}),document.body)},ny=({avatarContextMenu:e,getCachedMembers:t,onClose:n,onInsertAt:r,onShowProfile:l,onSetTitle:i,onMute:o,onKick:a,onAdminChanged:c,groupName:u})=>{const d=cr(),m=e.groupCode?t(e.groupCode):null,f=m&&d?m.find(R=>R.uid===d):null,y=f==null?void 0:f.role,w=y==="owner",k=y==="admin",j=m?m.find(R=>R.uid===e.senderUid):null,g=j==null?void 0:j.role,h=g==="admin",x=w||k&&g==="member",v=w||k&&g==="member",N=e.senderUid===d,S=w&&!N,T=p.useRef(null),M=lf(e.x,e.y,T),q=async()=>{const R=e;n();try{const V=h?2:3;await te("ntGroupApi","setMemberRole",[R.groupCode,R.senderUid,V]),Y(h?"已取消管理员":"已设为管理员","success"),c==null||c()}catch(V){Y(V.message||"操作失败","error")}};return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40",onClick:n,onContextMenu:R=>{R.preventDefault(),n()}}),s.jsxs("div",{ref:T,className:"fixed z-50 bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[120px]",style:{left:M.left,top:M.top,visibility:M.ready?"visible":"hidden"},onContextMenu:R=>R.preventDefault(),children:[e.chatType===2&&s.jsxs("button",{onClick:()=>{r(e.senderUid,e.senderUin,e.senderName),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(Zm,{size:14})," 召唤ta"]}),s.jsxs("button",{onClick:async()=>{const R=e;n();try{R.chatType===2&&R.groupCode?await $l(R.chatType,parseInt(R.senderUin),parseInt(R.groupCode)):await $l(R.chatType,parseInt(R.senderUin))}catch(V){Y(V.message||"戳一戳失败","error")}},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(th,{size:14})," 戳一戳"]}),s.jsxs("button",{onClick:()=>{l(e.senderUid,e.senderUin,e.x,e.y,e.groupCode),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(fh,{size:14})," 查看资料"]}),e.chatType===2&&e.groupCode&&w&&s.jsxs("button",{onClick:()=>{i(e.senderUid,e.senderName,e.groupCode),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(n0,{size:14})," 设置头衔"]}),e.chatType===2&&e.groupCode&&S&&s.jsxs("button",{onClick:q,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[h?s.jsx(j0,{size:14}):s.jsx(ms,{size:14}),h?"取消管理员":"设为管理员"]}),e.chatType===2&&e.groupCode&&!N&&x&&s.jsxs("button",{onClick:()=>{o(e.senderUid,e.senderName,e.groupCode),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-orange-500 hover:bg-theme-item-hover transition-colors",children:[s.jsx(E0,{size:14})," 禁言"]}),e.chatType===2&&e.groupCode&&!N&&v&&s.jsxs("button",{onClick:()=>{a(e.senderUid,e.senderName,e.groupCode,u||e.groupCode),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-500 hover:bg-theme-item-hover transition-colors",children:[s.jsx(S0,{size:14})," 踢出群"]})]})]}),document.body)},of=p.forwardRef(({placeholder:e="输入消息...",disabled:t=!1,onEnter:n,onPaste:r,onChange:l,onMentionChange:i},o)=>{const a=p.useRef(null),c=p.useRef(!1),u=p.useRef(null),[d,m]=p.useState(!1),f=p.useCallback(()=>{const b=a.current;if(!b)return[];const E=[],_=b.childNodes;for(let U=0;U<_.length;U++){const D=_[U];if(D.nodeType===Node.TEXT_NODE){const W=(D.textContent||"").replace(/\u200B/g,"");W&&E.push({type:"text",content:W})}else if(D.nodeType===Node.ELEMENT_NODE){const P=D;if(P.dataset.type==="face")E.push({type:"face",faceId:parseInt(P.dataset.faceId||"0")});else if(P.dataset.type==="image")E.push({type:"image",imageUrl:P.dataset.imageUrl,imageFile:P.__file});else if(P.dataset.type==="at")E.push({type:"at",atUid:P.dataset.atUid,atUin:P.dataset.atUin,atName:P.dataset.atName});else if(P.tagName==="BR")E.push({type:"text",content:`
|
|
440
|
+
`});else{const K=(P.textContent||"").replace(/\u200B/g,"");K&&E.push({type:"text",content:K})}}}return E},[]),y=p.useCallback(()=>{var E;const b=f();return b.length===0||b.length===1&&b[0].type==="text"&&!((E=b[0].content)!=null&&E.trim())},[f]),w=p.useCallback(()=>{var D;const b=window.getSelection();if(!b||b.rangeCount===0)return{top:0,left:0};const _=b.getRangeAt(0).getBoundingClientRect(),U=(D=a.current)==null?void 0:D.getBoundingClientRect();return U?{top:U.bottom-_.top+8,left:_.left-U.left}:{top:0,left:0}},[]),k=p.useCallback(()=>{if(!u.current)return"";const b=window.getSelection();if(!b||b.rangeCount===0)return"";const E=b.getRangeAt(0),{node:_,offset:U}=u.current;return E.startContainer!==_?"":(_.textContent||"").slice(U,E.startOffset)},[]),j=p.useCallback(()=>{u.current=null,m(!1),i==null||i({active:!1,query:"",position:{top:0,left:0}})},[i]),g=p.useCallback(()=>{const b=window.getSelection();if(!b||b.rangeCount===0)return;const E=b.getRangeAt(0),_=E.startContainer;if(_.nodeType!==Node.TEXT_NODE){d&&j();return}const U=_.textContent||"",D=E.startOffset;if(d&&u.current){if(u.current.node===_&&D>=u.current.offset){const K=k();K.includes(" ")?j():i==null||i({active:!0,query:K,position:w()})}else j();return}const P=U.slice(0,D),W=P.lastIndexOf("@");if(W!==-1){const K=W>0?P[W-1]:" ";if(K===" "||K===`
|
|
441
|
+
`||W===0){const J=P.slice(W+1);J.includes(" ")||(u.current={node:_,offset:W+1},m(!0),i==null||i({active:!0,query:J,position:w()}))}}},[d,k,w,j,i]),h=p.useCallback(b=>{const E=a.current;if(!E)return;j();const _=document.createTextNode(b),U=window.getSelection();if(U&&U.rangeCount>0){const D=U.getRangeAt(0);E.contains(D.commonAncestorContainer)?(D.deleteContents(),D.insertNode(_),D.setStartAfter(_),D.setEndAfter(_),U.removeAllRanges(),U.addRange(D)):E.appendChild(_)}else E.appendChild(_);E.focus(),l==null||l(f())},[l,f,j]),x=p.useCallback(b=>{const E=a.current;if(!E)return;j();const _=document.createElement("span");_.contentEditable="false",_.dataset.type="face",_.dataset.faceId=String(b),_.className="inline-block align-middle mx-0.5 select-all",_.innerHTML=`<img src="/face/${b}.png" alt="[表情]" class="w-6 h-6 inline-block" draggable="false" />`;const U=window.getSelection();if(U&&U.rangeCount>0){const D=U.getRangeAt(0);if(E.contains(D.commonAncestorContainer)){D.deleteContents(),D.insertNode(_);const P=document.createTextNode("");_.after(P),D.setStartAfter(P),D.setEndAfter(P),U.removeAllRanges(),U.addRange(D)}else{E.appendChild(_);const P=document.createTextNode("");E.appendChild(P)}}else{E.appendChild(_);const D=document.createTextNode("");E.appendChild(D)}E.focus(),l==null||l(f())},[l,f,j]),v=p.useCallback((b,E)=>{const _=a.current;if(!_)return;j();const U=document.createElement("span");U.contentEditable="false",U.dataset.type="image",U.dataset.imageUrl=E,b&&(U.__file=b),U.className="inline-block align-middle mx-0.5 select-all",U.innerHTML=`<img src="${E}" alt="[图片]" class="h-16 max-w-[200px] rounded inline-block object-cover" draggable="false" />`;const D=window.getSelection();if(D&&D.rangeCount>0){const P=D.getRangeAt(0);if(_.contains(P.commonAncestorContainer)){P.deleteContents(),P.insertNode(U);const W=document.createTextNode("");U.after(W),P.setStartAfter(W),P.setEndAfter(W),D.removeAllRanges(),D.addRange(P)}else{_.appendChild(U);const W=document.createTextNode("");_.appendChild(W)}}else{_.appendChild(U);const P=document.createTextNode("");_.appendChild(P)}_.focus(),l==null||l(f())},[l,f,j]),N=p.useCallback((b,E,_)=>{const U=a.current;if(!U)return;if(d&&u.current){const{node:J,offset:ae}=u.current,ge=window.getSelection();if(ge&&ge.rangeCount>0){const Ce=ge.getRangeAt(0),Q=document.createRange();Q.setStart(J,ae-1),Q.setEnd(Ce.startContainer,Ce.startOffset),Q.deleteContents()}}j();const D=document.createElement("span");D.contentEditable="false",D.dataset.type="at",D.dataset.atUid=b,D.dataset.atUin=E,D.dataset.atName=_,D.className="inline-block align-middle mx-0.5 px-1 py-0.5 bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-300 text-sm rounded select-all",D.textContent=`@${_}`;const P=window.getSelection();if(P&&P.rangeCount>0){const J=P.getRangeAt(0);U.contains(J.commonAncestorContainer)?(J.deleteContents(),J.insertNode(D),J.setStartAfter(D),J.setEndAfter(D),P.removeAllRanges(),P.addRange(J)):U.appendChild(D)}else U.appendChild(D);const W=document.createTextNode(" ");D.after(W);const K=document.createRange();K.setStartAfter(W),K.setEndAfter(W),P==null||P.removeAllRanges(),P==null||P.addRange(K),U.focus(),l==null||l(f())},[d,l,f,j]),S=p.useCallback(()=>{const b=a.current;b&&(b.innerHTML="",j(),l==null||l([]))},[l,j]),T=p.useCallback(()=>{const b=a.current;if(!b)return;b.focus();const E=window.getSelection();if(E){const _=document.createRange();_.selectNodeContents(b),_.collapse(!1),E.removeAllRanges(),E.addRange(_)}},[]);p.useImperativeHandle(o,()=>({focus:T,clear:S,insertFace:x,insertText:h,insertImage:v,insertAt:N,getContent:f,isEmpty:y,cancelMention:j}),[T,S,x,h,v,N,f,y,j]);const M=p.useCallback(b=>{if(d){if(["ArrowUp","ArrowDown","Enter","Tab"].includes(b.key))return;if(b.key==="Escape"){b.preventDefault(),j();return}}b.key==="Enter"&&!b.shiftKey&&!c.current&&!d&&(b.preventDefault(),n==null||n())},[n,d,j]),q=p.useCallback(()=>{g(),l==null||l(f())},[l,f,g]),R=p.useCallback(b=>{var U,D;const E=(U=b.clipboardData)==null?void 0:U.items;if(E){for(let P=0;P<E.length;P++)if(E[P].type.startsWith("image/")){b.preventDefault(),r==null||r(b);return}}b.preventDefault();const _=(D=b.clipboardData)==null?void 0:D.getData("text/plain");_&&document.execCommand("insertText",!1,_)},[r]),V=p.useCallback(()=>{setTimeout(g,0)},[g]),C=p.useCallback(()=>{setTimeout(()=>{d&&j()},200)},[d,j]);return s.jsxs("div",{className:"relative",children:[s.jsx("div",{ref:a,contentEditable:!t,onKeyDown:M,onInput:q,onPaste:R,onClick:V,onBlur:C,onCompositionStart:()=>{c.current=!0},onCompositionEnd:()=>{c.current=!1,q()},className:`min-h-[36px] max-h-[120px] overflow-y-auto px-3 py-2 outline-none text-theme whitespace-pre-wrap break-words ${t?"opacity-50 cursor-not-allowed":""}`,style:{wordBreak:"break-word"},"data-placeholder":e,suppressContentEditableWarning:!0}),s.jsx("style",{children:`
|
|
442
442
|
[data-placeholder]:empty:before {
|
|
443
443
|
content: attr(data-placeholder);
|
|
444
444
|
color: var(--theme-hint, #9ca3af);
|
|
445
445
|
pointer-events: none;
|
|
446
446
|
}
|
|
447
|
-
`})]})});of.displayName="RichInput";const ry=({members:e,loading:t,query:n,position:r,onSelect:l,onClose:i})=>{const o=p.useRef(null),[a,c]=p.useState(0),u=p.useMemo(()=>{if(!n)return e.slice(0,20);const m=n.toLowerCase();return e.filter(f=>{var v;return f.nickname.toLowerCase().includes(m)||((v=f.card)==null?void 0:v.toLowerCase().includes(m))||f.uin.includes(n)}).slice(0,20)},[e,n]);p.useEffect(()=>{c(0)},[n]),p.useEffect(()=>{const m=f=>{f.key==="ArrowDown"?(f.preventDefault(),c(v=>Math.min(v+1,u.length-1))):f.key==="ArrowUp"?(f.preventDefault(),c(v=>Math.max(v-1,0))):f.key==="Enter"||f.key==="Tab"?(f.preventDefault(),u[a]&&l(u[a])):f.key==="Escape"&&(f.preventDefault(),i())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[u,a,l,i]),p.useEffect(()=>{const m=f=>{o.current&&!o.current.contains(f.target)&&i()};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[i]),p.useEffect(()=>{const m=o.current;if(!m)return;const f=m.querySelector(`[data-index="${a}"]`);f&&f.scrollIntoView({block:"nearest"})},[a]);const d=m=>m==="owner"?s.jsx(ni,{size:12,className:"text-yellow-500"}):m==="admin"?s.jsx(ds,{size:12,className:"text-green-500"}):null;return s.jsx("div",{ref:o,className:"absolute z-50 bg-white dark:bg-neutral-800 rounded-xl shadow-xl border border-theme-divider overflow-hidden",style:{bottom:"100%",left:0,marginBottom:8,minWidth:240,maxWidth:300},children:t?s.jsx("div",{className:"flex items-center justify-center py-4",children:s.jsx(Se,{size:20,className:"animate-spin text-pink-500"})}):u.length===0?s.jsx("div",{className:"py-3 px-4 text-sm text-theme-muted text-center",children:n?"没有匹配的成员":"暂无成员"}):s.jsx("div",{className:"max-h-[200px] overflow-y-auto py-1",children:u.map((m,f)=>s.jsxs("div",{"data-index":f,onClick:()=>l(m),className:`flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${f===a?"bg-pink-50 dark:bg-pink-900/30":"hover:bg-theme-item-hover"}`,children:[s.jsx("img",{src:m.avatar||`https://q1.qlogo.cn/g?b=qq&nk=${m.uin}&s=40`,alt:"",className:"w-7 h-7 rounded-full flex-shrink-0",loading:"lazy"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-sm text-theme truncate",children:m.card||m.nickname}),d(m.role)]}),m.card&&m.card!==m.nickname&&s.jsx("div",{className:"text-xs text-theme-muted truncate",children:m.nickname})]})]},m.uid))})})},sy=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,41,42,43,46,49,53,56,59,60,63,64,66,67,74,75,76,77,78,79,85,86,89,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,114,116,118,119,120,121,123,124,125,129,137,144,146,147,169,171,172,173,174,175,176,177,178,179,181,182,183,185,187,201,212,262,263,264,265,266,267,268,269,270,271,272,273,277,281,282,283,284,285,286,287,289,293,294,295,297,298,299,300,302,303,305,306,307,311,312,314,317,318,319,320,323,324,325,326,332,333,334,336,337,338,339,341,342,343,344,345,346,347,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,415,416,417,419,420,421,422,423,424,425,426,427,428,429,430,431,432,451,453,454,458,459,460,461,462],ly=[{codePoint:9728,char:"☀"},{codePoint:9749,char:"☕"},{codePoint:9786,char:"☺"},{codePoint:10024,char:"✨"},{codePoint:10068,char:"❔"},{codePoint:127801,char:"🌹"},{codePoint:127817,char:"🍉"},{codePoint:127822,char:"🍎"},{codePoint:127827,char:"🍓"},{codePoint:127836,char:"🍜"},{codePoint:127838,char:"🍞"},{codePoint:127847,char:"🍧"},{codePoint:127866,char:"🍺"},{codePoint:127867,char:"🍻"},{codePoint:127881,char:"🎉"},{codePoint:127978,char:"🏪"},{codePoint:128014,char:"🐎"},{codePoint:128020,char:"🐔"},{codePoint:128027,char:"🐛"},{codePoint:128046,char:"🐮"},{codePoint:128051,char:"🐳"},{codePoint:128053,char:"🐵"},{codePoint:128054,char:"🐶"},{codePoint:128055,char:"🐷"},{codePoint:128056,char:"🐸"},{codePoint:128064,char:"👀"},{codePoint:128070,char:"👆"},{codePoint:128074,char:"👊"},{codePoint:128076,char:"👌"},{codePoint:128077,char:"👍"},{codePoint:128078,char:"👎"},{codePoint:128079,char:"👏"},{codePoint:128098,char:"👢"},{codePoint:128102,char:"👦"},{codePoint:128103,char:"👧"},{codePoint:128123,char:"👻"},{codePoint:128137,char:"💉"},{codePoint:128147,char:"💓"},{codePoint:128157,char:"💝"},{codePoint:128163,char:"💣"},{codePoint:128164,char:"💤"},{codePoint:128166,char:"💦"},{codePoint:128168,char:"💨"},{codePoint:128169,char:"💩"},{codePoint:128170,char:"💪"},{codePoint:128235,char:"📫"},{codePoint:128293,char:"🔥"},{codePoint:128299,char:"🔫"},{codePoint:128513,char:"😁"},{codePoint:128514,char:"😂"},{codePoint:128516,char:"😄"},{codePoint:128522,char:"😊"},{codePoint:128524,char:"😌"},{codePoint:128525,char:"😍"},{codePoint:128527,char:"😏"},{codePoint:128530,char:"😒"},{codePoint:128531,char:"😓"},{codePoint:128532,char:"😔"},{codePoint:128536,char:"😘"},{codePoint:128538,char:"😚"},{codePoint:128540,char:"😜"},{codePoint:128541,char:"😝"},{codePoint:128557,char:"😭"},{codePoint:128560,char:"😰"},{codePoint:128561,char:"😱"},{codePoint:128563,char:"😳"},{codePoint:128591,char:"🙏"},{codePoint:128684,char:"🚬"}],af="webqq_recent_emojis",iy=10;function ll(){try{const e=localStorage.getItem(af);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)&&t.length>0&&typeof t[0]=="number"?t.map(n=>({type:"face",faceId:n})):t}catch{return[]}}function Fu(e){const t=ll().filter(n=>n.type!==e.type?!0:n.type==="face"?n.faceId!==e.faceId:n.codePoint!==e.codePoint);t.unshift(e),localStorage.setItem(af,JSON.stringify(t.slice(0,iy)))}const cf=({onSelect:e,onSelectEmoji:t,onClose:n,position:r,inline:l})=>{const[i,o]=p.useState(new Set),[a,c]=p.useState(ll()),[u,d]=p.useState("qq"),m=p.useRef(null);p.useEffect(()=>{const w=j=>{m.current&&!m.current.contains(j.target)&&n()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[n]);const f=w=>{Fu({type:"face",faceId:w}),c(ll()),e(w)},v=(w,j)=>{Fu({type:"emoji",codePoint:w,char:j}),c(ll()),t&&t(j)},k=(w,j)=>w.type==="face"&&w.faceId!==void 0?s.jsx("button",{onClick:()=>f(w.faceId),className:"w-8 h-8 flex items-center justify-center hover:bg-theme-item rounded transition-colors",title:`表情 ${w.faceId}`,children:s.jsx("img",{src:`/face/${w.faceId}.png`,alt:`表情${w.faceId}`,className:"w-6 h-6"})},`recent-face-${w.faceId}`):w.type==="emoji"&&w.char?s.jsx("button",{onClick:()=>v(w.codePoint,w.char),className:"w-8 h-8 flex items-center justify-center hover:bg-theme-item rounded transition-colors text-xl",title:w.char,children:w.char},`recent-emoji-${w.codePoint}`):null;return s.jsxs("div",{ref:m,className:`${l?"":"absolute bottom-full left-0 mb-2"} bg-theme-card border border-theme-divider rounded-xl shadow-xl z-50`,style:r?{left:r.x,bottom:r.y}:void 0,children:[s.jsxs("div",{className:"flex border-b border-theme-divider",children:[s.jsx("button",{className:`flex-1 px-3 py-2 text-sm ${u==="qq"?"text-pink-500 border-b-2 border-pink-500":"text-theme-secondary"}`,onClick:()=>d("qq"),children:"QQ表情"}),s.jsx("button",{className:`flex-1 px-3 py-2 text-sm ${u==="emoji"?"text-pink-500 border-b-2 border-pink-500":"text-theme-secondary"}`,onClick:()=>d("emoji"),children:"Emoji"})]}),s.jsxs("div",{className:"p-2 max-h-[280px] overflow-y-auto w-[320px]",children:[a.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-xs text-theme-hint mb-1",children:"最近使用"}),s.jsx("div",{className:"grid grid-cols-8 gap-1 mb-2 pb-2 border-b border-theme-divider",children:a.map((w,j)=>k(w))})]}),u==="qq"?s.jsx("div",{className:"grid grid-cols-8 gap-1",children:sy.map(w=>s.jsx("button",{onClick:()=>f(w),className:"w-8 h-8 flex items-center justify-center hover:bg-theme-item rounded transition-colors",title:`表情 ${w}`,children:s.jsx("img",{src:`/face/${w}.png`,alt:`表情${w}`,className:`w-6 h-6 transition-opacity ${i.has(w)?"opacity-100":"opacity-0"}`,onLoad:()=>o(j=>new Set(j).add(w)),onError:j=>{j.target.style.display="none"}})},w))}):s.jsx("div",{className:"grid grid-cols-8 gap-1",children:ly.map(({codePoint:w,char:j})=>s.jsx("button",{onClick:()=>v(w,j),className:"w-8 h-8 flex items-center justify-center hover:bg-theme-item rounded transition-colors text-xl",title:j,children:j},w))})]})]})};let Ln=null;const Ka="webqq_recent_fav_emojis",oy=10;function Ur(){try{const e=localStorage.getItem(Ka);return e?JSON.parse(e):[]}catch{return[]}}function ay(e){const t=Ur().filter(n=>n.emoId!==e.emoId);t.unshift(e),localStorage.setItem(Ka,JSON.stringify(t.slice(0,oy)))}function cy(e){const t=Ur().filter(n=>n.emoId!==e);localStorage.setItem(Ka,JSON.stringify(t))}const uy=({x:e,y:t,onClose:n,onDelete:r})=>{const l=p.useRef(null),[i,o]=p.useState({left:e,top:t});return p.useEffect(()=>{if(!l.current)return;const a=l.current.getBoundingClientRect(),c=10;let u=e,d=t;e+a.width>window.innerWidth-c&&(u=e-a.width),u<c&&(u=c),t+a.height>window.innerHeight-c&&(d=t-a.height),d<c&&(d=c),o({left:u,top:d})},[e,t]),Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-[60]",onClick:n,onContextMenu:a=>{a.preventDefault(),n()}}),s.jsx("div",{ref:l,className:"fixed z-[60] bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[100px]",style:{left:i.left,top:i.top},onContextMenu:a=>a.preventDefault(),children:s.jsxs("button",{onClick:r,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-500 hover:bg-theme-item-hover transition-colors",children:[s.jsx(It,{size:14})," 删除"]})})]}),document.body)},dy=({onSelect:e,onClose:t})=>{const[n,r]=p.useState(Ln||[]),[l,i]=p.useState(!Ln),[o,a]=p.useState(null),[c,u]=p.useState(Ur()),[d,m]=p.useState(null),f=p.useRef(null);p.useEffect(()=>{if(Ln){r(Ln),i(!1);return}(async()=>{try{const y=((await re("ntMsgApi","fetchFavEmojiList",[1e3])).emojiInfoList||[]).map(N=>({emoId:N.emoId,resId:N.resId||"",url:N.url,desc:N.desc||""}));Ln=y,r(y)}catch{a("加载失败")}finally{i(!1)}})()},[]);const v=p.useRef(d);v.current=d,p.useEffect(()=>{const x=h=>{v.current||f.current&&!f.current.contains(h.target)&&t()};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[t]);const k=x=>{ay(x),u(Ur()),e(x)},w=(x,h)=>{x.preventDefault(),x.stopPropagation(),m({x:x.clientX,y:x.clientY,emoji:h})},j=async()=>{if(!d)return;const{emoji:x}=d;m(null);try{const h=await re("ntMsgApi","deleteFavEmoji",[[x.resId]]);if(h.result===0){Y("已删除","success");const g=n.filter(y=>y.emoId!==x.emoId);r(g),Ln=g,cy(x.emoId),u(Ur())}else Y(h.errMsg||"删除失败","error")}catch(h){Y(h.message||"删除失败","error")}};return s.jsxs("div",{ref:f,className:"absolute bottom-full left-0 mb-2 bg-theme-card border border-theme-divider rounded-xl shadow-xl z-50 w-[320px]",children:[s.jsx("div",{className:"p-2 border-b border-theme-divider text-sm text-theme-secondary",children:"收藏表情"}),s.jsxs("div",{className:"p-2 max-h-[300px] overflow-y-auto",children:[c.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-xs text-theme-hint mb-1",children:"最近使用"}),s.jsx("div",{className:"grid grid-cols-4 gap-1 mb-2 pb-2 border-b border-theme-divider",children:c.map(x=>s.jsx("button",{onClick:()=>k(x),onContextMenu:h=>w(h,x),className:"p-1 rounded-lg hover:bg-theme-item transition-colors",title:x.desc,children:s.jsx("img",{src:x.url,alt:x.desc,className:"w-16 h-16 object-contain"})},`recent-${x.emoId}`))})]}),l?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Se,{size:24,className:"animate-spin text-pink-500"})}):o?s.jsx("div",{className:"text-center py-8 text-theme-hint text-sm",children:o}):n.length===0?s.jsx("div",{className:"text-center py-8 text-theme-hint text-sm",children:"暂无收藏表情"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-xs text-theme-hint mb-1",children:"全部"}),s.jsx("div",{className:"grid grid-cols-4 gap-1",children:n.map(x=>s.jsx("button",{onClick:()=>k(x),onContextMenu:h=>w(h,x),className:"p-1 rounded-lg hover:bg-theme-item transition-colors",title:x.desc,children:s.jsx("img",{src:x.url,alt:x.desc,className:"w-16 h-16 object-contain",loading:"lazy"})},x.emoId))})]})]}),d&&s.jsx(uy,{x:d.x,y:d.y,emoji:d.emoji,onClose:()=>m(null),onDelete:j})]})},my=({target:e,onClose:t,containerRef:n})=>{const r=async a=>{const c=e.message;t();try{const u={chatType:c.chatType,peerUid:c.peerUin,guildId:""};await re("ntMsgApi","setEmojiLike",[u,c.msgSeq,String(a),!0])}catch(u){Y(u.message||"贴表情失败","error")}},l=async a=>{const c=e.message;t();try{const u={chatType:c.chatType,peerUid:c.peerUin,guildId:""},d=a.codePointAt(0);if(!d){Y("无效的表情","error");return}await re("ntMsgApi","setEmojiLike",[u,c.msgSeq,String(d),!0])}catch(u){Y(u.message||"贴表情失败","error")}},o=(()=>{if(n!=null&&n.current){const a=n.current.getBoundingClientRect();return{left:a.left+a.width/2,top:a.top+a.height/2}}return{left:window.innerWidth/2,top:window.innerHeight/2}})();return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:t}),s.jsx("div",{className:"fixed z-50 -translate-x-1/2 -translate-y-1/2",style:{left:o.left,top:o.top},children:s.jsx(cf,{onSelect:r,onSelectEmoji:l,onClose:t,inline:!0})})]}),document.body)},uf=p.forwardRef((e,t)=>{var Q;const{session:n,replyTo:r,onReplyCancel:l,onSendStart:i,onSendEnd:o,onTempMessage:a,onTempMessageRemove:c,onTempMessageFail:u}=e,d=p.useRef(null),m=p.useRef(null),f=p.useRef(null),[v,k]=p.useState(!1),[w,j]=p.useState(!1),[x,h]=p.useState(!1),[g,y]=p.useState({active:!1,query:"",position:{top:0,left:0}}),[N,S]=p.useState([]),[P,T]=p.useState(!1),{getCachedMembers:O,fetchGroupMembers:R}=_e(),V=p.useRef(null),C=p.useRef(O);C.current=O;const b=p.useRef(R);b.current=R,p.useImperativeHandle(t,()=>({insertAt:(M,$,W)=>{var le;(le=d.current)==null||le.insertAt(M,$,W)},focus:()=>{var M;(M=d.current)==null||M.focus()}}),[]),p.useEffect(()=>{const M=(n==null?void 0:n.chatType)===2?n.peerId:null;if(V.current=M,!M){S([]),T(!1);return}const $=!Qa(2,M);if(!$){const W=C.current(M);if(W){S(W),T(!1);return}}T(!0),S([]),b.current(M,$).then(W=>{V.current===M&&(S(W),T(!1))}).catch(()=>{V.current===M&&T(!1)})},[n==null?void 0:n.chatType,n==null?void 0:n.peerId]);const E=p.useCallback(M=>{if((n==null?void 0:n.chatType)!==2){y({active:!1,query:"",position:{top:0,left:0}});return}y(M)},[n==null?void 0:n.chatType]),_=p.useCallback(M=>{var $;($=d.current)==null||$.insertAt(M.uid,M.uin,M.card||M.nickname)},[]),U=p.useCallback(()=>{var M;(M=d.current)==null||M.cancelMention()},[]),D=p.useCallback(async()=>{if(!n||!d.current)return;const M=d.current.getContent();if(d.current.isEmpty())return;i();const W=r;d.current.clear(),l(),h(!1),setTimeout(()=>{var ue;return(ue=d.current)==null?void 0:ue.focus()},0);const le=M.map(ue=>({type:ue.type,content:ue.content,faceId:ue.faceId,imageUrl:ue.imageUrl,atName:ue.atName})),ae=`temp_${Date.now()}`;a({msgId:ae,items:le,timestamp:Date.now(),status:"sending"});try{const ue=[];W&&ue.push({type:"reply",msgId:W.msgId,msgSeq:W.msgSeq});for(const de of M)if(de.type==="text"&&de.content)ue.push({type:"text",text:de.content});else if(de.type==="face"&&de.faceId!==void 0)ue.push({type:"face",faceId:de.faceId});else if(de.type==="image"){if(de.imageFile){const qe=await bh(de.imageFile);ue.push({type:"image",imagePath:qe.imagePath})}else if(de.imageUrl){const qe=await Sh(de.imageUrl);ue.push({type:"image",imagePath:qe.imagePath})}}else de.type==="at"&&de.atUid&&ue.push({type:"at",uid:de.atUid,uin:de.atUin,name:de.atName});if(ue.length===0){c(ae);return}await Ho({chatType:n.chatType,peerId:n.peerId,content:ue})}catch{Y("发送失败","error"),u(ae)}finally{o()}},[n,r,i,o,l,a,c,u]),I=p.useCallback(M=>{var $;($=d.current)==null||$.insertFace(M),k(!1)},[]),q=p.useCallback(M=>{var $;($=d.current)==null||$.insertText(M),k(!1)},[]),K=p.useCallback(M=>{var $;j(!1),($=d.current)==null||$.insertImage(null,M.url)},[]),Z=p.useCallback(M=>{var W,le;const $=(W=M.target.files)==null?void 0:W[0];if($){if(!Uh($.name)){Y("不支持的图片格式,仅支持 JPG、PNG、GIF","error");return}(le=d.current)==null||le.insertImage($,URL.createObjectURL($)),m.current&&(m.current.value="")}},[]),oe=p.useCallback(async M=>{var le;const $=(le=M.target.files)==null?void 0:le[0];if(!$||!n)return;if($.size>100*1024*1024){Y("文件过大,最大支持 100MB","error");return}f.current&&(f.current.value=""),i();const W=`temp_${Date.now()}`;a({msgId:W,items:[{type:"text",content:`[文件] ${$.name}`}],timestamp:Date.now(),status:"sending"});try{const ae=await Ch($);await Ho({chatType:n.chatType,peerId:n.peerId,content:[{type:"file",filePath:ae.filePath,fileName:ae.fileName}]})}catch{Y("发送失败","error"),u(W)}finally{o()}},[n,i,o,a,c,u]),ye=p.useCallback(M=>{var W,le,ae;const $=(W=M.clipboardData)==null?void 0:W.items;if($){for(let ue=0;ue<$.length;ue++)if($[ue].type.startsWith("image/")){const de=$[ue].getAsFile();if(!de)continue;const qe=(le=de.type.split("/")[1])==null?void 0:le.toLowerCase();if(!["jpeg","jpg","png","gif"].includes(qe)){Y("不支持的图片格式","error");return}(ae=d.current)==null||ae.insertImage(de,URL.createObjectURL(de));return}}},[]),Ce=p.useCallback(M=>{var $;h(M.length>0&&!(M.length===1&&M[0].type==="text"&&!(($=M[0].content)!=null&&$.trim())))},[]);return s.jsxs("div",{className:"border-t border-theme-divider bg-theme-card",children:[r&&s.jsx("div",{className:"px-4 py-2 border-b border-theme-divider bg-theme-item",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ah,{size:16,className:"text-pink-500 flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0 text-sm text-theme-secondary truncate",children:["回复 ",r.sendMemberName||r.sendNickName||r.senderUin,":",(Q=r.elements)==null?void 0:Q.filter(M=>!M.replyElement).map((M,$)=>M.textElement?s.jsx("span",{children:M.textElement.content},$):M.picElement?s.jsx("span",{children:"[图片]"},$):M.faceElement?s.jsx("span",{children:"[表情]"},$):null)]}),s.jsx("button",{onClick:l,className:"p-1 text-theme-hint hover:text-theme rounded",children:s.jsx(ft,{size:16})})]})}),s.jsxs("div",{className:"px-4 pt-0.5 pb-3",children:[s.jsxs("div",{className:"flex items-center gap-1 mb-2 relative",children:[s.jsx("button",{onClick:()=>{k(!v),j(!1)},className:`p-2 rounded-lg transition-colors ${v?"text-pink-500 bg-pink-50 dark:bg-pink-900/30":"text-theme-muted hover:text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30"}`,title:"表情",children:s.jsx(dh,{size:18})}),s.jsx("button",{onClick:()=>{j(!w),k(!1)},className:`p-2 rounded-lg transition-colors ${w?"text-pink-500 bg-pink-50 dark:bg-pink-900/30":"text-theme-muted hover:text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30"}`,title:"收藏表情",children:s.jsx(b0,{size:18})}),s.jsx("button",{onClick:()=>{var M;return(M=m.current)==null?void 0:M.click()},className:"p-2 text-theme-muted hover:text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors",title:"图片",children:s.jsx(m0,{size:18})}),s.jsx("button",{onClick:()=>{var M;return(M=f.current)==null?void 0:M.click()},className:"p-2 text-theme-muted hover:text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors",title:"文件",children:s.jsx(lh,{size:18})}),v&&s.jsx(cf,{onSelect:I,onSelectEmoji:q,onClose:()=>k(!1)}),w&&s.jsx(dy,{onSelect:K,onClose:()=>j(!1)})]}),s.jsxs("div",{className:"flex items-end gap-2 relative",children:[s.jsx("input",{type:"file",ref:m,onChange:Z,accept:"image/jpeg,image/png,image/gif",className:"hidden"}),s.jsx("input",{type:"file",ref:f,onChange:oe,className:"hidden"}),s.jsx("div",{className:"flex-1 bg-theme-input border border-theme-input rounded-xl focus-within:ring-2 focus-within:ring-pink-500/20 overflow-hidden",children:s.jsx(of,{ref:d,placeholder:"输入消息...",onEnter:D,onPaste:ye,onChange:Ce,onMentionChange:E})}),g.active&&(n==null?void 0:n.chatType)===2&&s.jsx(ry,{members:N,loading:P,query:g.query,position:g.position,onSelect:_,onClose:U}),s.jsx("button",{onClick:D,disabled:!x,className:"p-2.5 bg-pink-500 text-white rounded-xl hover:bg-pink-600 disabled:opacity-50 disabled:cursor-not-allowed flex-shrink-0",children:s.jsx(rs,{size:20})})]})]})]})});uf.displayName="ChatInput";function hy(e){const t=parseInt(e);return t>1e3?`/face/emoji-${t.toString(16)}.png`:`/face/${e}.png`}const fy=({tip:e,onScrollToMessage:t})=>{const n=hy(e.emojiId),r=parseInt(e.emojiId);return s.jsx("div",{className:"flex justify-center py-2",children:s.jsxs("span",{className:"text-xs text-theme-hint bg-theme-item/50 px-3 py-1 rounded-full",children:[s.jsx("span",{className:"text-blue-500",children:e.userName}),s.jsx("span",{children:" 回应了"}),s.jsx("span",{className:"text-blue-500 cursor-pointer hover:underline",onClick:()=>t(e.msgSeq),children:"消息"}),s.jsx("span",{children:" "}),s.jsx("img",{src:n,alt:"emoji",className:"inline-block w-4 h-4 align-text-bottom",onError:l=>{const i=l.target;i.dataset.fallback||(i.dataset.fallback="1",r>1e3?(i.style.display="none",i.insertAdjacentHTML("afterend",`<span class="text-sm">${String.fromCodePoint(r)}</span>`)):i.src=`https://gxh.vip.qq.com/club/item/parcel/item/${e.emojiId.slice(0,2)}/${e.emojiId}/100x100.png`)}})]})})},py=({session:e,onShowMembers:t,onNewMessageCallback:n,onEmojiReactionCallback:r,onMessageRecalledCallback:l,appendInputText:i,onAppendInputTextConsumed:o,onBack:a,showBackButton:c})=>{const[u,d]=p.useState([]),[m,f]=p.useState([]),[v,k]=p.useState([]),[w,j]=p.useState(!1),[x,h]=p.useState(!1),[g,y]=p.useState(!0),[N,S]=p.useState(null),[P,T]=p.useState(null),[O,R]=p.useState(null),[V,C]=p.useState(null),[b,E]=p.useState(null),[_,U]=p.useState(null),[D,I]=p.useState(null),[q,K]=p.useState(!1),[Z,oe]=p.useState(null),[ye,Ce]=p.useState(null),[Q,M]=p.useState(null),[$,W]=p.useState(null),[le,ae]=p.useState(null),[ue,de]=p.useState(!1),qe=p.useMemo(()=>({showPreview:L=>S(L)}),[]),et=p.useMemo(()=>({showPreview:(L,z,A,H)=>T({chatType:L,peerUid:z,msgId:A,elementId:H})}),[]),ur=p.useMemo(()=>({showMenu:(L,z)=>{C({x:L.clientX,y:L.clientY,message:z})}}),[]),mf=p.useMemo(()=>({showMenu:(L,z,A)=>{C({x:L.clientX,y:L.clientY,message:z,elementId:A})}}),[]),hf=p.useMemo(()=>({showMenu:(L,z)=>{E({x:L.clientX,y:L.clientY,...z})}}),[]),{getCachedMembers:fs,setCachedMembers:Cy,fetchGroupMembers:ff,friendCategories:Ya}=_e(),Xa=p.useRef(null),ps=p.useRef(null),ii=p.useRef(null),dr=p.useRef(e),mr=p.useRef(!0),Ja=p.useRef(null),oi=p.useRef([]),hr=p.useRef(new Map),Za=p.useRef(null),ai=p.useRef(!1),xs=p.useRef(null),ec=p.useRef(!0),pf=p.useRef(0),ci=p.useRef(!1);p.useEffect(()=>{dr.current=e},[e]);const Ge=p.useMemo(()=>{const L=new Set,z=u.filter(J=>!J||!J.elements||!Array.isArray(J.elements)||L.has(J.msgId)?!1:(L.add(J.msgId),!0)).map(J=>({type:"raw",data:J})),A=m.map(J=>({type:"temp",data:J})),H=v.map(J=>({type:"system",data:J})),ee=[...z,...A,...H];return ee.sort((J,ne)=>{const te=X=>X.type==="raw"?parseInt(X.data.msgTime)*1e3:(X.type==="temp",X.data.timestamp);return te(J)-te(ne)}),oi.current=ee,ee},[u,m,v]),pt=Vh({count:Ge.length,getScrollElement:()=>ps.current,estimateSize:()=>80,overscan:5}),ui=p.useCallback((L,z)=>{const A=Ge.findIndex(H=>H.type!=="raw"?!1:H.data.msgId===L||z&&H.data.msgSeq===z);if(A!==-1){pt.scrollToIndex(A,{align:"center"});const H=Ge[A];H.type==="raw"&&(oe(H.data.msgId),setTimeout(()=>oe(null),2e3))}},[Ge,pt]),xf=p.useMemo(()=>({scrollToMessage:ui}),[ui]),gf=p.useMemo(()=>({getMembers:L=>fs(L)}),[fs]),yf=p.useMemo(()=>({getFriend:L=>{for(const z of Ya){const A=z.friends.find(H=>H.uin===L);if(A)return{uid:A.uid,uin:A.uin,nickname:A.nickname,remark:A.remark}}return null}}),[Ya]),di=p.useCallback(()=>{oi.current.length>0&&pt.scrollToIndex(oi.current.length-1,{align:"end"})},[pt]),[tc,nc]=p.useState(!1),fr=p.useRef(null);p.useEffect(()=>{const L=e?`${e.chatType}_${e.peerId}`:null;L!==Ja.current&&(Ja.current=L,K(!1),nc(!0))},[e==null?void 0:e.chatType,e==null?void 0:e.peerId]),p.useEffect(()=>{if(!(Ge.length===0||!tc))return fr.current&&clearTimeout(fr.current),fr.current=setTimeout(()=>{nc(!1);const L=()=>pt.scrollToIndex(Ge.length-1,{align:"end"});requestAnimationFrame(()=>{L(),setTimeout(L,50),setTimeout(()=>{L(),K(!0)},100)})},200),()=>{fr.current&&clearTimeout(fr.current)}},[Ge.length,tc,pt]),p.useEffect(()=>{mr.current&&Ge.length>0&&(di(),mr.current=!1)},[Ge.length,di]),p.useEffect(()=>(n&&n(z=>{if(!z||!z.msgId||!z.elements||!Array.isArray(z.elements))return;const A=cr(),H=z.senderUid===A;if(d(ee=>{if(ee.some(te=>te&&te.msgId===z.msgId))return ee;const J=[...ee,z],ne=dr.current;return ne&&Kh(ne.chatType,ne.peerId,z),J}),H){const ee=parseInt(z.msgTime)*1e3;f(J=>{const ne=J.filter(Pe=>Pe.status==="sending");if(ne.length===0)return J;let te=-1,X=1/0;if(ne.forEach((Pe,We)=>{const fe=Math.abs(ee-Pe.timestamp);fe<X&&fe<5e3&&(X=fe,te=We)}),te>=0){const Pe=ne[te];return J.filter(We=>We.msgId!==Pe.msgId)}return J})}}),()=>{n&&n(null)}),[n]),p.useEffect(()=>(r&&r(z=>{const A=si(),H=A&&z.userId===A;if(d(ee=>ee.map(J=>{if(J.msgSeq!==z.msgSeq)return J;const ne=J.emojiLikesList||[];if(z.isAdd){const te=ne.findIndex(X=>X.emojiId===z.emojiId);if(te>=0){const X=[...ne];return X[te]={...X[te],likesCnt:String(parseInt(X[te].likesCnt)+1),isClicked:X[te].isClicked||H},{...J,emojiLikesList:X}}else return{...J,emojiLikesList:[...ne,{emojiId:z.emojiId,emojiType:parseInt(z.emojiId)>999?"2":"1",likesCnt:"1",isClicked:H}]}}else{const te=ne.findIndex(X=>X.emojiId===z.emojiId);if(te>=0){const X=[...ne],Pe=parseInt(X[te].likesCnt)-1;return Pe<=0?X.splice(te,1):X[te]={...X[te],likesCnt:String(Pe),isClicked:H?!1:X[te].isClicked},{...J,emojiLikesList:X}}}return J})),z.isAdd&&!H){const ee={id:`tip_${Date.now()}_${Math.random()}`,type:"emoji-reaction",userName:z.userName,emojiId:z.emojiId,msgSeq:z.msgSeq,timestamp:Date.now()};k(J=>[...J,ee])}}),()=>{r&&r(null)}),[r]),p.useEffect(()=>(l&&l(z=>{d(A=>A.map(H=>H.msgId===z.msgId||z.msgSeq&&H.msgSeq===z.msgSeq?{...H,recallTime:String(Math.floor(Date.now()/1e3))}:H))}),()=>{l&&l(null)}),[l]);const rc=(L,z)=>`${L}_${z}`,sc=p.useCallback(async(L,z)=>{var J;if(!e)return;const A=e.chatType,H=e.peerId,ee=()=>{const ne=dr.current;return ne&&ne.chatType===A&&ne.peerId===H};console.log("[ChatWindow] loadMessages called:",{chatType:A,peerId:H,beforeMsgSeq:L,afterMsgSeq:z}),L?h(!0):j(!0),L&&u.length>0&&(xs.current=((J=u[0])==null?void 0:J.msgId)||null);try{const ne=await sl(A,H,L,20,z);if(console.log("[ChatWindow] API response:",{messagesCount:ne.messages.length,hasMore:ne.hasMore}),!ee()){console.log("[ChatWindow] Session changed after API call, skipping");return}const te=ne.messages.filter(X=>X!=null&&X.elements&&Array.isArray(X.elements));return console.log("[ChatWindow] Valid messages:",te.length),d(X=>{const Pe=new Set(X.map(ot=>ot.msgId)),We=te.filter(ot=>!Pe.has(ot.msgId)),fe=L?[...We,...X]:[...X,...We];return fe.sort((ot,Pt)=>parseInt(ot.msgTime)-parseInt(Pt.msgTime)),console.log("[ChatWindow] Merged messages:",fe.length,"new:",We.length),kn(A,H,fe),fe}),y(ne.hasMore),{validMessages:te,hasMore:ne.hasMore}}catch(ne){if(console.error("[ChatWindow] loadMessages error:",ne),xs.current=null,!ee())return;Y(L?"加载更多消息失败":"加载消息失败","error")}finally{ee()&&(j(!1),h(!1))}},[e,u]),vf=p.useCallback(async L=>{var ee,J,ne;if(!e)return;const z=e.chatType,A=e.peerId;j(!0);const H=()=>{const te=dr.current;return te&&te.chatType===z&&te.peerId===A};try{const te=await sl(z,A);if(!H()){console.log("[ChatWindow] Session changed during API call, skipping");return}const X=te.messages.filter(fe=>fe!=null&&fe.elements&&Array.isArray(fe.elements));if(console.log("[ChatWindow] Latest messages from API:",X.length),X.length===0){y(!1);return}const Pe=new Set(L.map(fe=>fe.msgId));if(X.some(fe=>Pe.has(fe.msgId))||L.length===0){console.log("[ChatWindow] Has overlap with cache, merging directly");const ot=[...L,...X].filter((Pt,Mn,lc)=>lc.findIndex(pr=>pr.msgId===Pt.msgId)===Mn);ot.sort((Pt,Mn)=>parseInt(Pt.msgTime)-parseInt(Mn.msgTime)),d(ot),kn(z,A,ot),y(te.hasMore)}else{console.log("[ChatWindow] No overlap, need to fill gap");let fe=[...X],ot=(ee=X[0])==null?void 0:ee.msgSeq,Pt=te.hasMore;const Mn=(J=L[L.length-1])==null?void 0:J.msgSeq;for(let dn=0;dn<10&&Pt;dn++){if(!H()){console.log("[ChatWindow] Session changed during gap fill, skipping");return}const In=await sl(z,A,ot),mn=In.messages.filter(Nt=>Nt!=null&&Nt.elements&&Array.isArray(Nt.elements));if(mn.length===0)break;fe=[...mn,...fe],ot=(ne=mn[0])==null?void 0:ne.msgSeq,Pt=In.hasMore;const mi=new Set(mn.map(Nt=>Nt.msgId));if(L.some(Nt=>mi.has(Nt.msgId))||Mn&&mn.some(Nt=>parseInt(Nt.msgSeq)<=parseInt(Mn))){console.log("[ChatWindow] Connected with cache after",dn+1,"iterations");break}}const pr=[...L,...fe].filter((dn,In,mn)=>mn.findIndex(mi=>mi.msgId===dn.msgId)===In);pr.sort((dn,In)=>parseInt(dn.msgTime)-parseInt(In.msgTime)),d(pr),kn(z,A,pr),y(Pt)}}catch(te){console.error("[ChatWindow] loadMessagesAndMergeWithCache error:",te),Y("加载消息失败","error")}finally{H()&&j(!1)}},[e]);p.useEffect(()=>{const L=xs.current;if(L&&Ge.length>0){const z=Ge.findIndex(A=>A.type==="raw"&&A.data.msgId===L);z!==-1&&pt.scrollToIndex(z,{align:"start"}),xs.current=null}},[Ge,pt]),p.useEffect(()=>{if(e){const L=++pf.current,z=rc(e.chatType,e.peerId),A=e.chatType,H=e.peerId;console.log("[ChatWindow] Session changed:",{chatType:A,peerId:H,version:L}),ci.current=!1;const ee=hr.current.get(z);ee&&ee.length>0?(console.log("[ChatWindow] Memory cache hit:",ee.length,"messages"),d(ee)):(console.log("[ChatWindow] Memory cache miss"),d([])),f([]),k([]),mr.current=!0;const J=ec.current,ne=Qa(A,H),te=J||!ne;console.log("[ChatWindow] Check load:",{isFirstMount:J,hasVisited:ne,shouldLoadFromApi:te}),hs(A,H).then(async X=>{const Pe=dr.current;if(!Pe||Pe.chatType!==A||Pe.peerId!==H){console.log("[ChatWindow] Session changed after IndexedDB read, skipping");return}let We=[];X&&X.length>0?(We=X.filter(fe=>fe.elements&&Array.isArray(fe.elements)),console.log("[ChatWindow] IndexedDB cache hit:",We.length,"valid messages"),We.length>0&&(hr.current.set(z,We),d(We))):console.log("[ChatWindow] IndexedDB cache miss"),te&&!ci.current&&(ci.current=!0,ec.current=!1,mg(A,H),console.log("[ChatWindow] Calling loadMessagesAndMergeWithCache()"),await vf(We))})}else d([]),f([]),k([])},[e==null?void 0:e.peerId,e==null?void 0:e.chatType]),p.useEffect(()=>{if(e&&u.length>0){const L=rc(e.chatType,e.peerId);hr.current.set(L,u)}},[u,e==null?void 0:e.chatType,e==null?void 0:e.peerId]),p.useEffect(()=>{const L=Za.current,z=ps.current;if(!L||!z)return;const A=new IntersectionObserver(H=>{var J;if(H[0].isIntersecting&&g&&!ai.current&&!w&&u.length>0){const ne=(J=u[0])==null?void 0:J.msgSeq;ne&&(ai.current=!0,sc(ne).finally(()=>{ai.current=!1}))}},{root:z,rootMargin:"50px 0px 0px 0px",threshold:0});return A.observe(L),()=>A.disconnect()},[g,u,sc]);const wf=p.useCallback(()=>{const L=ps.current;if(!L||u.length===0)return;const z=L.scrollHeight-L.scrollTop-L.clientHeight<100;mr.current=z,de(!z)},[u]),kf=p.useCallback(L=>{f(z=>z.filter(A=>A.msgId!==L.msgId))},[]),jf=p.useCallback(async(L,z,A,H,ee)=>{U({profile:null,loading:!0,position:{x:A,y:H}});try{const J=await $l(L,z,ee);U({profile:J,loading:!1,position:{x:A,y:H}})}catch{U(null),Y("获取用户资料失败","error")}},[]),Nf=p.useCallback(L=>{f(z=>[...z,L]),mr.current=!0},[]),bf=p.useCallback(L=>{f(z=>z.filter(A=>A.msgId!==L))},[]),Sf=p.useCallback(L=>{f(z=>z.map(A=>A.msgId===L?{...A,status:"failed"}:A))},[]);return e?s.jsx(Xh.Provider,{value:qe,children:s.jsx(Jh.Provider,{value:et,children:s.jsx(Zh.Provider,{value:mf,children:s.jsx(ef.Provider,{value:ur,children:s.jsx(tf.Provider,{value:hf,children:s.jsx(nf.Provider,{value:xf,children:s.jsx(rf.Provider,{value:gf,children:s.jsxs(sf.Provider,{value:yf,children:[s.jsxs("div",{ref:Xa,className:"flex flex-col h-full relative",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 md:px-4 py-3 border-b border-theme-divider bg-theme-card",children:[c&&s.jsx("button",{onClick:a,className:"p-2 mr-1 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors md:hidden",children:s.jsx(t0,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 cursor-pointer hover:opacity-80 transition-opacity flex-1 min-w-0",onClick:async L=>{const z=L.currentTarget.getBoundingClientRect(),A=z.left,H=z.bottom+8;if(e.chatType===2){I({profile:null,loading:!0,position:{x:A,y:H}});try{const ee=await Dh(e.peerId);I({profile:ee,loading:!1,position:{x:A,y:H}})}catch{I(null),Y("获取群资料失败","error")}}else{U({profile:null,loading:!0,position:{x:A,y:H}});try{const{friendCategories:ee}=_e.getState();let J="";for(const te of ee){const X=te.friends.find(Pe=>Pe.uin===e.peerId);if(X){J=X.uid;break}}const ne=await $l(J||void 0,e.peerId);U({profile:ne,loading:!1,position:{x:A,y:H}})}catch{U(null),Y("获取用户资料失败","error")}}},children:[s.jsx("img",{src:e.peerAvatar,alt:e.peerName,className:"w-10 h-10 rounded-full object-cover flex-shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium text-theme truncate",children:(()=>{const{groups:L,friendCategories:z}=_e.getState();if(e.chatType===2){const A=L.find(H=>H.groupCode===e.peerId);if(A!=null&&A.remarkName&&A.remarkName!==A.groupName)return`${A.remarkName}(${A.groupName})`}else for(const A of z){const H=A.friends.find(ee=>ee.uin===e.peerId);if(H!=null&&H.remark&&H.remark!==H.nickname)return`${H.remark}(${H.nickname})`}return e.peerName})()}),s.jsx("div",{className:"text-xs text-theme-hint",children:e.chatType===2?(()=>{const{groups:L}=_e.getState(),z=L.find(A=>A.groupCode===e.peerId);return`群聊 ${e.peerId}${z!=null&&z.memberCount?` · ${z.memberCount}人`:""}`})():e.chatType===100?`临时会话 ${e.peerId}`:`私聊 ${e.peerId}`})]})]}),e.chatType===2&&t&&s.jsx("button",{onClick:t,className:"p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg",title:"查看群成员",children:s.jsx(ri,{size:20})})]}),s.jsxs("div",{ref:ps,onScroll:wf,className:"flex-1 overflow-y-auto overflow-x-hidden p-4",children:[s.jsx("div",{ref:Za,className:"h-1"}),x&&s.jsx("div",{className:"flex justify-center py-2",children:s.jsx(Se,{size:20,className:"animate-spin text-pink-500"})}),w?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Se,{size:32,className:"animate-spin text-pink-500"})}):Ge.length===0?s.jsx("div",{className:"flex items-center justify-center h-full text-theme-hint",children:"暂无消息"}):s.jsx("div",{style:{height:`${pt.getTotalSize()}px`,width:"100%",position:"relative",opacity:q?1:0},className:"overflow-hidden",children:pt.getVirtualItems().map(L=>{const z=Ge[L.index];return s.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${L.start}px)`,padding:"8px 0"},"data-index":L.index,ref:pt.measureElement,className:"overflow-hidden box-border",children:z.type==="raw"?s.jsx(Gg,{message:z.data,allMessages:u,isHighlighted:Z===z.data.msgId}):z.type==="temp"?s.jsx(Xg,{message:z.data,onRetry:()=>kf(z.data)}):s.jsx(fy,{tip:z.data,onScrollToMessage:A=>ui("",A)})},L.key)})})]}),ue&&s.jsx("button",{onClick:di,className:"absolute bottom-[6.5rem] right-4 w-6 h-6 bg-theme-card/90 border border-theme-divider rounded-full shadow-md flex items-center justify-center text-theme-muted hover:text-theme hover:bg-theme-item transition-all z-10",title:"滚动到底部",children:s.jsx($o,{size:12})}),s.jsx(uf,{ref:ii,session:e,replyTo:O,onReplyCancel:()=>R(null),onSendStart:()=>{},onSendEnd:()=>{},onTempMessage:Nf,onTempMessageRemove:bf,onTempMessageFail:Sf})]}),V&&s.jsx(ty,{contextMenu:V,session:e,getCachedMembers:fs,onClose:()=>C(null),onReply:L=>{R(L),setTimeout(()=>{var z,A;return(A=(z=ii.current)==null?void 0:z.focus)==null?void 0:A.call(z)},50)},onEmojiReaction:(L,z,A)=>ae({message:L,x:z,y:A}),onRecall:L=>{if(d(z=>z.filter(A=>A.msgId!==L)),e){const z=`${e.chatType}_${e.peerId}`,A=hr.current.get(z);A&&hr.current.set(z,A.filter(H=>H.msgId!==L)),_g(e.chatType,e.peerId,L)}}}),le&&s.jsx(my,{target:le,onClose:()=>ae(null),containerRef:Xa}),b&&s.jsx(ny,{avatarContextMenu:b,getCachedMembers:fs,onClose:()=>E(null),onInsertAt:(L,z,A)=>{var H,ee;return(ee=(H=ii.current)==null?void 0:H.insertAt)==null?void 0:ee.call(H,L,z,A)},onShowProfile:jf,onSetTitle:(L,z,A)=>W({uid:L,name:z,groupCode:A}),onMute:(L,z,A)=>M({uid:L,name:z,groupCode:A}),onKick:(L,z,A,H)=>Ce({uid:L,name:z,groupCode:A,groupName:H}),onAdminChanged:()=>e&&ff(e.peerId,!0),groupName:e==null?void 0:e.peerName}),_&&s.jsx(Yh,{profile:_.profile,loading:_.loading,position:_.position,onClose:()=>U(null),isFriend:(e==null?void 0:e.chatType)===1,onFriendDeleted:L=>{const{removeFriend:z,setCurrentChat:A,removeRecentChat:H}=_e.getState();z(L),(e==null?void 0:e.chatType)===1&&(A(null),H(1,e.peerId))}}),D&&s.jsx(Ug,{profile:D.profile,loading:D.loading,position:D.position,onClose:()=>I(null),onQuitGroup:async(L,z)=>{try{await _h(L),Y(z?"群已解散":"已退出群聊","success");const{setCurrentChat:A,removeRecentChat:H}=_e.getState();A(null),H(2,L)}catch(A){Y(A.message||(z?"解散失败":"退群失败"),"error")}}}),ye&&s.jsx(Zg,{name:ye.name,groupName:ye.groupName,onConfirm:async()=>{const{uid:L,name:z,groupCode:A}=ye;Ce(null);try{await Ph(A,L),Y(`已将 ${z} 移出群聊`,"success")}catch(H){Y(H.message||"踢出失败","error")}},onClose:()=>Ce(null)}),Q&&s.jsx(Jg,{name:Q.name,onMute:async L=>{const{uid:z,name:A,groupCode:H}=Q;M(null);try{if(await zh(H,z,L),L===0)Y(`已解除 ${A} 的禁言`,"success");else{const ee=L>=86400?`${Math.floor(L/86400)}天`:L>=3600?`${Math.floor(L/3600)}小时`:L>=60?`${Math.floor(L/60)}分钟`:`${L}秒`;Y(`已禁言 ${A} ${ee}`,"success")}}catch(ee){Y(ee.message||"禁言失败","error")}},onClose:()=>M(null)}),$&&s.jsx(ey,{name:$.name,onConfirm:async L=>{const{uid:z,name:A,groupCode:H}=$;W(null);try{await Lh(H,z,L),Y(L?`已设置 ${A} 的头衔为「${L}」`:`已清除 ${A} 的头衔`,"success")}catch(ee){Y(ee.message||"设置头衔失败","error")}},onClose:()=>W(null)}),s.jsx(Dg,{url:N,onClose:()=>S(null)}),s.jsx(Og,{videoInfo:P,onClose:()=>T(null)})]})})})})})})})}):s.jsx("div",{className:"flex-1 flex items-center justify-center bg-theme-item",children:s.jsxs("div",{className:"text-center text-theme-hint",children:[s.jsx("div",{className:"text-6xl mb-4",children:"💬"}),s.jsx("p",{children:"选择一个联系人开始聊天"})]})})},xy=({member:e,onContextMenu:t,onClick:n})=>{const r=e.card||e.nickname,l=e.role==="owner"?s.jsx(ni,{size:14,className:"text-yellow-500"}):e.role==="admin"?s.jsx(ds,{size:14,className:"text-blue-500"}):null,i=o=>{("ontouchstart"in window||navigator.maxTouchPoints>0)&&(n==null||n(o))};return s.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 hover:bg-theme-item-hover transition-colors cursor-pointer",onClick:i,onContextMenu:t,children:[s.jsx("img",{src:e.avatar,alt:r,className:"w-8 h-8 rounded-full object-cover flex-shrink-0",loading:"lazy",onError:o=>{o.currentTarget.src=`https://q1.qlogo.cn/g?b=qq&nk=${e.uin}&s=640`}}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-sm text-theme truncate",children:r}),l]}),e.card&&e.card!==e.nickname&&s.jsx("div",{className:"text-xs text-theme-hint truncate",children:e.nickname})]})]})},gy=({groupCode:e,onClose:t,onAtMember:n})=>{const[r,l]=p.useState([]),[i,o]=p.useState(!1),[a,c]=p.useState(""),[u,d]=p.useState(null),[m,f]=p.useState(null),[v,k]=p.useState(null),{getCachedMembers:w,fetchGroupMembers:j}=_e(),x=p.useRef(null),h=p.useRef(e);p.useEffect(()=>{h.current=e},[e]);const g=p.useRef(w);g.current=w;const y=p.useRef(j);y.current=j;const N=p.useRef(!1);p.useEffect(()=>{const b=e,E=!Qa(2,b),_=hg(b);console.log("[GroupMemberPanel] useEffect triggered:",{groupCode:b,isFirstVisit:E,alreadyFetched:_});const U=g.current(b);if(U&&(console.log("[GroupMemberPanel] Cache hit:",U.length,"members"),l(U),d(null),_)){o(!1);return}if(_){o(!1);return}if(N.current){console.log("[GroupMemberPanel] Already loading, skip");return}return console.log("[GroupMemberPanel] Fetching from API, isFirstVisit:",E),N.current=!0,U||(o(!0),d(null),l([])),y.current(b,E).then(D=>{console.log("[GroupMemberPanel] API success:",D.length,"members, currentGroupCode:",h.current),h.current===b&&(l(D),o(!1),fg(b))}).catch(D=>{console.log("[GroupMemberPanel] API error:",D.message),h.current===b&&(U||d(D.message||"加载群成员失败"),Y("加载群成员失败","error"),o(!1))}).finally(()=>{h.current===b&&(N.current=!1)}),()=>{console.log("[GroupMemberPanel] Cleanup, reset isLoading"),N.current=!1}},[e]);const S=p.useMemo(()=>$h(r,a),[r,a]),P=Vh({count:S.length,getScrollElement:()=>x.current,estimateSize:()=>48,overscan:5}),T=p.useMemo(()=>{const b=r.filter(_=>_.role==="owner").length,E=r.filter(_=>_.role==="admin").length;return{owner:b,admin:E,total:r.length}},[r]),O=p.useCallback((b,E)=>{b.preventDefault(),b.stopPropagation(),f({x:b.clientX,y:b.clientY,member:E})},[]),R=p.useCallback(()=>{if(m&&n){const b=m.member.card||m.member.nickname;n(b)}f(null)},[m,n]),V=p.useCallback(async()=>{if(!m)return;const b=m.member;f(null);try{await Fl(2,Number(b.uin),Number(e))}catch(E){Y(E.message||"戳一戳失败","error")}},[m,e]),C=p.useCallback(async()=>{if(!m)return;const b=m.member,E={x:m.x,y:m.y};f(null),k({profile:null,loading:!0,position:E});try{const _=await $l(b.uid,b.uin,e);k({profile:_,loading:!1,position:E})}catch(_){Y(_.message||"获取资料失败","error"),k(null)}},[m,e]);return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-theme-divider",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-theme",children:"群成员"}),s.jsxs("div",{className:"text-xs text-theme-hint",children:[T.total," 人"]})]}),s.jsx("button",{onClick:t,className:"p-1.5 text-theme-hint hover:text-theme hover:bg-theme-item rounded-lg transition-colors",children:s.jsx(ft,{size:18})})]}),s.jsx("div",{className:"p-3",children:s.jsxs("div",{className:"relative",children:[s.jsx(ch,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-theme-hint"}),s.jsx("input",{type:"text",value:a,onChange:b=>c(b.target.value),placeholder:"搜索成员...",className:"w-full pl-9 pr-3 py-2 text-sm bg-theme-input border border-theme-input rounded-lg focus:outline-none focus:ring-2 focus:ring-pink-500/20 focus:border-pink-500/50 text-theme placeholder:text-theme-hint"})]})}),s.jsx("div",{ref:x,className:"flex-1 overflow-y-auto",children:i?s.jsx("div",{className:"flex items-center justify-center h-32",children:s.jsx(Se,{size:24,className:"animate-spin text-pink-500"})}):u?s.jsxs("div",{className:"flex flex-col items-center justify-center h-32 gap-2",children:[s.jsx("p",{className:"text-sm text-red-500",children:u}),s.jsx("button",{onClick:()=>j(e),className:"text-sm text-pink-500 hover:text-pink-600",children:"重试"})]}):S.length===0?s.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:a?"未找到匹配的成员":"暂无成员"}):s.jsx("div",{className:"py-1 relative",style:{height:P.getTotalSize()},children:P.getVirtualItems().map(b=>{const E=S[b.index];return s.jsx("div",{className:"absolute left-0 right-0",style:{top:b.start,height:b.size},children:s.jsx(xy,{member:E,onClick:_=>O(_,E),onContextMenu:_=>O(_,E)})},E.uid)})})}),m&&Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>f(null),onContextMenu:b=>{b.preventDefault(),f(null)}}),s.jsxs("div",{className:"fixed z-50 bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[120px]",style:{left:m.x,top:Math.min(m.y,window.innerHeight-150)},onContextMenu:b=>b.preventDefault(),children:[n&&s.jsxs("button",{onClick:R,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(Zm,{size:14}),"@ta"]}),s.jsxs("button",{onClick:V,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(th,{size:14}),"戳一戳"]}),s.jsxs("button",{onClick:C,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(fh,{size:14}),"查看资料"]})]})]}),document.body),v&&s.jsx(Yh,{profile:v.profile,loading:v.loading,position:v.position,onClose:()=>k(null)})]})};function yy(e){if(!e||!e.elements||!Array.isArray(e.elements))return"[消息]";for(const t of e.elements){if(t.textElement)return t.textElement.content;if(t.picElement)return"[图片]";if(t.faceElement)return"[表情]";if(t.fileElement)return"[文件]";if(t.pttElement)return"[语音]";if(t.videoElement)return"[视频]"}return"[消息]"}const df=({isFullscreen:e=!1})=>{const t=ce.useRef(null),n=ce.useRef(null),r=ce.useRef(null),l=ce.useRef([]),[,i]=ce.useState(0),{showWebQQFullscreenButton:o}=Ha(),{friendCategories:a,groups:c,contactsLoading:u,contactsError:d,currentChat:m,activeTab:f,unreadCounts:v,showMemberPanel:k,setCurrentChat:w,setActiveTab:j,setShowMemberPanel:x,clearUnreadCount:h,incrementUnreadCount:g,updateRecentChat:y,loadContacts:N,setRecentChats:S}=_e(),P=_e(M=>M.recentChats),[T,O]=ce.useState(""),R=p.useCallback(M=>{O(`@${M} `)},[]),V=p.useCallback(()=>{O("")},[]);p.useEffect(()=>{Pu(),Nh().catch(M=>console.error("获取登录信息失败:",M)),N()},[N]),p.useEffect(()=>{d&&Y(d,"error")},[d]);const C=ce.useRef(m);p.useEffect(()=>{C.current=m},[m]);const b=ce.useCallback(M=>{if(t.current=M,M&&l.current.length>0){const $=[...l.current];l.current=[],$.forEach(W=>M(W))}i($=>$+1)},[]),E=ce.useCallback(M=>{n.current=M},[]),_=ce.useCallback(M=>{r.current=M},[]);p.useEffect(()=>{const M=Ah($=>{if($.type==="message-created"||$.type==="message-sent"){const W=$.data;if(!W||!W.msgId||!W.elements||!Array.isArray(W.elements)){console.warn("SSE 收到无效消息:",W);return}const le=W.chatType,ae=W.peerUin||W.peerUid,ue=`${le}_${ae}`,de=C.current;Kh(le,ae,W),de&&de.chatType===le&&de.peerId===ae?t.current?t.current(W):l.current.push(W):g(ue);const qe=yy(W);let et,ur;le===2?(et=W.peerName||void 0,ur=`https://p.qlogo.cn/gh/${ae}/${ae}/640/`):(et=W.sendNickName||W.sendMemberName||void 0,ur=`https://q1.qlogo.cn/g?b=qq&nk=${ae}&s=640`),y(le,ae,qe,parseInt(W.msgTime)*1e3,et,ur)}else if($.type==="emoji-reaction"){const{groupCode:W,msgSeq:le,emojiId:ae,userId:ue,userName:de,isAdd:qe}=$.data,et=C.current;Ag(2,W,le,ae,qe),et&&et.chatType===2&&et.peerId===W&&n.current&&n.current({groupCode:W,msgSeq:le,emojiId:ae,userId:ue,userName:de,isAdd:qe})}else if($.type==="message-deleted"){const{msgId:W,msgSeq:le,chatType:ae,peerUid:ue,peerUin:de}=$.data,qe=de||ue,et=C.current;Fg(ae,qe,W,le),et&&et.chatType===ae&&et.peerId===qe&&r.current&&r.current({msgId:W,msgSeq:le})}},$=>{console.error("SSE 连接错误:",$)},()=>{console.log("[WebQQ] SSE 重连成功,重置已访问聊天标志"),Pu(),N()});return()=>{M.close()}},[g,y,N]);const U=p.useCallback(M=>{l.current=[],w(M),M.chatType!==2&&x(!1);const $=`${M.chatType}_${M.peerId}`;h($),S(P.map(W=>W.chatType===M.chatType&&W.peerId===M.peerId?{...W,unreadCount:0}:W))},[w,h,S,P,x]),[D,I]=p.useState(!1),q=p.useCallback(M=>{U(M),I(!0)},[U]),K=p.useCallback(()=>{I(!1)},[]),Z=p.useCallback(M=>{const $={chatType:1,peerId:M.uin,peerName:M.remark||M.nickname,peerAvatar:M.avatar};q($)},[q]),oe=p.useCallback(M=>{const $={chatType:2,peerId:M.groupCode,peerName:M.groupName,peerAvatar:M.avatar};q($)},[q]),ye=p.useCallback(M=>{const $={chatType:M.chatType,peerId:M.peerId,peerName:M.peerName,peerAvatar:M.peerAvatar};q($)},[q]),Ce=ce.useMemo(()=>new Map(Object.entries(v)),[v]);return u&&a.length===0&&c.length===0?s.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:s.jsx(Se,{size:48,className:"animate-spin text-pink-500"})}):d&&a.length===0&&c.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-[calc(100vh-200px)] gap-4",children:[s.jsx("p",{className:"text-red-500",children:d}),s.jsx("button",{onClick:()=>N(),className:"px-4 py-2 bg-pink-500 text-white rounded-lg hover:bg-pink-600 transition-colors",children:"重试"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex h-[calc(100vh-80px)] md:h-[calc(100vh-120px)] bg-theme-card backdrop-blur-xl rounded-none md:rounded-2xl overflow-hidden shadow-xl border border-theme",children:[s.jsx("div",{className:`
|
|
447
|
+
`})]})});of.displayName="RichInput";const ry=({members:e,loading:t,query:n,position:r,onSelect:l,onClose:i})=>{const o=p.useRef(null),[a,c]=p.useState(0),u=p.useMemo(()=>{if(!n)return e.slice(0,20);const m=n.toLowerCase();return e.filter(f=>{var y;return f.nickname.toLowerCase().includes(m)||((y=f.card)==null?void 0:y.toLowerCase().includes(m))||f.uin.includes(n)}).slice(0,20)},[e,n]);p.useEffect(()=>{c(0)},[n]),p.useEffect(()=>{const m=f=>{f.key==="ArrowDown"?(f.preventDefault(),c(y=>Math.min(y+1,u.length-1))):f.key==="ArrowUp"?(f.preventDefault(),c(y=>Math.max(y-1,0))):f.key==="Enter"||f.key==="Tab"?(f.preventDefault(),u[a]&&l(u[a])):f.key==="Escape"&&(f.preventDefault(),i())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[u,a,l,i]),p.useEffect(()=>{const m=f=>{o.current&&!o.current.contains(f.target)&&i()};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[i]),p.useEffect(()=>{const m=o.current;if(!m)return;const f=m.querySelector(`[data-index="${a}"]`);f&&f.scrollIntoView({block:"nearest"})},[a]);const d=m=>m==="owner"?s.jsx(ri,{size:12,className:"text-yellow-500"}):m==="admin"?s.jsx(ms,{size:12,className:"text-green-500"}):null;return s.jsx("div",{ref:o,className:"absolute z-50 bg-white dark:bg-neutral-800 rounded-xl shadow-xl border border-theme-divider overflow-hidden",style:{bottom:"100%",left:0,marginBottom:8,minWidth:240,maxWidth:300},children:t?s.jsx("div",{className:"flex items-center justify-center py-4",children:s.jsx(Se,{size:20,className:"animate-spin text-pink-500"})}):u.length===0?s.jsx("div",{className:"py-3 px-4 text-sm text-theme-muted text-center",children:n?"没有匹配的成员":"暂无成员"}):s.jsx("div",{className:"max-h-[200px] overflow-y-auto py-1",children:u.map((m,f)=>s.jsxs("div",{"data-index":f,onClick:()=>l(m),className:`flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${f===a?"bg-pink-50 dark:bg-pink-900/30":"hover:bg-theme-item-hover"}`,children:[s.jsx("img",{src:m.avatar||`https://q1.qlogo.cn/g?b=qq&nk=${m.uin}&s=40`,alt:"",className:"w-7 h-7 rounded-full flex-shrink-0",loading:"lazy"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-sm text-theme truncate",children:m.card||m.nickname}),d(m.role)]}),m.card&&m.card!==m.nickname&&s.jsx("div",{className:"text-xs text-theme-muted truncate",children:m.nickname})]})]},m.uid))})})},sy=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,41,42,43,46,49,53,56,59,60,63,64,66,67,74,75,76,77,78,79,85,86,89,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,114,116,118,119,120,121,123,124,125,129,137,144,146,147,169,171,172,173,174,175,176,177,178,179,181,182,183,185,187,201,212,262,263,264,265,266,267,268,269,270,271,272,273,277,281,282,283,284,285,286,287,289,293,294,295,297,298,299,300,302,303,305,306,307,311,312,314,317,318,319,320,323,324,325,326,332,333,334,336,337,338,339,341,342,343,344,345,346,347,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,415,416,417,419,420,421,422,423,424,425,426,427,428,429,430,431,432,451,453,454,458,459,460,461,462],ly=[{codePoint:9728,char:"☀"},{codePoint:9749,char:"☕"},{codePoint:9786,char:"☺"},{codePoint:10024,char:"✨"},{codePoint:10068,char:"❔"},{codePoint:127801,char:"🌹"},{codePoint:127817,char:"🍉"},{codePoint:127822,char:"🍎"},{codePoint:127827,char:"🍓"},{codePoint:127836,char:"🍜"},{codePoint:127838,char:"🍞"},{codePoint:127847,char:"🍧"},{codePoint:127866,char:"🍺"},{codePoint:127867,char:"🍻"},{codePoint:127881,char:"🎉"},{codePoint:127978,char:"🏪"},{codePoint:128014,char:"🐎"},{codePoint:128020,char:"🐔"},{codePoint:128027,char:"🐛"},{codePoint:128046,char:"🐮"},{codePoint:128051,char:"🐳"},{codePoint:128053,char:"🐵"},{codePoint:128054,char:"🐶"},{codePoint:128055,char:"🐷"},{codePoint:128056,char:"🐸"},{codePoint:128064,char:"👀"},{codePoint:128070,char:"👆"},{codePoint:128074,char:"👊"},{codePoint:128076,char:"👌"},{codePoint:128077,char:"👍"},{codePoint:128078,char:"👎"},{codePoint:128079,char:"👏"},{codePoint:128098,char:"👢"},{codePoint:128102,char:"👦"},{codePoint:128103,char:"👧"},{codePoint:128123,char:"👻"},{codePoint:128137,char:"💉"},{codePoint:128147,char:"💓"},{codePoint:128157,char:"💝"},{codePoint:128163,char:"💣"},{codePoint:128164,char:"💤"},{codePoint:128166,char:"💦"},{codePoint:128168,char:"💨"},{codePoint:128169,char:"💩"},{codePoint:128170,char:"💪"},{codePoint:128235,char:"📫"},{codePoint:128293,char:"🔥"},{codePoint:128299,char:"🔫"},{codePoint:128513,char:"😁"},{codePoint:128514,char:"😂"},{codePoint:128516,char:"😄"},{codePoint:128522,char:"😊"},{codePoint:128524,char:"😌"},{codePoint:128525,char:"😍"},{codePoint:128527,char:"😏"},{codePoint:128530,char:"😒"},{codePoint:128531,char:"😓"},{codePoint:128532,char:"😔"},{codePoint:128536,char:"😘"},{codePoint:128538,char:"😚"},{codePoint:128540,char:"😜"},{codePoint:128541,char:"😝"},{codePoint:128557,char:"😭"},{codePoint:128560,char:"😰"},{codePoint:128561,char:"😱"},{codePoint:128563,char:"😳"},{codePoint:128591,char:"🙏"},{codePoint:128684,char:"🚬"}],af="webqq_recent_emojis",iy=10;function il(){try{const e=localStorage.getItem(af);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)&&t.length>0&&typeof t[0]=="number"?t.map(n=>({type:"face",faceId:n})):t}catch{return[]}}function Fu(e){const t=il().filter(n=>n.type!==e.type?!0:n.type==="face"?n.faceId!==e.faceId:n.codePoint!==e.codePoint);t.unshift(e),localStorage.setItem(af,JSON.stringify(t.slice(0,iy)))}const cf=({onSelect:e,onSelectEmoji:t,onClose:n,position:r,inline:l})=>{const[i,o]=p.useState(new Set),[a,c]=p.useState(il()),[u,d]=p.useState("qq"),m=p.useRef(null);p.useEffect(()=>{const k=j=>{m.current&&!m.current.contains(j.target)&&n()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[n]);const f=k=>{Fu({type:"face",faceId:k}),c(il()),e(k)},y=(k,j)=>{Fu({type:"emoji",codePoint:k,char:j}),c(il()),t&&t(j)},w=(k,j)=>k.type==="face"&&k.faceId!==void 0?s.jsx("button",{onClick:()=>f(k.faceId),className:"w-8 h-8 flex items-center justify-center hover:bg-theme-item rounded transition-colors",title:`表情 ${k.faceId}`,children:s.jsx("img",{src:`/face/${k.faceId}.png`,alt:`表情${k.faceId}`,className:"w-6 h-6"})},`recent-face-${k.faceId}`):k.type==="emoji"&&k.char?s.jsx("button",{onClick:()=>y(k.codePoint,k.char),className:"w-8 h-8 flex items-center justify-center hover:bg-theme-item rounded transition-colors text-xl",title:k.char,children:k.char},`recent-emoji-${k.codePoint}`):null;return s.jsxs("div",{ref:m,className:`${l?"":"absolute bottom-full left-0 mb-2"} bg-theme-card border border-theme-divider rounded-xl shadow-xl z-50`,style:r?{left:r.x,bottom:r.y}:void 0,children:[s.jsxs("div",{className:"flex border-b border-theme-divider",children:[s.jsx("button",{className:`flex-1 px-3 py-2 text-sm ${u==="qq"?"text-pink-500 border-b-2 border-pink-500":"text-theme-secondary"}`,onClick:()=>d("qq"),children:"QQ表情"}),s.jsx("button",{className:`flex-1 px-3 py-2 text-sm ${u==="emoji"?"text-pink-500 border-b-2 border-pink-500":"text-theme-secondary"}`,onClick:()=>d("emoji"),children:"Emoji"})]}),s.jsxs("div",{className:"p-2 max-h-[280px] overflow-y-auto w-[320px]",children:[a.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-xs text-theme-hint mb-1",children:"最近使用"}),s.jsx("div",{className:"grid grid-cols-8 gap-1 mb-2 pb-2 border-b border-theme-divider",children:a.map((k,j)=>w(k))})]}),u==="qq"?s.jsx("div",{className:"grid grid-cols-8 gap-1",children:sy.map(k=>s.jsx("button",{onClick:()=>f(k),className:"w-8 h-8 flex items-center justify-center hover:bg-theme-item rounded transition-colors",title:`表情 ${k}`,children:s.jsx("img",{src:`/face/${k}.png`,alt:`表情${k}`,className:`w-6 h-6 transition-opacity ${i.has(k)?"opacity-100":"opacity-0"}`,onLoad:()=>o(j=>new Set(j).add(k)),onError:j=>{j.target.style.display="none"}})},k))}):s.jsx("div",{className:"grid grid-cols-8 gap-1",children:ly.map(({codePoint:k,char:j})=>s.jsx("button",{onClick:()=>y(k,j),className:"w-8 h-8 flex items-center justify-center hover:bg-theme-item rounded transition-colors text-xl",title:j,children:j},k))})]})]})};let Ln=null;const Ka="webqq_recent_fav_emojis",oy=10;function Dr(){try{const e=localStorage.getItem(Ka);return e?JSON.parse(e):[]}catch{return[]}}function ay(e){const t=Dr().filter(n=>n.emoId!==e.emoId);t.unshift(e),localStorage.setItem(Ka,JSON.stringify(t.slice(0,oy)))}function cy(e){const t=Dr().filter(n=>n.emoId!==e);localStorage.setItem(Ka,JSON.stringify(t))}const uy=({x:e,y:t,onClose:n,onDelete:r})=>{const l=p.useRef(null),[i,o]=p.useState({left:e,top:t});return p.useEffect(()=>{if(!l.current)return;const a=l.current.getBoundingClientRect(),c=10;let u=e,d=t;e+a.width>window.innerWidth-c&&(u=e-a.width),u<c&&(u=c),t+a.height>window.innerHeight-c&&(d=t-a.height),d<c&&(d=c),o({left:u,top:d})},[e,t]),Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-[60]",onClick:n,onContextMenu:a=>{a.preventDefault(),n()}}),s.jsx("div",{ref:l,className:"fixed z-[60] bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[100px]",style:{left:i.left,top:i.top},onContextMenu:a=>a.preventDefault(),children:s.jsxs("button",{onClick:r,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-500 hover:bg-theme-item-hover transition-colors",children:[s.jsx(It,{size:14})," 删除"]})})]}),document.body)},dy=({onSelect:e,onClose:t})=>{const[n,r]=p.useState(Ln||[]),[l,i]=p.useState(!Ln),[o,a]=p.useState(null),[c,u]=p.useState(Dr()),[d,m]=p.useState(null),f=p.useRef(null);p.useEffect(()=>{if(Ln){r(Ln),i(!1);return}(async()=>{try{const v=((await te("ntMsgApi","fetchFavEmojiList",[1e3])).emojiInfoList||[]).map(N=>({emoId:N.emoId,resId:N.resId||"",url:N.url,desc:N.desc||""}));Ln=v,r(v)}catch{a("加载失败")}finally{i(!1)}})()},[]);const y=p.useRef(d);y.current=d,p.useEffect(()=>{const g=h=>{y.current||f.current&&!f.current.contains(h.target)&&t()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[t]);const w=g=>{ay(g),u(Dr()),e(g)},k=(g,h)=>{g.preventDefault(),g.stopPropagation(),m({x:g.clientX,y:g.clientY,emoji:h})},j=async()=>{if(!d)return;const{emoji:g}=d;m(null);try{const h=await te("ntMsgApi","deleteFavEmoji",[[g.resId]]);if(h.result===0){Y("已删除","success");const x=n.filter(v=>v.emoId!==g.emoId);r(x),Ln=x,cy(g.emoId),u(Dr())}else Y(h.errMsg||"删除失败","error")}catch(h){Y(h.message||"删除失败","error")}};return s.jsxs("div",{ref:f,className:"absolute bottom-full left-0 mb-2 bg-theme-card border border-theme-divider rounded-xl shadow-xl z-50 w-[320px]",children:[s.jsx("div",{className:"p-2 border-b border-theme-divider text-sm text-theme-secondary",children:"收藏表情"}),s.jsxs("div",{className:"p-2 max-h-[300px] overflow-y-auto",children:[c.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-xs text-theme-hint mb-1",children:"最近使用"}),s.jsx("div",{className:"grid grid-cols-4 gap-1 mb-2 pb-2 border-b border-theme-divider",children:c.map(g=>s.jsx("button",{onClick:()=>w(g),onContextMenu:h=>k(h,g),className:"p-1 rounded-lg hover:bg-theme-item transition-colors",title:g.desc,children:s.jsx("img",{src:g.url,alt:g.desc,className:"w-16 h-16 object-contain"})},`recent-${g.emoId}`))})]}),l?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Se,{size:24,className:"animate-spin text-pink-500"})}):o?s.jsx("div",{className:"text-center py-8 text-theme-hint text-sm",children:o}):n.length===0?s.jsx("div",{className:"text-center py-8 text-theme-hint text-sm",children:"暂无收藏表情"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-xs text-theme-hint mb-1",children:"全部"}),s.jsx("div",{className:"grid grid-cols-4 gap-1",children:n.map(g=>s.jsx("button",{onClick:()=>w(g),onContextMenu:h=>k(h,g),className:"p-1 rounded-lg hover:bg-theme-item transition-colors",title:g.desc,children:s.jsx("img",{src:g.url,alt:g.desc,className:"w-16 h-16 object-contain",loading:"lazy"})},g.emoId))})]})]}),d&&s.jsx(uy,{x:d.x,y:d.y,emoji:d.emoji,onClose:()=>m(null),onDelete:j})]})},my=({target:e,onClose:t,containerRef:n})=>{const r=async a=>{const c=e.message;t();try{const u={chatType:c.chatType,peerUid:c.peerUin,guildId:""};await te("ntMsgApi","setEmojiLike",[u,c.msgSeq,String(a),!0])}catch(u){Y(u.message||"贴表情失败","error")}},l=async a=>{const c=e.message;t();try{const u={chatType:c.chatType,peerUid:c.peerUin,guildId:""},d=a.codePointAt(0);if(!d){Y("无效的表情","error");return}await te("ntMsgApi","setEmojiLike",[u,c.msgSeq,String(d),!0])}catch(u){Y(u.message||"贴表情失败","error")}},o=(()=>{if(n!=null&&n.current){const a=n.current.getBoundingClientRect();return{left:a.left+a.width/2,top:a.top+a.height/2}}return{left:window.innerWidth/2,top:window.innerHeight/2}})();return Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:t}),s.jsx("div",{className:"fixed z-50 -translate-x-1/2 -translate-y-1/2",style:{left:o.left,top:o.top},children:s.jsx(cf,{onSelect:r,onSelectEmoji:l,onClose:t,inline:!0})})]}),document.body)},uf=p.forwardRef((e,t)=>{var Q;const{session:n,replyTo:r,onReplyCancel:l,onSendStart:i,onSendEnd:o,onTempMessage:a,onTempMessageRemove:c,onTempMessageFail:u}=e,d=p.useRef(null),m=p.useRef(null),f=p.useRef(null),[y,w]=p.useState(!1),[k,j]=p.useState(!1),[g,h]=p.useState(!1),[x,v]=p.useState({active:!1,query:"",position:{top:0,left:0}}),[N,S]=p.useState([]),[T,M]=p.useState(!1),{getCachedMembers:q,fetchGroupMembers:R}=ze(),V=p.useRef(null),C=p.useRef(q);C.current=q;const b=p.useRef(R);b.current=R,p.useImperativeHandle(t,()=>({insertAt:(I,F,H)=>{var se;(se=d.current)==null||se.insertAt(I,F,H)},insertText:I=>{var F;(F=d.current)==null||F.insertText(I)},focus:()=>{var I;(I=d.current)==null||I.focus()}}),[]),p.useEffect(()=>{const I=(n==null?void 0:n.chatType)===2?n.peerId:null;if(V.current=I,!I){S([]),M(!1);return}const F=!Qa(2,I);if(!F){const H=C.current(I);if(H){S(H),M(!1);return}}M(!0),S([]),b.current(I,F).then(H=>{V.current===I&&(S(H),M(!1))}).catch(()=>{V.current===I&&M(!1)})},[n==null?void 0:n.chatType,n==null?void 0:n.peerId]);const E=p.useCallback(I=>{if((n==null?void 0:n.chatType)!==2){v({active:!1,query:"",position:{top:0,left:0}});return}v(I)},[n==null?void 0:n.chatType]),_=p.useCallback(I=>{var F;(F=d.current)==null||F.insertAt(I.uid,I.uin,I.card||I.nickname)},[]),U=p.useCallback(()=>{var I;(I=d.current)==null||I.cancelMention()},[]),D=p.useCallback(async()=>{if(!n||!d.current)return;const I=d.current.getContent();if(d.current.isEmpty())return;i();const H=r;d.current.clear(),l(),h(!1),setTimeout(()=>{var ue;return(ue=d.current)==null?void 0:ue.focus()},0);const se=I.map(ue=>({type:ue.type,content:ue.content,faceId:ue.faceId,imageUrl:ue.imageUrl,atName:ue.atName})),le=`temp_${Date.now()}`;a({msgId:le,items:se,timestamp:Date.now(),status:"sending"});try{const ue=[];H&&ue.push({type:"reply",msgId:H.msgId,msgSeq:H.msgSeq});for(const de of I)if(de.type==="text"&&de.content)ue.push({type:"text",text:de.content});else if(de.type==="face"&&de.faceId!==void 0)ue.push({type:"face",faceId:de.faceId});else if(de.type==="image"){if(de.imageFile){const Oe=await bh(de.imageFile);ue.push({type:"image",imagePath:Oe.imagePath})}else if(de.imageUrl){const Oe=await Sh(de.imageUrl);ue.push({type:"image",imagePath:Oe.imagePath})}}else de.type==="at"&&de.atUid&&ue.push({type:"at",uid:de.atUid,uin:de.atUin,name:de.atName});if(ue.length===0){c(le);return}await Ho({chatType:n.chatType,peerId:n.peerId,content:ue}),c(le)}catch{Y("发送失败","error"),u(le)}finally{o()}},[n,r,i,o,l,a,c,u]),P=p.useCallback(I=>{var F;(F=d.current)==null||F.insertFace(I),w(!1)},[]),W=p.useCallback(I=>{var F;(F=d.current)==null||F.insertText(I),w(!1)},[]),K=p.useCallback(I=>{var F;j(!1),(F=d.current)==null||F.insertImage(null,I.url)},[]),J=p.useCallback(I=>{var H,se;const F=(H=I.target.files)==null?void 0:H[0];if(F){if(!Uh(F.name)){Y("不支持的图片格式,仅支持 JPG、PNG、GIF","error");return}(se=d.current)==null||se.insertImage(F,URL.createObjectURL(F)),m.current&&(m.current.value="")}},[]),ae=p.useCallback(async I=>{var se;const F=(se=I.target.files)==null?void 0:se[0];if(!F||!n)return;if(F.size>100*1024*1024){Y("文件过大,最大支持 100MB","error");return}f.current&&(f.current.value=""),i();const H=`temp_${Date.now()}`;a({msgId:H,items:[{type:"text",content:`[文件] ${F.name}`}],timestamp:Date.now(),status:"sending"});try{const le=await Ch(F);await Ho({chatType:n.chatType,peerId:n.peerId,content:[{type:"file",filePath:le.filePath,fileName:le.fileName}]}),c(H)}catch{Y("发送失败","error"),u(H)}finally{o()}},[n,i,o,a,c,u]),ge=p.useCallback(I=>{var H,se,le;const F=(H=I.clipboardData)==null?void 0:H.items;if(F){for(let ue=0;ue<F.length;ue++)if(F[ue].type.startsWith("image/")){const de=F[ue].getAsFile();if(!de)continue;const Oe=(se=de.type.split("/")[1])==null?void 0:se.toLowerCase();if(!["jpeg","jpg","png","gif"].includes(Oe)){Y("不支持的图片格式","error");return}(le=d.current)==null||le.insertImage(de,URL.createObjectURL(de));return}}},[]),Ce=p.useCallback(I=>{var F;h(I.length>0&&!(I.length===1&&I[0].type==="text"&&!((F=I[0].content)!=null&&F.trim())))},[]);return s.jsxs("div",{className:"border-t border-theme-divider bg-theme-card",children:[r&&s.jsx("div",{className:"px-4 py-2 border-b border-theme-divider bg-theme-item",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ah,{size:16,className:"text-pink-500 flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0 text-sm text-theme-secondary truncate",children:["回复 ",r.sendMemberName||r.sendNickName||r.senderUin,":",(Q=r.elements)==null?void 0:Q.filter(I=>!I.replyElement).map((I,F)=>I.textElement?s.jsx("span",{children:I.textElement.content},F):I.picElement?s.jsx("span",{children:"[图片]"},F):I.faceElement?s.jsx("span",{children:"[表情]"},F):null)]}),s.jsx("button",{onClick:l,className:"p-1 text-theme-hint hover:text-theme rounded",children:s.jsx(ht,{size:16})})]})}),s.jsxs("div",{className:"px-4 pt-0.5 pb-3",children:[s.jsxs("div",{className:"flex items-center gap-1 mb-2 relative",children:[s.jsx("button",{onClick:()=>{w(!y),j(!1)},className:`p-2 rounded-lg transition-colors ${y?"text-pink-500 bg-pink-50 dark:bg-pink-900/30":"text-theme-muted hover:text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30"}`,title:"表情",children:s.jsx(dh,{size:18})}),s.jsx("button",{onClick:()=>{j(!k),w(!1)},className:`p-2 rounded-lg transition-colors ${k?"text-pink-500 bg-pink-50 dark:bg-pink-900/30":"text-theme-muted hover:text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30"}`,title:"收藏表情",children:s.jsx(b0,{size:18})}),s.jsx("button",{onClick:()=>{var I;return(I=m.current)==null?void 0:I.click()},className:"p-2 text-theme-muted hover:text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors",title:"图片",children:s.jsx(m0,{size:18})}),s.jsx("button",{onClick:()=>{var I;return(I=f.current)==null?void 0:I.click()},className:"p-2 text-theme-muted hover:text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors",title:"文件",children:s.jsx(lh,{size:18})}),y&&s.jsx(cf,{onSelect:P,onSelectEmoji:W,onClose:()=>w(!1)}),k&&s.jsx(dy,{onSelect:K,onClose:()=>j(!1)})]}),s.jsxs("div",{className:"flex items-end gap-2 relative",children:[s.jsx("input",{type:"file",ref:m,onChange:J,accept:"image/jpeg,image/png,image/gif",className:"hidden"}),s.jsx("input",{type:"file",ref:f,onChange:ae,className:"hidden"}),s.jsx("div",{className:"flex-1 bg-theme-input border border-theme-input rounded-xl focus-within:ring-2 focus-within:ring-pink-500/20 overflow-hidden",children:s.jsx(of,{ref:d,placeholder:"输入消息...",onEnter:D,onPaste:ge,onChange:Ce,onMentionChange:E})}),x.active&&(n==null?void 0:n.chatType)===2&&s.jsx(ry,{members:N,loading:T,query:x.query,position:x.position,onSelect:_,onClose:U}),s.jsx("button",{onClick:D,disabled:!g,className:"p-2.5 bg-pink-500 text-white rounded-xl hover:bg-pink-600 disabled:opacity-50 disabled:cursor-not-allowed flex-shrink-0",children:s.jsx(ss,{size:20})})]})]})]})});uf.displayName="ChatInput";function hy(e){const t=parseInt(e);return t>1e3?`/face/emoji-${t.toString(16)}.png`:`/face/${e}.png`}const fy=({tip:e,onScrollToMessage:t})=>{const n=hy(e.emojiId),r=parseInt(e.emojiId);return s.jsx("div",{className:"flex justify-center py-2",children:s.jsxs("span",{className:"text-xs text-theme-hint bg-theme-item/50 px-3 py-1 rounded-full",children:[s.jsx("span",{className:"text-blue-500",children:e.userName}),s.jsx("span",{children:" 回应了"}),s.jsx("span",{className:"text-blue-500 cursor-pointer hover:underline",onClick:()=>t(e.msgSeq),children:"消息"}),s.jsx("span",{children:" "}),s.jsx("img",{src:n,alt:"emoji",className:"inline-block w-4 h-4 align-text-bottom",onError:l=>{const i=l.target;i.dataset.fallback||(i.dataset.fallback="1",r>1e3?(i.style.display="none",i.insertAdjacentHTML("afterend",`<span class="text-sm">${String.fromCodePoint(r)}</span>`)):i.src=`https://gxh.vip.qq.com/club/item/parcel/item/${e.emojiId.slice(0,2)}/${e.emojiId}/100x100.png`)}})]})})},py=({session:e,onShowMembers:t,onNewMessageCallback:n,onEmojiReactionCallback:r,onMessageRecalledCallback:l,appendInputMention:i,onAppendInputMentionConsumed:o,onBack:a,showBackButton:c})=>{const[u,d]=p.useState([]),[m,f]=p.useState([]),[y,w]=p.useState([]),[k,j]=p.useState(!1),[g,h]=p.useState(!1),[x,v]=p.useState(!0),[N,S]=p.useState(null),[T,M]=p.useState(null),[q,R]=p.useState(null),[V,C]=p.useState(null),[b,E]=p.useState(null),[_,U]=p.useState(null),[D,P]=p.useState(null),[W,K]=p.useState(!1),[J,ae]=p.useState(null),[ge,Ce]=p.useState(null),[Q,I]=p.useState(null),[F,H]=p.useState(null),[se,le]=p.useState(null),[ue,de]=p.useState(!1),Oe=p.useMemo(()=>({showPreview:z=>S(z)}),[]),Je=p.useMemo(()=>({showPreview:(z,L,A,O)=>M({chatType:z,peerUid:L,msgId:A,elementId:O})}),[]),ur=p.useMemo(()=>({showMenu:(z,L)=>{C({x:z.clientX,y:z.clientY,message:L})}}),[]),mf=p.useMemo(()=>({showMenu:(z,L,A)=>{C({x:z.clientX,y:z.clientY,message:L,elementId:A})}}),[]),hf=p.useMemo(()=>({showMenu:(z,L)=>{E({x:z.clientX,y:z.clientY,...L})}}),[]),{getCachedMembers:ps,setCachedMembers:Cy,fetchGroupMembers:ff,friendCategories:Ya}=ze(),Xa=p.useRef(null),xs=p.useRef(null),dr=p.useRef(null),mr=p.useRef(e),hr=p.useRef(!0),Ja=p.useRef(null),oi=p.useRef([]),fr=p.useRef(new Map),Za=p.useRef(null),ai=p.useRef(!1),gs=p.useRef(null),ec=p.useRef(!0),pf=p.useRef(0),ci=p.useRef(!1);p.useEffect(()=>{mr.current=e},[e]);const Ve=p.useMemo(()=>{const z=new Set,L=u.filter(X=>!X||!X.elements||!Array.isArray(X.elements)||z.has(X.msgId)?!1:(z.add(X.msgId),!0)).map(X=>({type:"raw",data:X})),A=m.map(X=>({type:"temp",data:X})),O=y.map(X=>({type:"system",data:X})),ee=[...L,...A,...O];return ee.sort((X,ie)=>{const re=Z=>Z.type==="raw"?parseInt(Z.data.msgTime)*1e3:(Z.type==="temp",Z.data.timestamp);return re(X)-re(ie)}),oi.current=ee,ee},[u,m,y]),ft=Vh({count:Ve.length,getScrollElement:()=>xs.current,estimateSize:()=>80,overscan:5}),ui=p.useCallback((z,L)=>{const A=Ve.findIndex(O=>O.type!=="raw"?!1:O.data.msgId===z||L&&O.data.msgSeq===L);if(A!==-1){ft.scrollToIndex(A,{align:"center"});const O=Ve[A];O.type==="raw"&&(ae(O.data.msgId),setTimeout(()=>ae(null),2e3))}},[Ve,ft]),xf=p.useMemo(()=>({scrollToMessage:ui}),[ui]),gf=p.useMemo(()=>({getMembers:z=>ps(z)}),[ps]),yf=p.useMemo(()=>({getFriend:z=>{for(const L of Ya){const A=L.friends.find(O=>O.uin===z);if(A)return{uid:A.uid,uin:A.uin,nickname:A.nickname,remark:A.remark}}return null}}),[Ya]),di=p.useCallback(()=>{oi.current.length>0&&ft.scrollToIndex(oi.current.length-1,{align:"end"})},[ft]),[tc,nc]=p.useState(!1),pr=p.useRef(null);p.useEffect(()=>{const z=e?`${e.chatType}_${e.peerId}`:null;z!==Ja.current&&(Ja.current=z,K(!1),nc(!0))},[e==null?void 0:e.chatType,e==null?void 0:e.peerId]),p.useEffect(()=>{if(!(Ve.length===0||!tc))return pr.current&&clearTimeout(pr.current),pr.current=setTimeout(()=>{nc(!1);const z=()=>ft.scrollToIndex(Ve.length-1,{align:"end"});requestAnimationFrame(()=>{z(),setTimeout(z,50),setTimeout(()=>{z(),K(!0)},100)})},200),()=>{pr.current&&clearTimeout(pr.current)}},[Ve.length,tc,ft]),p.useEffect(()=>{hr.current&&Ve.length>0&&(di(),hr.current=!1)},[Ve.length,di]),p.useEffect(()=>(n&&n(L=>{if(!L||!L.msgId||!L.elements||!Array.isArray(L.elements))return;const A=cr();d(O=>{if(O.some(ie=>ie&&ie.msgId===L.msgId))return O;const ee=[...O,L],X=mr.current;return X&&Kh(X.chatType,X.peerId,L),ee}),L.senderUid===A&&f(O=>{const ee=O.filter(X=>X.status==="sending");return ee.length===0?O:(console.warn(`[SSE] 收到自己的消息时,仍存在 ${ee.length} 条临时消息,现已清除`,ee),O.filter(X=>X.status!=="sending"))})}),()=>{n&&n(null)}),[n]),p.useEffect(()=>(r&&r(L=>{const A=li(),O=A&&L.userId===A;if(d(ee=>ee.map(X=>{if(X.msgSeq!==L.msgSeq)return X;const ie=X.emojiLikesList||[];if(L.isAdd){const re=ie.findIndex(Z=>Z.emojiId===L.emojiId);if(re>=0){const Z=[...ie];return Z[re]={...Z[re],likesCnt:String(parseInt(Z[re].likesCnt)+1),isClicked:Z[re].isClicked||O},{...X,emojiLikesList:Z}}else return{...X,emojiLikesList:[...ie,{emojiId:L.emojiId,emojiType:parseInt(L.emojiId)>999?"2":"1",likesCnt:"1",isClicked:O}]}}else{const re=ie.findIndex(Z=>Z.emojiId===L.emojiId);if(re>=0){const Z=[...ie],lt=parseInt(Z[re].likesCnt)-1;return lt<=0?Z.splice(re,1):Z[re]={...Z[re],likesCnt:String(lt),isClicked:O?!1:Z[re].isClicked},{...X,emojiLikesList:Z}}}return X})),L.isAdd&&!O){const ee={id:`tip_${Date.now()}_${Math.random()}`,type:"emoji-reaction",userName:L.userName,emojiId:L.emojiId,msgSeq:L.msgSeq,timestamp:Date.now()};w(X=>[...X,ee])}}),()=>{r&&r(null)}),[r]),p.useEffect(()=>(l&&l(L=>{d(A=>A.map(O=>O.msgId===L.msgId||L.msgSeq&&O.msgSeq===L.msgSeq?{...O,recallTime:String(Math.floor(Date.now()/1e3))}:O))}),()=>{l&&l(null)}),[l]);const rc=(z,L)=>`${z}_${L}`,sc=p.useCallback(async(z,L)=>{var X;if(!e)return;const A=e.chatType,O=e.peerId,ee=()=>{const ie=mr.current;return ie&&ie.chatType===A&&ie.peerId===O};console.log("[ChatWindow] loadMessages called:",{chatType:A,peerId:O,beforeMsgSeq:z,afterMsgSeq:L}),z?h(!0):j(!0),z&&u.length>0&&(gs.current=((X=u[0])==null?void 0:X.msgId)||null);try{const ie=await ll(A,O,z,20,L);if(console.log("[ChatWindow] API response:",{messagesCount:ie.messages.length,hasMore:ie.hasMore}),!ee()){console.log("[ChatWindow] Session changed after API call, skipping");return}const re=ie.messages.filter(Z=>Z!=null&&Z.elements&&Array.isArray(Z.elements));return console.log("[ChatWindow] Valid messages:",re.length),d(Z=>{const lt=new Set(Z.map(it=>it.msgId)),pt=re.filter(it=>!lt.has(it.msgId)),Ne=z?[...pt,...Z]:[...Z,...pt];return Ne.sort((it,Pt)=>parseInt(it.msgTime)-parseInt(Pt.msgTime)),console.log("[ChatWindow] Merged messages:",Ne.length,"new:",pt.length),kn(A,O,Ne),Ne}),v(ie.hasMore),{validMessages:re,hasMore:ie.hasMore}}catch(ie){if(console.error("[ChatWindow] loadMessages error:",ie),gs.current=null,!ee())return;Y(z?"加载更多消息失败":"加载消息失败","error")}finally{ee()&&(j(!1),h(!1))}},[e,u]),vf=p.useCallback(async z=>{var ee,X,ie;if(!e)return;const L=e.chatType,A=e.peerId;j(!0);const O=()=>{const re=mr.current;return re&&re.chatType===L&&re.peerId===A};try{const re=await ll(L,A);if(!O()){console.log("[ChatWindow] Session changed during API call, skipping");return}const Z=re.messages.filter(Ne=>Ne!=null&&Ne.elements&&Array.isArray(Ne.elements));if(console.log("[ChatWindow] Latest messages from API:",Z.length),Z.length===0){v(!1);return}const lt=new Set(z.map(Ne=>Ne.msgId));if(Z.some(Ne=>lt.has(Ne.msgId))||z.length===0){console.log("[ChatWindow] Has overlap with cache, merging directly");const it=[...z,...Z].filter((Pt,Tn,lc)=>lc.findIndex(xr=>xr.msgId===Pt.msgId)===Tn);it.sort((Pt,Tn)=>parseInt(Pt.msgTime)-parseInt(Tn.msgTime)),d(it),kn(L,A,it),v(re.hasMore)}else{console.log("[ChatWindow] No overlap, need to fill gap");let Ne=[...Z],it=(ee=Z[0])==null?void 0:ee.msgSeq,Pt=re.hasMore;const Tn=(X=z[z.length-1])==null?void 0:X.msgSeq;for(let dn=0;dn<10&&Pt;dn++){if(!O()){console.log("[ChatWindow] Session changed during gap fill, skipping");return}const In=await ll(L,A,it),mn=In.messages.filter(Nt=>Nt!=null&&Nt.elements&&Array.isArray(Nt.elements));if(mn.length===0)break;Ne=[...mn,...Ne],it=(ie=mn[0])==null?void 0:ie.msgSeq,Pt=In.hasMore;const mi=new Set(mn.map(Nt=>Nt.msgId));if(z.some(Nt=>mi.has(Nt.msgId))||Tn&&mn.some(Nt=>parseInt(Nt.msgSeq)<=parseInt(Tn))){console.log("[ChatWindow] Connected with cache after",dn+1,"iterations");break}}const xr=[...z,...Ne].filter((dn,In,mn)=>mn.findIndex(mi=>mi.msgId===dn.msgId)===In);xr.sort((dn,In)=>parseInt(dn.msgTime)-parseInt(In.msgTime)),d(xr),kn(L,A,xr),v(Pt)}}catch(re){console.error("[ChatWindow] loadMessagesAndMergeWithCache error:",re),Y("加载消息失败","error")}finally{O()&&j(!1)}},[e]);p.useEffect(()=>{const z=gs.current;if(z&&Ve.length>0){const L=Ve.findIndex(A=>A.type==="raw"&&A.data.msgId===z);L!==-1&&ft.scrollToIndex(L,{align:"start"}),gs.current=null}},[Ve,ft]),p.useEffect(()=>{if(e){const z=++pf.current,L=rc(e.chatType,e.peerId),A=e.chatType,O=e.peerId;console.log("[ChatWindow] Session changed:",{chatType:A,peerId:O,version:z}),ci.current=!1;const ee=fr.current.get(L);ee&&ee.length>0?(console.log("[ChatWindow] Memory cache hit:",ee.length,"messages"),d(ee)):(console.log("[ChatWindow] Memory cache miss"),d([])),f([]),w([]),hr.current=!0;const X=ec.current,ie=Qa(A,O),re=X||!ie;console.log("[ChatWindow] Check load:",{isFirstMount:X,hasVisited:ie,shouldLoadFromApi:re}),fs(A,O).then(async Z=>{const lt=mr.current;if(!lt||lt.chatType!==A||lt.peerId!==O){console.log("[ChatWindow] Session changed after IndexedDB read, skipping");return}let pt=[];Z&&Z.length>0?(pt=Z.filter(Ne=>Ne.elements&&Array.isArray(Ne.elements)),console.log("[ChatWindow] IndexedDB cache hit:",pt.length,"valid messages"),pt.length>0&&(fr.current.set(L,pt),d(pt))):console.log("[ChatWindow] IndexedDB cache miss"),re&&!ci.current&&(ci.current=!0,ec.current=!1,mg(A,O),console.log("[ChatWindow] Calling loadMessagesAndMergeWithCache()"),await vf(pt))})}else d([]),f([]),w([])},[e==null?void 0:e.peerId,e==null?void 0:e.chatType]),p.useEffect(()=>{if(e&&u.length>0){const z=rc(e.chatType,e.peerId);fr.current.set(z,u)}},[u,e==null?void 0:e.chatType,e==null?void 0:e.peerId]),p.useEffect(()=>{const z=Za.current,L=xs.current;if(!z||!L)return;const A=new IntersectionObserver(O=>{var X;if(O[0].isIntersecting&&x&&!ai.current&&!k&&u.length>0){const ie=(X=u[0])==null?void 0:X.msgSeq;ie&&(ai.current=!0,sc(ie).finally(()=>{ai.current=!1}))}},{root:L,rootMargin:"50px 0px 0px 0px",threshold:0});return A.observe(z),()=>A.disconnect()},[x,u,sc]);const wf=p.useCallback(()=>{const z=xs.current;if(!z||u.length===0)return;const L=z.scrollHeight-z.scrollTop-z.clientHeight<100;hr.current=L,de(!L)},[u]),kf=p.useCallback(z=>{f(L=>L.filter(A=>A.msgId!==z.msgId))},[]),jf=p.useCallback(async(z,L,A,O,ee)=>{U({profile:null,loading:!0,position:{x:A,y:O}});try{const X=await Ul(z,L,ee);U({profile:X,loading:!1,position:{x:A,y:O}})}catch{U(null),Y("获取用户资料失败","error")}},[]),Nf=p.useCallback(z=>{f(L=>[...L,z]),hr.current=!0},[]),bf=p.useCallback(z=>{f(L=>L.filter(A=>A.msgId!==z))},[]),Sf=p.useCallback(z=>{f(L=>L.map(A=>A.msgId===z?{...A,status:"failed"}:A))},[]);return p.useEffect(()=>{var z,L,A,O;i&&((L=(z=dr.current)==null?void 0:z.insertAt)==null||L.call(z,i.uid,i.uin,i.name),(O=(A=dr.current)==null?void 0:A.focus)==null||O.call(A),o==null||o())},[i,o]),e?s.jsx(Xh.Provider,{value:Oe,children:s.jsx(Jh.Provider,{value:Je,children:s.jsx(Zh.Provider,{value:mf,children:s.jsx(ef.Provider,{value:ur,children:s.jsx(tf.Provider,{value:hf,children:s.jsx(nf.Provider,{value:xf,children:s.jsx(rf.Provider,{value:gf,children:s.jsxs(sf.Provider,{value:yf,children:[s.jsxs("div",{ref:Xa,className:"flex flex-col h-full relative",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 md:px-4 py-3 border-b border-theme-divider bg-theme-card",children:[c&&s.jsx("button",{onClick:a,className:"p-2 mr-1 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors md:hidden",children:s.jsx(t0,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 cursor-pointer hover:opacity-80 transition-opacity flex-1 min-w-0",onClick:async z=>{const L=z.currentTarget.getBoundingClientRect(),A=L.left,O=L.bottom+8;if(e.chatType===2){P({profile:null,loading:!0,position:{x:A,y:O}});try{const ee=await Dh(e.peerId);P({profile:ee,loading:!1,position:{x:A,y:O}})}catch{P(null),Y("获取群资料失败","error")}}else{U({profile:null,loading:!0,position:{x:A,y:O}});try{const{friendCategories:ee}=ze.getState();let X="";for(const re of ee){const Z=re.friends.find(lt=>lt.uin===e.peerId);if(Z){X=Z.uid;break}}const ie=await Ul(X||void 0,e.peerId);U({profile:ie,loading:!1,position:{x:A,y:O}})}catch{U(null),Y("获取用户资料失败","error")}}},children:[s.jsx("img",{src:e.peerAvatar,alt:e.peerName,className:"w-10 h-10 rounded-full object-cover flex-shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium text-theme truncate",children:(()=>{const{groups:z,friendCategories:L}=ze.getState();if(e.chatType===2){const A=z.find(O=>O.groupCode===e.peerId);if(A!=null&&A.remarkName&&A.remarkName!==A.groupName)return`${A.remarkName}(${A.groupName})`}else for(const A of L){const O=A.friends.find(ee=>ee.uin===e.peerId);if(O!=null&&O.remark&&O.remark!==O.nickname)return`${O.remark}(${O.nickname})`}return e.peerName})()}),s.jsx("div",{className:"text-xs text-theme-hint",children:e.chatType===2?(()=>{const{groups:z}=ze.getState(),L=z.find(A=>A.groupCode===e.peerId);return`群聊 ${e.peerId}${L!=null&&L.memberCount?` · ${L.memberCount}人`:""}`})():e.chatType===100?`临时会话 ${e.peerId}`:`私聊 ${e.peerId}`})]})]}),e.chatType===2&&t&&s.jsx("button",{onClick:t,className:"p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg",title:"查看群成员",children:s.jsx(si,{size:20})})]}),s.jsxs("div",{ref:xs,onScroll:wf,className:"flex-1 overflow-y-auto overflow-x-hidden p-4",children:[s.jsx("div",{ref:Za,className:"h-1"}),g&&s.jsx("div",{className:"flex justify-center py-2",children:s.jsx(Se,{size:20,className:"animate-spin text-pink-500"})}),k?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Se,{size:32,className:"animate-spin text-pink-500"})}):Ve.length===0?s.jsx("div",{className:"flex items-center justify-center h-full text-theme-hint",children:"暂无消息"}):s.jsx("div",{style:{height:`${ft.getTotalSize()}px`,width:"100%",position:"relative",opacity:W?1:0},className:"overflow-hidden",children:ft.getVirtualItems().map(z=>{const L=Ve[z.index];return s.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${z.start}px)`,padding:"8px 0"},"data-index":z.index,ref:ft.measureElement,className:"overflow-hidden box-border",children:L.type==="raw"?s.jsx(Gg,{message:L.data,allMessages:u,isHighlighted:J===L.data.msgId}):L.type==="temp"?s.jsx(Xg,{message:L.data,onRetry:()=>kf(L.data)}):s.jsx(fy,{tip:L.data,onScrollToMessage:A=>ui("",A)})},z.key)})})]}),ue&&s.jsx("button",{onClick:di,className:"absolute bottom-[6.5rem] right-4 w-6 h-6 bg-theme-card/90 border border-theme-divider rounded-full shadow-md flex items-center justify-center text-theme-muted hover:text-theme hover:bg-theme-item transition-all z-10",title:"滚动到底部",children:s.jsx($o,{size:12})}),s.jsx(uf,{ref:dr,session:e,replyTo:q,onReplyCancel:()=>R(null),onSendStart:()=>{},onSendEnd:()=>{},onTempMessage:Nf,onTempMessageRemove:bf,onTempMessageFail:Sf})]}),V&&s.jsx(ty,{contextMenu:V,session:e,getCachedMembers:ps,onClose:()=>C(null),onReply:z=>{R(z),setTimeout(()=>{var L,A;return(A=(L=dr.current)==null?void 0:L.focus)==null?void 0:A.call(L)},50)},onEmojiReaction:(z,L,A)=>le({message:z,x:L,y:A}),onRecall:z=>{if(d(L=>L.filter(A=>A.msgId!==z)),e){const L=`${e.chatType}_${e.peerId}`,A=fr.current.get(L);A&&fr.current.set(L,A.filter(O=>O.msgId!==z)),_g(e.chatType,e.peerId,z)}}}),se&&s.jsx(my,{target:se,onClose:()=>le(null),containerRef:Xa}),b&&s.jsx(ny,{avatarContextMenu:b,getCachedMembers:ps,onClose:()=>E(null),onInsertAt:(z,L,A)=>{var O,ee;return(ee=(O=dr.current)==null?void 0:O.insertAt)==null?void 0:ee.call(O,z,L,A)},onShowProfile:jf,onSetTitle:(z,L,A)=>H({uid:z,name:L,groupCode:A}),onMute:(z,L,A)=>I({uid:z,name:L,groupCode:A}),onKick:(z,L,A,O)=>Ce({uid:z,name:L,groupCode:A,groupName:O}),onAdminChanged:()=>e&&ff(e.peerId,!0),groupName:e==null?void 0:e.peerName}),_&&s.jsx(Yh,{profile:_.profile,loading:_.loading,position:_.position,onClose:()=>U(null),isFriend:(e==null?void 0:e.chatType)===1,onFriendDeleted:z=>{const{removeFriend:L,setCurrentChat:A,removeRecentChat:O}=ze.getState();L(z),(e==null?void 0:e.chatType)===1&&(A(null),O(1,e.peerId))}}),D&&s.jsx(Ug,{profile:D.profile,loading:D.loading,position:D.position,onClose:()=>P(null),onQuitGroup:async(z,L)=>{try{await _h(z),Y(L?"群已解散":"已退出群聊","success");const{setCurrentChat:A,removeRecentChat:O}=ze.getState();A(null),O(2,z)}catch(A){Y(A.message||(L?"解散失败":"退群失败"),"error")}}}),ge&&s.jsx(Zg,{name:ge.name,groupName:ge.groupName,onConfirm:async()=>{const{uid:z,name:L,groupCode:A}=ge;Ce(null);try{await Ph(A,z),Y(`已将 ${L} 移出群聊`,"success")}catch(O){Y(O.message||"踢出失败","error")}},onClose:()=>Ce(null)}),Q&&s.jsx(Jg,{name:Q.name,onMute:async z=>{const{uid:L,name:A,groupCode:O}=Q;I(null);try{if(await zh(O,L,z),z===0)Y(`已解除 ${A} 的禁言`,"success");else{const ee=z>=86400?`${Math.floor(z/86400)}天`:z>=3600?`${Math.floor(z/3600)}小时`:z>=60?`${Math.floor(z/60)}分钟`:`${z}秒`;Y(`已禁言 ${A} ${ee}`,"success")}}catch(ee){Y(ee.message||"禁言失败","error")}},onClose:()=>I(null)}),F&&s.jsx(ey,{name:F.name,onConfirm:async z=>{const{uid:L,name:A,groupCode:O}=F;H(null);try{await Lh(O,L,z),Y(z?`已设置 ${A} 的头衔为「${z}」`:`已清除 ${A} 的头衔`,"success")}catch(ee){Y(ee.message||"设置头衔失败","error")}},onClose:()=>H(null)}),s.jsx(Dg,{url:N,onClose:()=>S(null)}),s.jsx(Og,{videoInfo:T,onClose:()=>M(null)})]})})})})})})})}):s.jsx("div",{className:"flex-1 flex items-center justify-center bg-theme-item",children:s.jsxs("div",{className:"text-center text-theme-hint",children:[s.jsx("div",{className:"text-6xl mb-4",children:"💬"}),s.jsx("p",{children:"选择一个联系人开始聊天"})]})})},xy=({member:e,onContextMenu:t,onClick:n})=>{const r=e.card||e.nickname,l=e.role==="owner"?s.jsx(ri,{size:14,className:"text-yellow-500"}):e.role==="admin"?s.jsx(ms,{size:14,className:"text-blue-500"}):null,i=o=>{("ontouchstart"in window||navigator.maxTouchPoints>0)&&(n==null||n(o))};return s.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 hover:bg-theme-item-hover transition-colors cursor-pointer",onClick:i,onContextMenu:t,children:[s.jsx("img",{src:e.avatar,alt:r,className:"w-8 h-8 rounded-full object-cover flex-shrink-0",loading:"lazy",onError:o=>{o.currentTarget.src=`https://q1.qlogo.cn/g?b=qq&nk=${e.uin}&s=640`}}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-sm text-theme truncate",children:r}),l]}),e.card&&e.card!==e.nickname&&s.jsx("div",{className:"text-xs text-theme-hint truncate",children:e.nickname})]})]})},gy=({groupCode:e,onClose:t,onAtMember:n})=>{const[r,l]=p.useState([]),[i,o]=p.useState(!1),[a,c]=p.useState(""),[u,d]=p.useState(null),[m,f]=p.useState(null),[y,w]=p.useState(null),{getCachedMembers:k,fetchGroupMembers:j}=ze(),g=p.useRef(null),h=p.useRef(e);p.useEffect(()=>{h.current=e},[e]);const x=p.useRef(k);x.current=k;const v=p.useRef(j);v.current=j;const N=p.useRef(!1);p.useEffect(()=>{const b=e,E=!Qa(2,b),_=hg(b);console.log("[GroupMemberPanel] useEffect triggered:",{groupCode:b,isFirstVisit:E,alreadyFetched:_});const U=x.current(b);if(U&&(console.log("[GroupMemberPanel] Cache hit:",U.length,"members"),l(U),d(null),_)){o(!1);return}if(_){o(!1);return}if(N.current){console.log("[GroupMemberPanel] Already loading, skip");return}return console.log("[GroupMemberPanel] Fetching from API, isFirstVisit:",E),N.current=!0,U||(o(!0),d(null),l([])),v.current(b,E).then(D=>{console.log("[GroupMemberPanel] API success:",D.length,"members, currentGroupCode:",h.current),h.current===b&&(l(D),o(!1),fg(b))}).catch(D=>{console.log("[GroupMemberPanel] API error:",D.message),h.current===b&&(U||d(D.message||"加载群成员失败"),Y("加载群成员失败","error"),o(!1))}).finally(()=>{h.current===b&&(N.current=!1)}),()=>{console.log("[GroupMemberPanel] Cleanup, reset isLoading"),N.current=!1}},[e]);const S=p.useMemo(()=>$h(r,a),[r,a]),T=Vh({count:S.length,getScrollElement:()=>g.current,estimateSize:()=>48,overscan:5}),M=p.useMemo(()=>{const b=r.filter(_=>_.role==="owner").length,E=r.filter(_=>_.role==="admin").length;return{owner:b,admin:E,total:r.length}},[r]),q=p.useCallback((b,E)=>{b.preventDefault(),b.stopPropagation(),f({x:b.clientX,y:b.clientY,member:E})},[]),R=p.useCallback(()=>{if(m&&n){const b=m.member;n({uid:b.uid,uin:b.uin,name:b.card||b.nickname})}f(null)},[m,n]),V=p.useCallback(async()=>{if(!m)return;const b=m.member;f(null);try{await $l(2,Number(b.uin),Number(e))}catch(E){Y(E.message||"戳一戳失败","error")}},[m,e]),C=p.useCallback(async()=>{if(!m)return;const b=m.member,E={x:m.x,y:m.y};f(null),w({profile:null,loading:!0,position:E});try{const _=await Ul(b.uid,b.uin,e);w({profile:_,loading:!1,position:E})}catch(_){Y(_.message||"获取资料失败","error"),w(null)}},[m,e]);return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-theme-divider",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-theme",children:"群成员"}),s.jsxs("div",{className:"text-xs text-theme-hint",children:[M.total," 人"]})]}),s.jsx("button",{onClick:t,className:"p-1.5 text-theme-hint hover:text-theme hover:bg-theme-item rounded-lg transition-colors",children:s.jsx(ht,{size:18})})]}),s.jsx("div",{className:"p-3",children:s.jsxs("div",{className:"relative",children:[s.jsx(ch,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-theme-hint"}),s.jsx("input",{type:"text",value:a,onChange:b=>c(b.target.value),placeholder:"搜索成员...",className:"w-full pl-9 pr-3 py-2 text-sm bg-theme-input border border-theme-input rounded-lg focus:outline-none focus:ring-2 focus:ring-pink-500/20 focus:border-pink-500/50 text-theme placeholder:text-theme-hint"})]})}),s.jsx("div",{ref:g,className:"flex-1 overflow-y-auto",children:i?s.jsx("div",{className:"flex items-center justify-center h-32",children:s.jsx(Se,{size:24,className:"animate-spin text-pink-500"})}):u?s.jsxs("div",{className:"flex flex-col items-center justify-center h-32 gap-2",children:[s.jsx("p",{className:"text-sm text-red-500",children:u}),s.jsx("button",{onClick:()=>j(e),className:"text-sm text-pink-500 hover:text-pink-600",children:"重试"})]}):S.length===0?s.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:a?"未找到匹配的成员":"暂无成员"}):s.jsx("div",{className:"py-1 relative",style:{height:T.getTotalSize()},children:T.getVirtualItems().map(b=>{const E=S[b.index];return s.jsx("div",{className:"absolute left-0 right-0",style:{top:b.start,height:b.size},children:s.jsx(xy,{member:E,onClick:_=>q(_,E),onContextMenu:_=>q(_,E)})},E.uid)})})}),m&&Ie.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>f(null),onContextMenu:b=>{b.preventDefault(),f(null)}}),s.jsxs("div",{className:"fixed z-50 bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[120px]",style:{left:m.x,top:Math.min(m.y,window.innerHeight-150)},onContextMenu:b=>b.preventDefault(),children:[n&&s.jsxs("button",{onClick:R,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(Zm,{size:14}),"@ta"]}),s.jsxs("button",{onClick:V,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(th,{size:14}),"戳一戳"]}),s.jsxs("button",{onClick:C,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[s.jsx(fh,{size:14}),"查看资料"]})]})]}),document.body),y&&s.jsx(Yh,{profile:y.profile,loading:y.loading,position:y.position,onClose:()=>w(null)})]})};function yy(e){var r;if(!e||!e.elements||!Array.isArray(e.elements))return"[消息]";const t=[];for(const l of e.elements){if((r=l.textElement)!=null&&r.content){t.push(l.textElement.content);continue}if(l.picElement){t.push("[图片]");continue}if(l.faceElement){t.push("[表情]");continue}if(l.fileElement){t.push("[文件]");continue}if(l.pttElement){t.push("[语音]");continue}if(l.videoElement){t.push("[视频]");continue}if(l.replyElement){t.push("[回复]");continue}}const n=t.join("").replace(/\s+/g," ").trim();return n?/^@[^\s]+$/.test(n)?`${n} [提及]`:n:"[消息]"}const df=({isFullscreen:e=!1})=>{const t=ce.useRef(null),n=ce.useRef(null),r=ce.useRef(null),l=ce.useRef([]),[,i]=ce.useState(0),{showWebQQFullscreenButton:o}=Ha(),{friendCategories:a,groups:c,contactsLoading:u,contactsError:d,currentChat:m,activeTab:f,unreadCounts:y,showMemberPanel:w,setCurrentChat:k,setActiveTab:j,setShowMemberPanel:g,clearUnreadCount:h,incrementUnreadCount:x,updateRecentChat:v,loadContacts:N,setRecentChats:S}=ze(),T=ze(I=>I.recentChats),[M,q]=ce.useState(null),R=p.useCallback(I=>{q(I)},[]),V=p.useCallback(()=>{q(null)},[]);p.useEffect(()=>{Pu(),Nh().catch(I=>console.error("获取登录信息失败:",I)),N()},[N]),p.useEffect(()=>{d&&Y(d,"error")},[d]);const C=ce.useRef(m);p.useEffect(()=>{C.current=m},[m]);const b=ce.useCallback(I=>{if(t.current=I,I&&l.current.length>0){const F=[...l.current];l.current=[],F.forEach(H=>I(H))}i(F=>F+1)},[]),E=ce.useCallback(I=>{n.current=I},[]),_=ce.useCallback(I=>{r.current=I},[]);p.useEffect(()=>{const I=Ah(F=>{if(F.type==="message-created"||F.type==="message-sent"){const H=F.data;if(!H||!H.msgId||!H.elements||!Array.isArray(H.elements)){console.warn("SSE 收到无效消息:",H);return}const se=H.chatType,le=H.peerUin||H.peerUid,ue=`${se}_${le}`,de=C.current;Kh(se,le,H),de&&de.chatType===se&&de.peerId===le?t.current?t.current(H):l.current.push(H):x(ue);const Oe=yy(H);let Je,ur;se===2?(Je=H.peerName||void 0,ur=`https://p.qlogo.cn/gh/${le}/${le}/640/`):(Je=H.sendNickName||H.sendMemberName||void 0,ur=`https://q1.qlogo.cn/g?b=qq&nk=${le}&s=640`),v(se,le,Oe,parseInt(H.msgTime)*1e3,Je,ur)}else if(F.type==="emoji-reaction"){const{groupCode:H,msgSeq:se,emojiId:le,userId:ue,userName:de,isAdd:Oe}=F.data,Je=C.current;Ag(2,H,se,le,Oe),Je&&Je.chatType===2&&Je.peerId===H&&n.current&&n.current({groupCode:H,msgSeq:se,emojiId:le,userId:ue,userName:de,isAdd:Oe})}else if(F.type==="message-deleted"){const{msgId:H,msgSeq:se,chatType:le,peerUid:ue,peerUin:de}=F.data,Oe=de||ue,Je=C.current;Fg(le,Oe,H,se),Je&&Je.chatType===le&&Je.peerId===Oe&&r.current&&r.current({msgId:H,msgSeq:se})}},F=>{console.error("SSE 连接错误:",F)},()=>{console.log("[WebQQ] SSE 重连成功,重置已访问聊天标志"),Pu(),N()});return()=>{I.close()}},[x,v,N]);const U=p.useCallback(I=>{l.current=[],k(I),I.chatType!==2&&g(!1);const F=`${I.chatType}_${I.peerId}`;h(F),S(T.map(H=>H.chatType===I.chatType&&H.peerId===I.peerId?{...H,unreadCount:0}:H))},[k,h,S,T,g]),[D,P]=p.useState(!1),W=p.useCallback(I=>{U(I),P(!0)},[U]),K=p.useCallback(()=>{P(!1)},[]),J=p.useCallback(I=>{const F={chatType:1,peerId:I.uin,peerName:I.remark||I.nickname,peerAvatar:I.avatar};W(F)},[W]),ae=p.useCallback(I=>{const F={chatType:2,peerId:I.groupCode,peerName:I.groupName,peerAvatar:I.avatar};W(F)},[W]),ge=p.useCallback(I=>{const F={chatType:I.chatType,peerId:I.peerId,peerName:I.peerName,peerAvatar:I.peerAvatar};W(F)},[W]),Ce=ce.useMemo(()=>new Map(Object.entries(y)),[y]);return u&&a.length===0&&c.length===0?s.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:s.jsx(Se,{size:48,className:"animate-spin text-pink-500"})}):d&&a.length===0&&c.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-[calc(100vh-200px)] gap-4",children:[s.jsx("p",{className:"text-red-500",children:d}),s.jsx("button",{onClick:()=>N(),className:"px-4 py-2 bg-pink-500 text-white rounded-lg hover:bg-pink-600 transition-colors",children:"重试"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex h-[calc(100vh-80px)] md:h-[calc(100vh-120px)] bg-theme-card backdrop-blur-xl rounded-none md:rounded-2xl overflow-hidden shadow-xl border border-theme",children:[s.jsx("div",{className:`
|
|
448
448
|
w-full md:w-72 border-r border-theme-divider flex-shrink-0
|
|
449
449
|
${D?"hidden md:block":"block"}
|
|
450
|
-
`,children:s.jsx(gg,{activeTab:f,onTabChange:j,friendCategories:a,groups:c,recentChats:
|
|
450
|
+
`,children:s.jsx(gg,{activeTab:f,onTabChange:j,friendCategories:a,groups:c,recentChats:T,unreadCounts:Ce,selectedPeerId:m==null?void 0:m.peerId,onSelectFriend:J,onSelectGroup:ae,onSelectRecent:ge})}),s.jsx("div",{className:`
|
|
451
451
|
flex-1 flex flex-col min-w-0
|
|
452
452
|
${D?"block":"hidden md:flex"}
|
|
453
|
-
`,children:s.jsx(py,{session:m,onShowMembers:()=>x(!k),onNewMessageCallback:b,onEmojiReactionCallback:E,onMessageRecalledCallback:_,appendInputText:T,onAppendInputTextConsumed:V,onBack:K,showBackButton:D})}),k&&(m==null?void 0:m.chatType)===2&&s.jsx("div",{className:"fixed inset-0 z-50 bg-white/85 dark:bg-neutral-900/85 backdrop-blur-xl md:static md:inset-auto md:z-auto md:bg-transparent md:backdrop-blur-none md:w-64 md:border-l md:border-theme-divider md:flex-shrink-0",children:s.jsx(gy,{groupCode:m.peerId,onClose:()=>x(!1),onAtMember:R})})]}),!e&&o&&s.jsx("button",{onClick:()=>window.open("#webqq-fullscreen","_blank"),className:"fixed bottom-6 right-6 z-50 p-3 bg-pink-500/70 hover:bg-pink-500/90 text-white rounded-full shadow-lg hover:shadow-xl transition-all duration-200 group backdrop-blur-sm",title:"在新窗口中全屏打开",children:s.jsx(g0,{size:20,className:"group-hover:scale-110 transition-transform"})})]})},vy=()=>s.jsx("div",{className:"h-screen bg-theme p-4 md:p-8",children:s.jsx(df,{isFullscreen:!0})}),wy={enable:!0,connect:[]},ky={enable:!1,host:"127.0.0.1",port:5600,token:""},jy={enable:!1,reportSelfMessage:!1,http:{host:"127.0.0.1",port:3010,prefix:"",accessToken:""},webhook:{urls:[],accessToken:""}},Ny={enable:!0,host:"127.0.0.1",port:3080},by={webui:Ny,milky:jy,satori:ky,ob11:wy,enableLocalFile2Url:!1,log:!0,autoDeleteFile:!1,autoDeleteFileSecond:60,musicSignUrl:"https://ss.xingzhige.com/music_card/card",msgCacheExpire:120,ffmpeg:"",rawMsgPB:!1},$u="7.9.0";function Sy(){const e=()=>{const Q=window.location.hash.slice(1);return["dashboard","onebot","satori","milky","logs","other","webqq","webqq-fullscreen","about"].includes(Q)?Q:"dashboard"},[t,n]=p.useState(e),[r,l]=p.useState(by),[i,o]=p.useState(null),[a,c]=p.useState(!1),[u,d]=p.useState(!1),[m,f]=p.useState(!0),[v,k]=p.useState(null),[w,j]=p.useState(!1),[x,h]=p.useState(""),[g,y]=p.useState(null),[N,S]=p.useState(!1),[P,T]=p.useState(!1),[O,R]=p.useState(!1),[V,C]=p.useState(!1),[b,E]=p.useState(""),[_,U]=p.useState(!1),[D,I]=p.useState(!1),[q,K]=p.useState(!1),{autoHideSidebarInWebQQ:Z}=Ha();p.useEffect(()=>{W0(async Q=>new Promise(M=>{h(Q||""),j(!0),y(()=>M)}))},[]),p.useEffect(()=>{window.location.hash=t},[t]),p.useEffect(()=>{Z&&t==="webqq"&&I(!0)},[t,Z]),p.useEffect(()=>{const Q=()=>{const M=window.location.hash.slice(1);["dashboard","onebot","satori","milky","logs","other","webqq","webqq-fullscreen","about"].includes(M)&&n(M)};return window.addEventListener("hashchange",Q),()=>window.removeEventListener("hashchange",Q)},[]);const oe=p.useCallback(Q=>{Q.trim()?(j(!1),h(""),g&&(g(Q),y(null))):h("密码不能为空")},[g]);p.useEffect(()=>{(async()=>{var M;try{const $=await Ne("/api/config");if($.success&&$.data.selfInfo.online){d(!0),k({nick:$.data.selfInfo.nick||"",uin:$.data.selfInfo.uin}),l($.data.config);try{const W=await Ne("/api/email/config");W.success&&W.data&&o(W.data)}catch(W){console.error("Failed to fetch email config:",W)}try{const W=await Ne("/api/device-info");W.success&&((M=W.data)!=null&&M.buildVer)&&E(W.data.buildVer)}catch(W){console.error("Failed to fetch device info:",W)}}else d(!1)}catch($){console.error("Failed to check login status:",$),d(!1)}finally{f(!1)}})()},[]);const ye=p.useCallback(async(Q,M)=>{try{c(!0);const $=Q||r,W=M!==void 0?M:i,le=await Ne("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:$})});if(!le.success){Y(le.message||"保存失败","error");return}if(W)try{const ae=await Ne("/api/email/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)});if(!ae.success){Y(`主配置已保存,但邮件配置保存失败:${ae.message}`,"warning");return}}catch(ae){Y(`主配置已保存,但邮件配置保存失败:${ae.message}`,"warning");return}Y("配置保存成功","success")}catch($){Y($.message||"保存失败","error")}finally{c(!1)}},[r,i]),Ce=p.useCallback(()=>{window.location.reload()},[]);return m?s.jsxs(s.Fragment,{children:[s.jsx(_s,{}),s.jsx("div",{className:"relative flex items-center justify-center min-h-screen z-10",children:s.jsx(Se,{size:48,className:"animate-spin text-pink-500"})}),s.jsx(Us,{visible:w,onConfirm:oe,error:x})]}):u?t==="webqq-fullscreen"?s.jsxs(s.Fragment,{children:[s.jsx(_s,{}),s.jsx(vy,{}),s.jsx(Us,{visible:w,onConfirm:oe,error:x}),s.jsx(Di,{})]}):s.jsxs("div",{className:"flex min-h-screen",children:[s.jsx(_s,{}),s.jsx(B0,{activeTab:t,onTabChange:n,accountInfo:v||void 0,isOpen:_,onClose:()=>U(!1),collapsed:D,onToggleCollapse:()=>I(!D),onOpenSettings:()=>K(!0)}),s.jsxs("main",{className:`flex-1 overflow-auto z-10 transition-all duration-300 ${D?"":"md:ml-64"}`,children:[s.jsxs("div",{className:"md:hidden sticky top-0 z-30 bg-theme-card/95 backdrop-blur-xl border-b border-theme-divider px-4 py-3 flex items-center gap-3",children:[s.jsx("button",{onClick:()=>U(!0),className:"p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors",children:s.jsx(y0,{size:24})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/logo.jpg",alt:"Logo",className:"w-8 h-8 rounded-lg"}),s.jsx("span",{className:"font-semibold text-theme",children:"LLBot"})]})]}),s.jsxs("div",{className:"p-4 md:p-8 max-w-6xl mx-auto",children:[s.jsxs("div",{className:"mb-8 hidden md:block",children:[s.jsx("h2",{className:"text-3xl font-bold text-white mb-2",children:t==="dashboard"&&"Dashboard"}),s.jsx("p",{className:"text-white/80",children:t==="dashboard"&&"欢迎使用 Lucky Lillia Bot"})]}),t==="dashboard"&&s.jsx(Y0,{llbotVersion:$u,qqVersion:b}),t==="webqq"&&s.jsx(df,{}),t==="logs"&&s.jsx(X0,{}),t==="onebot"&&s.jsx(J0,{config:r.ob11,onChange:Q=>{const M={...r,ob11:Q};l(M)},onSave:Q=>{if(Q){const M={...r,ob11:Q};ye(M)}else ye()}}),t==="satori"&&s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl gradient-primary-br flex items-center justify-center",children:s.jsx(Ua,{size:24,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"Satori 协议"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"配置 Satori 协议相关设置"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"启用 Satori 协议"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"开启后将支持 Satori 协议连接"})]}),s.jsx("input",{type:"checkbox",checked:r.satori.enable,onChange:Q=>l({...r,satori:{...r.satori,enable:Q.target.checked}}),className:"switch-toggle"})]}),r.satori.enable&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"监听地址"}),s.jsx(ss,{value:r.satori.host,onChange:Q=>l({...r,satori:{...r.satori,host:Q}})}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"选择服务监听的网络地址"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Satori 端口"}),s.jsx("input",{type:"number",value:r.satori.port,onChange:Q=>l({...r,satori:{...r.satori,port:parseInt(Q.target.value)}}),min:"1",max:"65535",placeholder:"5500",className:"input-field"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"Satori 服务监听端口(1-65535)"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Satori Token"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:N?"text":"password",value:r.satori.token,onChange:Q=>l({...r,satori:{...r.satori,token:Q.target.value}}),placeholder:"请输入 Satori Token",className:"input-field pr-12"}),s.jsx("button",{type:"button",onClick:()=>S(!N),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1",children:N?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"用于 Satori 连接验证的 Token"})]})]})]}),s.jsx("div",{className:"mt-6 flex justify-end",children:s.jsx("button",{onClick:()=>{var Q;if(r.satori.host===""&&r.satori.enable&&!((Q=r.satori.token)!=null&&Q.trim())){Y("当监听所有地址时,必须设置 Satori Token!","error");return}ye()},disabled:a,className:"btn-primary flex items-center gap-2",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Se,{size:20,className:"animate-spin"}),"保存中..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ui,{size:20}),"保存配置"]})})})]}),t==="milky"&&s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-pink-500 to-rose-600 flex items-center justify-center",children:s.jsx(rh,{size:24,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"Milky 协议"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"配置 Milky 协议相关设置"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"启用 Milky 协议"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"开启后将支持 Milky 协议连接"})]}),s.jsx("input",{type:"checkbox",checked:r.milky.enable,onChange:Q=>l({...r,milky:{...r.milky,enable:Q.target.checked}}),className:"switch-toggle"})]}),r.milky.enable&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"上报自己发送的消息"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后将上报自己发送的消息"})]}),s.jsx("input",{type:"checkbox",checked:r.milky.reportSelfMessage,onChange:Q=>l({...r,milky:{...r.milky,reportSelfMessage:Q.target.checked}}),className:"switch-toggle"})]}),s.jsxs("div",{className:"border-t border-theme-divider pt-4 mt-4",children:[s.jsx("h4",{className:"text-md font-semibold text-theme mb-4",children:"HTTP 配置"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"监听地址"}),s.jsx(ss,{value:r.milky.http.host,onChange:Q=>l({...r,milky:{...r.milky,http:{...r.milky.http,host:Q}}})}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"选择服务监听的网络地址"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"HTTP 端口"}),s.jsx("input",{type:"number",value:r.milky.http.port,onChange:Q=>l({...r,milky:{...r.milky,http:{...r.milky.http,port:parseInt(Q.target.value)}}}),min:"1",max:"65535",placeholder:"3010",className:"input-field"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"Milky HTTP 服务监听端口(1-65535)"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"路径前缀"}),s.jsx("input",{type:"text",value:r.milky.http.prefix,onChange:Q=>l({...r,milky:{...r.milky,http:{...r.milky.http,prefix:Q.target.value}}}),placeholder:"/api",className:"input-field"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"HTTP API 路径前缀(可选)"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Access Token"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:P?"text":"password",value:r.milky.http.accessToken,onChange:Q=>l({...r,milky:{...r.milky,http:{...r.milky.http,accessToken:Q.target.value}}}),placeholder:"请输入 Access Token",className:"input-field pr-12"}),s.jsx("button",{type:"button",onClick:()=>T(!P),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1",children:P?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"用于 Milky HTTP 连接验证的 Token"})]})]})]}),s.jsxs("div",{className:"border-t border-theme-divider pt-4 mt-4",children:[s.jsx("h4",{className:"text-md font-semibold text-theme mb-4",children:"Webhook 配置"}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Webhook URLs"}),s.jsxs("div",{className:"space-y-2",children:[r.milky.webhook.urls.map((Q,M)=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"text",value:Q,onChange:$=>{const W=[...r.milky.webhook.urls];W[M]=$.target.value,l({...r,milky:{...r.milky,webhook:{...r.milky.webhook,urls:W}}})},placeholder:"http:// 或 https://",className:`input-field flex-1 ${Q&&!Q.match(/^https?:\/\//)?"border-red-300 focus:ring-red-500":""}`}),s.jsx("button",{type:"button",onClick:()=>{const $=r.milky.webhook.urls.filter((W,le)=>le!==M);l({...r,milky:{...r.milky,webhook:{...r.milky.webhook,urls:$}}})},className:"p-2 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/30 rounded-lg transition-colors",title:"删除",children:s.jsx(It,{size:18})})]},M)),r.milky.webhook.urls.some(Q=>Q&&!Q.match(/^https?:\/\//))&&s.jsx("p",{className:"text-xs text-red-500",children:"URL 必须以 http:// 或 https:// 开头"}),s.jsxs("button",{type:"button",onClick:()=>{l({...r,milky:{...r.milky,webhook:{...r.milky.webhook,urls:[...r.milky.webhook.urls,""]}}})},className:"flex items-center gap-2 px-4 py-2 text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors text-sm font-medium",children:[s.jsx(ih,{size:18}),"添加 Webhook URL"]})]}),s.jsx("p",{className:"text-xs text-theme-muted mt-2",children:"事件上报的 Webhook 地址"})]}),s.jsxs("div",{className:"mt-4",children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Access Token"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:O?"text":"password",value:r.milky.webhook.accessToken,onChange:Q=>l({...r,milky:{...r.milky,webhook:{...r.milky.webhook,accessToken:Q.target.value}}}),placeholder:"请输入 Access Token",className:"input-field pr-12"}),s.jsx("button",{type:"button",onClick:()=>R(!O),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1",children:O?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"用于 Webhook 请求验证的 Token"})]})]})]})]}),s.jsx("div",{className:"mt-6 flex justify-end",children:s.jsx("button",{onClick:()=>{var $;if(r.milky.http.host===""&&r.milky.enable&&!(($=r.milky.http.accessToken)!=null&&$.trim())){Y("当监听所有地址时,必须设置 Milky Access Token!","error");return}if(r.milky.webhook.urls.filter(W=>W.trim()&&!W.match(/^https?:\/\//)).length>0){Y("Webhook URL 必须以 http:// 或 https:// 开头","error");return}const M={...r,milky:{...r.milky,webhook:{...r.milky.webhook,urls:r.milky.webhook.urls.filter(W=>W.trim())}}};l(M),ye(M)},disabled:a,className:"btn-primary flex items-center gap-2",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Se,{size:20,className:"animate-spin"}),"保存中..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ui,{size:20}),"保存配置"]})})})]}),t==="other"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"pb-24",children:s.jsx(tg,{config:r,emailConfig:i,onChange:l,onEmailChange:o,onOpenChangePassword:()=>C(!0)})}),s.jsx("div",{className:"fixed bottom-8 right-8 z-40",children:s.jsx("button",{onClick:()=>ye(),disabled:a,className:"btn-primary flex items-center gap-2 shadow-2xl hover:shadow-3xl",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Se,{size:20,className:"animate-spin"}),"保存中..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ui,{size:20}),"保存配置"]})})})]}),t==="about"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"card p-8 text-center",children:[s.jsx("div",{className:"w-20 h-20 rounded-3xl overflow-hidden mx-auto mb-6 shadow-lg",children:s.jsx("img",{src:"/logo.jpg",alt:"Logo",className:"w-full h-full object-cover"})}),s.jsx("h1",{className:"text-3xl font-bold text-theme mb-2",children:"Lucky Lillia Bot"}),s.jsx("p",{className:"text-theme-secondary mb-6",children:"使你的 QQNT 支持 OneBot 11 协议、Satori 协议、Milky 协议进行 QQ 机器人开发"}),s.jsxs("div",{className:"flex items-center justify-center gap-4",children:[s.jsxs("a",{href:"https://github.com/LLOneBot/LuckyLilliaBot",target:"_blank",rel:"noopener noreferrer",className:"px-6 py-2.5 bg-gray-800 dark:bg-neutral-700 text-white rounded-xl hover:bg-gray-900 dark:hover:bg-neutral-600 transition-colors flex items-center gap-2",children:[s.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})}),"GitHub"]}),s.jsxs("a",{href:"https://luckylillia.com",target:"_blank",rel:"noopener noreferrer",className:"px-6 py-2.5 gradient-primary text-white rounded-xl hover:shadow-lg transition-all flex items-center gap-2",children:[s.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),"文档"]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl gradient-primary-br flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{d:"M16.5 3c-1.862 0-3.505.928-4.5 2.344C11.005 3.928 9.362 3 7.5 3 4.462 3 2 5.462 2 8.5c0 4.171 4.912 8.213 6.281 9.49a2.94 2.94 0 0 0 2.438.94 2.94 2.94 0 0 0 2.438-.94C14.588 16.713 19.5 12.671 19.5 8.5 19.5 5.462 17.038 3 16.5 3z"})})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"Telegram 群"}),s.jsx("p",{className:"text-sm text-theme-secondary"})]})]}),s.jsx("a",{href:"https://t.me/+nLZEnpne-pQ1OWFl",target:"_blank",rel:"noopener noreferrer",className:"text-pink-500 hover:text-pink-600 hover:underline text-sm break-all",children:"https://t.me/+nLZEnpne-pQ1OWFl"})]}),s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-green-500 to-emerald-600 flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{d:"M16.5 3c-1.862 0-3.505.928-4.5 2.344C11.005 3.928 9.362 3 7.5 3 4.462 3 2 5.462 2 8.5c0 4.171 4.912 8.213 6.281 9.49a2.94 2.94 0 0 0 2.438.94 2.94 2.94 0 0 0 2.438-.94C14.588 16.713 19.5 12.671 19.5 8.5 19.5 5.462 17.038 3 16.5 3z"})})}),s.jsx("div",{children:s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"QQ 群"})})]}),s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("a",{href:"https://qm.qq.com/q/EZndy3xntQ",target:"_blank",rel:"noopener noreferrer",className:" text-pink-500 hover:text-pink-600 hover:underline",children:"545402644"})})]})]}),s.jsx("div",{className:"card p-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl gradient-primary-br flex items-center justify-center",children:s.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"版本信息"}),s.jsxs("div",{className:"text-xs text-theme-muted",children:["Lucky Lillia Bot ",$u]}),b&&s.jsxs("div",{className:"text-xs text-theme-muted",children:["QQ ",b]})]})]}),s.jsxs("div",{className:"text-sm text-theme-secondary",children:["WebUI Powered by ",s.jsx("span",{className:"font-semibold text-pink-500",children:"React + Tailwind"})]})]})})]})]})]}),a&&s.jsx("div",{className:"fixed inset-0 bg-black/20 dark:bg-black/40 flex items-center justify-center",style:{zIndex:9e3},children:s.jsxs("div",{className:"bg-theme-card backdrop-blur-xl rounded-2xl p-6 shadow-2xl",children:[s.jsx(Se,{size:48,className:"animate-spin text-pink-500 mx-auto"}),s.jsx("p",{className:"mt-4 text-theme",children:"加载中..."})]})}),s.jsx(Us,{visible:w,onConfirm:oe,error:x}),s.jsx(ng,{visible:V,onClose:()=>C(!1),onSuccess:()=>{window.location.reload()}}),s.jsx(Di,{}),s.jsx($0,{visible:q,onClose:()=>K(!1)})]}):s.jsxs(s.Fragment,{children:[s.jsx(_s,{}),s.jsx(rg,{onLoginSuccess:Ce}),s.jsx(Us,{visible:w,onConfirm:oe,error:x}),s.jsx(Di,{})]})}const Uu=localStorage.getItem("llbot-theme");if(Uu)try{const{state:e}=JSON.parse(Uu);e!=null&&e.isDark&&document.documentElement.classList.add("dark")}catch{}Hi.createRoot(document.getElementById("root")).render(s.jsx(ce.StrictMode,{children:s.jsx(Sy,{})}));
|
|
453
|
+
`,children:s.jsx(py,{session:m,onShowMembers:()=>g(!w),onNewMessageCallback:b,onEmojiReactionCallback:E,onMessageRecalledCallback:_,appendInputMention:M,onAppendInputMentionConsumed:V,onBack:K,showBackButton:D})}),w&&(m==null?void 0:m.chatType)===2&&s.jsx("div",{className:"fixed inset-0 z-50 bg-white/85 dark:bg-neutral-900/85 backdrop-blur-xl md:static md:inset-auto md:z-auto md:bg-transparent md:backdrop-blur-none md:w-64 md:border-l md:border-theme-divider md:flex-shrink-0",children:s.jsx(gy,{groupCode:m.peerId,onClose:()=>g(!1),onAtMember:R})})]}),!e&&o&&s.jsx("button",{onClick:()=>window.open("#webqq-fullscreen","_blank"),className:"fixed bottom-6 right-6 z-50 p-3 bg-pink-500/70 hover:bg-pink-500/90 text-white rounded-full shadow-lg hover:shadow-xl transition-all duration-200 group backdrop-blur-sm",title:"在新窗口中全屏打开",children:s.jsx(g0,{size:20,className:"group-hover:scale-110 transition-transform"})})]})},vy=()=>s.jsx("div",{className:"h-screen bg-theme p-4 md:p-8",children:s.jsx(df,{isFullscreen:!0})}),wy={enable:!0,connect:[]},ky={enable:!1,host:"127.0.0.1",port:5600,token:""},jy={enable:!1,reportSelfMessage:!1,http:{host:"127.0.0.1",port:3010,prefix:"",accessToken:""},webhook:{urls:[],accessToken:""}},Ny={enable:!0,host:"127.0.0.1",port:3080},by={webui:Ny,milky:jy,satori:ky,ob11:wy,enableLocalFile2Url:!1,log:!0,autoDeleteFile:!1,autoDeleteFileSecond:60,musicSignUrl:"https://ss.xingzhige.com/music_card/card",msgCacheExpire:120,ffmpeg:"",rawMsgPB:!1},$u="7.9.2";function Sy(){const e=()=>{const Q=window.location.hash.slice(1);return["dashboard","onebot","satori","milky","logs","other","webqq","webqq-fullscreen","about"].includes(Q)?Q:"dashboard"},[t,n]=p.useState(e),[r,l]=p.useState(by),[i,o]=p.useState(null),[a,c]=p.useState(!1),[u,d]=p.useState(!1),[m,f]=p.useState(!0),[y,w]=p.useState(null),[k,j]=p.useState(!1),[g,h]=p.useState(""),[x,v]=p.useState(null),[N,S]=p.useState(!1),[T,M]=p.useState(!1),[q,R]=p.useState(!1),[V,C]=p.useState(!1),[b,E]=p.useState(""),[_,U]=p.useState(!1),[D,P]=p.useState(!1),[W,K]=p.useState(!1),{autoHideSidebarInWebQQ:J}=Ha();p.useEffect(()=>{W0(async Q=>new Promise(I=>{h(Q||""),j(!0),v(()=>I)}))},[]),p.useEffect(()=>{window.location.hash=t},[t]),p.useEffect(()=>{J&&t==="webqq"&&P(!0)},[t,J]),p.useEffect(()=>{const Q=()=>{const I=window.location.hash.slice(1);["dashboard","onebot","satori","milky","logs","other","webqq","webqq-fullscreen","about"].includes(I)&&n(I)};return window.addEventListener("hashchange",Q),()=>window.removeEventListener("hashchange",Q)},[]);const ae=p.useCallback(Q=>{Q.trim()?(j(!1),h(""),x&&(x(Q),v(null))):h("密码不能为空")},[x]);p.useEffect(()=>{(async()=>{var I;try{const F=await je("/api/config");if(F.success&&F.data.selfInfo.online){d(!0),w({nick:F.data.selfInfo.nick||"",uin:F.data.selfInfo.uin}),l(F.data.config);try{const H=await je("/api/email/config");H.success&&H.data&&o(H.data)}catch(H){console.error("Failed to fetch email config:",H)}try{const H=await je("/api/device-info");H.success&&((I=H.data)!=null&&I.buildVer)&&E(H.data.buildVer)}catch(H){console.error("Failed to fetch device info:",H)}}else d(!1)}catch(F){console.error("Failed to check login status:",F),d(!1)}finally{f(!1)}})()},[]);const ge=p.useCallback(async(Q,I)=>{try{c(!0);const F=Q||r,H=I!==void 0?I:i,se=await je("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:F})});if(!se.success){Y(se.message||"保存失败","error");return}if(H)try{const le=await je("/api/email/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)});if(!le.success){Y(`主配置已保存,但邮件配置保存失败:${le.message}`,"warning");return}}catch(le){Y(`主配置已保存,但邮件配置保存失败:${le.message}`,"warning");return}Y("配置保存成功","success")}catch(F){Y(F.message||"保存失败","error")}finally{c(!1)}},[r,i]),Ce=p.useCallback(()=>{window.location.reload()},[]);return m?s.jsxs(s.Fragment,{children:[s.jsx(As,{}),s.jsx("div",{className:"relative flex items-center justify-center min-h-screen z-10",children:s.jsx(Se,{size:48,className:"animate-spin text-pink-500"})}),s.jsx(Ds,{visible:k,onConfirm:ae,error:g})]}):u?t==="webqq-fullscreen"?s.jsxs(s.Fragment,{children:[s.jsx(As,{}),s.jsx(vy,{}),s.jsx(Ds,{visible:k,onConfirm:ae,error:g}),s.jsx(Di,{})]}):s.jsxs("div",{className:"flex min-h-screen",children:[s.jsx(As,{}),s.jsx(B0,{activeTab:t,onTabChange:n,accountInfo:y||void 0,isOpen:_,onClose:()=>U(!1),collapsed:D,onToggleCollapse:()=>P(!D),onOpenSettings:()=>K(!0)}),s.jsxs("main",{className:`flex-1 overflow-auto z-10 transition-all duration-300 ${D?"":"md:ml-64"}`,children:[s.jsxs("div",{className:"md:hidden sticky top-0 z-30 bg-theme-card/95 backdrop-blur-xl border-b border-theme-divider px-4 py-3 flex items-center gap-3",children:[s.jsx("button",{onClick:()=>U(!0),className:"p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors",children:s.jsx(y0,{size:24})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/logo.jpg",alt:"Logo",className:"w-8 h-8 rounded-lg"}),s.jsx("span",{className:"font-semibold text-theme",children:"LLBot"})]})]}),s.jsxs("div",{className:"p-4 md:p-8 max-w-6xl mx-auto",children:[s.jsxs("div",{className:"mb-8 hidden md:block",children:[s.jsx("h2",{className:"text-3xl font-bold text-white mb-2",children:t==="dashboard"&&"Dashboard"}),s.jsx("p",{className:"text-white/80",children:t==="dashboard"&&"欢迎使用 Lucky Lillia Bot"})]}),t==="dashboard"&&s.jsx(Y0,{llbotVersion:$u,qqVersion:b}),t==="webqq"&&s.jsx(df,{}),t==="logs"&&s.jsx(X0,{}),t==="onebot"&&s.jsx(J0,{config:r.ob11,onChange:Q=>{const I={...r,ob11:Q};l(I)},onSave:Q=>{if(Q){const I={...r,ob11:Q};ge(I)}else ge()}}),t==="satori"&&s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl gradient-primary-br flex items-center justify-center",children:s.jsx(Ua,{size:24,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"Satori 协议"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"配置 Satori 协议相关设置"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"启用 Satori 协议"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"开启后将支持 Satori 协议连接"})]}),s.jsx("input",{type:"checkbox",checked:r.satori.enable,onChange:Q=>l({...r,satori:{...r.satori,enable:Q.target.checked}}),className:"switch-toggle"})]}),r.satori.enable&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"监听地址"}),s.jsx(ls,{value:r.satori.host,onChange:Q=>l({...r,satori:{...r.satori,host:Q}})}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"选择服务监听的网络地址"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Satori 端口"}),s.jsx("input",{type:"number",value:r.satori.port,onChange:Q=>l({...r,satori:{...r.satori,port:parseInt(Q.target.value)}}),min:"1",max:"65535",placeholder:"5500",className:"input-field"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"Satori 服务监听端口(1-65535)"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Satori Token"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:N?"text":"password",value:r.satori.token,onChange:Q=>l({...r,satori:{...r.satori,token:Q.target.value}}),placeholder:"请输入 Satori Token",className:"input-field pr-12"}),s.jsx("button",{type:"button",onClick:()=>S(!N),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1",children:N?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"用于 Satori 连接验证的 Token"})]})]})]}),s.jsx("div",{className:"mt-6 flex justify-end",children:s.jsx("button",{onClick:()=>{var Q;if(r.satori.host===""&&r.satori.enable&&!((Q=r.satori.token)!=null&&Q.trim())){Y("当监听所有地址时,必须设置 Satori Token!","error");return}ge()},disabled:a,className:"btn-primary flex items-center gap-2",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Se,{size:20,className:"animate-spin"}),"保存中..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ui,{size:20}),"保存配置"]})})})]}),t==="milky"&&s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-pink-500 to-rose-600 flex items-center justify-center",children:s.jsx(rh,{size:24,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"Milky 协议"}),s.jsx("p",{className:"text-sm text-theme-secondary",children:"配置 Milky 协议相关设置"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"启用 Milky 协议"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"开启后将支持 Milky 协议连接"})]}),s.jsx("input",{type:"checkbox",checked:r.milky.enable,onChange:Q=>l({...r,milky:{...r.milky,enable:Q.target.checked}}),className:"switch-toggle"})]}),r.milky.enable&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"上报自己发送的消息"}),s.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后将上报自己发送的消息"})]}),s.jsx("input",{type:"checkbox",checked:r.milky.reportSelfMessage,onChange:Q=>l({...r,milky:{...r.milky,reportSelfMessage:Q.target.checked}}),className:"switch-toggle"})]}),s.jsxs("div",{className:"border-t border-theme-divider pt-4 mt-4",children:[s.jsx("h4",{className:"text-md font-semibold text-theme mb-4",children:"HTTP 配置"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"监听地址"}),s.jsx(ls,{value:r.milky.http.host,onChange:Q=>l({...r,milky:{...r.milky,http:{...r.milky.http,host:Q}}})}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"选择服务监听的网络地址"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"HTTP 端口"}),s.jsx("input",{type:"number",value:r.milky.http.port,onChange:Q=>l({...r,milky:{...r.milky,http:{...r.milky.http,port:parseInt(Q.target.value)}}}),min:"1",max:"65535",placeholder:"3010",className:"input-field"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"Milky HTTP 服务监听端口(1-65535)"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"路径前缀"}),s.jsx("input",{type:"text",value:r.milky.http.prefix,onChange:Q=>l({...r,milky:{...r.milky,http:{...r.milky.http,prefix:Q.target.value}}}),placeholder:"/api",className:"input-field"}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"HTTP API 路径前缀(可选)"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Access Token"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:T?"text":"password",value:r.milky.http.accessToken,onChange:Q=>l({...r,milky:{...r.milky,http:{...r.milky.http,accessToken:Q.target.value}}}),placeholder:"请输入 Access Token",className:"input-field pr-12"}),s.jsx("button",{type:"button",onClick:()=>M(!T),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1",children:T?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"用于 Milky HTTP 连接验证的 Token"})]})]})]}),s.jsxs("div",{className:"border-t border-theme-divider pt-4 mt-4",children:[s.jsx("h4",{className:"text-md font-semibold text-theme mb-4",children:"Webhook 配置"}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Webhook URLs"}),s.jsxs("div",{className:"space-y-2",children:[r.milky.webhook.urls.map((Q,I)=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"text",value:Q,onChange:F=>{const H=[...r.milky.webhook.urls];H[I]=F.target.value,l({...r,milky:{...r.milky,webhook:{...r.milky.webhook,urls:H}}})},placeholder:"http:// 或 https://",className:`input-field flex-1 ${Q&&!Q.match(/^https?:\/\//)?"border-red-300 focus:ring-red-500":""}`}),s.jsx("button",{type:"button",onClick:()=>{const F=r.milky.webhook.urls.filter((H,se)=>se!==I);l({...r,milky:{...r.milky,webhook:{...r.milky.webhook,urls:F}}})},className:"p-2 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/30 rounded-lg transition-colors",title:"删除",children:s.jsx(It,{size:18})})]},I)),r.milky.webhook.urls.some(Q=>Q&&!Q.match(/^https?:\/\//))&&s.jsx("p",{className:"text-xs text-red-500",children:"URL 必须以 http:// 或 https:// 开头"}),s.jsxs("button",{type:"button",onClick:()=>{l({...r,milky:{...r.milky,webhook:{...r.milky.webhook,urls:[...r.milky.webhook.urls,""]}}})},className:"flex items-center gap-2 px-4 py-2 text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors text-sm font-medium",children:[s.jsx(ih,{size:18}),"添加 Webhook URL"]})]}),s.jsx("p",{className:"text-xs text-theme-muted mt-2",children:"事件上报的 Webhook 地址"})]}),s.jsxs("div",{className:"mt-4",children:[s.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Access Token"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:q?"text":"password",value:r.milky.webhook.accessToken,onChange:Q=>l({...r,milky:{...r.milky,webhook:{...r.milky.webhook,accessToken:Q.target.value}}}),placeholder:"请输入 Access Token",className:"input-field pr-12"}),s.jsx("button",{type:"button",onClick:()=>R(!q),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1",children:q?s.jsx(sn,{size:20}):s.jsx(Ft,{size:20})})]}),s.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"用于 Webhook 请求验证的 Token"})]})]})]})]}),s.jsx("div",{className:"mt-6 flex justify-end",children:s.jsx("button",{onClick:()=>{var F;if(r.milky.http.host===""&&r.milky.enable&&!((F=r.milky.http.accessToken)!=null&&F.trim())){Y("当监听所有地址时,必须设置 Milky Access Token!","error");return}if(r.milky.webhook.urls.filter(H=>H.trim()&&!H.match(/^https?:\/\//)).length>0){Y("Webhook URL 必须以 http:// 或 https:// 开头","error");return}const I={...r,milky:{...r.milky,webhook:{...r.milky.webhook,urls:r.milky.webhook.urls.filter(H=>H.trim())}}};l(I),ge(I)},disabled:a,className:"btn-primary flex items-center gap-2",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Se,{size:20,className:"animate-spin"}),"保存中..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ui,{size:20}),"保存配置"]})})})]}),t==="other"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"pb-24",children:s.jsx(tg,{config:r,emailConfig:i,onChange:l,onEmailChange:o,onOpenChangePassword:()=>C(!0)})}),s.jsx("div",{className:"fixed bottom-8 right-8 z-40",children:s.jsx("button",{onClick:()=>ge(),disabled:a,className:"btn-primary flex items-center gap-2 shadow-2xl hover:shadow-3xl",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Se,{size:20,className:"animate-spin"}),"保存中..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ui,{size:20}),"保存配置"]})})})]}),t==="about"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"card p-8 text-center",children:[s.jsx("div",{className:"w-20 h-20 rounded-3xl overflow-hidden mx-auto mb-6 shadow-lg",children:s.jsx("img",{src:"/logo.jpg",alt:"Logo",className:"w-full h-full object-cover"})}),s.jsx("h1",{className:"text-3xl font-bold text-theme mb-2",children:"Lucky Lillia Bot"}),s.jsx("p",{className:"text-theme-secondary mb-6",children:"使你的 QQNT 支持 OneBot 11 协议、Satori 协议、Milky 协议进行 QQ 机器人开发"}),s.jsxs("div",{className:"flex items-center justify-center gap-4",children:[s.jsxs("a",{href:"https://github.com/LLOneBot/LuckyLilliaBot",target:"_blank",rel:"noopener noreferrer",className:"px-6 py-2.5 bg-gray-800 dark:bg-neutral-700 text-white rounded-xl hover:bg-gray-900 dark:hover:bg-neutral-600 transition-colors flex items-center gap-2",children:[s.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})}),"GitHub"]}),s.jsxs("a",{href:"https://luckylillia.com",target:"_blank",rel:"noopener noreferrer",className:"px-6 py-2.5 gradient-primary text-white rounded-xl hover:shadow-lg transition-all flex items-center gap-2",children:[s.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),"文档"]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl gradient-primary-br flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{d:"M16.5 3c-1.862 0-3.505.928-4.5 2.344C11.005 3.928 9.362 3 7.5 3 4.462 3 2 5.462 2 8.5c0 4.171 4.912 8.213 6.281 9.49a2.94 2.94 0 0 0 2.438.94 2.94 2.94 0 0 0 2.438-.94C14.588 16.713 19.5 12.671 19.5 8.5 19.5 5.462 17.038 3 16.5 3z"})})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"Telegram 群"}),s.jsx("p",{className:"text-sm text-theme-secondary"})]})]}),s.jsx("a",{href:"https://t.me/+nLZEnpne-pQ1OWFl",target:"_blank",rel:"noopener noreferrer",className:"text-pink-500 hover:text-pink-600 hover:underline text-sm break-all",children:"https://t.me/+nLZEnpne-pQ1OWFl"})]}),s.jsxs("div",{className:"card p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-green-500 to-emerald-600 flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{d:"M16.5 3c-1.862 0-3.505.928-4.5 2.344C11.005 3.928 9.362 3 7.5 3 4.462 3 2 5.462 2 8.5c0 4.171 4.912 8.213 6.281 9.49a2.94 2.94 0 0 0 2.438.94 2.94 2.94 0 0 0 2.438-.94C14.588 16.713 19.5 12.671 19.5 8.5 19.5 5.462 17.038 3 16.5 3z"})})}),s.jsx("div",{children:s.jsx("h3",{className:"text-lg font-semibold text-theme",children:"QQ 群"})})]}),s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("a",{href:"https://qm.qq.com/q/EZndy3xntQ",target:"_blank",rel:"noopener noreferrer",className:" text-pink-500 hover:text-pink-600 hover:underline",children:"545402644"})})]})]}),s.jsx("div",{className:"card p-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl gradient-primary-br flex items-center justify-center",children:s.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-theme",children:"版本信息"}),s.jsxs("div",{className:"text-xs text-theme-muted",children:["Lucky Lillia Bot ",$u]}),b&&s.jsxs("div",{className:"text-xs text-theme-muted",children:["QQ ",b]})]})]}),s.jsxs("div",{className:"text-sm text-theme-secondary",children:["WebUI Powered by ",s.jsx("span",{className:"font-semibold text-pink-500",children:"React + Tailwind"})]})]})})]})]})]}),a&&s.jsx("div",{className:"fixed inset-0 bg-black/20 dark:bg-black/40 flex items-center justify-center",style:{zIndex:9e3},children:s.jsxs("div",{className:"bg-theme-card backdrop-blur-xl rounded-2xl p-6 shadow-2xl",children:[s.jsx(Se,{size:48,className:"animate-spin text-pink-500 mx-auto"}),s.jsx("p",{className:"mt-4 text-theme",children:"加载中..."})]})}),s.jsx(Ds,{visible:k,onConfirm:ae,error:g}),s.jsx(ng,{visible:V,onClose:()=>C(!1),onSuccess:()=>{window.location.reload()}}),s.jsx(Di,{}),s.jsx($0,{visible:W,onClose:()=>K(!1)})]}):s.jsxs(s.Fragment,{children:[s.jsx(As,{}),s.jsx(rg,{onLoginSuccess:Ce}),s.jsx(Ds,{visible:k,onConfirm:ae,error:g}),s.jsx(Di,{})]})}const Uu=localStorage.getItem("llbot-theme");if(Uu)try{const{state:e}=JSON.parse(Uu);e!=null&&e.isDark&&document.documentElement.classList.add("dark")}catch{}Hi.createRoot(document.getElementById("root")).render(s.jsx(ce.StrictMode,{children:s.jsx(Sy,{})}));
|