llonebot-dist 7.1.3 → 7.3.0

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.
Files changed (200) hide show
  1. package/assets/index-BzaRbVUe.js +45 -0
  2. package/assets/index-BzaRbVUe.js.map +1 -0
  3. package/default_config.json +2 -1
  4. package/{llonebot.js → llbot.js} +16628 -3044
  5. package/llbot.js.map +1 -0
  6. package/node_modules/file-type/core.js +19 -0
  7. package/node_modules/file-type/package.json +3 -1
  8. package/node_modules/file-type/readme.md +2 -0
  9. package/node_modules/file-type/supported.js +4 -0
  10. package/package.json +1 -1
  11. package/webui/assets/index-Bs4Za8Si.js +391 -0
  12. package/webui/assets/index-Dazdm2BW.css +1 -0
  13. package/webui/face/0.png +0 -0
  14. package/webui/face/1.png +0 -0
  15. package/webui/face/10.png +0 -0
  16. package/webui/face/100.png +0 -0
  17. package/webui/face/101.png +0 -0
  18. package/webui/face/102.png +0 -0
  19. package/webui/face/103.png +0 -0
  20. package/webui/face/104.png +0 -0
  21. package/webui/face/105.png +0 -0
  22. package/webui/face/106.png +0 -0
  23. package/webui/face/107.png +0 -0
  24. package/webui/face/108.png +0 -0
  25. package/webui/face/109.png +0 -0
  26. package/webui/face/11.png +0 -0
  27. package/webui/face/110.png +0 -0
  28. package/webui/face/111.png +0 -0
  29. package/webui/face/112.png +0 -0
  30. package/webui/face/114.png +0 -0
  31. package/webui/face/116.png +0 -0
  32. package/webui/face/118.png +0 -0
  33. package/webui/face/119.png +0 -0
  34. package/webui/face/12.png +0 -0
  35. package/webui/face/120.png +0 -0
  36. package/webui/face/121.png +0 -0
  37. package/webui/face/123.png +0 -0
  38. package/webui/face/124.png +0 -0
  39. package/webui/face/125.png +0 -0
  40. package/webui/face/129.png +0 -0
  41. package/webui/face/13.png +0 -0
  42. package/webui/face/137.png +0 -0
  43. package/webui/face/14.png +0 -0
  44. package/webui/face/144.png +0 -0
  45. package/webui/face/146.png +0 -0
  46. package/webui/face/147.png +0 -0
  47. package/webui/face/15.png +0 -0
  48. package/webui/face/16.png +0 -0
  49. package/webui/face/169.png +0 -0
  50. package/webui/face/171.png +0 -0
  51. package/webui/face/172.png +0 -0
  52. package/webui/face/173.png +0 -0
  53. package/webui/face/174.png +0 -0
  54. package/webui/face/175.png +0 -0
  55. package/webui/face/176.png +0 -0
  56. package/webui/face/177.png +0 -0
  57. package/webui/face/178.png +0 -0
  58. package/webui/face/179.png +0 -0
  59. package/webui/face/18.png +0 -0
  60. package/webui/face/181.png +0 -0
  61. package/webui/face/182.png +0 -0
  62. package/webui/face/183.png +0 -0
  63. package/webui/face/185.png +0 -0
  64. package/webui/face/187.png +0 -0
  65. package/webui/face/19.png +0 -0
  66. package/webui/face/2.png +0 -0
  67. package/webui/face/20.png +0 -0
  68. package/webui/face/201.png +0 -0
  69. package/webui/face/21.png +0 -0
  70. package/webui/face/212.png +0 -0
  71. package/webui/face/22.png +0 -0
  72. package/webui/face/23.png +0 -0
  73. package/webui/face/24.png +0 -0
  74. package/webui/face/25.png +0 -0
  75. package/webui/face/26.png +0 -0
  76. package/webui/face/262.png +0 -0
  77. package/webui/face/263.png +0 -0
  78. package/webui/face/264.png +0 -0
  79. package/webui/face/265.png +0 -0
  80. package/webui/face/266.png +0 -0
  81. package/webui/face/267.png +0 -0
  82. package/webui/face/268.png +0 -0
  83. package/webui/face/269.png +0 -0
  84. package/webui/face/27.png +0 -0
  85. package/webui/face/270.png +0 -0
  86. package/webui/face/271.png +0 -0
  87. package/webui/face/272.png +0 -0
  88. package/webui/face/273.png +0 -0
  89. package/webui/face/277.png +0 -0
  90. package/webui/face/28.png +0 -0
  91. package/webui/face/281.png +0 -0
  92. package/webui/face/282.png +0 -0
  93. package/webui/face/283.png +0 -0
  94. package/webui/face/284.png +0 -0
  95. package/webui/face/285.png +0 -0
  96. package/webui/face/286.png +0 -0
  97. package/webui/face/287.png +0 -0
  98. package/webui/face/289.png +0 -0
  99. package/webui/face/29.png +0 -0
  100. package/webui/face/293.png +0 -0
  101. package/webui/face/294.png +0 -0
  102. package/webui/face/295.png +0 -0
  103. package/webui/face/297.png +0 -0
  104. package/webui/face/298.png +0 -0
  105. package/webui/face/299.png +0 -0
  106. package/webui/face/3.png +0 -0
  107. package/webui/face/30.png +0 -0
  108. package/webui/face/300.png +0 -0
  109. package/webui/face/302.png +0 -0
  110. package/webui/face/303.png +0 -0
  111. package/webui/face/305.png +0 -0
  112. package/webui/face/306.png +0 -0
  113. package/webui/face/307.png +0 -0
  114. package/webui/face/31.png +0 -0
  115. package/webui/face/311.png +0 -0
  116. package/webui/face/312.png +0 -0
  117. package/webui/face/314.png +0 -0
  118. package/webui/face/317.png +0 -0
  119. package/webui/face/318.png +0 -0
  120. package/webui/face/319.png +0 -0
  121. package/webui/face/32.png +0 -0
  122. package/webui/face/320.png +0 -0
  123. package/webui/face/323.png +0 -0
  124. package/webui/face/324.png +0 -0
  125. package/webui/face/325.png +0 -0
  126. package/webui/face/326.png +0 -0
  127. package/webui/face/33.png +0 -0
  128. package/webui/face/332.png +0 -0
  129. package/webui/face/333.png +0 -0
  130. package/webui/face/334.png +0 -0
  131. package/webui/face/336.png +0 -0
  132. package/webui/face/337.png +0 -0
  133. package/webui/face/338.png +0 -0
  134. package/webui/face/339.png +0 -0
  135. package/webui/face/34.png +0 -0
  136. package/webui/face/341.png +0 -0
  137. package/webui/face/342.png +0 -0
  138. package/webui/face/343.png +0 -0
  139. package/webui/face/344.png +0 -0
  140. package/webui/face/345.png +0 -0
  141. package/webui/face/346.png +0 -0
  142. package/webui/face/347.png +0 -0
  143. package/webui/face/349.png +0 -0
  144. package/webui/face/35.png +0 -0
  145. package/webui/face/350.png +0 -0
  146. package/webui/face/351.png +0 -0
  147. package/webui/face/352.png +0 -0
  148. package/webui/face/353.png +0 -0
  149. package/webui/face/354.png +0 -0
  150. package/webui/face/355.png +0 -0
  151. package/webui/face/356.png +0 -0
  152. package/webui/face/357.png +0 -0
  153. package/webui/face/358.png +0 -0
  154. package/webui/face/359.png +0 -0
  155. package/webui/face/36.png +0 -0
  156. package/webui/face/37.png +0 -0
  157. package/webui/face/38.png +0 -0
  158. package/webui/face/39.png +0 -0
  159. package/webui/face/392.png +0 -0
  160. package/webui/face/393.png +0 -0
  161. package/webui/face/394.png +0 -0
  162. package/webui/face/395.png +0 -0
  163. package/webui/face/4.png +0 -0
  164. package/webui/face/41.png +0 -0
  165. package/webui/face/42.png +0 -0
  166. package/webui/face/43.png +0 -0
  167. package/webui/face/46.png +0 -0
  168. package/webui/face/49.png +0 -0
  169. package/webui/face/5.png +0 -0
  170. package/webui/face/53.png +0 -0
  171. package/webui/face/56.png +0 -0
  172. package/webui/face/59.png +0 -0
  173. package/webui/face/6.png +0 -0
  174. package/webui/face/60.png +0 -0
  175. package/webui/face/63.png +0 -0
  176. package/webui/face/64.png +0 -0
  177. package/webui/face/66.png +0 -0
  178. package/webui/face/67.png +0 -0
  179. package/webui/face/7.png +0 -0
  180. package/webui/face/74.png +0 -0
  181. package/webui/face/75.png +0 -0
  182. package/webui/face/76.png +0 -0
  183. package/webui/face/77.png +0 -0
  184. package/webui/face/78.png +0 -0
  185. package/webui/face/79.png +0 -0
  186. package/webui/face/8.png +0 -0
  187. package/webui/face/85.png +0 -0
  188. package/webui/face/86.png +0 -0
  189. package/webui/face/89.png +0 -0
  190. package/webui/face/9.png +0 -0
  191. package/webui/face/96.png +0 -0
  192. package/webui/face/97.png +0 -0
  193. package/webui/face/98.png +0 -0
  194. package/webui/face/99.png +0 -0
  195. package/webui/index.html +2 -2
  196. package//344/275/277/347/224/250/350/257/264/346/230/216.txt +1 -1
  197. package//346/233/264/346/226/260/346/227/245/345/277/227.txt +42 -0
  198. package/llonebot.js.map +0 -1
  199. package/webui/assets/index-CAnlmz3O.js +0 -308
  200. package/webui/assets/index-CO7Tbtyt.css +0 -1
@@ -0,0 +1,391 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)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(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function th(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yu={exports:{}},Nl={},vu={exports:{}},te={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var es=Symbol.for("react.element"),nh=Symbol.for("react.portal"),rh=Symbol.for("react.fragment"),sh=Symbol.for("react.strict_mode"),lh=Symbol.for("react.profiler"),ih=Symbol.for("react.provider"),oh=Symbol.for("react.context"),ah=Symbol.for("react.forward_ref"),ch=Symbol.for("react.suspense"),uh=Symbol.for("react.memo"),dh=Symbol.for("react.lazy"),qa=Symbol.iterator;function mh(e){return e===null||typeof e!="object"?null:(e=qa&&e[qa]||e["@@iterator"],typeof e=="function"?e:null)}var wu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ku=Object.assign,ju={};function lr(e,t,n){this.props=e,this.context=t,this.refs=ju,this.updater=n||wu}lr.prototype.isReactComponent={};lr.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")};lr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Nu(){}Nu.prototype=lr.prototype;function Po(e,t,n){this.props=e,this.context=t,this.refs=ju,this.updater=n||wu}var Lo=Po.prototype=new Nu;Lo.constructor=Po;ku(Lo,lr.prototype);Lo.isPureReactComponent=!0;var Wa=Array.isArray,bu=Object.prototype.hasOwnProperty,Ro={current:null},Su={key:!0,ref:!0,__self:!0,__source:!0};function Cu(e,t,n){var r,s={},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)bu.call(t,r)&&!Su.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:es,type:e,key:i,ref:o,props:s,_owner:Ro.current}}function fh(e,t){return{$$typeof:es,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function _o(e){return typeof e=="object"&&e!==null&&e.$$typeof===es}function hh(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ha=/\/+/g;function Xl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?hh(""+e.key):t.toString(36)}function Ls(e,t,n,r,s){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 es:case nh:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Xl(o,0):r,Wa(s)?(n="",e!=null&&(n=e.replace(Ha,"$&/")+"/"),Ls(s,t,n,"",function(u){return u})):s!=null&&(_o(s)&&(s=fh(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Ha,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Wa(e))for(var a=0;a<e.length;a++){i=e[a];var c=r+Xl(i,a);o+=Ls(i,t,n,c,s)}else if(c=mh(e),typeof c=="function")for(e=c.call(e),a=0;!(i=e.next()).done;)i=i.value,c=r+Xl(i,a++),o+=Ls(i,t,n,c,s);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 ds(e,t,n){if(e==null)return e;var r=[],s=0;return Ls(e,r,"","",function(i){return t.call(n,i,s++)}),r}function ph(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 We={current:null},Rs={transition:null},xh={ReactCurrentDispatcher:We,ReactCurrentBatchConfig:Rs,ReactCurrentOwner:Ro};function Eu(){throw Error("act(...) is not supported in production builds of React.")}te.Children={map:ds,forEach:function(e,t,n){ds(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ds(e,function(){t++}),t},toArray:function(e){return ds(e,function(t){return t})||[]},only:function(e){if(!_o(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};te.Component=lr;te.Fragment=rh;te.Profiler=lh;te.PureComponent=Po;te.StrictMode=sh;te.Suspense=ch;te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xh;te.act=Eu;te.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=ku({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Ro.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)bu.call(t,c)&&!Su.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:es,type:e.type,key:s,ref:i,props:r,_owner:o}};te.createContext=function(e){return e={$$typeof:oh,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ih,_context:e},e.Consumer=e};te.createElement=Cu;te.createFactory=function(e){var t=Cu.bind(null,e);return t.type=e,t};te.createRef=function(){return{current:null}};te.forwardRef=function(e){return{$$typeof:ah,render:e}};te.isValidElement=_o;te.lazy=function(e){return{$$typeof:dh,_payload:{_status:-1,_result:e},_init:ph}};te.memo=function(e,t){return{$$typeof:uh,type:e,compare:t===void 0?null:t}};te.startTransition=function(e){var t=Rs.transition;Rs.transition={};try{e()}finally{Rs.transition=t}};te.unstable_act=Eu;te.useCallback=function(e,t){return We.current.useCallback(e,t)};te.useContext=function(e){return We.current.useContext(e)};te.useDebugValue=function(){};te.useDeferredValue=function(e){return We.current.useDeferredValue(e)};te.useEffect=function(e,t){return We.current.useEffect(e,t)};te.useId=function(){return We.current.useId()};te.useImperativeHandle=function(e,t,n){return We.current.useImperativeHandle(e,t,n)};te.useInsertionEffect=function(e,t){return We.current.useInsertionEffect(e,t)};te.useLayoutEffect=function(e,t){return We.current.useLayoutEffect(e,t)};te.useMemo=function(e,t){return We.current.useMemo(e,t)};te.useReducer=function(e,t,n){return We.current.useReducer(e,t,n)};te.useRef=function(e){return We.current.useRef(e)};te.useState=function(e){return We.current.useState(e)};te.useSyncExternalStore=function(e,t,n){return We.current.useSyncExternalStore(e,t,n)};te.useTransition=function(){return We.current.useTransition()};te.version="18.3.1";vu.exports=te;var x=vu.exports;const le=th(x);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var gh=x,yh=Symbol.for("react.element"),vh=Symbol.for("react.fragment"),wh=Object.prototype.hasOwnProperty,kh=gh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,jh={key:!0,ref:!0,__self:!0,__source:!0};function Tu(e,t,n){var r,s={},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)wh.call(t,r)&&!jh.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:yh,type:e,key:i,ref:o,props:s,_owner:kh.current}}Nl.Fragment=vh;Nl.jsx=Tu;Nl.jsxs=Tu;yu.exports=Nl;var l=yu.exports,Ei={},Mu={exports:{}},tt={},Iu={exports:{}},zu={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(E,$){var q=E.length;E.push($);e:for(;0<q;){var G=q-1>>>1,B=E[G];if(0<s(B,$))E[G]=$,E[q]=B,q=G;else break e}}function n(E){return E.length===0?null:E[0]}function r(E){if(E.length===0)return null;var $=E[0],q=E.pop();if(q!==$){E[0]=q;e:for(var G=0,B=E.length,ne=B>>>1;G<ne;){var Z=2*(G+1)-1,Te=E[Z],ue=Z+1,W=E[ue];if(0>s(Te,q))ue<B&&0>s(W,Te)?(E[G]=W,E[ue]=q,G=ue):(E[G]=Te,E[Z]=q,G=Z);else if(ue<B&&0>s(W,q))E[G]=W,E[ue]=q,G=ue;else break e}}return $}function s(E,$){var q=E.sortIndex-$.sortIndex;return q!==0?q:E.id-$.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=[],h=1,f=null,p=3,v=!1,y=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(E){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=E)r(u),$.sortIndex=$.expirationTime,t(c,$);else break;$=n(u)}}function N(E){if(w=!1,g(E),!y)if(n(c)!==null)y=!0,U(b);else{var $=n(u);$!==null&&Y(N,$.startTime-E)}}function b(E,$){y=!1,w&&(w=!1,d(T),T=-1),v=!0;var q=p;try{for(g($),f=n(c);f!==null&&(!(f.expirationTime>$)||E&&!C());){var G=f.callback;if(typeof G=="function"){f.callback=null,p=f.priorityLevel;var B=G(f.expirationTime<=$);$=e.unstable_now(),typeof B=="function"?f.callback=B:f===n(c)&&r(c),g($)}else r(c);f=n(c)}if(f!==null)var ne=!0;else{var Z=n(u);Z!==null&&Y(N,Z.startTime-$),ne=!1}return ne}finally{f=null,p=q,v=!1}}var M=!1,_=null,T=-1,O=5,I=-1;function C(){return!(e.unstable_now()-I<O)}function A(){if(_!==null){var E=e.unstable_now();I=E;var $=!0;try{$=_(!0,E)}finally{$?j():(M=!1,_=null)}}else M=!1}var j;if(typeof m=="function")j=function(){m(A)};else if(typeof MessageChannel<"u"){var S=new MessageChannel,P=S.port2;S.port1.onmessage=A,j=function(){P.postMessage(null)}}else j=function(){k(A,0)};function U(E){_=E,M||(M=!0,j())}function Y(E,$){T=k(function(){E(e.unstable_now())},$)}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(E){E.callback=null},e.unstable_continueExecution=function(){y||v||(y=!0,U(b))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(E){switch(p){case 1:case 2:case 3:var $=3;break;default:$=p}var q=p;p=$;try{return E()}finally{p=q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,$){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var q=p;p=E;try{return $()}finally{p=q}},e.unstable_scheduleCallback=function(E,$,q){var G=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?G+q:G):q=G,E){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=q+B,E={id:h++,callback:$,priorityLevel:E,startTime:q,expirationTime:B,sortIndex:-1},q>G?(E.sortIndex=q,t(u,E),n(c)===null&&E===n(u)&&(w?(d(T),T=-1):w=!0,Y(N,q-G))):(E.sortIndex=B,t(c,E),y||v||(y=!0,U(b))),E},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(E){var $=p;return function(){var q=p;p=$;try{return E.apply(this,arguments)}finally{p=q}}}})(zu);Iu.exports=zu;var Nh=Iu.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var bh=x,et=Nh;function F(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 Pu=new Set,Fr={};function Sn(e,t){Xn(e,t),Xn(e+"Capture",t)}function Xn(e,t){for(Fr[e]=t,e=0;e<t.length;e++)Pu.add(t[e])}var _t=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ti=Object.prototype.hasOwnProperty,Sh=/^[: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]*$/,Ba={},Va={};function Ch(e){return Ti.call(Va,e)?!0:Ti.call(Ba,e)?!1:Sh.test(e)?Va[e]=!0:(Ba[e]=!0,!1)}function Eh(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 Th(e,t,n,r){if(t===null||typeof t>"u"||Eh(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 He(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var _e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_e[e]=new He(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];_e[t]=new He(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_e[e]=new He(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_e[e]=new He(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){_e[e]=new He(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_e[e]=new He(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_e[e]=new He(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_e[e]=new He(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_e[e]=new He(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ao=/[\-:]([a-z])/g;function Fo(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(Ao,Fo);_e[t]=new He(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(Ao,Fo);_e[t]=new He(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(Ao,Fo);_e[t]=new He(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_e[e]=new He(e,1,!1,e.toLowerCase(),null,!1,!1)});_e.xlinkHref=new He("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_e[e]=new He(e,1,!1,e.toLowerCase(),null,!0,!0)});function Uo(e,t,n,r){var s=_e.hasOwnProperty(t)?_e[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Th(t,n,s,r)&&(n=null),r||s===null?Ch(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var $t=bh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ms=Symbol.for("react.element"),Pn=Symbol.for("react.portal"),Ln=Symbol.for("react.fragment"),$o=Symbol.for("react.strict_mode"),Mi=Symbol.for("react.profiler"),Lu=Symbol.for("react.provider"),Ru=Symbol.for("react.context"),Do=Symbol.for("react.forward_ref"),Ii=Symbol.for("react.suspense"),zi=Symbol.for("react.suspense_list"),Oo=Symbol.for("react.memo"),Ot=Symbol.for("react.lazy"),_u=Symbol.for("react.offscreen"),Qa=Symbol.iterator;function fr(e){return e===null||typeof e!="object"?null:(e=Qa&&e[Qa]||e["@@iterator"],typeof e=="function"?e:null)}var we=Object.assign,Jl;function kr(e){if(Jl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Jl=t&&t[1]||""}return`
34
+ `+Jl+e}var Zl=!1;function ei(e,t){if(!e||Zl)return"";Zl=!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 s=u.stack.split(`
35
+ `),i=r.stack.split(`
36
+ `),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var c=`
37
+ `+s[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{Zl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?kr(e):""}function Mh(e){switch(e.tag){case 5:return kr(e.type);case 16:return kr("Lazy");case 13:return kr("Suspense");case 19:return kr("SuspenseList");case 0:case 2:case 15:return e=ei(e.type,!1),e;case 11:return e=ei(e.type.render,!1),e;case 1:return e=ei(e.type,!0),e;default:return""}}function Pi(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 Ln:return"Fragment";case Pn:return"Portal";case Mi:return"Profiler";case $o:return"StrictMode";case Ii:return"Suspense";case zi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ru:return(e.displayName||"Context")+".Consumer";case Lu:return(e._context.displayName||"Context")+".Provider";case Do:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Oo:return t=e.displayName||null,t!==null?t:Pi(e.type)||"Memo";case Ot:t=e._payload,e=e._init;try{return Pi(e(t))}catch{}}return null}function Ih(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 Pi(t);case 8:return t===$o?"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 tn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Au(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zh(e){var t=Au(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 s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.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 fs(e){e._valueTracker||(e._valueTracker=zh(e))}function Fu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Au(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Gs(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 Li(e,t){var n=t.checked;return we({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ga(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=tn(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 Uu(e,t){t=t.checked,t!=null&&Uo(e,"checked",t,!1)}function Ri(e,t){Uu(e,t);var n=tn(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")?_i(e,t.type,n):t.hasOwnProperty("defaultValue")&&_i(e,t.type,tn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ka(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 _i(e,t,n){(t!=="number"||Gs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var jr=Array.isArray;function Hn(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+tn(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Ai(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return we({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ya(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(jr(n)){if(1<n.length)throw Error(F(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:tn(n)}}function $u(e,t){var n=tn(t.value),r=tn(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 Xa(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Du(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 Fi(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Du(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var hs,Ou=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(hs=hs||document.createElement("div"),hs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=hs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ur(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cr={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},Ph=["Webkit","ms","Moz","O"];Object.keys(Cr).forEach(function(e){Ph.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Cr[t]=Cr[e]})});function qu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Cr.hasOwnProperty(e)&&Cr[e]?(""+t).trim():t+"px"}function Wu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=qu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var Lh=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 Ui(e,t){if(t){if(Lh[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 $i(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 Di=null;function qo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Oi=null,Bn=null,Vn=null;function Ja(e){if(e=rs(e)){if(typeof Oi!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Tl(t),Oi(e.stateNode,e.type,t))}}function Hu(e){Bn?Vn?Vn.push(e):Vn=[e]:Bn=e}function Bu(){if(Bn){var e=Bn,t=Vn;if(Vn=Bn=null,Ja(e),t)for(e=0;e<t.length;e++)Ja(t[e])}}function Vu(e,t){return e(t)}function Qu(){}var ti=!1;function Gu(e,t,n){if(ti)return e(t,n);ti=!0;try{return Vu(e,t,n)}finally{ti=!1,(Bn!==null||Vn!==null)&&(Qu(),Bu())}}function $r(e,t){var n=e.stateNode;if(n===null)return null;var r=Tl(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 qi=!1;if(_t)try{var hr={};Object.defineProperty(hr,"passive",{get:function(){qi=!0}}),window.addEventListener("test",hr,hr),window.removeEventListener("test",hr,hr)}catch{qi=!1}function Rh(e,t,n,r,s,i,o,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(h){this.onError(h)}}var Er=!1,Ks=null,Ys=!1,Wi=null,_h={onError:function(e){Er=!0,Ks=e}};function Ah(e,t,n,r,s,i,o,a,c){Er=!1,Ks=null,Rh.apply(_h,arguments)}function Fh(e,t,n,r,s,i,o,a,c){if(Ah.apply(this,arguments),Er){if(Er){var u=Ks;Er=!1,Ks=null}else throw Error(F(198));Ys||(Ys=!0,Wi=u)}}function Cn(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 Ku(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 Za(e){if(Cn(e)!==e)throw Error(F(188))}function Uh(e){var t=e.alternate;if(!t){if(t=Cn(e),t===null)throw Error(F(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return Za(s),e;if(i===r)return Za(s),t;i=i.sibling}throw Error(F(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;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 Yu(e){return e=Uh(e),e!==null?Xu(e):null}function Xu(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Xu(e);if(t!==null)return t;e=e.sibling}return null}var Ju=et.unstable_scheduleCallback,ec=et.unstable_cancelCallback,$h=et.unstable_shouldYield,Dh=et.unstable_requestPaint,be=et.unstable_now,Oh=et.unstable_getCurrentPriorityLevel,Wo=et.unstable_ImmediatePriority,Zu=et.unstable_UserBlockingPriority,Xs=et.unstable_NormalPriority,qh=et.unstable_LowPriority,ed=et.unstable_IdlePriority,bl=null,St=null;function Wh(e){if(St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(bl,e,void 0,(e.current.flags&128)===128)}catch{}}var gt=Math.clz32?Math.clz32:Vh,Hh=Math.log,Bh=Math.LN2;function Vh(e){return e>>>=0,e===0?32:31-(Hh(e)/Bh|0)|0}var ps=64,xs=4194304;function Nr(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 Js(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=Nr(a):(i&=o,i!==0&&(r=Nr(i)))}else o=n&~s,o!==0?r=Nr(o):i!==0&&(r=Nr(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===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-gt(t),s=1<<n,r|=e[n],t&=~s;return r}function Qh(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 Gh(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-gt(i),a=1<<o,c=s[o];c===-1?(!(a&n)||a&r)&&(s[o]=Qh(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}function Hi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function td(){var e=ps;return ps<<=1,!(ps&4194240)&&(ps=64),e}function ni(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ts(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gt(t),e[t]=n}function Kh(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 s=31-gt(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function Ho(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-gt(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ie=0;function nd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var rd,Bo,sd,ld,id,Bi=!1,gs=[],Qt=null,Gt=null,Kt=null,Dr=new Map,Or=new Map,Wt=[],Yh="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 tc(e,t){switch(e){case"focusin":case"focusout":Qt=null;break;case"dragenter":case"dragleave":Gt=null;break;case"mouseover":case"mouseout":Kt=null;break;case"pointerover":case"pointerout":Dr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Or.delete(t.pointerId)}}function pr(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=rs(t),t!==null&&Bo(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Xh(e,t,n,r,s){switch(t){case"focusin":return Qt=pr(Qt,e,t,n,r,s),!0;case"dragenter":return Gt=pr(Gt,e,t,n,r,s),!0;case"mouseover":return Kt=pr(Kt,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Dr.set(i,pr(Dr.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Or.set(i,pr(Or.get(i)||null,e,t,n,r,s)),!0}return!1}function od(e){var t=fn(e.target);if(t!==null){var n=Cn(t);if(n!==null){if(t=n.tag,t===13){if(t=Ku(n),t!==null){e.blockedOn=t,id(e.priority,function(){sd(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 _s(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Vi(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Di=r,n.target.dispatchEvent(r),Di=null}else return t=rs(n),t!==null&&Bo(t),e.blockedOn=n,!1;t.shift()}return!0}function nc(e,t,n){_s(e)&&n.delete(t)}function Jh(){Bi=!1,Qt!==null&&_s(Qt)&&(Qt=null),Gt!==null&&_s(Gt)&&(Gt=null),Kt!==null&&_s(Kt)&&(Kt=null),Dr.forEach(nc),Or.forEach(nc)}function xr(e,t){e.blockedOn===t&&(e.blockedOn=null,Bi||(Bi=!0,et.unstable_scheduleCallback(et.unstable_NormalPriority,Jh)))}function qr(e){function t(s){return xr(s,e)}if(0<gs.length){xr(gs[0],e);for(var n=1;n<gs.length;n++){var r=gs[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Qt!==null&&xr(Qt,e),Gt!==null&&xr(Gt,e),Kt!==null&&xr(Kt,e),Dr.forEach(t),Or.forEach(t),n=0;n<Wt.length;n++)r=Wt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Wt.length&&(n=Wt[0],n.blockedOn===null);)od(n),n.blockedOn===null&&Wt.shift()}var Qn=$t.ReactCurrentBatchConfig,Zs=!0;function Zh(e,t,n,r){var s=ie,i=Qn.transition;Qn.transition=null;try{ie=1,Vo(e,t,n,r)}finally{ie=s,Qn.transition=i}}function ep(e,t,n,r){var s=ie,i=Qn.transition;Qn.transition=null;try{ie=4,Vo(e,t,n,r)}finally{ie=s,Qn.transition=i}}function Vo(e,t,n,r){if(Zs){var s=Vi(e,t,n,r);if(s===null)mi(e,t,r,el,n),tc(e,r);else if(Xh(s,e,t,n,r))r.stopPropagation();else if(tc(e,r),t&4&&-1<Yh.indexOf(e)){for(;s!==null;){var i=rs(s);if(i!==null&&rd(i),i=Vi(e,t,n,r),i===null&&mi(e,t,r,el,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else mi(e,t,r,null,n)}}var el=null;function Vi(e,t,n,r){if(el=null,e=qo(r),e=fn(e),e!==null)if(t=Cn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ku(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 el=e,null}function ad(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(Oh()){case Wo:return 1;case Zu:return 4;case Xs:case qh:return 16;case ed:return 536870912;default:return 16}default:return 16}}var Bt=null,Qo=null,As=null;function cd(){if(As)return As;var e,t=Qo,n=t.length,r,s="value"in Bt?Bt.value:Bt.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return As=s.slice(e,1<r?1-r:void 0)}function Fs(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 ys(){return!0}function rc(){return!1}function nt(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,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)?ys:rc,this.isPropagationStopped=rc,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=ys)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ys)},persist:function(){},isPersistent:ys}),t}var ir={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Go=nt(ir),ns=we({},ir,{view:0,detail:0}),tp=nt(ns),ri,si,gr,Sl=we({},ns,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ko,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!==gr&&(gr&&e.type==="mousemove"?(ri=e.screenX-gr.screenX,si=e.screenY-gr.screenY):si=ri=0,gr=e),ri)},movementY:function(e){return"movementY"in e?e.movementY:si}}),sc=nt(Sl),np=we({},Sl,{dataTransfer:0}),rp=nt(np),sp=we({},ns,{relatedTarget:0}),li=nt(sp),lp=we({},ir,{animationName:0,elapsedTime:0,pseudoElement:0}),ip=nt(lp),op=we({},ir,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ap=nt(op),cp=we({},ir,{data:0}),lc=nt(cp),up={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dp={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"},mp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=mp[e])?!!t[e]:!1}function Ko(){return fp}var hp=we({},ns,{key:function(e){if(e.key){var t=up[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ko,charCode:function(e){return e.type==="keypress"?Fs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pp=nt(hp),xp=we({},Sl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ic=nt(xp),gp=we({},ns,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ko}),yp=nt(gp),vp=we({},ir,{propertyName:0,elapsedTime:0,pseudoElement:0}),wp=nt(vp),kp=we({},Sl,{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}),jp=nt(kp),Np=[9,13,27,32],Yo=_t&&"CompositionEvent"in window,Tr=null;_t&&"documentMode"in document&&(Tr=document.documentMode);var bp=_t&&"TextEvent"in window&&!Tr,ud=_t&&(!Yo||Tr&&8<Tr&&11>=Tr),oc=" ",ac=!1;function dd(e,t){switch(e){case"keyup":return Np.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function md(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rn=!1;function Sp(e,t){switch(e){case"compositionend":return md(t);case"keypress":return t.which!==32?null:(ac=!0,oc);case"textInput":return e=t.data,e===oc&&ac?null:e;default:return null}}function Cp(e,t){if(Rn)return e==="compositionend"||!Yo&&dd(e,t)?(e=cd(),As=Qo=Bt=null,Rn=!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 ud&&t.locale!=="ko"?null:t.data;default:return null}}var Ep={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 cc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ep[e.type]:t==="textarea"}function fd(e,t,n,r){Hu(r),t=tl(t,"onChange"),0<t.length&&(n=new Go("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mr=null,Wr=null;function Tp(e){bd(e,0)}function Cl(e){var t=Fn(e);if(Fu(t))return e}function Mp(e,t){if(e==="change")return t}var hd=!1;if(_t){var ii;if(_t){var oi="oninput"in document;if(!oi){var uc=document.createElement("div");uc.setAttribute("oninput","return;"),oi=typeof uc.oninput=="function"}ii=oi}else ii=!1;hd=ii&&(!document.documentMode||9<document.documentMode)}function dc(){Mr&&(Mr.detachEvent("onpropertychange",pd),Wr=Mr=null)}function pd(e){if(e.propertyName==="value"&&Cl(Wr)){var t=[];fd(t,Wr,e,qo(e)),Gu(Tp,t)}}function Ip(e,t,n){e==="focusin"?(dc(),Mr=t,Wr=n,Mr.attachEvent("onpropertychange",pd)):e==="focusout"&&dc()}function zp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cl(Wr)}function Pp(e,t){if(e==="click")return Cl(t)}function Lp(e,t){if(e==="input"||e==="change")return Cl(t)}function Rp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vt=typeof Object.is=="function"?Object.is:Rp;function Hr(e,t){if(vt(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 s=n[r];if(!Ti.call(t,s)||!vt(e[s],t[s]))return!1}return!0}function mc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fc(e,t){var n=mc(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=mc(n)}}function xd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gd(){for(var e=window,t=Gs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gs(e.document)}return t}function Xo(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 _p(e){var t=gd(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&xd(n.ownerDocument.documentElement,n)){if(r!==null&&Xo(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 s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=fc(n,i);var o=fc(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.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 Ap=_t&&"documentMode"in document&&11>=document.documentMode,_n=null,Qi=null,Ir=null,Gi=!1;function hc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gi||_n==null||_n!==Gs(r)||(r=_n,"selectionStart"in r&&Xo(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}),Ir&&Hr(Ir,r)||(Ir=r,r=tl(Qi,"onSelect"),0<r.length&&(t=new Go("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=_n)))}function vs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var An={animationend:vs("Animation","AnimationEnd"),animationiteration:vs("Animation","AnimationIteration"),animationstart:vs("Animation","AnimationStart"),transitionend:vs("Transition","TransitionEnd")},ai={},yd={};_t&&(yd=document.createElement("div").style,"AnimationEvent"in window||(delete An.animationend.animation,delete An.animationiteration.animation,delete An.animationstart.animation),"TransitionEvent"in window||delete An.transitionend.transition);function El(e){if(ai[e])return ai[e];if(!An[e])return e;var t=An[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in yd)return ai[e]=t[n];return e}var vd=El("animationend"),wd=El("animationiteration"),kd=El("animationstart"),jd=El("transitionend"),Nd=new Map,pc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function rn(e,t){Nd.set(e,t),Sn(t,[e])}for(var ci=0;ci<pc.length;ci++){var ui=pc[ci],Fp=ui.toLowerCase(),Up=ui[0].toUpperCase()+ui.slice(1);rn(Fp,"on"+Up)}rn(vd,"onAnimationEnd");rn(wd,"onAnimationIteration");rn(kd,"onAnimationStart");rn("dblclick","onDoubleClick");rn("focusin","onFocus");rn("focusout","onBlur");rn(jd,"onTransitionEnd");Xn("onMouseEnter",["mouseout","mouseover"]);Xn("onMouseLeave",["mouseout","mouseover"]);Xn("onPointerEnter",["pointerout","pointerover"]);Xn("onPointerLeave",["pointerout","pointerover"]);Sn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Sn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Sn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Sn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Sn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Sn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var br="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(" "),$p=new Set("cancel close invalid load scroll toggle".split(" ").concat(br));function xc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Fh(r,t,void 0,e),e.currentTarget=null}function bd(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=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&&s.isPropagationStopped())break e;xc(s,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&&s.isPropagationStopped())break e;xc(s,a,u),i=c}}}if(Ys)throw e=Wi,Ys=!1,Wi=null,e}function me(e,t){var n=t[Zi];n===void 0&&(n=t[Zi]=new Set);var r=e+"__bubble";n.has(r)||(Sd(t,e,2,!1),n.add(r))}function di(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var ws="_reactListening"+Math.random().toString(36).slice(2);function Br(e){if(!e[ws]){e[ws]=!0,Pu.forEach(function(n){n!=="selectionchange"&&($p.has(n)||di(n,!1,e),di(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ws]||(t[ws]=!0,di("selectionchange",!1,t))}}function Sd(e,t,n,r){switch(ad(t)){case 1:var s=Zh;break;case 4:s=ep;break;default:s=Vo}n=s.bind(null,t,n,e),s=void 0,!qi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function mi(e,t,n,r,s){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===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;a!==null;){if(o=fn(a),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}a=a.parentNode}}r=r.return}Gu(function(){var u=i,h=qo(n),f=[];e:{var p=Nd.get(e);if(p!==void 0){var v=Go,y=e;switch(e){case"keypress":if(Fs(n)===0)break e;case"keydown":case"keyup":v=pp;break;case"focusin":y="focus",v=li;break;case"focusout":y="blur",v=li;break;case"beforeblur":case"afterblur":v=li;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=sc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=rp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=yp;break;case vd:case wd:case kd:v=ip;break;case jd:v=wp;break;case"scroll":v=tp;break;case"wheel":v=jp;break;case"copy":case"cut":case"paste":v=ap;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=ic}var w=(t&4)!==0,k=!w&&e==="scroll",d=w?p!==null?p+"Capture":null:p;w=[];for(var m=u,g;m!==null;){g=m;var N=g.stateNode;if(g.tag===5&&N!==null&&(g=N,d!==null&&(N=$r(m,d),N!=null&&w.push(Vr(m,N,g)))),k)break;m=m.return}0<w.length&&(p=new v(p,y,null,n,h),f.push({event:p,listeners:w}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",p&&n!==Di&&(y=n.relatedTarget||n.fromElement)&&(fn(y)||y[At]))break e;if((v||p)&&(p=h.window===h?h:(p=h.ownerDocument)?p.defaultView||p.parentWindow:window,v?(y=n.relatedTarget||n.toElement,v=u,y=y?fn(y):null,y!==null&&(k=Cn(y),y!==k||y.tag!==5&&y.tag!==6)&&(y=null)):(v=null,y=u),v!==y)){if(w=sc,N="onMouseLeave",d="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(w=ic,N="onPointerLeave",d="onPointerEnter",m="pointer"),k=v==null?p:Fn(v),g=y==null?p:Fn(y),p=new w(N,m+"leave",v,n,h),p.target=k,p.relatedTarget=g,N=null,fn(h)===u&&(w=new w(d,m+"enter",y,n,h),w.target=g,w.relatedTarget=k,N=w),k=N,v&&y)t:{for(w=v,d=y,m=0,g=w;g;g=Mn(g))m++;for(g=0,N=d;N;N=Mn(N))g++;for(;0<m-g;)w=Mn(w),m--;for(;0<g-m;)d=Mn(d),g--;for(;m--;){if(w===d||d!==null&&w===d.alternate)break t;w=Mn(w),d=Mn(d)}w=null}else w=null;v!==null&&gc(f,p,v,w,!1),y!==null&&k!==null&&gc(f,k,y,w,!0)}}e:{if(p=u?Fn(u):window,v=p.nodeName&&p.nodeName.toLowerCase(),v==="select"||v==="input"&&p.type==="file")var b=Mp;else if(cc(p))if(hd)b=Lp;else{b=zp;var M=Ip}else(v=p.nodeName)&&v.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(b=Pp);if(b&&(b=b(e,u))){fd(f,b,n,h);break e}M&&M(e,p,u),e==="focusout"&&(M=p._wrapperState)&&M.controlled&&p.type==="number"&&_i(p,"number",p.value)}switch(M=u?Fn(u):window,e){case"focusin":(cc(M)||M.contentEditable==="true")&&(_n=M,Qi=u,Ir=null);break;case"focusout":Ir=Qi=_n=null;break;case"mousedown":Gi=!0;break;case"contextmenu":case"mouseup":case"dragend":Gi=!1,hc(f,n,h);break;case"selectionchange":if(Ap)break;case"keydown":case"keyup":hc(f,n,h)}var _;if(Yo)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 Rn?dd(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(ud&&n.locale!=="ko"&&(Rn||T!=="onCompositionStart"?T==="onCompositionEnd"&&Rn&&(_=cd()):(Bt=h,Qo="value"in Bt?Bt.value:Bt.textContent,Rn=!0)),M=tl(u,T),0<M.length&&(T=new lc(T,e,null,n,h),f.push({event:T,listeners:M}),_?T.data=_:(_=md(n),_!==null&&(T.data=_)))),(_=bp?Sp(e,n):Cp(e,n))&&(u=tl(u,"onBeforeInput"),0<u.length&&(h=new lc("onBeforeInput","beforeinput",null,n,h),f.push({event:h,listeners:u}),h.data=_))}bd(f,t)})}function Vr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function tl(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=$r(e,n),i!=null&&r.unshift(Vr(e,i,s)),i=$r(e,t),i!=null&&r.push(Vr(e,i,s))),e=e.return}return r}function Mn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function gc(e,t,n,r,s){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,s?(c=$r(n,i),c!=null&&o.unshift(Vr(n,c,a))):s||(c=$r(n,i),c!=null&&o.push(Vr(n,c,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Dp=/\r\n?/g,Op=/\u0000|\uFFFD/g;function yc(e){return(typeof e=="string"?e:""+e).replace(Dp,`
38
+ `).replace(Op,"")}function ks(e,t,n){if(t=yc(t),yc(e)!==t&&n)throw Error(F(425))}function nl(){}var Ki=null,Yi=null;function Xi(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 Ji=typeof setTimeout=="function"?setTimeout:void 0,qp=typeof clearTimeout=="function"?clearTimeout:void 0,vc=typeof Promise=="function"?Promise:void 0,Wp=typeof queueMicrotask=="function"?queueMicrotask:typeof vc<"u"?function(e){return vc.resolve(null).then(e).catch(Hp)}:Ji;function Hp(e){setTimeout(function(){throw e})}function fi(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),qr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);qr(t)}function Yt(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 wc(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 or=Math.random().toString(36).slice(2),bt="__reactFiber$"+or,Qr="__reactProps$"+or,At="__reactContainer$"+or,Zi="__reactEvents$"+or,Bp="__reactListeners$"+or,Vp="__reactHandles$"+or;function fn(e){var t=e[bt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[At]||n[bt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=wc(e);e!==null;){if(n=e[bt])return n;e=wc(e)}return t}e=n,n=e.parentNode}return null}function rs(e){return e=e[bt]||e[At],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function Tl(e){return e[Qr]||null}var eo=[],Un=-1;function sn(e){return{current:e}}function fe(e){0>Un||(e.current=eo[Un],eo[Un]=null,Un--)}function ce(e,t){Un++,eo[Un]=e.current,e.current=t}var nn={},De=sn(nn),Ge=sn(!1),wn=nn;function Jn(e,t){var n=e.type.contextTypes;if(!n)return nn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ke(e){return e=e.childContextTypes,e!=null}function rl(){fe(Ge),fe(De)}function kc(e,t,n){if(De.current!==nn)throw Error(F(168));ce(De,t),ce(Ge,n)}function Cd(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(F(108,Ih(e)||"Unknown",s));return we({},n,r)}function sl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||nn,wn=De.current,ce(De,e),ce(Ge,Ge.current),!0}function jc(e,t,n){var r=e.stateNode;if(!r)throw Error(F(169));n?(e=Cd(e,t,wn),r.__reactInternalMemoizedMergedChildContext=e,fe(Ge),fe(De),ce(De,e)):fe(Ge),ce(Ge,n)}var zt=null,Ml=!1,hi=!1;function Ed(e){zt===null?zt=[e]:zt.push(e)}function Qp(e){Ml=!0,Ed(e)}function ln(){if(!hi&&zt!==null){hi=!0;var e=0,t=ie;try{var n=zt;for(ie=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}zt=null,Ml=!1}catch(s){throw zt!==null&&(zt=zt.slice(e+1)),Ju(Wo,ln),s}finally{ie=t,hi=!1}}return null}var $n=[],Dn=0,ll=null,il=0,st=[],lt=0,kn=null,Pt=1,Lt="";function dn(e,t){$n[Dn++]=il,$n[Dn++]=ll,ll=e,il=t}function Td(e,t,n){st[lt++]=Pt,st[lt++]=Lt,st[lt++]=kn,kn=e;var r=Pt;e=Lt;var s=32-gt(r)-1;r&=~(1<<s),n+=1;var i=32-gt(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Pt=1<<32-gt(t)+s|n<<s|r,Lt=i+e}else Pt=1<<i|n<<s|r,Lt=e}function Jo(e){e.return!==null&&(dn(e,1),Td(e,1,0))}function Zo(e){for(;e===ll;)ll=$n[--Dn],$n[Dn]=null,il=$n[--Dn],$n[Dn]=null;for(;e===kn;)kn=st[--lt],st[lt]=null,Lt=st[--lt],st[lt]=null,Pt=st[--lt],st[lt]=null}var Ze=null,Je=null,pe=!1,pt=null;function Md(e,t){var n=it(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 Nc(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,Ze=e,Je=Yt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ze=e,Je=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=kn!==null?{id:Pt,overflow:Lt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=it(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ze=e,Je=null,!0):!1;default:return!1}}function to(e){return(e.mode&1)!==0&&(e.flags&128)===0}function no(e){if(pe){var t=Je;if(t){var n=t;if(!Nc(e,t)){if(to(e))throw Error(F(418));t=Yt(n.nextSibling);var r=Ze;t&&Nc(e,t)?Md(r,n):(e.flags=e.flags&-4097|2,pe=!1,Ze=e)}}else{if(to(e))throw Error(F(418));e.flags=e.flags&-4097|2,pe=!1,Ze=e}}}function bc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ze=e}function js(e){if(e!==Ze)return!1;if(!pe)return bc(e),pe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Xi(e.type,e.memoizedProps)),t&&(t=Je)){if(to(e))throw Id(),Error(F(418));for(;t;)Md(e,t),t=Yt(t.nextSibling)}if(bc(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){Je=Yt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Je=null}}else Je=Ze?Yt(e.stateNode.nextSibling):null;return!0}function Id(){for(var e=Je;e;)e=Yt(e.nextSibling)}function Zn(){Je=Ze=null,pe=!1}function ea(e){pt===null?pt=[e]:pt.push(e)}var Gp=$t.ReactCurrentBatchConfig;function yr(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 s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.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 Ns(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Sc(e){var t=e._init;return t(e._payload)}function zd(e){function t(d,m){if(e){var g=d.deletions;g===null?(d.deletions=[m],d.flags|=16):g.push(m)}}function n(d,m){if(!e)return null;for(;m!==null;)t(d,m),m=m.sibling;return null}function r(d,m){for(d=new Map;m!==null;)m.key!==null?d.set(m.key,m):d.set(m.index,m),m=m.sibling;return d}function s(d,m){return d=en(d,m),d.index=0,d.sibling=null,d}function i(d,m,g){return d.index=g,e?(g=d.alternate,g!==null?(g=g.index,g<m?(d.flags|=2,m):g):(d.flags|=2,m)):(d.flags|=1048576,m)}function o(d){return e&&d.alternate===null&&(d.flags|=2),d}function a(d,m,g,N){return m===null||m.tag!==6?(m=ki(g,d.mode,N),m.return=d,m):(m=s(m,g),m.return=d,m)}function c(d,m,g,N){var b=g.type;return b===Ln?h(d,m,g.props.children,N,g.key):m!==null&&(m.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Ot&&Sc(b)===m.type)?(N=s(m,g.props),N.ref=yr(d,m,g),N.return=d,N):(N=Hs(g.type,g.key,g.props,null,d.mode,N),N.ref=yr(d,m,g),N.return=d,N)}function u(d,m,g,N){return m===null||m.tag!==4||m.stateNode.containerInfo!==g.containerInfo||m.stateNode.implementation!==g.implementation?(m=ji(g,d.mode,N),m.return=d,m):(m=s(m,g.children||[]),m.return=d,m)}function h(d,m,g,N,b){return m===null||m.tag!==7?(m=gn(g,d.mode,N,b),m.return=d,m):(m=s(m,g),m.return=d,m)}function f(d,m,g){if(typeof m=="string"&&m!==""||typeof m=="number")return m=ki(""+m,d.mode,g),m.return=d,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ms:return g=Hs(m.type,m.key,m.props,null,d.mode,g),g.ref=yr(d,null,m),g.return=d,g;case Pn:return m=ji(m,d.mode,g),m.return=d,m;case Ot:var N=m._init;return f(d,N(m._payload),g)}if(jr(m)||fr(m))return m=gn(m,d.mode,g,null),m.return=d,m;Ns(d,m)}return null}function p(d,m,g,N){var b=m!==null?m.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return b!==null?null:a(d,m,""+g,N);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ms:return g.key===b?c(d,m,g,N):null;case Pn:return g.key===b?u(d,m,g,N):null;case Ot:return b=g._init,p(d,m,b(g._payload),N)}if(jr(g)||fr(g))return b!==null?null:h(d,m,g,N,null);Ns(d,g)}return null}function v(d,m,g,N,b){if(typeof N=="string"&&N!==""||typeof N=="number")return d=d.get(g)||null,a(m,d,""+N,b);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case ms:return d=d.get(N.key===null?g:N.key)||null,c(m,d,N,b);case Pn:return d=d.get(N.key===null?g:N.key)||null,u(m,d,N,b);case Ot:var M=N._init;return v(d,m,g,M(N._payload),b)}if(jr(N)||fr(N))return d=d.get(g)||null,h(m,d,N,b,null);Ns(m,N)}return null}function y(d,m,g,N){for(var b=null,M=null,_=m,T=m=0,O=null;_!==null&&T<g.length;T++){_.index>T?(O=_,_=null):O=_.sibling;var I=p(d,_,g[T],N);if(I===null){_===null&&(_=O);break}e&&_&&I.alternate===null&&t(d,_),m=i(I,m,T),M===null?b=I:M.sibling=I,M=I,_=O}if(T===g.length)return n(d,_),pe&&dn(d,T),b;if(_===null){for(;T<g.length;T++)_=f(d,g[T],N),_!==null&&(m=i(_,m,T),M===null?b=_:M.sibling=_,M=_);return pe&&dn(d,T),b}for(_=r(d,_);T<g.length;T++)O=v(_,d,T,g[T],N),O!==null&&(e&&O.alternate!==null&&_.delete(O.key===null?T:O.key),m=i(O,m,T),M===null?b=O:M.sibling=O,M=O);return e&&_.forEach(function(C){return t(d,C)}),pe&&dn(d,T),b}function w(d,m,g,N){var b=fr(g);if(typeof b!="function")throw Error(F(150));if(g=b.call(g),g==null)throw Error(F(151));for(var M=b=null,_=m,T=m=0,O=null,I=g.next();_!==null&&!I.done;T++,I=g.next()){_.index>T?(O=_,_=null):O=_.sibling;var C=p(d,_,I.value,N);if(C===null){_===null&&(_=O);break}e&&_&&C.alternate===null&&t(d,_),m=i(C,m,T),M===null?b=C:M.sibling=C,M=C,_=O}if(I.done)return n(d,_),pe&&dn(d,T),b;if(_===null){for(;!I.done;T++,I=g.next())I=f(d,I.value,N),I!==null&&(m=i(I,m,T),M===null?b=I:M.sibling=I,M=I);return pe&&dn(d,T),b}for(_=r(d,_);!I.done;T++,I=g.next())I=v(_,d,T,I.value,N),I!==null&&(e&&I.alternate!==null&&_.delete(I.key===null?T:I.key),m=i(I,m,T),M===null?b=I:M.sibling=I,M=I);return e&&_.forEach(function(A){return t(d,A)}),pe&&dn(d,T),b}function k(d,m,g,N){if(typeof g=="object"&&g!==null&&g.type===Ln&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ms:e:{for(var b=g.key,M=m;M!==null;){if(M.key===b){if(b=g.type,b===Ln){if(M.tag===7){n(d,M.sibling),m=s(M,g.props.children),m.return=d,d=m;break e}}else if(M.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Ot&&Sc(b)===M.type){n(d,M.sibling),m=s(M,g.props),m.ref=yr(d,M,g),m.return=d,d=m;break e}n(d,M);break}else t(d,M);M=M.sibling}g.type===Ln?(m=gn(g.props.children,d.mode,N,g.key),m.return=d,d=m):(N=Hs(g.type,g.key,g.props,null,d.mode,N),N.ref=yr(d,m,g),N.return=d,d=N)}return o(d);case Pn:e:{for(M=g.key;m!==null;){if(m.key===M)if(m.tag===4&&m.stateNode.containerInfo===g.containerInfo&&m.stateNode.implementation===g.implementation){n(d,m.sibling),m=s(m,g.children||[]),m.return=d,d=m;break e}else{n(d,m);break}else t(d,m);m=m.sibling}m=ji(g,d.mode,N),m.return=d,d=m}return o(d);case Ot:return M=g._init,k(d,m,M(g._payload),N)}if(jr(g))return y(d,m,g,N);if(fr(g))return w(d,m,g,N);Ns(d,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,m!==null&&m.tag===6?(n(d,m.sibling),m=s(m,g),m.return=d,d=m):(n(d,m),m=ki(g,d.mode,N),m.return=d,d=m),o(d)):n(d,m)}return k}var er=zd(!0),Pd=zd(!1),ol=sn(null),al=null,On=null,ta=null;function na(){ta=On=al=null}function ra(e){var t=ol.current;fe(ol),e._currentValue=t}function ro(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 Gn(e,t){al=e,ta=On=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qe=!0),e.firstContext=null)}function at(e){var t=e._currentValue;if(ta!==e)if(e={context:e,memoizedValue:t,next:null},On===null){if(al===null)throw Error(F(308));On=e,al.dependencies={lanes:0,firstContext:e}}else On=On.next=e;return t}var hn=null;function sa(e){hn===null?hn=[e]:hn.push(e)}function Ld(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,sa(t)):(n.next=s.next,s.next=n),t.interleaved=n,Ft(e,r)}function Ft(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 qt=!1;function la(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rd(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 Rt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Xt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,re&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Ft(e,n)}return s=r.interleaved,s===null?(t.next=t,sa(r)):(t.next=s.next,s.next=t),r.interleaved=t,Ft(e,n)}function Us(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,Ho(e,n)}}function Cc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=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?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,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 cl(e,t,n,r){var s=e.updateQueue;qt=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=u:a.next=u,h.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;o=0,h=u=c=null,a=i;do{var p=a.lane,v=a.eventTime;if((r&p)===p){h!==null&&(h=h.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,w=a;switch(p=t,v=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){f=y.call(v,f,p);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,p=typeof y=="function"?y.call(v,f,p):y,p==null)break e;f=we({},f,p);break e;case 2:qt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[a]:p.push(a))}else v={eventTime:v,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(u=h=v,c=f):h=h.next=v,o|=p;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;p=a,a=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(h===null&&(c=f),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=h,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Nn|=o,e.lanes=o,e.memoizedState=f}}function Ec(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(F(191,s));s.call(r)}}}var ss={},Ct=sn(ss),Gr=sn(ss),Kr=sn(ss);function pn(e){if(e===ss)throw Error(F(174));return e}function ia(e,t){switch(ce(Kr,t),ce(Gr,e),ce(Ct,ss),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Fi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Fi(t,e)}fe(Ct),ce(Ct,t)}function tr(){fe(Ct),fe(Gr),fe(Kr)}function _d(e){pn(Kr.current);var t=pn(Ct.current),n=Fi(t,e.type);t!==n&&(ce(Gr,e),ce(Ct,n))}function oa(e){Gr.current===e&&(fe(Ct),fe(Gr))}var ye=sn(0);function ul(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 aa(){for(var e=0;e<pi.length;e++)pi[e]._workInProgressVersionPrimary=null;pi.length=0}var $s=$t.ReactCurrentDispatcher,xi=$t.ReactCurrentBatchConfig,jn=0,ve=null,Ce=null,Me=null,dl=!1,zr=!1,Yr=0,Kp=0;function Fe(){throw Error(F(321))}function ca(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vt(e[n],t[n]))return!1;return!0}function ua(e,t,n,r,s,i){if(jn=i,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$s.current=e===null||e.memoizedState===null?Zp:ex,e=n(r,s),zr){i=0;do{if(zr=!1,Yr=0,25<=i)throw Error(F(301));i+=1,Me=Ce=null,t.updateQueue=null,$s.current=tx,e=n(r,s)}while(zr)}if($s.current=ml,t=Ce!==null&&Ce.next!==null,jn=0,Me=Ce=ve=null,dl=!1,t)throw Error(F(300));return e}function da(){var e=Yr!==0;return Yr=0,e}function Nt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Me===null?ve.memoizedState=Me=e:Me=Me.next=e,Me}function ct(){if(Ce===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Ce.next;var t=Me===null?ve.memoizedState:Me.next;if(t!==null)Me=t,Ce=e;else{if(e===null)throw Error(F(310));Ce=e,e={memoizedState:Ce.memoizedState,baseState:Ce.baseState,baseQueue:Ce.baseQueue,queue:Ce.queue,next:null},Me===null?ve.memoizedState=Me=e:Me=Me.next=e}return Me}function Xr(e,t){return typeof t=="function"?t(e):t}function gi(e){var t=ct(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var r=Ce,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,c=null,u=i;do{var h=u.lane;if((jn&h)===h)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 f={lane:h,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=f,o=r):c=c.next=f,ve.lanes|=h,Nn|=h}u=u.next}while(u!==null&&u!==i);c===null?o=r:c.next=a,vt(r,t.memoizedState)||(Qe=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,ve.lanes|=i,Nn|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function yi(e){var t=ct(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);vt(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Ad(){}function Fd(e,t){var n=ve,r=ct(),s=t(),i=!vt(r.memoizedState,s);if(i&&(r.memoizedState=s,Qe=!0),r=r.queue,ma(Dd.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Me!==null&&Me.memoizedState.tag&1){if(n.flags|=2048,Jr(9,$d.bind(null,n,r,s,t),void 0,null),Ie===null)throw Error(F(349));jn&30||Ud(n,t,s)}return s}function Ud(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 $d(e,t,n,r){t.value=n,t.getSnapshot=r,Od(t)&&qd(e)}function Dd(e,t,n){return n(function(){Od(t)&&qd(e)})}function Od(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vt(e,n)}catch{return!0}}function qd(e){var t=Ft(e,1);t!==null&&yt(t,e,1,-1)}function Tc(e){var t=Nt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Xr,lastRenderedState:e},t.queue=e,e=e.dispatch=Jp.bind(null,ve,e),[t.memoizedState,e]}function Jr(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 Wd(){return ct().memoizedState}function Ds(e,t,n,r){var s=Nt();ve.flags|=e,s.memoizedState=Jr(1|t,n,void 0,r===void 0?null:r)}function Il(e,t,n,r){var s=ct();r=r===void 0?null:r;var i=void 0;if(Ce!==null){var o=Ce.memoizedState;if(i=o.destroy,r!==null&&ca(r,o.deps)){s.memoizedState=Jr(t,n,i,r);return}}ve.flags|=e,s.memoizedState=Jr(1|t,n,i,r)}function Mc(e,t){return Ds(8390656,8,e,t)}function ma(e,t){return Il(2048,8,e,t)}function Hd(e,t){return Il(4,2,e,t)}function Bd(e,t){return Il(4,4,e,t)}function Vd(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 Qd(e,t,n){return n=n!=null?n.concat([e]):null,Il(4,4,Vd.bind(null,t,e),n)}function fa(){}function Gd(e,t){var n=ct();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ca(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Kd(e,t){var n=ct();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ca(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Yd(e,t,n){return jn&21?(vt(n,t)||(n=td(),ve.lanes|=n,Nn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Qe=!0),e.memoizedState=n)}function Yp(e,t){var n=ie;ie=n!==0&&4>n?n:4,e(!0);var r=xi.transition;xi.transition={};try{e(!1),t()}finally{ie=n,xi.transition=r}}function Xd(){return ct().memoizedState}function Xp(e,t,n){var r=Zt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Jd(e))Zd(t,n);else if(n=Ld(e,t,n,r),n!==null){var s=qe();yt(n,e,r,s),em(n,t,r)}}function Jp(e,t,n){var r=Zt(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jd(e))Zd(t,s);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(s.hasEagerState=!0,s.eagerState=a,vt(a,o)){var c=t.interleaved;c===null?(s.next=s,sa(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=Ld(e,t,s,r),n!==null&&(s=qe(),yt(n,e,r,s),em(n,t,r))}}function Jd(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function Zd(e,t){zr=dl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function em(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ho(e,n)}}var ml={readContext:at,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},Zp={readContext:at,useCallback:function(e,t){return Nt().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:Mc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ds(4194308,4,Vd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ds(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ds(4,2,e,t)},useMemo:function(e,t){var n=Nt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Nt();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=Xp.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=Nt();return e={current:e},t.memoizedState=e},useState:Tc,useDebugValue:fa,useDeferredValue:function(e){return Nt().memoizedState=e},useTransition:function(){var e=Tc(!1),t=e[0];return e=Yp.bind(null,e[1]),Nt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,s=Nt();if(pe){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),Ie===null)throw Error(F(349));jn&30||Ud(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Mc(Dd.bind(null,r,i,e),[e]),r.flags|=2048,Jr(9,$d.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Nt(),t=Ie.identifierPrefix;if(pe){var n=Lt,r=Pt;n=(r&~(1<<32-gt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Yr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Kp++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ex={readContext:at,useCallback:Gd,useContext:at,useEffect:ma,useImperativeHandle:Qd,useInsertionEffect:Hd,useLayoutEffect:Bd,useMemo:Kd,useReducer:gi,useRef:Wd,useState:function(){return gi(Xr)},useDebugValue:fa,useDeferredValue:function(e){var t=ct();return Yd(t,Ce.memoizedState,e)},useTransition:function(){var e=gi(Xr)[0],t=ct().memoizedState;return[e,t]},useMutableSource:Ad,useSyncExternalStore:Fd,useId:Xd,unstable_isNewReconciler:!1},tx={readContext:at,useCallback:Gd,useContext:at,useEffect:ma,useImperativeHandle:Qd,useInsertionEffect:Hd,useLayoutEffect:Bd,useMemo:Kd,useReducer:yi,useRef:Wd,useState:function(){return yi(Xr)},useDebugValue:fa,useDeferredValue:function(e){var t=ct();return Ce===null?t.memoizedState=e:Yd(t,Ce.memoizedState,e)},useTransition:function(){var e=yi(Xr)[0],t=ct().memoizedState;return[e,t]},useMutableSource:Ad,useSyncExternalStore:Fd,useId:Xd,unstable_isNewReconciler:!1};function ft(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 so(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 zl={isMounted:function(e){return(e=e._reactInternals)?Cn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=qe(),s=Zt(e),i=Rt(r,s);i.payload=t,n!=null&&(i.callback=n),t=Xt(e,i,s),t!==null&&(yt(t,e,s,r),Us(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=qe(),s=Zt(e),i=Rt(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Xt(e,i,s),t!==null&&(yt(t,e,s,r),Us(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=qe(),r=Zt(e),s=Rt(n,r);s.tag=2,t!=null&&(s.callback=t),t=Xt(e,s,r),t!==null&&(yt(t,e,r,n),Us(t,e,r))}};function Ic(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Hr(n,r)||!Hr(s,i):!0}function tm(e,t,n){var r=!1,s=nn,i=t.contextType;return typeof i=="object"&&i!==null?i=at(i):(s=Ke(t)?wn:De.current,r=t.contextTypes,i=(r=r!=null)?Jn(e,s):nn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=zl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function zc(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&&zl.enqueueReplaceState(t,t.state,null)}function lo(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},la(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=at(i):(i=Ke(t)?wn:De.current,s.context=Jn(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(so(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&zl.enqueueReplaceState(s,s.state,null),cl(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function nr(e,t){try{var n="",r=t;do n+=Mh(r),r=r.return;while(r);var s=n}catch(i){s=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:s,digest:null}}function vi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function io(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var nx=typeof WeakMap=="function"?WeakMap:Map;function nm(e,t,n){n=Rt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){hl||(hl=!0,go=r),io(e,t)},n}function rm(e,t,n){n=Rt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){io(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){io(e,t),typeof r!="function"&&(Jt===null?Jt=new Set([this]):Jt.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Pc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nx;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=xx.bind(null,e,t,n),t.then(e,e))}function Lc(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 Rc(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,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=Rt(-1,1),t.tag=2,Xt(n,t,1))),n.lanes|=1),e)}var rx=$t.ReactCurrentOwner,Qe=!1;function Oe(e,t,n,r){t.child=e===null?Pd(t,null,n,r):er(t,e.child,n,r)}function _c(e,t,n,r,s){n=n.render;var i=t.ref;return Gn(t,s),r=ua(e,t,n,r,i,s),n=da(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Ut(e,t,s)):(pe&&n&&Jo(t),t.flags|=1,Oe(e,t,r,s),t.child)}function Ac(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!ka(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,sm(e,t,i,r,s)):(e=Hs(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Hr,n(o,r)&&e.ref===t.ref)return Ut(e,t,s)}return t.flags|=1,e=en(i,r),e.ref=t.ref,e.return=t,t.child=e}function sm(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Hr(i,r)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Qe=!0);else return t.lanes=e.lanes,Ut(e,t,s)}return oo(e,t,n,r,s)}function lm(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ce(Wn,Xe),Xe|=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,ce(Wn,Xe),Xe|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ce(Wn,Xe),Xe|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ce(Wn,Xe),Xe|=r;return Oe(e,t,s,n),t.child}function im(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function oo(e,t,n,r,s){var i=Ke(n)?wn:De.current;return i=Jn(t,i),Gn(t,s),n=ua(e,t,n,r,i,s),r=da(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Ut(e,t,s)):(pe&&r&&Jo(t),t.flags|=1,Oe(e,t,n,s),t.child)}function Fc(e,t,n,r,s){if(Ke(n)){var i=!0;sl(t)}else i=!1;if(Gn(t,s),t.stateNode===null)Os(e,t),tm(t,n,r),lo(t,n,r,s),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=at(u):(u=Ke(n)?wn:De.current,u=Jn(t,u));var h=n.getDerivedStateFromProps,f=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==u)&&zc(t,o,r,u),qt=!1;var p=t.memoizedState;o.state=p,cl(t,r,o,s),c=t.memoizedState,a!==r||p!==c||Ge.current||qt?(typeof h=="function"&&(so(t,n,h,r),c=t.memoizedState),(a=qt||Ic(t,n,a,r,p,c,u))?(f||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,Rd(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:ft(t.type,a),o.props=u,f=t.pendingProps,p=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=at(c):(c=Ke(n)?wn:De.current,c=Jn(t,c));var v=n.getDerivedStateFromProps;(h=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||p!==c)&&zc(t,o,r,c),qt=!1,p=t.memoizedState,o.state=p,cl(t,r,o,s);var y=t.memoizedState;a!==f||p!==y||Ge.current||qt?(typeof v=="function"&&(so(t,n,v,r),y=t.memoizedState),(u=qt||Ic(t,n,u,r,p,y,c)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,y,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,y,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),o.props=r,o.state=y,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return ao(e,t,n,r,i,s)}function ao(e,t,n,r,s,i){im(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&jc(t,n,!1),Ut(e,t,i);r=t.stateNode,rx.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=er(t,e.child,null,i),t.child=er(t,null,a,i)):Oe(e,t,a,i),t.memoizedState=r.state,s&&jc(t,n,!0),t.child}function om(e){var t=e.stateNode;t.pendingContext?kc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&kc(e,t.context,!1),ia(e,t.containerInfo)}function Uc(e,t,n,r,s){return Zn(),ea(s),t.flags|=256,Oe(e,t,n,r),t.child}var co={dehydrated:null,treeContext:null,retryLane:0};function uo(e){return{baseLanes:e,cachePool:null,transitions:null}}function am(e,t,n){var r=t.pendingProps,s=ye.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),ce(ye,s&1),e===null)return no(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=Rl(o,r,0,null),e=gn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=uo(n),t.memoizedState=co,e):ha(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return sx(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=en(s,c),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=en(a,i):(i=gn(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?uo(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=co,r}return i=e.child,e=i.sibling,r=en(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 ha(e,t){return t=Rl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function bs(e,t,n,r){return r!==null&&ea(r),er(t,e.child,null,n),e=ha(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sx(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=vi(Error(F(422))),bs(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Rl({mode:"visible",children:r.children},s,0,null),i=gn(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&er(t,e.child,null,o),t.child.memoizedState=uo(o),t.memoizedState=co,i);if(!(t.mode&1))return bs(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(F(419)),r=vi(i,r,void 0),bs(e,t,o,r)}if(a=(o&e.childLanes)!==0,Qe||a){if(r=Ie,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Ft(e,s),yt(r,e,s,-1))}return wa(),r=vi(Error(F(421))),bs(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=gx.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Je=Yt(s.nextSibling),Ze=t,pe=!0,pt=null,e!==null&&(st[lt++]=Pt,st[lt++]=Lt,st[lt++]=kn,Pt=e.id,Lt=e.overflow,kn=t),t=ha(t,r.children),t.flags|=4096,t)}function $c(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ro(e.return,t,n)}function wi(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function cm(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(Oe(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&&$c(e,n,t);else if(e.tag===19)$c(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(ce(ye,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&ul(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),wi(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ul(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}wi(t,!0,n,null,i);break;case"together":wi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Os(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ut(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Nn|=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=en(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=en(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function lx(e,t,n){switch(t.tag){case 3:om(t),Zn();break;case 5:_d(t);break;case 1:Ke(t.type)&&sl(t);break;case 4:ia(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;ce(ol,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ce(ye,ye.current&1),t.flags|=128,null):n&t.child.childLanes?am(e,t,n):(ce(ye,ye.current&1),e=Ut(e,t,n),e!==null?e.sibling:null);ce(ye,ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return cm(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ce(ye,ye.current),r)break;return null;case 22:case 23:return t.lanes=0,lm(e,t,n)}return Ut(e,t,n)}var um,mo,dm,mm;um=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(){};dm=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,pn(Ct.current);var i=null;switch(n){case"input":s=Li(e,s),r=Li(e,r),i=[];break;case"select":s=we({},s,{value:void 0}),r=we({},r,{value:void 0}),i=[];break;case"textarea":s=Ai(e,s),r=Ai(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=nl)}Ui(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Fr.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(a=s!=null?s[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"&&(Fr.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&me("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)}};mm=function(e,t,n,r){n!==r&&(t.flags|=4)};function vr(e,t){if(!pe)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 s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ix(e,t,n){var r=t.pendingProps;switch(Zo(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 Ke(t.type)&&rl(),Ue(t),null;case 3:return r=t.stateNode,tr(),fe(Ge),fe(De),aa(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(js(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pt!==null&&(wo(pt),pt=null))),mo(e,t),Ue(t),null;case 5:oa(t);var s=pn(Kr.current);if(n=t.type,e!==null&&t.stateNode!=null)dm(e,t,n,r,s),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=pn(Ct.current),js(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[bt]=t,r[Qr]=i,e=(t.mode&1)!==0,n){case"dialog":me("cancel",r),me("close",r);break;case"iframe":case"object":case"embed":me("load",r);break;case"video":case"audio":for(s=0;s<br.length;s++)me(br[s],r);break;case"source":me("error",r);break;case"img":case"image":case"link":me("error",r),me("load",r);break;case"details":me("toggle",r);break;case"input":Ga(r,i),me("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},me("invalid",r);break;case"textarea":Ya(r,i),me("invalid",r)}Ui(n,i),s=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&&ks(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&ks(r.textContent,a,e),s=["children",""+a]):Fr.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&me("scroll",r)}switch(n){case"input":fs(r),Ka(r,i,!0);break;case"textarea":fs(r),Xa(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=nl)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Du(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[bt]=t,e[Qr]=r,um(e,t,!1,!1),t.stateNode=e;e:{switch(o=$i(n,r),n){case"dialog":me("cancel",e),me("close",e),s=r;break;case"iframe":case"object":case"embed":me("load",e),s=r;break;case"video":case"audio":for(s=0;s<br.length;s++)me(br[s],e);s=r;break;case"source":me("error",e),s=r;break;case"img":case"image":case"link":me("error",e),me("load",e),s=r;break;case"details":me("toggle",e),s=r;break;case"input":Ga(e,r),s=Li(e,r),me("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=we({},r,{value:void 0}),me("invalid",e);break;case"textarea":Ya(e,r),s=Ai(e,r),me("invalid",e);break;default:s=r}Ui(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?Wu(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Ou(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ur(e,c):typeof c=="number"&&Ur(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Fr.hasOwnProperty(i)?c!=null&&i==="onScroll"&&me("scroll",e):c!=null&&Uo(e,i,c,o))}switch(n){case"input":fs(e),Ka(e,r,!1);break;case"textarea":fs(e),Xa(e);break;case"option":r.value!=null&&e.setAttribute("value",""+tn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Hn(e,!!r.multiple,i,!1):r.defaultValue!=null&&Hn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=nl)}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)mm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(F(166));if(n=pn(Kr.current),pn(Ct.current),js(t)){if(r=t.stateNode,n=t.memoizedProps,r[bt]=t,(i=r.nodeValue!==n)&&(e=Ze,e!==null))switch(e.tag){case 3:ks(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ks(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[bt]=t,t.stateNode=r}return Ue(t),null;case 13:if(fe(ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(pe&&Je!==null&&t.mode&1&&!(t.flags&128))Id(),Zn(),t.flags|=98560,i=!1;else if(i=js(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[bt]=t}else Zn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ue(t),i=!1}else pt!==null&&(wo(pt),pt=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?Ee===0&&(Ee=3):wa())),t.updateQueue!==null&&(t.flags|=4),Ue(t),null);case 4:return tr(),mo(e,t),e===null&&Br(t.stateNode.containerInfo),Ue(t),null;case 10:return ra(t.type._context),Ue(t),null;case 17:return Ke(t.type)&&rl(),Ue(t),null;case 19:if(fe(ye),i=t.memoizedState,i===null)return Ue(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)vr(i,!1);else{if(Ee!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ul(e),o!==null){for(t.flags|=128,vr(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 ce(ye,ye.current&1|2),t.child}e=e.sibling}i.tail!==null&&be()>rr&&(t.flags|=128,r=!0,vr(i,!1),t.lanes=4194304)}else{if(!r)if(e=ul(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),vr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!pe)return Ue(t),null}else 2*be()-i.renderingStartTime>rr&&n!==1073741824&&(t.flags|=128,r=!0,vr(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,ce(ye,r?n&1|2:n&1),t):(Ue(t),null);case 22:case 23:return va(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Xe&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 ox(e,t){switch(Zo(t),t.tag){case 1:return Ke(t.type)&&rl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return tr(),fe(Ge),fe(De),aa(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return oa(t),null;case 13:if(fe(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));Zn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fe(ye),null;case 4:return tr(),null;case 10:return ra(t.type._context),null;case 22:case 23:return va(),null;case 24:return null;default:return null}}var Ss=!1,$e=!1,ax=typeof WeakSet=="function"?WeakSet:Set,H=null;function qn(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 fo(e,t,n){try{n()}catch(r){ke(e,t,r)}}var Dc=!1;function cx(e,t){if(Ki=Zs,e=gd(),Xo(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 s=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,h=0,f=e,p=null;t:for(;;){for(var v;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(v=f.firstChild)!==null;)p=f,f=v;for(;;){if(f===e)break t;if(p===n&&++u===s&&(a=o),p===i&&++h===r&&(c=o),(v=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=v}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yi={focusedElem:e,selectionRange:n},Zs=!1,H=t;H!==null;)if(t=H,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,H=e;else for(;H!==null;){t=H;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,k=y.memoizedState,d=t.stateNode,m=d.getSnapshotBeforeUpdate(t.elementType===t.type?w:ft(t.type,w),k);d.__reactInternalSnapshotBeforeUpdate=m}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(N){ke(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,H=e;break}H=t.return}return y=Dc,Dc=!1,y}function Pr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&fo(t,n,i)}s=s.next}while(s!==r)}}function Pl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ho(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 fm(e){var t=e.alternate;t!==null&&(e.alternate=null,fm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bt],delete t[Qr],delete t[Zi],delete t[Bp],delete t[Vp])),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 hm(e){return e.tag===5||e.tag===3||e.tag===4}function Oc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hm(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 po(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=nl));else if(r!==4&&(e=e.child,e!==null))for(po(e,t,n),e=e.sibling;e!==null;)po(e,t,n),e=e.sibling}function xo(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(xo(e,t,n),e=e.sibling;e!==null;)xo(e,t,n),e=e.sibling}var Pe=null,ht=!1;function Dt(e,t,n){for(n=n.child;n!==null;)pm(e,t,n),n=n.sibling}function pm(e,t,n){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(bl,n)}catch{}switch(n.tag){case 5:$e||qn(n,t);case 6:var r=Pe,s=ht;Pe=null,Dt(e,t,n),Pe=r,ht=s,Pe!==null&&(ht?(e=Pe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pe.removeChild(n.stateNode));break;case 18:Pe!==null&&(ht?(e=Pe,n=n.stateNode,e.nodeType===8?fi(e.parentNode,n):e.nodeType===1&&fi(e,n),qr(e)):fi(Pe,n.stateNode));break;case 4:r=Pe,s=ht,Pe=n.stateNode.containerInfo,ht=!0,Dt(e,t,n),Pe=r,ht=s;break;case 0:case 11:case 14:case 15:if(!$e&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&fo(n,t,o),s=s.next}while(s!==r)}Dt(e,t,n);break;case 1:if(!$e&&(qn(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)}Dt(e,t,n);break;case 21:Dt(e,t,n);break;case 22:n.mode&1?($e=(r=$e)||n.memoizedState!==null,Dt(e,t,n),$e=r):Dt(e,t,n);break;default:Dt(e,t,n)}}function qc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ax),t.forEach(function(r){var s=yx.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function mt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Pe=a.stateNode,ht=!1;break e;case 3:Pe=a.stateNode.containerInfo,ht=!0;break e;case 4:Pe=a.stateNode.containerInfo,ht=!0;break e}a=a.return}if(Pe===null)throw Error(F(160));pm(i,o,s),Pe=null,ht=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){ke(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)xm(t,e),t=t.sibling}function xm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(mt(t,e),jt(e),r&4){try{Pr(3,e,e.return),Pl(3,e)}catch(w){ke(e,e.return,w)}try{Pr(5,e,e.return)}catch(w){ke(e,e.return,w)}}break;case 1:mt(t,e),jt(e),r&512&&n!==null&&qn(n,n.return);break;case 5:if(mt(t,e),jt(e),r&512&&n!==null&&qn(n,n.return),e.flags&32){var s=e.stateNode;try{Ur(s,"")}catch(w){ke(e,e.return,w)}}if(r&4&&(s=e.stateNode,s!=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&&Uu(s,i),$i(a,o);var u=$i(a,i);for(o=0;o<c.length;o+=2){var h=c[o],f=c[o+1];h==="style"?Wu(s,f):h==="dangerouslySetInnerHTML"?Ou(s,f):h==="children"?Ur(s,f):Uo(s,h,f,u)}switch(a){case"input":Ri(s,i);break;case"textarea":$u(s,i);break;case"select":var p=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var v=i.value;v!=null?Hn(s,!!i.multiple,v,!1):p!==!!i.multiple&&(i.defaultValue!=null?Hn(s,!!i.multiple,i.defaultValue,!0):Hn(s,!!i.multiple,i.multiple?[]:"",!1))}s[Qr]=i}catch(w){ke(e,e.return,w)}}break;case 6:if(mt(t,e),jt(e),r&4){if(e.stateNode===null)throw Error(F(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(w){ke(e,e.return,w)}}break;case 3:if(mt(t,e),jt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{qr(t.containerInfo)}catch(w){ke(e,e.return,w)}break;case 4:mt(t,e),jt(e);break;case 13:mt(t,e),jt(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(ga=be())),r&4&&qc(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?($e=(u=$e)||h,mt(t,e),$e=u):mt(t,e),jt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!h&&e.mode&1)for(H=e,h=e.child;h!==null;){for(f=H=h;H!==null;){switch(p=H,v=p.child,p.tag){case 0:case 11:case 14:case 15:Pr(4,p,p.return);break;case 1:qn(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(w){ke(r,n,w)}}break;case 5:qn(p,p.return);break;case 22:if(p.memoizedState!==null){Hc(f);continue}}v!==null?(v.return=p,H=v):Hc(f)}h=h.sibling}e:for(h=null,f=e;;){if(f.tag===5){if(h===null){h=f;try{s=f.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=qu("display",o))}catch(w){ke(e,e.return,w)}}}else if(f.tag===6){if(h===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(w){ke(e,e.return,w)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;h===f&&(h=null),f=f.return}h===f&&(h=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:mt(t,e),jt(e),r&4&&qc(e);break;case 21:break;default:mt(t,e),jt(e)}}function jt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(hm(n)){var r=n;break e}n=n.return}throw Error(F(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Ur(s,""),r.flags&=-33);var i=Oc(e);xo(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Oc(e);po(e,a,o);break;default:throw Error(F(161))}}catch(c){ke(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ux(e,t,n){H=e,gm(e)}function gm(e,t,n){for(var r=(e.mode&1)!==0;H!==null;){var s=H,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Ss;if(!o){var a=s.alternate,c=a!==null&&a.memoizedState!==null||$e;a=Ss;var u=$e;if(Ss=o,($e=c)&&!u)for(H=s;H!==null;)o=H,c=o.child,o.tag===22&&o.memoizedState!==null?Bc(s):c!==null?(c.return=o,H=c):Bc(s);for(;i!==null;)H=i,gm(i),i=i.sibling;H=s,Ss=a,$e=u}Wc(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,H=i):Wc(e)}}function Wc(e){for(;H!==null;){var t=H;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:$e||Pl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!$e)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:ft(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ec(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}Ec(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 h=u.memoizedState;if(h!==null){var f=h.dehydrated;f!==null&&qr(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}$e||t.flags&512&&ho(t)}catch(p){ke(t,t.return,p)}}if(t===e){H=null;break}if(n=t.sibling,n!==null){n.return=t.return,H=n;break}H=t.return}}function Hc(e){for(;H!==null;){var t=H;if(t===e){H=null;break}var n=t.sibling;if(n!==null){n.return=t.return,H=n;break}H=t.return}}function Bc(e){for(;H!==null;){var t=H;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Pl(4,t)}catch(c){ke(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){ke(t,s,c)}}var i=t.return;try{ho(t)}catch(c){ke(t,i,c)}break;case 5:var o=t.return;try{ho(t)}catch(c){ke(t,o,c)}}}catch(c){ke(t,t.return,c)}if(t===e){H=null;break}var a=t.sibling;if(a!==null){a.return=t.return,H=a;break}H=t.return}}var dx=Math.ceil,fl=$t.ReactCurrentDispatcher,pa=$t.ReactCurrentOwner,ot=$t.ReactCurrentBatchConfig,re=0,Ie=null,Se=null,Re=0,Xe=0,Wn=sn(0),Ee=0,Zr=null,Nn=0,Ll=0,xa=0,Lr=null,Ve=null,ga=0,rr=1/0,It=null,hl=!1,go=null,Jt=null,Cs=!1,Vt=null,pl=0,Rr=0,yo=null,qs=-1,Ws=0;function qe(){return re&6?be():qs!==-1?qs:qs=be()}function Zt(e){return e.mode&1?re&2&&Re!==0?Re&-Re:Gp.transition!==null?(Ws===0&&(Ws=td()),Ws):(e=ie,e!==0||(e=window.event,e=e===void 0?16:ad(e.type)),e):1}function yt(e,t,n,r){if(50<Rr)throw Rr=0,yo=null,Error(F(185));ts(e,n,r),(!(re&2)||e!==Ie)&&(e===Ie&&(!(re&2)&&(Ll|=n),Ee===4&&Ht(e,Re)),Ye(e,r),n===1&&re===0&&!(t.mode&1)&&(rr=be()+500,Ml&&ln()))}function Ye(e,t){var n=e.callbackNode;Gh(e,t);var r=Js(e,e===Ie?Re:0);if(r===0)n!==null&&ec(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ec(n),t===1)e.tag===0?Qp(Vc.bind(null,e)):Ed(Vc.bind(null,e)),Wp(function(){!(re&6)&&ln()}),n=null;else{switch(nd(r)){case 1:n=Wo;break;case 4:n=Zu;break;case 16:n=Xs;break;case 536870912:n=ed;break;default:n=Xs}n=Sm(n,ym.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ym(e,t){if(qs=-1,Ws=0,re&6)throw Error(F(327));var n=e.callbackNode;if(Kn()&&e.callbackNode!==n)return null;var r=Js(e,e===Ie?Re:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=xl(e,r);else{t=r;var s=re;re|=2;var i=wm();(Ie!==e||Re!==t)&&(It=null,rr=be()+500,xn(e,t));do try{hx();break}catch(a){vm(e,a)}while(!0);na(),fl.current=i,re=s,Se!==null?t=0:(Ie=null,Re=0,t=Ee)}if(t!==0){if(t===2&&(s=Hi(e),s!==0&&(r=s,t=vo(e,s))),t===1)throw n=Zr,xn(e,0),Ht(e,r),Ye(e,be()),n;if(t===6)Ht(e,r);else{if(s=e.current.alternate,!(r&30)&&!mx(s)&&(t=xl(e,r),t===2&&(i=Hi(e),i!==0&&(r=i,t=vo(e,i))),t===1))throw n=Zr,xn(e,0),Ht(e,r),Ye(e,be()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(F(345));case 2:mn(e,Ve,It);break;case 3:if(Ht(e,r),(r&130023424)===r&&(t=ga+500-be(),10<t)){if(Js(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){qe(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Ji(mn.bind(null,e,Ve,It),t);break}mn(e,Ve,It);break;case 4:if(Ht(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-gt(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=be()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*dx(r/1960))-r,10<r){e.timeoutHandle=Ji(mn.bind(null,e,Ve,It),r);break}mn(e,Ve,It);break;case 5:mn(e,Ve,It);break;default:throw Error(F(329))}}}return Ye(e,be()),e.callbackNode===n?ym.bind(null,e):null}function vo(e,t){var n=Lr;return e.current.memoizedState.isDehydrated&&(xn(e,t).flags|=256),e=xl(e,t),e!==2&&(t=Ve,Ve=n,t!==null&&wo(t)),e}function wo(e){Ve===null?Ve=e:Ve.push.apply(Ve,e)}function mx(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 s=n[r],i=s.getSnapshot;s=s.value;try{if(!vt(i(),s))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 Ht(e,t){for(t&=~xa,t&=~Ll,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-gt(t),r=1<<n;e[n]=-1,t&=~r}}function Vc(e){if(re&6)throw Error(F(327));Kn();var t=Js(e,0);if(!(t&1))return Ye(e,be()),null;var n=xl(e,t);if(e.tag!==0&&n===2){var r=Hi(e);r!==0&&(t=r,n=vo(e,r))}if(n===1)throw n=Zr,xn(e,0),Ht(e,t),Ye(e,be()),n;if(n===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,mn(e,Ve,It),Ye(e,be()),null}function ya(e,t){var n=re;re|=1;try{return e(t)}finally{re=n,re===0&&(rr=be()+500,Ml&&ln())}}function bn(e){Vt!==null&&Vt.tag===0&&!(re&6)&&Kn();var t=re;re|=1;var n=ot.transition,r=ie;try{if(ot.transition=null,ie=1,e)return e()}finally{ie=r,ot.transition=n,re=t,!(re&6)&&ln()}}function va(){Xe=Wn.current,fe(Wn)}function xn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,qp(n)),Se!==null)for(n=Se.return;n!==null;){var r=n;switch(Zo(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&rl();break;case 3:tr(),fe(Ge),fe(De),aa();break;case 5:oa(r);break;case 4:tr();break;case 13:fe(ye);break;case 19:fe(ye);break;case 10:ra(r.type._context);break;case 22:case 23:va()}n=n.return}if(Ie=e,Se=e=en(e.current,null),Re=Xe=t,Ee=0,Zr=null,xa=Ll=Nn=0,Ve=Lr=null,hn!==null){for(t=0;t<hn.length;t++)if(n=hn[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}hn=null}return e}function vm(e,t){do{var n=Se;try{if(na(),$s.current=ml,dl){for(var r=ve.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}dl=!1}if(jn=0,Me=Ce=ve=null,zr=!1,Yr=0,pa.current=null,n===null||n.return===null){Ee=1,Zr=t,Se=null;break}e:{var i=e,o=n.return,a=n,c=t;if(t=Re,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,h=a,f=h.tag;if(!(h.mode&1)&&(f===0||f===11||f===15)){var p=h.alternate;p?(h.updateQueue=p.updateQueue,h.memoizedState=p.memoizedState,h.lanes=p.lanes):(h.updateQueue=null,h.memoizedState=null)}var v=Lc(o);if(v!==null){v.flags&=-257,Rc(v,o,a,i,t),v.mode&1&&Pc(i,u,t),t=v,c=u;var y=t.updateQueue;if(y===null){var w=new Set;w.add(c),t.updateQueue=w}else y.add(c);break e}else{if(!(t&1)){Pc(i,u,t),wa();break e}c=Error(F(426))}}else if(pe&&a.mode&1){var k=Lc(o);if(k!==null){!(k.flags&65536)&&(k.flags|=256),Rc(k,o,a,i,t),ea(nr(c,a));break e}}i=c=nr(c,a),Ee!==4&&(Ee=2),Lr===null?Lr=[i]:Lr.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var d=nm(i,c,t);Cc(i,d);break e;case 1:a=c;var m=i.type,g=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Jt===null||!Jt.has(g)))){i.flags|=65536,t&=-t,i.lanes|=t;var N=rm(i,a,t);Cc(i,N);break e}}i=i.return}while(i!==null)}jm(n)}catch(b){t=b,Se===n&&n!==null&&(Se=n=n.return);continue}break}while(!0)}function wm(){var e=fl.current;return fl.current=ml,e===null?ml:e}function wa(){(Ee===0||Ee===3||Ee===2)&&(Ee=4),Ie===null||!(Nn&268435455)&&!(Ll&268435455)||Ht(Ie,Re)}function xl(e,t){var n=re;re|=2;var r=wm();(Ie!==e||Re!==t)&&(It=null,xn(e,t));do try{fx();break}catch(s){vm(e,s)}while(!0);if(na(),re=n,fl.current=r,Se!==null)throw Error(F(261));return Ie=null,Re=0,Ee}function fx(){for(;Se!==null;)km(Se)}function hx(){for(;Se!==null&&!$h();)km(Se)}function km(e){var t=bm(e.alternate,e,Xe);e.memoizedProps=e.pendingProps,t===null?jm(e):Se=t,pa.current=null}function jm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=ox(n,t),n!==null){n.flags&=32767,Se=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ee=6,Se=null;return}}else if(n=ix(n,t,Xe),n!==null){Se=n;return}if(t=t.sibling,t!==null){Se=t;return}Se=t=e}while(t!==null);Ee===0&&(Ee=5)}function mn(e,t,n){var r=ie,s=ot.transition;try{ot.transition=null,ie=1,px(e,t,n,r)}finally{ot.transition=s,ie=r}return null}function px(e,t,n,r){do Kn();while(Vt!==null);if(re&6)throw Error(F(327));n=e.finishedWork;var s=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(Kh(e,i),e===Ie&&(Se=Ie=null,Re=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Cs||(Cs=!0,Sm(Xs,function(){return Kn(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ot.transition,ot.transition=null;var o=ie;ie=1;var a=re;re|=4,pa.current=null,cx(e,n),xm(n,e),_p(Yi),Zs=!!Ki,Yi=Ki=null,e.current=n,ux(n),Dh(),re=a,ie=o,ot.transition=i}else e.current=n;if(Cs&&(Cs=!1,Vt=e,pl=s),i=e.pendingLanes,i===0&&(Jt=null),Wh(n.stateNode),Ye(e,be()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(hl)throw hl=!1,e=go,go=null,e;return pl&1&&e.tag!==0&&Kn(),i=e.pendingLanes,i&1?e===yo?Rr++:(Rr=0,yo=e):Rr=0,ln(),null}function Kn(){if(Vt!==null){var e=nd(pl),t=ot.transition,n=ie;try{if(ot.transition=null,ie=16>e?16:e,Vt===null)var r=!1;else{if(e=Vt,Vt=null,pl=0,re&6)throw Error(F(331));var s=re;for(re|=4,H=e.current;H!==null;){var i=H,o=i.child;if(H.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(H=u;H!==null;){var h=H;switch(h.tag){case 0:case 11:case 15:Pr(8,h,i)}var f=h.child;if(f!==null)f.return=h,H=f;else for(;H!==null;){h=H;var p=h.sibling,v=h.return;if(fm(h),h===u){H=null;break}if(p!==null){p.return=v,H=p;break}H=v}}}var y=i.alternate;if(y!==null){var w=y.child;if(w!==null){y.child=null;do{var k=w.sibling;w.sibling=null,w=k}while(w!==null)}}H=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,H=o;else e:for(;H!==null;){if(i=H,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Pr(9,i,i.return)}var d=i.sibling;if(d!==null){d.return=i.return,H=d;break e}H=i.return}}var m=e.current;for(H=m;H!==null;){o=H;var g=o.child;if(o.subtreeFlags&2064&&g!==null)g.return=o,H=g;else e:for(o=m;H!==null;){if(a=H,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Pl(9,a)}}catch(b){ke(a,a.return,b)}if(a===o){H=null;break e}var N=a.sibling;if(N!==null){N.return=a.return,H=N;break e}H=a.return}}if(re=s,ln(),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(bl,e)}catch{}r=!0}return r}finally{ie=n,ot.transition=t}}return!1}function Qc(e,t,n){t=nr(n,t),t=nm(e,t,1),e=Xt(e,t,1),t=qe(),e!==null&&(ts(e,1,t),Ye(e,t))}function ke(e,t,n){if(e.tag===3)Qc(e,e,n);else for(;t!==null;){if(t.tag===3){Qc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Jt===null||!Jt.has(r))){e=nr(n,e),e=rm(t,e,1),t=Xt(t,e,1),e=qe(),t!==null&&(ts(t,1,e),Ye(t,e));break}}t=t.return}}function xx(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=qe(),e.pingedLanes|=e.suspendedLanes&n,Ie===e&&(Re&n)===n&&(Ee===4||Ee===3&&(Re&130023424)===Re&&500>be()-ga?xn(e,0):xa|=n),Ye(e,t)}function Nm(e,t){t===0&&(e.mode&1?(t=xs,xs<<=1,!(xs&130023424)&&(xs=4194304)):t=1);var n=qe();e=Ft(e,t),e!==null&&(ts(e,t,n),Ye(e,n))}function gx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Nm(e,n)}function yx(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(F(314))}r!==null&&r.delete(t),Nm(e,n)}var bm;bm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ge.current)Qe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Qe=!1,lx(e,t,n);Qe=!!(e.flags&131072)}else Qe=!1,pe&&t.flags&1048576&&Td(t,il,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Os(e,t),e=t.pendingProps;var s=Jn(t,De.current);Gn(t,n),s=ua(null,t,r,e,s,n);var i=da();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ke(r)?(i=!0,sl(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,la(t),s.updater=zl,t.stateNode=s,s._reactInternals=t,lo(t,r,e,n),t=ao(null,t,r,!0,i,n)):(t.tag=0,pe&&i&&Jo(t),Oe(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Os(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=wx(r),e=ft(r,e),s){case 0:t=oo(null,t,r,e,n);break e;case 1:t=Fc(null,t,r,e,n);break e;case 11:t=_c(null,t,r,e,n);break e;case 14:t=Ac(null,t,r,ft(r.type,e),n);break e}throw Error(F(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ft(r,s),oo(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ft(r,s),Fc(e,t,r,s,n);case 3:e:{if(om(t),e===null)throw Error(F(387));r=t.pendingProps,i=t.memoizedState,s=i.element,Rd(e,t),cl(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){s=nr(Error(F(423)),t),t=Uc(e,t,r,n,s);break e}else if(r!==s){s=nr(Error(F(424)),t),t=Uc(e,t,r,n,s);break e}else for(Je=Yt(t.stateNode.containerInfo.firstChild),Ze=t,pe=!0,pt=null,n=Pd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Zn(),r===s){t=Ut(e,t,n);break e}Oe(e,t,r,n)}t=t.child}return t;case 5:return _d(t),e===null&&no(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Xi(r,s)?o=null:i!==null&&Xi(r,i)&&(t.flags|=32),im(e,t),Oe(e,t,o,n),t.child;case 6:return e===null&&no(t),null;case 13:return am(e,t,n);case 4:return ia(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=er(t,null,r,n):Oe(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ft(r,s),_c(e,t,r,s,n);case 7:return Oe(e,t,t.pendingProps,n),t.child;case 8:return Oe(e,t,t.pendingProps.children,n),t.child;case 12:return Oe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,ce(ol,r._currentValue),r._currentValue=o,i!==null)if(vt(i.value,o)){if(i.children===s.children&&!Ge.current){t=Ut(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=Rt(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?c.next=c:(c.next=h.next,h.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),ro(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),ro(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}Oe(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Gn(t,n),s=at(s),r=r(s),t.flags|=1,Oe(e,t,r,n),t.child;case 14:return r=t.type,s=ft(r,t.pendingProps),s=ft(r.type,s),Ac(e,t,r,s,n);case 15:return sm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ft(r,s),Os(e,t),t.tag=1,Ke(r)?(e=!0,sl(t)):e=!1,Gn(t,n),tm(t,r,s),lo(t,r,s,n),ao(null,t,r,!0,e,n);case 19:return cm(e,t,n);case 22:return lm(e,t,n)}throw Error(F(156,t.tag))};function Sm(e,t){return Ju(e,t)}function vx(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 it(e,t,n,r){return new vx(e,t,n,r)}function ka(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wx(e){if(typeof e=="function")return ka(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Do)return 11;if(e===Oo)return 14}return 2}function en(e,t){var n=e.alternate;return n===null?(n=it(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 Hs(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")ka(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ln:return gn(n.children,s,i,t);case $o:o=8,s|=8;break;case Mi:return e=it(12,n,t,s|2),e.elementType=Mi,e.lanes=i,e;case Ii:return e=it(13,n,t,s),e.elementType=Ii,e.lanes=i,e;case zi:return e=it(19,n,t,s),e.elementType=zi,e.lanes=i,e;case _u:return Rl(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Lu:o=10;break e;case Ru:o=9;break e;case Do:o=11;break e;case Oo:o=14;break e;case Ot:o=16,r=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=it(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function gn(e,t,n,r){return e=it(7,e,r,t),e.lanes=n,e}function Rl(e,t,n,r){return e=it(22,e,r,t),e.elementType=_u,e.lanes=n,e.stateNode={isHidden:!1},e}function ki(e,t,n){return e=it(6,e,null,t),e.lanes=n,e}function ji(e,t,n){return t=it(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function kx(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ni(0),this.expirationTimes=ni(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ni(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ja(e,t,n,r,s,i,o,a,c){return e=new kx(e,t,n,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=it(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},la(i),e}function jx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Pn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Cm(e){if(!e)return nn;e=e._reactInternals;e:{if(Cn(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(Ke(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(Ke(n))return Cd(e,n,t)}return t}function Em(e,t,n,r,s,i,o,a,c){return e=ja(n,r,!0,e,s,i,o,a,c),e.context=Cm(null),n=e.current,r=qe(),s=Zt(n),i=Rt(r,s),i.callback=t??null,Xt(n,i,s),e.current.lanes=s,ts(e,s,r),Ye(e,r),e}function _l(e,t,n,r){var s=t.current,i=qe(),o=Zt(s);return n=Cm(n),t.context===null?t.context=n:t.pendingContext=n,t=Rt(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Xt(s,t,o),e!==null&&(yt(e,s,o,i),Us(e,s,o)),o}function gl(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 Gc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Na(e,t){Gc(e,t),(e=e.alternate)&&Gc(e,t)}function Nx(){return null}var Tm=typeof reportError=="function"?reportError:function(e){console.error(e)};function ba(e){this._internalRoot=e}Al.prototype.render=ba.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));_l(e,t,null,null)};Al.prototype.unmount=ba.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bn(function(){_l(null,e,null,null)}),t[At]=null}};function Al(e){this._internalRoot=e}Al.prototype.unstable_scheduleHydration=function(e){if(e){var t=ld();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wt.length&&t!==0&&t<Wt[n].priority;n++);Wt.splice(n,0,e),n===0&&od(e)}};function Sa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Fl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Kc(){}function bx(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var u=gl(o);i.call(u)}}var o=Em(t,r,e,0,null,!1,!1,"",Kc);return e._reactRootContainer=o,e[At]=o.current,Br(e.nodeType===8?e.parentNode:e),bn(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var u=gl(c);a.call(u)}}var c=ja(e,0,!1,null,null,!1,!1,"",Kc);return e._reactRootContainer=c,e[At]=c.current,Br(e.nodeType===8?e.parentNode:e),bn(function(){_l(t,c,n,r)}),c}function Ul(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var c=gl(o);a.call(c)}}_l(t,o,e,s)}else o=bx(n,t,e,s,r);return gl(o)}rd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Nr(t.pendingLanes);n!==0&&(Ho(t,n|1),Ye(t,be()),!(re&6)&&(rr=be()+500,ln()))}break;case 13:bn(function(){var r=Ft(e,1);if(r!==null){var s=qe();yt(r,e,1,s)}}),Na(e,1)}};Bo=function(e){if(e.tag===13){var t=Ft(e,134217728);if(t!==null){var n=qe();yt(t,e,134217728,n)}Na(e,134217728)}};sd=function(e){if(e.tag===13){var t=Zt(e),n=Ft(e,t);if(n!==null){var r=qe();yt(n,e,t,r)}Na(e,t)}};ld=function(){return ie};id=function(e,t){var n=ie;try{return ie=e,t()}finally{ie=n}};Oi=function(e,t,n){switch(t){case"input":if(Ri(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 s=Tl(r);if(!s)throw Error(F(90));Fu(r),Ri(r,s)}}}break;case"textarea":$u(e,n);break;case"select":t=n.value,t!=null&&Hn(e,!!n.multiple,t,!1)}};Vu=ya;Qu=bn;var Sx={usingClientEntryPoint:!1,Events:[rs,Fn,Tl,Hu,Bu,ya]},wr={findFiberByHostInstance:fn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Cx={bundleType:wr.bundleType,version:wr.version,rendererPackageName:wr.rendererPackageName,rendererConfig:wr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$t.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Yu(e),e===null?null:e.stateNode},findFiberByHostInstance:wr.findFiberByHostInstance||Nx,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 Es=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Es.isDisabled&&Es.supportsFiber)try{bl=Es.inject(Cx),St=Es}catch{}}tt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Sx;tt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Sa(t))throw Error(F(200));return jx(e,t,null,n)};tt.createRoot=function(e,t){if(!Sa(e))throw Error(F(299));var n=!1,r="",s=Tm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=ja(e,1,!1,null,null,n,!1,r,s),e[At]=t.current,Br(e.nodeType===8?e.parentNode:e),new ba(t)};tt.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=Yu(t),e=e===null?null:e.stateNode,e};tt.flushSync=function(e){return bn(e)};tt.hydrate=function(e,t,n){if(!Fl(t))throw Error(F(200));return Ul(null,e,t,!0,n)};tt.hydrateRoot=function(e,t,n){if(!Sa(e))throw Error(F(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=Tm;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Em(t,null,e,1,n??null,s,!1,i,o),e[At]=t.current,Br(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Al(t)};tt.render=function(e,t,n){if(!Fl(t))throw Error(F(200));return Ul(null,e,t,!1,n)};tt.unmountComponentAtNode=function(e){if(!Fl(e))throw Error(F(40));return e._reactRootContainer?(bn(function(){Ul(null,null,e,!1,function(){e._reactRootContainer=null,e[At]=null})}),!0):!1};tt.unstable_batchedUpdates=ya;tt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Fl(n))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return Ul(e,t,n,!1,r)};tt.version="18.3.1-next-f1338f8080-20240426";function Mm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mm)}catch(e){console.error(e)}}Mm(),Mu.exports=tt;var Ae=Mu.exports,Yc=Ae;Ei.createRoot=Yc.createRoot,Ei.hydrateRoot=Yc.hydrateRoot;/**
41
+ * @license lucide-react v0.294.0 - ISC
42
+ *
43
+ * This source code is licensed under the ISC license.
44
+ * See the LICENSE file in the root directory of this source tree.
45
+ */var Ex={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
46
+ * @license lucide-react v0.294.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */const Tx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),V=(e,t)=>{const n=x.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:a="",children:c,...u},h)=>x.createElement("svg",{ref:h,...Ex,width:s,height:s,stroke:r,strokeWidth:o?Number(i)*24/Number(s):i,className:["lucide",`lucide-${Tx(e)}`,a].join(" "),...u},[...t.map(([f,p])=>x.createElement(f,p)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
51
+ * @license lucide-react v0.294.0 - ISC
52
+ *
53
+ * This source code is licensed under the ISC license.
54
+ * See the LICENSE file in the root directory of this source tree.
55
+ */const Im=V("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
56
+ * @license lucide-react v0.294.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */const ko=V("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
61
+ * @license lucide-react v0.294.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const Mx=V("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
66
+ * @license lucide-react v0.294.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const zm=V("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/**
71
+ * @license lucide-react v0.294.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const Ix=V("Award",[["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}],["path",{d:"M15.477 12.89 17 22l-5-3-5 3 1.523-9.11",key:"em7aur"}]]);/**
76
+ * @license lucide-react v0.294.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const zx=V("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
81
+ * @license lucide-react v0.294.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const Px=V("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/**
86
+ * @license lucide-react v0.294.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const Lx=V("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
91
+ * @license lucide-react v0.294.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const Rx=V("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
96
+ * @license lucide-react v0.294.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const _x=V("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
101
+ * @license lucide-react v0.294.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const _r=V("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
106
+ * @license lucide-react v0.294.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const Pm=V("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
111
+ * @license lucide-react v0.294.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const $l=V("Crown",[["path",{d:"m2 4 3 12h14l3-12-6 7-4-7-4 7-6-7zm3 16h14",key:"zkxr6b"}]]);/**
116
+ * @license lucide-react v0.294.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const yn=V("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
121
+ * @license lucide-react v0.294.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const vn=V("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
126
+ * @license lucide-react v0.294.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const Ax=V("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/**
131
+ * @license lucide-react v0.294.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const yl=V("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"}]]);/**
136
+ * @license lucide-react v0.294.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const Lm=V("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v0",key:"aigmz7"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v2",key:"1n6bmn"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v8",key:"a9iiix"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/**
141
+ * @license lucide-react v0.294.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const Fx=V("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
146
+ * @license lucide-react v0.294.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const Ux=V("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
151
+ * @license lucide-react v0.294.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const $x=V("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
156
+ * @license lucide-react v0.294.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const Dx=V("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
161
+ * @license lucide-react v0.294.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const je=V("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
166
+ * @license lucide-react v0.294.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const Rm=V("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"}]]);/**
171
+ * @license lucide-react v0.294.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const Ox=V("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
176
+ * @license lucide-react v0.294.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const qx=V("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
181
+ * @license lucide-react v0.294.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const _m=V("MessageCircle",[["path",{d:"m3 21 1.9-5.7a8.5 8.5 0 1 1 3.8 3.8z",key:"v2veuj"}]]);/**
186
+ * @license lucide-react v0.294.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const Am=V("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
191
+ * @license lucide-react v0.294.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const Wx=V("Milk",[["path",{d:"M8 2h8",key:"1ssgc1"}],["path",{d:"M9 2v2.789a4 4 0 0 1-.672 2.219l-.656.984A4 4 0 0 0 7 10.212V20a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-9.789a4 4 0 0 0-.672-2.219l-.656-.984A4 4 0 0 1 15 4.788V2",key:"qtp12x"}],["path",{d:"M7 15a6.472 6.472 0 0 1 5 0 6.47 6.47 0 0 0 5 0",key:"ygeh44"}]]);/**
196
+ * @license lucide-react v0.294.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const Fm=V("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
201
+ * @license lucide-react v0.294.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const Xc=V("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
206
+ * @license lucide-react v0.294.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const Um=V("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
211
+ * @license lucide-react v0.294.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const jo=V("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/**
216
+ * @license lucide-react v0.294.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const Hx=V("PenSquare",[["path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1qinfi"}],["path",{d:"M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",key:"w2jsv5"}]]);/**
221
+ * @license lucide-react v0.294.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const Bx=V("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]]);/**
226
+ * @license lucide-react v0.294.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const Vx=V("Pin",[["line",{x1:"12",x2:"12",y1:"17",y2:"22",key:"1jrz49"}],["path",{d:"M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z",key:"13yl11"}]]);/**
231
+ * @license lucide-react v0.294.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const No=V("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
236
+ * @license lucide-react v0.294.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const $m=V("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
241
+ * @license lucide-react v0.294.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const bo=V("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"}]]);/**
246
+ * @license lucide-react v0.294.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const Dm=V("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
251
+ * @license lucide-react v0.294.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const Om=V("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
256
+ * @license lucide-react v0.294.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const Ni=V("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
261
+ * @license lucide-react v0.294.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const qm=V("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
266
+ * @license lucide-react v0.294.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const vl=V("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
271
+ * @license lucide-react v0.294.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const So=V("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
276
+ * @license lucide-react v0.294.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const Qx=V("ShieldOff",[["path",{d:"M19.7 14a6.9 6.9 0 0 0 .3-2V5l-8-3-3.2 1.2",key:"342pvf"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M4.7 4.7 4 5v7c0 6 8 10 8 10a20.3 20.3 0 0 0 5.62-4.38",key:"p0ycf4"}]]);/**
281
+ * @license lucide-react v0.294.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const ls=V("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
286
+ * @license lucide-react v0.294.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const Gx=V("Sliders",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
291
+ * @license lucide-react v0.294.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const Wm=V("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/**
296
+ * @license lucide-react v0.294.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const Hm=V("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
301
+ * @license lucide-react v0.294.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const Kx=V("Sticker",[["path",{d:"M15.5 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V8.5L15.5 3Z",key:"1wis1t"}],["path",{d:"M15 3v6h6",key:"edgan2"}],["path",{d:"M10 16s.8 1 2 1c1.3 0 2-1 2-1",key:"1vvgv3"}],["path",{d:"M8 13h0",key:"jdup5h"}],["path",{d:"M16 13h0",key:"l4i2ga"}]]);/**
306
+ * @license lucide-react v0.294.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const Bm=V("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
311
+ * @license lucide-react v0.294.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const Bs=V("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
316
+ * @license lucide-react v0.294.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const Et=V("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
321
+ * @license lucide-react v0.294.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const Yx=V("UserMinus",[["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"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
326
+ * @license lucide-react v0.294.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const Vm=V("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
331
+ * @license lucide-react v0.294.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const Xx=V("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/**
336
+ * @license lucide-react v0.294.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const Dl=V("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"}]]);/**
341
+ * @license lucide-react v0.294.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const Jx=V("VolumeX",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
346
+ * @license lucide-react v0.294.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const Jc=V("Wifi",[["path",{d:"M5 13a10 10 0 0 1 14 0",key:"6v8j51"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/**
351
+ * @license lucide-react v0.294.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const Zx=V("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"}]]);/**
356
+ * @license lucide-react v0.294.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const wt=V("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
361
+ * @license lucide-react v0.294.0 - ISC
362
+ *
363
+ * This source code is licensed under the ISC license.
364
+ * See the LICENSE file in the root directory of this source tree.
365
+ */const e0=V("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),t0=({message:e,type:t="success",duration:n=3e3,onClose:r})=>{const[s,i]=x.useState(!0);x.useEffect(()=>{const c=setTimeout(()=>{i(!1),setTimeout(r,300)},n);return()=>clearTimeout(c)},[n,r]);const o={success:l.jsx(Lx,{className:"w-5 h-5"}),error:l.jsx(Zx,{className:"w-5 h-5"}),warning:l.jsx(Im,{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 l.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]} ${s?"translate-x-0 opacity-100":"translate-x-full opacity-0"}`,style:{minWidth:"300px",maxWidth:"500px",zIndex:99999},children:[l.jsx("div",{className:"flex-shrink-0",children:o[t]}),l.jsx("p",{className:"flex-1 text-sm font-medium",children:e}),l.jsx("button",{onClick:()=>{i(!1),setTimeout(r,300)},className:"flex-shrink-0 hover:opacity-70 transition-opacity",children:l.jsx(wt,{size:18})})]})};let n0=0;const Vs=[];let wl=[];const Qm=()=>{Vs.forEach(e=>e([...wl]))},Q=(e,t="success",n=3e3)=>{const r=n0++;wl.push({id:r,message:e,type:t,duration:n}),Qm()},Zc=()=>{const[e,t]=x.useState([]);x.useEffect(()=>{const s=i=>t(i);return Vs.push(s),()=>{const i=Vs.indexOf(s);i>-1&&Vs.splice(i,1)}},[]);const n=s=>{wl=wl.filter(i=>i.id!==s),Qm()},r=l.jsx(l.Fragment,{children:e.map((s,i)=>l.jsx("div",{style:{top:`${1+i*4.5}rem`,zIndex:99999},className:"fixed right-4",children:l.jsx(t0,{message:s.message,type:s.type,duration:s.duration,onClose:()=>n(s.id)})},s.id))});return Ae.createPortal(r,document.body)},eu=({children:e})=>{const t=x.useRef(null);return t.current||(t.current=document.createElement("div")),x.useEffect(()=>{const n=document.body,r=t.current;return n.appendChild(r),()=>{n.removeChild(r)}},[]),Ae.createPortal(e,t.current)},tu=e=>{let t;const n=new Set,r=(u,h)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const p=t;t=h??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(v=>v(t,p))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=t=e(r,s,a);return a},r0=e=>e?tu(e):tu,s0=e=>e;function l0(e,t=s0){const n=le.useSyncExternalStore(e.subscribe,le.useCallback(()=>t(e.getState()),[e,t]),le.useCallback(()=>t(e.getInitialState()),[e,t]));return le.useDebugValue(n),n}const i0=e=>{const t=r0(e),n=r=>l0(t,r);return Object.assign(n,t),n},Gm=e=>i0;function o0(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var i;const o=c=>c===null?null:JSON.parse(c,void 0),a=(i=n.getItem(s))!=null?i:null;return a instanceof Promise?a.then(o):o(a)},setItem:(s,i)=>n.setItem(s,JSON.stringify(i,void 0)),removeItem:s=>n.removeItem(s)}}const Co=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Co(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Co(r)(n)}}}},a0=(e,t)=>(n,r,s)=>{let i={storage:o0(()=>localStorage),partialize:w=>w,version:0,merge:(w,k)=>({...k,...w}),...t},o=!1;const a=new Set,c=new Set;let u=i.storage;if(!u)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...w)},r,s);const h=()=>{const w=i.partialize({...r()});return u.setItem(i.name,{state:w,version:i.version})},f=s.setState;s.setState=(w,k)=>(f(w,k),h());const p=e((...w)=>(n(...w),h()),r,s);s.getInitialState=()=>p;let v;const y=()=>{var w,k;if(!u)return;o=!1,a.forEach(m=>{var g;return m((g=r())!=null?g:p)});const d=((k=i.onRehydrateStorage)==null?void 0:k.call(i,(w=r())!=null?w:p))||void 0;return Co(u.getItem.bind(u))(i.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate){const g=i.migrate(m.state,m.version);return g instanceof Promise?g.then(N=>[!0,N]):[!0,g]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,m.state];return[!1,void 0]}).then(m=>{var g;const[N,b]=m;if(v=i.merge(b,(g=r())!=null?g:p),n(v,!0),N)return h()}).then(()=>{d==null||d(v,void 0),v=r(),o=!0,c.forEach(m=>m(v))}).catch(m=>{d==null||d(void 0,m)})};return s.persist={setOptions:w=>{i={...i,...w},w.storage&&(u=w.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>y(),hasHydrated:()=>o,onHydrate:w=>(a.add(w),()=>{a.delete(w)}),onFinishHydration:w=>(c.add(w),()=>{c.delete(w)})},i.skipHydration||y(),v||p},Km=a0,c0=Gm()(Km(e=>({isDark:!1,toggleTheme:()=>e(t=>{const n=!t.isDark;return n?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),{isDark:n}}),setTheme:t=>e(()=>(t?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),{isDark:t}))}),{name:"llbot-theme",onRehydrateStorage:()=>e=>{e!=null&&e.isDark&&document.documentElement.classList.add("dark")}})),u0=()=>{const{isDark:e,toggleTheme:t}=c0();return l.jsx("button",{onClick:t,className:`p-2 rounded-lg transition-all duration-200
366
+ text-theme-muted
367
+ hover:bg-theme-item
368
+ hover:text-theme`,title:e?"切换到亮色模式":"切换到暗黑模式",children:e?l.jsx(Bm,{size:18}):l.jsx(Fm,{size:18})})},bi=()=>{const e=x.useRef(null),t=x.useRef([]),n=x.useRef(),r=x.useRef(0);return x.useEffect(()=>{const s=e.current;if(!s)return;const i=s.getContext("2d",{alpha:!0});if(!i)return;const a=1e3/30,c=()=>{s.width=window.innerWidth,s.height=window.innerHeight,t.current.forEach(y=>{y.offscreenCanvas=h(y)})},u=["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)"],h=y=>{const w=Math.ceil(y.baseRadius*2.5),k=document.createElement("canvas");k.width=w,k.height=w;const d=k.getContext("2d");if(!d)return k;const m=w/2,g=w/2,N=y.baseRadius,b=d.createRadialGradient(m,g,0,m,g,N);return b.addColorStop(0,y.color.replace("0.6","0.8")),b.addColorStop(.5,y.color),b.addColorStop(1,y.color.replace("0.6","0")),d.fillStyle=b,d.beginPath(),d.arc(m,g,N,0,Math.PI*2),d.fill(),k},f=()=>{const y=[];for(let k=0;k<8;k++){const d=Math.random()*80+60,m={x:Math.random()*s.width,y:Math.random()*s.height,vx:(Math.random()-.5)*.8,vy:(Math.random()-.5)*.8,radius:d,baseRadius:d,scale:1,scaleSpeed:Math.random()*.002+.001,color:u[Math.floor(Math.random()*u.length)]};m.offscreenCanvas=h(m),y.push(m)}t.current=y},p=(y,w)=>{const k=w.x-y.x,d=w.y-y.y,m=Math.sqrt(k*k+d*d);if(m<y.radius+w.radius){const g=Math.atan2(d,k),N=Math.sin(g),b=Math.cos(g),M=y.vx*b+y.vy*N,_=y.vy*b-y.vx*N,T=w.vx*b+w.vy*N,O=w.vy*b-w.vx*N;y.vx=T*b-_*N,y.vy=_*b+T*N,w.vx=M*b-O*N,w.vy=O*b+M*N;const I=(y.radius+w.radius-m)/2;y.x-=I*b,y.y-=I*N,w.x+=I*b,w.y+=I*N}},v=y=>{n.current=requestAnimationFrame(v);const w=y-r.current;w<a||(r.current=y-w%a,i.clearRect(0,0,s.width,s.height),t.current.forEach((k,d)=>{k.x+=k.vx,k.y+=k.vy,k.scale+=k.scaleSpeed,(k.scale>1.2||k.scale<.8)&&(k.scaleSpeed=-k.scaleSpeed),k.radius=k.baseRadius*k.scale,(k.x-k.radius<0||k.x+k.radius>s.width)&&(k.vx=-k.vx,k.x=Math.max(k.radius,Math.min(s.width-k.radius,k.x))),(k.y-k.radius<0||k.y+k.radius>s.height)&&(k.vy=-k.vy,k.y=Math.max(k.radius,Math.min(s.height-k.radius,k.y)));for(let m=d+1;m<t.current.length;m++)p(k,t.current[m]);if(k.offscreenCanvas){const m=k.offscreenCanvas.width*k.scale;i.drawImage(k.offscreenCanvas,k.x-m/2,k.y-m/2,m,m)}}))};return c(),window.addEventListener("resize",c),f(),n.current=requestAnimationFrame(v),()=>{window.removeEventListener("resize",c),n.current&&cancelAnimationFrame(n.current)}},[]),l.jsx("canvas",{ref:e,className:"fixed inset-0 w-full h-full pointer-events-none",style:{zIndex:0}})},d0=({activeTab:e,onTabChange:t,accountInfo:n,isOpen:r=!0,onClose:s})=>{const i=[{id:"dashboard",icon:Dx,label:"Dashboard"},{id:"onebot",icon:bo,label:"OneBot 11"},{id:"satori",icon:Pm,label:"Satori"},{id:"milky",icon:Wx,label:"Milky"},{id:"logs",icon:Bs,label:"日志"},{id:"other",icon:Gx,label:"其他配置"},{id:"webqq",icon:Am,label:"WebQQ"},{id:"about",icon:$x,label:"关于"}],o=a=>{t(a),s&&window.innerWidth<768&&s()};return l.jsxs(l.Fragment,{children:[r&&l.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:s}),l.jsxs("div",{className:`
369
+ fixed md:sticky top-0 left-0 z-50
370
+ w-64 bg-theme-card backdrop-blur-2xl h-screen flex flex-col shadow-xl border-r border-theme
371
+ transform transition-transform duration-300 ease-in-out
372
+ ${r?"translate-x-0":"-translate-x-full"}
373
+ md:translate-x-0
374
+ `,children:[l.jsx("div",{className:"p-6 border-b border-theme-divider",children:l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:"w-12 h-12 rounded-2xl overflow-hidden shadow-lg flex-shrink-0",children:l.jsx("img",{src:"/logo.jpg",alt:"Logo",className:"w-full h-full object-cover"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("h1",{className:"text-xl font-bold text-theme truncate",children:"LLBot"}),l.jsx("p",{className:"text-xs text-theme-muted",children:"WebUI"})]}),l.jsx("button",{onClick:s,className:"md:hidden p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors",children:l.jsx(wt,{size:20})})]})}),l.jsx("nav",{className:"flex-1 p-4 space-y-1 overflow-y-auto",children:i.map(a=>{const c=a.icon,u=e===a.id;return l.jsxs("button",{onClick:()=>o(a.id),className:`w-full flex items-center space-x-3 px-4 py-3 rounded-2xl transition-all duration-200 ${u?"gradient-primary text-white shadow-lg scale-105":"text-theme hover:bg-theme-item-hover"}`,children:[l.jsx(c,{size:20}),l.jsx("span",{className:"font-medium",children:a.label})]},a.id)})}),l.jsx("div",{className:"p-4 border-t border-theme-divider",children:l.jsxs("div",{className:"flex items-center space-x-3 px-3 py-2",children:[n&&l.jsxs(l.Fragment,{children:[l.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:a=>{const c=a.target;c.style.display="none";const u=c.nextElementSibling;u&&(u.style.display="flex")}}),l.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()}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-theme truncate",children:n.nick}),l.jsx("p",{className:"text-xs text-theme-muted truncate",children:n.uin})]})]}),!n&&l.jsx("div",{className:"flex-1"}),l.jsx(u0,{})]})})]})]})};function m0(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),s=r.length*8,i=Math.ceil((s+65)/512)*64,o=new Uint8Array(i);o.set(r),o[r.length]=128;const a=new DataView(o.buffer);a.setUint32(i-4,s&4294967295,!1);let c=1779033703,u=3144134277,h=1013904242,f=2773480762,p=1359893119,v=2600822924,y=528734635,w=1541459225;for(let k=0;k<i;k+=64){const d=new Uint32Array(64);for(let I=0;I<16;I++)d[I]=a.getUint32(k+I*4,!1);for(let I=16;I<64;I++){const C=(d[I-15]>>>7|d[I-15]<<25)^(d[I-15]>>>18|d[I-15]<<14)^d[I-15]>>>3,A=(d[I-2]>>>17|d[I-2]<<15)^(d[I-2]>>>19|d[I-2]<<13)^d[I-2]>>>10;d[I]=d[I-16]+C+d[I-7]+A>>>0}let m=c,g=u,N=h,b=f,M=p,_=v,T=y,O=w;for(let I=0;I<64;I++){const C=(M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7),A=M&_^~M&T,j=O+C+A+t[I]+d[I]>>>0,S=(m>>>2|m<<30)^(m>>>13|m<<19)^(m>>>22|m<<10),P=m&g^m&N^g&N,U=S+P>>>0;O=T,T=_,_=M,M=b+j>>>0,b=N,N=g,g=m,m=j+U>>>0}c=c+m>>>0,u=u+g>>>0,h=h+N>>>0,f=f+b>>>0,p=p+M>>>0,v=v+_>>>0,y=y+T>>>0,w=w+O>>>0}return[c.toString(16).padStart(8,"0"),u.toString(16).padStart(8,"0"),h.toString(16).padStart(8,"0"),f.toString(16).padStart(8,"0"),p.toString(16).padStart(8,"0"),v.toString(16).padStart(8,"0"),y.toString(16).padStart(8,"0"),w.toString(16).padStart(8,"0")].join("")}async function f0(e){try{return m0(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 nu(e){return await f0(e)}function h0(e,t,n=30){const r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3);const s=`expires=${r.toUTCString()}`,o=window.location.protocol==="https:"?"; Secure":"",a=window.location.hostname,u=/^\d+\.\d+\.\d+\.\d+$/.test(a)?"":"; SameSite=Lax",h=`${e}=${t}; ${s}; path=/${u}${o}`;document.cookie=h}function Ym(e){const t=e+"=",n=document.cookie.split(";");for(let r=0;r<n.length;r++){let s=n[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return s.substring(t.length,s.length)}return console.log("[Cookie] 未找到Cookie:",{name:e,allCookies:document.cookie}),null}const Xm="webui_token",p0=30;let Sr=null;function x0(e){Sr=e}function is(){return Ym(Xm)}function ru(e){h0(Xm,e,p0)}async function Le(e,t={}){const n=async r=>{const s={...t.headers};return r&&(s["x-webui-token"]=r),fetch(e,{...t,headers:s})};try{let r=await n(is());if(r.status===401&&Sr){console.log("401 - Password not set, prompting to set password...");const s=await Sr("请设置密码");if(!s||!s.trim())throw new Error("密码不能为空");if(!(await fetch("/api/set-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:s.trim()})})).ok)throw new Error("设置密码失败");const o=await nu(s.trim());ru(o),r=await n(o)}if(r.status===403&&Sr){console.log("403 - Token verification failed, prompting for password...");let s=null;try{s=await r.clone().json()}catch{}s!=null&&s.locked&&Q(s.message||"账户已被锁定","error");let i=0;const o=5;for(;r.status===403&&i<o;)try{const a=i>0?"密码错误,请重新输入":"请输入密码",c=await Sr(a);if(!c||!c.trim())throw new Error("密码不能为空");const u=await nu(c.trim());if(ru(u),r=await n(u),r.status===200){console.log("Authentication successful!");break}try{if(s=await r.clone().json(),s!=null&&s.locked)throw new Error(s.message||"账户已被锁定")}catch{}i++}catch(a){throw console.error("Password prompt error:",a),a}if(r.status===403)throw new Error((s==null?void 0:s.message)||"认证失败")}if(!r.ok){const s=await r.text();throw new Error(`HTTP error! status: ${r.status}, message: ${s}`)}return await r.json()}catch(r){throw console.error("API fetch error:",r),r}}const g0=!1,y0=()=>({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}}),su=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",v0=e=>{const n=Math.floor(Date.now()/1e3)-e,r=Math.floor(n/86400),s=Math.floor(n%86400/3600),i=Math.floor(n%3600/60),o=n%60;return r>0?`${r}天 ${s}时 ${i}分`:s>0?`${s}时 ${i}分 ${o}秒`:i>0?`${i}分 ${o}秒`:`${o}秒`},w0=e=>e?new Date(e*1e3).toLocaleString("zh-CN"):"暂无",Ts=({icon:e,label:t,value:n,gradient:r})=>l.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:[l.jsx("div",{className:`w-10 h-10 rounded-xl ${r} flex items-center justify-center shadow-md`,children:e}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-xs text-theme-muted",children:t}),l.jsx("p",{className:"text-lg font-bold text-theme truncate",children:n})]})]}),lu=({value:e,size:t=100,strokeWidth:n=8,gradientId:r,gradientColors:s,label:i,displayValue:o,icon:a})=>{const c=(t-n)/2,u=c*2*Math.PI,h=Math.min(Math.max(e,0),100),f=u-h/100*u;return l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsxs("div",{className:"relative",style:{width:t,height:t},children:[l.jsxs("svg",{width:t,height:t,className:"transform -rotate-90",children:[l.jsx("defs",{children:l.jsxs("linearGradient",{id:r,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[l.jsx("stop",{offset:"0%",stopColor:s[0]}),l.jsx("stop",{offset:"100%",stopColor:s[1]})]})}),l.jsx("circle",{cx:t/2,cy:t/2,r:c,fill:"none",stroke:"rgba(128,128,128,0.15)",strokeWidth:n}),l.jsx("circle",{cx:t/2,cy:t/2,r:c,fill:"none",stroke:`url(#${r})`,strokeWidth:n,strokeDasharray:u,strokeDashoffset:f,strokeLinecap:"round",className:"transition-all duration-1000 ease-out"})]}),l.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[l.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center shadow-md",style:{background:`linear-gradient(135deg, ${s[0]}, ${s[1]})`},children:a}),l.jsxs("span",{className:"text-sm font-bold text-theme mt-1",children:[h.toFixed(1),"%"]})]})]}),l.jsx("p",{className:"text-xs font-semibold text-theme mt-2",children:i}),l.jsx("p",{className:"text-xs text-theme-muted",children:o})]})},iu=({title:e,version:t,icon:n,gradient:r,cpu:s,memory:i,totalMemory:o,memoryPercent:a,cpuGradientId:c,memGradientId:u,cpuColors:h,memColors:f})=>l.jsxs("div",{className:"card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx("div",{className:`w-8 h-8 rounded-lg ${r} flex items-center justify-center shadow-md`,children:n}),l.jsx("h4",{className:"text-sm font-semibold text-theme",children:e}),t&&l.jsx("span",{className:"ml-auto text-xs text-theme-muted bg-theme-item px-2 py-0.5 rounded-full",children:t})]}),l.jsxs("div",{className:"flex justify-around",children:[l.jsx(lu,{value:s,gradientId:c,gradientColors:h,label:"CPU",displayValue:`${s.toFixed(1)}%`,icon:l.jsx(Pm,{size:16,className:"text-white"})}),l.jsx(lu,{value:a,gradientId:u,gradientColors:f,label:"内存",displayValue:`${su(i)} / ${su(o)}`,icon:l.jsx(Fx,{size:16,className:"text-white"})})]})]}),k0=({llbotVersion:e,qqVersion:t})=>{const[n,r]=x.useState(null),[s,i]=x.useState(!0),[o,a]=x.useState(""),c=x.useRef(),u=async()=>{try{const h=g0?y0():(await Le("/api/dashboard/stats")).data;h&&r(h)}catch(h){console.error("Failed to fetch dashboard stats:",h)}finally{i(!1)}};return x.useEffect(()=>(u(),c.current=window.setInterval(u,5e3),()=>{c.current&&clearInterval(c.current)}),[]),x.useEffect(()=>{if(!(n!=null&&n.startupTime))return;const h=()=>a(v0(n.startupTime));h();const f=setInterval(h,1e3);return()=>clearInterval(f)},[n==null?void 0:n.startupTime]),s?l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx("div",{className:"w-12 h-12 border-4 border-pink-500 border-t-transparent rounded-full animate-spin"})}):n?l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[l.jsxs("div",{className:"card p-4 flex flex-col",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-xl gradient-primary-br flex items-center justify-center shadow-md",children:l.jsx(_r,{size:20,className:"text-white"})}),l.jsx("h3",{className:"text-base font-semibold text-theme",children:"运行时间"}),l.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:[l.jsx(e0,{size:12}),"运行中"]})]}),l.jsxs("div",{className:"flex-1 flex flex-col justify-center space-y-2",children:[l.jsxs("div",{className:"p-3 rounded-xl bg-theme-item",children:[l.jsx("p",{className:"text-xs text-theme-muted",children:"已运行"}),l.jsx("p",{className:"text-xl font-bold bg-gradient-to-r from-pink-500 to-rose-500 bg-clip-text text-transparent",children:o})]}),l.jsxs("div",{className:"px-3 py-2",children:[l.jsx("p",{className:"text-xs text-theme-muted",children:"启动时间"}),l.jsx("p",{className:"text-sm font-medium text-theme",children:w0(n.startupTime)})]})]})]}),l.jsxs("div",{className:"card p-4 space-y-3",children:[l.jsx(Ts,{icon:l.jsx(Dl,{size:20,className:"text-white"}),label:"好友数量",value:n.friendCount.toLocaleString(),gradient:"bg-gradient-to-br from-sky-500 to-blue-500"}),l.jsx(Ts,{icon:l.jsx(Xx,{size:20,className:"text-white"}),label:"群组数量",value:n.groupCount.toLocaleString(),gradient:"bg-gradient-to-br from-violet-500 to-purple-500"})]}),l.jsxs("div",{className:"card p-4 space-y-3",children:[l.jsx(Ts,{icon:l.jsx(Am,{size:20,className:"text-white"}),label:"收到消息",value:n.messageReceived.toLocaleString(),gradient:"bg-gradient-to-br from-green-500 to-emerald-500"}),l.jsx(Ts,{icon:l.jsx(vl,{size:20,className:"text-white"}),label:"发送消息",value:n.messageSent.toLocaleString(),gradient:"bg-gradient-to-br from-orange-500 to-amber-500"})]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(iu,{title:"QQ 资源",version:t,icon:l.jsx(_m,{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"]}),l.jsx(iu,{title:"LLBot 资源",version:e,icon:l.jsx(zx,{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"]})]})]}):l.jsx("div",{className:"card p-8 text-center",children:l.jsx("p",{className:"text-theme-muted",children:"无法加载统计数据"})})},Ms=72,Is=1e3,ou=10,j0=()=>{var A;const[e,t]=x.useState([]),[n,r]=x.useState(!1),[s,i]=x.useState(!0),[o,a]=x.useState(""),[c,u]=x.useState("all"),[h,f]=x.useState(!1),[p,v]=x.useState(0),y=x.useRef(null),w=x.useRef([]),k=x.useCallback(()=>{y.current&&s&&(y.current.scrollTop=y.current.scrollHeight)},[s]);x.useEffect(()=>{let j=null,S=!0;return(()=>{const U=Ym("webui_token")||"",Y=`/api/logs/stream?token=${encodeURIComponent(U)}`;j=new EventSource(Y),j.addEventListener("connected",()=>{S&&f(!0)}),j.onmessage=E=>{if(S)try{const $=JSON.parse(E.data);n?w.current.push($):t(q=>{const G=[...q,$];return G.length>Is?G.slice(-Is):G})}catch($){console.error("[LogViewer] Failed to parse log:",$)}},j.onerror=()=>{S&&f(!1)}})(),()=>{S=!1,j&&j.close()}},[n]),x.useEffect(()=>{k()},[e,k]);const d=x.useCallback(j=>{v(j.currentTarget.scrollTop)},[]),m=()=>{r(!1),t(j=>{const S=[...j,...w.current];return w.current=[],S.length>Is?S.slice(-Is):S})},g=()=>{t([]),w.current=[]},N=j=>{switch(j.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"}}},b=x.useMemo(()=>{let j=e;if(c!=="all"&&(j=j.filter(S=>S.type.toLowerCase()===c)),o){const S=o.toLowerCase();j=j.filter(P=>P.content.toLowerCase().includes(S)||P.type.toLowerCase().includes(S))}return j},[e,o,c]),M=((A=y.current)==null?void 0:A.clientHeight)||500,_=b.length*Ms,T=Math.max(0,Math.floor(p/Ms)-ou),O=Math.min(b.length,Math.ceil((p+M)/Ms)+ou),I=b.slice(T,O),C=T*Ms;return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"card p-4",children:[l.jsxs("div",{className:"hidden md:flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.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:l.jsx(Bs,{size:20,className:"text-white"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-base font-semibold text-theme",children:"实时日志"}),l.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[l.jsxs("span",{className:`flex items-center gap-1 px-2 py-0.5 rounded-full ${h?"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:[l.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${h?"bg-green-500":"bg-red-500"}`}),h?"已连接":"未连接"]}),l.jsx("span",{className:"text-theme-muted",children:n?`已暂停 (${w.current.length} 条待显示)`:`${e.length} 条日志`})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.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(j=>l.jsx("button",{onClick:()=>u(j.value),className:`px-3 py-1.5 text-xs font-medium transition-all ${c===j.value?"gradient-primary-br text-white":"bg-theme-input text-theme-secondary hover:bg-theme-item-hover"}`,children:j.label},j.value))}),l.jsx("input",{type:"text",placeholder:"搜索日志...",value:o,onChange:j=>a(j.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"}),l.jsx("button",{onClick:()=>i(!s),className:`p-2 rounded-lg transition-all ${s?"gradient-primary text-white shadow-md":"bg-theme-input text-theme-secondary hover:bg-theme-item-hover"}`,title:s?"自动滚动已开启":"自动滚动已关闭",children:l.jsx(ko,{size:18})}),l.jsx("button",{onClick:n?m:()=>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?l.jsx(No,{size:18}):l.jsx(jo,{size:18})}),l.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:l.jsx(Et,{size:18})})]})]}),l.jsxs("div",{className:"md:hidden space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.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:l.jsx(Bs,{size:20,className:"text-white"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h3",{className:"text-base font-semibold text-theme",children:"实时日志"}),l.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[l.jsxs("span",{className:`flex items-center gap-1 px-2 py-0.5 rounded-full flex-shrink-0 ${h?"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:[l.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${h?"bg-green-500":"bg-red-500"}`}),h?"已连接":"未连接"]}),l.jsx("span",{className:"text-theme-muted truncate",children:n?`已暂停 (${w.current.length} 条待显示)`:`${e.length} 条日志`})]})]})]}),l.jsx("input",{type:"text",placeholder:"搜索日志...",value:o,onChange:j=>a(j.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"}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.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(j=>l.jsx("button",{onClick:()=>u(j.value),className:`px-2 py-1.5 text-xs font-medium transition-all ${c===j.value?"gradient-primary-br text-white":"bg-theme-input text-theme-secondary hover:bg-theme-item-hover"}`,children:j.label},j.value))}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{onClick:()=>i(!s),className:`p-1.5 rounded-lg transition-all ${s?"gradient-primary text-white shadow-md":"bg-theme-input text-theme-secondary hover:bg-theme-item-hover"}`,title:s?"自动滚动已开启":"自动滚动已关闭",children:l.jsx(ko,{size:16})}),l.jsx("button",{onClick:n?m:()=>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?l.jsx(No,{size:16}):l.jsx(jo,{size:16})}),l.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:l.jsx(Et,{size:16})})]})]})]})]}),l.jsx("div",{className:"card p-4",children:l.jsx("div",{ref:y,onScroll:d,className:"h-[calc(100vh-240px)] overflow-auto pr-2",children:b.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-theme-hint",children:[l.jsx(Bs,{size:48,className:"mb-3 opacity-50"}),l.jsx("p",{className:"text-sm",children:"等待日志..."})]}):l.jsx("div",{style:{height:_,position:"relative"},children:l.jsx("div",{style:{transform:`translateY(${C}px)`},className:"space-y-1.5",children:I.map((j,S)=>{const P=N(j.type);return l.jsx("div",{className:`p-2.5 rounded-lg ${P.bg} hover:shadow-sm transition-shadow`,children:l.jsx("div",{className:"flex items-start gap-2",children:l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[l.jsx("span",{className:"text-xs text-theme-hint font-mono",children:j.dateTimeStr}),l.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded ${P.badge}`,children:j.type.toUpperCase()})]}),l.jsx("p",{className:"text-sm text-theme-secondary whitespace-pre-wrap break-all font-mono",children:j.content})]})})},`${j.timestamp}-${T+S}`)})})})})})]})},N0=({config:e,onChange:t,onSave:n,globalConfig:r})=>{const[s,i]=x.useState(null),[o,a]=x.useState(-1),[c,u]=x.useState(!1),[h,f]=x.useState(!1),[p,v]=x.useState(!1),[y,w]=x.useState(!1),[k,d]=x.useState(""),[m,g]=x.useState(!1),N={ws:{icon:bo,name:"WebSocket正向",desc:"提供WebSocket服务器"},"ws-reverse":{icon:Jc,name:"WebSocket反向",desc:"作为客户端连接到WebSocket服务"},http:{icon:yl,name:"HTTP服务",desc:"提供HTTP API服务"},"http-post":{icon:vl,name:"HTTP上报",desc:"上报事件到HTTP服务器"}},b=(j,S)=>{i(j),a(S),v(!1),w(!1),d(j.name||""),g(!1),u(!0)},M=j=>{j.stopPropagation(),w(!0)},_=()=>{if(!s)return;const j={...s,name:k.trim()};i(j),w(!1)},T=()=>{d((s==null?void 0:s.name)||""),w(!1)},O=()=>{var U;if(!s)return;if((s.type==="ws"||s.type==="http")&&!r.onlyLocalhost&&!((U=s.token)!=null&&U.trim())){Q('当"只监听本地地址"关闭时,必须设置 Token!',"error");return}let S;if(p)S=[...e.connect,s];else{if(o<0)return;S=[...e.connect],S[o]=s}const P={...e,connect:S};t(P),u(!1),v(!1),n(P)},I=()=>{if(p){u(!1),v(!1);return}if(o<0)return;const j=e.connect.filter((P,U)=>U!==o),S={...e,connect:j};t(S),u(!1),n(S)},C=j=>{const S={enable:!0,token:"",messageFormat:"array",reportSelfMessage:!1,reportOfflineMessage:!1,debug:!1};let P;switch(j){case"ws":P={...S,type:"ws",port:3001,heartInterval:6e4};break;case"ws-reverse":P={...S,type:"ws-reverse",url:"",heartInterval:6e4};break;case"http":P={...S,type:"http",port:3e3};break;case"http-post":P={...S,type:"http-post",url:"",enableHeart:!1,heartInterval:6e4};break}f(!1),i(P),a(-1),v(!0),g(!1),u(!0)},A=(j,S)=>{s&&i({...s,[j]:S})};return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"card p-6",children:l.jsxs("label",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold text-theme",children:"OneBot 11 协议"}),l.jsx("p",{className:"text-sm text-theme-secondary mt-1",children:"启用或禁用 OneBot 11 适配器"})]}),l.jsx("input",{type:"checkbox",checked:e.enable,onChange:j=>{const S={...e,enable:j.target.checked};t(S),n(S)},className:"switch-toggle-lg"})]})}),e.enable&&e.connect&&Array.isArray(e.connect)&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.connect.map((j,S)=>{const P=N[j.type],U=P.icon;return l.jsxs("div",{className:`card p-6 cursor-pointer hover:scale-105 transition-all ${j.enable?"ring-2 ring-pink-500":""}`,onClick:()=>b(j,S),children:[l.jsxs("div",{className:"flex items-start justify-between mb-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center ${j.enable?"gradient-primary-br text-white":"bg-gray-200 dark:bg-neutral-600 text-theme-secondary"}`,children:l.jsx(U,{size:24})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("h4",{className:"text-lg font-semibold text-theme",children:j.name||P.name}),l.jsx("p",{className:"text-sm text-theme-secondary",children:P.desc})]})]}),l.jsx(So,{size:20,className:"text-theme-hint"})]}),l.jsxs("div",{className:"flex items-center justify-between mt-4 pt-4 border-t border-theme-divider",children:[l.jsx("span",{className:`text-xs font-medium px-3 py-1 rounded-full ${j.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:j.enable?"已启用":"未启用"}),j.enable&&l.jsxs(l.Fragment,{children:[(j.type==="ws"||j.type==="http")&&l.jsxs("span",{className:"text-sm text-theme-secondary",children:["端口: ",j.port]}),(j.type==="ws-reverse"||j.type==="http-post")&&l.jsxs("span",{className:"text-sm text-theme-secondary truncate max-w-[180px]",title:j.url||"未配置",children:["URL: ",j.url||"未配置"]})]})]})]},S)})}),l.jsx("div",{className:"flex justify-center mt-6",children:l.jsxs("button",{onClick:()=>f(!0),className:"btn-primary flex items-center gap-2",children:[l.jsx($m,{size:20}),"添加适配器"]})})]}),c&&s&&l.jsx(eu,{children:l.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:l.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:[l.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-white/20 dark:border-neutral-700/50",children:[l.jsx("div",{className:"flex items-center gap-3 flex-1",children:y?l.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[l.jsx("input",{type:"text",value:k,onChange:j=>d(j.target.value),onKeyDown:j=>{j.key==="Enter"&&_(),j.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}),l.jsx("button",{onClick:_,className:"px-4 py-2 bg-pink-500 text-white rounded-xl hover:bg-pink-600 transition-colors",children:"确定"}),l.jsx("button",{onClick:T,className:"px-4 py-2 bg-theme-item text-theme-secondary rounded-xl hover:bg-theme-item-hover transition-colors",children:"取消"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("h3",{className:"text-xl font-semibold text-theme",children:[p?"新建 - ":"",s.name||N[s.type].name]}),l.jsx("button",{onClick:M,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:l.jsx(Bx,{size:18})})]})}),l.jsx("button",{onClick:()=>{u(!1),v(!1),w(!1)},className:"text-theme-hint hover:text-theme",children:l.jsx(wt,{size:24})})]}),l.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto flex-1",children:[l.jsx("div",{children:l.jsxs("label",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"启用此适配器"}),l.jsx("input",{type:"checkbox",checked:s.enable,onChange:j=>A("enable",j.target.checked),className:"switch-toggle"})]})}),s.type==="ws"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"端口"}),l.jsx("input",{type:"number",value:s.port,onChange:j=>A("port",parseInt(j.target.value)),className:"input-field"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"心跳间隔 (ms)"}),l.jsx("input",{type:"number",value:s.heartInterval,onChange:j=>A("heartInterval",parseInt(j.target.value)),className:"input-field"})]})]}),s.type==="ws-reverse"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"连接地址"}),l.jsx("input",{type:"text",value:s.url,onChange:j=>A("url",j.target.value),placeholder:"ws://example.com:8080",className:"input-field"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"心跳间隔 (ms)"}),l.jsx("input",{type:"number",value:s.heartInterval,onChange:j=>A("heartInterval",parseInt(j.target.value)),className:"input-field"})]})]}),s.type==="http"&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"端口"}),l.jsx("input",{type:"number",value:s.port,onChange:j=>A("port",parseInt(j.target.value)),className:"input-field"})]}),s.type==="http-post"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"上报地址"}),l.jsx("input",{type:"text",value:s.url,onChange:j=>A("url",j.target.value),placeholder:"http://example.com:8080/webhook",className:"input-field"})]}),l.jsx("div",{children:l.jsxs("label",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"启用心跳"}),l.jsx("input",{type:"checkbox",checked:s.enableHeart,onChange:j=>A("enableHeart",j.target.checked),className:"switch-toggle"})]})}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"心跳间隔 (ms)"}),l.jsx("input",{type:"number",value:s.heartInterval,onChange:j=>A("heartInterval",parseInt(j.target.value)),className:"input-field"})]})]}),l.jsxs("div",{className:"border-t border-theme-divider pt-6",children:[l.jsx("h4",{className:"text-md font-semibold text-theme mb-4",children:"通用配置"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Token"}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:m?"text":"password",value:s.token,onChange:j=>A("token",j.target.value),placeholder:"访问令牌",className:"input-field pr-12"}),l.jsx("button",{type:"button",onClick:()=>g(!m),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1",children:m?l.jsx(yn,{size:20}):l.jsx(vn,{size:20})})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"消息格式"}),l.jsxs("div",{className:"flex gap-4 text-theme-secondary",children:[l.jsxs("label",{className:"flex items-center",children:[l.jsx("input",{type:"radio",value:"array",checked:s.messageFormat==="array",onChange:j=>A("messageFormat",j.target.value),className:"mr-2"}),"消息段 (array)"]}),l.jsxs("label",{className:"flex items-center",children:[l.jsx("input",{type:"radio",value:"string",checked:s.messageFormat==="string",onChange:j=>A("messageFormat",j.target.value),className:"mr-2"}),"CQ码 (string)"]})]})]}),l.jsx("div",{children:l.jsxs("label",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"上报自己发送的消息"}),l.jsx("input",{type:"checkbox",checked:s.reportSelfMessage,onChange:j=>A("reportSelfMessage",j.target.checked),className:"switch-toggle"})]})}),l.jsx("div",{children:l.jsxs("label",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"上报离线消息"}),l.jsx("input",{type:"checkbox",checked:s.reportOfflineMessage,onChange:j=>A("reportOfflineMessage",j.target.checked),className:"switch-toggle"})]})}),l.jsx("div",{children:l.jsxs("label",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"调试模式"}),l.jsx("input",{type:"checkbox",checked:s.debug,onChange:j=>A("debug",j.target.checked),className:"switch-toggle"})]})})]})]})]}),l.jsxs("div",{className:"flex items-center justify-between p-6 border-t border-white/20 dark:border-neutral-700/50",children:[!p&&l.jsxs("button",{onClick:I,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:[l.jsx(Et,{size:18}),"删除"]}),p&&l.jsx("div",{}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{onClick:()=>u(!1),className:"px-6 py-2.5 text-theme-secondary hover:bg-theme-item rounded-xl font-medium transition-colors",children:"取消"}),l.jsx("button",{onClick:O,className:"btn-primary",children:"保存"})]})]})]})})}),h&&l.jsx(eu,{children:l.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:l.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:[l.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-white/20 dark:border-neutral-700/50",children:[l.jsx("h3",{className:"text-xl font-semibold text-theme",children:"选择适配器类型"}),l.jsx("button",{onClick:()=>f(!1),className:"text-theme-hint hover:text-theme",children:l.jsx(wt,{size:24})})]}),l.jsxs("div",{className:"p-6 space-y-3",children:[l.jsxs("button",{onClick:()=>C("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:[l.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:l.jsx(bo,{size:24})}),l.jsxs("div",{className:"text-left",children:[l.jsx("h4",{className:"text-lg font-semibold text-theme",children:"WebSocket正向"}),l.jsx("p",{className:"text-sm text-theme-secondary",children:"作为WebSocket服务器"})]})]}),l.jsxs("button",{onClick:()=>C("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:[l.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:l.jsx(Jc,{size:24})}),l.jsxs("div",{className:"text-left",children:[l.jsx("h4",{className:"text-lg font-semibold text-theme",children:"WebSocket反向"}),l.jsx("p",{className:"text-sm text-theme-secondary",children:"作为客户端连接到WebSocket服务端"})]})]}),l.jsxs("button",{onClick:()=>C("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:[l.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:l.jsx(yl,{size:24})}),l.jsxs("div",{className:"text-left",children:[l.jsx("h4",{className:"text-lg font-semibold text-theme",children:"HTTP服务"}),l.jsx("p",{className:"text-sm text-theme-secondary",children:"提供HTTP API服务"})]})]}),l.jsxs("button",{onClick:()=>C("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:[l.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:l.jsx(vl,{size:24})}),l.jsxs("div",{className:"text-left",children:[l.jsx("h4",{className:"text-lg font-semibold text-theme",children:"HTTP上报"}),l.jsx("p",{className:"text-sm text-theme-secondary",children:"上报事件到HTTP服务器"})]})]})]}),l.jsx("div",{className:"flex justify-end p-6 border-t border-white/20 dark:border-neutral-700/50",children:l.jsx("button",{onClick:()=>f(!1),className:"px-6 py-2.5 text-theme-secondary hover:bg-theme-item rounded-xl font-medium transition-colors",children:"取消"})})]})})})]})},b0=({config:e,onChange:t,onOpenChangePassword:n})=>{const r=(s,i)=>{t({...e,[s]:i})};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"card p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsx("div",{className:"w-10 h-10 rounded-xl gradient-primary-br flex items-center justify-center",children:l.jsx(yl,{size:20,className:"text-white"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold text-theme",children:"系统功能"}),l.jsx("p",{className:"text-sm text-theme-secondary",children:"基础功能开关配置"})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Ax,{size:20,className:"text-green-600"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-theme",children:"日志记录"}),l.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后记录详细的运行日志"})]})]}),l.jsx("input",{type:"checkbox",checked:e.log,onChange:s=>r("log",s.target.checked),className:"switch-toggle"})]}),l.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(yl,{size:20,className:"text-pink-500"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-theme",children:"只监听本地地址"}),l.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"取消后可能会暴露在公网"})]})]}),l.jsx("input",{type:"checkbox",checked:e.onlyLocalhost,onChange:s=>r("onlyLocalhost",s.target.checked),className:"switch-toggle"})]}),l.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Um,{size:20,className:"text-pink-500"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-theme",children:"本地文件转URL"}),l.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后可将本地文件转换为URL链接"})]})]}),l.jsx("input",{type:"checkbox",checked:e.enableLocalFile2Url,onChange:s=>r("enableLocalFile2Url",s.target.checked),className:"switch-toggle"})]})]})]}),l.jsxs("div",{className:"card p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.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:l.jsx(Et,{size:20,className:"text-white"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold text-theme",children:"文件管理"}),l.jsx("p",{className:"text-sm text-theme-secondary",children:"自动清理文件相关配置"})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Et,{size:20,className:"text-red-600"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-theme",children:"自动删除收到的文件"}),l.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后将自动清理接收的临时文件"})]})]}),l.jsx("input",{type:"checkbox",checked:e.autoDeleteFile,onChange:s=>r("autoDeleteFile",s.target.checked),className:"switch-toggle"})]}),e.autoDeleteFile&&l.jsx("div",{className:"pl-4",children:l.jsxs("label",{className:"block",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(_r,{size:16,className:"text-theme-secondary"}),l.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"自动删除时间(秒)"})]}),l.jsx("input",{type:"number",value:e.autoDeleteFileSecond,onChange:s=>r("autoDeleteFileSecond",parseInt(s.target.value)),min:"1",max:"3600",className:"input-field",placeholder:"60"}),l.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"文件接收后多少秒自动删除(1-3600秒)"})]})})]})]}),l.jsxs("div",{className:"card p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.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:l.jsx(_r,{size:20,className:"text-white"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold text-theme",children:"缓存设置"}),l.jsx("p",{className:"text-sm text-theme-secondary",children:"消息缓存相关配置"})]})]}),l.jsxs("label",{className:"block",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(_r,{size:16,className:"text-pink-500"}),l.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"消息缓存过期时间(秒)"})]}),l.jsx("input",{type:"number",value:e.msgCacheExpire,onChange:s=>r("msgCacheExpire",parseInt(s.target.value)),min:"1",max:"86400",className:"input-field",placeholder:"3600"}),l.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"消息在缓存中保留的时间(1-86400秒)"})]})]}),l.jsxs("div",{className:"card p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.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:l.jsx(Xc,{size:20,className:"text-white"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold text-theme",children:"扩展功能"}),l.jsx("p",{className:"text-sm text-theme-secondary",children:"第三方服务配置"})]})]}),l.jsxs("label",{className:"block",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Xc,{size:16,className:"text-green-600"}),l.jsx("span",{className:"text-sm font-medium text-theme-secondary",children:"音乐签名地址"})]}),l.jsx("input",{type:"text",value:e.musicSignUrl,onChange:s=>r("musicSignUrl",s.target.value),placeholder:"https://example.com/sign",className:"input-field"}),l.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"用于音乐卡片签名的服务地址"})]})]}),l.jsxs("div",{className:"card p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.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:l.jsx(ls,{size:20,className:"text-white"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold text-theme",children:"安全设置"}),l.jsx("p",{className:"text-sm text-theme-secondary",children:"WebUI 访问控制"})]})]}),l.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl bg-item-hover transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Rm,{size:20,className:"text-red-600"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-theme",children:"WebUI 访问密码"}),l.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"用于保护 WebUI 访问的密码"})]})]}),l.jsxs("button",{onClick:n,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:[l.jsx(Hx,{size:16}),"修改密码"]})]})]})]})};function Jm(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 S0=({visible:e,onClose:t,onSuccess:n})=>{const[r,s]=x.useState(""),[i,o]=x.useState(""),[a,c]=x.useState(!1),[u,h]=x.useState(!1),[f,p]=x.useState(!1),[v,y]=x.useState(""),w=x.useRef(null);x.useEffect(()=>{e&&w.current&&setTimeout(()=>{var m;return(m=w.current)==null?void 0:m.focus()},100)},[e]),x.useEffect(()=>{e&&(s(""),o(""),c(!1),h(!1),y(""))},[e]);const k=async()=>{const m=Jm(r,6);if(!m.isValid){y(m.error||"密码验证失败");return}if(r!==i){y("两次输入的密码不一致");return}p(!0),y("");try{const g=await Le("/api/set-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r})});g.success?(Q("密码修改成功","success"),n(),t()):y(g.message||"密码修改失败")}catch(g){y(g.message||"密码修改失败")}finally{p(!1)}},d=m=>{m.key==="Enter"&&k()};return e?l.jsx(l.Fragment,{children:l.jsx("div",{className:"fixed inset-0 bg-black/30 backdrop-blur-sm flex items-center justify-center p-4",style:{zIndex:9e3},onClick:m=>m.target===m.currentTarget&&t(),children:l.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:[l.jsxs("div",{className:"flex items-center gap-3 p-6 border-b border-white/20 dark:border-neutral-700/50",children:[l.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:l.jsx(Rm,{size:20,className:"text-white"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("h3",{className:"text-xl font-semibold text-theme",children:"修改 WebUI 密码"}),l.jsx("p",{className:"text-sm text-theme-secondary mt-0.5",children:"请输入新密码"})]}),l.jsx("button",{onClick:t,className:"text-theme-hint hover:text-theme transition-colors",children:l.jsx(wt,{size:24})})]}),l.jsxs("div",{className:"p-6 space-y-4",children:[v&&l.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}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"新密码"}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{ref:w,type:a?"text":"password",value:r,onChange:m=>{s(m.target.value),y("")},onKeyPress:d,placeholder:"请输入新密码(支持数字、字母、符号)",className:"input-field pr-12",autoComplete:"new-password"}),l.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?l.jsx(yn,{size:20}):l.jsx(vn,{size:20})})]}),l.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"密码长度至少6位"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"确认密码"}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:u?"text":"password",value:i,onChange:m=>{o(m.target.value),y("")},onKeyPress:d,placeholder:"请再次输入新密码",className:"input-field pr-12",autoComplete:"new-password"}),l.jsx("button",{type:"button",onClick:()=>h(!u),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors",children:u?l.jsx(yn,{size:20}):l.jsx(vn,{size:20})})]})]})]}),l.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-white/20 dark:border-neutral-700/50",children:[l.jsx("button",{onClick:t,disabled:f,className:"px-6 py-2.5 text-theme-secondary hover:bg-theme-item rounded-lg font-medium transition-colors disabled:opacity-50",children:"取消"}),l.jsx("button",{onClick:k,disabled:f||!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:f?"修改中...":"确定修改"})]})]})})}):null},Si=({visible:e,onConfirm:t,onClose:n,error:r})=>{const[s,i]=x.useState(""),[o,a]=x.useState(!1),[c,u]=x.useState(""),h=x.useRef(null);x.useEffect(()=>{e&&h.current&&setTimeout(()=>{var v;return(v=h.current)==null?void 0:v.focus()},100)},[e]),x.useEffect(()=>{e&&(i(""),a(!1),u(""))},[e]);const f=()=>{const v=Jm(s);if(!v.isValid){u(v.error||"密码验证失败");return}u(""),t(s.trim())},p=v=>{v.key==="Enter"&&f()};return x.useEffect(()=>{if(!e)return;const v=y=>{y.key==="Escape"&&(y.preventDefault(),y.stopPropagation())};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[e]),e?l.jsx(l.Fragment,{children:l.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:l.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:[l.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-white/20 dark:border-neutral-700/50",children:[l.jsx("h3",{className:"text-xl font-semibold text-theme",children:r||"WebUI 密码"}),n&&l.jsx("button",{onClick:n,className:"text-theme-hint hover:text-theme transition-colors",children:l.jsx(wt,{size:24})})]}),l.jsx("div",{className:"p-6",children:l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"relative",children:[l.jsx("input",{ref:h,type:o?"text":"password",value:s,onChange:v=>{i(v.target.value),c&&u("")},onKeyPress:p,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"}),l.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?l.jsx(yn,{size:20}):l.jsx(vn,{size:20})})]}),c&&l.jsx("p",{className:"text-sm text-red-500 px-1",children:c})]})}),l.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-white/20 dark:border-neutral-700/50",children:[n&&l.jsx("button",{onClick:n,className:"px-6 py-2.5 text-theme-secondary hover:bg-theme-item rounded-lg font-medium transition-colors",children:"取消"}),l.jsx("button",{onClick:f,disabled:!s.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},C0=({onLoginSuccess:e})=>{const[t,n]=x.useState("quick"),[r,s]=x.useState(!1),[i,o]=x.useState(!1),[a,c]=x.useState(!1),[u,h]=x.useState(""),[f,p]=x.useState([]),[v,y]=x.useState(null),w=x.useRef(null),k=x.useRef(null),d=x.useRef(null),m=x.useRef(!1),g=x.useRef(!1),N={scanning:"扫描成功,请在手机上确认",success:"登录成功",expired:"二维码已过期,请刷新",error:"登录失败,请重试","":""},b=x.useCallback(()=>{m.current=!1,d.current&&(clearTimeout(d.current),d.current=null)},[]),M=x.useCallback(async()=>{if(m.current)return;m.current=!0;const S=60;let P=0;const U=async()=>{if(P>=S){b(),Q("登录超时,请重试","error"),t==="qr"&&h("error");return}P++;try{const Y=await Le("/api/login-info");if(Y.success&&Y.data.online===!0){b(),Q("登录成功!正在跳转到主页面...","success"),t==="qr"&&h("success"),setTimeout(()=>e(),1e3);return}d.current=setTimeout(U,3e3)}catch{d.current=setTimeout(U,3e3)}};await U()},[t,e,b]),_=x.useCallback(S=>{if(!w.current)return;const U=w.current.getContext("2d");if(!U)return;const Y=new Image;Y.onload=()=>{U.clearRect(0,0,200,200),U.drawImage(Y,0,0,200,200)},Y.src=S},[]),T=x.useCallback(async()=>{if(w.current)try{const S=await Le("/api/login-qrcode");if(S.success&&S.data){_(S.data.pngBase64QrcodeData);const P=S.data.expireTime*1e3;k.current&&clearInterval(k.current),k.current=setTimeout(()=>{c(!0),h("expired"),b()},P),c(!1),h(""),Q("请使用手机QQ扫码登录","warning"),await M()}else throw new Error(S.message||"获取二维码失败")}catch(S){Q(S.message||"获取二维码失败","error")}},[_,M,b]),O=x.useCallback(async()=>{await T(),Q("二维码已刷新","success")},[T]),I=x.useCallback(async()=>{if(!g.current){g.current=!0;try{const S=await Le("/api/quick-login-list");if(S.success&&S.data&&S.data.LocalLoginInfoList){const P=S.data.LocalLoginInfoList.filter(U=>U.isQuickLogin&&!U.isUserLogin);p(P),P.length>0?y(U=>U??P[0]):n("qr")}else p([])}catch{Q("获取快速登录列表失败","error"),p([])}}},[]),C=x.useCallback(async()=>{if(v){o(!0);try{const P=(await Le("/api/quick-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uin:v.uin})})).data;if(P.result==="0")Q(`正在登录 ${v.nickName}...`,"success"),await M();else throw new Error(P.loginErrorInfo.errMsg||"登录失败")}catch(S){Q(S.message,"error"),n("qr")}finally{o(!1)}}},[v,M]),A=()=>s(!r),j=S=>{y(S),s(!1)};return x.useEffect(()=>(g.current||I(),()=>{k.current&&clearInterval(k.current),b()}),[]),x.useEffect(()=>{t==="qr"?setTimeout(()=>T(),100):k.current&&clearInterval(k.current),t==="quick"&&f.length===0&&!g.current&&I()},[t,f.length,T]),l.jsx("div",{className:"relative min-h-screen flex flex-col items-center justify-center p-5",children:l.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"&&l.jsxs("div",{className:"flex flex-col items-center gap-6",children:[!r&&v&&l.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:A,children:[l.jsx("div",{className:"w-20 h-20 rounded-full overflow-hidden mb-3 shadow-lg",children:l.jsx("img",{src:v.faceUrl,alt:v.nickName,className:"w-full h-full object-cover"})}),l.jsx("div",{className:"text-base text-theme mb-2",children:v.nickName})]}),r&&l.jsx("div",{className:"grid grid-cols-2 gap-4 my-5 w-full max-w-md",children:f.map(S=>l.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:()=>j(S),children:[l.jsx("div",{className:"w-[60px] h-[60px] rounded-full overflow-hidden mb-2 shadow-md",children:l.jsx("img",{src:S.faceUrl,alt:S.nickName,className:"w-full h-full object-cover"})}),l.jsx("div",{className:"text-sm text-theme text-center truncate w-full px-1",children:S.nickName})]},S.uin))}),!r&&l.jsx("button",{onClick:C,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?l.jsxs(l.Fragment,{children:[l.jsx(je,{size:20,className:"animate-spin"}),"登录中..."]}):"登录"}),l.jsxs("div",{className:"flex gap-6 justify-center",children:[!r&&l.jsx("button",{onClick:A,className:"text-pink-500 text-sm hover:underline",children:"切换账号"}),l.jsx("button",{onClick:()=>n("qr"),className:"text-pink-500 text-sm hover:underline",children:"扫码登录"})]})]}),t==="qr"&&l.jsxs("div",{className:"flex flex-col items-center gap-5",children:[l.jsx("div",{className:"relative inline-block",children:l.jsxs("div",{className:"relative p-5 bg-white rounded-2xl shadow-lg",children:[l.jsx("canvas",{ref:w,width:"200",height:"200",className:"block rounded-lg"}),a&&l.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:[l.jsx(Dm,{size:32,className:"mb-2"}),l.jsx("div",{children:"点击刷新"})]})]})}),l.jsx("div",{className:"text-theme-secondary",children:"请使用手机QQ扫码登录"}),u&&l.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:N[u]})]}),l.jsx("div",{className:"mt-6",children:t==="qr"&&f.length>0&&l.jsx("button",{onClick:()=>n("quick"),className:"text-pink-500 text-sm hover:underline",children:"快速登录"})})]})})};let Zm=null,ef=null;function tf(e,t){Zm=e,ef=t}function os(){return Zm}function Ca(){return ef}function Ea(e){return`https://q1.qlogo.cn/g?b=qq&nk=${e}&s=640`}function Ol(e){return`https://p.qlogo.cn/gh/${e}/${e}/640/`}async function nf(){const e=await Le("/api/login-info");if(!e.success)throw new Error(e.message||"获取登录信息失败");const t=e.data;return tf(t.uid,t.uin),t}async function Eo(){const e=await se("ntFriendApi","getBuddyV2",[!0]),t=await se("ntFriendApi","getBuddyList",[]),n=new Map;for(const s of t)n.set(s.uid,s);const r=(e.data||[]).map(s=>{const i=(s.buddyUids||[]).map(o=>n.get(o)).filter(o=>o).map(o=>{var a,c,u;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:Ea(o.uin),online:((u=o.status)==null?void 0:u.status)===10||!1}});return{categoryId:s.categoryId,categoryName:s.categroyName||"我的好友",categorySort:s.categorySortId,onlineCount:s.onlineCount||0,memberCount:s.categroyMbCount||i.length,friends:i}});return r.sort((s,i)=>s.categorySort-i.categorySort),r}async function To(){return(await se("ntGroupApi","getGroups",[!1])).map(t=>({groupCode:t.groupCode,groupName:t.groupName,remarkName:t.remarkName||"",avatar:Ol(t.groupCode),memberCount:t.memberCount}))}async function Mo(){return(await se("ntUserApi","getRecentContactListSnapShot",[50])).info.changedList.filter(t=>{const n=t.peerUin||t.peerUid;return n&&n!=="0"&&n!==""}).map(t=>{const n=t.chatType,r=n===2,s=r?t.peerUin||t.peerUid:t.peerUin;return{chatType:n,peerId:s,peerName:t.peerName||t.remark||t.peerUin,peerAvatar:r?Ol(s):Ea(t.peerUin),lastMessage:E0(t.abstractContent),lastTime:parseInt(t.msgTime)*1e3,unreadCount:parseInt(t.unreadCnt)||0}}).sort((t,n)=>n.lastTime-t.lastTime)}function E0(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 Qs(e,t,n,r=20,s){const i=new URLSearchParams({chatType:String(e),peerId:t,limit:r.toString()});n&&i.append("beforeMsgSeq",n),s&&i.append("afterMsgSeq",s);const o=await Le(`/api/webqq/messages?${i}`);if(!o.success)throw new Error(o.message||"获取消息历史失败");return o.data||{messages:[],hasMore:!1}}async function Io(e){const t=await Le("/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 rf(e){const t=new FormData;t.append("image",e);const n=await Le("/api/webqq/upload",{method:"POST",body:t});if(!n.success)throw new Error(n.message||"上传图片失败");return n.data}async function sf(e){const t=await Le("/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 lf(e){const t=new FormData;t.append("file",e);const n=await Le("/api/webqq/upload-file",{method:"POST",body:t});if(!n.success)throw new Error(n.message||"上传文件失败");return n.data}async function T0(e){const t=await Le(`/api/webqq/members?groupCode=${e}`);if(!t.success)throw new Error(t.message||"获取群成员失败");return t.data||[]}async function se(e,t,n=[]){const r=await Le(`/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 of(e,t,n,r){return await se("ntFileApi","getVideoUrl",[{chatType:e,peerUid:t,guildId:""},n,r])}async function af(e,t,n){await se("ntMsgApi","recallMsg",[{chatType:e,peerUid:t,guildId:""},[n]])}async function cf(e,t){var n,r;try{if(t){const i=await se("ntGroupApi","getGroupMember",[t,e,!1]);if(i)return i.cardName||i.nick||"未知用户"}const s=await se("ntUserApi","getUserSimpleInfo",[e,!1]);return((n=s==null?void 0:s.coreInfo)==null?void 0:n.remark)||((r=s==null?void 0:s.coreInfo)==null?void 0:r.nick)||"未知用户"}catch{return"未知用户"}}async function kl(e,t,n){e===2&&n?await se("pmhq","sendGroupPoke",[Number(n),Number(t)]):await se("pmhq","sendFriendPoke",[Number(t)])}async function uf(e,t,n,r){return await se("ntMsgApi","translatePtt2Text",[e,{chatType:t,peerUid:n,guildId:""},r])||""}async function df(e,t,n=!1){const r=await se("ntGroupApi","kickMember",[e,[t],n,""]);if((r==null?void 0:r.errCode)!==0)throw new Error((r==null?void 0:r.errMsg)||"踢出失败")}async function mf(e,t,n){await se("ntGroupApi","banMember",[e,[{uid:t,timeStamp:n}]])}async function ff(e,t,n){await se("pmhq","setSpecialTitle",[parseInt(e),t,n])}function hf(e,t,n){const r=is();let s=`/api/webqq/audio-proxy?fileUuid=${encodeURIComponent(e)}&isGroup=${t}&token=${encodeURIComponent(r||"")}`;return n&&(s+=`&filePath=${encodeURIComponent(n)}`),s}async function pf(e){const t=await se("ntGroupApi","quitGroup",[e]);if((t==null?void 0:t.result)!==0)throw new Error((t==null?void 0:t.errMsg)||"退群失败")}async function jl(e,t,n){var v;let r=e;if(!r&&t&&(r=await se("ntUserApi","getUidByUin",[t])),!r)throw new Error("无法获取用户信息");const i=(await se("ntUserApi","fetchUserDetailInfo",[r])).detail[r];if(!i)throw new Error("用户不存在");let o=t||i.uin;o||(o=await se("ntUserApi","getUinByUid",[r]));const a=i.simpleInfo,c=a==null?void 0:a.coreInfo,u=a==null?void 0:a.baseInfo,h=i.commonExt;let f=((v=h==null?void 0:h.qqLevel)==null?void 0:v.level)||0;if(f===0&&o)try{f=await se("pmhq","fetchUserLevel",[parseInt(o)])}catch{}const p={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:f,regTime:(h==null?void 0:h.regTime)||void 0,avatar:`https://q1.qlogo.cn/g?b=qq&nk=${o}&s=640`};if(n)try{const y=await se("ntGroupApi","getGroupMember",[n,r,!1]);y&&(p.groupCard=y.cardName||"",p.groupRole=y.role===4?"owner":y.role===3?"admin":"member",p.groupTitle=y.memberSpecialTitle||"",p.groupLevel=y.memberRealLevel||y.memberLevel||0,p.joinTime=y.joinTime,p.lastSpeakTime=y.lastSpeakTime)}catch{}return p}function xf(e,t,n){const r=is(),s=r?`/api/webqq/events?token=${encodeURIComponent(r)}`:"/api/webqq/events";let i,o=0,a=null,c=!1;const u=()=>(i=new EventSource(s),i.addEventListener("message",f=>{try{const p=JSON.parse(f.data);e(p)}catch(p){console.error("解析 SSE 消息失败:",p)}}),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=f=>{if(console.error("[SSE] 连接错误:",f),c)return;i.close();const p=Math.min(1e3*Math.pow(2,o),3e4);o++,console.log(`[SSE] 将在 ${p}ms 后尝试第 ${o} 次重连...`),a=setTimeout(()=>{c||(console.log("[SSE] 正在重连..."),u())},p),t==null||t(f)},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 gf(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 yf(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 vf(e){const t=e.toLowerCase().split(".").pop()||"";return["jpg","jpeg","png","gif"].includes(t)}async function wf(e){var r,s,i;const t=await se("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:(s=t.groupMemo)==null?void 0:s.length,richFingerMemo:t.richFingerMemo});let n="";if(t.ownerUid)try{const o=await se("ntUserApi","getUinByUid",[t.ownerUid]),a=await se("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:Ol(t.groupCode),memberCount:t.memberNum,maxMemberCount:t.maxMemberNum,ownerUin:t.ownerUid?await se("ntUserApi","getUinByUid",[t.ownerUid]).catch(()=>""):"",ownerName:n,createTime:t.cmdUinJoinTime||void 0,description:t.richFingerMemo||t.fingerMemo||"",announcement:t.groupMemo||""}}function ql(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 s=new Date(n);return s.setDate(s.getDate()-1),t.toDateString()===s.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 kf(e){const t=await se("ntFriendApi","delBuddy",[e]);if((t==null?void 0:t.result)!==0)throw new Error((t==null?void 0:t.errMsg)||"删除好友失败")}const M0=Object.freeze(Object.defineProperty({__proto__:null,createEventSource:xf,deleteFriend:kf,filterGroups:gf,filterMembers:yf,formatMessageTime:ql,getAudioProxyUrl:hf,getFriends:Eo,getGroupAvatar:Ol,getGroupMembers:T0,getGroupProfile:wf,getGroups:To,getLoginInfo:nf,getMessages:Qs,getRecentChats:Mo,getSelfUid:os,getSelfUin:Ca,getUserAvatar:Ea,getUserDisplayName:cf,getUserProfile:jl,getVideoUrl:of,isValidImageFormat:vf,kickGroupMember:df,muteGroupMember:mf,ntCall:se,quitGroup:pf,recallMessage:af,sendMessage:Io,sendPoke:kl,setMemberTitle:ff,setSelfInfo:tf,translatePttToText:uf,uploadFile:lf,uploadImage:rf,uploadImageByUrl:sf},Symbol.toStringTag,{value:"Module"})),I0="modulepreload",z0=function(e){return"/"+e},au={},P0=function(t,n,r){let s=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"));s=Promise.allSettled(n.map(c=>{if(c=z0(c),c in au)return;au[c]=!0;const u=c.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":I0,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((p,v)=>{f.addEventListener("load",p),f.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 s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})},L0=60*60*1e3,cu=30*60*1e3,zs=new Map;let Ta=new Set,Ma=new Set;const uu=()=>{Ta=new Set,Ma=new Set},Ia=(e,t)=>Ta.has(`${e}_${t}`),R0=(e,t)=>{Ta.add(`${e}_${t}`)},_0=e=>Ma.has(e),A0=e=>{Ma.add(e)},xt=Gm()(Km((e,t)=>({friendCategories:[],groups:[],recentChats:[],contactsLoading:!1,contactsError:null,currentChat:null,activeTab:"recent",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}),setUnreadCount:(n,r)=>e(s=>({unreadCounts:{...s.unreadCounts,[n]:r}})),incrementUnreadCount:n=>e(r=>({unreadCounts:{...r.unreadCounts,[n]:(r.unreadCounts[n]||0)+1}})),clearUnreadCount:n=>e(r=>{const{[n]:s,...i}=r.unreadCounts;return{unreadCounts:i}}),initUnreadCounts:n=>{const r={};n.forEach(s=>{s.unreadCount>0&&(r[`${s.chatType}_${s.peerId}`]=s.unreadCount)}),e({unreadCounts:r})},toggleCategory:n=>e(r=>{const s=new Set(r.expandedCategories);return s.has(n)?s.delete(n):s.add(n),{expandedCategories:Array.from(s)}}),setExpandedCategories:n=>e({expandedCategories:n}),getCachedMembers:n=>{const s=t().membersCache[n];return s&&Date.now()-s.timestamp<cu?s.members:null},setCachedMembers:(n,r)=>e(s=>{const i=Date.now(),o={};for(const[a,c]of Object.entries(s.membersCache))i-c.timestamp<cu&&(o[a]=c);return{membersCache:{...o,[n]:{members:r,timestamp:i}}}}),fetchGroupMembers:async(n,r=!1)=>{const s=t();if(console.log("[Store] fetchGroupMembers called:",n,"forceRefresh:",r),!r){const a=s.getCachedMembers(n);if(a)return console.log("[Store] Cache hit, returning cached members"),a}const i=zs.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 P0(async()=>{const{getGroupMembers:u}=await Promise.resolve().then(()=>M0);return{getGroupMembers:u}},void 0),c=await a(n);return console.log("[Store] API success, caching members"),t().setCachedMembers(n,c),zs.delete(n),c})().catch(a=>{throw console.log("[Store] API error:",a.message),zs.delete(n),a});return zs.set(n,o),o},setShowMemberPanel:n=>e({showMemberPanel:n}),getScrollPosition:(n,r)=>{const s=t(),i=`${n}_${r}`;return s.scrollPositions[i]||null},setScrollPosition:(n,r,s)=>e(i=>({scrollPositions:{...i.scrollPositions,[`${n}_${r}`]:s}})),clearScrollPosition:(n,r)=>e(s=>{const{[`${n}_${r}`]:i,...o}=s.scrollPositions;return{scrollPositions:o}}),isContactsCacheValid:()=>{const n=t();return n.contactsCacheTimestamp>0&&Date.now()-n.contactsCacheTimestamp<L0&&(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,s,i]=await Promise.all([Eo(),To(),Mo()]),o=i.filter(f=>f.peerId&&f.peerId!=="0"&&f.peerId!==""),a=new Map;n.recentChats.forEach(f=>{f.peerId&&f.peerId!=="0"&&f.peerId!==""&&a.set(`${f.chatType}_${f.peerId}`,f)}),o.forEach(f=>{const p=`${f.chatType}_${f.peerId}`,v=a.get(p);v?f.lastTime>v.lastTime&&a.set(p,f):a.set(p,f)});const c=Array.from(a.values()).sort((f,p)=>p.lastTime-f.lastTime);e({friendCategories:r,groups:s,recentChats:c,contactsCacheTimestamp:Date.now(),contactsLoading:!1});const h={...t().unreadCounts};o.forEach(f=>{const p=`${f.chatType}_${f.peerId}`;!(p in h)&&f.unreadCount>0&&(h[p]=f.unreadCount)}),e({unreadCounts:h})}catch(r){e({contactsError:r.message||"加载联系人失败",contactsLoading:!1})}},refreshContacts:async()=>{try{const[n,r,s]=await Promise.all([Eo(),To(),Mo()]),i=s.filter(f=>f.peerId&&f.peerId!=="0"&&f.peerId!==""),o=t(),a=new Map;o.recentChats.forEach(f=>{f.peerId&&f.peerId!=="0"&&f.peerId!==""&&a.set(`${f.chatType}_${f.peerId}`,f)}),i.forEach(f=>{const p=`${f.chatType}_${f.peerId}`,v=a.get(p);v?f.lastTime>v.lastTime&&a.set(p,f):a.set(p,f)});const c=Array.from(a.values()).sort((f,p)=>p.lastTime-f.lastTime);e({friendCategories:n,groups:r,recentChats:c,contactsCacheTimestamp:Date.now()});const h={...t().unreadCounts};i.forEach(f=>{const p=`${f.chatType}_${f.peerId}`;!(p in h)&&f.unreadCount>0&&(h[p]=f.unreadCount)}),e({unreadCounts:h})}catch(n){console.error("Failed to refresh contacts:",n)}},updateRecentChat:(n,r,s,i,o,a)=>e(c=>{const u=c.recentChats.filter((v,y,w)=>w.findIndex(k=>k.chatType===v.chatType&&k.peerId===v.peerId)===y),h=u.find(v=>v.chatType===n&&v.peerId===r),f=c.currentChat,p=(f==null?void 0:f.chatType)===n&&(f==null?void 0:f.peerId)===r;if(h){const v=u.filter(d=>!(d.chatType===n&&d.peerId===r)),y={...h,lastMessage:s,lastTime:i,unreadCount:p?0:h.unreadCount+1};if(h.pinned){const d=v.filter(g=>g.pinned),m=v.filter(g=>!g.pinned);return{recentChats:[y,...d,...m]}}const w=v.filter(d=>d.pinned),k=v.filter(d=>!d.pinned);return{recentChats:[...w,y,...k]}}else{let v=o||r,y=a||"";if(n===1||n===100){for(const k of c.friendCategories){const d=k.friends.find(m=>m.uin===r);if(d){v=d.remark||d.nickname,y=d.avatar;break}}y||(y=`https://q1.qlogo.cn/g?b=qq&nk=${r}&s=640`)}else if(n===2){const k=c.groups.find(d=>d.groupCode===r);k&&(v=k.groupName,y=k.avatar),y||(y=`https://p.qlogo.cn/gh/${r}/${r}/640/`)}return{recentChats:[{chatType:n,peerId:r,peerName:v,peerAvatar:y,lastMessage:s,lastTime:i,unreadCount:p?0:1},...u]}}}),togglePinChat:(n,r)=>e(s=>{const i=s.recentChats.map(o=>o.chatType===n&&o.peerId===r?{...o,pinned:!o.pinned}:o);return i.sort((o,a)=>o.pinned&&!a.pinned?-1:!o.pinned&&a.pinned?1:a.lastTime-o.lastTime),{recentChats:i}}),removeRecentChat:(n,r)=>e(s=>({recentChats:s.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,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 F0(e,t,n){const[r,s]=x.useState({left:-9999,top:-9999,ready:!1});return x.useEffect(()=>{s({left:-9999,top:-9999,ready:!1});const i=requestAnimationFrame(()=>{if(!n.current){s({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),s({left:c,top:u,ready:!0})});return()=>cancelAnimationFrame(i)},[e,t]),r}const U0=({activeTab:e,onTabChange:t,friendCategories:n,groups:r,recentChats:s,unreadCounts:i,selectedPeerId:o,onSelectFriend:a,onSelectGroup:c,onSelectRecent:u})=>{const[h,f]=x.useState(""),p=x.useMemo(()=>{if(!h.trim())return n;const w=h.toLowerCase();return n.map(k=>({...k,friends:k.friends.filter(d=>d.nickname.toLowerCase().includes(w)||d.remark.toLowerCase().includes(w)||d.uin.includes(h))})).filter(k=>k.friends.length>0)},[n,h]),v=x.useMemo(()=>gf(r,h),[r,h]),y=[{id:"recent",icon:_r,label:"最近"},{id:"friends",icon:Dl,label:"好友"},{id:"groups",icon:_m,label:"群组"}];return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsx("div",{className:"flex border-b border-theme-divider px-2 pt-2",children:y.map(w=>{const k=w.icon,d=e===w.id;return l.jsxs("button",{onClick:()=>t(w.id),className:`flex-1 flex items-center justify-center gap-1.5 py-2.5 text-sm font-medium transition-colors rounded-t-lg ${d?"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:[l.jsx(k,{size:16}),w.label]},w.id)})}),e!=="recent"&&l.jsx("div",{className:"p-3",children:l.jsxs("div",{className:"relative",children:[l.jsx(qm,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-theme-hint"}),l.jsx("input",{type:"text",value:h,onChange:w=>f(w.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"})]})}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="recent"&&l.jsx(W0,{items:s,unreadCounts:i,selectedPeerId:o,onSelect:u}),e==="friends"&&l.jsx($0,{categories:p,selectedPeerId:o,onSelect:a}),e==="groups"&&l.jsx(O0,{items:v,selectedPeerId:o,onSelect:c})]})]})},$0=({categories:e,selectedPeerId:t,onSelect:n})=>{const{expandedCategories:r,toggleCategory:s}=xt(),i=x.useMemo(()=>new Set(r),[r]);return e.length===0?l.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:"暂无好友"}):l.jsx("div",{className:"py-1",children:e.map(o=>{const a=i.has(o.categoryId);return l.jsxs("div",{children:[l.jsxs("div",{onClick:()=>s(o.categoryId),className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-theme-item-hover text-theme-secondary",children:[a?l.jsx(Rx,{size:14}):l.jsx(_x,{size:14}),l.jsx("span",{className:"text-xs font-medium",children:o.categoryName}),l.jsxs("span",{className:"text-xs text-theme-hint",children:[o.onlineCount,"/",o.memberCount]})]}),a&&o.friends.map(c=>l.jsx(D0,{friend:c,isSelected:t===c.uin,onClick:()=>n(c)},c.uid))]},o.categoryId)})})},D0=({friend:e,isSelected:t,onClick:n})=>l.jsxs("div",{onClick:n,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:[l.jsxs("div",{className:"relative flex-shrink-0",children:[l.jsx("img",{src:e.avatar,alt:e.nickname,className:"w-10 h-10 rounded-full object-cover",onError:r=>{r.currentTarget.src=`https://q1.qlogo.cn/g?b=qq&nk=${e.uin}&s=640`}}),e.online&&l.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"})]}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-theme truncate",children:e.remark||e.nickname}),e.remark&&l.jsx("div",{className:"text-xs text-theme-hint truncate",children:e.nickname})]})]}),O0=({items:e,selectedPeerId:t,onSelect:n})=>e.length===0?l.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:"暂无群组"}):l.jsx("div",{className:"py-1",children:e.map(r=>l.jsx(q0,{group:r,isSelected:t===r.groupCode,onClick:()=>n(r)},r.groupCode))}),q0=({group:e,isSelected:t,onClick:n})=>l.jsxs("div",{onClick:n,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:[l.jsx("img",{src:e.avatar,alt:e.groupName,className:"w-10 h-10 rounded-full object-cover flex-shrink-0",onError:r=>{r.currentTarget.src=`https://p.qlogo.cn/gh/${e.groupCode}/${e.groupCode}/640/`}}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-theme truncate",children:e.groupName}),l.jsxs("div",{className:"text-xs text-theme-hint",children:[e.memberCount," 人"]})]})]}),W0=({items:e,unreadCounts:t,selectedPeerId:n,onSelect:r})=>{const{togglePinChat:s,removeRecentChat:i,friendCategories:o,groups:a}=xt(),[c,u]=x.useState(null),h=x.useRef(null),f=F0((c==null?void 0:c.x)||0,(c==null?void 0:c.y)||0,h),p=d=>{if(d.chatType===2){const m=a.find(g=>g.groupCode===d.peerId);if(m!=null&&m.remarkName&&m.remarkName!==m.groupName)return m.remarkName}else if(d.chatType===1||d.chatType===100)for(const m of o){const g=m.friends.find(N=>N.uin===d.peerId);if(g!=null&&g.remark&&g.remark!==g.nickname)return g.remark}return d.peerName},v=(d,m)=>{d.preventDefault(),u({x:d.clientX,y:d.clientY,item:m})},y=()=>u(null),w=()=>{c&&(s(c.item.chatType,c.item.peerId),y())},k=()=>{c&&(i(c.item.chatType,c.item.peerId),y())};return e.length===0?l.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:"暂无最近会话"}):l.jsxs("div",{className:"py-1",onClick:y,children:[e.map(d=>l.jsx(H0,{item:d,displayName:p(d),unreadCount:t.get(`${d.chatType}_${d.peerId}`)||d.unreadCount,isSelected:n===d.peerId,onClick:()=>r(d),onContextMenu:m=>v(m,d)},`${d.chatType}_${d.peerId}`)),c&&Ae.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:y,onContextMenu:d=>{d.preventDefault(),y()}}),l.jsxs("div",{ref:h,className:"fixed z-50 bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[120px]",style:{left:f.left,top:f.top,visibility:f.ready?"visible":"hidden"},onContextMenu:d=>d.preventDefault(),children:[l.jsxs("button",{onClick:w,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[l.jsx(Vx,{size:14}),c.item.pinned?"取消置顶":"置顶"]}),l.jsxs("button",{onClick:k,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:[l.jsx(Et,{size:14}),"删除"]})]})]}),document.body)]})},H0=({item:e,displayName:t,unreadCount:n,isSelected:r,onClick:s,onContextMenu:i})=>l.jsxs("div",{onClick:s,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:[l.jsxs("div",{className:"relative flex-shrink-0",children:[l.jsx("img",{src:e.peerAvatar,alt:t,className:"w-10 h-10 rounded-full object-cover"}),n>0&&l.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})]}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-theme truncate",children:t}),l.jsx("span",{className:"text-xs text-theme-hint flex-shrink-0 ml-2",children:ql(e.lastTime)})]}),l.jsx("div",{className:"text-xs text-theme-hint truncate mt-0.5",children:e.lastMessage})]})]});function In(e,t,n){let r=n.initialDeps??[],s,i=!0;function o(){var a,c,u;let h;n.key&&((a=n.debug)!=null&&a.call(n))&&(h=Date.now());const f=e();if(!(f.length!==r.length||f.some((y,w)=>r[w]!==y)))return s;r=f;let v;if(n.key&&((c=n.debug)!=null&&c.call(n))&&(v=Date.now()),s=t(...f),n.key&&((u=n.debug)!=null&&u.call(n))){const y=Math.round((Date.now()-h)*100)/100,w=Math.round((Date.now()-v)*100)/100,k=w/16,d=(m,g)=>{for(m=String(m);m.length<g;)m=" "+m;return m};console.info(`%c⏱ ${d(w,5)} /${d(y,5)} ms`,`
375
+ font-size: .6rem;
376
+ font-weight: bold;
377
+ color: hsl(${Math.max(0,Math.min(120-120*k,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(s),i=!1,s}return o.updateDeps=a=>{r=a},o}function du(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const B0=(e,t)=>Math.abs(e-t)<1.01,V0=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}},mu=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Q0=e=>e,G0=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let s=t;s<=n;s++)r.push(s);return r},K0=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=o=>{const{width:a,height:c}=o;t({width:Math.round(a),height:Math.round(c)})};if(s(mu(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){s({width:u.inlineSize,height:u.blockSize});return}}s(mu(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},fu={passive:!0},hu=typeof window>"u"?!0:"onscrollend"in window,Y0=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let s=0;const i=e.options.useScrollendEvent&&hu?()=>{}:V0(r,()=>{t(s,!1)},e.options.isScrollingResetDelay),o=h=>()=>{const{horizontal:f,isRtl:p}=e.options;s=f?n.scrollLeft*(p&&-1||1):n.scrollTop,i(),t(s,h)},a=o(!0),c=o(!1);c(),n.addEventListener("scroll",a,fu);const u=e.options.useScrollendEvent&&hu;return u&&n.addEventListener("scrollend",c,fu),()=>{n.removeEventListener("scroll",a),u&&n.removeEventListener("scrollend",c)}},X0=(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"]},J0=(e,{adjustments:t=0,behavior:n},r)=>{var s,i;const o=e+t;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:o,behavior:n})};class Z0{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,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(s=>{s.forEach(i=>{const o=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,s])=>{typeof s>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Q0,rangeExtractor:G0,onChange:()=>{},measureElement:X0,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,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=In(()=>(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(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=i,this.maybeNotify()}))}},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 s=new Map,i=new Map;for(let o=r-1;o>=0;o--){const a=n[o];if(s.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&&s.set(a.lane,!0),s.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=In(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,s,i,o,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:o,lanes:a}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=In(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:s,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 p of this.laneAssignments.keys())p>=n&&this.laneAssignments.delete(p);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(p=>{this.itemSizeCache.set(p.key,p.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 h=this.measurementsCache.slice(0,u),f=new Array(a).fill(void 0);for(let p=0;p<u;p++){const v=h[p];v&&(f[v.lane]=p)}for(let p=u;p<n;p++){const v=i(p),y=this.laneAssignments.get(p);let w,k;if(y!==void 0&&this.options.lanes>1){w=y;const N=f[w],b=N!==void 0?h[N]:void 0;k=b?b.end+this.options.gap:r+s}else{const N=this.options.lanes===1?h[p-1]:this.getFurthestMeasurement(h,p);k=N?N.end+this.options.gap:r+s,w=N?N.lane:p%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(p,w)}const d=c.get(v),m=typeof d=="number"?d:this.options.estimateSize(p),g=k+m;h[p]={index:p,start:k,size:m,end:g,key:v,lane:w},f[w]=p}return this.measurementsCache=h,h},{key:!1,debug:()=>this.options.debug}),this.calculateRange=In(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,i)=>this.range=n.length>0&&r>0?eg({measurements:n,outerSize:r,scrollOffset:s,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=In(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,i,o)=>i===null||o===null?[]:n({startIndex:i,endIndex:o,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const s=this.indexFromElement(n),i=this.measurementsCache[s];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(s,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const s=this.measurementsCache[n];if(!s)return;const i=this.itemSizeCache.get(s.key)??s.size,o=r-i;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,o,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(n,void 0)},this.getVirtualItems=In(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let i=0,o=n.length;i<o;i++){const a=n[i],c=r[a];s.push(c)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return du(r[jf(0,r.length-1,s=>du(r[s]).start,n)])},this.getOffsetForAlignment=(n,r,s=0)=>{const i=this.getSize(),o=this.getScrollOffset();r==="auto"&&(r=n>=o+i?"end":"start"),r==="center"?n+=(s-i)/2:r==="end"&&(n-=i);const a=this.getTotalSize()+this.options.scrollMargin-i;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 s=this.measurementsCache[n];if(!s)return;const i=this.getSize(),o=this.getScrollOffset();if(r==="auto")if(s.end>=o+i-this.options.scrollPaddingEnd)r="end";else if(s.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];const a=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:s}={})=>{s==="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:s})},this.scrollToIndex=(n,{align:r="auto",behavior:s}={})=>{s==="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));let i=0;const o=10,a=u=>{if(!this.targetWindow)return;const h=this.getOffsetForIndex(n,u);if(!h){console.warn("Failed to get offset for index:",n);return}const[f,p]=h;this._scrollToOffset(f,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const v=this.getScrollOffset(),y=this.getOffsetForIndex(n,p);if(!y){console.warn("Failed to get offset for index:",n);return}B0(y[0],v)||c(p)})},c=u=>{this.targetWindow&&(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 s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((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--}s=Math.max(...i.filter(a=>a!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const jf=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,i=n(s);if(i<r)e=s+1;else if(i>r)t=s-1;else return s}return e>0?e-1:0};function eg({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const s=e.length-1,i=c=>e[c].start;if(e.length<=r)return{startIndex:0,endIndex:s};let o=jf(0,s,i,n),a=o;if(r===1)for(;a<s&&e[a].end<n+t;)a++;else if(r>1){const c=Array(r).fill(0);for(;a<s&&c.some(h=>h<n+t);){const h=e[a];c[h.lane]=h.end,a++}const u=Array(r).fill(n+t);for(;o>=0&&u.some(h=>h>=n);){const h=e[o];u[h.lane]=h.start,o--}o=Math.max(0,o-o%r),a=Math.min(s,a+(r-1-a%r))}return{startIndex:o,endIndex:a}}const pu=typeof document<"u"?x.useLayoutEffect:x.useEffect;function tg(e){const t=x.useReducer(()=>({}),{})[1],n={...e,onChange:(s,i)=>{var o;i?Ae.flushSync(t):t(),(o=e.onChange)==null||o.call(e,s,i)}},[r]=x.useState(()=>new Z0(n));return r.setOptions(n),pu(()=>r._didMount(),[]),pu(()=>r._willUpdate()),r}function Nf(e){return tg({observeElementRect:K0,observeElementOffset:Y0,scrollToFn:J0,...e})}const ng="webqq-messages",rg=1,sr="messages",bf=100;let Ps=null;function Sf(){return Ps?Promise.resolve(Ps):new Promise((e,t)=>{const n=indexedDB.open(ng,rg);n.onerror=()=>t(n.error),n.onsuccess=()=>{Ps=n.result,e(Ps)},n.onupgradeneeded=r=>{const s=r.target.result;s.objectStoreNames.contains(sr)||s.createObjectStore(sr,{keyPath:"chatKey"})}})}async function Wl(e,t){try{const n=await Sf(),r=`${e}_${t}`;return new Promise(s=>{const a=n.transaction(sr,"readonly").objectStore(sr).get(r);a.onsuccess=()=>{const c=a.result;c&&c.messages?s(c.messages):s(null)},a.onerror=()=>s(null)})}catch{return null}}async function Yn(e,t,n){try{const r=await Sf(),s=`${e}_${t}`,i=n.slice(-bf);return new Promise((o,a)=>{const h=r.transaction(sr,"readwrite").objectStore(sr).put({chatKey:s,messages:i,timestamp:Date.now()});h.onsuccess=()=>o(),h.onerror=()=>a(h.error)})}catch(r){console.error("Failed to cache messages:",r)}}async function Cf(e,t,n){try{const r=await Wl(e,t);if(r){const s=[...r.slice(-(bf-1)),n];await Yn(e,t,s)}}catch(r){console.error("Failed to append message:",r)}}async function sg(e,t,n){try{const r=await Wl(e,t);if(r){const s=r.filter(i=>i.msgId!==n);await Yn(e,t,s)}}catch(r){console.error("Failed to remove message:",r)}}async function lg(e,t,n,r,s){try{const i=await Wl(e,t);if(!i)return;const o=i.map(a=>{if(a.msgSeq!==n)return a;const c=a.emojiLikesList||[];if(s){const u=c.findIndex(h=>h.emojiId===r);if(u>=0){const h=[...c];return h[u]={...h[u],likesCnt:String(parseInt(h[u].likesCnt)+1)},{...a,emojiLikesList:h}}else return{...a,emojiLikesList:[...c,{emojiId:r,emojiType:parseInt(r)>999?"2":"1",likesCnt:"1",isClicked:!1}]}}else{const u=c.findIndex(h=>h.emojiId===r);if(u>=0){const h=[...c],f=parseInt(h[u].likesCnt)-1;return f<=0?h.splice(u,1):h[u]={...h[u],likesCnt:String(f)},{...a,emojiLikesList:h}}}return a});await Yn(e,t,o)}catch(i){console.error("Failed to update emoji reaction:",i)}}const ig=({level:e})=>{const t=e%4,n=Math.floor(e/4)%4,r=Math.floor(e/16)%4,s=Math.floor(e/64)%4,i=Math.floor(e/256),o=[];for(let a=0;a<i;a++)o.push(l.jsx("span",{className:"text-amber-400 text-xs font-bold",title:"金企鹅",children:"🐧"},`penguin-${a}`));for(let a=0;a<s;a++)o.push(l.jsx($l,{size:14,className:"text-amber-500"},`crown-${a}`));for(let a=0;a<r;a++)o.push(l.jsx(Bm,{size:14,className:"text-orange-400"},`sun-${a}`));for(let a=0;a<n;a++)o.push(l.jsx(Fm,{size:14,className:"text-blue-400"},`moon-${a}`));for(let a=0;a<t;a++)o.push(l.jsx(Hm,{size:14,className:"text-yellow-400 fill-yellow-400"},`star-${a}`));return l.jsx("div",{className:"flex items-center gap-0.5 flex-wrap",children:o})},Ef=({profile:e,loading:t,position:n,onClose:r,isFriend:s,onFriendDeleted:i})=>{const o=x.useRef(null),[a,c]=x.useState({left:n.x,top:n.y}),[u,h]=x.useState(!1),[f,p]=x.useState(!1);if(x.useEffect(()=>{if(!o.current)return;const g=320,N=o.current.offsetHeight||400;let b=n.x,M=n.y;b+g>window.innerWidth-20&&(b=window.innerWidth-g-20),b<20&&(b=20),M+N>window.innerHeight-20&&(M=window.innerHeight-N-20),M<20&&(M=20),c({left:b,top:M})},[n,e,t]),!e&&!t)return null;const v=g=>g===1?"男":g===2?"女":"",y=g=>{if(!g)return"";const N=new Date(g*1e3),b=new Date,M=b.getFullYear()-N.getFullYear(),_=b.getMonth()-N.getMonth(),T=M+(_<0?-1:0);if(T<1){const O=M*12+_;return O>0?`${O}个月`:"不足1个月"}return`${T}年`},w=g=>g==="owner"?"群主":g==="admin"?"管理员":"",k=g=>g==="owner"?"bg-amber-500 text-white":g==="admin"?"bg-green-500 text-white":"",d=async()=>{if(e){p(!0);try{await kf(e.uid),Q("已删除好友","success"),i==null||i(e.uid),r()}catch(g){Q(g.message||"删除好友失败","error")}finally{p(!1),h(!1)}}},m=g=>g?new Date(g*1e3).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"";return Ae.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:r}),l.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?l.jsx("div",{className:"flex items-center justify-center h-40",children:l.jsx(je,{size:24,className:"animate-spin text-pink-500"})}):e&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"bg-gradient-to-r from-pink-400 to-amber-300 p-4 relative",children:[s&&!e.groupRole&&l.jsx("button",{onClick:()=>h(!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:l.jsx(Et,{size:16})}),l.jsxs("div",{className:"flex items-start gap-4",children:[l.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"}),l.jsxs("div",{className:"flex-1 min-w-0 text-white pt-1",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"font-bold text-lg truncate",children:e.nickname}),e.groupRole&&w(e.groupRole)&&l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded flex-shrink-0 ${k(e.groupRole)}`,children:w(e.groupRole)})]}),e.remark&&e.remark!==e.nickname&&l.jsxs("div",{className:"text-white/80 text-sm truncate mb-1",children:["备注: ",e.remark]}),l.jsx("div",{className:"text-white/90 text-sm",children:e.uin}),e.qid&&l.jsxs("div",{className:"text-white/70 text-xs mt-0.5",children:["QID: ",e.qid]})]})]})]}),l.jsxs("div",{className:"p-4 overflow-y-auto",style:{maxHeight:"calc(100vh - 40px - 120px)"},children:[e.signature&&l.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}),l.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[v(e.sex)&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-theme-hint",children:"性别"}),l.jsx("span",{className:"text-theme",children:v(e.sex)})]}),e.birthday&&e.birthday!=="0-0-0"&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-theme-hint",children:"生日"}),l.jsx("span",{className:"text-theme",children:e.birthday})]}),y(e.regTime)&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-theme-hint",children:"Q龄"}),l.jsx("span",{className:"text-theme",children:y(e.regTime)})]}),e.level>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-theme-hint",children:"等级"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:"text-theme",children:["Lv.",e.level]}),l.jsx(ig,{level:e.level})]})]})]}),(e.groupCard||e.groupTitle||e.groupLevel)&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-theme-divider my-3"}),l.jsx("div",{className:"text-xs text-theme-hint mb-2",children:"群信息"}),l.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.groupCard&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-theme-hint",children:"群名片"}),l.jsx("span",{className:"text-theme truncate",children:e.groupCard})]}),e.groupTitle&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-theme-hint",children:"群头衔"}),l.jsx("span",{className:"text-pink-500",children:e.groupTitle})]}),e.groupLevel!==void 0&&e.groupLevel>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-theme-hint",children:"群等级"}),l.jsxs("span",{className:"text-theme",children:["Lv.",e.groupLevel]})]}),e.joinTime&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-theme-hint",children:"入群时间"}),l.jsx("span",{className:"text-theme",children:m(e.joinTime)})]}),e.lastSpeakTime&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-theme-hint",children:"最后发言"}),l.jsx("span",{className:"text-theme",children:m(e.lastSpeakTime)})]})]})]})]})]}),u&&e&&l.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center rounded-xl",children:l.jsxs("div",{className:"bg-popup m-4 p-4 rounded-lg shadow-lg max-w-[280px]",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"font-medium text-theme",children:"删除好友"}),l.jsx("button",{onClick:()=>h(!1),className:"text-theme-muted hover:text-theme",children:l.jsx(wt,{size:18})})]}),l.jsxs("p",{className:"text-sm text-theme-secondary mb-4",children:["确定要删除好友 ",l.jsx("span",{className:"font-medium text-theme",children:e.remark||e.nickname})," 吗?删除后将无法恢复。"]}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx("button",{onClick:()=>h(!1),className:"px-3 py-1.5 text-sm rounded-lg bg-theme-item hover:bg-theme-hover text-theme transition-colors",disabled:f,children:"取消"}),l.jsxs("button",{onClick:d,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:f,children:[f&&l.jsx(je,{size:14,className:"animate-spin"}),"删除"]})]})]})})]})]}),document.body)},og=({profile:e,loading:t,position:n,onClose:r,onQuitGroup:s})=>{const i=x.useRef(null),[o,a]=x.useState({left:n.x,top:n.y}),[c,u]=x.useState(!1),h=Ca(),f=(e==null?void 0:e.ownerUin)===h;if(x.useEffect(()=>{if(!i.current)return;const w=320,k=i.current.offsetHeight||300;let d=n.x,m=n.y;d+w>window.innerWidth-20&&(d=window.innerWidth-w-20),d<20&&(d=20),m+k>window.innerHeight-20&&(m=window.innerHeight-k-20),m<20&&(m=20),a({left:d,top:m})},[n,e,t]),!e&&!t)return null;const p=w=>w?new Date(w*1e3).toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}):"",v=()=>{u(!0)},y=()=>{e&&s&&s(e.groupCode,f),u(!1),r()};return Ae.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:r}),l.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?l.jsx("div",{className:"flex items-center justify-center h-40",children:l.jsx(je,{size:24,className:"animate-spin text-pink-500"})}):e&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"bg-gradient-to-r from-blue-400 to-cyan-300 p-4 relative",children:[s&&l.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:f?"解散该群":"退出该群",children:l.jsx(Ox,{size:16})}),l.jsxs("div",{className:"flex items-start gap-4",children:[l.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"}),l.jsxs("div",{className:"flex-1 min-w-0 text-white pt-1 pr-6",children:[l.jsx("div",{className:"font-bold text-lg truncate mb-1",children:e.groupName}),e.remarkName&&e.remarkName!==e.groupName&&l.jsxs("div",{className:"text-white/80 text-sm truncate mb-1",children:["备注: ",e.remarkName]}),l.jsx("div",{className:"text-white/90 text-sm",children:e.groupCode})]})]})]}),l.jsxs("div",{className:"p-4 overflow-y-auto",style:{maxHeight:"calc(100vh - 40px - 140px)"},children:[l.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[l.jsxs("span",{className:"text-theme-hint flex items-center gap-1",children:[l.jsx(Dl,{size:14}),"成员"]}),l.jsxs("span",{className:"text-theme",children:[e.memberCount,e.maxMemberCount?` / ${e.maxMemberCount}`:""]}),e.ownerName&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-theme-hint flex items-center gap-1",children:[l.jsx($l,{size:14}),"群主"]}),l.jsx("span",{className:"text-theme truncate",children:e.ownerName})]}),e.createTime&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-theme-hint flex items-center gap-1",children:[l.jsx(Px,{size:14}),"创建"]}),l.jsx("span",{className:"text-theme",children:p(e.createTime)})]})]}),e.description&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-theme-divider my-3"}),l.jsx("div",{className:"text-xs text-theme-hint mb-2",children:"群简介"}),l.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&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-theme-divider my-3"}),l.jsxs("div",{className:"text-xs text-theme-hint mb-2 flex items-center gap-1",children:[l.jsx(ls,{size:12}),"群公告"]}),l.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&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-[60] bg-black/50",onClick:()=>u(!1)}),l.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:[l.jsx("h3",{className:"text-lg font-medium text-theme mb-4",children:f?"确认解散群聊":"确认退出群聊"}),l.jsx("p",{className:"text-theme-secondary mb-6",children:f?l.jsxs(l.Fragment,{children:["确定要解散群 ",l.jsx("span",{className:"font-medium text-theme",children:e.groupName})," 吗?此操作不可撤销,所有群成员将被移出。"]}):l.jsxs(l.Fragment,{children:["确定要退出群 ",l.jsx("span",{className:"font-medium text-theme",children:e.groupName})," 吗?"]})}),l.jsxs("div",{className:"flex justify-end gap-3",children:[l.jsx("button",{onClick:()=>u(!1),className:"px-4 py-2 text-sm text-theme-secondary hover:bg-theme-item rounded-lg transition-colors",children:"取消"}),l.jsx("button",{onClick:y,className:"px-4 py-2 text-sm bg-red-500 hover:bg-red-600 text-white rounded-lg transition-colors",children:f?"确认解散":"确认退出"})]})]})]})]}),document.body)},ag=({url:e,onClose:t})=>e?Ae.createPortal(l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:t,children:[l.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-white/80 hover:text-white bg-black/50 rounded-full",children:l.jsx(wt,{size:24})}),l.jsx("img",{src:e,alt:"预览",className:"max-w-[90vw] max-h-[90vh] object-contain",onClick:n=>n.stopPropagation()})]}),document.body):null,cg=({videoInfo:e,onClose:t})=>{const[n,r]=x.useState(null),[s,i]=x.useState(!1),[o,a]=x.useState(null);return x.useEffect(()=>{if(!e){r(null),a(null);return}i(!0),a(null),of(e.chatType,e.peerUid,e.msgId,e.elementId).then(r).catch(c=>a(c.message||"获取视频失败")).finally(()=>i(!1))},[e]),e?Ae.createPortal(l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:t,children:[l.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:l.jsx(wt,{size:24})}),s&&l.jsxs("div",{className:"text-white flex items-center gap-2",children:[l.jsx(je,{size:24,className:"animate-spin"}),"加载中..."]}),o&&l.jsx("div",{className:"text-red-400",children:o}),n&&!s&&l.jsx("video",{src:n,controls:!0,autoPlay:!0,className:"max-w-[90vw] max-h-[90vh]",onClick:c=>c.stopPropagation()})]}),document.body):null},Tf=le.createContext(null),Mf=le.createContext(null),If=le.createContext(null),ug=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(is()||"")}`:e:"",Ci=x.memo(({element:e,message:t})=>{var v;const[n,r]=x.useState(!1),[s,i]=x.useState(!1),[o,a]=x.useState(!1),[c,u]=x.useState(!1),h=le.useContext(Tf),f=le.useContext(Mf),p=le.useContext(If);if(e.textElement)return l.jsx("span",{className:"whitespace-pre-wrap break-all",style:{overflowWrap:"anywhere",wordBreak:"break-all"},children:e.textElement.content});if(e.picElement){const y=e.picElement;let w=y.originImageUrl?y.originImageUrl.startsWith("http")?y.originImageUrl:`https://gchat.qpic.cn${y.originImageUrl}`:"";const k=ug(w),d=200,m=300;let g=y.picWidth||200,N=y.picHeight||200;N>d&&(g=g*d/N,N=d),g>m&&(N=N*m/g,g=m);const b=M=>{t&&(M.preventDefault(),M.stopPropagation(),p==null||p.showMenu(M,t,e.elementId))};return l.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-theme-item cursor-pointer",style:{width:g,height:N},onClick:()=>h==null?void 0:h.showPreview(k),onContextMenu:b,children:[!n&&!s&&l.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-theme-hint",children:l.jsx(je,{size:24,className:"animate-spin"})}),s&&l.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-theme-hint text-xs",children:"图片加载失败"}),l.jsx("img",{src:k,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 y=e.faceElement.faceIndex,w=e.faceElement.faceText;return l.jsx("img",{src:`/face/${y}.png`,alt:w||`[表情${y}]`,title:w||`表情${y}`,className:"inline-block align-text-bottom",style:{width:24,height:24},onError:k=>{var g;const d=k.target;d.style.display="none";const m=document.createElement("span");m.textContent=w||`[表情${y}]`,(g=d.parentNode)==null||g.insertBefore(m,d)}})}if(e.fileElement)return l.jsxs("span",{children:["[文件: ",e.fileElement.fileName,"]"]});if(e.pttElement)return l.jsx(fg,{element:e,message:t});if(e.videoElement){const y=e.videoElement,w=200,k=300;let d=y.thumbWidth||200,m=y.thumbHeight||150;m>w&&(d=d*w/m,m=w),d>k&&(m=m*k/d,d=k);let g="";if(y.thumbPath){let O;y.thumbPath instanceof Map?O=y.thumbPath.values().next().value:typeof y.thumbPath=="object"&&(O=Object.values(y.thumbPath)[0]),O&&(g=`/api/webqq/file-proxy?path=${encodeURIComponent(O)}&token=${encodeURIComponent(is()||"")}`)}const N=y.fileTime||0,b=Math.floor(N/60),M=N%60,_=`${b}:${M.toString().padStart(2,"0")}`,T=()=>{t&&e.elementId&&(f==null||f.showPreview(t.chatType,t.peerUid,t.msgId,e.elementId))};return l.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-theme-item cursor-pointer group",style:{width:d,height:m},onClick:T,children:[l.jsx("div",{className:"absolute inset-0 bg-gray-200 dark:bg-gray-700"}),g?l.jsxs(l.Fragment,{children:[!o&&!c&&l.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-theme-hint",children:l.jsx(je,{size:24,className:"animate-spin"})}),l.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)})]}):l.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-theme-hint text-xs",children:"视频"}),l.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l.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:l.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"}})})}),l.jsx("div",{className:"absolute bottom-1 right-1 px-1.5 py-0.5 bg-black/60 rounded text-white text-xs",children:_})]})}if(e.grayTipElement){const y=e.grayTipElement;if((v=y.jsonGrayTipElement)!=null&&v.jsonStr)try{const w=JSON.parse(y.jsonGrayTipElement.jsonStr);if(w.items){const k=w.items.map(d=>d.txt||"").join("");return l.jsx("span",{className:"text-theme-hint text-xs",children:k||"[戳一戳]"})}}catch{}return l.jsx("span",{className:"text-theme-hint text-xs",children:"[系统提示]"})}if(e.arkElement)return l.jsx("span",{children:"[卡片消息]"});if(e.marketFaceElement){const{emojiId:y,faceName:w,supportSize:k}=e.marketFaceElement,{width:d=200,height:m=200}=(k==null?void 0:k[0])??{},N=`https://gxh.vip.qq.com/club/item/parcel/item/${y.substring(0,2)}/${y}/raw${Math.min(d,300)}.gif`;return l.jsx("img",{src:N,alt:w||"[表情包]",title:w,className:"inline-block align-text-bottom rounded",style:{maxWidth:Math.min(d,200),maxHeight:Math.min(m,200)},onError:b=>{var T;const M=b.target;M.style.display="none";const _=document.createElement("span");_.textContent=`[${w||"表情包"}]`,(T=M.parentNode)==null||T.insertBefore(_,M)}})}return null}),dg=e=>!!(e.textElement||e.picElement||e.fileElement||e.pttElement||e.videoElement||e.faceElement||e.grayTipElement||e.arkElement||e.marketFaceElement),mg=e=>!e.elements||e.elements.length===0?!1:e.elements.every(t=>t.grayTipElement||t.replyElement),fg=({element:e,message:t})=>{const[n,r]=x.useState(null),[s,i]=x.useState(!1),[o,a]=x.useState(!1),[c,u]=x.useState(!1),[h,f]=x.useState(!1),p=x.useRef(null),v=e.pttElement,y=v.duration||0,w=Math.floor(y/60),k=y%60,d=w>0?`${w}:${k.toString().padStart(2,"0")}`:`${k}"`,m=v.text,g=80,b=Math.min(200,Math.max(g,g+y*3)),M=async()=>{if(!(!t||!v.fileUuid||h)){if(c&&p.current){p.current.pause(),u(!1);return}if(p.current&&p.current.readyState>=2){p.current.play(),u(!0);return}f(!0);try{const T=t.chatType===2;console.log("pttElement:",v);const O=hf(v.fileUuid,T,v.filePath);console.log("音频代理URL:",O);const I=new Audio;p.current=I,I.onended=()=>u(!1),I.onerror=C=>{fetch(O).then(A=>A.text()).then(A=>{console.error("音频加载错误,响应内容:",A.substring(0,200))}).catch(()=>{}),console.error("音频加载错误:",C,I.error,"URL:",O),u(!1),f(!1)},I.onloadeddata=async()=>{f(!1);try{await I.play(),u(!0)}catch(C){console.error("播放失败:",C)}},I.src=O}catch(T){console.error("获取语音URL失败:",T),f(!1)}}},_=async()=>{if(!(!t||s||n!==null)){i(!0),a(!1);try{const T=await uf(t.msgId,t.chatType,t.peerUid,e);r(T||"(无法识别)")}catch(T){console.error("语音转文字失败:",T),a(!0),r("转换失败")}finally{i(!1)}}};return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.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:b},onClick:M,title:"点击播放",children:[h?l.jsx(je,{size:16,className:"text-green-600 dark:text-green-400 flex-shrink-0 animate-spin"}):c?l.jsx(jo,{size:16,className:"text-green-600 dark:text-green-400 flex-shrink-0"}):l.jsx(No,{size:16,className:"text-green-600 dark:text-green-400 flex-shrink-0"}),l.jsx("div",{className:"flex-1 flex items-center gap-0.5",children:[1,2,3,4,5].map(T=>l.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))}),l.jsx("span",{className:"text-xs text-green-700 dark:text-green-300 flex-shrink-0",children:d})]}),!m&&n===null&&l.jsx("button",{onClick:_,disabled:s,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:s?l.jsx(je,{size:12,className:"animate-spin"}):"文"})]}),(m||n)&&l.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:m||n})]})},zf=le.createContext(null),Pf=le.createContext(null),Lf=le.createContext(null),Rf=le.createContext(null),_f=le.createContext(null),hg=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 s=JSON.parse(r.grayTipElement.jsonGrayTipElement.jsonStr);if(s.items){const i=s.items.some(o=>o.type==="qq"&&o.uid);return{items:s.items,hasUid:i}}}catch{}return null},un=new Map,pg=x.memo(({message:e,groupCode:t})=>{const n=un.get(e.msgId),[r,s]=x.useState(n??"[系统提示]"),i=os();return x.useEffect(()=>{var h,f;if(un.has(e.msgId)){s(un.get(e.msgId));return}const o=hg(e);if(!o){for(const p of e.elements)if((f=(h=p.grayTipElement)==null?void 0:h.xmlElement)!=null&&f.content){const v=p.grayTipElement.xmlElement.content.replace(/<[^>]+>/g,"");un.set(e.msgId,v),s(v);return}un.set(e.msgId,"[系统提示]"),s("[系统提示]");return}const{items:a,hasUid:c}=o;if(!c){const v=a.map(y=>y.txt||"").join("")||"[系统提示]";un.set(e.msgId,v),s(v);return}(async()=>{const p=[];let v=0;for(const w of a)if(w.type==="qq"&&w.uid)if(w.uid===i)p.push(l.jsx("span",{className:"text-blue-500",children:"你"},v++));else{const k=await cf(w.uid,t);p.push(l.jsx("span",{className:"text-blue-500",children:k},v++))}else w.type==="nor"&&w.txt&&p.push(l.jsx("span",{children:w.txt},v++));const y=p.length>0?p:"[系统提示]";un.set(e.msgId,y),s(y)})()},[e.msgId,i,t]),l.jsx("div",{className:"flex justify-center py-2",children:l.jsx("span",{className:"text-xs text-theme-hint bg-theme-item/50 px-3 py-1 rounded-full",children:r})})}),xg=x.memo(({message:e,allMessages:t,isHighlighted:n})=>{var O,I;if(mg(e)){const C=e.chatType===2?e.peerUin:void 0;return l.jsx(pg,{message:e,groupCode:C})}const r=os(),s=r?e.senderUid===r:!1,i=le.useContext(zf),o=le.useContext(Pf),a=le.useContext(Lf),c=le.useContext(Rf),u=le.useContext(_f);let h=e.sendMemberName||e.sendNickName||e.senderUin;if(e.chatType===1&&!s&&u){const C=u.getFriend(e.senderUin);C&&(h=C.remark||C.nickname||h)}const f=`https://q1.qlogo.cn/g?b=qq&nk=${e.senderUin}&s=640`,p=parseInt(e.msgTime)*1e3;let v,y,w;if(e.chatType===2){const C=e.msgAttrs;if(C){const j=(S=>{if(C instanceof Map)return C.get(S);if(typeof C=="object")return C[S.toString()]})(2);j!=null&&j.groupHonor&&(v=j.groupHonor.level,y=j.groupHonor.uniqueTitle||void 0)}if(c){const A=c.getMembers(e.peerUin),j=A==null?void 0:A.find(S=>S.uid===e.senderUid||S.uin===e.senderUin);j&&(w=j.role,v===void 0&&j.level&&(v=j.level),!y&&j.specialTitle&&(y=j.specialTitle))}}if(!e.elements||!Array.isArray(e.elements))return null;const k=(O=e.elements.find(C=>C.replyElement))==null?void 0:O.replyElement,d=e.elements.filter(C=>!C.replyElement);if(!(d.some(dg)||k))return null;const g=d.length===1&&d[0].pttElement&&!k,N=k?t.find(C=>C.msgId===k.replayMsgId||C.msgSeq===k.replayMsgSeq):null,b=C=>{C.preventDefault(),C.stopPropagation(),i==null||i.showMenu(C,e)},M=C=>{C.preventDefault(),C.stopPropagation(),o==null||o.showMenu(C,{senderUid:e.senderUid,senderUin:e.senderUin,senderName:h,chatType:e.chatType,groupCode:e.chatType===2?e.peerUin:void 0})},_=C=>{("ontouchstart"in window||navigator.maxTouchPoints>0)&&(C.preventDefault(),C.stopPropagation(),o==null||o.showMenu(C,{senderUid:e.senderUid,senderUin:e.senderUin,senderName:h,chatType:e.chatType,groupCode:e.chatType===2?e.peerUin:void 0}))},T=()=>{k&&(a==null||a.scrollToMessage(k.replayMsgId,k.replayMsgSeq))};return l.jsxs("div",{className:`flex gap-2 w-full ${s?"flex-row-reverse":""} ${n?"animate-pulse bg-pink-100 dark:bg-pink-900/30 rounded-lg -mx-2 px-2":""}`,children:[l.jsx("img",{src:f,alt:h,loading:"lazy",className:"w-8 h-8 rounded-full object-cover flex-shrink-0 cursor-pointer hover:opacity-80 transition-opacity",onClick:_,onContextMenu:M}),l.jsxs("div",{className:`flex flex-col ${s?"items-end":"items-start"} max-w-[calc(100%-48px)] md:max-w-[70%] min-w-0 overflow-hidden`,children:[l.jsxs("div",{className:`flex items-center gap-1.5 mb-1 ${s?"flex-row-reverse":""}`,children:[l.jsx("span",{className:"text-xs text-theme-hint",children:h}),v!==void 0&&v>0&&l.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"&&l.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:y||"群主"}),w==="admin"&&l.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:y||"管理员"}),w==="member"&&y&&l.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:y})]}),g?l.jsx("div",{onContextMenu:b,children:d.map((C,A)=>l.jsx(Ci,{element:C,message:e},A))}):l.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 ${s?"rounded-tr-sm":"rounded-tl-sm"}`,onContextMenu:b,children:[k&&l.jsx("div",{className:"text-xs mb-2 pb-2 border-b border-theme-divider cursor-pointer hover:opacity-80 transition-opacity",onClick:T,children:l.jsx("div",{className:"bg-theme-input rounded px-2 py-1",children:N?l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-medium text-theme-secondary",children:[N.sendMemberName||N.sendNickName||N.senderUin,":"]}),l.jsx("div",{className:"text-theme-muted",children:(I=N.elements)==null?void 0:I.filter(C=>!C.replyElement).map((C,A)=>l.jsx(Ci,{element:C},A))})]}):l.jsx("span",{className:"text-theme-muted",children:k.sourceMsgText||"[消息]"})})}),d.map((C,A)=>l.jsx(Ci,{element:C,message:e},A))]}),e.emojiLikesList&&e.emojiLikesList.length>0&&l.jsx("div",{className:`flex flex-wrap gap-1 mt-1 ${s?"justify-end":"justify-start"}`,children:e.emojiLikesList.map((C,A)=>l.jsxs("div",{className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-xs ${C.isClicked?"bg-pink-100 dark:bg-pink-900/40 border border-pink-300 dark:border-pink-700":"bg-theme-item border border-theme-divider"}`,title:`表情 ${C.emojiId}`,children:[l.jsx("img",{src:`/face/${C.emojiId}.png`,alt:`表情${C.emojiId}`,className:"w-4 h-4",onError:j=>{C.emojiType==="2"&&(j.target.style.display="none")}}),l.jsx("span",{className:"text-theme-secondary",children:C.likesCnt})]},`${C.emojiId}-${A}`))}),l.jsx("span",{className:"text-xs text-theme-hint mt-1",children:ql(p)})]})]})}),gg=x.memo(({message:e,onRetry:t})=>{const n=Ca(),r=n?`https://q1.qlogo.cn/g?b=qq&nk=${n}&s=640`:"";return l.jsxs("div",{className:"flex gap-2 flex-row-reverse w-full",children:[r&&l.jsx("img",{src:r,alt:"我",loading:"lazy",className:"w-8 h-8 rounded-full object-cover flex-shrink-0"}),l.jsxs("div",{className:"flex flex-col items-end max-w-[calc(100%-48px)] md:max-w-[70%] min-w-0 overflow-hidden",children:[l.jsx("span",{className:"text-xs text-theme-hint mb-1",children:"我"}),l.jsxs("div",{className:"flex items-end gap-1",children:[e.status==="failed"&&l.jsx("button",{onClick:t,className:"p-1 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/30 rounded",title:"重新发送",children:l.jsx(Dm,{size:14})}),l.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((s,i)=>s.type==="text"&&s.content?l.jsx("span",{className:"whitespace-pre-wrap break-words",children:s.content},i):s.type==="face"&&s.faceId!==void 0?l.jsx("img",{src:`/face/${s.faceId}.png`,alt:`[表情${s.faceId}]`,className:"inline-block align-text-bottom",style:{width:24,height:24}},i):s.type==="image"&&s.imageUrl?l.jsx("img",{src:s.imageUrl,alt:"图片",loading:"lazy",className:"max-w-full rounded-lg",style:{maxHeight:"200px"}},i):s.type==="at"&&s.atName?l.jsxs("span",{className:"text-blue-500",children:["@",s.atName]},i):null)}),e.status==="sending"&&l.jsx(je,{size:14,className:"animate-spin text-theme-hint"}),e.status==="failed"&&l.jsx(Im,{size:14,className:"text-red-500"})]}),l.jsx("span",{className:"text-xs text-theme-hint mt-1",children:ql(e.timestamp)})]})]})}),yg=({name:e,onMute:t,onClose:n})=>{const[r,s]=x.useState(0),[i,o]=x.useState(0),[a,c]=x.useState(0),[u,h]=x.useState(0),f=()=>{const v=r+i*60+a*3600+u*86400;v>0&&t(v)},p=r+i*60+a*3600+u*86400;return Ae.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-50 bg-black/30",onClick:n}),l.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:[l.jsxs("h3",{className:"text-lg font-medium text-theme mb-4",children:["禁言 ",e]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-sm text-theme-secondary mb-3",children:"设置禁言时长:"}),l.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("input",{type:"number",min:0,max:59,value:r,onChange:v=>s(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"}),l.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"秒"})]}),l.jsxs("div",{className:"flex flex-col items-center",children:[l.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"}),l.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"分钟"})]}),l.jsxs("div",{className:"flex flex-col items-center",children:[l.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"}),l.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"小时"})]}),l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("input",{type:"number",min:0,max:29,value:u,onChange:v=>h(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"}),l.jsx("span",{className:"text-xs text-theme-secondary mt-1",children:"天"})]})]}),l.jsx("p",{className:"text-xs text-theme-secondary mt-2 text-center",children:"最长29天23小时59分59秒"})]}),l.jsxs("div",{className:"flex justify-between",children:[l.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:"解除禁言"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm text-theme-secondary hover:bg-theme-item rounded-lg transition-colors",children:"取消"}),l.jsx("button",{onClick:f,disabled:p===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)},vg=({name:e,groupName:t,onConfirm:n,onClose:r})=>Ae.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:r}),l.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:[l.jsx("h3",{className:"text-lg font-medium text-theme mb-4",children:"确认踢出"}),l.jsxs("p",{className:"text-theme-secondary mb-6",children:["确定要将 ",l.jsx("span",{className:"font-medium text-theme",children:e})," 移出群 ",l.jsx("span",{className:"font-medium text-theme",children:t})," 吗?"]}),l.jsxs("div",{className:"flex justify-end gap-3",children:[l.jsx("button",{onClick:r,className:"px-4 py-2 text-sm text-theme-secondary hover:bg-theme-item rounded-lg transition-colors",children:"取消"}),l.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),wg=({name:e,onConfirm:t,onClose:n})=>{const[r,s]=x.useState("");return Ae.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-50 bg-black/30",onClick:n}),l.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:[l.jsx("h3",{className:"text-lg font-medium text-theme mb-4",children:"设置头衔"}),l.jsxs("p",{className:"text-sm text-theme-secondary mb-3",children:["为 ",e," 设置专属头衔:"]}),l.jsx("input",{type:"text",maxLength:12,value:r,onChange:i=>s(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())}}),l.jsx("p",{className:"text-xs text-theme-secondary mt-2",children:"中文最多6字,英文最多12字,按回车确认"}),l.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm text-theme-secondary hover:bg-theme-item rounded-lg transition-colors",children:"取消"}),l.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 Af(e,t,n){const[r,s]=x.useState({left:-9999,top:-9999,ready:!1});return x.useEffect(()=>{s({left:-9999,top:-9999,ready:!1});const i=requestAnimationFrame(()=>{if(!n.current){s({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),s({left:c,top:u,ready:!0})});return()=>cancelAnimationFrame(i)},[e,t]),r}const kg=({contextMenu:e,session:t,getCachedMembers:n,onClose:r,onReply:s,onEmojiReaction:i,onRecall:o})=>{const a=e.message,c=os(),u=c&&a.senderUid===c,h=a.chatType===2,f=h&&t?n(t.peerId):null,p=f&&c?f.find(T=>T.uid===c):null,v=p==null?void 0:p.role,y=v==="owner",w=v==="admin"||v==="owner",k=f?f.find(T=>T.uid===a.senderUid):null,d=k==null?void 0:k.role,g=u||h&&(y||w&&!(d==="admin"||d==="owner")),N=!!e.elementId,b=x.useRef(null),M=Af(e.x,e.y,b),_=async()=>{if(e.elementId){r();try{const T=await se("ntFileApi","downloadMedia",[a.msgId,a.chatType,a.peerUid,e.elementId,"",""]);if(!T){Q("图片下载失败","error");return}const O=await se("ntMsgApi","addFavEmoji",[T]);O.result===0?Q(O.isExist?"表情已存在":"已添加到表情","success"):Q(O.errMsg||"添加失败","error")}catch(T){Q(T.message||"添加失败","error")}}};return Ae.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:r,onContextMenu:T=>{T.preventDefault(),r()}}),l.jsxs("div",{ref:b,className:"fixed z-50 bg-popup backdrop-blur-sm border border-theme-divider rounded-lg shadow-lg py-1 min-w-[100px]",style:{left:M.left,top:M.top,visibility:M.ready?"visible":"hidden"},onContextMenu:T=>T.preventDefault(),children:[l.jsxs("button",{onClick:()=>{s(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:[l.jsx(Om,{size:14})," 回复"]}),t.chatType===2&&l.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:[l.jsx(Wm,{size:14})," 贴表情"]}),N&&l.jsxs("button",{onClick:_,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[l.jsx(Hm,{size:14})," 添加到表情"]}),g&&l.jsxs("button",{onClick:async()=>{r();try{await af(a.chatType,a.peerUid,a.msgId),o(a.msgId),Q("消息已撤回","success")}catch(T){Q(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:[l.jsx(Et,{size:14})," 撤回"]})]})]}),document.body)},jg=({avatarContextMenu:e,getCachedMembers:t,onClose:n,onInsertAt:r,onShowProfile:s,onSetTitle:i,onMute:o,onKick:a,onAdminChanged:c,groupName:u})=>{const h=os(),f=e.groupCode?t(e.groupCode):null,p=f&&h?f.find(I=>I.uid===h):null,v=p==null?void 0:p.role,y=v==="owner",w=v==="admin",k=f?f.find(I=>I.uid===e.senderUid):null,d=k==null?void 0:k.role,m=d==="admin",g=y||w&&d==="member",N=y||w&&d==="member",b=e.senderUid===h,M=y&&!b,_=x.useRef(null),T=Af(e.x,e.y,_),O=async()=>{const I=e;n();try{const C=m?2:3;await se("ntGroupApi","setMemberRole",[I.groupCode,I.senderUid,C]),Q(m?"已取消管理员":"已设为管理员","success"),c==null||c()}catch(C){Q(C.message||"操作失败","error")}};return Ae.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:n,onContextMenu:I=>{I.preventDefault(),n()}}),l.jsxs("div",{ref:_,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:I=>I.preventDefault(),children:[e.chatType===2&&l.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:[l.jsx(zm,{size:14})," 召唤ta"]}),l.jsxs("button",{onClick:async()=>{const I=e;n();try{I.chatType===2&&I.groupCode?await kl(I.chatType,parseInt(I.senderUin),parseInt(I.groupCode)):await kl(I.chatType,parseInt(I.senderUin)),Q("戳一戳已发送","success")}catch(C){Q(C.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:[l.jsx(Lm,{size:14})," 戳一戳"]}),l.jsxs("button",{onClick:()=>{s(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:[l.jsx(Vm,{size:14})," 查看资料"]}),e.chatType===2&&e.groupCode&&y&&l.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:[l.jsx(Ix,{size:14})," 设置头衔"]}),e.chatType===2&&e.groupCode&&M&&l.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:[m?l.jsx(Qx,{size:14}):l.jsx(ls,{size:14}),m?"取消管理员":"设为管理员"]}),e.chatType===2&&e.groupCode&&!b&&g&&l.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:[l.jsx(Jx,{size:14})," 禁言"]}),e.chatType===2&&e.groupCode&&!b&&N&&l.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:[l.jsx(Yx,{size:14})," 踢出群"]})]})]}),document.body)},Ff=x.forwardRef(({placeholder:e="输入消息...",disabled:t=!1,onEnter:n,onPaste:r,onChange:s,onMentionChange:i},o)=>{const a=x.useRef(null),c=x.useRef(!1),u=x.useRef(null),[h,f]=x.useState(!1),p=x.useCallback(()=>{const C=a.current;if(!C)return[];const A=[],j=C.childNodes;for(let S=0;S<j.length;S++){const P=j[S];if(P.nodeType===Node.TEXT_NODE){const U=P.textContent||"";U&&A.push({type:"text",content:U})}else if(P.nodeType===Node.ELEMENT_NODE){const U=P;if(U.dataset.type==="face")A.push({type:"face",faceId:parseInt(U.dataset.faceId||"0")});else if(U.dataset.type==="image")A.push({type:"image",imageUrl:U.dataset.imageUrl,imageFile:U.__file});else if(U.dataset.type==="at")A.push({type:"at",atUid:U.dataset.atUid,atUin:U.dataset.atUin,atName:U.dataset.atName});else if(U.tagName==="BR")A.push({type:"text",content:`
378
+ `});else{const Y=U.textContent||"";Y&&A.push({type:"text",content:Y})}}}return A},[]),v=x.useCallback(()=>{var A;const C=p();return C.length===0||C.length===1&&C[0].type==="text"&&!((A=C[0].content)!=null&&A.trim())},[p]),y=x.useCallback(()=>{var P;const C=window.getSelection();if(!C||C.rangeCount===0)return{top:0,left:0};const j=C.getRangeAt(0).getBoundingClientRect(),S=(P=a.current)==null?void 0:P.getBoundingClientRect();return S?{top:S.bottom-j.top+8,left:j.left-S.left}:{top:0,left:0}},[]),w=x.useCallback(()=>{if(!u.current)return"";const C=window.getSelection();if(!C||C.rangeCount===0)return"";const A=C.getRangeAt(0),{node:j,offset:S}=u.current;return A.startContainer!==j?"":(j.textContent||"").slice(S,A.startOffset)},[]),k=x.useCallback(()=>{u.current=null,f(!1),i==null||i({active:!1,query:"",position:{top:0,left:0}})},[i]),d=x.useCallback(()=>{const C=window.getSelection();if(!C||C.rangeCount===0)return;const A=C.getRangeAt(0),j=A.startContainer;if(j.nodeType!==Node.TEXT_NODE){h&&k();return}const S=j.textContent||"",P=A.startOffset;if(h&&u.current){if(u.current.node===j&&P>=u.current.offset){const E=w();E.includes(" ")?k():i==null||i({active:!0,query:E,position:y()})}else k();return}const U=S.slice(0,P),Y=U.lastIndexOf("@");if(Y!==-1){const E=Y>0?U[Y-1]:" ";if(E===" "||E===`
379
+ `||Y===0){const $=U.slice(Y+1);$.includes(" ")||(u.current={node:j,offset:Y+1},f(!0),i==null||i({active:!0,query:$,position:y()}))}}},[h,w,y,k,i]),m=x.useCallback(C=>{const A=a.current;if(!A)return;k();const j=document.createElement("span");j.contentEditable="false",j.dataset.type="face",j.dataset.faceId=String(C),j.className="inline-block align-middle mx-0.5 select-all",j.innerHTML=`<img src="/face/${C}.png" alt="[表情]" class="w-6 h-6 inline-block" draggable="false" />`;const S=window.getSelection();if(S&&S.rangeCount>0){const P=S.getRangeAt(0);A.contains(P.commonAncestorContainer)?(P.deleteContents(),P.insertNode(j),P.setStartAfter(j),P.setEndAfter(j),S.removeAllRanges(),S.addRange(P)):A.appendChild(j)}else A.appendChild(j);A.focus(),s==null||s(p())},[s,p,k]),g=x.useCallback((C,A)=>{const j=a.current;if(!j)return;k();const S=document.createElement("span");S.contentEditable="false",S.dataset.type="image",S.dataset.imageUrl=A,C&&(S.__file=C),S.className="inline-block align-middle mx-0.5 select-all",S.innerHTML=`<img src="${A}" alt="[图片]" class="h-16 max-w-[200px] rounded inline-block object-cover" draggable="false" />`;const P=window.getSelection();if(P&&P.rangeCount>0){const U=P.getRangeAt(0);j.contains(U.commonAncestorContainer)?(U.deleteContents(),U.insertNode(S),U.setStartAfter(S),U.setEndAfter(S),P.removeAllRanges(),P.addRange(U)):j.appendChild(S)}else j.appendChild(S);j.focus(),s==null||s(p())},[s,p,k]),N=x.useCallback((C,A,j)=>{const S=a.current;if(!S)return;if(h&&u.current){const{node:$,offset:q}=u.current,G=window.getSelection();if(G&&G.rangeCount>0){const B=G.getRangeAt(0),ne=document.createRange();ne.setStart($,q-1),ne.setEnd(B.startContainer,B.startOffset),ne.deleteContents()}}k();const P=document.createElement("span");P.contentEditable="false",P.dataset.type="at",P.dataset.atUid=C,P.dataset.atUin=A,P.dataset.atName=j,P.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",P.textContent=`@${j}`;const U=window.getSelection();if(U&&U.rangeCount>0){const $=U.getRangeAt(0);S.contains($.commonAncestorContainer)?($.deleteContents(),$.insertNode(P),$.setStartAfter(P),$.setEndAfter(P),U.removeAllRanges(),U.addRange($)):S.appendChild(P)}else S.appendChild(P);const Y=document.createTextNode(" ");P.after(Y);const E=document.createRange();E.setStartAfter(Y),E.setEndAfter(Y),U==null||U.removeAllRanges(),U==null||U.addRange(E),S.focus(),s==null||s(p())},[h,s,p,k]),b=x.useCallback(()=>{const C=a.current;C&&(C.innerHTML="",k(),s==null||s([]))},[s,k]);x.useImperativeHandle(o,()=>({focus:()=>{var C;return(C=a.current)==null?void 0:C.focus()},clear:b,insertFace:m,insertImage:g,insertAt:N,getContent:p,isEmpty:v,cancelMention:k}),[b,m,g,N,p,v,k]);const M=x.useCallback(C=>{if(h){if(["ArrowUp","ArrowDown","Enter","Tab"].includes(C.key))return;if(C.key==="Escape"){C.preventDefault(),k();return}}C.key==="Enter"&&!C.shiftKey&&!c.current&&!h&&(C.preventDefault(),n==null||n())},[n,h,k]),_=x.useCallback(()=>{d(),s==null||s(p())},[s,p,d]),T=x.useCallback(C=>{var S,P;const A=(S=C.clipboardData)==null?void 0:S.items;if(A){for(let U=0;U<A.length;U++)if(A[U].type.startsWith("image/")){C.preventDefault(),r==null||r(C);return}}C.preventDefault();const j=(P=C.clipboardData)==null?void 0:P.getData("text/plain");j&&document.execCommand("insertText",!1,j)},[r]),O=x.useCallback(()=>{setTimeout(d,0)},[d]),I=x.useCallback(()=>{setTimeout(()=>{h&&k()},200)},[h,k]);return l.jsxs("div",{className:"relative",children:[l.jsx("div",{ref:a,contentEditable:!t,onKeyDown:M,onInput:_,onPaste:T,onClick:O,onBlur:I,onCompositionStart:()=>{c.current=!0},onCompositionEnd:()=>{c.current=!1,_()},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}),l.jsx("style",{children:`
380
+ [data-placeholder]:empty:before {
381
+ content: attr(data-placeholder);
382
+ color: var(--theme-hint, #9ca3af);
383
+ pointer-events: none;
384
+ }
385
+ `})]})});Ff.displayName="RichInput";const Ng=({members:e,loading:t,query:n,position:r,onSelect:s,onClose:i})=>{const o=x.useRef(null),[a,c]=x.useState(0),u=x.useMemo(()=>{if(!n)return e.slice(0,20);const f=n.toLowerCase();return e.filter(p=>{var v;return p.nickname.toLowerCase().includes(f)||((v=p.card)==null?void 0:v.toLowerCase().includes(f))||p.uin.includes(n)}).slice(0,20)},[e,n]);x.useEffect(()=>{c(0)},[n]),x.useEffect(()=>{const f=p=>{p.key==="ArrowDown"?(p.preventDefault(),c(v=>Math.min(v+1,u.length-1))):p.key==="ArrowUp"?(p.preventDefault(),c(v=>Math.max(v-1,0))):p.key==="Enter"||p.key==="Tab"?(p.preventDefault(),u[a]&&s(u[a])):p.key==="Escape"&&(p.preventDefault(),i())};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[u,a,s,i]),x.useEffect(()=>{const f=p=>{o.current&&!o.current.contains(p.target)&&i()};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[i]),x.useEffect(()=>{const f=o.current;if(!f)return;const p=f.querySelector(`[data-index="${a}"]`);p&&p.scrollIntoView({block:"nearest"})},[a]);const h=f=>f==="owner"?l.jsx($l,{size:12,className:"text-yellow-500"}):f==="admin"?l.jsx(ls,{size:12,className:"text-green-500"}):null;return l.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?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(je,{size:20,className:"animate-spin text-pink-500"})}):u.length===0?l.jsx("div",{className:"py-3 px-4 text-sm text-theme-muted text-center",children:n?"没有匹配的成员":"暂无成员"}):l.jsx("div",{className:"max-h-[200px] overflow-y-auto py-1",children:u.map((f,p)=>l.jsxs("div",{"data-index":p,onClick:()=>s(f),className:`flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${p===a?"bg-pink-50 dark:bg-pink-900/30":"hover:bg-theme-item-hover"}`,children:[l.jsx("img",{src:f.avatar||`https://q1.qlogo.cn/g?b=qq&nk=${f.uin}&s=40`,alt:"",className:"w-7 h-7 rounded-full flex-shrink-0",loading:"lazy"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-sm text-theme truncate",children:f.card||f.nickname}),h(f.role)]}),f.card&&f.card!==f.nickname&&l.jsx("div",{className:"text-xs text-theme-muted truncate",children:f.nickname})]})]},f.uid))})})},bg=[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,392,393,394,395],Uf="webqq_recent_emojis",Sg=10;function zo(){try{const e=localStorage.getItem(Uf);return e?JSON.parse(e):[]}catch{return[]}}function Cg(e){const t=zo().filter(n=>n!==e);t.unshift(e),localStorage.setItem(Uf,JSON.stringify(t.slice(0,Sg)))}const $f=({onSelect:e,onClose:t,position:n,inline:r})=>{const[s,i]=x.useState(new Set),[o,a]=x.useState(zo()),c=x.useRef(null);x.useEffect(()=>{const h=f=>{c.current&&!c.current.contains(f.target)&&t()};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[t]);const u=h=>{Cg(h),a(zo()),e(h)};return l.jsxs("div",{ref:c,className:`${r?"":"absolute bottom-full left-0 mb-2"} bg-theme-card border border-theme-divider rounded-xl shadow-xl z-50`,style:n?{left:n.x,bottom:n.y}:void 0,children:[l.jsx("div",{className:"p-2 border-b border-theme-divider text-sm text-theme-secondary",children:"表情"}),l.jsxs("div",{className:"p-2 max-h-[280px] overflow-y-auto w-[320px]",children:[o.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-xs text-theme-hint mb-1",children:"最近使用"}),l.jsx("div",{className:"grid grid-cols-8 gap-1 mb-2 pb-2 border-b border-theme-divider",children:o.map(h=>l.jsx("button",{onClick:()=>u(h),className:"w-8 h-8 flex items-center justify-center hover:bg-theme-item rounded transition-colors",title:`表情 ${h}`,children:l.jsx("img",{src:`/face/${h}.png`,alt:`表情${h}`,className:"w-6 h-6"})},`recent-${h}`))})]}),l.jsx("div",{className:"grid grid-cols-8 gap-1",children:bg.map(h=>l.jsx("button",{onClick:()=>u(h),className:"w-8 h-8 flex items-center justify-center hover:bg-theme-item rounded transition-colors",title:`表情 ${h}`,children:l.jsx("img",{src:`/face/${h}.png`,alt:`表情${h}`,className:`w-6 h-6 transition-opacity ${s.has(h)?"opacity-100":"opacity-0"}`,onLoad:()=>i(f=>new Set(f).add(h)),onError:f=>{f.target.style.display="none"}})},h))})]})]})};let zn=null;const za="webqq_recent_fav_emojis",Eg=10;function Ar(){try{const e=localStorage.getItem(za);return e?JSON.parse(e):[]}catch{return[]}}function Tg(e){const t=Ar().filter(n=>n.emoId!==e.emoId);t.unshift(e),localStorage.setItem(za,JSON.stringify(t.slice(0,Eg)))}function Mg(e){const t=Ar().filter(n=>n.emoId!==e);localStorage.setItem(za,JSON.stringify(t))}const Ig=({x:e,y:t,onClose:n,onDelete:r})=>{const s=x.useRef(null),[i,o]=x.useState({left:e,top:t});return x.useEffect(()=>{if(!s.current)return;const a=s.current.getBoundingClientRect(),c=10;let u=e,h=t;e+a.width>window.innerWidth-c&&(u=e-a.width),u<c&&(u=c),t+a.height>window.innerHeight-c&&(h=t-a.height),h<c&&(h=c),o({left:u,top:h})},[e,t]),Ae.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-[60]",onClick:n,onContextMenu:a=>{a.preventDefault(),n()}}),l.jsx("div",{ref:s,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:l.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:[l.jsx(Et,{size:14})," 删除"]})})]}),document.body)},zg=({onSelect:e,onClose:t})=>{const[n,r]=x.useState(zn||[]),[s,i]=x.useState(!zn),[o,a]=x.useState(null),[c,u]=x.useState(Ar()),[h,f]=x.useState(null),p=x.useRef(null);x.useEffect(()=>{if(zn){r(zn),i(!1);return}(async()=>{try{const N=((await se("ntMsgApi","fetchFavEmojiList",[1e3])).emojiInfoList||[]).map(b=>({emoId:b.emoId,resId:b.resId||"",url:b.url,desc:b.desc||""}));zn=N,r(N)}catch{a("加载失败")}finally{i(!1)}})()},[]);const v=x.useRef(h);v.current=h,x.useEffect(()=>{const d=m=>{v.current||p.current&&!p.current.contains(m.target)&&t()};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[t]);const y=d=>{Tg(d),u(Ar()),e(d)},w=(d,m)=>{d.preventDefault(),d.stopPropagation(),f({x:d.clientX,y:d.clientY,emoji:m})},k=async()=>{if(!h)return;const{emoji:d}=h;f(null);try{const m=await se("ntMsgApi","deleteFavEmoji",[[d.resId]]);if(m.result===0){Q("已删除","success");const g=n.filter(N=>N.emoId!==d.emoId);r(g),zn=g,Mg(d.emoId),u(Ar())}else Q(m.errMsg||"删除失败","error")}catch(m){Q(m.message||"删除失败","error")}};return l.jsxs("div",{ref:p,className:"absolute bottom-full left-0 mb-2 bg-theme-card border border-theme-divider rounded-xl shadow-xl z-50 w-[320px]",children:[l.jsx("div",{className:"p-2 border-b border-theme-divider text-sm text-theme-secondary",children:"收藏表情"}),l.jsxs("div",{className:"p-2 max-h-[300px] overflow-y-auto",children:[c.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-xs text-theme-hint mb-1",children:"最近使用"}),l.jsx("div",{className:"grid grid-cols-4 gap-1 mb-2 pb-2 border-b border-theme-divider",children:c.map(d=>l.jsx("button",{onClick:()=>y(d),onContextMenu:m=>w(m,d),className:"p-1 rounded-lg hover:bg-theme-item transition-colors",title:d.desc,children:l.jsx("img",{src:d.url,alt:d.desc,className:"w-16 h-16 object-contain"})},`recent-${d.emoId}`))})]}),s?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(je,{size:24,className:"animate-spin text-pink-500"})}):o?l.jsx("div",{className:"text-center py-8 text-theme-hint text-sm",children:o}):n.length===0?l.jsx("div",{className:"text-center py-8 text-theme-hint text-sm",children:"暂无收藏表情"}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-xs text-theme-hint mb-1",children:"全部"}),l.jsx("div",{className:"grid grid-cols-4 gap-1",children:n.map(d=>l.jsx("button",{onClick:()=>y(d),onContextMenu:m=>w(m,d),className:"p-1 rounded-lg hover:bg-theme-item transition-colors",title:d.desc,children:l.jsx("img",{src:d.url,alt:d.desc,className:"w-16 h-16 object-contain",loading:"lazy"})},d.emoId))})]})]}),h&&l.jsx(Ig,{x:h.x,y:h.y,emoji:h.emoji,onClose:()=>f(null),onDelete:k})]})},Pg=({target:e,onClose:t,containerRef:n})=>{const r=async o=>{const a=e.message;t();try{const c={chatType:a.chatType,peerUid:a.peerUin,guildId:""};await se("ntMsgApi","setEmojiLike",[c,a.msgSeq,String(o),!0]),Q("已贴表情","success")}catch(c){Q(c.message||"贴表情失败","error")}},i=(()=>{if(n!=null&&n.current){const o=n.current.getBoundingClientRect();return{left:o.left+o.width/2,top:o.top+o.height/2}}return{left:window.innerWidth/2,top:window.innerHeight/2}})();return Ae.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:t}),l.jsx("div",{className:"fixed z-50 -translate-x-1/2 -translate-y-1/2",style:{left:i.left,top:i.top},children:l.jsx($f,{onSelect:r,onClose:t,inline:!0})})]}),document.body)},Df=x.forwardRef((e,t)=>{var ue;const{session:n,replyTo:r,onReplyCancel:s,onSendStart:i,onSendEnd:o,onTempMessage:a,onTempMessageRemove:c,onTempMessageFail:u}=e,h=x.useRef(null),f=x.useRef(null),p=x.useRef(null),[v,y]=x.useState(!1),[w,k]=x.useState(!1),[d,m]=x.useState(!1),[g,N]=x.useState(!1),[b,M]=x.useState({active:!1,query:"",position:{top:0,left:0}}),[_,T]=x.useState([]),[O,I]=x.useState(!1),{getCachedMembers:C,fetchGroupMembers:A}=xt(),j=x.useRef(null),S=x.useRef(C);S.current=C;const P=x.useRef(A);P.current=A,x.useImperativeHandle(t,()=>({insertAt:(W,K,oe)=>{var xe;(xe=h.current)==null||xe.insertAt(W,K,oe)},focus:()=>{var W;(W=h.current)==null||W.focus()}}),[]),x.useEffect(()=>{const W=(n==null?void 0:n.chatType)===2?n.peerId:null;if(j.current=W,!W){T([]),I(!1);return}const K=!Ia(2,W);if(!K){const oe=S.current(W);if(oe){T(oe),I(!1);return}}I(!0),T([]),P.current(W,K).then(oe=>{j.current===W&&(T(oe),I(!1))}).catch(()=>{j.current===W&&I(!1)})},[n==null?void 0:n.chatType,n==null?void 0:n.peerId]);const U=x.useCallback(W=>{if((n==null?void 0:n.chatType)!==2){M({active:!1,query:"",position:{top:0,left:0}});return}M(W)},[n==null?void 0:n.chatType]),Y=x.useCallback(W=>{var K;(K=h.current)==null||K.insertAt(W.uid,W.uin,W.card||W.nickname)},[]),E=x.useCallback(()=>{var W;(W=h.current)==null||W.cancelMention()},[]),$=x.useCallback(async()=>{if(!n||!h.current)return;const W=h.current.getContent();if(h.current.isEmpty())return;m(!0),i();const oe=r;h.current.clear(),s(),N(!1);const xe=W.map(de=>({type:de.type,content:de.content,faceId:de.faceId,imageUrl:de.imageUrl,atName:de.atName})),ze=`temp_${Date.now()}`;a({msgId:ze,items:xe,timestamp:Date.now(),status:"sending"});try{const de=[];oe&&de.push({type:"reply",msgId:oe.msgId,msgSeq:oe.msgSeq});for(const ge of W)if(ge.type==="text"&&ge.content)de.push({type:"text",text:ge.content});else if(ge.type==="face"&&ge.faceId!==void 0)de.push({type:"face",faceId:ge.faceId});else if(ge.type==="image"){if(ge.imageFile){const on=await rf(ge.imageFile);de.push({type:"image",imagePath:on.imagePath})}else if(ge.imageUrl){const on=await sf(ge.imageUrl);de.push({type:"image",imagePath:on.imagePath})}}else ge.type==="at"&&ge.atUid&&de.push({type:"at",uid:ge.atUid,uin:ge.atUin,name:ge.atName});if(de.length===0){c(ze);return}await Io({chatType:n.chatType,peerId:n.peerId,content:de}),c(ze)}catch{Q("发送失败","error"),u(ze)}finally{m(!1),o(),setTimeout(()=>{var de;return(de=h.current)==null?void 0:de.focus()},50)}},[n,r,i,o,s,a,c,u]),q=x.useCallback(W=>{var K;(K=h.current)==null||K.insertFace(W),y(!1)},[]),G=x.useCallback(W=>{var K;k(!1),(K=h.current)==null||K.insertImage(null,W.url)},[]),B=x.useCallback(W=>{var oe,xe;const K=(oe=W.target.files)==null?void 0:oe[0];if(K){if(!vf(K.name)){Q("不支持的图片格式,仅支持 JPG、PNG、GIF","error");return}(xe=h.current)==null||xe.insertImage(K,URL.createObjectURL(K)),f.current&&(f.current.value="")}},[]),ne=x.useCallback(async W=>{var xe;const K=(xe=W.target.files)==null?void 0:xe[0];if(!K||!n)return;if(K.size>100*1024*1024){Q("文件过大,最大支持 100MB","error");return}p.current&&(p.current.value=""),m(!0),i();const oe=`temp_${Date.now()}`;a({msgId:oe,items:[{type:"text",content:`[文件] ${K.name}`}],timestamp:Date.now(),status:"sending"});try{const ze=await lf(K);await Io({chatType:n.chatType,peerId:n.peerId,content:[{type:"file",filePath:ze.filePath,fileName:ze.fileName}]}),c(oe)}catch{Q("发送失败","error"),u(oe)}finally{m(!1),o()}},[n,i,o,a,c,u]),Z=x.useCallback(W=>{var oe,xe,ze;const K=(oe=W.clipboardData)==null?void 0:oe.items;if(K){for(let de=0;de<K.length;de++)if(K[de].type.startsWith("image/")){const ge=K[de].getAsFile();if(!ge)continue;const on=(xe=ge.type.split("/")[1])==null?void 0:xe.toLowerCase();if(!["jpeg","jpg","png","gif"].includes(on)){Q("不支持的图片格式","error");return}(ze=h.current)==null||ze.insertImage(ge,URL.createObjectURL(ge));return}}},[]),Te=x.useCallback(W=>{var K;N(W.length>0&&!(W.length===1&&W[0].type==="text"&&!((K=W[0].content)!=null&&K.trim())))},[]);return l.jsxs("div",{className:"border-t border-theme-divider bg-theme-card",children:[r&&l.jsx("div",{className:"px-4 py-2 border-b border-theme-divider bg-theme-item",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Om,{size:16,className:"text-pink-500 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0 text-sm text-theme-secondary truncate",children:["回复 ",r.sendMemberName||r.sendNickName||r.senderUin,":",(ue=r.elements)==null?void 0:ue.filter(W=>!W.replyElement).map((W,K)=>W.textElement?l.jsx("span",{children:W.textElement.content},K):W.picElement?l.jsx("span",{children:"[图片]"},K):W.faceElement?l.jsx("span",{children:"[表情]"},K):null)]}),l.jsx("button",{onClick:s,className:"p-1 text-theme-hint hover:text-theme rounded",children:l.jsx(wt,{size:16})})]})}),l.jsxs("div",{className:"px-4 pt-0.5 pb-3",children:[l.jsxs("div",{className:"flex items-center gap-1 mb-2 relative",children:[l.jsx("button",{onClick:()=>{y(!v),k(!1)},disabled:d,className:`p-2 rounded-lg transition-colors disabled:opacity-50 ${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:l.jsx(Wm,{size:18})}),l.jsx("button",{onClick:()=>{k(!w),y(!1)},disabled:d,className:`p-2 rounded-lg transition-colors disabled:opacity-50 ${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:l.jsx(Kx,{size:18})}),l.jsx("button",{onClick:()=>{var W;return(W=f.current)==null?void 0:W.click()},disabled:d,className:"p-2 text-theme-muted hover:text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors disabled:opacity-50",title:"图片",children:l.jsx(Ux,{size:18})}),l.jsx("button",{onClick:()=>{var W;return(W=p.current)==null?void 0:W.click()},disabled:d,className:"p-2 text-theme-muted hover:text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors disabled:opacity-50",title:"文件",children:l.jsx(Um,{size:18})}),v&&l.jsx($f,{onSelect:q,onClose:()=>y(!1)}),w&&l.jsx(zg,{onSelect:G,onClose:()=>k(!1)})]}),l.jsxs("div",{className:"flex items-end gap-2 relative",children:[l.jsx("input",{type:"file",ref:f,onChange:B,accept:"image/jpeg,image/png,image/gif",className:"hidden"}),l.jsx("input",{type:"file",ref:p,onChange:ne,className:"hidden"}),l.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:l.jsx(Ff,{ref:h,placeholder:"输入消息...",disabled:d,onEnter:$,onPaste:Z,onChange:Te,onMentionChange:U})}),b.active&&(n==null?void 0:n.chatType)===2&&l.jsx(Ng,{members:_,loading:O,query:b.query,position:b.position,onSelect:Y,onClose:E}),l.jsx("button",{onClick:$,disabled:d||!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:d?l.jsx(je,{size:20,className:"animate-spin"}):l.jsx(vl,{size:20})})]})]})]})});Df.displayName="ChatInput";const Lg=({tip:e,onScrollToMessage:t})=>l.jsx("div",{className:"flex justify-center py-2",children:l.jsxs("span",{className:"text-xs text-theme-hint bg-theme-item/50 px-3 py-1 rounded-full",children:[l.jsx("span",{className:"text-blue-500",children:e.userName}),l.jsx("span",{children:" 回应了"}),l.jsx("span",{className:"text-blue-500 cursor-pointer hover:underline",onClick:()=>t(e.msgSeq),children:"消息"}),l.jsx("span",{children:" "}),l.jsx("img",{src:`/face/${e.emojiId}.png`,alt:"emoji",className:"inline-block w-4 h-4 align-text-bottom",onError:n=>{const r=n.target;r.dataset.fallback||(r.dataset.fallback="1",r.src=`https://gxh.vip.qq.com/club/item/parcel/item/${e.emojiId.slice(0,2)}/${e.emojiId}/100x100.png`)}})]})}),Rg=({session:e,onShowMembers:t,onNewMessageCallback:n,onEmojiReactionCallback:r,appendInputText:s,onAppendInputTextConsumed:i,onBack:o,showBackButton:a})=>{const[c,u]=x.useState([]),[h,f]=x.useState([]),[p,v]=x.useState([]),[y,w]=x.useState(!1),[k,d]=x.useState(!1),[m,g]=x.useState(!0),[N,b]=x.useState(null),[M,_]=x.useState(null),[T,O]=x.useState(null),[I,C]=x.useState(null),[A,j]=x.useState(null),[S,P]=x.useState(null),[U,Y]=x.useState(null),[E,$]=x.useState(!1),[q,G]=x.useState(null),[B,ne]=x.useState(null),[Z,Te]=x.useState(null),[ue,W]=x.useState(null),[K,oe]=x.useState(null),[xe,ze]=x.useState(!1),de=x.useMemo(()=>({showPreview:z=>b(z)}),[]),ge=x.useMemo(()=>({showPreview:(z,L,R,D)=>_({chatType:z,peerUid:L,msgId:R,elementId:D})}),[]),on=x.useMemo(()=>({showMenu:(z,L)=>{C({x:z.clientX,y:z.clientY,message:L})}}),[]),Of=x.useMemo(()=>({showMenu:(z,L,R)=>{C({x:z.clientX,y:z.clientY,message:L,elementId:R})}}),[]),qf=x.useMemo(()=>({showMenu:(z,L)=>{j({x:z.clientX,y:z.clientY,...L})}}),[]),{getCachedMembers:as,setCachedMembers:Bg,fetchGroupMembers:Wf,friendCategories:Pa}=xt(),La=x.useRef(null),cs=x.useRef(null),Hl=x.useRef(null),ar=x.useRef(e),cr=x.useRef(!0),Ra=x.useRef(null),Bl=x.useRef([]),ur=x.useRef(new Map),_a=x.useRef(null),Vl=x.useRef(!1),us=x.useRef(null),Aa=x.useRef(!0),Hf=x.useRef(0),Ql=x.useRef(!1);x.useEffect(()=>{ar.current=e},[e]);const Be=x.useMemo(()=>{const z=new Set,L=c.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})),R=h.map(X=>({type:"temp",data:X})),D=p.map(X=>({type:"system",data:X})),J=[...L,...R,...D];return J.sort((X,ee)=>{const he=ae=>ae.type==="raw"?parseInt(ae.data.msgTime)*1e3:(ae.type==="temp",ae.data.timestamp);return he(X)-he(ee)}),Bl.current=J,J},[c,h,p]),ut=Nf({count:Be.length,getScrollElement:()=>cs.current,estimateSize:()=>80,overscan:5}),Gl=x.useCallback((z,L)=>{const R=Be.findIndex(D=>D.type!=="raw"?!1:D.data.msgId===z||L&&D.data.msgSeq===L);if(R!==-1){ut.scrollToIndex(R,{align:"center"});const D=Be[R];D.type==="raw"&&(G(D.data.msgId),setTimeout(()=>G(null),2e3))}},[Be,ut]),Bf=x.useMemo(()=>({scrollToMessage:Gl}),[Gl]),Vf=x.useMemo(()=>({getMembers:z=>as(z)}),[as]),Qf=x.useMemo(()=>({getFriend:z=>{for(const L of Pa){const R=L.friends.find(D=>D.uin===z);if(R)return{uid:R.uid,uin:R.uin,nickname:R.nickname,remark:R.remark}}return null}}),[Pa]),Kl=x.useCallback(()=>{Bl.current.length>0&&ut.scrollToIndex(Bl.current.length-1,{align:"end"})},[ut]),[Fa,Ua]=x.useState(!1),dr=x.useRef(null);x.useEffect(()=>{const z=e?`${e.chatType}_${e.peerId}`:null;z!==Ra.current&&(Ra.current=z,$(!1),Ua(!0))},[e==null?void 0:e.chatType,e==null?void 0:e.peerId]),x.useEffect(()=>{if(!(Be.length===0||!Fa))return dr.current&&clearTimeout(dr.current),dr.current=setTimeout(()=>{Ua(!1);const z=()=>ut.scrollToIndex(Be.length-1,{align:"end"});requestAnimationFrame(()=>{z(),setTimeout(z,50),setTimeout(()=>{z(),$(!0)},100)})},200),()=>{dr.current&&clearTimeout(dr.current)}},[Be.length,Fa,ut]),x.useEffect(()=>{cr.current&&Be.length>0&&(Kl(),cr.current=!1)},[Be.length,Kl]),x.useEffect(()=>(n&&n(L=>{!L||!L.msgId||!L.elements||!Array.isArray(L.elements)||(u(R=>{if(R.some(X=>X&&X.msgId===L.msgId))return R;const D=[...R,L],J=ar.current;return J&&Cf(J.chatType,J.peerId,L),D}),f(R=>R.filter(D=>D.status!=="sending")))}),()=>{n&&n(null)}),[n]),x.useEffect(()=>(r&&r(L=>{if(u(R=>R.map(D=>{if(D.msgSeq!==L.msgSeq)return D;const J=D.emojiLikesList||[];if(L.isAdd){const X=J.findIndex(ee=>ee.emojiId===L.emojiId);if(X>=0){const ee=[...J];return ee[X]={...ee[X],likesCnt:String(parseInt(ee[X].likesCnt)+1)},{...D,emojiLikesList:ee}}else return{...D,emojiLikesList:[...J,{emojiId:L.emojiId,emojiType:parseInt(L.emojiId)>999?"2":"1",likesCnt:"1",isClicked:!1}]}}else{const X=J.findIndex(ee=>ee.emojiId===L.emojiId);if(X>=0){const ee=[...J],he=parseInt(ee[X].likesCnt)-1;return he<=0?ee.splice(X,1):ee[X]={...ee[X],likesCnt:String(he)},{...D,emojiLikesList:ee}}}return D})),L.isAdd){const R={id:`tip_${Date.now()}_${Math.random()}`,type:"emoji-reaction",userName:L.userName,emojiId:L.emojiId,msgSeq:L.msgSeq,timestamp:Date.now()};v(D=>[...D,R])}}),()=>{r&&r(null)}),[r]);const $a=(z,L)=>`${z}_${L}`,Da=x.useCallback(async(z,L)=>{var X;if(!e)return;const R=e.chatType,D=e.peerId,J=()=>{const ee=ar.current;return ee&&ee.chatType===R&&ee.peerId===D};console.log("[ChatWindow] loadMessages called:",{chatType:R,peerId:D,beforeMsgSeq:z,afterMsgSeq:L}),z?d(!0):w(!0),z&&c.length>0&&(us.current=((X=c[0])==null?void 0:X.msgId)||null);try{const ee=await Qs(R,D,z,20,L);if(console.log("[ChatWindow] API response:",{messagesCount:ee.messages.length,hasMore:ee.hasMore}),!J()){console.log("[ChatWindow] Session changed after API call, skipping");return}const he=ee.messages.filter(ae=>ae!=null&&ae.elements&&Array.isArray(ae.elements));return console.log("[ChatWindow] Valid messages:",he.length),u(ae=>{const Tt=new Set(ae.map(rt=>rt.msgId)),dt=he.filter(rt=>!Tt.has(rt.msgId)),Ne=z?[...dt,...ae]:[...ae,...dt];return Ne.sort((rt,Mt)=>parseInt(rt.msgTime)-parseInt(Mt.msgTime)),console.log("[ChatWindow] Merged messages:",Ne.length,"new:",dt.length),Yn(R,D,Ne),Ne}),g(ee.hasMore),{validMessages:he,hasMore:ee.hasMore}}catch(ee){if(console.error("[ChatWindow] loadMessages error:",ee),us.current=null,!J())return;Q(z?"加载更多消息失败":"加载消息失败","error")}finally{J()&&(w(!1),d(!1))}},[e,c]),Gf=x.useCallback(async z=>{var J,X,ee;if(!e)return;const L=e.chatType,R=e.peerId;w(!0);const D=()=>{const he=ar.current;return he&&he.chatType===L&&he.peerId===R};try{const he=await Qs(L,R);if(!D()){console.log("[ChatWindow] Session changed during API call, skipping");return}const ae=he.messages.filter(Ne=>Ne!=null&&Ne.elements&&Array.isArray(Ne.elements));if(console.log("[ChatWindow] Latest messages from API:",ae.length),ae.length===0){g(!1);return}const Tt=new Set(z.map(Ne=>Ne.msgId));if(ae.some(Ne=>Tt.has(Ne.msgId))||z.length===0){console.log("[ChatWindow] Has overlap with cache, merging directly");const rt=[...z,...ae].filter((Mt,En,Oa)=>Oa.findIndex(mr=>mr.msgId===Mt.msgId)===En);rt.sort((Mt,En)=>parseInt(Mt.msgTime)-parseInt(En.msgTime)),u(rt),Yn(L,R,rt),g(he.hasMore)}else{console.log("[ChatWindow] No overlap, need to fill gap");let Ne=[...ae],rt=(J=ae[0])==null?void 0:J.msgSeq,Mt=he.hasMore;const En=(X=z[z.length-1])==null?void 0:X.msgSeq;for(let an=0;an<10&&Mt;an++){if(!D()){console.log("[ChatWindow] Session changed during gap fill, skipping");return}const Tn=await Qs(L,R,rt),cn=Tn.messages.filter(kt=>kt!=null&&kt.elements&&Array.isArray(kt.elements));if(cn.length===0)break;Ne=[...cn,...Ne],rt=(ee=cn[0])==null?void 0:ee.msgSeq,Mt=Tn.hasMore;const Yl=new Set(cn.map(kt=>kt.msgId));if(z.some(kt=>Yl.has(kt.msgId))||En&&cn.some(kt=>parseInt(kt.msgSeq)<=parseInt(En))){console.log("[ChatWindow] Connected with cache after",an+1,"iterations");break}}const mr=[...z,...Ne].filter((an,Tn,cn)=>cn.findIndex(Yl=>Yl.msgId===an.msgId)===Tn);mr.sort((an,Tn)=>parseInt(an.msgTime)-parseInt(Tn.msgTime)),u(mr),Yn(L,R,mr),g(Mt)}}catch(he){console.error("[ChatWindow] loadMessagesAndMergeWithCache error:",he),Q("加载消息失败","error")}finally{D()&&w(!1)}},[e]);x.useEffect(()=>{const z=us.current;if(z&&Be.length>0){const L=Be.findIndex(R=>R.type==="raw"&&R.data.msgId===z);L!==-1&&ut.scrollToIndex(L,{align:"start"}),us.current=null}},[Be,ut]),x.useEffect(()=>{if(e){const z=++Hf.current,L=$a(e.chatType,e.peerId),R=e.chatType,D=e.peerId;console.log("[ChatWindow] Session changed:",{chatType:R,peerId:D,version:z}),Ql.current=!1;const J=ur.current.get(L);J&&J.length>0?(console.log("[ChatWindow] Memory cache hit:",J.length,"messages"),u(J)):(console.log("[ChatWindow] Memory cache miss"),u([])),f([]),v([]),cr.current=!0;const X=Aa.current,ee=Ia(R,D),he=X||!ee;console.log("[ChatWindow] Check load:",{isFirstMount:X,hasVisited:ee,shouldLoadFromApi:he}),Wl(R,D).then(async ae=>{const Tt=ar.current;if(!Tt||Tt.chatType!==R||Tt.peerId!==D){console.log("[ChatWindow] Session changed after IndexedDB read, skipping");return}let dt=[];ae&&ae.length>0?(dt=ae.filter(Ne=>Ne.elements&&Array.isArray(Ne.elements)),console.log("[ChatWindow] IndexedDB cache hit:",dt.length,"valid messages"),dt.length>0&&(ur.current.set(L,dt),u(dt))):console.log("[ChatWindow] IndexedDB cache miss"),he&&!Ql.current&&(Ql.current=!0,Aa.current=!1,R0(R,D),console.log("[ChatWindow] Calling loadMessagesAndMergeWithCache()"),await Gf(dt))})}else u([]),f([]),v([])},[e==null?void 0:e.peerId,e==null?void 0:e.chatType]),x.useEffect(()=>{if(e&&c.length>0){const z=$a(e.chatType,e.peerId);ur.current.set(z,c)}},[c,e==null?void 0:e.chatType,e==null?void 0:e.peerId]),x.useEffect(()=>{const z=_a.current,L=cs.current;if(!z||!L)return;const R=new IntersectionObserver(D=>{var X;if(D[0].isIntersecting&&m&&!Vl.current&&!y&&c.length>0){const ee=(X=c[0])==null?void 0:X.msgSeq;ee&&(Vl.current=!0,Da(ee).finally(()=>{Vl.current=!1}))}},{root:L,rootMargin:"50px 0px 0px 0px",threshold:0});return R.observe(z),()=>R.disconnect()},[m,c,Da]);const Kf=x.useCallback(()=>{const z=cs.current;if(!z||c.length===0)return;const L=z.scrollHeight-z.scrollTop-z.clientHeight<100;cr.current=L,ze(!L)},[c]),Yf=x.useCallback(z=>{f(L=>L.filter(R=>R.msgId!==z.msgId))},[]),Xf=x.useCallback(async(z,L,R,D,J)=>{P({profile:null,loading:!0,position:{x:R,y:D}});try{const X=await jl(z,L,J);P({profile:X,loading:!1,position:{x:R,y:D}})}catch{P(null),Q("获取用户资料失败","error")}},[]),Jf=x.useCallback(z=>{f(L=>[...L,z]),cr.current=!0},[]),Zf=x.useCallback(z=>{f(L=>L.filter(R=>R.msgId!==z))},[]),eh=x.useCallback(z=>{f(L=>L.map(R=>R.msgId===z?{...R,status:"failed"}:R))},[]);return e?l.jsx(Tf.Provider,{value:de,children:l.jsx(Mf.Provider,{value:ge,children:l.jsx(If.Provider,{value:Of,children:l.jsx(zf.Provider,{value:on,children:l.jsx(Pf.Provider,{value:qf,children:l.jsx(Lf.Provider,{value:Bf,children:l.jsx(Rf.Provider,{value:Vf,children:l.jsxs(_f.Provider,{value:Qf,children:[l.jsxs("div",{ref:La,className:"flex flex-col h-full relative",children:[l.jsxs("div",{className:"flex items-center justify-between px-2 md:px-4 py-3 border-b border-theme-divider bg-theme-card",children:[a&&l.jsx("button",{onClick:o,className:"p-2 mr-1 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors md:hidden",children:l.jsx(Mx,{size:20})}),l.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(),R=L.left,D=L.bottom+8;if(e.chatType===2){Y({profile:null,loading:!0,position:{x:R,y:D}});try{const J=await wf(e.peerId);Y({profile:J,loading:!1,position:{x:R,y:D}})}catch{Y(null),Q("获取群资料失败","error")}}else{P({profile:null,loading:!0,position:{x:R,y:D}});try{const{friendCategories:J}=xt.getState();let X="";for(const he of J){const ae=he.friends.find(Tt=>Tt.uin===e.peerId);if(ae){X=ae.uid;break}}const ee=await jl(X||void 0,e.peerId);P({profile:ee,loading:!1,position:{x:R,y:D}})}catch{P(null),Q("获取用户资料失败","error")}}},children:[l.jsx("img",{src:e.peerAvatar,alt:e.peerName,className:"w-10 h-10 rounded-full object-cover flex-shrink-0"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"font-medium text-theme truncate",children:(()=>{const{groups:z,friendCategories:L}=xt.getState();if(e.chatType===2){const R=z.find(D=>D.groupCode===e.peerId);if(R!=null&&R.remarkName&&R.remarkName!==R.groupName)return`${R.remarkName}(${R.groupName})`}else for(const R of L){const D=R.friends.find(J=>J.uin===e.peerId);if(D!=null&&D.remark&&D.remark!==D.nickname)return`${D.remark}(${D.nickname})`}return e.peerName})()}),l.jsx("div",{className:"text-xs text-theme-hint",children:e.chatType===2?(()=>{const{groups:z}=xt.getState(),L=z.find(R=>R.groupCode===e.peerId);return`群聊 ${e.peerId}${L!=null&&L.memberCount?` · ${L.memberCount}人`:""}`})():e.chatType===100?`临时会话 ${e.peerId}`:`私聊 ${e.peerId}`})]})]}),e.chatType===2&&t&&l.jsx("button",{onClick:t,className:"p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg",title:"查看群成员",children:l.jsx(Dl,{size:20})})]}),l.jsxs("div",{ref:cs,onScroll:Kf,className:"flex-1 overflow-y-auto overflow-x-hidden p-4",children:[l.jsx("div",{ref:_a,className:"h-1"}),k&&l.jsx("div",{className:"flex justify-center py-2",children:l.jsx(je,{size:20,className:"animate-spin text-pink-500"})}),y?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(je,{size:32,className:"animate-spin text-pink-500"})}):Be.length===0?l.jsx("div",{className:"flex items-center justify-center h-full text-theme-hint",children:"暂无消息"}):l.jsx("div",{style:{height:`${ut.getTotalSize()}px`,width:"100%",position:"relative",opacity:E?1:0},className:"overflow-hidden",children:ut.getVirtualItems().map(z=>{const L=Be[z.index];return l.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${z.start}px)`,padding:"8px 0"},"data-index":z.index,ref:ut.measureElement,className:"overflow-hidden box-border",children:L.type==="raw"?l.jsx(xg,{message:L.data,allMessages:c,isHighlighted:q===L.data.msgId}):L.type==="temp"?l.jsx(gg,{message:L.data,onRetry:()=>Yf(L.data)}):l.jsx(Lg,{tip:L.data,onScrollToMessage:R=>Gl("",R)})},z.key)})})]}),xe&&l.jsx("button",{onClick:Kl,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:l.jsx(ko,{size:12})}),l.jsx(Df,{ref:Hl,session:e,replyTo:T,onReplyCancel:()=>O(null),onSendStart:()=>{},onSendEnd:()=>{},onTempMessage:Jf,onTempMessageRemove:Zf,onTempMessageFail:eh})]}),I&&l.jsx(kg,{contextMenu:I,session:e,getCachedMembers:as,onClose:()=>C(null),onReply:z=>{O(z),setTimeout(()=>{var L,R;return(R=(L=Hl.current)==null?void 0:L.focus)==null?void 0:R.call(L)},50)},onEmojiReaction:(z,L,R)=>oe({message:z,x:L,y:R}),onRecall:z=>{if(u(L=>L.filter(R=>R.msgId!==z)),e){const L=`${e.chatType}_${e.peerId}`,R=ur.current.get(L);R&&ur.current.set(L,R.filter(D=>D.msgId!==z)),sg(e.chatType,e.peerId,z)}}}),K&&l.jsx(Pg,{target:K,onClose:()=>oe(null),containerRef:La}),A&&l.jsx(jg,{avatarContextMenu:A,getCachedMembers:as,onClose:()=>j(null),onInsertAt:(z,L,R)=>{var D,J;return(J=(D=Hl.current)==null?void 0:D.insertAt)==null?void 0:J.call(D,z,L,R)},onShowProfile:Xf,onSetTitle:(z,L,R)=>W({uid:z,name:L,groupCode:R}),onMute:(z,L,R)=>Te({uid:z,name:L,groupCode:R}),onKick:(z,L,R,D)=>ne({uid:z,name:L,groupCode:R,groupName:D}),onAdminChanged:()=>e&&Wf(e.peerId,!0),groupName:e==null?void 0:e.peerName}),S&&l.jsx(Ef,{profile:S.profile,loading:S.loading,position:S.position,onClose:()=>P(null),isFriend:(e==null?void 0:e.chatType)===1,onFriendDeleted:z=>{const{removeFriend:L,setCurrentChat:R,removeRecentChat:D}=xt.getState();L(z),(e==null?void 0:e.chatType)===1&&(R(null),D(1,e.peerId))}}),U&&l.jsx(og,{profile:U.profile,loading:U.loading,position:U.position,onClose:()=>Y(null),onQuitGroup:async(z,L)=>{try{await pf(z),Q(L?"群已解散":"已退出群聊","success");const{setCurrentChat:R,removeRecentChat:D}=xt.getState();R(null),D(2,z)}catch(R){Q(R.message||(L?"解散失败":"退群失败"),"error")}}}),B&&l.jsx(vg,{name:B.name,groupName:B.groupName,onConfirm:async()=>{const{uid:z,name:L,groupCode:R}=B;ne(null);try{await df(R,z),Q(`已将 ${L} 移出群聊`,"success")}catch(D){Q(D.message||"踢出失败","error")}},onClose:()=>ne(null)}),Z&&l.jsx(yg,{name:Z.name,onMute:async z=>{const{uid:L,name:R,groupCode:D}=Z;Te(null);try{if(await mf(D,L,z),z===0)Q(`已解除 ${R} 的禁言`,"success");else{const J=z>=86400?`${Math.floor(z/86400)}天`:z>=3600?`${Math.floor(z/3600)}小时`:z>=60?`${Math.floor(z/60)}分钟`:`${z}秒`;Q(`已禁言 ${R} ${J}`,"success")}}catch(J){Q(J.message||"禁言失败","error")}},onClose:()=>Te(null)}),ue&&l.jsx(wg,{name:ue.name,onConfirm:async z=>{const{uid:L,name:R,groupCode:D}=ue;W(null);try{await ff(D,L,z),Q(z?`已设置 ${R} 的头衔为「${z}」`:`已清除 ${R} 的头衔`,"success")}catch(J){Q(J.message||"设置头衔失败","error")}},onClose:()=>W(null)}),l.jsx(ag,{url:N,onClose:()=>b(null)}),l.jsx(cg,{videoInfo:M,onClose:()=>_(null)})]})})})})})})})}):l.jsx("div",{className:"flex-1 flex items-center justify-center bg-theme-item",children:l.jsxs("div",{className:"text-center text-theme-hint",children:[l.jsx("div",{className:"text-6xl mb-4",children:"💬"}),l.jsx("p",{children:"选择一个联系人开始聊天"})]})})},_g=({member:e,onContextMenu:t,onClick:n})=>{const r=e.card||e.nickname,s=e.role==="owner"?l.jsx($l,{size:14,className:"text-yellow-500"}):e.role==="admin"?l.jsx(ls,{size:14,className:"text-blue-500"}):null,i=o=>{("ontouchstart"in window||navigator.maxTouchPoints>0)&&(n==null||n(o))};return l.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:[l.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`}}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"text-sm text-theme truncate",children:r}),s]}),e.card&&e.card!==e.nickname&&l.jsx("div",{className:"text-xs text-theme-hint truncate",children:e.nickname})]})]})},Ag=({groupCode:e,onClose:t,onAtMember:n})=>{const[r,s]=x.useState([]),[i,o]=x.useState(!1),[a,c]=x.useState(""),[u,h]=x.useState(null),[f,p]=x.useState(null),[v,y]=x.useState(null),{getCachedMembers:w,fetchGroupMembers:k}=xt(),d=x.useRef(null),m=x.useRef(e);x.useEffect(()=>{m.current=e},[e]);const g=x.useRef(w);g.current=w;const N=x.useRef(k);N.current=k;const b=x.useRef(!1);x.useEffect(()=>{const j=e,S=!Ia(2,j),P=_0(j);console.log("[GroupMemberPanel] useEffect triggered:",{groupCode:j,isFirstVisit:S,alreadyFetched:P});const U=g.current(j);if(U&&(console.log("[GroupMemberPanel] Cache hit:",U.length,"members"),s(U),h(null),P)){o(!1);return}if(P){o(!1);return}if(b.current){console.log("[GroupMemberPanel] Already loading, skip");return}return console.log("[GroupMemberPanel] Fetching from API, isFirstVisit:",S),b.current=!0,U||(o(!0),h(null),s([])),N.current(j,S).then(Y=>{console.log("[GroupMemberPanel] API success:",Y.length,"members, currentGroupCode:",m.current),m.current===j&&(s(Y),o(!1),A0(j))}).catch(Y=>{console.log("[GroupMemberPanel] API error:",Y.message),m.current===j&&(U||h(Y.message||"加载群成员失败"),Q("加载群成员失败","error"),o(!1))}).finally(()=>{m.current===j&&(b.current=!1)}),()=>{console.log("[GroupMemberPanel] Cleanup, reset isLoading"),b.current=!1}},[e]);const M=x.useMemo(()=>yf(r,a),[r,a]),_=Nf({count:M.length,getScrollElement:()=>d.current,estimateSize:()=>48,overscan:5}),T=x.useMemo(()=>{const j=r.filter(P=>P.role==="owner").length,S=r.filter(P=>P.role==="admin").length;return{owner:j,admin:S,total:r.length}},[r]),O=x.useCallback((j,S)=>{j.preventDefault(),j.stopPropagation(),p({x:j.clientX,y:j.clientY,member:S})},[]),I=x.useCallback(()=>{if(f&&n){const j=f.member.card||f.member.nickname;n(j)}p(null)},[f,n]),C=x.useCallback(async()=>{if(!f)return;const j=f.member;p(null);try{await kl(2,Number(j.uin),Number(e)),Q("戳一戳成功","success")}catch(S){Q(S.message||"戳一戳失败","error")}},[f,e]),A=x.useCallback(async()=>{if(!f)return;const j=f.member,S={x:f.x,y:f.y};p(null),y({profile:null,loading:!0,position:S});try{const P=await jl(j.uid,j.uin,e);y({profile:P,loading:!1,position:S})}catch(P){Q(P.message||"获取资料失败","error"),y(null)}},[f,e]);return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-theme-divider",children:[l.jsxs("div",{children:[l.jsx("div",{className:"font-medium text-theme",children:"群成员"}),l.jsxs("div",{className:"text-xs text-theme-hint",children:[T.total," 人"]})]}),l.jsx("button",{onClick:t,className:"p-1.5 text-theme-hint hover:text-theme hover:bg-theme-item rounded-lg transition-colors",children:l.jsx(wt,{size:18})})]}),l.jsx("div",{className:"p-3",children:l.jsxs("div",{className:"relative",children:[l.jsx(qm,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-theme-hint"}),l.jsx("input",{type:"text",value:a,onChange:j=>c(j.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"})]})}),l.jsx("div",{ref:d,className:"flex-1 overflow-y-auto",children:i?l.jsx("div",{className:"flex items-center justify-center h-32",children:l.jsx(je,{size:24,className:"animate-spin text-pink-500"})}):u?l.jsxs("div",{className:"flex flex-col items-center justify-center h-32 gap-2",children:[l.jsx("p",{className:"text-sm text-red-500",children:u}),l.jsx("button",{onClick:()=>k(e),className:"text-sm text-pink-500 hover:text-pink-600",children:"重试"})]}):M.length===0?l.jsx("div",{className:"flex items-center justify-center h-32 text-theme-hint text-sm",children:a?"未找到匹配的成员":"暂无成员"}):l.jsx("div",{className:"py-1 relative",style:{height:_.getTotalSize()},children:_.getVirtualItems().map(j=>{const S=M[j.index];return l.jsx("div",{className:"absolute left-0 right-0",style:{top:j.start,height:j.size},children:l.jsx(_g,{member:S,onClick:P=>O(P,S),onContextMenu:P=>O(P,S)})},S.uid)})})}),f&&Ae.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>p(null),onContextMenu:j=>{j.preventDefault(),p(null)}}),l.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:f.x,top:Math.min(f.y,window.innerHeight-150)},onContextMenu:j=>j.preventDefault(),children:[n&&l.jsxs("button",{onClick:I,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[l.jsx(zm,{size:14}),"@ta"]}),l.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:[l.jsx(Lm,{size:14}),"戳一戳"]}),l.jsxs("button",{onClick:A,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-theme hover:bg-theme-item-hover transition-colors",children:[l.jsx(Vm,{size:14}),"查看资料"]})]})]}),document.body),v&&l.jsx(Ef,{profile:v.profile,loading:v.loading,position:v.position,onClose:()=>y(null)})]})};function Fg(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 Ug=()=>{const e=le.useRef(null),t=le.useRef(null),n=le.useRef([]),[,r]=le.useState(0),{friendCategories:s,groups:i,recentChats:o,contactsLoading:a,contactsError:c,currentChat:u,activeTab:h,unreadCounts:f,showMemberPanel:p,setCurrentChat:v,setActiveTab:y,setShowMemberPanel:w,clearUnreadCount:k,incrementUnreadCount:d,updateRecentChat:m,loadContacts:g,setRecentChats:N}=xt(),[b,M]=le.useState(""),_=x.useCallback(B=>{M(`@${B} `)},[]),T=x.useCallback(()=>{M("")},[]);x.useEffect(()=>{uu(),nf().catch(B=>console.error("获取登录信息失败:",B)),g()},[g]),x.useEffect(()=>{c&&Q(c,"error")},[c]);const O=le.useRef(u);x.useEffect(()=>{O.current=u},[u]);const I=le.useCallback(B=>{if(e.current=B,B&&n.current.length>0){const ne=[...n.current];n.current=[],ne.forEach(Z=>B(Z))}r(ne=>ne+1)},[]),C=le.useCallback(B=>{t.current=B},[]);x.useEffect(()=>{const B=xf(ne=>{if(ne.type==="message-created"||ne.type==="message-sent"){const Z=ne.data;if(!Z||!Z.msgId||!Z.elements||!Array.isArray(Z.elements)){console.warn("SSE 收到无效消息:",Z);return}const Te=Z.chatType,ue=Z.peerUin||Z.peerUid,W=`${Te}_${ue}`,K=O.current;Cf(Te,ue,Z),K&&K.chatType===Te&&K.peerId===ue?e.current?e.current(Z):n.current.push(Z):d(W);const oe=Fg(Z);let xe,ze;Te===2?(xe=Z.peerName||void 0,ze=`https://p.qlogo.cn/gh/${ue}/${ue}/640/`):(xe=Z.sendNickName||Z.sendMemberName||void 0,ze=`https://q1.qlogo.cn/g?b=qq&nk=${ue}&s=640`),m(Te,ue,oe,parseInt(Z.msgTime)*1e3,xe,ze)}else if(ne.type==="emoji-reaction"){const{groupCode:Z,msgSeq:Te,emojiId:ue,userId:W,userName:K,isAdd:oe}=ne.data,xe=O.current;lg(2,Z,Te,ue,oe),xe&&xe.chatType===2&&xe.peerId===Z&&t.current&&t.current({groupCode:Z,msgSeq:Te,emojiId:ue,userId:W,userName:K,isAdd:oe})}},ne=>{console.error("SSE 连接错误:",ne)},()=>{console.log("[WebQQ] SSE 重连成功,重置已访问聊天标志"),uu(),g()});return()=>{B.close()}},[d,m,g]);const A=x.useCallback(B=>{n.current=[],v(B),B.chatType!==2&&w(!1);const ne=`${B.chatType}_${B.peerId}`;k(ne),N(o.map(Z=>Z.chatType===B.chatType&&Z.peerId===B.peerId?{...Z,unreadCount:0}:Z))},[v,k,N,o,w]),[j,S]=x.useState(!1),P=x.useCallback(B=>{A(B),S(!0)},[A]),U=x.useCallback(()=>{S(!1)},[]),Y=x.useCallback(B=>{const ne={chatType:1,peerId:B.uin,peerName:B.remark||B.nickname,peerAvatar:B.avatar};P(ne)},[P]),E=x.useCallback(B=>{const ne={chatType:2,peerId:B.groupCode,peerName:B.groupName,peerAvatar:B.avatar};P(ne)},[P]),$=x.useCallback(B=>{const ne={chatType:B.chatType,peerId:B.peerId,peerName:B.peerName,peerAvatar:B.peerAvatar};P(ne)},[P]),q=le.useMemo(()=>new Map(Object.entries(f)),[f]);return a&&s.length===0&&i.length===0?l.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:l.jsx(je,{size:48,className:"animate-spin text-pink-500"})}):c&&s.length===0&&i.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-[calc(100vh-200px)] gap-4",children:[l.jsx("p",{className:"text-red-500",children:c}),l.jsx("button",{onClick:()=>g(),className:"px-4 py-2 bg-pink-500 text-white rounded-lg hover:bg-pink-600 transition-colors",children:"重试"})]}):l.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:[l.jsx("div",{className:`
386
+ w-full md:w-72 border-r border-theme-divider flex-shrink-0
387
+ ${j?"hidden md:block":"block"}
388
+ `,children:l.jsx(U0,{activeTab:h,onTabChange:y,friendCategories:s,groups:i,recentChats:o,unreadCounts:q,selectedPeerId:u==null?void 0:u.peerId,onSelectFriend:Y,onSelectGroup:E,onSelectRecent:$})}),l.jsx("div",{className:`
389
+ flex-1 flex flex-col min-w-0
390
+ ${j?"block":"hidden md:flex"}
391
+ `,children:l.jsx(Rg,{session:u,onShowMembers:()=>w(!p),onNewMessageCallback:I,onEmojiReactionCallback:C,appendInputText:b,onAppendInputTextConsumed:T,onBack:U,showBackButton:j})}),p&&(u==null?void 0:u.chatType)===2&&l.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:l.jsx(Ag,{groupCode:u.peerId,onClose:()=>w(!1),onAtMember:_})})]})},$g={enable:!0,connect:[]},Dg={enable:!1,port:5600,token:""},Og={enable:!1,reportSelfMessage:!1,http:{port:3010,prefix:"",accessToken:""},webhook:{urls:[],accessToken:""}},qg={enable:!0,port:3080},Wg={webui:qg,onlyLocalhost:!0,milky:Og,satori:Dg,ob11:$g,enableLocalFile2Url:!1,log:!0,autoDeleteFile:!1,autoDeleteFileSecond:60,musicSignUrl:"https://llob.linyuchen.net/sign/music",msgCacheExpire:120,ffmpeg:"",rawMsgPB:!1},xu="7.3.0";function Hg(){const e=()=>{const E=window.location.hash.slice(1);return["dashboard","onebot","satori","milky","logs","other","webqq","about"].includes(E)?E:"dashboard"},[t,n]=x.useState(e),[r,s]=x.useState(Wg),[i,o]=x.useState(!1),[a,c]=x.useState(!1),[u,h]=x.useState(!0),[f,p]=x.useState(null),[v,y]=x.useState(!1),[w,k]=x.useState(""),[d,m]=x.useState(null),[g,N]=x.useState(!1),[b,M]=x.useState(!1),[_,T]=x.useState(!1),[O,I]=x.useState(!1),[C,A]=x.useState(""),[j,S]=x.useState(!1);x.useEffect(()=>{x0(async E=>new Promise($=>{k(E||""),y(!0),m(()=>$)}))},[]),x.useEffect(()=>{window.location.hash=t},[t]),x.useEffect(()=>{const E=()=>{const $=window.location.hash.slice(1);["dashboard","onebot","satori","milky","logs","other","webqq","about"].includes($)&&n($)};return window.addEventListener("hashchange",E),()=>window.removeEventListener("hashchange",E)},[]);const P=x.useCallback(E=>{E.trim()?(y(!1),k(""),d&&(d(E),m(null))):k("密码不能为空")},[d]);x.useEffect(()=>{(async()=>{var $;try{const q=await Le("/api/config");if(q.success&&q.data.selfInfo.online){c(!0),p({nick:q.data.selfInfo.nick||"",uin:q.data.selfInfo.uin}),s(q.data.config);try{const G=await Le("/api/device-info");G.success&&(($=G.data)!=null&&$.buildVer)&&A(G.data.buildVer)}catch(G){console.error("Failed to fetch device info:",G)}}else c(!1)}catch(q){console.error("Failed to check login status:",q),c(!1)}finally{h(!1)}})()},[]);const U=x.useCallback(async E=>{try{o(!0);const q=await Le("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:E||r})});q.success?Q("配置保存成功","success"):Q("保存失败:"+q.message,"error")}catch($){Q("保存失败:"+$.message,"error")}finally{o(!1)}},[r]),Y=x.useCallback(()=>{window.location.reload()},[]);return u?l.jsxs(l.Fragment,{children:[l.jsx(bi,{}),l.jsx("div",{className:"relative flex items-center justify-center min-h-screen z-10",children:l.jsx(je,{size:48,className:"animate-spin text-pink-500"})}),l.jsx(Si,{visible:v,onConfirm:P,error:w})]}):a?l.jsxs("div",{className:"flex min-h-screen",children:[l.jsx(bi,{}),l.jsx(d0,{activeTab:t,onTabChange:n,accountInfo:f||void 0,isOpen:j,onClose:()=>S(!1)}),l.jsxs("main",{className:"flex-1 overflow-auto z-10",children:[l.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:[l.jsx("button",{onClick:()=>S(!0),className:"p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors",children:l.jsx(qx,{size:24})}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:"/logo.jpg",alt:"Logo",className:"w-8 h-8 rounded-lg"}),l.jsx("span",{className:"font-semibold text-theme",children:"LLBot"})]})]}),l.jsxs("div",{className:"p-4 md:p-8 max-w-6xl mx-auto",children:[l.jsxs("div",{className:"mb-8 hidden md:block",children:[l.jsx("h2",{className:"text-3xl font-bold text-white mb-2",children:t==="dashboard"&&"Dashboard"}),l.jsx("p",{className:"text-white/80",children:t==="dashboard"&&"欢迎使用 Lucky Lillia Bot"})]}),t==="dashboard"&&l.jsx(k0,{llbotVersion:xu,qqVersion:C}),t==="webqq"&&l.jsx(Ug,{}),t==="logs"&&l.jsx(j0,{}),t==="onebot"&&l.jsx(N0,{config:r.ob11,globalConfig:r,onChange:E=>{const $={...r,ob11:E};s($)},onSave:E=>{if(E){const $={...r,ob11:E};U($)}else U()}}),t==="satori"&&l.jsxs("div",{className:"card p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsx("div",{className:"w-12 h-12 rounded-xl gradient-primary-br flex items-center justify-center",children:l.jsx(So,{size:24,className:"text-white"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold text-theme",children:"Satori 协议"}),l.jsx("p",{className:"text-sm text-theme-secondary",children:"配置 Satori 协议相关设置"})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-theme",children:"启用 Satori 协议"}),l.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"开启后将支持 Satori 协议连接"})]}),l.jsx("input",{type:"checkbox",checked:r.satori.enable,onChange:E=>s({...r,satori:{...r.satori,enable:E.target.checked}}),className:"switch-toggle"})]}),r.satori.enable&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Satori 端口"}),l.jsx("input",{type:"number",value:r.satori.port,onChange:E=>s({...r,satori:{...r.satori,port:parseInt(E.target.value)}}),min:"1",max:"65535",placeholder:"5500",className:"input-field"}),l.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"Satori 服务监听端口(1-65535)"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Satori Token"}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:g?"text":"password",value:r.satori.token,onChange:E=>s({...r,satori:{...r.satori,token:E.target.value}}),placeholder:"请输入 Satori Token",className:"input-field pr-12"}),l.jsx("button",{type:"button",onClick:()=>N(!g),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1",children:g?l.jsx(yn,{size:20}):l.jsx(vn,{size:20})})]}),l.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"用于 Satori 连接验证的 Token"})]})]})]}),l.jsx("div",{className:"mt-6 flex justify-end",children:l.jsx("button",{onClick:()=>{var E;if(!r.onlyLocalhost&&r.satori.enable&&!((E=r.satori.token)!=null&&E.trim())){Q('当"只监听本地地址"关闭时,必须设置 Satori Token!',"error");return}U()},disabled:i,className:"btn-primary flex items-center gap-2",children:i?l.jsxs(l.Fragment,{children:[l.jsx(je,{size:20,className:"animate-spin"}),"保存中..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Ni,{size:20}),"保存配置"]})})})]}),t==="milky"&&l.jsxs("div",{className:"card p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.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:l.jsx(So,{size:24,className:"text-white"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold text-theme",children:"Milky 协议"}),l.jsx("p",{className:"text-sm text-theme-secondary",children:"配置 Milky 协议相关设置"})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-theme",children:"启用 Milky 协议"}),l.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"开启后将支持 Milky 协议连接"})]}),l.jsx("input",{type:"checkbox",checked:r.milky.enable,onChange:E=>s({...r,milky:{...r.milky,enable:E.target.checked}}),className:"switch-toggle"})]}),r.milky.enable&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-theme",children:"上报自己发送的消息"}),l.jsx("div",{className:"text-xs text-theme-muted mt-0.5",children:"启用后将上报自己发送的消息"})]}),l.jsx("input",{type:"checkbox",checked:r.milky.reportSelfMessage,onChange:E=>s({...r,milky:{...r.milky,reportSelfMessage:E.target.checked}}),className:"switch-toggle"})]}),l.jsxs("div",{className:"border-t border-theme-divider pt-4 mt-4",children:[l.jsx("h4",{className:"text-md font-semibold text-theme mb-4",children:"HTTP 配置"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"HTTP 端口"}),l.jsx("input",{type:"number",value:r.milky.http.port,onChange:E=>s({...r,milky:{...r.milky,http:{...r.milky.http,port:parseInt(E.target.value)}}}),min:"1",max:"65535",placeholder:"3010",className:"input-field"}),l.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"Milky HTTP 服务监听端口(1-65535)"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"路径前缀"}),l.jsx("input",{type:"text",value:r.milky.http.prefix,onChange:E=>s({...r,milky:{...r.milky,http:{...r.milky.http,prefix:E.target.value}}}),placeholder:"/api",className:"input-field"}),l.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"HTTP API 路径前缀(可选)"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Access Token"}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:b?"text":"password",value:r.milky.http.accessToken,onChange:E=>s({...r,milky:{...r.milky,http:{...r.milky.http,accessToken:E.target.value}}}),placeholder:"请输入 Access Token",className:"input-field pr-12"}),l.jsx("button",{type:"button",onClick:()=>M(!b),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1",children:b?l.jsx(yn,{size:20}):l.jsx(vn,{size:20})})]}),l.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"用于 Milky HTTP 连接验证的 Token"})]})]})]}),l.jsxs("div",{className:"border-t border-theme-divider pt-4 mt-4",children:[l.jsx("h4",{className:"text-md font-semibold text-theme mb-4",children:"Webhook 配置"}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Webhook URLs"}),l.jsxs("div",{className:"space-y-2",children:[r.milky.webhook.urls.map((E,$)=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",value:E,onChange:q=>{const G=[...r.milky.webhook.urls];G[$]=q.target.value,s({...r,milky:{...r.milky,webhook:{...r.milky.webhook,urls:G}}})},placeholder:"http:// 或 https://",className:`input-field flex-1 ${E&&!E.match(/^https?:\/\//)?"border-red-300 focus:ring-red-500":""}`}),l.jsx("button",{type:"button",onClick:()=>{const q=r.milky.webhook.urls.filter((G,B)=>B!==$);s({...r,milky:{...r.milky,webhook:{...r.milky.webhook,urls:q}}})},className:"p-2 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/30 rounded-lg transition-colors",title:"删除",children:l.jsx(Et,{size:18})})]},$)),r.milky.webhook.urls.some(E=>E&&!E.match(/^https?:\/\//))&&l.jsx("p",{className:"text-xs text-red-500",children:"URL 必须以 http:// 或 https:// 开头"}),l.jsxs("button",{type:"button",onClick:()=>{s({...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:[l.jsx($m,{size:18}),"添加 Webhook URL"]})]}),l.jsx("p",{className:"text-xs text-theme-muted mt-2",children:"事件上报的 Webhook 地址"})]}),l.jsxs("div",{className:"mt-4",children:[l.jsx("label",{className:"block text-sm font-medium text-theme-secondary mb-2",children:"Access Token"}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:_?"text":"password",value:r.milky.webhook.accessToken,onChange:E=>s({...r,milky:{...r.milky,webhook:{...r.milky.webhook,accessToken:E.target.value}}}),placeholder:"请输入 Access Token",className:"input-field pr-12"}),l.jsx("button",{type:"button",onClick:()=>T(!_),className:"absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1",children:_?l.jsx(yn,{size:20}):l.jsx(vn,{size:20})})]}),l.jsx("p",{className:"text-xs text-theme-muted mt-1",children:"用于 Webhook 请求验证的 Token"})]})]})]})]}),l.jsx("div",{className:"mt-6 flex justify-end",children:l.jsx("button",{onClick:()=>{var q;if(!r.onlyLocalhost&&r.milky.enable&&!((q=r.milky.http.accessToken)!=null&&q.trim())){Q('当"只监听本地地址"关闭时,必须设置 Milky Access Token!',"error");return}if(r.milky.webhook.urls.filter(G=>G.trim()&&!G.match(/^https?:\/\//)).length>0){Q("Webhook URL 必须以 http:// 或 https:// 开头","error");return}const $={...r,milky:{...r.milky,webhook:{...r.milky.webhook,urls:r.milky.webhook.urls.filter(G=>G.trim())}}};s($),U($)},disabled:i,className:"btn-primary flex items-center gap-2",children:i?l.jsxs(l.Fragment,{children:[l.jsx(je,{size:20,className:"animate-spin"}),"保存中..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Ni,{size:20}),"保存配置"]})})})]}),t==="other"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pb-24",children:l.jsx(b0,{config:r,onChange:s,onOpenChangePassword:()=>I(!0)})}),l.jsx("div",{className:"fixed bottom-8 right-8 z-40",children:l.jsx("button",{onClick:()=>U(),disabled:i,className:"btn-primary flex items-center gap-2 shadow-2xl hover:shadow-3xl",children:i?l.jsxs(l.Fragment,{children:[l.jsx(je,{size:20,className:"animate-spin"}),"保存中..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Ni,{size:20}),"保存配置"]})})})]}),t==="about"&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"card p-8 text-center",children:[l.jsx("div",{className:"w-20 h-20 rounded-3xl overflow-hidden mx-auto mb-6 shadow-lg",children:l.jsx("img",{src:"/logo.jpg",alt:"Logo",className:"w-full h-full object-cover"})}),l.jsx("h1",{className:"text-3xl font-bold text-theme mb-2",children:"Lucky Lillia Bot"}),l.jsx("p",{className:"text-theme-secondary mb-6",children:"使你的 QQNT 支持 OneBot 11 协议、Satori 协议、Milky 协议进行 QQ 机器人开发"}),l.jsxs("div",{className:"flex items-center justify-center gap-4",children:[l.jsxs("a",{href:"https://github.com/LLOneBot/LLOneBot",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:[l.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:l.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"]}),l.jsxs("a",{href:"https://llonebot.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:[l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})}),"文档"]})]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"card p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.jsx("div",{className:"w-12 h-12 rounded-xl gradient-primary-br flex items-center justify-center",children:l.jsx("svg",{className:"w-6 h-6 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:l.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"})})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold text-theme",children:"Telegram 群"}),l.jsx("p",{className:"text-sm text-theme-secondary"})]})]}),l.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"})]}),l.jsxs("div",{className:"card p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.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:l.jsx("svg",{className:"w-6 h-6 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:l.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"})})}),l.jsx("div",{children:l.jsx("h3",{className:"text-lg font-semibold text-theme",children:"QQ 群"})})]}),l.jsx("div",{className:"flex items-center gap-3",children:l.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"})})]})]}),l.jsx("div",{className:"card p-6",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-xl gradient-primary-br flex items-center justify-center",children:l.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-theme",children:"版本信息"}),l.jsxs("div",{className:"text-xs text-theme-muted",children:["Lucky Lillia Bot ",xu]}),C&&l.jsxs("div",{className:"text-xs text-theme-muted",children:["QQ ",C]})]})]}),l.jsxs("div",{className:"text-sm text-theme-secondary",children:["WebUI Powered by ",l.jsx("span",{className:"font-semibold text-pink-500",children:"React + Tailwind"})]})]})})]})]})]}),i&&l.jsx("div",{className:"fixed inset-0 bg-black/20 dark:bg-black/40 flex items-center justify-center",style:{zIndex:9e3},children:l.jsxs("div",{className:"bg-theme-card backdrop-blur-xl rounded-2xl p-6 shadow-2xl",children:[l.jsx(je,{size:48,className:"animate-spin text-pink-500 mx-auto"}),l.jsx("p",{className:"mt-4 text-theme",children:"加载中..."})]})}),l.jsx(Si,{visible:v,onConfirm:P,error:w}),l.jsx(S0,{visible:O,onClose:()=>I(!1),onSuccess:()=>{window.location.reload()}}),l.jsx(Zc,{})]}):l.jsxs(l.Fragment,{children:[l.jsx(bi,{}),l.jsx(C0,{onLoginSuccess:Y}),l.jsx(Si,{visible:v,onConfirm:P,error:w}),l.jsx(Zc,{})]})}const gu=localStorage.getItem("llbot-theme");if(gu)try{const{state:e}=JSON.parse(gu);e!=null&&e.isDark&&document.documentElement.classList.add("dark")}catch{}Ei.createRoot(document.getElementById("root")).render(l.jsx(le.StrictMode,{children:l.jsx(Hg,{})}));