From d6344d4e62c7fea6dc6c4d8e51f7d916446ba5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E8=8B=A5?= Date: Sun, 8 Mar 2026 09:14:15 +0800 Subject: [PATCH] =?UTF-8?q?sync:=20soul-admin=20=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E3=80=81soul-admin=20=E9=85=8D=E7=BD=AE=20|=20=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0:=20=E5=89=8D=E7=AB=AF=E4=BB=A3=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E3=80=81=E5=89=8D=E7=AB=AF=E6=9E=84=E5=BB=BA=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soul-admin/dist/assets/index-BtipDEJW.js | 500 ----------------- soul-admin/dist/assets/index-N0mJ5XsI.js | 505 ++++++++++++++++++ ...{index-BRP7wZez.css => index-Y-uxw2Gi.css} | 2 +- soul-admin/dist/index.html | 4 +- soul-admin/tsconfig.tsbuildinfo | 2 +- 5 files changed, 509 insertions(+), 504 deletions(-) delete mode 100644 soul-admin/dist/assets/index-BtipDEJW.js create mode 100644 soul-admin/dist/assets/index-N0mJ5XsI.js rename soul-admin/dist/assets/{index-BRP7wZez.css => index-Y-uxw2Gi.css} (64%) diff --git a/soul-admin/dist/assets/index-BtipDEJW.js b/soul-admin/dist/assets/index-BtipDEJW.js deleted file mode 100644 index 4c0707d2..00000000 --- a/soul-admin/dist/assets/index-BtipDEJW.js +++ /dev/null @@ -1,500 +0,0 @@ -function mv(r,a){for(var l=0;lo[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function Ex(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var xd={exports:{}},Nl={},pd={exports:{}},Xe={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var gf;function fv(){if(gf)return Xe;gf=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),m=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function C(M){return M===null||typeof M!="object"?null:(M=v&&M[v]||M["@@iterator"],typeof M=="function"?M:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,S={};function b(M,O,L){this.props=M,this.context=O,this.refs=S,this.updater=L||P}b.prototype.isReactComponent={},b.prototype.setState=function(M,O){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,O,"setState")},b.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function N(){}N.prototype=b.prototype;function E(M,O,L){this.props=M,this.context=O,this.refs=S,this.updater=L||P}var j=E.prototype=new N;j.constructor=E,T(j,b.prototype),j.isPureReactComponent=!0;var R=Array.isArray,W=Object.prototype.hasOwnProperty,U={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function A(M,O,L){var X,K={},de=null,G=null;if(O!=null)for(X in O.ref!==void 0&&(G=O.ref),O.key!==void 0&&(de=""+O.key),O)W.call(O,X)&&!k.hasOwnProperty(X)&&(K[X]=O[X]);var xe=arguments.length-2;if(xe===1)K.children=L;else if(1>>1,O=$[M];if(0>>1;Mc(K,H))dec(G,K)?($[M]=G,$[de]=H,M=de):($[M]=K,$[X]=H,M=X);else if(dec(G,H))$[M]=G,$[de]=H,M=de;else break e}}return ce}function c($,ce){var H=$.sortIndex-ce.sortIndex;return H!==0?H:$.id-ce.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;r.unstable_now=function(){return d.now()}}else{var m=Date,f=m.now();r.unstable_now=function(){return m.now()-f}}var p=[],y=[],g=1,v=null,C=3,P=!1,T=!1,S=!1,b=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j($){for(var ce=l(y);ce!==null;){if(ce.callback===null)o(y);else if(ce.startTime<=$)o(y),ce.sortIndex=ce.expirationTime,a(p,ce);else break;ce=l(y)}}function R($){if(S=!1,j($),!T)if(l(p)!==null)T=!0,ne(W);else{var ce=l(y);ce!==null&&ve(R,ce.startTime-$)}}function W($,ce){T=!1,S&&(S=!1,N(A),A=-1),P=!0;var H=C;try{for(j(ce),v=l(p);v!==null&&(!(v.expirationTime>ce)||$&&!ie());){var M=v.callback;if(typeof M=="function"){v.callback=null,C=v.priorityLevel;var O=M(v.expirationTime<=ce);ce=r.unstable_now(),typeof O=="function"?v.callback=O:v===l(p)&&o(p),j(ce)}else o(p);v=l(p)}if(v!==null)var L=!0;else{var X=l(y);X!==null&&ve(R,X.startTime-ce),L=!1}return L}finally{v=null,C=H,P=!1}}var U=!1,k=null,A=-1,I=5,re=-1;function ie(){return!(r.unstable_now()-re$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<$?Math.floor(1e3/$):5},r.unstable_getCurrentPriorityLevel=function(){return C},r.unstable_getFirstCallbackNode=function(){return l(p)},r.unstable_next=function($){switch(C){case 1:case 2:case 3:var ce=3;break;default:ce=C}var H=C;C=ce;try{return $()}finally{C=H}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function($,ce){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=C;C=$;try{return ce()}finally{C=H}},r.unstable_scheduleCallback=function($,ce,H){var M=r.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0M?($.sortIndex=H,a(y,$),l(p)===null&&$===l(y)&&(S?(N(A),A=-1):S=!0,ve(R,H-M))):($.sortIndex=O,a(p,$),T||P||(T=!0,ne(W))),$},r.unstable_shouldYield=ie,r.unstable_wrapCallback=function($){var ce=C;return function(){var H=C;C=ce;try{return $.apply(this,arguments)}finally{C=H}}}})(vd)),vd}var Nf;function yv(){return Nf||(Nf=1,yd.exports=gv()),yd.exports}/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var wf;function vv(){if(wf)return ms;wf=1;var r=du(),a=yv();function l(t){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,y=/^[: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]*$/,g={},v={};function C(t){return p.call(v,t)?!0:p.call(g,t)?!1:y.test(t)?v[t]=!0:(g[t]=!0,!1)}function P(t,s,n,i){if(n!==null&&n.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function T(t,s,n,i){if(s===null||typeof s>"u"||P(t,s,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function S(t,s,n,i,u,x,w){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=i,this.attributeNamespace=u,this.mustUseProperty=n,this.propertyName=t,this.type=s,this.sanitizeURL=x,this.removeEmptyString=w}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){b[t]=new S(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var s=t[0];b[s]=new S(s,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){b[t]=new S(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){b[t]=new S(t,2,!1,t,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(t){b[t]=new S(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){b[t]=new S(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){b[t]=new S(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){b[t]=new S(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){b[t]=new S(t,5,!1,t.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function E(t){return t[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(t){var s=t.replace(N,E);b[s]=new S(s,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var s=t.replace(N,E);b[s]=new S(s,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var s=t.replace(N,E);b[s]=new S(s,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){b[t]=new S(t,1,!1,t.toLowerCase(),null,!1,!1)}),b.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){b[t]=new S(t,1,!1,t.toLowerCase(),null,!0,!0)});function j(t,s,n,i){var u=b.hasOwnProperty(s)?b[s]:null;(u!==null?u.type!==0:i||!(2_||u[w]!==x[_]){var z=` -`+u[w].replace(" at new "," at ");return t.displayName&&z.includes("")&&(z=z.replace("",t.displayName)),z}while(1<=w&&0<=_);break}}}finally{L=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?O(t):""}function K(t){switch(t.tag){case 5:return O(t.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return t=X(t.type,!1),t;case 11:return t=X(t.type.render,!1),t;case 1:return t=X(t.type,!0),t;default:return""}}function de(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case k:return"Fragment";case U:return"Portal";case I:return"Profiler";case A:return"StrictMode";case te:return"Suspense";case J:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case ie:return(t.displayName||"Context")+".Consumer";case re:return(t._context.displayName||"Context")+".Provider";case oe:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Y:return s=t.displayName||null,s!==null?s:de(t.type)||"Memo";case ne:s=t._payload,t=t._init;try{return de(t(s))}catch{}}return null}function G(t){var s=t.type;switch(t.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=s.render,t=t.displayName||t.name||"",s.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(s);case 8:return s===A?"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 s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function xe(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function we(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function D(t){var s=we(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,s),i=""+t[s];if(!t.hasOwnProperty(s)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var u=n.get,x=n.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return u.call(this)},set:function(w){i=""+w,x.call(this,w)}}),Object.defineProperty(t,s,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(w){i=""+w},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function ue(t){t._valueTracker||(t._valueTracker=D(t))}function Se(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var n=s.getValue(),i="";return t&&(i=we(t)?t.checked?"true":"false":t.value),t=i,t!==n?(s.setValue(t),!0):!1}function Ie(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Ue(t,s){var n=s.checked;return H({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Ze(t,s){var n=s.defaultValue==null?"":s.defaultValue,i=s.checked!=null?s.checked:s.defaultChecked;n=xe(s.value!=null?s.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function et(t,s){s=s.checked,s!=null&&j(t,"checked",s,!1)}function tt(t,s){et(t,s);var n=xe(s.value),i=s.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}s.hasOwnProperty("value")?fe(t,s.type,n):s.hasOwnProperty("defaultValue")&&fe(t,s.type,xe(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(t.defaultChecked=!!s.defaultChecked)}function pe(t,s,n){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var i=s.type;if(!(i!=="submit"&&i!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+t._wrapperState.initialValue,n||s===t.value||(t.value=s),t.defaultValue=s}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function fe(t,s,n){(s!=="number"||Ie(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ot=Array.isArray;function ss(t,s,n,i){if(t=t.options,s){s={};for(var u=0;u"+s.valueOf().toString()+"",s=ur.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;s.firstChild;)t.appendChild(s.firstChild)}});function ls(t,s){if(s){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=s;return}}t.textContent=s}var ks={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},jn=["Webkit","ms","Moz","O"];Object.keys(ks).forEach(function(t){jn.forEach(function(s){s=s+t.charAt(0).toUpperCase()+t.substring(1),ks[s]=ks[t]})});function Es(t,s,n){return s==null||typeof s=="boolean"||s===""?"":n||typeof s!="number"||s===0||ks.hasOwnProperty(t)&&ks[t]?(""+s).trim():s+"px"}function Ls(t,s){t=t.style;for(var n in s)if(s.hasOwnProperty(n)){var i=n.indexOf("--")===0,u=Es(n,s[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,u):t[n]=u}}var hr=H({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 bn(t,s){if(s){if(hr[t]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(l(137,t));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(l(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(l(61))}if(s.style!=null&&typeof s.style!="object")throw Error(l(62))}}function mr(t,s){if(t.indexOf("-")===-1)return typeof s.is=="string";switch(t){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 Ir=null;function Ps(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Nn=null,qs=null,Xs=null;function Vn(t){if(t=il(t)){if(typeof Nn!="function")throw Error(l(280));var s=t.stateNode;s&&(s=si(s),Nn(t.stateNode,t.type,s))}}function Wn(t){qs?Xs?Xs.push(t):Xs=[t]:qs=t}function Hn(){if(qs){var t=qs,s=Xs;if(Xs=qs=null,Vn(t),s)for(t=0;t>>=0,t===0?32:31-(Tg(t)/Rg|0)|0}var Fl=64,zl=4194304;function Va(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function $l(t,s){var n=t.pendingLanes;if(n===0)return 0;var i=0,u=t.suspendedLanes,x=t.pingedLanes,w=n&268435455;if(w!==0){var _=w&~u;_!==0?i=Va(_):(x&=w,x!==0&&(i=Va(x)))}else w=n&~u,w!==0?i=Va(w):x!==0&&(i=Va(x));if(i===0)return 0;if(s!==0&&s!==i&&(s&u)===0&&(u=i&-i,x=s&-s,u>=x||u===16&&(x&4194240)!==0))return s;if((i&4)!==0&&(i|=n&16),s=t.entangledLanes,s!==0)for(t=t.entanglements,s&=i;0n;n++)s.push(t);return s}function Wa(t,s,n){t.pendingLanes|=s,s!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,s=31-Os(s),t[s]=n}function Ag(t,s){var n=t.pendingLanes&~s;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=s,t.mutableReadLanes&=s,t.entangledLanes&=s,s=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0=Ja),ch=" ",dh=!1;function uh(t,s){switch(t){case"keyup":return oy.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Xn=!1;function dy(t,s){switch(t){case"compositionend":return hh(s);case"keypress":return s.which!==32?null:(dh=!0,ch);case"textInput":return t=s.data,t===ch&&dh?null:t;default:return null}}function uy(t,s){if(Xn)return t==="compositionend"||!Qo&&uh(t,s)?(t=rh(),Hl=Vo=Fr=null,Xn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:n,offset:s-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=vh(n)}}function bh(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?bh(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function Nh(){for(var t=window,s=Ie();s instanceof t.HTMLIFrameElement;){try{var n=typeof s.contentWindow.location.href=="string"}catch{n=!1}if(n)t=s.contentWindow;else break;s=Ie(t.document)}return s}function Jo(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}function jy(t){var s=Nh(),n=t.focusedElem,i=t.selectionRange;if(s!==n&&n&&n.ownerDocument&&bh(n.ownerDocument.documentElement,n)){if(i!==null&&Jo(n)){if(s=i.start,t=i.end,t===void 0&&(t=s),"selectionStart"in n)n.selectionStart=s,n.selectionEnd=Math.min(t,n.value.length);else if(t=(s=n.ownerDocument||document)&&s.defaultView||window,t.getSelection){t=t.getSelection();var u=n.textContent.length,x=Math.min(i.start,u);i=i.end===void 0?x:Math.min(i.end,u),!t.extend&&x>i&&(u=i,i=x,x=u),u=jh(n,x);var w=jh(n,i);u&&w&&(t.rangeCount!==1||t.anchorNode!==u.node||t.anchorOffset!==u.offset||t.focusNode!==w.node||t.focusOffset!==w.offset)&&(s=s.createRange(),s.setStart(u.node,u.offset),t.removeAllRanges(),x>i?(t.addRange(s),t.extend(w.node,w.offset)):(s.setEnd(w.node,w.offset),t.addRange(s)))}}for(s=[],t=n;t=t.parentNode;)t.nodeType===1&&s.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Jn=null,Zo=null,sl=null,ec=!1;function wh(t,s,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ec||Jn==null||Jn!==Ie(i)||(i=Jn,"selectionStart"in i&&Jo(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),sl&&tl(sl,i)||(sl=i,i=Zl(Zo,"onSelect"),0ra||(t.current=hc[ra],hc[ra]=null,ra--)}function ht(t,s){ra++,hc[ra]=t.current,t.current=s}var Ur={},Xt=Br(Ur),os=Br(!1),Cn=Ur;function na(t,s){var n=t.type.contextTypes;if(!n)return Ur;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===s)return i.__reactInternalMemoizedMaskedChildContext;var u={},x;for(x in n)u[x]=s[x];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=u),u}function cs(t){return t=t.childContextTypes,t!=null}function ri(){xt(os),xt(Xt)}function Fh(t,s,n){if(Xt.current!==Ur)throw Error(l(168));ht(Xt,s),ht(os,n)}function zh(t,s,n){var i=t.stateNode;if(s=s.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var u in i)if(!(u in s))throw Error(l(108,G(t)||"Unknown",u));return H({},n,i)}function ni(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ur,Cn=Xt.current,ht(Xt,t),ht(os,os.current),!0}function $h(t,s,n){var i=t.stateNode;if(!i)throw Error(l(169));n?(t=zh(t,s,Cn),i.__reactInternalMemoizedMergedChildContext=t,xt(os),xt(Xt),ht(Xt,t)):xt(os),ht(os,n)}var xr=null,ai=!1,mc=!1;function Bh(t){xr===null?xr=[t]:xr.push(t)}function _y(t){ai=!0,Bh(t)}function Vr(){if(!mc&&xr!==null){mc=!0;var t=0,s=ct;try{var n=xr;for(ct=1;t>=w,u-=w,pr=1<<32-Os(s)+u|n<Ve?(Vt=ze,ze=null):Vt=ze.sibling;var rt=he(Q,ze,Z[Ve],je);if(rt===null){ze===null&&(ze=Vt);break}t&&ze&&rt.alternate===null&&s(Q,ze),V=x(rt,V,Ve),Fe===null?Le=rt:Fe.sibling=rt,Fe=rt,ze=Vt}if(Ve===Z.length)return n(Q,ze),vt&&En(Q,Ve),Le;if(ze===null){for(;VeVe?(Vt=ze,ze=null):Vt=ze.sibling;var Jr=he(Q,ze,rt.value,je);if(Jr===null){ze===null&&(ze=Vt);break}t&&ze&&Jr.alternate===null&&s(Q,ze),V=x(Jr,V,Ve),Fe===null?Le=Jr:Fe.sibling=Jr,Fe=Jr,ze=Vt}if(rt.done)return n(Q,ze),vt&&En(Q,Ve),Le;if(ze===null){for(;!rt.done;Ve++,rt=Z.next())rt=ge(Q,rt.value,je),rt!==null&&(V=x(rt,V,Ve),Fe===null?Le=rt:Fe.sibling=rt,Fe=rt);return vt&&En(Q,Ve),Le}for(ze=i(Q,ze);!rt.done;Ve++,rt=Z.next())rt=Pe(ze,Q,Ve,rt.value,je),rt!==null&&(t&&rt.alternate!==null&&ze.delete(rt.key===null?Ve:rt.key),V=x(rt,V,Ve),Fe===null?Le=rt:Fe.sibling=rt,Fe=rt);return t&&ze.forEach(function(hv){return s(Q,hv)}),vt&&En(Q,Ve),Le}function Rt(Q,V,Z,je){if(typeof Z=="object"&&Z!==null&&Z.type===k&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case W:e:{for(var Le=Z.key,Fe=V;Fe!==null;){if(Fe.key===Le){if(Le=Z.type,Le===k){if(Fe.tag===7){n(Q,Fe.sibling),V=u(Fe,Z.props.children),V.return=Q,Q=V;break e}}else if(Fe.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===ne&&Yh(Le)===Fe.type){n(Q,Fe.sibling),V=u(Fe,Z.props),V.ref=ol(Q,Fe,Z),V.return=Q,Q=V;break e}n(Q,Fe);break}else s(Q,Fe);Fe=Fe.sibling}Z.type===k?(V=Dn(Z.props.children,Q.mode,je,Z.key),V.return=Q,Q=V):(je=Mi(Z.type,Z.key,Z.props,null,Q.mode,je),je.ref=ol(Q,V,Z),je.return=Q,Q=je)}return w(Q);case U:e:{for(Fe=Z.key;V!==null;){if(V.key===Fe)if(V.tag===4&&V.stateNode.containerInfo===Z.containerInfo&&V.stateNode.implementation===Z.implementation){n(Q,V.sibling),V=u(V,Z.children||[]),V.return=Q,Q=V;break e}else{n(Q,V);break}else s(Q,V);V=V.sibling}V=dd(Z,Q.mode,je),V.return=Q,Q=V}return w(Q);case ne:return Fe=Z._init,Rt(Q,V,Fe(Z._payload),je)}if(ot(Z))return _e(Q,V,Z,je);if(ce(Z))return De(Q,V,Z,je);ci(Q,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"?(Z=""+Z,V!==null&&V.tag===6?(n(Q,V.sibling),V=u(V,Z),V.return=Q,Q=V):(n(Q,V),V=cd(Z,Q.mode,je),V.return=Q,Q=V),w(Q)):n(Q,V)}return Rt}var oa=Gh(!0),Qh=Gh(!1),di=Br(null),ui=null,ca=null,vc=null;function jc(){vc=ca=ui=null}function bc(t){var s=di.current;xt(di),t._currentValue=s}function Nc(t,s,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,i!==null&&(i.childLanes|=s)):i!==null&&(i.childLanes&s)!==s&&(i.childLanes|=s),t===n)break;t=t.return}}function da(t,s){ui=t,vc=ca=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&s)!==0&&(ds=!0),t.firstContext=null)}function _s(t){var s=t._currentValue;if(vc!==t)if(t={context:t,memoizedValue:s,next:null},ca===null){if(ui===null)throw Error(l(308));ca=t,ui.dependencies={lanes:0,firstContext:t}}else ca=ca.next=t;return s}var Pn=null;function wc(t){Pn===null?Pn=[t]:Pn.push(t)}function qh(t,s,n,i){var u=s.interleaved;return u===null?(n.next=n,wc(s)):(n.next=u.next,u.next=n),s.interleaved=n,yr(t,i)}function yr(t,s){t.lanes|=s;var n=t.alternate;for(n!==null&&(n.lanes|=s),n=t,t=t.return;t!==null;)t.childLanes|=s,n=t.alternate,n!==null&&(n.childLanes|=s),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Wr=!1;function Sc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xh(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function vr(t,s){return{eventTime:t,lane:s,tag:0,payload:null,callback:null,next:null}}function Hr(t,s,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(st&2)!==0){var u=i.pending;return u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s,yr(t,n)}return u=i.interleaved,u===null?(s.next=s,wc(i)):(s.next=u.next,u.next=s),i.interleaved=s,yr(t,n)}function hi(t,s,n){if(s=s.updateQueue,s!==null&&(s=s.shared,(n&4194240)!==0)){var i=s.lanes;i&=t.pendingLanes,n|=i,s.lanes=n,Fo(t,n)}}function Jh(t,s){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var u=null,x=null;if(n=n.firstBaseUpdate,n!==null){do{var w={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};x===null?u=x=w:x=x.next=w,n=n.next}while(n!==null);x===null?u=x=s:x=x.next=s}else u=x=s;n={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:x,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=s:t.next=s,n.lastBaseUpdate=s}function mi(t,s,n,i){var u=t.updateQueue;Wr=!1;var x=u.firstBaseUpdate,w=u.lastBaseUpdate,_=u.shared.pending;if(_!==null){u.shared.pending=null;var z=_,se=z.next;z.next=null,w===null?x=se:w.next=se,w=z;var me=t.alternate;me!==null&&(me=me.updateQueue,_=me.lastBaseUpdate,_!==w&&(_===null?me.firstBaseUpdate=se:_.next=se,me.lastBaseUpdate=z))}if(x!==null){var ge=u.baseState;w=0,me=se=z=null,_=x;do{var he=_.lane,Pe=_.eventTime;if((i&he)===he){me!==null&&(me=me.next={eventTime:Pe,lane:0,tag:_.tag,payload:_.payload,callback:_.callback,next:null});e:{var _e=t,De=_;switch(he=s,Pe=n,De.tag){case 1:if(_e=De.payload,typeof _e=="function"){ge=_e.call(Pe,ge,he);break e}ge=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=De.payload,he=typeof _e=="function"?_e.call(Pe,ge,he):_e,he==null)break e;ge=H({},ge,he);break e;case 2:Wr=!0}}_.callback!==null&&_.lane!==0&&(t.flags|=64,he=u.effects,he===null?u.effects=[_]:he.push(_))}else Pe={eventTime:Pe,lane:he,tag:_.tag,payload:_.payload,callback:_.callback,next:null},me===null?(se=me=Pe,z=ge):me=me.next=Pe,w|=he;if(_=_.next,_===null){if(_=u.shared.pending,_===null)break;he=_,_=he.next,he.next=null,u.lastBaseUpdate=he,u.shared.pending=null}}while(!0);if(me===null&&(z=ge),u.baseState=z,u.firstBaseUpdate=se,u.lastBaseUpdate=me,s=u.shared.interleaved,s!==null){u=s;do w|=u.lane,u=u.next;while(u!==s)}else x===null&&(u.shared.lanes=0);In|=w,t.lanes=w,t.memoizedState=ge}}function Zh(t,s,n){if(t=s.effects,s.effects=null,t!==null)for(s=0;sn?n:4,t(!0);var i=Tc.transition;Tc.transition={};try{t(!1),s()}finally{ct=n,Tc.transition=i}}function ym(){return Ms().memoizedState}function Ly(t,s,n){var i=Qr(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},vm(t))jm(s,n);else if(n=qh(t,s,n,i),n!==null){var u=as();Vs(n,t,i,u),bm(n,s,i)}}function Oy(t,s,n){var i=Qr(t),u={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(vm(t))jm(s,u);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var w=s.lastRenderedState,_=x(w,n);if(u.hasEagerState=!0,u.eagerState=_,Fs(_,w)){var z=s.interleaved;z===null?(u.next=u,wc(s)):(u.next=z.next,z.next=u),s.interleaved=u;return}}catch{}finally{}n=qh(t,s,u,i),n!==null&&(u=as(),Vs(n,t,i,u),bm(n,s,i))}}function vm(t){var s=t.alternate;return t===wt||s!==null&&s===wt}function jm(t,s){hl=pi=!0;var n=t.pending;n===null?s.next=s:(s.next=n.next,n.next=s),t.pending=s}function bm(t,s,n){if((n&4194240)!==0){var i=s.lanes;i&=t.pendingLanes,n|=i,s.lanes=n,Fo(t,n)}}var vi={readContext:_s,useCallback:Jt,useContext:Jt,useEffect:Jt,useImperativeHandle:Jt,useInsertionEffect:Jt,useLayoutEffect:Jt,useMemo:Jt,useReducer:Jt,useRef:Jt,useState:Jt,useDebugValue:Jt,useDeferredValue:Jt,useTransition:Jt,useMutableSource:Jt,useSyncExternalStore:Jt,useId:Jt,unstable_isNewReconciler:!1},Fy={readContext:_s,useCallback:function(t,s){return sr().memoizedState=[t,s===void 0?null:s],t},useContext:_s,useEffect:dm,useImperativeHandle:function(t,s,n){return n=n!=null?n.concat([t]):null,gi(4194308,4,mm.bind(null,s,t),n)},useLayoutEffect:function(t,s){return gi(4194308,4,t,s)},useInsertionEffect:function(t,s){return gi(4,2,t,s)},useMemo:function(t,s){var n=sr();return s=s===void 0?null:s,t=t(),n.memoizedState=[t,s],t},useReducer:function(t,s,n){var i=sr();return s=n!==void 0?n(s):s,i.memoizedState=i.baseState=s,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:s},i.queue=t,t=t.dispatch=Ly.bind(null,wt,t),[i.memoizedState,t]},useRef:function(t){var s=sr();return t={current:t},s.memoizedState=t},useState:om,useDebugValue:Lc,useDeferredValue:function(t){return sr().memoizedState=t},useTransition:function(){var t=om(!1),s=t[0];return t=Dy.bind(null,t[1]),sr().memoizedState=t,[s,t]},useMutableSource:function(){},useSyncExternalStore:function(t,s,n){var i=wt,u=sr();if(vt){if(n===void 0)throw Error(l(407));n=n()}else{if(n=s(),Ut===null)throw Error(l(349));(Rn&30)!==0||rm(i,s,n)}u.memoizedState=n;var x={value:n,getSnapshot:s};return u.queue=x,dm(am.bind(null,i,x,t),[t]),i.flags|=2048,xl(9,nm.bind(null,i,x,n,s),void 0,null),n},useId:function(){var t=sr(),s=Ut.identifierPrefix;if(vt){var n=gr,i=pr;n=(i&~(1<<32-Os(i)-1)).toString(32)+n,s=":"+s+"R"+n,n=ml++,0<\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=w.createElement(n,{is:i.is}):(t=w.createElement(n),n==="select"&&(w=t,i.multiple?w.multiple=!0:i.size&&(w.size=i.size))):t=w.createElementNS(t,n),t[er]=s,t[ll]=i,Bm(t,s,!1,!1),s.stateNode=t;e:{switch(w=mr(n,i),n){case"dialog":ft("cancel",t),ft("close",t),u=i;break;case"iframe":case"object":case"embed":ft("load",t),u=i;break;case"video":case"audio":for(u=0;uxa&&(s.flags|=128,i=!0,pl(x,!1),s.lanes=4194304)}else{if(!i)if(t=fi(w),t!==null){if(s.flags|=128,i=!0,n=t.updateQueue,n!==null&&(s.updateQueue=n,s.flags|=4),pl(x,!0),x.tail===null&&x.tailMode==="hidden"&&!w.alternate&&!vt)return Zt(s),null}else 2*Tt()-x.renderingStartTime>xa&&n!==1073741824&&(s.flags|=128,i=!0,pl(x,!1),s.lanes=4194304);x.isBackwards?(w.sibling=s.child,s.child=w):(n=x.last,n!==null?n.sibling=w:s.child=w,x.last=w)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=Tt(),s.sibling=null,n=Nt.current,ht(Nt,i?n&1|2:n&1),s):(Zt(s),null);case 22:case 23:return ld(),i=s.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(s.flags|=8192),i&&(s.mode&1)!==0?(Ns&1073741824)!==0&&(Zt(s),s.subtreeFlags&6&&(s.flags|=8192)):Zt(s),null;case 24:return null;case 25:return null}throw Error(l(156,s.tag))}function Ky(t,s){switch(xc(s),s.tag){case 1:return cs(s.type)&&ri(),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return ua(),xt(os),xt(Xt),Pc(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 5:return kc(s),null;case 13:if(xt(Nt),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));ia()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return xt(Nt),null;case 4:return ua(),null;case 10:return bc(s.type._context),null;case 22:case 23:return ld(),null;case 24:return null;default:return null}}var wi=!1,es=!1,Yy=typeof WeakSet=="function"?WeakSet:Set,Re=null;function ma(t,s){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){Et(t,s,i)}else n.current=null}function Gc(t,s,n){try{n()}catch(i){Et(t,s,i)}}var Wm=!1;function Gy(t,s){if(lc=Vl,t=Nh(),Jo(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var u=i.anchorOffset,x=i.focusNode;i=i.focusOffset;try{n.nodeType,x.nodeType}catch{n=null;break e}var w=0,_=-1,z=-1,se=0,me=0,ge=t,he=null;t:for(;;){for(var Pe;ge!==n||u!==0&&ge.nodeType!==3||(_=w+u),ge!==x||i!==0&&ge.nodeType!==3||(z=w+i),ge.nodeType===3&&(w+=ge.nodeValue.length),(Pe=ge.firstChild)!==null;)he=ge,ge=Pe;for(;;){if(ge===t)break t;if(he===n&&++se===u&&(_=w),he===x&&++me===i&&(z=w),(Pe=ge.nextSibling)!==null)break;ge=he,he=ge.parentNode}ge=Pe}n=_===-1||z===-1?null:{start:_,end:z}}else n=null}n=n||{start:0,end:0}}else n=null;for(ic={focusedElem:t,selectionRange:n},Vl=!1,Re=s;Re!==null;)if(s=Re,t=s.child,(s.subtreeFlags&1028)!==0&&t!==null)t.return=s,Re=t;else for(;Re!==null;){s=Re;try{var _e=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var De=_e.memoizedProps,Rt=_e.memoizedState,Q=s.stateNode,V=Q.getSnapshotBeforeUpdate(s.elementType===s.type?De:$s(s.type,De),Rt);Q.__reactInternalSnapshotBeforeUpdate=V}break;case 3:var Z=s.stateNode.containerInfo;Z.nodeType===1?Z.textContent="":Z.nodeType===9&&Z.documentElement&&Z.removeChild(Z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(je){Et(s,s.return,je)}if(t=s.sibling,t!==null){t.return=s.return,Re=t;break}Re=s.return}return _e=Wm,Wm=!1,_e}function gl(t,s,n){var i=s.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&t)===t){var x=u.destroy;u.destroy=void 0,x!==void 0&&Gc(s,n,x)}u=u.next}while(u!==i)}}function Si(t,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var n=s=s.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==s)}}function Qc(t){var s=t.ref;if(s!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof s=="function"?s(t):s.current=t}}function Hm(t){var s=t.alternate;s!==null&&(t.alternate=null,Hm(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&(delete s[er],delete s[ll],delete s[uc],delete s[Ry],delete s[Iy])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Km(t){return t.tag===5||t.tag===3||t.tag===4}function Ym(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Km(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function qc(t,s,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,s?n.nodeType===8?n.parentNode.insertBefore(t,s):n.insertBefore(t,s):(n.nodeType===8?(s=n.parentNode,s.insertBefore(t,n)):(s=n,s.appendChild(t)),n=n._reactRootContainer,n!=null||s.onclick!==null||(s.onclick=ti));else if(i!==4&&(t=t.child,t!==null))for(qc(t,s,n),t=t.sibling;t!==null;)qc(t,s,n),t=t.sibling}function Xc(t,s,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,s?n.insertBefore(t,s):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(Xc(t,s,n),t=t.sibling;t!==null;)Xc(t,s,n),t=t.sibling}var Yt=null,Bs=!1;function Kr(t,s,n){for(n=n.child;n!==null;)Gm(t,s,n),n=n.sibling}function Gm(t,s,n){if(Zs&&typeof Zs.onCommitFiberUnmount=="function")try{Zs.onCommitFiberUnmount(Ol,n)}catch{}switch(n.tag){case 5:es||ma(n,s);case 6:var i=Yt,u=Bs;Yt=null,Kr(t,s,n),Yt=i,Bs=u,Yt!==null&&(Bs?(t=Yt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Yt.removeChild(n.stateNode));break;case 18:Yt!==null&&(Bs?(t=Yt,n=n.stateNode,t.nodeType===8?dc(t.parentNode,n):t.nodeType===1&&dc(t,n),Qa(t)):dc(Yt,n.stateNode));break;case 4:i=Yt,u=Bs,Yt=n.stateNode.containerInfo,Bs=!0,Kr(t,s,n),Yt=i,Bs=u;break;case 0:case 11:case 14:case 15:if(!es&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){u=i=i.next;do{var x=u,w=x.destroy;x=x.tag,w!==void 0&&((x&2)!==0||(x&4)!==0)&&Gc(n,s,w),u=u.next}while(u!==i)}Kr(t,s,n);break;case 1:if(!es&&(ma(n,s),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(_){Et(n,s,_)}Kr(t,s,n);break;case 21:Kr(t,s,n);break;case 22:n.mode&1?(es=(i=es)||n.memoizedState!==null,Kr(t,s,n),es=i):Kr(t,s,n);break;default:Kr(t,s,n)}}function Qm(t){var s=t.updateQueue;if(s!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Yy),s.forEach(function(i){var u=rv.bind(null,t,i);n.has(i)||(n.add(i),i.then(u,u))})}}function Us(t,s){var n=s.deletions;if(n!==null)for(var i=0;iu&&(u=w),i&=~x}if(i=u,i=Tt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qy(i/1960))-i,10t?16:t,Gr===null)var i=!1;else{if(t=Gr,Gr=null,Ti=0,(st&6)!==0)throw Error(l(331));var u=st;for(st|=4,Re=t.current;Re!==null;){var x=Re,w=x.child;if((Re.flags&16)!==0){var _=x.deletions;if(_!==null){for(var z=0;z<_.length;z++){var se=_[z];for(Re=se;Re!==null;){var me=Re;switch(me.tag){case 0:case 11:case 15:gl(8,me,x)}var ge=me.child;if(ge!==null)ge.return=me,Re=ge;else for(;Re!==null;){me=Re;var he=me.sibling,Pe=me.return;if(Hm(me),me===se){Re=null;break}if(he!==null){he.return=Pe,Re=he;break}Re=Pe}}}var _e=x.alternate;if(_e!==null){var De=_e.child;if(De!==null){_e.child=null;do{var Rt=De.sibling;De.sibling=null,De=Rt}while(De!==null)}}Re=x}}if((x.subtreeFlags&2064)!==0&&w!==null)w.return=x,Re=w;else e:for(;Re!==null;){if(x=Re,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:gl(9,x,x.return)}var Q=x.sibling;if(Q!==null){Q.return=x.return,Re=Q;break e}Re=x.return}}var V=t.current;for(Re=V;Re!==null;){w=Re;var Z=w.child;if((w.subtreeFlags&2064)!==0&&Z!==null)Z.return=w,Re=Z;else e:for(w=V;Re!==null;){if(_=Re,(_.flags&2048)!==0)try{switch(_.tag){case 0:case 11:case 15:Si(9,_)}}catch(Le){Et(_,_.return,Le)}if(_===w){Re=null;break e}var je=_.sibling;if(je!==null){je.return=_.return,Re=je;break e}Re=_.return}}if(st=u,Vr(),Zs&&typeof Zs.onPostCommitFiberRoot=="function")try{Zs.onPostCommitFiberRoot(Ol,t)}catch{}i=!0}return i}finally{ct=n,As.transition=s}}return!1}function of(t,s,n){s=ha(n,s),s=Cm(t,s,1),t=Hr(t,s,1),s=as(),t!==null&&(Wa(t,1,s),hs(t,s))}function Et(t,s,n){if(t.tag===3)of(t,t,n);else for(;s!==null;){if(s.tag===3){of(s,t,n);break}else if(s.tag===1){var i=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Yr===null||!Yr.has(i))){t=ha(n,t),t=km(s,t,1),s=Hr(s,t,1),t=as(),s!==null&&(Wa(s,1,t),hs(s,t));break}}s=s.return}}function tv(t,s,n){var i=t.pingCache;i!==null&&i.delete(s),s=as(),t.pingedLanes|=t.suspendedLanes&n,Ut===t&&(Gt&n)===n&&(zt===4||zt===3&&(Gt&130023424)===Gt&&500>Tt()-ed?Mn(t,0):Zc|=n),hs(t,s)}function cf(t,s){s===0&&((t.mode&1)===0?s=1:(s=zl,zl<<=1,(zl&130023424)===0&&(zl=4194304)));var n=as();t=yr(t,s),t!==null&&(Wa(t,s,n),hs(t,n))}function sv(t){var s=t.memoizedState,n=0;s!==null&&(n=s.retryLane),cf(t,n)}function rv(t,s){var n=0;switch(t.tag){case 13:var i=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(l(314))}i!==null&&i.delete(s),cf(t,n)}var df;df=function(t,s,n){if(t!==null)if(t.memoizedProps!==s.pendingProps||os.current)ds=!0;else{if((t.lanes&n)===0&&(s.flags&128)===0)return ds=!1,Wy(t,s,n);ds=(t.flags&131072)!==0}else ds=!1,vt&&(s.flags&1048576)!==0&&Uh(s,ii,s.index);switch(s.lanes=0,s.tag){case 2:var i=s.type;Ni(t,s),t=s.pendingProps;var u=na(s,Xt.current);da(s,n),u=Ic(null,s,i,t,u,n);var x=_c();return s.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,cs(i)?(x=!0,ni(s)):x=!1,s.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Sc(s),u.updater=ji,s.stateNode=u,u._reactInternals=s,Fc(s,i,t,n),s=Uc(null,s,i,!0,x,n)):(s.tag=0,vt&&x&&fc(s),ns(null,s,u,n),s=s.child),s;case 16:i=s.elementType;e:{switch(Ni(t,s),t=s.pendingProps,u=i._init,i=u(i._payload),s.type=i,u=s.tag=av(i),t=$s(i,t),u){case 0:s=Bc(null,s,i,t,n);break e;case 1:s=Dm(null,s,i,t,n);break e;case 11:s=Rm(null,s,i,t,n);break e;case 14:s=Im(null,s,i,$s(i.type,t),n);break e}throw Error(l(306,i,""))}return s;case 0:return i=s.type,u=s.pendingProps,u=s.elementType===i?u:$s(i,u),Bc(t,s,i,u,n);case 1:return i=s.type,u=s.pendingProps,u=s.elementType===i?u:$s(i,u),Dm(t,s,i,u,n);case 3:e:{if(Lm(s),t===null)throw Error(l(387));i=s.pendingProps,x=s.memoizedState,u=x.element,Xh(t,s),mi(s,i,null,n);var w=s.memoizedState;if(i=w.element,x.isDehydrated)if(x={element:i,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){u=ha(Error(l(423)),s),s=Om(t,s,i,n,u);break e}else if(i!==u){u=ha(Error(l(424)),s),s=Om(t,s,i,n,u);break e}else for(bs=$r(s.stateNode.containerInfo.firstChild),js=s,vt=!0,zs=null,n=Qh(s,null,i,n),s.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ia(),i===u){s=jr(t,s,n);break e}ns(t,s,i,n)}s=s.child}return s;case 5:return em(s),t===null&&gc(s),i=s.type,u=s.pendingProps,x=t!==null?t.memoizedProps:null,w=u.children,oc(i,u)?w=null:x!==null&&oc(i,x)&&(s.flags|=32),Am(t,s),ns(t,s,w,n),s.child;case 6:return t===null&&gc(s),null;case 13:return Fm(t,s,n);case 4:return Cc(s,s.stateNode.containerInfo),i=s.pendingProps,t===null?s.child=oa(s,null,i,n):ns(t,s,i,n),s.child;case 11:return i=s.type,u=s.pendingProps,u=s.elementType===i?u:$s(i,u),Rm(t,s,i,u,n);case 7:return ns(t,s,s.pendingProps,n),s.child;case 8:return ns(t,s,s.pendingProps.children,n),s.child;case 12:return ns(t,s,s.pendingProps.children,n),s.child;case 10:e:{if(i=s.type._context,u=s.pendingProps,x=s.memoizedProps,w=u.value,ht(di,i._currentValue),i._currentValue=w,x!==null)if(Fs(x.value,w)){if(x.children===u.children&&!os.current){s=jr(t,s,n);break e}}else for(x=s.child,x!==null&&(x.return=s);x!==null;){var _=x.dependencies;if(_!==null){w=x.child;for(var z=_.firstContext;z!==null;){if(z.context===i){if(x.tag===1){z=vr(-1,n&-n),z.tag=2;var se=x.updateQueue;if(se!==null){se=se.shared;var me=se.pending;me===null?z.next=z:(z.next=me.next,me.next=z),se.pending=z}}x.lanes|=n,z=x.alternate,z!==null&&(z.lanes|=n),Nc(x.return,n,s),_.lanes|=n;break}z=z.next}}else if(x.tag===10)w=x.type===s.type?null:x.child;else if(x.tag===18){if(w=x.return,w===null)throw Error(l(341));w.lanes|=n,_=w.alternate,_!==null&&(_.lanes|=n),Nc(w,n,s),w=x.sibling}else w=x.child;if(w!==null)w.return=x;else for(w=x;w!==null;){if(w===s){w=null;break}if(x=w.sibling,x!==null){x.return=w.return,w=x;break}w=w.return}x=w}ns(t,s,u.children,n),s=s.child}return s;case 9:return u=s.type,i=s.pendingProps.children,da(s,n),u=_s(u),i=i(u),s.flags|=1,ns(t,s,i,n),s.child;case 14:return i=s.type,u=$s(i,s.pendingProps),u=$s(i.type,u),Im(t,s,i,u,n);case 15:return _m(t,s,s.type,s.pendingProps,n);case 17:return i=s.type,u=s.pendingProps,u=s.elementType===i?u:$s(i,u),Ni(t,s),s.tag=1,cs(i)?(t=!0,ni(s)):t=!1,da(s,n),wm(s,i,u),Fc(s,i,u,n),Uc(null,s,i,!0,t,n);case 19:return $m(t,s,n);case 22:return Mm(t,s,n)}throw Error(l(156,s.tag))};function uf(t,s){return Ts(t,s)}function nv(t,s,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ds(t,s,n,i){return new nv(t,s,n,i)}function od(t){return t=t.prototype,!(!t||!t.isReactComponent)}function av(t){if(typeof t=="function")return od(t)?1:0;if(t!=null){if(t=t.$$typeof,t===oe)return 11;if(t===Y)return 14}return 2}function Xr(t,s){var n=t.alternate;return n===null?(n=Ds(t.tag,s,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=s,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,s=t.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Mi(t,s,n,i,u,x){var w=2;if(i=t,typeof t=="function")od(t)&&(w=1);else if(typeof t=="string")w=5;else e:switch(t){case k:return Dn(n.children,u,x,s);case A:w=8,u|=8;break;case I:return t=Ds(12,n,s,u|2),t.elementType=I,t.lanes=x,t;case te:return t=Ds(13,n,s,u),t.elementType=te,t.lanes=x,t;case J:return t=Ds(19,n,s,u),t.elementType=J,t.lanes=x,t;case ve:return Ai(n,u,x,s);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case re:w=10;break e;case ie:w=9;break e;case oe:w=11;break e;case Y:w=14;break e;case ne:w=16,i=null;break e}throw Error(l(130,t==null?t:typeof t,""))}return s=Ds(w,n,s,u),s.elementType=t,s.type=i,s.lanes=x,s}function Dn(t,s,n,i){return t=Ds(7,t,i,s),t.lanes=n,t}function Ai(t,s,n,i){return t=Ds(22,t,i,s),t.elementType=ve,t.lanes=n,t.stateNode={isHidden:!1},t}function cd(t,s,n){return t=Ds(6,t,null,s),t.lanes=n,t}function dd(t,s,n){return s=Ds(4,t.children!==null?t.children:[],t.key,s),s.lanes=n,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}function lv(t,s,n,i,u){this.tag=s,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Oo(0),this.expirationTimes=Oo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oo(0),this.identifierPrefix=i,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function ud(t,s,n,i,u,x,w,_,z){return t=new lv(t,s,n,_,z),s===1?(s=1,x===!0&&(s|=8)):s=0,x=Ds(3,null,null,s),t.current=x,x.stateNode=t,x.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sc(x),t}function iv(t,s,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),gd.exports=vv(),gd.exports}var Cf;function jv(){if(Cf)return Bi;Cf=1;var r=Px();return Bi.createRoot=r.createRoot,Bi.hydrateRoot=r.hydrateRoot,Bi}var bv=jv(),Il=Px();const Nv=Ex(Il);/** - * @remix-run/router v1.23.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function El(){return El=Object.assign?Object.assign.bind():function(r){for(var a=1;a"u")throw new Error(a)}function uu(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Sv(){return Math.random().toString(36).substr(2,8)}function Ef(r,a){return{usr:r.state,key:r.key,idx:a}}function zd(r,a,l,o){return l===void 0&&(l=null),El({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?Ma(a):a,{state:l,key:a&&a.key||o||Sv()})}function so(r){let{pathname:a="/",search:l="",hash:o=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function Ma(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let o=r.indexOf("?");o>=0&&(a.search=r.substr(o),r=r.substr(0,o)),r&&(a.pathname=r)}return a}function Cv(r,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:d=!1}=o,m=c.history,f=rn.Pop,p=null,y=g();y==null&&(y=0,m.replaceState(El({},m.state,{idx:y}),""));function g(){return(m.state||{idx:null}).idx}function v(){f=rn.Pop;let b=g(),N=b==null?null:b-y;y=b,p&&p({action:f,location:S.location,delta:N})}function C(b,N){f=rn.Push;let E=zd(S.location,b,N);y=g()+1;let j=Ef(E,y),R=S.createHref(E);try{m.pushState(j,"",R)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;c.location.assign(R)}d&&p&&p({action:f,location:S.location,delta:1})}function P(b,N){f=rn.Replace;let E=zd(S.location,b,N);y=g();let j=Ef(E,y),R=S.createHref(E);m.replaceState(j,"",R),d&&p&&p({action:f,location:S.location,delta:0})}function T(b){let N=c.location.origin!=="null"?c.location.origin:c.location.href,E=typeof b=="string"?b:so(b);return E=E.replace(/ $/,"%20"),It(N,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,N)}let S={get action(){return f},get location(){return r(c,m)},listen(b){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(kf,v),p=b,()=>{c.removeEventListener(kf,v),p=null}},createHref(b){return a(c,b)},createURL:T,encodeLocation(b){let N=T(b);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:C,replace:P,go(b){return m.go(b)}};return S}var Pf;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Pf||(Pf={}));function kv(r,a,l){return l===void 0&&(l="/"),Ev(r,a,l)}function Ev(r,a,l,o){let c=typeof a=="string"?Ma(a):a,d=hu(c.pathname||"/",l);if(d==null)return null;let m=Tx(r);Pv(m);let f=null;for(let p=0;f==null&&p{let p={relativePath:f===void 0?d.path||"":f,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};p.relativePath.startsWith("/")&&(It(p.relativePath.startsWith(o),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(o.length));let y=an([o,p.relativePath]),g=l.concat(p);d.children&&d.children.length>0&&(It(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Tx(d.children,a,g,y)),!(d.path==null&&!d.index)&&a.push({path:y,score:Dv(y,d.index),routesMeta:g})};return r.forEach((d,m)=>{var f;if(d.path===""||!((f=d.path)!=null&&f.includes("?")))c(d,m);else for(let p of Rx(d.path))c(d,m,p)}),a}function Rx(r){let a=r.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(o.length===0)return c?[d,""]:[d];let m=Rx(o.join("/")),f=[];return f.push(...m.map(p=>p===""?d:[d,p].join("/"))),c&&f.push(...m),f.map(p=>r.startsWith("/")&&p===""?"/":p)}function Pv(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:Lv(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const Tv=/^:[\w-]+$/,Rv=3,Iv=2,_v=1,Mv=10,Av=-2,Tf=r=>r==="*";function Dv(r,a){let l=r.split("/"),o=l.length;return l.some(Tf)&&(o+=Av),a&&(o+=Iv),l.filter(c=>!Tf(c)).reduce((c,d)=>c+(Tv.test(d)?Rv:d===""?_v:Mv),o)}function Lv(r,a){return r.length===a.length&&r.slice(0,-1).every((o,c)=>o===a[c])?r[r.length-1]-a[a.length-1]:0}function Ov(r,a,l){let{routesMeta:o}=r,c={},d="/",m=[];for(let f=0;f{let{paramName:C,isOptional:P}=g;if(C==="*"){let S=f[v]||"";m=d.slice(0,d.length-S.length).replace(/(.)\/+$/,"$1")}const T=f[v];return P&&!T?y[C]=void 0:y[C]=(T||"").replace(/%2F/g,"/"),y},{}),pathname:d,pathnameBase:m,pattern:r}}function zv(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),uu(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let o=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,f,p)=>(o.push({paramName:f,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(o.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function $v(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return uu(!1,'The URL path "'+r+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),r}}function hu(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=r.charAt(l);return o&&o!=="/"?null:r.slice(l)||"/"}const Bv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Uv=r=>Bv.test(r);function Vv(r,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof r=="string"?Ma(r):r,d;if(l)if(Uv(l))d=l;else{if(l.includes("//")){let m=l;l=l.replace(/\/\/+/g,"/"),uu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(m+" -> "+l))}l.startsWith("/")?d=Rf(l.substring(1),"/"):d=Rf(l,a)}else d=a;return{pathname:d,search:Kv(o),hash:Yv(c)}}function Rf(r,a){let l=a.replace(/\/+$/,"").split("/");return r.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function jd(r,a,l,o){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Wv(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function mu(r,a){let l=Wv(r);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function fu(r,a,l,o){o===void 0&&(o=!1);let c;typeof r=="string"?c=Ma(r):(c=El({},r),It(!c.pathname||!c.pathname.includes("?"),jd("?","pathname","search",c)),It(!c.pathname||!c.pathname.includes("#"),jd("#","pathname","hash",c)),It(!c.search||!c.search.includes("#"),jd("#","search","hash",c)));let d=r===""||c.pathname==="",m=d?"/":c.pathname,f;if(m==null)f=l;else{let v=a.length-1;if(!o&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),v-=1;c.pathname=C.join("/")}f=v>=0?a[v]:"/"}let p=Vv(c,f),y=m&&m!=="/"&&m.endsWith("/"),g=(d||m===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(y||g)&&(p.pathname+="/"),p}const an=r=>r.join("/").replace(/\/\/+/g,"/"),Hv=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Kv=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Yv=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function Gv(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Ix=["post","put","patch","delete"];new Set(Ix);const Qv=["get",...Ix];new Set(Qv);/** - * React Router v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Pl(){return Pl=Object.assign?Object.assign.bind():function(r){for(var a=1;a{f.current=!0}),h.useCallback(function(y,g){if(g===void 0&&(g={}),!f.current)return;if(typeof y=="number"){o.go(y);return}let v=fu(y,JSON.parse(m),d,g.relative==="path");r==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:an([a,v.pathname])),(g.replace?o.replace:o.push)(v,g.state,g)},[a,o,m,d,r])}const Zv=h.createContext(null);function ej(r){let a=h.useContext(Rr).outlet;return a&&h.createElement(Zv.Provider,{value:r},a)}function Ax(r,a){let{relative:l}=a===void 0?{}:a,{future:o}=h.useContext(fn),{matches:c}=h.useContext(Rr),{pathname:d}=xn(),m=JSON.stringify(mu(c,o.v7_relativeSplatPath));return h.useMemo(()=>fu(r,JSON.parse(m),d,l==="path"),[r,m,d,l])}function tj(r,a){return sj(r,a)}function sj(r,a,l,o){Aa()||It(!1);let{navigator:c}=h.useContext(fn),{matches:d}=h.useContext(Rr),m=d[d.length-1],f=m?m.params:{};m&&m.pathname;let p=m?m.pathnameBase:"/";m&&m.route;let y=xn(),g;if(a){var v;let b=typeof a=="string"?Ma(a):a;p==="/"||(v=b.pathname)!=null&&v.startsWith(p)||It(!1),g=b}else g=y;let C=g.pathname||"/",P=C;if(p!=="/"){let b=p.replace(/^\//,"").split("/");P="/"+C.replace(/^\//,"").split("/").slice(b.length).join("/")}let T=kv(r,{pathname:P}),S=ij(T&&T.map(b=>Object.assign({},b,{params:Object.assign({},f,b.params),pathname:an([p,c.encodeLocation?c.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?p:an([p,c.encodeLocation?c.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),d,l,o);return a&&S?h.createElement(vo.Provider,{value:{location:Pl({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:rn.Pop}},S):S}function rj(){let r=uj(),a=Gv(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),l=r instanceof Error?r.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},a),l?h.createElement("pre",{style:c},l):null,null)}const nj=h.createElement(rj,null);class aj extends h.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){console.error("React Router caught the following error during render",a,l)}render(){return this.state.error!==void 0?h.createElement(Rr.Provider,{value:this.props.routeContext},h.createElement(_x.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function lj(r){let{routeContext:a,match:l,children:o}=r,c=h.useContext(xu);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),h.createElement(Rr.Provider,{value:a},o)}function ij(r,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),r==null){var d;if(!l)return null;if(l.errors)r=l.matches;else if((d=o)!=null&&d.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)r=l.matches;else return null}let m=r,f=(c=l)==null?void 0:c.errors;if(f!=null){let g=m.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);g>=0||It(!1),m=m.slice(0,Math.min(m.length,g+1))}let p=!1,y=-1;if(l&&o&&o.v7_partialHydration)for(let g=0;g=0?m=m.slice(0,y+1):m=[m[0]];break}}}return m.reduceRight((g,v,C)=>{let P,T=!1,S=null,b=null;l&&(P=f&&v.route.id?f[v.route.id]:void 0,S=v.route.errorElement||nj,p&&(y<0&&C===0?(mj("route-fallback"),T=!0,b=null):y===C&&(T=!0,b=v.route.hydrateFallbackElement||null)));let N=a.concat(m.slice(0,C+1)),E=()=>{let j;return P?j=S:T?j=b:v.route.Component?j=h.createElement(v.route.Component,null):v.route.element?j=v.route.element:j=g,h.createElement(lj,{match:v,routeContext:{outlet:g,matches:N,isDataRoute:l!=null},children:j})};return l&&(v.route.ErrorBoundary||v.route.errorElement||C===0)?h.createElement(aj,{location:l.location,revalidation:l.revalidation,component:S,error:P,children:E(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):E()},null)}var Dx=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(Dx||{}),Lx=(function(r){return r.UseBlocker="useBlocker",r.UseLoaderData="useLoaderData",r.UseActionData="useActionData",r.UseRouteError="useRouteError",r.UseNavigation="useNavigation",r.UseRouteLoaderData="useRouteLoaderData",r.UseMatches="useMatches",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r.UseRouteId="useRouteId",r})(Lx||{});function oj(r){let a=h.useContext(xu);return a||It(!1),a}function cj(r){let a=h.useContext(qv);return a||It(!1),a}function dj(r){let a=h.useContext(Rr);return a||It(!1),a}function Ox(r){let a=dj(),l=a.matches[a.matches.length-1];return l.route.id||It(!1),l.route.id}function uj(){var r;let a=h.useContext(_x),l=cj(),o=Ox();return a!==void 0?a:(r=l.errors)==null?void 0:r[o]}function hj(){let{router:r}=oj(Dx.UseNavigateStable),a=Ox(Lx.UseNavigateStable),l=h.useRef(!1);return Mx(()=>{l.current=!0}),h.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,Pl({fromRouteId:a},d)))},[r,a])}const If={};function mj(r,a,l){If[r]||(If[r]=!0)}function fj(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function bd(r){let{to:a,replace:l,state:o,relative:c}=r;Aa()||It(!1);let{future:d,static:m}=h.useContext(fn),{matches:f}=h.useContext(Rr),{pathname:p}=xn(),y=Da(),g=fu(a,mu(f,d.v7_relativeSplatPath),p,c==="path"),v=JSON.stringify(g);return h.useEffect(()=>y(JSON.parse(v),{replace:l,state:o,relative:c}),[y,v,c,l,o]),null}function xj(r){return ej(r.context)}function pt(r){It(!1)}function pj(r){let{basename:a="/",children:l=null,location:o,navigationType:c=rn.Pop,navigator:d,static:m=!1,future:f}=r;Aa()&&It(!1);let p=a.replace(/^\/*/,"/"),y=h.useMemo(()=>({basename:p,navigator:d,static:m,future:Pl({v7_relativeSplatPath:!1},f)}),[p,f,d,m]);typeof o=="string"&&(o=Ma(o));let{pathname:g="/",search:v="",hash:C="",state:P=null,key:T="default"}=o,S=h.useMemo(()=>{let b=hu(g,p);return b==null?null:{location:{pathname:b,search:v,hash:C,state:P,key:T},navigationType:c}},[p,g,v,C,P,T,c]);return S==null?null:h.createElement(fn.Provider,{value:y},h.createElement(vo.Provider,{children:l,value:S}))}function gj(r){let{children:a,location:l}=r;return tj($d(a),l)}new Promise(()=>{});function $d(r,a){a===void 0&&(a=[]);let l=[];return h.Children.forEach(r,(o,c)=>{if(!h.isValidElement(o))return;let d=[...a,c];if(o.type===h.Fragment){l.push.apply(l,$d(o.props.children,d));return}o.type!==pt&&It(!1),!o.props.index||!o.props.children||It(!1);let m={id:o.props.id||d.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(m.children=$d(o.props.children,d)),l.push(m)}),l}/** - * React Router DOM v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Bd(){return Bd=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function vj(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function jj(r,a){return r.button===0&&(!a||a==="_self")&&!vj(r)}function Ud(r){return r===void 0&&(r=""),new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((a,l)=>{let o=r[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function bj(r,a){let l=Ud(r);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(d=>{l.append(c,d)})}),l}const Nj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],wj="6";try{window.__reactRouterVersion=wj}catch{}const Sj="startTransition",_f=yo[Sj];function Cj(r){let{basename:a,children:l,future:o,window:c}=r,d=h.useRef();d.current==null&&(d.current=wv({window:c,v5Compat:!0}));let m=d.current,[f,p]=h.useState({action:m.action,location:m.location}),{v7_startTransition:y}=o||{},g=h.useCallback(v=>{y&&_f?_f(()=>p(v)):p(v)},[p,y]);return h.useLayoutEffect(()=>m.listen(g),[m,g]),h.useEffect(()=>fj(o),[o]),h.createElement(pj,{basename:a,children:l,location:f.location,navigationType:f.action,navigator:m,future:o})}const kj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ej=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ji=h.forwardRef(function(a,l){let{onClick:o,relative:c,reloadDocument:d,replace:m,state:f,target:p,to:y,preventScrollReset:g,viewTransition:v}=a,C=yj(a,Nj),{basename:P}=h.useContext(fn),T,S=!1;if(typeof y=="string"&&Ej.test(y)&&(T=y,kj))try{let j=new URL(window.location.href),R=y.startsWith("//")?new URL(j.protocol+y):new URL(y),W=hu(R.pathname,P);R.origin===j.origin&&W!=null?y=W+R.search+R.hash:S=!0}catch{}let b=Xv(y,{relative:c}),N=Pj(y,{replace:m,state:f,target:p,preventScrollReset:g,relative:c,viewTransition:v});function E(j){o&&o(j),j.defaultPrevented||N(j)}return h.createElement("a",Bd({},C,{href:T||b,onClick:S||d?o:E,ref:l,target:p}))});var Mf;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(Mf||(Mf={}));var Af;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(Af||(Af={}));function Pj(r,a){let{target:l,replace:o,state:c,preventScrollReset:d,relative:m,viewTransition:f}=a===void 0?{}:a,p=Da(),y=xn(),g=Ax(r,{relative:m});return h.useCallback(v=>{if(jj(v,l)){v.preventDefault();let C=o!==void 0?o:so(y)===so(g);p(r,{replace:C,state:c,preventScrollReset:d,relative:m,viewTransition:f})}},[y,p,g,o,c,l,r,d,m,f])}function Tj(r){let a=h.useRef(Ud(r)),l=h.useRef(!1),o=xn(),c=h.useMemo(()=>bj(o.search,l.current?null:a.current),[o.search]),d=Da(),m=h.useCallback((f,p)=>{const y=Ud(typeof f=="function"?f(c):f);l.current=!0,d("?"+y,p)},[d,c]);return[c,m]}/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Rj=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ij=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,o)=>o?o.toUpperCase():l.toLowerCase()),Df=r=>{const a=Ij(r);return a.charAt(0).toUpperCase()+a.slice(1)},Fx=(...r)=>r.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).join(" ").trim(),_j=r=>{for(const a in r)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var Mj={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Aj=h.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:d,iconNode:m,...f},p)=>h.createElement("svg",{ref:p,...Mj,width:a,height:a,stroke:r,strokeWidth:o?Number(l)*24/Number(a):l,className:Fx("lucide",c),...!d&&!_j(f)&&{"aria-hidden":"true"},...f},[...m.map(([y,g])=>h.createElement(y,g)),...Array.isArray(d)?d:[d]]));/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ee=(r,a)=>{const l=h.forwardRef(({className:o,...c},d)=>h.createElement(Aj,{ref:d,iconNode:a,className:Fx(`lucide-${Rj(Df(r))}`,`lucide-${r}`,o),...c}));return l.displayName=Df(r),l};/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Dj=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Lj=Ee("arrow-up-down",Dj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Oj=[["path",{d:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",key:"yr8idg"}]],Lf=Ee("bitcoin",Oj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fj=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Ks=Ee("book-open",Fj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zj=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],ro=Ee("calendar",zj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $j=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Bj=Ee("chart-column",$j);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Uj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jo=Ee("check",Uj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ta=Ee("chevron-down",Vj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],tn=Ee("chevron-right",Wj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],pu=Ee("chevron-up",Hj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Kj=[["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"}]],Yj=Ee("circle-alert",Kj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Of=Ee("circle-check-big",Gj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Vd=Ee("circle-check",Qj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],zx=Ee("circle-question-mark",qj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],Nd=Ee("circle-user",Xj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jj=[["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"}]],$x=Ee("circle-x",Jj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zj=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Wd=Ee("clock",Zj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const eb=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Bx=Ee("copy",eb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tb=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Hd=Ee("credit-card",tb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sb=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],kr=Ee("crown",sb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rb=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],no=Ee("dollar-sign",rb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nb=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],ab=Ee("download",nb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lb=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ao=Ee("external-link",lb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ib=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Cr=Ee("eye",ib);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ob=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],cb=Ee("file-text",ob);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const db=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],ub=Ee("funnel",db);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hb=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],mb=Ee("gift",hb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fb=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],xb=Ee("git-merge",fb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pb=[["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"}]],Kd=Ee("globe",pb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gb=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],Ux=Ee("graduation-cap",gb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yb=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Nr=Ee("grip-vertical",yb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vb=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],jb=Ee("handshake",vb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bb=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Nb=Ee("house",bb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wb=[["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"}]],Vx=Ee("image",wb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Sb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ui=Ee("info",Sb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Cb=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Ff=Ee("key",Cb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const kb=[["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"}]],Eb=Ee("layout-dashboard",kb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pb=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],ln=Ee("link-2",Pb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Tb=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],zf=Ee("link",Tb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Rb=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Ib=Ee("list",Rb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _b=[["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"}]],Mb=Ee("lock",_b);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ab=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Db=Ee("log-out",Ab);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Lb=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Wx=Ee("map-pin",Lb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ob=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Fb=Ee("menu",Ob);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zb=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],$b=Ee("message-circle",zb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bb=[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]],wa=Ee("navigation",Bb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ub=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Vb=Ee("palette",Ub);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wb=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],mt=Ee("pen-line",Wb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hb=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],Kb=Ee("percent",Hb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Yb=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Gb=Ee("phone",Yb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Pt=Ee("plus",Qb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qb=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],$f=Ee("qr-code",qb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xb=[["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"}]],$e=Ee("refresh-cw",Xb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jb=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],_t=Ee("save",Jb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zb=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],on=Ee("search",Zb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const eN=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Sa=Ee("settings",eN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tN=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],wd=Ee("settings-2",tN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],gu=Ee("shield-check",sN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rN=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],Yd=Ee("shopping-bag",rN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nN=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],lo=Ee("smartphone",nN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const aN=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Sd=Ee("tag",aN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lN=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Wt=Ee("trash-2",lN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const iN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Ca=Ee("trending-up",iN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oN=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Hx=Ee("undo-2",oN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cN=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],io=Ee("upload",cN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dN=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["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"}]],uN=Ee("user-check",dN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hN=[["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:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Gd=Ee("user-plus",hN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mN=[["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"}]],ka=Ee("user",mN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Qt=Ee("users",fN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xN=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],Ra=Ee("wallet",xN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fs=Ee("x",pN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gN=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],nn=Ee("zap",gN),yu="admin_token";function vu(){try{return localStorage.getItem(yu)}catch{return null}}function yN(r){try{localStorage.setItem(yu,r)}catch{}}function vN(){try{localStorage.removeItem(yu)}catch{}}const jN="https://soulapi.quwanzhi.com",bN=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):jN};function Ia(r){const a=bN(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function bo(r,a={}){const{data:l,...o}=a,c=Ia(r),d=new Headers(o.headers),m=vu();m&&d.set("Authorization",`Bearer ${m}`),l!=null&&!d.has("Content-Type")&&d.set("Content-Type","application/json");const f=l!=null?JSON.stringify(l):o.body,p=await fetch(c,{...o,headers:d,body:f,credentials:"include"}),g=(p.headers.get("Content-Type")||"").includes("application/json")?await p.json():p;if(!p.ok){const v=new Error((g==null?void 0:g.error)||`HTTP ${p.status}`);throw v.status=p.status,v.data=g,v}return g}function Be(r,a){return bo(r,{...a,method:"GET"})}function yt(r,a,l){return bo(r,{...l,method:"POST",data:a})}function gt(r,a,l){return bo(r,{...l,method:"PUT",data:a})}function Er(r,a){return bo(r,{...a,method:"DELETE"})}const NN=[{icon:Eb,label:"数据概览",href:"/dashboard"},{icon:Ks,label:"内容管理",href:"/content"},{icon:Qt,label:"用户管理",href:"/users"}],Bf=[{icon:xb,label:"找伙伴",href:"/find-partner"},{icon:kr,label:"VIP 角色",href:"/vip-roles"},{icon:Ux,label:"导师管理",href:"/mentors"},{icon:Ra,label:"推广中心",href:"/distribution"},{icon:Hd,label:"推广设置",href:"/referral-settings"}];function wN(){const r=xn(),a=Da(),[l,o]=h.useState(!1),[c,d]=h.useState(!1),[m,f]=h.useState(!1);h.useEffect(()=>{o(!0)},[]),h.useEffect(()=>{Bf.some(g=>r.pathname===g.href)&&f(!0)},[r.pathname]),h.useEffect(()=>{if(!l)return;d(!1);let y=!1;return Be("/api/admin").then(g=>{y||(g&&g.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{y||a("/login",{replace:!0})}),()=>{y=!0}},[l,a]);const p=async()=>{vN();try{await yt("/api/admin/logout",{})}catch{}a("/login",{replace:!0})};return!l||!c?e.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[e.jsx("div",{className:"w-64 bg-[#0f2137] border-r border-gray-700/50"}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"text-[#38bdac]",children:"加载中..."})})]}):e.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[e.jsxs("div",{className:"w-64 bg-[#0f2137] flex flex-col border-r border-gray-700/50 shadow-xl",children:[e.jsxs("div",{className:"p-6 border-b border-gray-700/50",children:[e.jsx("h1",{className:"text-xl font-bold text-[#38bdac]",children:"管理后台"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Soul创业派对"})]}),e.jsxs("nav",{className:"flex-1 p-4 space-y-1 overflow-y-auto",children:[NN.map(y=>{const g=r.pathname===y.href;return e.jsxs(Ji,{to:y.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${g?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(y.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:y.label})]},y.href)}),e.jsx("button",{type:"button",onClick:()=>f(!m),className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-gray-400 hover:bg-gray-700/50 hover:text-white rounded-lg transition-colors",children:e.jsxs("span",{className:"flex items-center gap-3",children:[m?e.jsx(pu,{className:"w-5 h-5"}):e.jsx(Ta,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"更多"})]})}),m&&e.jsx("div",{className:"space-y-1 pl-4",children:Bf.map(y=>{const g=r.pathname===y.href;return e.jsxs(Ji,{to:y.href,className:`flex items-center gap-3 px-4 py-2 rounded-lg transition-colors ${g?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(y.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:y.label})]},y.href)})}),e.jsx("div",{className:"pt-4 mt-4 border-t border-gray-700/50",children:e.jsxs(Ji,{to:"/settings",className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${r.pathname==="/settings"?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(Sa,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:"系统设置"})]})})]}),e.jsx("div",{className:"p-4 border-t border-gray-700/50 space-y-1",children:e.jsxs("button",{type:"button",onClick:p,className:"w-full flex items-center gap-3 px-4 py-3 text-gray-400 hover:text-white rounded-lg hover:bg-gray-700/50 transition-colors",children:[e.jsx(Db,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"退出登录"})]})})]}),e.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628] min-w-0",children:e.jsx("div",{className:"w-full min-w-[1024px] min-h-full",children:e.jsx(xj,{})})})]})}function Uf(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function ju(...r){return a=>{let l=!1;const o=r.map(c=>{const d=Uf(c,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let c=0;c{let{children:d,...m}=o;Kx(d)&&typeof oo=="function"&&(d=oo(d._payload));const f=h.Children.toArray(d),p=f.find(PN);if(p){const y=p.props.children,g=f.map(v=>v===p?h.Children.count(y)>1?h.Children.only(null):h.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...m,ref:c,children:h.isValidElement(y)?h.cloneElement(y,void 0,g):null})}return e.jsx(a,{...m,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}var Gx=Yx("Slot");function kN(r){const a=h.forwardRef((l,o)=>{let{children:c,...d}=l;if(Kx(c)&&typeof oo=="function"&&(c=oo(c._payload)),h.isValidElement(c)){const m=RN(c),f=TN(d,c.props);return c.type!==h.Fragment&&(f.ref=o?ju(o,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var EN=Symbol("radix.slottable");function PN(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===EN}function TN(r,a){const l={...a};for(const o in a){const c=r[o],d=a[o];/^on[A-Z]/.test(o)?c&&d?l[o]=(...f)=>{const p=d(...f);return c(...f),p}:c&&(l[o]=c):o==="style"?l[o]={...c,...d}:o==="className"&&(l[o]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function RN(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}function Qx(r){var a,l,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;atypeof r=="boolean"?`${r}`:r===0?"0":r,Wf=qx,Xx=(r,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return Wf(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:d}=a,m=Object.keys(c).map(y=>{const g=l==null?void 0:l[y],v=d==null?void 0:d[y];if(g===null)return null;const C=Vf(g)||Vf(v);return c[y][C]}),f=l&&Object.entries(l).reduce((y,g)=>{let[v,C]=g;return C===void 0||(y[v]=C),y},{}),p=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((y,g)=>{let{class:v,className:C,...P}=g;return Object.entries(P).every(T=>{let[S,b]=T;return Array.isArray(b)?b.includes({...d,...f}[S]):{...d,...f}[S]===b})?[...y,v,C]:y},[]);return Wf(r,m,p,l==null?void 0:l.class,l==null?void 0:l.className)},IN=(r,a)=>{const l=new Array(r.length+a.length);for(let o=0;o({classGroupId:r,validator:a}),Jx=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),co="-",Hf=[],MN="arbitrary..",AN=r=>{const a=LN(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return DN(m);const f=m.split(co),p=f[0]===""&&f.length>1?1:0;return Zx(f,p,a)},getConflictingClassGroupIds:(m,f)=>{if(f){const p=o[m],y=l[m];return p?y?IN(y,p):p:y||Hf}return l[m]||Hf}}},Zx=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],d=l.nextPart.get(c);if(d){const y=Zx(r,a+1,d);if(y)return y}const m=l.validators;if(m===null)return;const f=a===0?r.join(co):r.slice(a).join(co),p=m.length;for(let y=0;yr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?MN+o:void 0})(),LN=r=>{const{theme:a,classGroups:l}=r;return ON(l,a)},ON=(r,a)=>{const l=Jx();for(const o in r){const c=r[o];bu(c,l,o,a)}return l},bu=(r,a,l,o)=>{const c=r.length;for(let d=0;d{if(typeof r=="string"){zN(r,a,l);return}if(typeof r=="function"){$N(r,a,l,o);return}BN(r,a,l,o)},zN=(r,a,l)=>{const o=r===""?a:ep(a,r);o.classGroupId=l},$N=(r,a,l,o)=>{if(UN(r)){bu(r(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(_N(l,r))},BN=(r,a,l,o)=>{const c=Object.entries(r),d=c.length;for(let m=0;m{let l=r;const o=a.split(co),c=o.length;for(let d=0;d"isThemeGetter"in r&&r.isThemeGetter===!0,VN=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(d,m)=>{l[d]=m,a++,a>r&&(a=0,o=l,l=Object.create(null))};return{get(d){let m=l[d];if(m!==void 0)return m;if((m=o[d])!==void 0)return c(d,m),m},set(d,m){d in l?l[d]=m:c(d,m)}}},Qd="!",Kf=":",WN=[],Yf=(r,a,l,o,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),HN=r=>{const{prefix:a,experimentalParseClassName:l}=r;let o=c=>{const d=[];let m=0,f=0,p=0,y;const g=c.length;for(let S=0;Sp?y-p:void 0;return Yf(d,P,C,T)};if(a){const c=a+Kf,d=o;o=m=>m.startsWith(c)?d(m.slice(c.length)):Yf(WN,!1,m,void 0,!0)}if(l){const c=o;o=d=>l({className:d,parseClassName:c})}return o},KN=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,o)=>{a.set(l,1e6+o)}),l=>{const o=[];let c=[];for(let d=0;d0&&(c.sort(),o.push(...c),c=[]),o.push(m)):c.push(m)}return c.length>0&&(c.sort(),o.push(...c)),o}},YN=r=>({cache:VN(r.cacheSize),parseClassName:HN(r),sortModifiers:KN(r),...AN(r)}),GN=/\s+/,QN=(r,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:d}=a,m=[],f=r.trim().split(GN);let p="";for(let y=f.length-1;y>=0;y-=1){const g=f[y],{isExternal:v,modifiers:C,hasImportantModifier:P,baseClassName:T,maybePostfixModifierPosition:S}=l(g);if(v){p=g+(p.length>0?" "+p:p);continue}let b=!!S,N=o(b?T.substring(0,S):T);if(!N){if(!b){p=g+(p.length>0?" "+p:p);continue}if(N=o(T),!N){p=g+(p.length>0?" "+p:p);continue}b=!1}const E=C.length===0?"":C.length===1?C[0]:d(C).join(":"),j=P?E+Qd:E,R=j+N;if(m.indexOf(R)>-1)continue;m.push(R);const W=c(N,b);for(let U=0;U0?" "+p:p)}return p},qN=(...r)=>{let a=0,l,o,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let o=0;o{let l,o,c,d;const m=p=>{const y=a.reduce((g,v)=>v(g),r());return l=YN(y),o=l.cache.get,c=l.cache.set,d=f,f(p)},f=p=>{const y=o(p);if(y)return y;const g=QN(p,l);return c(p,g),g};return d=m,(...p)=>d(qN(...p))},JN=[],$t=r=>{const a=l=>l[r]||JN;return a.isThemeGetter=!0,a},sp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ZN=/^\d+\/\d+$/,ew=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,rw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ga=r=>ZN.test(r),Qe=r=>!!r&&!Number.isNaN(Number(r)),Zr=r=>!!r&&Number.isInteger(Number(r)),Cd=r=>r.endsWith("%")&&Qe(r.slice(0,-1)),wr=r=>ew.test(r),aw=()=>!0,lw=r=>tw.test(r)&&!sw.test(r),np=()=>!1,iw=r=>rw.test(r),ow=r=>nw.test(r),cw=r=>!Me(r)&&!Ae(r),dw=r=>La(r,ip,np),Me=r=>sp.test(r),Ln=r=>La(r,op,lw),kd=r=>La(r,xw,Qe),Gf=r=>La(r,ap,np),uw=r=>La(r,lp,ow),Vi=r=>La(r,cp,iw),Ae=r=>rp.test(r),wl=r=>Oa(r,op),hw=r=>Oa(r,pw),Qf=r=>Oa(r,ap),mw=r=>Oa(r,ip),fw=r=>Oa(r,lp),Wi=r=>Oa(r,cp,!0),La=(r,a,l)=>{const o=sp.exec(r);return o?o[1]?a(o[1]):l(o[2]):!1},Oa=(r,a,l=!1)=>{const o=rp.exec(r);return o?o[1]?a(o[1]):l:!1},ap=r=>r==="position"||r==="percentage",lp=r=>r==="image"||r==="url",ip=r=>r==="length"||r==="size"||r==="bg-size",op=r=>r==="length",xw=r=>r==="number",pw=r=>r==="family-name",cp=r=>r==="shadow",gw=()=>{const r=$t("color"),a=$t("font"),l=$t("text"),o=$t("font-weight"),c=$t("tracking"),d=$t("leading"),m=$t("breakpoint"),f=$t("container"),p=$t("spacing"),y=$t("radius"),g=$t("shadow"),v=$t("inset-shadow"),C=$t("text-shadow"),P=$t("drop-shadow"),T=$t("blur"),S=$t("perspective"),b=$t("aspect"),N=$t("ease"),E=$t("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],W=()=>[...R(),Ae,Me],U=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],A=()=>[Ae,Me,p],I=()=>[ga,"full","auto",...A()],re=()=>[Zr,"none","subgrid",Ae,Me],ie=()=>["auto",{span:["full",Zr,Ae,Me]},Zr,Ae,Me],oe=()=>[Zr,"auto",Ae,Me],te=()=>["auto","min","max","fr",Ae,Me],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],ne=()=>["auto",...A()],ve=()=>[ga,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[r,Ae,Me],ce=()=>[...R(),Qf,Gf,{position:[Ae,Me]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",mw,dw,{size:[Ae,Me]}],O=()=>[Cd,wl,Ln],L=()=>["","none","full",y,Ae,Me],X=()=>["",Qe,wl,Ln],K=()=>["solid","dashed","dotted","double"],de=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>[Qe,Cd,Qf,Gf],xe=()=>["","none",T,Ae,Me],we=()=>["none",Qe,Ae,Me],D=()=>["none",Qe,Ae,Me],ue=()=>[Qe,Ae,Me],Se=()=>[ga,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[wr],breakpoint:[wr],color:[aw],container:[wr],"drop-shadow":[wr],ease:["in","out","in-out"],font:[cw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[wr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[wr],shadow:[wr],spacing:["px",Qe],text:[wr],"text-shadow":[wr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ga,Me,Ae,b]}],container:["container"],columns:[{columns:[Qe,Me,Ae,f]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:W()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Zr,"auto",Ae,Me]}],basis:[{basis:[ga,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,ga,"auto","initial","none",Me]}],grow:[{grow:["",Qe,Ae,Me]}],shrink:[{shrink:["",Qe,Ae,Me]}],order:[{order:[Zr,"first","last","none",Ae,Me]}],"grid-cols":[{"grid-cols":re()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":re()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:ne()}],mx:[{mx:ne()}],my:[{my:ne()}],ms:[{ms:ne()}],me:[{me:ne()}],mt:[{mt:ne()}],mr:[{mr:ne()}],mb:[{mb:ne()}],ml:[{ml:ne()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:ve()}],w:[{w:[f,"screen",...ve()]}],"min-w":[{"min-w":[f,"screen","none",...ve()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[m]},...ve()]}],h:[{h:["screen","lh",...ve()]}],"min-h":[{"min-h":["screen","lh","none",...ve()]}],"max-h":[{"max-h":["screen","lh",...ve()]}],"font-size":[{text:["base",l,wl,Ln]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ae,kd]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cd,Me]}],"font-family":[{font:[hw,Me,a]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,Ae,Me]}],"line-clamp":[{"line-clamp":[Qe,"none",Ae,kd]}],leading:[{leading:[d,...A()]}],"list-image":[{"list-image":["none",Ae,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",Ae,Ln]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Qe,"auto",Ae,Me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zr,Ae,Me],radial:["",Ae,Me],conic:[Zr,Ae,Me]},fw,uw]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,Ae,Me]}],"outline-w":[{outline:["",Qe,wl,Ln]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",g,Wi,Vi]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",v,Wi,Vi]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Qe,Ln]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",C,Wi,Vi]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Qe,Ae,Me]}],"mix-blend":[{"mix-blend":[...de(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":de()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":G()}],"mask-image-linear-to-pos":[{"mask-linear-to":G()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":G()}],"mask-image-t-to-pos":[{"mask-t-to":G()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":G()}],"mask-image-r-to-pos":[{"mask-r-to":G()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":G()}],"mask-image-b-to-pos":[{"mask-b-to":G()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":G()}],"mask-image-l-to-pos":[{"mask-l-to":G()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":G()}],"mask-image-x-to-pos":[{"mask-x-to":G()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":G()}],"mask-image-y-to-pos":[{"mask-y-to":G()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Ae,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":G()}],"mask-image-radial-to-pos":[{"mask-radial-to":G()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":G()}],"mask-image-conic-to-pos":[{"mask-conic-to":G()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,Me]}],filter:[{filter:["","none",Ae,Me]}],blur:[{blur:xe()}],brightness:[{brightness:[Qe,Ae,Me]}],contrast:[{contrast:[Qe,Ae,Me]}],"drop-shadow":[{"drop-shadow":["","none",P,Wi,Vi]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Qe,Ae,Me]}],"hue-rotate":[{"hue-rotate":[Qe,Ae,Me]}],invert:[{invert:["",Qe,Ae,Me]}],saturate:[{saturate:[Qe,Ae,Me]}],sepia:[{sepia:["",Qe,Ae,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,Me]}],"backdrop-blur":[{"backdrop-blur":xe()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,Ae,Me]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,Ae,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,Ae,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,Ae,Me]}],"backdrop-invert":[{"backdrop-invert":["",Qe,Ae,Me]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,Ae,Me]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,Ae,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,Ae,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",Ae,Me]}],ease:[{ease:["linear","initial",N,Ae,Me]}],delay:[{delay:[Qe,Ae,Me]}],animate:[{animate:["none",E,Ae,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ae,Me]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[Ae,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae,Me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae,Me]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Qe,wl,Ln,kd]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},yw=XN(gw);function it(...r){return yw(qx(r))}const vw=Xx("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function q({className:r,variant:a,size:l,asChild:o=!1,...c}){const d=o?Gx:"button";return e.jsx(d,{"data-slot":"button",className:it(vw({variant:a,size:l,className:r})),...c})}function le({className:r,type:a,...l}){return e.jsx("input",{type:a,"data-slot":"input",className:it("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none placeholder:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 md:text-sm focus-visible:ring-2 focus-visible:ring-ring",r),...l})}function jw(){const r=Da(),[a,l]=h.useState(""),[o,c]=h.useState(""),[d,m]=h.useState(""),[f,p]=h.useState(!1),y=async()=>{m(""),p(!0);try{const g=await yt("/api/admin",{username:a.trim(),password:o});if((g==null?void 0:g.success)!==!1&&(g!=null&&g.token)){yN(g.token),r("/dashboard",{replace:!0});return}m(g.error||"用户名或密码错误")}catch(g){const v=g;m(v.status===401?"用户名或密码错误":(v==null?void 0:v.message)||"网络错误,请重试")}finally{p(!1)}};return e.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"w-full max-w-md relative z-10",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 bg-[#38bdac]/20 rounded-2xl flex items-center justify-center mx-auto mb-4 border border-[#38bdac]/30",children:e.jsx(gu,{className:"w-8 h-8 text-[#38bdac]"})}),e.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),e.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),e.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[e.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),e.jsxs("div",{className:"relative",children:[e.jsx(ka,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(le,{type:"text",value:a,onChange:g=>l(g.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),e.jsxs("div",{className:"relative",children:[e.jsx(Mb,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(le,{type:"password",value:o,onChange:g=>c(g.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:g=>g.key==="Enter"&&y()})]})]}),d&&e.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:d}),e.jsx(q,{onClick:y,disabled:f,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:f?"登录中...":"登录"})]})]}),e.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const Ce=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:it("rounded-xl border bg-card text-card-foreground shadow",r),...a}));Ce.displayName="Card";const Ke=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:it("flex flex-col space-y-1.5 p-6",r),...a}));Ke.displayName="CardHeader";const Ye=h.forwardRef(({className:r,...a},l)=>e.jsx("h3",{ref:l,className:it("font-semibold leading-none tracking-tight",r),...a}));Ye.displayName="CardTitle";const bt=h.forwardRef(({className:r,...a},l)=>e.jsx("p",{ref:l,className:it("text-sm text-muted-foreground",r),...a}));bt.displayName="CardDescription";const ke=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:it("p-6 pt-0",r),...a}));ke.displayName="CardContent";const bw=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:it("flex items-center p-6 pt-0",r),...a}));bw.displayName="CardFooter";function Nw(){const r=Da(),[a,l]=h.useState(!0),[o,c]=h.useState([]),[d,m]=h.useState([]),[f,p]=h.useState(0),[y,g]=h.useState(0),[v,C]=h.useState(0),[P,T]=h.useState(0),[S,b]=h.useState(null);async function N(){var W;l(!0),b(null);try{const U=await Be("/api/admin/dashboard/overview");if(U!=null&&U.success){p(U.totalUsers??0),g(U.paidOrderCount??0),C(U.totalRevenue??0),T(U.conversionRate??0),m(U.recentOrders??[]),c(U.newUsers??[]);return}}catch(U){console.error("数据概览接口失败,尝试降级拉取",U)}try{const[U,k]=await Promise.all([Be("/api/db/users?page=1&pageSize=10"),Be("/api/orders?page=1&pageSize=20&status=paid")]),A=typeof(U==null?void 0:U.total)=="number"?U.total:((W=U==null?void 0:U.users)==null?void 0:W.length)??0,I=(k==null?void 0:k.orders)??[],re=typeof(k==null?void 0:k.total)=="number"?k.total:I.length,ie=I.filter(Y=>Y.status==="paid"||Y.status==="completed"||Y.status==="success"),oe=ie.reduce((Y,ne)=>Y+Number(ne.amount||0),0),te=new Set(ie.map(Y=>Y.userId).filter(Boolean)),J=A>0&&te.size>0?te.size/A*100:0;p(A),g(re),C(oe),T(J),m(I.slice(0,5)),c((U==null?void 0:U.users)??[])}catch(U){console.error("降级拉取失败",U);const k=U;(k==null?void 0:k.status)===401?b("登录已过期,请重新登录"):b("加载失败,请检查网络或联系管理员")}finally{l(!1)}}if(h.useEffect(()=>{N();const W=setInterval(N,3e4);return()=>clearInterval(W)},[]),a)return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-24",children:[e.jsx($e,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),e.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const E=f,j=W=>{const U=W.productType||"",k=W.description||"";if(k){if(U==="section"&&k.includes("章节")){if(k.includes("-")){const A=k.split("-");if(A.length>=3)return{title:`第${A[1]}章 第${A[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:k,subtitle:"章节购买"}}return U==="fullbook"||k.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"||k.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:k,subtitle:U==="section"?"单章":U==="fullbook"?"全书":"其他"}}return U==="section"?{title:`章节 ${W.productId||""}`,subtitle:"单章购买"}:U==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:U||"其他"}},R=[{title:"总用户数",value:E,icon:Qt,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${(v??0).toFixed(2)}`,icon:Ca,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:Yd,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${typeof P=="number"?P.toFixed(1):0}%`,icon:Ks,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"}];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),S&&e.jsxs("div",{className:"mb-6 px-4 py-3 rounded-lg bg-amber-500/20 border border-amber-500/50 text-amber-200 text-sm flex items-center justify-between",children:[e.jsx("span",{children:S}),e.jsx("button",{type:"button",onClick:()=>N(),className:"text-amber-400 hover:text-amber-300 underline",children:"重试"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:R.map((W,U)=>e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>W.link&&r(W.link),children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(Ye,{className:"text-sm font-medium text-gray-400",children:W.title}),e.jsx("div",{className:`p-2 rounded-lg ${W.bg}`,children:e.jsx(W.icon,{className:`w-4 h-4 ${W.color}`})})]}),e.jsx(ke,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-2xl font-bold text-white",children:W.value}),e.jsx(tn,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},U))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between",children:[e.jsx(Ye,{className:"text-white",children:"最近订单"}),e.jsxs("button",{type:"button",onClick:()=>N(),className:"text-xs text-gray-400 hover:text-[#38bdac] flex items-center gap-1",title:"刷新",children:[e.jsx($e,{className:"w-3.5 h-3.5"}),"刷新(每 30 秒自动更新)"]})]}),e.jsx(ke,{children:e.jsxs("div",{className:"space-y-3",children:[d.slice(0,5).map(W=>{var re;const U=W.referrerId?o.find(ie=>ie.id===W.referrerId):void 0,k=W.referralCode||(U==null?void 0:U.referralCode)||(U==null?void 0:U.nickname)||(W.referrerId?String(W.referrerId).slice(0,8):""),A=j(W),I=W.userNickname||((re=o.find(ie=>ie.id===W.userId))==null?void 0:re.nickname)||"匿名用户";return e.jsxs("div",{className:"flex items-start justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30 hover:border-[#38bdac]/30 transition-colors",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[W.userAvatar?e.jsx("img",{src:W.userAvatar,alt:I,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:ie=>{ie.currentTarget.style.display="none";const oe=ie.currentTarget.nextElementSibling;oe&&oe.classList.remove("hidden")}}):null,e.jsx("div",{className:`w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 mt-0.5 ${W.userAvatar?"hidden":""}`,children:I.charAt(0)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm text-gray-300",children:I}),e.jsx("span",{className:"text-gray-600",children:"·"}),e.jsx("span",{className:"text-sm font-medium text-white truncate",children:A.title})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[e.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700/50 rounded",children:A.subtitle}),e.jsx("span",{children:new Date(W.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),k&&e.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",k]})]})]}),e.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[e.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(W.amount).toFixed(2)]}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:W.paymentMethod||"微信"})]})]},W.id)}),d.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Yd,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"新注册用户"})}),e.jsx(ke,{children:e.jsxs("div",{className:"space-y-3",children:[o.slice(0,5).map(W=>{var U;return e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((U=W.nickname)==null?void 0:U.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-white",children:W.nickname||"匿名用户"}),e.jsx("p",{className:"text-xs text-gray-500",children:W.phone||"-"})]})]}),e.jsx("p",{className:"text-xs text-gray-400",children:W.createdAt?new Date(W.createdAt).toLocaleDateString():"-"})]},W.id)}),o.length===0&&e.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const xs=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:l,className:it("w-full caption-bottom text-sm",r),...a})}));xs.displayName="Table";const ps=h.forwardRef(({className:r,...a},l)=>e.jsx("thead",{ref:l,className:it("[&_tr]:border-b",r),...a}));ps.displayName="TableHeader";const gs=h.forwardRef(({className:r,...a},l)=>e.jsx("tbody",{ref:l,className:it("[&_tr:last-child]:border-0",r),...a}));gs.displayName="TableBody";const Je=h.forwardRef(({className:r,...a},l)=>e.jsx("tr",{ref:l,className:it("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));Je.displayName="TableRow";const be=h.forwardRef(({className:r,...a},l)=>e.jsx("th",{ref:l,className:it("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));be.displayName="TableHead";const ye=h.forwardRef(({className:r,...a},l)=>e.jsx("td",{ref:l,className:it("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));ye.displayName="TableCell";const ww=Xx("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Oe({className:r,variant:a,asChild:l=!1,...o}){const c=l?Gx:"span";return e.jsx(c,{className:it(ww({variant:a}),r),...o})}function He(r,a,{checkForDefaultPrevented:l=!0}={}){return function(c){if(r==null||r(c),l===!1||!c.defaultPrevented)return a==null?void 0:a(c)}}function Sw(r,a){const l=h.createContext(a),o=d=>{const{children:m,...f}=d,p=h.useMemo(()=>f,Object.values(f));return e.jsx(l.Provider,{value:p,children:m})};o.displayName=r+"Provider";function c(d){const m=h.useContext(l);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${r}\``)}return[o,c]}function pn(r,a=[]){let l=[];function o(d,m){const f=h.createContext(m),p=l.length;l=[...l,m];const y=v=>{var N;const{scope:C,children:P,...T}=v,S=((N=C==null?void 0:C[r])==null?void 0:N[p])||f,b=h.useMemo(()=>T,Object.values(T));return e.jsx(S.Provider,{value:b,children:P})};y.displayName=d+"Provider";function g(v,C){var S;const P=((S=C==null?void 0:C[r])==null?void 0:S[p])||f,T=h.useContext(P);if(T)return T;if(m!==void 0)return m;throw new Error(`\`${v}\` must be used within \`${d}\``)}return[y,g]}const c=()=>{const d=l.map(m=>h.createContext(m));return function(f){const p=(f==null?void 0:f[r])||d;return h.useMemo(()=>({[`__scope${r}`]:{...f,[r]:p}}),[f,p])}};return c.scopeName=r,[o,Cw(c,...a)]}function Cw(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const o=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const m=o.reduce((f,{useScope:p,scopeName:y})=>{const v=p(d)[`__scope${y}`];return{...f,...v}},{});return h.useMemo(()=>({[`__scope${a.scopeName}`]:m}),[m])}};return l.scopeName=a.scopeName,l}var ts=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},kw=yo[" useId ".trim().toString()]||(()=>{}),Ew=0;function cn(r){const[a,l]=h.useState(kw());return ts(()=>{l(o=>o??String(Ew++))},[r]),a?`radix-${a}`:""}var Pw=yo[" useInsertionEffect ".trim().toString()]||ts;function On({prop:r,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,d,m]=Tw({defaultProp:a,onChange:l}),f=r!==void 0,p=f?r:c;{const g=h.useRef(r!==void 0);h.useEffect(()=>{const v=g.current;v!==f&&console.warn(`${o} is changing from ${v?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=f},[f,o])}const y=h.useCallback(g=>{var v;if(f){const C=Rw(g)?g(r):g;C!==r&&((v=m.current)==null||v.call(m,C))}else d(g)},[f,r,d,m]);return[p,y]}function Tw({defaultProp:r,onChange:a}){const[l,o]=h.useState(r),c=h.useRef(l),d=h.useRef(a);return Pw(()=>{d.current=a},[a]),h.useEffect(()=>{var m;c.current!==l&&((m=d.current)==null||m.call(d,l),c.current=l)},[l,c]),[l,o,d]}function Rw(r){return typeof r=="function"}function Tl(r){const a=Iw(r),l=h.forwardRef((o,c)=>{const{children:d,...m}=o,f=h.Children.toArray(d),p=f.find(Mw);if(p){const y=p.props.children,g=f.map(v=>v===p?h.Children.count(y)>1?h.Children.only(null):h.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...m,ref:c,children:h.isValidElement(y)?h.cloneElement(y,void 0,g):null})}return e.jsx(a,{...m,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}function Iw(r){const a=h.forwardRef((l,o)=>{const{children:c,...d}=l;if(h.isValidElement(c)){const m=Dw(c),f=Aw(d,c.props);return c.type!==h.Fragment&&(f.ref=o?ju(o,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var _w=Symbol("radix.slottable");function Mw(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===_w}function Aw(r,a){const l={...a};for(const o in a){const c=r[o],d=a[o];/^on[A-Z]/.test(o)?c&&d?l[o]=(...f)=>{const p=d(...f);return c(...f),p}:c&&(l[o]=c):o==="style"?l[o]={...c,...d}:o==="className"&&(l[o]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function Dw(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Lw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=Lw.reduce((r,a)=>{const l=Tl(`Primitive.${a}`),o=h.forwardRef((c,d)=>{const{asChild:m,...f}=c,p=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...f,ref:d})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{});function Ow(r,a){r&&Il.flushSync(()=>r.dispatchEvent(a))}function un(r){const a=h.useRef(r);return h.useEffect(()=>{a.current=r}),h.useMemo(()=>(...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function Fw(r,a=globalThis==null?void 0:globalThis.document){const l=un(r);h.useEffect(()=>{const o=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",o,{capture:!0}),()=>a.removeEventListener("keydown",o,{capture:!0})},[l,a])}var zw="DismissableLayer",qd="dismissableLayer.update",$w="dismissableLayer.pointerDownOutside",Bw="dismissableLayer.focusOutside",qf,dp=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Nu=h.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:m,onDismiss:f,...p}=r,y=h.useContext(dp),[g,v]=h.useState(null),C=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=h.useState({}),T=lt(a,k=>v(k)),S=Array.from(y.layers),[b]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),N=S.indexOf(b),E=g?S.indexOf(g):-1,j=y.layersWithOutsidePointerEventsDisabled.size>0,R=E>=N,W=Ww(k=>{const A=k.target,I=[...y.branches].some(re=>re.contains(A));!R||I||(c==null||c(k),m==null||m(k),k.defaultPrevented||f==null||f())},C),U=Hw(k=>{const A=k.target;[...y.branches].some(re=>re.contains(A))||(d==null||d(k),m==null||m(k),k.defaultPrevented||f==null||f())},C);return Fw(k=>{E===y.layers.size-1&&(o==null||o(k),!k.defaultPrevented&&f&&(k.preventDefault(),f()))},C),h.useEffect(()=>{if(g)return l&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(qf=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(g)),y.layers.add(g),Xf(),()=>{l&&y.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=qf)}},[g,C,l,y]),h.useEffect(()=>()=>{g&&(y.layers.delete(g),y.layersWithOutsidePointerEventsDisabled.delete(g),Xf())},[g,y]),h.useEffect(()=>{const k=()=>P({});return document.addEventListener(qd,k),()=>document.removeEventListener(qd,k)},[]),e.jsx(qe.div,{...p,ref:T,style:{pointerEvents:j?R?"auto":"none":void 0,...r.style},onFocusCapture:He(r.onFocusCapture,U.onFocusCapture),onBlurCapture:He(r.onBlurCapture,U.onBlurCapture),onPointerDownCapture:He(r.onPointerDownCapture,W.onPointerDownCapture)})});Nu.displayName=zw;var Uw="DismissableLayerBranch",Vw=h.forwardRef((r,a)=>{const l=h.useContext(dp),o=h.useRef(null),c=lt(a,o);return h.useEffect(()=>{const d=o.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),e.jsx(qe.div,{...r,ref:c})});Vw.displayName=Uw;function Ww(r,a=globalThis==null?void 0:globalThis.document){const l=un(r),o=h.useRef(!1),c=h.useRef(()=>{});return h.useEffect(()=>{const d=f=>{if(f.target&&!o.current){let p=function(){up($w,l,y,{discrete:!0})};const y={originalEvent:f};f.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=p,a.addEventListener("click",c.current,{once:!0})):p()}else a.removeEventListener("click",c.current);o.current=!1},m=window.setTimeout(()=>{a.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(m),a.removeEventListener("pointerdown",d),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>o.current=!0}}function Hw(r,a=globalThis==null?void 0:globalThis.document){const l=un(r),o=h.useRef(!1);return h.useEffect(()=>{const c=d=>{d.target&&!o.current&&up(Bw,l,{originalEvent:d},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Xf(){const r=new CustomEvent(qd);document.dispatchEvent(r)}function up(r,a,l,{discrete:o}){const c=l.originalEvent.target,d=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),o?Ow(c,d):c.dispatchEvent(d)}var Ed="focusScope.autoFocusOnMount",Pd="focusScope.autoFocusOnUnmount",Jf={bubbles:!1,cancelable:!0},Kw="FocusScope",wu=h.forwardRef((r,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...m}=r,[f,p]=h.useState(null),y=un(c),g=un(d),v=h.useRef(null),C=lt(a,S=>p(S)),P=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let S=function(j){if(P.paused||!f)return;const R=j.target;f.contains(R)?v.current=R:sn(v.current,{select:!0})},b=function(j){if(P.paused||!f)return;const R=j.relatedTarget;R!==null&&(f.contains(R)||sn(v.current,{select:!0}))},N=function(j){if(document.activeElement===document.body)for(const W of j)W.removedNodes.length>0&&sn(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",b);const E=new MutationObserver(N);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",b),E.disconnect()}}},[o,f,P.paused]),h.useEffect(()=>{if(f){ex.add(P);const S=document.activeElement;if(!f.contains(S)){const N=new CustomEvent(Ed,Jf);f.addEventListener(Ed,y),f.dispatchEvent(N),N.defaultPrevented||(Yw(Jw(hp(f)),{select:!0}),document.activeElement===S&&sn(f))}return()=>{f.removeEventListener(Ed,y),setTimeout(()=>{const N=new CustomEvent(Pd,Jf);f.addEventListener(Pd,g),f.dispatchEvent(N),N.defaultPrevented||sn(S??document.body,{select:!0}),f.removeEventListener(Pd,g),ex.remove(P)},0)}}},[f,y,g,P]);const T=h.useCallback(S=>{if(!l&&!o||P.paused)return;const b=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,N=document.activeElement;if(b&&N){const E=S.currentTarget,[j,R]=Gw(E);j&&R?!S.shiftKey&&N===R?(S.preventDefault(),l&&sn(j,{select:!0})):S.shiftKey&&N===j&&(S.preventDefault(),l&&sn(R,{select:!0})):N===E&&S.preventDefault()}},[l,o,P.paused]);return e.jsx(qe.div,{tabIndex:-1,...m,ref:C,onKeyDown:T})});wu.displayName=Kw;function Yw(r,{select:a=!1}={}){const l=document.activeElement;for(const o of r)if(sn(o,{select:a}),document.activeElement!==l)return}function Gw(r){const a=hp(r),l=Zf(a,r),o=Zf(a.reverse(),r);return[l,o]}function hp(r){const a=[],l=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function Zf(r,a){for(const l of r)if(!Qw(l,{upTo:a}))return l}function Qw(r,{upTo:a}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(a!==void 0&&r===a)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function qw(r){return r instanceof HTMLInputElement&&"select"in r}function sn(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&qw(r)&&a&&r.select()}}var ex=Xw();function Xw(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=tx(r,a),r.unshift(a)},remove(a){var l;r=tx(r,a),(l=r[0])==null||l.resume()}}}function tx(r,a){const l=[...r],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function Jw(r){return r.filter(a=>a.tagName!=="A")}var Zw="Portal",Su=h.forwardRef((r,a)=>{var f;const{container:l,...o}=r,[c,d]=h.useState(!1);ts(()=>d(!0),[]);const m=l||c&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return m?Nv.createPortal(e.jsx(qe.div,{...o,ref:a}),m):null});Su.displayName=Zw;function e1(r,a){return h.useReducer((l,o)=>a[l][o]??l,r)}var _l=r=>{const{present:a,children:l}=r,o=t1(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),d=lt(o.ref,s1(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:d}):null};_l.displayName="Presence";function t1(r){const[a,l]=h.useState(),o=h.useRef(null),c=h.useRef(r),d=h.useRef("none"),m=r?"mounted":"unmounted",[f,p]=e1(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const y=Hi(o.current);d.current=f==="mounted"?y:"none"},[f]),ts(()=>{const y=o.current,g=c.current;if(g!==r){const C=d.current,P=Hi(y);r?p("MOUNT"):P==="none"||(y==null?void 0:y.display)==="none"?p("UNMOUNT"):p(g&&C!==P?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,p]),ts(()=>{if(a){let y;const g=a.ownerDocument.defaultView??window,v=P=>{const S=Hi(o.current).includes(CSS.escape(P.animationName));if(P.target===a&&S&&(p("ANIMATION_END"),!c.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",y=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},C=P=>{P.target===a&&(d.current=Hi(o.current))};return a.addEventListener("animationstart",C),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{g.clearTimeout(y),a.removeEventListener("animationstart",C),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:h.useCallback(y=>{o.current=y?getComputedStyle(y):null,l(y)},[])}}function Hi(r){return(r==null?void 0:r.animationName)||"none"}function s1(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Td=0;function mp(){h.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??sx()),document.body.insertAdjacentElement("beforeend",r[1]??sx()),Td++,()=>{Td===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Td--}},[])}function sx(){const r=document.createElement("span");return r.setAttribute("data-radix-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}var ar=function(){return ar=Object.assign||function(a){for(var l,o=1,c=arguments.length;o"u")return v1;var a=j1(r),l=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-l+a[2]-a[0])}},N1=gp(),Ea="data-scroll-locked",w1=function(r,a,l,o){var c=r.left,d=r.top,m=r.right,f=r.gap;return l===void 0&&(l="margin"),` - .`.concat(n1,` { - overflow: hidden `).concat(o,`; - padding-right: `).concat(f,"px ").concat(o,`; - } - body[`).concat(Ea,`] { - overflow: hidden `).concat(o,`; - overscroll-behavior: contain; - `).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&` - padding-left: `.concat(c,`px; - padding-top: `).concat(d,`px; - padding-right: `).concat(m,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(f,"px ").concat(o,`; - `),l==="padding"&&"padding-right: ".concat(f,"px ").concat(o,";")].filter(Boolean).join(""),` - } - - .`).concat(Zi,` { - right: `).concat(f,"px ").concat(o,`; - } - - .`).concat(eo,` { - margin-right: `).concat(f,"px ").concat(o,`; - } - - .`).concat(Zi," .").concat(Zi,` { - right: 0 `).concat(o,`; - } - - .`).concat(eo," .").concat(eo,` { - margin-right: 0 `).concat(o,`; - } - - body[`).concat(Ea,`] { - `).concat(a1,": ").concat(f,`px; - } -`)},nx=function(){var r=parseInt(document.body.getAttribute(Ea)||"0",10);return isFinite(r)?r:0},S1=function(){h.useEffect(function(){return document.body.setAttribute(Ea,(nx()+1).toString()),function(){var r=nx()-1;r<=0?document.body.removeAttribute(Ea):document.body.setAttribute(Ea,r.toString())}},[])},C1=function(r){var a=r.noRelative,l=r.noImportant,o=r.gapMode,c=o===void 0?"margin":o;S1();var d=h.useMemo(function(){return b1(c)},[c]);return h.createElement(N1,{styles:w1(d,!a,c,l?"":"!important")})},Xd=!1;if(typeof window<"u")try{var Ki=Object.defineProperty({},"passive",{get:function(){return Xd=!0,!0}});window.addEventListener("test",Ki,Ki),window.removeEventListener("test",Ki,Ki)}catch{Xd=!1}var ya=Xd?{passive:!1}:!1,k1=function(r){return r.tagName==="TEXTAREA"},yp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!k1(r)&&l[a]==="visible")},E1=function(r){return yp(r,"overflowY")},P1=function(r){return yp(r,"overflowX")},ax=function(r,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=vp(r,o);if(c){var d=jp(r,o),m=d[1],f=d[2];if(m>f)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},T1=function(r){var a=r.scrollTop,l=r.scrollHeight,o=r.clientHeight;return[a,l,o]},R1=function(r){var a=r.scrollLeft,l=r.scrollWidth,o=r.clientWidth;return[a,l,o]},vp=function(r,a){return r==="v"?E1(a):P1(a)},jp=function(r,a){return r==="v"?T1(a):R1(a)},I1=function(r,a){return r==="h"&&a==="rtl"?-1:1},_1=function(r,a,l,o,c){var d=I1(r,window.getComputedStyle(a).direction),m=d*o,f=l.target,p=a.contains(f),y=!1,g=m>0,v=0,C=0;do{if(!f)break;var P=jp(r,f),T=P[0],S=P[1],b=P[2],N=S-b-d*T;(T||N)&&vp(r,f)&&(v+=N,C+=T);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&f!==document.body||p&&(a.contains(f)||a===f));return(g&&Math.abs(v)<1||!g&&Math.abs(C)<1)&&(y=!0),y},Yi=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},lx=function(r){return[r.deltaX,r.deltaY]},ix=function(r){return r&&"current"in r?r.current:r},M1=function(r,a){return r[0]===a[0]&&r[1]===a[1]},A1=function(r){return` - .block-interactivity-`.concat(r,` {pointer-events: none;} - .allow-interactivity-`).concat(r,` {pointer-events: all;} -`)},D1=0,va=[];function L1(r){var a=h.useRef([]),l=h.useRef([0,0]),o=h.useRef(),c=h.useState(D1++)[0],d=h.useState(gp)[0],m=h.useRef(r);h.useEffect(function(){m.current=r},[r]),h.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var S=r1([r.lockRef.current],(r.shards||[]).map(ix),!0).filter(Boolean);return S.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var f=h.useCallback(function(S,b){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!m.current.allowPinchZoom;var N=Yi(S),E=l.current,j="deltaX"in S?S.deltaX:E[0]-N[0],R="deltaY"in S?S.deltaY:E[1]-N[1],W,U=S.target,k=Math.abs(j)>Math.abs(R)?"h":"v";if("touches"in S&&k==="h"&&U.type==="range")return!1;var A=window.getSelection(),I=A&&A.anchorNode,re=I?I===U||I.contains(U):!1;if(re)return!1;var ie=ax(k,U);if(!ie)return!0;if(ie?W=k:(W=k==="v"?"h":"v",ie=ax(k,U)),!ie)return!1;if(!o.current&&"changedTouches"in S&&(j||R)&&(o.current=W),!W)return!0;var oe=o.current||W;return _1(oe,b,S,oe==="h"?j:R)},[]),p=h.useCallback(function(S){var b=S;if(!(!va.length||va[va.length-1]!==d)){var N="deltaY"in b?lx(b):Yi(b),E=a.current.filter(function(W){return W.name===b.type&&(W.target===b.target||b.target===W.shadowParent)&&M1(W.delta,N)})[0];if(E&&E.should){b.cancelable&&b.preventDefault();return}if(!E){var j=(m.current.shards||[]).map(ix).filter(Boolean).filter(function(W){return W.contains(b.target)}),R=j.length>0?f(b,j[0]):!m.current.noIsolation;R&&b.cancelable&&b.preventDefault()}}},[]),y=h.useCallback(function(S,b,N,E){var j={name:S,delta:b,target:N,should:E,shadowParent:O1(N)};a.current.push(j),setTimeout(function(){a.current=a.current.filter(function(R){return R!==j})},1)},[]),g=h.useCallback(function(S){l.current=Yi(S),o.current=void 0},[]),v=h.useCallback(function(S){y(S.type,lx(S),S.target,f(S,r.lockRef.current))},[]),C=h.useCallback(function(S){y(S.type,Yi(S),S.target,f(S,r.lockRef.current))},[]);h.useEffect(function(){return va.push(d),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:C}),document.addEventListener("wheel",p,ya),document.addEventListener("touchmove",p,ya),document.addEventListener("touchstart",g,ya),function(){va=va.filter(function(S){return S!==d}),document.removeEventListener("wheel",p,ya),document.removeEventListener("touchmove",p,ya),document.removeEventListener("touchstart",g,ya)}},[]);var P=r.removeScrollBar,T=r.inert;return h.createElement(h.Fragment,null,T?h.createElement(d,{styles:A1(c)}):null,P?h.createElement(C1,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function O1(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const F1=h1(pp,L1);var Cu=h.forwardRef(function(r,a){return h.createElement(No,ar({},r,{ref:a,sideCar:F1}))});Cu.classNames=No.classNames;var z1=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},ja=new WeakMap,Gi=new WeakMap,Qi={},Md=0,bp=function(r){return r&&(r.host||bp(r.parentNode))},$1=function(r,a){return a.map(function(l){if(r.contains(l))return l;var o=bp(l);return o&&r.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},B1=function(r,a,l,o){var c=$1(a,Array.isArray(r)?r:[r]);Qi[l]||(Qi[l]=new WeakMap);var d=Qi[l],m=[],f=new Set,p=new Set(c),y=function(v){!v||f.has(v)||(f.add(v),y(v.parentNode))};c.forEach(y);var g=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(C){if(f.has(C))g(C);else try{var P=C.getAttribute(o),T=P!==null&&P!=="false",S=(ja.get(C)||0)+1,b=(d.get(C)||0)+1;ja.set(C,S),d.set(C,b),m.push(C),S===1&&T&&Gi.set(C,!0),b===1&&C.setAttribute(l,"true"),T||C.setAttribute(o,"true")}catch(N){console.error("aria-hidden: cannot operate on ",C,N)}})};return g(a),f.clear(),Md++,function(){m.forEach(function(v){var C=ja.get(v)-1,P=d.get(v)-1;ja.set(v,C),d.set(v,P),C||(Gi.has(v)||v.removeAttribute(o),Gi.delete(v)),P||v.removeAttribute(l)}),Md--,Md||(ja=new WeakMap,ja=new WeakMap,Gi=new WeakMap,Qi={})}},Np=function(r,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(r)?r:[r]),c=z1(r);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),B1(o,c,l,"aria-hidden")):function(){return null}},wo="Dialog",[wp]=pn(wo),[U1,Qs]=wp(wo),Sp=r=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:d,modal:m=!0}=r,f=h.useRef(null),p=h.useRef(null),[y,g]=On({prop:o,defaultProp:c??!1,onChange:d,caller:wo});return e.jsx(U1,{scope:a,triggerRef:f,contentRef:p,contentId:cn(),titleId:cn(),descriptionId:cn(),open:y,onOpenChange:g,onOpenToggle:h.useCallback(()=>g(v=>!v),[g]),modal:m,children:l})};Sp.displayName=wo;var Cp="DialogTrigger",V1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(Cp,l),d=lt(a,c.triggerRef);return e.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Pu(c.open),...o,ref:d,onClick:He(r.onClick,c.onOpenToggle)})});V1.displayName=Cp;var ku="DialogPortal",[W1,kp]=wp(ku,{forceMount:void 0}),Ep=r=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=r,d=Qs(ku,a);return e.jsx(W1,{scope:a,forceMount:l,children:h.Children.map(o,m=>e.jsx(_l,{present:l||d.open,children:e.jsx(Su,{asChild:!0,container:c,children:m})}))})};Ep.displayName=ku;var uo="DialogOverlay",Pp=h.forwardRef((r,a)=>{const l=kp(uo,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,d=Qs(uo,r.__scopeDialog);return d.modal?e.jsx(_l,{present:o||d.open,children:e.jsx(K1,{...c,ref:a})}):null});Pp.displayName=uo;var H1=Tl("DialogOverlay.RemoveScroll"),K1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(uo,l);return e.jsx(Cu,{as:H1,allowPinchZoom:!0,shards:[c.contentRef],children:e.jsx(qe.div,{"data-state":Pu(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),Fn="DialogContent",Tp=h.forwardRef((r,a)=>{const l=kp(Fn,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,d=Qs(Fn,r.__scopeDialog);return e.jsx(_l,{present:o||d.open,children:d.modal?e.jsx(Y1,{...c,ref:a}):e.jsx(G1,{...c,ref:a})})});Tp.displayName=Fn;var Y1=h.forwardRef((r,a)=>{const l=Qs(Fn,r.__scopeDialog),o=h.useRef(null),c=lt(a,l.contentRef,o);return h.useEffect(()=>{const d=o.current;if(d)return Np(d)},[]),e.jsx(Rp,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(r.onCloseAutoFocus,d=>{var m;d.preventDefault(),(m=l.triggerRef.current)==null||m.focus()}),onPointerDownOutside:He(r.onPointerDownOutside,d=>{const m=d.detail.originalEvent,f=m.button===0&&m.ctrlKey===!0;(m.button===2||f)&&d.preventDefault()}),onFocusOutside:He(r.onFocusOutside,d=>d.preventDefault())})}),G1=h.forwardRef((r,a)=>{const l=Qs(Fn,r.__scopeDialog),o=h.useRef(!1),c=h.useRef(!1);return e.jsx(Rp,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var m,f;(m=r.onCloseAutoFocus)==null||m.call(r,d),d.defaultPrevented||(o.current||(f=l.triggerRef.current)==null||f.focus(),d.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:d=>{var p,y;(p=r.onInteractOutside)==null||p.call(r,d),d.defaultPrevented||(o.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const m=d.target;((y=l.triggerRef.current)==null?void 0:y.contains(m))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),Rp=h.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:d,...m}=r,f=Qs(Fn,l),p=h.useRef(null),y=lt(a,p);return mp(),e.jsxs(e.Fragment,{children:[e.jsx(wu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:d,children:e.jsx(Nu,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Pu(f.open),...m,ref:y,onDismiss:()=>f.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Q1,{titleId:f.titleId}),e.jsx(X1,{contentRef:p,descriptionId:f.descriptionId})]})]})}),Eu="DialogTitle",Ip=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(Eu,l);return e.jsx(qe.h2,{id:c.titleId,...o,ref:a})});Ip.displayName=Eu;var _p="DialogDescription",Mp=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(_p,l);return e.jsx(qe.p,{id:c.descriptionId,...o,ref:a})});Mp.displayName=_p;var Ap="DialogClose",Dp=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(Ap,l);return e.jsx(qe.button,{type:"button",...o,ref:a,onClick:He(r.onClick,()=>c.onOpenChange(!1))})});Dp.displayName=Ap;function Pu(r){return r?"open":"closed"}var Lp="DialogTitleWarning",[HC,Op]=Sw(Lp,{contentName:Fn,titleName:Eu,docsSlug:"dialog"}),Q1=({titleId:r})=>{const a=Op(Lp),l=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return h.useEffect(()=>{r&&(document.getElementById(r)||console.error(l))},[l,r]),null},q1="DialogDescriptionWarning",X1=({contentRef:r,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Op(q1).contentName}}.`;return h.useEffect(()=>{var d;const c=(d=r.current)==null?void 0:d.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(o))},[o,r,a]),null},J1=Sp,Z1=Ep,e2=Pp,t2=Tp,s2=Ip,r2=Mp,n2=Dp;function St(r){return e.jsx(J1,{"data-slot":"dialog",...r})}function a2(r){return e.jsx(Z1,{...r})}const Fp=h.forwardRef(({className:r,...a},l)=>e.jsx(e2,{ref:l,className:it("fixed inset-0 z-50 bg-black/50",r),...a}));Fp.displayName="DialogOverlay";const jt=h.forwardRef(({className:r,children:a,showCloseButton:l=!0,...o},c)=>e.jsxs(a2,{children:[e.jsx(Fp,{}),e.jsxs(t2,{ref:c,"aria-describedby":void 0,className:it("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border bg-background p-6 shadow-lg sm:max-w-lg",r),...o,children:[a,l&&e.jsxs(n2,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(fs,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));jt.displayName="DialogContent";function Ct({className:r,...a}){return e.jsx("div",{className:it("flex flex-col gap-2 text-center sm:text-left",r),...a})}function Dt({className:r,...a}){return e.jsx("div",{className:it("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function kt(r){return e.jsx(s2,{className:"text-lg font-semibold leading-none",...r})}function l2(r){return e.jsx(r2,{className:"text-sm text-muted-foreground",...r})}function Tu(r,a){const[l,o]=h.useState(r);return h.useEffect(()=>{const c=setTimeout(()=>o(r),a);return()=>clearTimeout(c)},[r,a]),l}function Hs({page:r,totalPages:a,total:l,pageSize:o,onPageChange:c,onPageSizeChange:d,pageSizeOptions:m=[10,20,50,100]}){return a<=1&&!d?null:e.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[e.jsxs("span",{children:["共 ",l," 条"]}),d&&e.jsx("select",{value:o,onChange:f=>d(Number(f.target.value)),className:"bg-[#0f2137] border border-gray-600 rounded px-2 py-1 text-gray-300 text-sm",children:m.map(f=>e.jsxs("option",{value:f,children:[f," 条/页"]},f))})]}),a>1&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>c(1),disabled:r<=1,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"首页"}),e.jsx("button",{type:"button",onClick:()=>c(r-1),disabled:r<=1,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"上一页"}),e.jsxs("span",{className:"px-3 py-1 text-gray-400 text-sm",children:[r," / ",a]}),e.jsx("button",{type:"button",onClick:()=>c(r+1),disabled:r>=a,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"下一页"}),e.jsx("button",{type:"button",onClick:()=>c(a),disabled:r>=a,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"末页"})]})]})}function i2(){const[r,a]=h.useState([]),[l,o]=h.useState([]),[c,d]=h.useState(0),[m,f]=h.useState(0),[p,y]=h.useState(0),[g,v]=h.useState(1),[C,P]=h.useState(10),[T,S]=h.useState(""),b=Tu(T,300),[N,E]=h.useState("all"),[j,R]=h.useState(!0),[W,U]=h.useState(null),[k,A]=h.useState(null),[I,re]=h.useState(""),[ie,oe]=h.useState(!1);async function te(){R(!0),U(null);try{const H=N==="all"?"":N==="completed"?"completed":N,M=new URLSearchParams({page:String(g),pageSize:String(C),...H&&{status:H},...b&&{search:b}}),[O,L]=await Promise.all([Be(`/api/orders?${M}`),Be("/api/db/users?page=1&pageSize=500")]);O!=null&&O.success&&(a(O.orders||[]),d(O.total??0),f(O.totalRevenue??0),y(O.todayRevenue??0)),L!=null&&L.success&&L.users&&o(L.users)}catch(H){console.error("加载订单失败",H),U("加载订单失败,请检查网络后重试")}finally{R(!1)}}h.useEffect(()=>{v(1)},[b,N]),h.useEffect(()=>{te()},[g,C,b,N]);const J=H=>{var M;return H.userNickname||((M=l.find(O=>O.id===H.userId))==null?void 0:M.nickname)||"匿名用户"},Y=H=>{var M;return((M=l.find(O=>O.id===H))==null?void 0:M.phone)||"-"},ne=H=>{const M=H.productType||H.type||"",O=H.description||"";if(O){if(M==="section"&&O.includes("章节")){if(O.includes("-")){const L=O.split("-");if(L.length>=3)return{name:`第${L[1]}章 第${L[2]}节`,type:"《一场Soul的创业实验》"}}return{name:O,type:"章节购买"}}return M==="fullbook"||O.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:M==="vip"||O.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:M==="match"||O.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:O,type:"其他"}}return M==="section"?{name:`章节 ${H.productId||H.sectionId||""}`,type:"单章"}:M==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:M==="vip"?{name:"VIP年度会员",type:"VIP"}:M==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:M||"其他"}},ve=Math.ceil(c/C)||1;async function $(){var H;if(!(!(k!=null&&k.orderSn)&&!(k!=null&&k.id))){oe(!0),U(null);try{const M=await gt("/api/admin/orders/refund",{orderSn:k.orderSn||k.id,reason:I||void 0});M!=null&&M.success?(A(null),re(""),te()):U((M==null?void 0:M.error)||"退款失败")}catch(M){const O=M;U(((H=O==null?void 0:O.data)==null?void 0:H.error)||"退款失败,请检查网络后重试")}finally{oe(!1)}}}function ce(){if(r.length===0){alert("暂无数据可导出");return}const H=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],M=r.map(de=>{const G=ne(de);return[de.orderSn||de.id||"",J(de),Y(de.userId),G.name,Number(de.amount||0).toFixed(2),de.paymentMethod==="wechat"?"微信支付":de.paymentMethod==="alipay"?"支付宝":de.paymentMethod||"微信支付",de.status==="refunded"?"已退款":de.status==="paid"||de.status==="completed"?"已完成":de.status==="pending"||de.status==="created"?"待支付":"已失败",de.status==="refunded"&&de.refundReason?de.refundReason:"-",de.referrerEarnings?Number(de.referrerEarnings).toFixed(2):"-",de.createdAt?new Date(de.createdAt).toLocaleString("zh-CN"):""].join(",")}),O="\uFEFF"+[H.join(","),...M].join(` -`),L=new Blob([O],{type:"text/csv;charset=utf-8"}),X=URL.createObjectURL(L),K=document.createElement("a");K.href=X,K.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,K.click(),URL.revokeObjectURL(X)}return e.jsxs("div",{className:"p-8 w-full",children:[W&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:W}),e.jsx("button",{type:"button",onClick:()=>U(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"订单管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",r.length," 笔订单"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(q,{variant:"outline",onClick:te,disabled:j,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${j?"animate-spin":""}`}),"刷新"]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-gray-400",children:"总收入:"}),e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",m.toFixed(2)]}),e.jsx("span",{className:"text-gray-600",children:"|"}),e.jsx("span",{className:"text-gray-400",children:"今日:"}),e.jsxs("span",{className:"text-[#FFD700] font-bold",children:["¥",p.toFixed(2)]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(le,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:T,onChange:H=>S(H.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ub,{className:"w-4 h-4 text-gray-400"}),e.jsxs("select",{value:N,onChange:H=>E(H.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"created",children:"已创建"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsxs(q,{variant:"outline",onClick:ce,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ab,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:j?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs("div",{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"订单号"}),e.jsx(be,{className:"text-gray-400",children:"用户"}),e.jsx(be,{className:"text-gray-400",children:"商品"}),e.jsx(be,{className:"text-gray-400",children:"金额"}),e.jsx(be,{className:"text-gray-400",children:"支付方式"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"退款原因"}),e.jsx(be,{className:"text-gray-400",children:"分销佣金"}),e.jsx(be,{className:"text-gray-400",children:"下单时间"}),e.jsx(be,{className:"text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(H=>{const M=ne(H);return e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsxs(ye,{className:"font-mono text-xs text-gray-400",children:[(H.orderSn||H.id||"").slice(0,12),"..."]}),e.jsx(ye,{children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:J(H)}),e.jsx("p",{className:"text-gray-500 text-xs",children:Y(H.userId)})]})}),e.jsx(ye,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[M.name,(H.productType||H.type)==="vip"&&e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0 text-xs",children:"VIP"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:M.type})]})}),e.jsxs(ye,{className:"text-[#38bdac] font-bold",children:["¥",Number(H.amount||0).toFixed(2)]}),e.jsx(ye,{className:"text-gray-300",children:H.paymentMethod==="wechat"?"微信支付":H.paymentMethod==="alipay"?"支付宝":H.paymentMethod||"微信支付"}),e.jsx(ye,{children:H.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):H.status==="paid"||H.status==="completed"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):H.status==="pending"||H.status==="created"?e.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):e.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),e.jsx(ye,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:H.refundReason,children:H.status==="refunded"&&H.refundReason?H.refundReason:"-"}),e.jsx(ye,{className:"text-[#FFD700]",children:H.referrerEarnings?`¥${Number(H.referrerEarnings).toFixed(2)}`:"-"}),e.jsx(ye,{className:"text-gray-400 text-sm",children:new Date(H.createdAt).toLocaleString("zh-CN")}),e.jsx(ye,{children:(H.status==="paid"||H.status==="completed")&&e.jsxs(q,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{A(H),re("")},children:[e.jsx(Hx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},H.id)}),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),e.jsx(Hs,{page:g,totalPages:ve,total:c,pageSize:C,onPageChange:v,onPageSizeChange:H=>{P(H),v(1)}})]})})}),e.jsx(St,{open:!!k,onOpenChange:H=>!H&&A(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:"订单退款"})}),k&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",k.orderSn||k.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(k.amount||0).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:I,onChange:H=>re(H.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>A(null),disabled:ie,children:"取消"}),e.jsx(q,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:$,disabled:ie,children:ie?"退款中...":"确认退款"})]})]})})]})}var o2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],c2=o2.reduce((r,a)=>{const l=Yx(`Primitive.${a}`),o=h.forwardRef((c,d)=>{const{asChild:m,...f}=c,p=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...f,ref:d})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{}),d2="Label",zp=h.forwardRef((r,a)=>e.jsx(c2.label,{...r,ref:a,onMouseDown:l=>{var c;l.target.closest("button, input, select, textarea")||((c=r.onMouseDown)==null||c.call(r,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));zp.displayName=d2;var $p=zp;const ee=h.forwardRef(({className:r,...a},l)=>e.jsx($p,{ref:l,className:it("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));ee.displayName=$p.displayName;function Ru(r){const a=r+"CollectionProvider",[l,o]=pn(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),m=S=>{const{scope:b,children:N}=S,E=en.useRef(null),j=en.useRef(new Map).current;return e.jsx(c,{scope:b,itemMap:j,collectionRef:E,children:N})};m.displayName=a;const f=r+"CollectionSlot",p=Tl(f),y=en.forwardRef((S,b)=>{const{scope:N,children:E}=S,j=d(f,N),R=lt(b,j.collectionRef);return e.jsx(p,{ref:R,children:E})});y.displayName=f;const g=r+"CollectionItemSlot",v="data-radix-collection-item",C=Tl(g),P=en.forwardRef((S,b)=>{const{scope:N,children:E,...j}=S,R=en.useRef(null),W=lt(b,R),U=d(g,N);return en.useEffect(()=>(U.itemMap.set(R,{ref:R,...j}),()=>void U.itemMap.delete(R))),e.jsx(C,{[v]:"",ref:W,children:E})});P.displayName=g;function T(S){const b=d(r+"CollectionConsumer",S);return en.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${v}]`));return Array.from(b.itemMap.values()).sort((U,k)=>j.indexOf(U.ref.current)-j.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:m,Slot:y,ItemSlot:P},T,o]}var u2=h.createContext(void 0);function So(r){const a=h.useContext(u2);return r||a||"ltr"}var Ad="rovingFocusGroup.onEntryFocus",h2={bubbles:!1,cancelable:!0},Ml="RovingFocusGroup",[Jd,Bp,m2]=Ru(Ml),[f2,Up]=pn(Ml,[m2]),[x2,p2]=f2(Ml),Vp=h.forwardRef((r,a)=>e.jsx(Jd.Provider,{scope:r.__scopeRovingFocusGroup,children:e.jsx(Jd.Slot,{scope:r.__scopeRovingFocusGroup,children:e.jsx(g2,{...r,ref:a})})}));Vp.displayName=Ml;var g2=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:d,currentTabStopId:m,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:p,onEntryFocus:y,preventScrollOnEntryFocus:g=!1,...v}=r,C=h.useRef(null),P=lt(a,C),T=So(d),[S,b]=On({prop:m,defaultProp:f??null,onChange:p,caller:Ml}),[N,E]=h.useState(!1),j=un(y),R=Bp(l),W=h.useRef(!1),[U,k]=h.useState(0);return h.useEffect(()=>{const A=C.current;if(A)return A.addEventListener(Ad,j),()=>A.removeEventListener(Ad,j)},[j]),e.jsx(x2,{scope:l,orientation:o,dir:T,loop:c,currentTabStopId:S,onItemFocus:h.useCallback(A=>b(A),[b]),onItemShiftTab:h.useCallback(()=>E(!0),[]),onFocusableItemAdd:h.useCallback(()=>k(A=>A+1),[]),onFocusableItemRemove:h.useCallback(()=>k(A=>A-1),[]),children:e.jsx(qe.div,{tabIndex:N||U===0?-1:0,"data-orientation":o,...v,ref:P,style:{outline:"none",...r.style},onMouseDown:He(r.onMouseDown,()=>{W.current=!0}),onFocus:He(r.onFocus,A=>{const I=!W.current;if(A.target===A.currentTarget&&I&&!N){const re=new CustomEvent(Ad,h2);if(A.currentTarget.dispatchEvent(re),!re.defaultPrevented){const ie=R().filter(ne=>ne.focusable),oe=ie.find(ne=>ne.active),te=ie.find(ne=>ne.id===S),Y=[oe,te,...ie].filter(Boolean).map(ne=>ne.ref.current);Kp(Y,g)}}W.current=!1}),onBlur:He(r.onBlur,()=>E(!1))})})}),Wp="RovingFocusGroupItem",Hp=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:d,children:m,...f}=r,p=cn(),y=d||p,g=p2(Wp,l),v=g.currentTabStopId===y,C=Bp(l),{onFocusableItemAdd:P,onFocusableItemRemove:T,currentTabStopId:S}=g;return h.useEffect(()=>{if(o)return P(),()=>T()},[o,P,T]),e.jsx(Jd.ItemSlot,{scope:l,id:y,focusable:o,active:c,children:e.jsx(qe.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...f,ref:a,onMouseDown:He(r.onMouseDown,b=>{o?g.onItemFocus(y):b.preventDefault()}),onFocus:He(r.onFocus,()=>g.onItemFocus(y)),onKeyDown:He(r.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){g.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const N=j2(b,g.orientation,g.dir);if(N!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let j=C().filter(R=>R.focusable).map(R=>R.ref.current);if(N==="last")j.reverse();else if(N==="prev"||N==="next"){N==="prev"&&j.reverse();const R=j.indexOf(b.currentTarget);j=g.loop?b2(j,R+1):j.slice(R+1)}setTimeout(()=>Kp(j))}}),children:typeof m=="function"?m({isCurrentTabStop:v,hasTabStop:S!=null}):m})})});Hp.displayName=Wp;var y2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function v2(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function j2(r,a,l){const o=v2(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return y2[o]}function Kp(r,a=!1){const l=document.activeElement;for(const o of r)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function b2(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var N2=Vp,w2=Hp,Co="Tabs",[S2]=pn(Co,[Up]),Yp=Up(),[C2,Iu]=S2(Co),Gp=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:d,orientation:m="horizontal",dir:f,activationMode:p="automatic",...y}=r,g=So(f),[v,C]=On({prop:o,onChange:c,defaultProp:d??"",caller:Co});return e.jsx(C2,{scope:l,baseId:cn(),value:v,onValueChange:C,orientation:m,dir:g,activationMode:p,children:e.jsx(qe.div,{dir:g,"data-orientation":m,...y,ref:a})})});Gp.displayName=Co;var Qp="TabsList",qp=h.forwardRef((r,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=r,d=Iu(Qp,l),m=Yp(l);return e.jsx(N2,{asChild:!0,...m,orientation:d.orientation,dir:d.dir,loop:o,children:e.jsx(qe.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});qp.displayName=Qp;var Xp="TabsTrigger",Jp=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...d}=r,m=Iu(Xp,l),f=Yp(l),p=t0(m.baseId,o),y=s0(m.baseId,o),g=o===m.value;return e.jsx(w2,{asChild:!0,...f,focusable:!c,active:g,children:e.jsx(qe.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":y,"data-state":g?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:p,...d,ref:a,onMouseDown:He(r.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?m.onValueChange(o):v.preventDefault()}),onKeyDown:He(r.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&m.onValueChange(o)}),onFocus:He(r.onFocus,()=>{const v=m.activationMode!=="manual";!g&&!c&&v&&m.onValueChange(o)})})})});Jp.displayName=Xp;var Zp="TabsContent",e0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:d,...m}=r,f=Iu(Zp,l),p=t0(f.baseId,o),y=s0(f.baseId,o),g=o===f.value,v=h.useRef(g);return h.useEffect(()=>{const C=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(C)},[]),e.jsx(_l,{present:c||g,children:({present:C})=>e.jsx(qe.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":p,hidden:!C,id:y,tabIndex:0,...m,ref:a,style:{...r.style,animationDuration:v.current?"0s":void 0},children:C&&d})})});e0.displayName=Zp;function t0(r,a){return`${r}-trigger-${a}`}function s0(r,a){return`${r}-content-${a}`}var k2=Gp,r0=qp,n0=Jp,a0=e0;const Al=k2,Fa=h.forwardRef(({className:r,...a},l)=>e.jsx(r0,{ref:l,className:it("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));Fa.displayName=r0.displayName;const Lt=h.forwardRef(({className:r,...a},l)=>e.jsx(n0,{ref:l,className:it("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",r),...a}));Lt.displayName=n0.displayName;const Ot=h.forwardRef(({className:r,...a},l)=>e.jsx(a0,{ref:l,className:it("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...a}));Ot.displayName=a0.displayName;function _u(r){const a=h.useRef({value:r,previous:r});return h.useMemo(()=>(a.current.value!==r&&(a.current.previous=a.current.value,a.current.value=r),a.current.previous),[r])}function Mu(r){const[a,l]=h.useState(void 0);return ts(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let m,f;if("borderBoxSize"in d){const p=d.borderBoxSize,y=Array.isArray(p)?p[0]:p;m=y.inlineSize,f=y.blockSize}else m=r.offsetWidth,f=r.offsetHeight;l({width:m,height:f})});return o.observe(r,{box:"border-box"}),()=>o.unobserve(r)}else l(void 0)},[r]),a}var ko="Switch",[E2]=pn(ko),[P2,T2]=E2(ko),l0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:d,required:m,disabled:f,value:p="on",onCheckedChange:y,form:g,...v}=r,[C,P]=h.useState(null),T=lt(a,j=>P(j)),S=h.useRef(!1),b=C?g||!!C.closest("form"):!0,[N,E]=On({prop:c,defaultProp:d??!1,onChange:y,caller:ko});return e.jsxs(P2,{scope:l,checked:N,disabled:f,children:[e.jsx(qe.button,{type:"button",role:"switch","aria-checked":N,"aria-required":m,"data-state":d0(N),"data-disabled":f?"":void 0,disabled:f,value:p,...v,ref:T,onClick:He(r.onClick,j=>{E(R=>!R),b&&(S.current=j.isPropagationStopped(),S.current||j.stopPropagation())})}),b&&e.jsx(c0,{control:C,bubbles:!S.current,name:o,value:p,checked:N,required:m,disabled:f,form:g,style:{transform:"translateX(-100%)"}})]})});l0.displayName=ko;var i0="SwitchThumb",o0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,...o}=r,c=T2(i0,l);return e.jsx(qe.span,{"data-state":d0(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:a})});o0.displayName=i0;var R2="SwitchBubbleInput",c0=h.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:o=!0,...c},d)=>{const m=h.useRef(null),f=lt(m,d),p=_u(l),y=Mu(a);return h.useEffect(()=>{const g=m.current;if(!g)return;const v=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(v,"checked").set;if(p!==l&&P){const T=new Event("click",{bubbles:o});P.call(g,l),g.dispatchEvent(T)}},[p,l,o]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:f,style:{...c.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});c0.displayName=R2;function d0(r){return r?"checked":"unchecked"}var u0=l0,I2=o0;const dt=h.forwardRef(({className:r,...a},l)=>e.jsx(u0,{className:it("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a1628] disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-gray-600 data-[state=checked]:bg-[#38bdac]",r),...a,ref:l,children:e.jsx(I2,{className:it("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));dt.displayName=u0.displayName;const dn=h.forwardRef(({className:r,...a},l)=>e.jsx("textarea",{className:it("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:l,...a}));dn.displayName="Textarea";function _2({open:r,onClose:a,userId:l,onUserUpdated:o}){var tt;const[c,d]=h.useState(null),[m,f]=h.useState([]),[p,y]=h.useState([]),[g,v]=h.useState(!1),[C,P]=h.useState(!1),[T,S]=h.useState(!1),[b,N]=h.useState("info"),[E,j]=h.useState(""),[R,W]=h.useState(""),[U,k]=h.useState([]),[A,I]=h.useState(""),[re,ie]=h.useState(!1),[oe,te]=h.useState(null),[J,Y]=h.useState(null),[ne,ve]=h.useState(""),[$,ce]=h.useState(""),[H,M]=h.useState(""),[O,L]=h.useState(!1),[X,K]=h.useState(null),[de,G]=h.useState("");h.useEffect(()=>{r&&l&&(N("info"),te(null),Y(null),K(null),G(""),xe())},[r,l]);async function xe(){if(l){v(!0);try{const pe=await Be(`/api/db/users?id=${encodeURIComponent(l)}`);if(pe!=null&&pe.success&&pe.user){const fe=pe.user;d(fe),j(fe.phone||""),W(fe.nickname||""),ve(fe.phone||""),ce(fe.wechatId||""),M(fe.openId||"");try{k(typeof fe.tags=="string"?JSON.parse(fe.tags||"[]"):[])}catch{k([])}}try{const fe=await Be(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);fe!=null&&fe.success&&fe.tracks&&f(fe.tracks)}catch{f([])}try{const fe=await Be(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);fe!=null&&fe.success&&fe.referrals&&y(fe.referrals)}catch{y([])}}catch(pe){console.error("Load user detail error:",pe)}finally{v(!1)}}}async function we(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}P(!0);try{const pe=await yt("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});pe!=null&&pe.success?(alert("同步成功"),xe()):alert("同步失败: "+(pe==null?void 0:pe.error))}catch(pe){console.error("Sync CKB error:",pe),alert("同步失败")}finally{P(!1)}}async function D(){if(c){S(!0);try{const pe={id:c.id,phone:E||void 0,nickname:R||void 0,tags:JSON.stringify(U)},fe=await gt("/api/db/users",pe);fe!=null&&fe.success?(alert("保存成功"),xe(),o==null||o()):alert("保存失败: "+(fe==null?void 0:fe.error))}catch(pe){console.error("Save user error:",pe),alert("保存失败")}finally{S(!1)}}}const ue=()=>{A&&!U.includes(A)&&(k([...U,A]),I(""))},Se=pe=>k(U.filter(fe=>fe!==pe));async function Ie(){if(!ne&&!H&&!$){Y("请至少输入手机号、微信号或 OpenID 中的一项");return}ie(!0),Y(null),te(null);try{const pe=new URLSearchParams;ne&&pe.set("phone",ne),H&&pe.set("openId",H),$&&pe.set("wechatId",$);const fe=await Be(`/api/admin/shensheshou/query?${pe}`);fe!=null&&fe.success&&fe.data?(te(fe.data),c&&await Ue(fe.data)):Y((fe==null?void 0:fe.error)||"未查询到数据,该用户可能未在神射手收录")}catch(pe){console.error("SSS query error:",pe),Y("请求失败,请检查神射手接口配置")}finally{ie(!1)}}async function Ue(pe){if(c)try{await yt("/api/admin/shensheshou/enrich",{userId:c.id,phone:ne||c.phone||"",openId:H||c.openId||"",wechatId:$||c.wechatId||""}),xe()}catch(fe){console.error("SSS enrich error:",fe)}}async function Ze(){if(c){L(!0),K(null);try{const pe={users:[{phone:c.phone||"",name:c.nickname||"",openId:c.openId||"",tags:U}]},fe=await yt("/api/admin/shensheshou/ingest",pe);fe!=null&&fe.success&&fe.data?K(fe.data):K({error:(fe==null?void 0:fe.error)||"推送失败"})}catch(pe){console.error("SSS ingest error:",pe),K({error:"请求失败"})}finally{L(!1)}}}const et=pe=>{const ot={view_chapter:Ks,purchase:Yd,match:Qt,login:ka,register:ka,share:ln,bind_phone:Gb,bind_wechat:$b,fill_profile:Sd,visit_page:wa}[pe]||Wd;return e.jsx(ot,{className:"w-4 h-4"})};return r?e.jsx(St,{open:r,onOpenChange:()=>a(),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(ka,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"}),(c==null?void 0:c.isVip)&&e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 border-0",children:"VIP"})]})}),g?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):c?e.jsxs("div",{className:"flex flex-col h-[75vh]",children:[e.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-3",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac] shrink-0",children:c.avatar?e.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((tt=c.nickname)==null?void 0:tt.charAt(0))||"?"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"text-lg font-bold text-white",children:c.nickname}),c.isAdmin&&e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"}),c.vipRole&&e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 border-0",children:c.vipRole})]}),e.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechatId&&` · 💬 ${c.wechatId}`,c.mbti&&` · ${c.mbti}`]}),e.jsxs("div",{className:"flex items-center gap-4 mt-1",children:[e.jsxs("p",{className:"text-gray-600 text-xs",children:["ID: ",c.id.slice(0,16),"…"]}),c.referralCode&&e.jsxs("p",{className:"text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"推广码:"}),e.jsx("code",{className:"text-[#38bdac] bg-[#38bdac]/10 px-1.5 py-0.5 rounded",children:c.referralCode})]})]})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsxs("p",{className:"text-[#38bdac] font-bold text-lg",children:["¥",(c.earnings||0).toFixed(2)]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"})]})]}),e.jsxs(Al,{value:b,onValueChange:N,className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(Fa,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-3 flex-wrap h-auto gap-1",children:[e.jsx(Lt,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"基础信息"}),e.jsx(Lt,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"标签体系"}),e.jsxs(Lt,{value:"journey",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:[e.jsx(wa,{className:"w-3 h-3 mr-1"}),"用户旅程"]}),e.jsx(Lt,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"关系链路"}),e.jsxs(Lt,{value:"shensheshou",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:[e.jsx(nn,{className:"w-3 h-3 mr-1"}),"用户资料完善"]})]}),e.jsxs(Ot,{value:"info",className:"flex-1 overflow-auto space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"手机号"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:E,onChange:pe=>j(pe.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"昵称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:R,onChange:pe=>W(pe.target.value)})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.openId&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"微信 OpenID"}),e.jsx("p",{className:"text-gray-300 font-mono text-xs break-all",children:c.openId})]}),c.region&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg flex items-center gap-2",children:[e.jsx(Wx,{className:"w-4 h-4 text-gray-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs",children:"地区"}),e.jsx("p",{className:"text-white",children:c.region})]})]}),c.industry&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"行业"}),e.jsx("p",{className:"text-white",children:c.industry})]}),c.position&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"职位"}),e.jsx("p",{className:"text-white",children:c.position})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"推荐人数"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:c.referralCount??0})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"待提现"}),e.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["¥",(c.pendingEarnings??0).toFixed(2)]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"创建时间"}),e.jsx("p",{className:"text-sm text-white",children:c.createdAt?new Date(c.createdAt).toLocaleDateString():"-"})]})]}),c.isVip&&e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg border border-amber-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(kr,{className:"w-4 h-4 text-amber-400"}),e.jsx("span",{className:"text-white font-medium",children:"VIP 信息"}),e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 border-0 text-xs",children:c.vipRole||"VIP"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.vipName&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"展示名:"}),e.jsx("span",{className:"text-white",children:c.vipName})]}),c.vipProject&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"项目:"}),e.jsx("span",{className:"text-white",children:c.vipProject})]}),c.vipContact&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"联系方式:"}),e.jsx("span",{className:"text-white",children:c.vipContact})]}),c.vipExpireDate&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"到期时间:"}),e.jsx("span",{className:"text-white",children:new Date(c.vipExpireDate).toLocaleDateString()})]})]}),c.vipBio&&e.jsx("p",{className:"text-gray-400 text-sm mt-2",children:c.vipBio})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg border border-purple-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(lo,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"微信归属"}),e.jsx("span",{className:"text-gray-500 text-xs",children:"该用户归属在哪个微信号下"})]}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(le,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"输入归属微信号(如 wxid_xxxx)",value:de,onChange:pe=>G(pe.target.value)}),e.jsxs(q,{size:"sm",onClick:async()=>{if(!(!de||!c))try{await gt("/api/db/users",{id:c.id,wechatId:de}),alert("已保存微信归属"),xe()}catch{alert("保存失败")}},className:"bg-purple-500/20 hover:bg-purple-500/30 text-purple-400 border border-purple-500/30 shrink-0",children:[e.jsx(_t,{className:"w-4 h-4 mr-1"})," 保存"]})]}),c.wechatId&&e.jsxs("p",{className:"text-gray-500 text-xs mt-2",children:["当前归属:",e.jsx("span",{className:"text-purple-400",children:c.wechatId})]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ln,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),e.jsx(q,{size:"sm",onClick:we,disabled:C||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1"})," 同步数据"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"同步状态:"}),c.ckbSyncedAt?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 ml-1",children:"未同步"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"最后同步:"}),e.jsx("span",{className:"text-gray-300 ml-1",children:c.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),e.jsxs(Ot,{value:"tags",className:"flex-1 overflow-auto space-y-4",children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Sd,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"用户标签"}),e.jsx("span",{className:"text-gray-500 text-xs",children:"基于《一场 Soul 的创业实验》维度打标"})]}),e.jsxs("div",{className:"mb-3 p-2.5 bg-[#38bdac]/5 border border-[#38bdac]/20 rounded-lg flex items-center gap-2 text-xs text-gray-400",children:[e.jsx(Vd,{className:"w-3.5 h-3.5 text-[#38bdac] shrink-0"}),"命中的标签自动高亮 · 系统根据行为轨迹和填写资料自动打标 · 手动点击补充或取消"]}),e.jsx("div",{className:"mb-4 space-y-3",children:[{category:"身份类型",tags:["创业者","打工人","自由职业","学生","投资人","合伙人"]},{category:"行业背景",tags:["电商","内容","传统行业","科技/AI","金融","教育","餐饮"]},{category:"痛点标签",tags:["找资源","找方向","找合伙人","想赚钱","想学习","找情感出口"]},{category:"付费意愿",tags:["高意向","已付费","观望中","薅羊毛"]},{category:"MBTI",tags:["ENTJ","INTJ","ENFP","INFP","ENTP","INTP","ESTJ","ISFJ"]}].map(pe=>e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1.5",children:pe.category}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:pe.tags.map(fe=>e.jsxs("button",{type:"button",onClick:()=>{U.includes(fe)?Se(fe):k([...U,fe])},className:`px-2 py-0.5 rounded text-xs border transition-all ${U.includes(fe)?"bg-[#38bdac]/20 border-[#38bdac]/50 text-[#38bdac]":"bg-transparent border-gray-700 text-gray-500 hover:border-gray-500 hover:text-gray-300"}`,children:[U.includes(fe)?"✓ ":"",fe]},fe))})]},pe.category))}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-3",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-2",children:"已选标签"}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-3 min-h-[32px]",children:[U.map((pe,fe)=>e.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[pe,e.jsx("button",{type:"button",onClick:()=>Se(pe),className:"ml-1 hover:text-red-400",children:e.jsx(fs,{className:"w-3 h-3"})})]},fe)),U.length===0&&e.jsx("span",{className:"text-gray-600 text-sm",children:"暂未选择标签"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(le,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"自定义标签(回车添加)",value:A,onChange:pe=>I(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&ue()}),e.jsx(q,{onClick:ue,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})]}),c.ckbTags&&e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Sd,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝标签"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:(typeof c.ckbTags=="string"?c.ckbTags.split(","):[]).map((pe,fe)=>e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:pe.trim()},fe))})]})]}),e.jsxs(Ot,{value:"journey",className:"flex-1 overflow-auto",children:[e.jsxs("div",{className:"mb-3 p-3 bg-[#0a1628] rounded-lg flex items-center gap-2",children:[e.jsx(wa,{className:"w-4 h-4 text-[#38bdac]"}),e.jsxs("span",{className:"text-gray-400 text-sm",children:["记录用户从注册到付费的完整行动路径,共 ",m.length," 条记录"]})]}),e.jsx("div",{className:"space-y-2",children:m.length>0?m.map((pe,fe)=>e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:et(pe.action)}),fe0?p.map((pe,fe)=>{var ss;const ot=pe;return e.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#162840] rounded",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:((ss=ot.nickname)==null?void 0:ss.charAt(0))||"?"}),e.jsx("span",{className:"text-white text-sm",children:ot.nickname})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[ot.status==="vip"&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),e.jsx("span",{className:"text-gray-500 text-xs",children:ot.createdAt?new Date(ot.createdAt).toLocaleDateString():""})]})]},ot.id||fe)}):e.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})}),e.jsxs(Ot,{value:"shensheshou",className:"flex-1 overflow-auto space-y-4",children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(nn,{className:"w-5 h-5 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"用户资料完善"}),e.jsx("span",{className:"text-gray-500 text-xs",children:"通过多维度查询神射手数据,自动回填用户基础信息"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[e.jsxs("div",{children:[e.jsx(ee,{className:"text-gray-500 text-xs mb-1 block",children:"手机号"}),e.jsx(le,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"11位手机号",value:ne,onChange:pe=>ve(pe.target.value)})]}),e.jsxs("div",{children:[e.jsx(ee,{className:"text-gray-500 text-xs mb-1 block",children:"微信号"}),e.jsx(le,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"微信 ID",value:$,onChange:pe=>ce(pe.target.value)})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx(ee,{className:"text-gray-500 text-xs mb-1 block",children:"微信 OpenID"}),e.jsx(le,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"openid_xxxx(自动填入)",value:H,onChange:pe=>M(pe.target.value)})]})]}),e.jsx(q,{onClick:Ie,disabled:re,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:re?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"})," 查询并自动回填中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(on,{className:"w-4 h-4 mr-1"})," 查询并自动完善用户资料"]})}),e.jsx("p",{className:"text-gray-600 text-xs mt-2",children:"查询成功后,神射手返回的标签将自动同步到该用户"}),J&&e.jsx("div",{className:"mt-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg text-red-400 text-sm",children:J}),oe&&e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"神射手 RFM 分"}),e.jsx("p",{className:"text-2xl font-bold text-[#38bdac]",children:oe.rfm_score??"-"})]}),e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"用户等级"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:oe.user_level??"-"})]})]}),oe.tags&&oe.tags.length>0&&e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-2",children:"神射手标签"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:oe.tags.map((pe,fe)=>e.jsx(Oe,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/20",children:pe},fe))})]}),oe.last_active&&e.jsxs("div",{className:"text-sm text-gray-500",children:["最近活跃:",oe.last_active]})]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(nn,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"推送用户数据到神射手"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"将本用户信息(手机号、昵称、标签等)同步至神射手,自动完善用户画像"})]}),e.jsx(q,{onClick:Ze,disabled:O||!c.phone,variant:"outline",className:"border-purple-500/40 text-purple-400 hover:bg-purple-500/10 bg-transparent shrink-0 ml-4",children:O?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"})," 推送中"]}):e.jsxs(e.Fragment,{children:[e.jsx(nn,{className:"w-4 h-4 mr-1"})," 推送"]})})]}),!c.phone&&e.jsx("p",{className:"text-yellow-500/70 text-xs",children:"⚠ 用户未绑定手机号,无法推送"}),X&&e.jsx("div",{className:"mt-3 p-3 bg-[#162840] rounded-lg text-sm",children:X.error?e.jsx("p",{className:"text-red-400",children:String(X.error)}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-green-400 flex items-center gap-1",children:[e.jsx(Vd,{className:"w-4 h-4"})," 推送成功"]}),X.enriched!==void 0&&e.jsxs("p",{className:"text-gray-400",children:["自动补全标签数:",String(X.new_tags_added??0)]})]})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-3 border-t border-gray-700 mt-3",children:[e.jsxs(q,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"关闭"]}),e.jsxs(q,{onClick:D,disabled:T,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),T?"保存中...":"保存修改"]})]})]}):e.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const Dd={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function M2({open:r,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[d,m]=h.useState(Dd),[f,p]=h.useState([]),[y,g]=h.useState(!1),[v,C]=h.useState(!1);h.useEffect(()=>{if(!r){m(Dd);return}let T=!1;return g(!0),Promise.all([Be("/api/db/vip-roles"),l?Be(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([S,b])=>{if(T)return;const N=S!=null&&S.success&&S.data?S.data:[];p(N);const E=b&&b.user?b.user:null;if(E){const j=String(E.vipRole??""),R=N.some(W=>W.name===j);m({isVip:!!(E.isVip??!1),vipExpireDate:E.vipExpireDate?String(E.vipExpireDate).slice(0,10):"",vipSort:typeof E.vipSort=="number"?E.vipSort:"",vipRole:R?j:j?"__custom__":"",vipRoleCustom:R?"":j,vipName:String(E.vipName??""),vipProject:String(E.vipProject??""),vipContact:String(E.vipContact??""),vipBio:String(E.vipBio??"")})}else m(Dd)}).catch(S=>{T||console.error("Load error:",S)}).finally(()=>{T||g(!1)}),()=>{T=!0}},[r,l]);async function P(){if(l){if(d.isVip&&!d.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(d.isVip&&d.vipExpireDate.trim()){const T=new Date(d.vipExpireDate);if(isNaN(T.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}C(!0);try{const T=d.vipRole==="__custom__"?d.vipRoleCustom.trim():d.vipRole,S={id:l,isVip:d.isVip,vipExpireDate:d.isVip?d.vipExpireDate:void 0,vipSort:d.vipSort===""?void 0:d.vipSort,vipRole:T||void 0,vipName:d.vipName||void 0,vipProject:d.vipProject||void 0,vipContact:d.vipContact||void 0,vipBio:d.vipBio||void 0},b=await gt("/api/db/users",S);b!=null&&b.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(b==null?void 0:b.error))}catch(T){console.error("Save VIP error:",T),alert("保存失败")}finally{C(!1)}}}return r?e.jsx(St,{open:r,onOpenChange:()=>a(),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(kr,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",o||l]})}),y?e.jsx("div",{className:"py-8 text-center text-gray-400",children:"加载中..."}):e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ee,{className:"text-gray-300",children:"VIP 会员"}),e.jsx(dt,{checked:d.isVip,onCheckedChange:T=>m(S=>({...S,isVip:T}))})]}),d.isVip&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",e.jsx("span",{className:"text-amber-400",children:"*"})]}),e.jsx(le,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:d.vipExpireDate,onChange:T=>m(S=>({...S,vipExpireDate:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"排序"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:d.vipSort===""?"":d.vipSort,onChange:T=>{const S=T.target.value;m(b=>({...b,vipSort:S===""?"":parseInt(S,10)||0}))}})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md px-3 py-2",value:d.vipRole,onChange:T=>m(S=>({...S,vipRole:T.target.value})),children:[e.jsx("option",{value:"",children:"请选择或下方手动填写"}),f.map(T=>e.jsx("option",{value:T.name,children:T.name},T.id)),e.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),d.vipRole==="__custom__"&&e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:d.vipRoleCustom,onChange:T=>m(S=>({...S,vipRoleCustom:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"VIP 展示名"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:d.vipName,onChange:T=>m(S=>({...S,vipName:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"项目/公司"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:d.vipProject,onChange:T=>m(S=>({...S,vipProject:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"联系方式"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:d.vipContact,onChange:T=>m(S=>({...S,vipContact:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"一句话简介"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:d.vipBio,onChange:T=>m(S=>({...S,vipBio:T.target.value}))})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:P,disabled:v||y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})}):null}const qi=[{id:"register",label:"注册/登录",icon:"👤",color:"bg-blue-500/20 border-blue-500/40 text-blue-400",desc:"微信授权登录或手机号注册"},{id:"browse",label:"浏览章节",icon:"📖",color:"bg-purple-500/20 border-purple-500/40 text-purple-400",desc:"点击免费/付费章节预览"},{id:"bind_phone",label:"绑定手机",icon:"📱",color:"bg-cyan-500/20 border-cyan-500/40 text-cyan-400",desc:"触发付费章节后绑定手机"},{id:"first_pay",label:"首次付款",icon:"💳",color:"bg-green-500/20 border-green-500/40 text-green-400",desc:"购买单章或全书"},{id:"fill_profile",label:"完善资料",icon:"✍️",color:"bg-yellow-500/20 border-yellow-500/40 text-yellow-400",desc:"填写头像、MBTI、行业等"},{id:"match",label:"派对房匹配",icon:"🤝",color:"bg-orange-500/20 border-orange-500/40 text-orange-400",desc:"参与 Soul 派对房"},{id:"vip",label:"升级 VIP",icon:"👑",color:"bg-amber-500/20 border-amber-500/40 text-amber-400",desc:"付款 ¥1980 购买全书"},{id:"distribution",label:"开启分销",icon:"🔗",color:"bg-[#38bdac]/20 border-[#38bdac]/40 text-[#38bdac]",desc:"生成推广码并推荐好友"}];function A2(){var Te,ut,rs,nt,is;const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(""),g=Tu(p,300),[v,C]=h.useState("all"),[P,T]=h.useState(!0),[S,b]=h.useState(null),[N,E]=h.useState(!1),[j,R]=h.useState("desc"),[W,U]=h.useState(!1),[k,A]=h.useState(!1),[I,re]=h.useState(null),[ie,oe]=h.useState(""),[te,J]=h.useState(""),[Y,ne]=h.useState(!1),[ve,$]=h.useState(!1),[ce,H]=h.useState({referrals:[],stats:{}}),[M,O]=h.useState(!1),[L,X]=h.useState(null),[K,de]=h.useState(!1),[G,xe]=h.useState(null),[we,D]=h.useState(!1),[ue,Se]=h.useState(null),[Ie,Ue]=h.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),[Ze,et]=h.useState([]),[tt,pe]=h.useState(!1),[fe,ot]=h.useState(!1),[ss,dr]=h.useState(null),[Ht,Cs]=h.useState({title:"",description:"",trigger:"",sort:0,enabled:!0}),[Kt,vn]=h.useState([]),[Mt,ur]=h.useState(!1),[Un,ls]=h.useState(!1),[ks,jn]=h.useState(null),[Es,Ls]=h.useState({name:"",sort:0}),[hr,bn]=h.useState({}),[mr,Ir]=h.useState(!1);async function Ps(){var B;T(!0),b(null);try{if(N){const We=new URLSearchParams({search:g,limit:String(m*5)}),Ge=await Be(`/api/db/users/rfm?${We}`);if(Ge!=null&&Ge.success){let at=Ge.users||[];j==="asc"&&(at=[...at].reverse());const Ts=(c-1)*m;a(at.slice(Ts,Ts+m)),o(((B=Ge.users)==null?void 0:B.length)??0)}}else{const We=new URLSearchParams({page:String(c),pageSize:String(m),search:g,...v==="vip"&&{vip:"true"}}),Ge=await Be(`/api/db/users?${We}`);Ge!=null&&Ge.success?(a(Ge.users||[]),o(Ge.total??0)):b((Ge==null?void 0:Ge.error)||"加载失败")}}catch(We){console.error("Load users error:",We),b("网络错误")}finally{T(!1)}}h.useEffect(()=>{d(1)},[g,v,N]),h.useEffect(()=>{Ps()},[c,m,g,v,N,j]);const Nn=Math.ceil(l/m)||1,qs=()=>{N?j==="desc"?R("asc"):(E(!1),R("desc")):(E(!0),R("desc"))},Xs=B=>({S:"bg-amber-500/20 text-amber-400",A:"bg-green-500/20 text-green-400",B:"bg-blue-500/20 text-blue-400",C:"bg-gray-500/20 text-gray-400",D:"bg-red-500/20 text-red-400"})[B||""]||"bg-gray-500/20 text-gray-400";async function Vn(B){if(confirm("确定要删除这个用户吗?"))try{const We=await Er(`/api/db/users?id=${encodeURIComponent(B)}`);We!=null&&We.success?Ps():alert("删除失败: "+((We==null?void 0:We.error)||""))}catch{alert("删除失败")}}const Wn=B=>{re(B),Ue({phone:B.phone||"",nickname:B.nickname||"",password:"",isAdmin:!!(B.isAdmin??!1),hasFullBook:!!(B.hasFullBook??!1)}),U(!0)},Hn=()=>{re(null),Ue({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),U(!0)};async function Kn(){if(!Ie.phone||!Ie.nickname){alert("请填写手机号和昵称");return}ne(!0);try{if(I){const B=await gt("/api/db/users",{id:I.id,nickname:Ie.nickname,isAdmin:Ie.isAdmin,hasFullBook:Ie.hasFullBook,...Ie.password&&{password:Ie.password}});if(!(B!=null&&B.success)){alert("更新失败: "+((B==null?void 0:B.error)||""));return}}else{const B=await yt("/api/db/users",{phone:Ie.phone,nickname:Ie.nickname,password:Ie.password,isAdmin:Ie.isAdmin});if(!(B!=null&&B.success)){alert("创建失败: "+((B==null?void 0:B.error)||""));return}}U(!1),Ps()}catch{alert("保存失败")}finally{ne(!1)}}const Yn=B=>{re(B),oe(""),J(""),A(!0)};async function _r(B){X(B),$(!0),O(!0);try{const We=await Be(`/api/db/users/referrals?userId=${encodeURIComponent(B.id)}`);We!=null&&We.success?H({referrals:We.referrals||[],stats:We.stats||{}}):H({referrals:[],stats:{}})}catch{H({referrals:[],stats:{}})}finally{O(!1)}}async function wn(){if(!ie){alert("请输入新密码");return}if(ie!==te){alert("两次密码不一致");return}if(ie.length<6){alert("密码至少6位");return}ne(!0);try{const B=await gt("/api/db/users",{id:I==null?void 0:I.id,password:ie});B!=null&&B.success?(alert("修改成功"),A(!1)):alert("修改失败: "+((B==null?void 0:B.error)||""))}catch{alert("修改失败")}finally{ne(!1)}}const qt=h.useCallback(async()=>{pe(!0);try{const B=await Be("/api/db/user-rules");B!=null&&B.success&&et(B.rules||[])}catch{}finally{pe(!1)}},[]);async function Mr(){if(!Ht.title){alert("请填写规则标题");return}ne(!0);try{if(ss){const B=await gt("/api/db/user-rules",{id:ss.id,...Ht});if(!(B!=null&&B.success)){alert("更新失败: "+((B==null?void 0:B.error)||""));return}}else{const B=await yt("/api/db/user-rules",Ht);if(!(B!=null&&B.success)){alert("创建失败: "+((B==null?void 0:B.error)||""));return}}ot(!1),qt()}catch{alert("保存失败")}finally{ne(!1)}}async function Js(B){if(confirm("确定删除?"))try{const We=await Er(`/api/db/user-rules?id=${B}`);We!=null&&We.success&&qt()}catch{}}async function Gn(B){try{await gt("/api/db/user-rules",{id:B.id,enabled:!B.enabled}),qt()}catch{}}const ys=h.useCallback(async()=>{ur(!0);try{const B=await Be("/api/db/vip-roles");B!=null&&B.success&&vn(B.roles||[])}catch{}finally{ur(!1)}},[]);async function F(){if(!Es.name){alert("请填写角色名称");return}ne(!0);try{if(ks){const B=await gt("/api/db/vip-roles",{id:ks.id,...Es});if(!(B!=null&&B.success)){alert("更新失败");return}}else{const B=await yt("/api/db/vip-roles",Es);if(!(B!=null&&B.success)){alert("创建失败");return}}ls(!1),ys()}catch{alert("保存失败")}finally{ne(!1)}}async function ae(B){if(confirm("确定删除?"))try{const We=await Er(`/api/db/vip-roles?id=${B}`);We!=null&&We.success&&ys()}catch{}}const Ne=h.useCallback(async()=>{Ir(!0);try{const B=await Be("/api/db/users/journey-stats");B!=null&&B.success&&B.stats&&bn(B.stats)}catch{}finally{Ir(!1)}},[]);return e.jsxs("div",{className:"p-8 w-full",children:[S&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:S}),e.jsx("button",{type:"button",onClick:()=>b(null),children:"×"})]}),e.jsx("div",{className:"flex justify-between items-center mb-6",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"用户管理"}),e.jsxs("p",{className:"text-gray-400 mt-1 text-sm",children:["共 ",l," 位注册用户",N&&" · RFM 排序中"]})]})}),e.jsxs(Al,{defaultValue:"users",className:"w-full",children:[e.jsxs(Fa,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-6 flex-wrap h-auto gap-1",children:[e.jsxs(Lt,{value:"users",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",children:[e.jsx(Qt,{className:"w-4 h-4"})," 用户列表"]}),e.jsxs(Lt,{value:"journey",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",onClick:Ne,children:[e.jsx(wa,{className:"w-4 h-4"})," 用户旅程总览"]}),e.jsxs(Lt,{value:"rules",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",onClick:qt,children:[e.jsx(Sa,{className:"w-4 h-4"})," 规则配置"]}),e.jsxs(Lt,{value:"vip-roles",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",onClick:ys,children:[e.jsx(kr,{className:"w-4 h-4"})," VIP 角色"]})]}),e.jsxs(Ot,{value:"users",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4 justify-end flex-wrap",children:[e.jsxs(q,{variant:"outline",onClick:Ps,disabled:P,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${P?"animate-spin":""}`})," 刷新"]}),e.jsxs("select",{value:v,onChange:B=>{C(B.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",disabled:N,children:[e.jsx("option",{value:"all",children:"全部用户"}),e.jsx("option",{value:"vip",children:"VIP会员"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(le,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-56",value:p,onChange:B=>y(B.target.value)})]}),e.jsxs(q,{onClick:Hn,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Gd,{className:"w-4 h-4 mr-2"})," 添加用户"]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:P?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs("div",{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"用户信息"}),e.jsx(be,{className:"text-gray-400",children:"绑定信息"}),e.jsx(be,{className:"text-gray-400",children:"购买状态"}),e.jsx(be,{className:"text-gray-400",children:"分销收益"}),e.jsxs(be,{className:"text-gray-400 cursor-pointer select-none",onClick:qs,children:[e.jsxs("div",{className:"flex items-center gap-1 group",children:[e.jsx(Ca,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"RFM分值"}),N?j==="desc"?e.jsx(Ta,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(pu,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Lj,{className:"w-3.5 h-3.5 text-gray-600 group-hover:text-gray-400"})]}),N&&e.jsx("div",{className:"text-[10px] text-[#38bdac] font-normal mt-0.5",children:"点击切换方向/关闭"})]}),e.jsx(be,{className:"text-gray-400",children:"注册时间"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(B=>{var We,Ge,at;return e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:B.avatar?e.jsx("img",{src:B.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((We=B.nickname)==null?void 0:We.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("p",{className:"font-medium text-white",children:B.nickname}),B.isAdmin&&e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),B.openId&&!((Ge=B.id)!=null&&Ge.startsWith("user_"))&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0 text-xs",children:"微信"})]}),e.jsx("p",{className:"text-xs text-gray-500 font-mono",children:B.openId?B.openId.slice(0,12)+"...":(at=B.id)==null?void 0:at.slice(0,12)})]})]})}),e.jsx(ye,{children:e.jsxs("div",{className:"space-y-1",children:[B.phone&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"📱"}),e.jsx("span",{className:"text-gray-300",children:B.phone})]}),B.wechatId&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"💬"}),e.jsx("span",{className:"text-gray-300",children:B.wechatId})]}),B.openId&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"🔗"}),e.jsxs("span",{className:"text-gray-500 truncate max-w-[100px]",title:B.openId,children:[B.openId.slice(0,12),"..."]})]}),!B.phone&&!B.wechatId&&!B.openId&&e.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),e.jsx(ye,{children:B.hasFullBook?e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),e.jsx(ye,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(B.earnings||0)).toFixed(2)]}),parseFloat(String(B.pendingEarnings||0))>0&&e.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(B.pendingEarnings||0)).toFixed(2)]}),e.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>_r(B),role:"button",tabIndex:0,onKeyDown:Ts=>Ts.key==="Enter"&&_r(B),children:[e.jsx(Qt,{className:"w-3 h-3"})," 绑定",B.referralCount||0,"人"]})]})}),e.jsx(ye,{children:B.rfmScore!==void 0?e.jsx("div",{className:"flex flex-col gap-1",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-white font-bold text-base",children:B.rfmScore}),e.jsx(Oe,{className:`border-0 text-xs ${Xs(B.rfmLevel)}`,children:B.rfmLevel})]})}):e.jsxs("span",{className:"text-gray-600 text-sm",children:["— ",e.jsx("span",{className:"text-xs text-gray-700",children:"点列头排序"})]})}),e.jsx(ye,{className:"text-gray-400",children:B.createdAt?new Date(B.createdAt).toLocaleDateString():"-"}),e.jsx(ye,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{Se(B),D(!0)},className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:e.jsx(kr,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{xe(B.id),de(!0)},className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:e.jsx(Cr,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>Wn(B),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>Yn(B),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:e.jsx(Ff,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>Vn(B.id),title:"删除",children:e.jsx(Wt,{className:"w-4 h-4"})})]})})]},B.id)}),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),e.jsx(Hs,{page:c,totalPages:Nn,total:l,pageSize:m,onPageChange:d,onPageSizeChange:B=>{f(B),d(1)}})]})})})]}),e.jsxs(Ot,{value:"journey",children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"用户从注册到 VIP 的完整行动路径,点击各阶段查看用户动态"}),e.jsxs(q,{variant:"outline",onClick:Ne,disabled:mr,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${mr?"animate-spin":""}`})," 刷新数据"]})]}),e.jsxs("div",{className:"relative mb-8",children:[e.jsx("div",{className:"absolute top-16 left-0 right-0 h-0.5 bg-gradient-to-r from-blue-500/20 via-[#38bdac]/30 to-amber-500/20 mx-20"}),e.jsx("div",{className:"grid grid-cols-4 gap-4 lg:grid-cols-8",children:qi.map((B,We)=>e.jsxs("div",{className:"relative flex flex-col items-center",children:[e.jsxs("div",{className:`relative w-full p-3 rounded-xl border ${B.color} text-center cursor-default`,children:[e.jsx("div",{className:"text-2xl mb-1",children:B.icon}),e.jsx("div",{className:`text-xs font-medium ${B.color.split(" ").find(Ge=>Ge.startsWith("text-"))}`,children:B.label}),hr[B.id]!==void 0&&e.jsxs("div",{className:"mt-1.5 text-xs text-gray-400",children:[e.jsx("span",{className:"font-bold text-white",children:hr[B.id]})," 人"]}),e.jsx("div",{className:"absolute -top-2.5 -left-2.5 w-5 h-5 rounded-full bg-[#0a1628] border border-gray-700 flex items-center justify-center text-[10px] text-gray-500",children:We+1})]}),Wee.jsxs("div",{className:"flex items-start gap-3 p-2 bg-[#0a1628] rounded",children:[e.jsx("span",{className:"text-[#38bdac] font-mono text-xs shrink-0 mt-0.5",children:B.step}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-300",children:B.action}),e.jsxs("p",{className:"text-gray-600 text-xs",children:["→ ",B.next]})]})]},B.step))})]}),e.jsxs("div",{className:"bg-[#0f2137] border border-gray-700/50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Ks,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"行为锚点统计"}),e.jsx("span",{className:"text-gray-500 text-xs ml-auto",children:"实时更新"})]}),mr?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx($e,{className:"w-5 h-5 text-[#38bdac] animate-spin"})}):Object.keys(hr).length>0?e.jsx("div",{className:"space-y-2",children:qi.map(B=>{const We=hr[B.id]||0,Ge=Math.max(...qi.map(Ts=>hr[Ts.id]||0),1),at=Math.round(We/Ge*100);return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-gray-500 text-xs w-20 shrink-0",children:[B.icon," ",B.label]}),e.jsx("div",{className:"flex-1 h-2 bg-[#0a1628] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#38bdac]/60 rounded-full transition-all",style:{width:`${at}%`}})}),e.jsx("span",{className:"text-gray-400 text-xs w-10 text-right",children:We})]},B.id)})}):e.jsx("div",{className:"text-center py-8",children:e.jsx("p",{className:"text-gray-500 text-sm",children:"点击「刷新数据」加载统计"})})]})]})]}),e.jsxs(Ot,{value:"rules",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"用户旅程引导规则,定义各行为节点的触发条件与引导内容"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(q,{variant:"outline",onClick:qt,disabled:tt,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${tt?"animate-spin":""}`})," 刷新"]}),e.jsxs(q,{onClick:()=>{dr(null),Cs({title:"",description:"",trigger:"",sort:0,enabled:!0}),ot(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"})," 添加规则"]})]})]}),tt?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"})}):Ze.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(Ks,{className:"w-12 h-12 text-[#38bdac]/30 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400 mb-4",children:"暂无规则(重启服务将自动写入10条默认规则)"}),e.jsxs(q,{onClick:qt,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($e,{className:"w-4 h-4 mr-2"})," 重新加载"]})]}):e.jsx("div",{className:"space-y-2",children:Ze.map(B=>e.jsx("div",{className:`p-4 rounded-lg border transition-all ${B.enabled?"bg-[#0f2137] border-gray-700/50":"bg-[#0a1628]/50 border-gray-700/30 opacity-55"}`,children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[e.jsx(mt,{className:"w-4 h-4 text-[#38bdac] shrink-0"}),e.jsx("span",{className:"text-white font-medium",children:B.title}),B.trigger&&e.jsxs(Oe,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/30 text-xs",children:["触发:",B.trigger]}),e.jsx(Oe,{className:`text-xs border-0 ${B.enabled?"bg-green-500/20 text-green-400":"bg-gray-500/20 text-gray-400"}`,children:B.enabled?"启用":"禁用"})]}),B.description&&e.jsx("p",{className:"text-gray-400 text-sm ml-6",children:B.description})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4 shrink-0",children:[e.jsx(dt,{checked:B.enabled,onCheckedChange:()=>Gn(B)}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{dr(B),Cs({title:B.title,description:B.description,trigger:B.trigger,sort:B.sort,enabled:B.enabled}),ot(!0)},className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>Js(B.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Wt,{className:"w-4 h-4"})})]})]})},B.id))})]}),e.jsxs(Ot,{value:"vip-roles",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"管理用户 VIP 角色分类,这些角色将在用户详情和会员展示中使用"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(q,{variant:"outline",onClick:ys,disabled:Mt,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${Mt?"animate-spin":""}`})," 刷新"]}),e.jsxs(q,{onClick:()=>{jn(null),Ls({name:"",sort:0}),ls(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"})," 添加角色"]})]})]}),Mt?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"})}):Kt.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(kr,{className:"w-12 h-12 text-amber-400/30 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400 mb-4",children:"暂无 VIP 角色"}),e.jsxs(q,{onClick:()=>{jn(null),Ls({name:"",sort:0}),ls(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"})," 添加第一个角色"]})]}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Kt.map(B=>e.jsxs("div",{className:"p-4 bg-[#0f2137] border border-amber-500/20 rounded-xl hover:border-amber-500/40 transition-all group",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(kr,{className:"w-4 h-4 text-amber-400"}),e.jsx("span",{className:"text-white font-medium",children:B.name})]}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{type:"button",onClick:()=>{jn(B),Ls({name:B.name,sort:B.sort}),ls(!0)},className:"text-gray-500 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:()=>ae(B.id),className:"text-gray-500 hover:text-red-400",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("p",{className:"text-gray-600 text-xs",children:["排序: ",B.sort]})]},B.id))})]})]}),e.jsx(St,{open:W,onOpenChange:U,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[I?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Gd,{className:"w-5 h-5 text-[#38bdac]"}),I?"编辑用户":"添加用户"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"手机号"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:Ie.phone,onChange:B=>Ue({...Ie,phone:B.target.value}),disabled:!!I})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"昵称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:Ie.nickname,onChange:B=>Ue({...Ie,nickname:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:I?"新密码 (留空则不修改)":"密码"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:I?"留空则不修改":"请输入密码",value:Ie.password,onChange:B=>Ue({...Ie,password:B.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ee,{className:"text-gray-300",children:"管理员权限"}),e.jsx(dt,{checked:Ie.isAdmin,onCheckedChange:B=>Ue({...Ie,isAdmin:B})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ee,{className:"text-gray-300",children:"已购全书"}),e.jsx(dt,{checked:Ie.hasFullBook,onCheckedChange:B=>Ue({...Ie,hasFullBook:B})})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>U(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:Kn,disabled:Y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),Y?"保存中...":"保存"]})]})]})}),e.jsx(St,{open:k,onOpenChange:A,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Ff,{className:"w-5 h-5 text-[#38bdac]"}),"修改密码"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["用户:",I==null?void 0:I.nickname]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",I==null?void 0:I.phone]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"新密码"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:ie,onChange:B=>oe(B.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"确认密码"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入",value:te,onChange:B=>J(B.target.value)})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>A(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:wn,disabled:Y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:Y?"保存中...":"确认修改"})]})]})}),e.jsx(St,{open:fe,onOpenChange:ot,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),ss?"编辑规则":"添加规则"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"规则标题 *"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:匹配后填写头像、付款1980需填写信息",value:Ht.title,onChange:B=>Cs({...Ht,title:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"规则描述"}),e.jsx(dn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[80px] resize-none",placeholder:"详细说明规则内容...",value:Ht.description,onChange:B=>Cs({...Ht,description:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"触发条件"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:完成匹配、付款后、注册时",value:Ht.trigger,onChange:B=>Cs({...Ht,trigger:B.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx(ee,{className:"text-gray-300",children:"启用状态"})}),e.jsx(dt,{checked:Ht.enabled,onCheckedChange:B=>Cs({...Ht,enabled:B})})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>ot(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:Mr,disabled:Y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),Y?"保存中...":"保存"]})]})]})}),e.jsx(St,{open:Un,onOpenChange:ls,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(kr,{className:"w-5 h-5 text-amber-400"}),ks?"编辑 VIP 角色":"添加 VIP 角色"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"角色名称 *"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:创业者、资源整合者、技术咖",value:Es.name,onChange:B=>Ls({...Es,name:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"排序(越小越前)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Es.sort,onChange:B=>Ls({...Es,sort:parseInt(B.target.value)||0})})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>ls(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:F,disabled:Y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),Y?"保存中...":"保存"]})]})]})}),e.jsx(St,{open:ve,onOpenChange:$,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系 - ",L==null?void 0:L.nickname]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-[#38bdac]",children:((Te=ce.stats)==null?void 0:Te.total)||0}),e.jsx("div",{className:"text-xs text-gray-400",children:"绑定总数"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-green-400",children:((ut=ce.stats)==null?void 0:ut.purchased)||0}),e.jsx("div",{className:"text-xs text-gray-400",children:"已付费"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-yellow-400",children:["¥",(((rs=ce.stats)==null?void 0:rs.earnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"累计收益"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-orange-400",children:["¥",(((nt=ce.stats)==null?void 0:nt.pendingEarnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),M?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx($e,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((is=ce.referrals)==null?void 0:is.length)??0)>0?e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(ce.referrals??[]).map((B,We)=>{var at;const Ge=B;return e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:((at=Ge.nickname)==null?void 0:at.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white text-sm",children:Ge.nickname}),e.jsx("div",{className:"text-xs text-gray-500",children:Ge.phone||(Ge.hasOpenId?"微信用户":"未绑定")})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[Ge.status==="vip"&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),Ge.status==="paid"&&e.jsxs(Oe,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",Ge.purchasedSections,"章"]}),Ge.status==="free"&&e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),e.jsx("span",{className:"text-xs text-gray-500",children:Ge.createdAt?new Date(Ge.createdAt).toLocaleDateString():""})]})]},Ge.id||We)})}):e.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),e.jsx(Dt,{children:e.jsx(q,{variant:"outline",onClick:()=>$(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),e.jsx(_2,{open:K,onClose:()=>de(!1),userId:G,onUserUpdated:Ps}),e.jsx(M2,{open:we,onClose:()=>{D(!1),Se(null)},userId:(ue==null?void 0:ue.id)??null,userNickname:ue==null?void 0:ue.nickname,onSaved:Ps})]})}function D2(){var we;const[r,a]=h.useState("overview"),[l,o]=h.useState([]),[c,d]=h.useState(null),[m,f]=h.useState([]),[p,y]=h.useState([]),[g,v]=h.useState([]),[C,P]=h.useState(!0),[T,S]=h.useState(null),[b,N]=h.useState(""),[E,j]=h.useState("all"),[R,W]=h.useState(1),[U,k]=h.useState(10),[A,I]=h.useState(0),[re,ie]=h.useState(new Set),[oe,te]=h.useState(null),[J,Y]=h.useState(""),[ne,ve]=h.useState(!1);h.useEffect(()=>{$()},[]),h.useEffect(()=>{W(1)},[r,E]),h.useEffect(()=>{ce(r)},[r]),h.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&ce(r,!0)},[R,U,E,b]);async function $(){S(null);try{const D=await Be("/api/admin/distribution/overview");D!=null&&D.success&&D.overview&&d(D.overview)}catch(D){console.error("[Admin] 概览接口异常:",D),S("加载概览失败")}try{const D=await Be("/api/db/users");v((D==null?void 0:D.users)||[])}catch(D){console.error("[Admin] 用户数据加载失败:",D)}}async function ce(D,ue=!1){var Se;if(!(!ue&&re.has(D))){P(!0);try{const Ie=g;switch(D){case"overview":break;case"orders":{try{const Ue=new URLSearchParams({page:String(R),pageSize:String(U),...E!=="all"&&{status:E},...b&&{search:b}}),Ze=await Be(`/api/orders?${Ue}`);if(Ze!=null&&Ze.success&&Ze.orders){const et=Ze.orders.map(tt=>{const pe=Ie.find(ot=>ot.id===tt.userId),fe=tt.referrerId?Ie.find(ot=>ot.id===tt.referrerId):null;return{...tt,amount:parseFloat(String(tt.amount))||0,userNickname:(pe==null?void 0:pe.nickname)||tt.userNickname||"未知用户",userPhone:(pe==null?void 0:pe.phone)||tt.userPhone||"-",referrerNickname:(fe==null?void 0:fe.nickname)||null,referrerCode:(fe==null?void 0:fe.referralCode)??null,type:tt.productType||tt.type}});o(et),I(Ze.total??et.length)}else o([]),I(0)}catch(Ue){console.error(Ue),S("加载订单失败"),o([])}break}case"bindings":{try{const Ue=new URLSearchParams({page:String(R),pageSize:String(U),...E!=="all"&&{status:E}}),Ze=await Be(`/api/db/distribution?${Ue}`);f((Ze==null?void 0:Ze.bindings)||[]),I((Ze==null?void 0:Ze.total)??((Se=Ze==null?void 0:Ze.bindings)==null?void 0:Se.length)??0)}catch(Ue){console.error(Ue),S("加载绑定数据失败"),f([])}break}case"withdrawals":{try{const Ue=E==="completed"?"success":E==="rejected"?"failed":E,Ze=new URLSearchParams({...Ue&&Ue!=="all"&&{status:Ue},page:String(R),pageSize:String(U)}),et=await Be(`/api/admin/withdrawals?${Ze}`);if(et!=null&&et.success&&et.withdrawals){const tt=et.withdrawals.map(pe=>({...pe,account:pe.account??"未绑定微信号",status:pe.status==="success"?"completed":pe.status==="failed"?"rejected":pe.status}));y(tt),I((et==null?void 0:et.total)??tt.length)}else et!=null&&et.success||S(`获取提现记录失败: ${(et==null?void 0:et.error)||"未知错误"}`),y([])}catch(Ue){console.error(Ue),S("加载提现数据失败"),y([])}break}}ie(Ue=>new Set(Ue).add(D))}catch(Ie){console.error(Ie)}finally{P(!1)}}}async function H(){S(null),ie(D=>{const ue=new Set(D);return ue.delete(r),ue}),r==="overview"&&$(),await ce(r,!0)}async function M(D){if(confirm("确认审核通过并打款?"))try{const ue=await gt("/api/admin/withdrawals",{id:D,action:"approve"});if(!(ue!=null&&ue.success)){const Se=(ue==null?void 0:ue.message)||(ue==null?void 0:ue.error)||"操作失败";alert(Se);return}await H()}catch(ue){console.error(ue),alert("操作失败")}}async function O(D){const ue=prompt("请输入拒绝原因:");if(ue)try{const Se=await gt("/api/admin/withdrawals",{id:D,action:"reject",errorMessage:ue});if(!(Se!=null&&Se.success)){alert((Se==null?void 0:Se.error)||"操作失败");return}await H()}catch(Se){console.error(Se),alert("操作失败")}}async function L(){var D;if(!(!(oe!=null&&oe.orderSn)&&!(oe!=null&&oe.id))){ve(!0),S(null);try{const ue=await gt("/api/admin/orders/refund",{orderSn:oe.orderSn||oe.id,reason:J||void 0});ue!=null&&ue.success?(te(null),Y(""),await ce("orders",!0)):S((ue==null?void 0:ue.error)||"退款失败")}catch(ue){const Se=ue;S(((D=Se==null?void 0:Se.data)==null?void 0:D.error)||"退款失败,请检查网络后重试")}finally{ve(!1)}}}function X(D){const ue={active:"bg-green-500/20 text-green-400",converted:"bg-blue-500/20 text-blue-400",expired:"bg-gray-500/20 text-gray-400",cancelled:"bg-red-500/20 text-red-400",pending:"bg-orange-500/20 text-orange-400",pending_confirm:"bg-orange-500/20 text-orange-400",processing:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400"},Se={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return e.jsx(Oe,{className:`${ue[D]||"bg-gray-500/20 text-gray-400"} border-0`,children:Se[D]||D})}const K=Math.ceil(A/U)||1,de=l,G=m.filter(D=>{var Se,Ie,Ue,Ze;if(!b)return!0;const ue=b.toLowerCase();return((Se=D.refereeNickname)==null?void 0:Se.toLowerCase().includes(ue))||((Ie=D.refereePhone)==null?void 0:Ie.includes(ue))||((Ue=D.referrerName)==null?void 0:Ue.toLowerCase().includes(ue))||((Ze=D.referrerCode)==null?void 0:Ze.toLowerCase().includes(ue))}),xe=p.filter(D=>{var Se;if(!b)return!0;const ue=b.toLowerCase();return((Se=D.userName)==null?void 0:Se.toLowerCase().includes(ue))||D.account&&D.account.toLowerCase().includes(ue)});return e.jsxs("div",{className:"p-8 w-full",children:[T&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:T}),e.jsx("button",{type:"button",onClick:()=>S(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"推广中心"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),e.jsxs(q,{onClick:H,disabled:C,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${C?"animate-spin":""}`}),"刷新数据"]})]}),e.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4",children:[{key:"overview",label:"数据概览",icon:Ca},{key:"orders",label:"订单管理",icon:no},{key:"bindings",label:"绑定管理",icon:ln},{key:"withdrawals",label:"提现审核",icon:Ra}].map(D=>e.jsxs("button",{type:"button",onClick:()=>{a(D.key),j("all"),N("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===D.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[e.jsx(D.icon,{className:"w-4 h-4"}),D.label]},D.key))}),C?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx($e,{className:"w-8 h-8 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[r==="overview"&&c&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"总点击次数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(Cr,{className:"w-6 h-6 text-blue-400"})})]})})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日独立用户"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayUniqueVisitors??0}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"去重访客数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-cyan-500/20 flex items-center justify-center",children:e.jsx(Qt,{className:"w-6 h-6 text-cyan-400"})})]})})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日总文章点击率"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:(c.todayClickRate??0).toFixed(2)}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"人均点击(总点击/独立用户)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-amber-500/20 flex items-center justify-center",children:e.jsx(Ca,{className:"w-6 h-6 text-amber-400"})})]})})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:e.jsx(ln,{className:"w-6 h-6 text-green-400"})})]})})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:e.jsx(Of,{className:"w-6 h-6 text-purple-400"})})]})})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),e.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:e.jsx(no,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),(((we=c.todayClicksByPage)==null?void 0:we.length)??0)>0&&e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Cr,{className:"w-5 h-5 text-[#38bdac]"}),"每篇文章今日点击(按来源页/文章统计)"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"实际用户与实际文章的点击均计入;今日总点击与上表一致"})]}),e.jsx(ke,{children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"pb-3 pr-4",children:"来源页/文章"}),e.jsx("th",{className:"pb-3 pr-4 text-right",children:"今日点击"}),e.jsx("th",{className:"pb-3 text-right",children:"占比"})]})}),e.jsx("tbody",{children:[...c.todayClicksByPage??[]].sort((D,ue)=>ue.clicks-D.clicks).map((D,ue)=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-4 text-white font-mono",children:D.page||"(未区分)"}),e.jsx("td",{className:"py-2 pr-4 text-right text-white",children:D.clicks}),e.jsxs("td",{className:"py-2 text-right text-gray-400",children:[c.todayClicks>0?(D.clicks/c.todayClicks*100).toFixed(1):0,"%"]})]},ue))})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Ce,{className:"bg-orange-500/10 border-orange-500/30",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:e.jsx(Wd,{className:"w-6 h-6 text-orange-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),e.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期,需关注转化"})]})]})})}),e.jsx(Ce,{className:"bg-blue-500/10 border-blue-500/30",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(Ra,{className:"w-6 h-6 text-blue-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),e.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),e.jsx(q,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(ro,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),e.jsx(ke,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Ca,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),e.jsxs(ke,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),e.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-300",children:"点击转化率"}),e.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),e.jsx(ke,{children:e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),r==="orders"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(le,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-0",children:[l.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"退款原因"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:de.map(D=>{var ue,Se;return e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsxs("td",{className:"p-4 font-mono text-xs text-gray-400",children:[(ue=D.id)==null?void 0:ue.slice(0,12),"..."]}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:D.userNickname}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.userPhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:(()=>{const Ie=D.productType||D.type;return Ie==="fullbook"?`${D.bookName||"《底层逻辑》"} - 全本`:Ie==="match"?"匹配次数购买":`${D.bookName||"《底层逻辑》"} - ${D.sectionTitle||D.chapterTitle||`章节${D.productId||D.sectionId||""}`}`})()}),e.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const Ie=D.productType||D.type;return Ie==="fullbook"?"全书解锁":Ie==="match"?"功能权益":D.chapterTitle||"单章购买"})()})]})}),e.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof D.amount=="number"?D.amount.toFixed(2):parseFloat(String(D.amount||"0")).toFixed(2)]}),e.jsx("td",{className:"p-4 text-gray-300",children:D.paymentMethod==="wechat"?"微信支付":D.paymentMethod==="alipay"?"支付宝":D.paymentMethod||"微信支付"}),e.jsx("td",{className:"p-4",children:D.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):D.status==="completed"||D.status==="paid"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):D.status==="pending"||D.status==="created"?e.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):e.jsx(Oe,{className:"bg-red-500/20 text-red-400 border-0",children:"已失败"})}),e.jsx("td",{className:"p-4 text-gray-400 text-sm max-w-[120px]",title:D.refundReason,children:D.status==="refunded"&&D.refundReason?D.refundReason:"-"}),e.jsx("td",{className:"p-4 text-gray-300 text-sm",children:D.referrerId||D.referralCode?e.jsxs("span",{title:D.referralCode||D.referrerCode||D.referrerId||"",children:[D.referrerNickname||D.referralCode||D.referrerCode||((Se=D.referrerId)==null?void 0:Se.slice(0,8)),(D.referralCode||D.referrerCode)&&` (${D.referralCode||D.referrerCode})`]}):"-"}),e.jsx("td",{className:"p-4 text-[#FFD700]",children:D.referrerEarnings?`¥${(typeof D.referrerEarnings=="number"?D.referrerEarnings:parseFloat(String(D.referrerEarnings))).toFixed(2)}`:"-"}),e.jsx("td",{className:"p-4 text-gray-400 text-sm",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:(D.status==="paid"||D.status==="completed")&&e.jsxs(q,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{te(D),Y("")},children:[e.jsx(Hx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},D.id)})})]})}),r==="orders"&&e.jsx(Hs,{page:R,totalPages:K,total:A,pageSize:U,onPageChange:W,onPageSizeChange:D=>{k(D),W(1)}})]})})]}),r==="bindings"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(le,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"active",children:"有效"}),e.jsx("option",{value:"converted",children:"已转化"}),e.jsx("option",{value:"expired",children:"已过期"})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-0",children:[G.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:G.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-medium",children:D.refereeNickname||"匿名用户"}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.refereePhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white",children:D.referrerName||"-"}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:D.referrerCode})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.boundAt?new Date(D.boundAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:D.expiresAt?new Date(D.expiresAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4",children:D.commission?e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",D.commission.toFixed(2)]}):e.jsx("span",{className:"text-gray-500",children:"-"})})]},D.id))})]})}),r==="bindings"&&e.jsx(Hs,{page:R,totalPages:K,total:A,pageSize:U,onPageChange:W,onPageSizeChange:D=>{k(D),W(1)}})]})})]}),r==="withdrawals"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(le,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"pending",children:"待审核"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-0",children:[xe.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:xe.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[D.userAvatar?e.jsx("img",{src:D.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(D.userName||D.name||"?").slice(0,1)}),e.jsx("p",{className:"text-white font-medium",children:D.userName||D.name})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",D.amount.toFixed(2)]})}),e.jsx("td",{className:"p-4",children:e.jsx(Oe,{className:D.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:D.method==="wechat"?"微信":"支付宝"})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-mono text-xs",children:D.account}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.name})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4 text-right",children:D.status==="pending"&&e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsxs(q,{size:"sm",onClick:()=>M(D.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Of,{className:"w-4 h-4 mr-1"}),"通过"]}),e.jsxs(q,{size:"sm",variant:"outline",onClick:()=>O(D.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[e.jsx($x,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},D.id))})]})}),r==="withdrawals"&&e.jsx(Hs,{page:R,totalPages:K,total:A,pageSize:U,onPageChange:W,onPageSizeChange:D=>{k(D),W(1)}})]})})]})]}),e.jsx(St,{open:!!oe,onOpenChange:D=>!D&&te(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:"订单退款"})}),oe&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",oe.orderSn||oe.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof oe.amount=="number"?oe.amount.toFixed(2):parseFloat(String(oe.amount||"0")).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:J,onChange:D=>Y(D.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>te(null),disabled:ne,children:"取消"}),e.jsx(q,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:L,disabled:ne,children:ne?"退款中...":"确认退款"})]})]})})]})}function L2(){const[r,a]=h.useState([]),[l,o]=h.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,d]=h.useState(!0),[m,f]=h.useState(null),[p,y]=h.useState("all"),[g,v]=h.useState(1),[C,P]=h.useState(10),[T,S]=h.useState(0),[b,N]=h.useState(null);async function E(){var k,A,I,re,ie,oe,te;d(!0),f(null);try{const J=new URLSearchParams({status:p,page:String(g),pageSize:String(C)}),Y=await Be(`/api/admin/withdrawals?${J}`);if(Y!=null&&Y.success){const ne=Y.withdrawals||[];a(ne),S(Y.total??((k=Y.stats)==null?void 0:k.total)??ne.length),o({total:((A=Y.stats)==null?void 0:A.total)??Y.total??ne.length,pendingCount:((I=Y.stats)==null?void 0:I.pendingCount)??0,pendingAmount:((re=Y.stats)==null?void 0:re.pendingAmount)??0,successCount:((ie=Y.stats)==null?void 0:ie.successCount)??0,successAmount:((oe=Y.stats)==null?void 0:oe.successAmount)??0,failedCount:((te=Y.stats)==null?void 0:te.failedCount)??0})}else f("加载提现记录失败")}catch(J){console.error("Load withdrawals error:",J),f("加载失败,请检查网络后重试")}finally{d(!1)}}h.useEffect(()=>{v(1)},[p]),h.useEffect(()=>{E()},[p,g,C]);const j=Math.ceil(T/C)||1;async function R(k){const A=r.find(I=>I.id===k);if(A!=null&&A.userCommissionInfo&&A.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${A.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 - -确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;N(k);try{const I=await gt("/api/admin/withdrawals",{id:k,action:"approve"});I!=null&&I.success?E():alert("操作失败: "+((I==null?void 0:I.error)??""))}catch{alert("操作失败")}finally{N(null)}}async function W(k){const A=prompt("请输入拒绝原因(将返还用户余额):");if(A){N(k);try{const I=await gt("/api/admin/withdrawals",{id:k,action:"reject",errorMessage:A});I!=null&&I.success?E():alert("操作失败: "+((I==null?void 0:I.error)??""))}catch{alert("操作失败")}finally{N(null)}}}function U(k){switch(k){case"pending":return e.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"pending_confirm":return e.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待用户确认"});case"processing":return e.jsx(Oe,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"已审批等待打款"});case"success":case"completed":return e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return e.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:k})}}return e.jsxs("div",{className:"p-8 w-full",children:[m&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:m}),e.jsx("button",{type:"button",onClick:()=>f(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-start mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),e.jsxs(q,{variant:"outline",onClick:E,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),e.jsx(Ce,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:e.jsx(ke,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(no,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),e.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",e.jsx("span",{className:"text-white font-medium",children:"90%"})]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),e.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),e.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),e.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),e.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(k=>e.jsx(q,{variant:p===k?"default":"outline",size:"sm",onClick:()=>y(k),className:p===k?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:k==="all"?"全部":k==="pending"?"待处理":k==="success"?"已完成":"已拒绝"},k))}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:c?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):r.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Ra,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"确认收款"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:r.map(k=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4 text-gray-400",children:new Date(k.createdAt??"").toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[k.userAvatar?e.jsx("img",{src:k.userAvatar,alt:k.userName??"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:(k.userName??"?").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-white",children:k.userName??"未知"}),e.jsx("p",{className:"text-xs text-gray-500",children:k.userPhone??k.referralCode??(k.userId??"").slice(0,10)})]})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(k.amount).toFixed(2)]})}),e.jsx("td",{className:"p-4",children:k.userCommissionInfo?e.jsxs("div",{className:"text-xs space-y-1",children:[e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",k.userCommissionInfo.totalCommission.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"已提现:"}),e.jsxs("span",{className:"text-gray-400",children:["¥",k.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"待审核:"}),e.jsxs("span",{className:"text-orange-400",children:["¥",k.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[e.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),e.jsxs("span",{className:k.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",k.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):e.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),e.jsxs("td",{className:"p-4",children:[U(k.status),k.errorMessage&&e.jsx("p",{className:"text-xs text-red-400 mt-1",children:k.errorMessage})]}),e.jsx("td",{className:"p-4 text-gray-400",children:k.processedAt?new Date(k.processedAt).toLocaleString():"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:k.userConfirmedAt?e.jsxs("span",{className:"text-green-400",title:k.userConfirmedAt,children:["已确认 ",new Date(k.userConfirmedAt).toLocaleString()]}):"-"}),e.jsxs("td",{className:"p-4 text-right",children:[(k.status==="pending"||k.status==="pending_confirm")&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs(q,{size:"sm",onClick:()=>R(k.id),disabled:b===k.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(jo,{className:"w-4 h-4 mr-1"}),"批准"]}),e.jsxs(q,{size:"sm",variant:"outline",onClick:()=>W(k.id),disabled:b===k.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(k.status==="success"||k.status==="completed")&&k.transactionId&&e.jsx("span",{className:"text-xs text-gray-500 font-mono",children:k.transactionId})]})]},k.id))})]})}),e.jsx(Hs,{page:g,totalPages:j,total:T,pageSize:C,onPageChange:v,onPageSizeChange:k=>{P(k),v(1)}})]})})})]})}function ho(r,[a,l]){return Math.min(l,Math.max(a,r))}const O2=["top","right","bottom","left"],hn=Math.min,ws=Math.max,mo=Math.round,Xi=Math.floor,ir=r=>({x:r,y:r}),F2={left:"right",right:"left",bottom:"top",top:"bottom"},z2={start:"end",end:"start"};function Zd(r,a,l){return ws(r,hn(a,l))}function Pr(r,a){return typeof r=="function"?r(a):r}function Tr(r){return r.split("-")[0]}function za(r){return r.split("-")[1]}function Au(r){return r==="x"?"y":"x"}function Du(r){return r==="y"?"height":"width"}const $2=new Set(["top","bottom"]);function lr(r){return $2.has(Tr(r))?"y":"x"}function Lu(r){return Au(lr(r))}function B2(r,a,l){l===void 0&&(l=!1);const o=za(r),c=Lu(r),d=Du(c);let m=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(m=fo(m)),[m,fo(m)]}function U2(r){const a=fo(r);return[eu(r),a,eu(a)]}function eu(r){return r.replace(/start|end/g,a=>z2[a])}const ox=["left","right"],cx=["right","left"],V2=["top","bottom"],W2=["bottom","top"];function H2(r,a,l){switch(r){case"top":case"bottom":return l?a?cx:ox:a?ox:cx;case"left":case"right":return a?V2:W2;default:return[]}}function K2(r,a,l,o){const c=za(r);let d=H2(Tr(r),l==="start",o);return c&&(d=d.map(m=>m+"-"+c),a&&(d=d.concat(d.map(eu)))),d}function fo(r){return r.replace(/left|right|bottom|top/g,a=>F2[a])}function Y2(r){return{top:0,right:0,bottom:0,left:0,...r}}function h0(r){return typeof r!="number"?Y2(r):{top:r,right:r,bottom:r,left:r}}function xo(r){const{x:a,y:l,width:o,height:c}=r;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function dx(r,a,l){let{reference:o,floating:c}=r;const d=lr(a),m=Lu(a),f=Du(m),p=Tr(a),y=d==="y",g=o.x+o.width/2-c.width/2,v=o.y+o.height/2-c.height/2,C=o[f]/2-c[f]/2;let P;switch(p){case"top":P={x:g,y:o.y-c.height};break;case"bottom":P={x:g,y:o.y+o.height};break;case"right":P={x:o.x+o.width,y:v};break;case"left":P={x:o.x-c.width,y:v};break;default:P={x:o.x,y:o.y}}switch(za(a)){case"start":P[m]-=C*(l&&y?-1:1);break;case"end":P[m]+=C*(l&&y?-1:1);break}return P}async function G2(r,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:d,rects:m,elements:f,strategy:p}=r,{boundary:y="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:C=!1,padding:P=0}=Pr(a,r),T=h0(P),b=f[C?v==="floating"?"reference":"floating":v],N=xo(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(b)))==null||l?b:b.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(f.floating)),boundary:y,rootBoundary:g,strategy:p})),E=v==="floating"?{x:o,y:c,width:m.floating.width,height:m.floating.height}:m.reference,j=await(d.getOffsetParent==null?void 0:d.getOffsetParent(f.floating)),R=await(d.isElement==null?void 0:d.isElement(j))?await(d.getScale==null?void 0:d.getScale(j))||{x:1,y:1}:{x:1,y:1},W=xo(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:E,offsetParent:j,strategy:p}):E);return{top:(N.top-W.top+T.top)/R.y,bottom:(W.bottom-N.bottom+T.bottom)/R.y,left:(N.left-W.left+T.left)/R.x,right:(W.right-N.right+T.right)/R.x}}const Q2=async(r,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:d=[],platform:m}=l,f=d.filter(Boolean),p=await(m.isRTL==null?void 0:m.isRTL(a));let y=await m.getElementRects({reference:r,floating:a,strategy:c}),{x:g,y:v}=dx(y,o,p),C=o,P={},T=0;for(let b=0;b({name:"arrow",options:r,async fn(a){const{x:l,y:o,placement:c,rects:d,platform:m,elements:f,middlewareData:p}=a,{element:y,padding:g=0}=Pr(r,a)||{};if(y==null)return{};const v=h0(g),C={x:l,y:o},P=Lu(c),T=Du(P),S=await m.getDimensions(y),b=P==="y",N=b?"top":"left",E=b?"bottom":"right",j=b?"clientHeight":"clientWidth",R=d.reference[T]+d.reference[P]-C[P]-d.floating[T],W=C[P]-d.reference[P],U=await(m.getOffsetParent==null?void 0:m.getOffsetParent(y));let k=U?U[j]:0;(!k||!await(m.isElement==null?void 0:m.isElement(U)))&&(k=f.floating[j]||d.floating[T]);const A=R/2-W/2,I=k/2-S[T]/2-1,re=hn(v[N],I),ie=hn(v[E],I),oe=re,te=k-S[T]-ie,J=k/2-S[T]/2+A,Y=Zd(oe,J,te),ne=!p.arrow&&za(c)!=null&&J!==Y&&d.reference[T]/2-(JJ<=0)){var ie,oe;const J=(((ie=d.flip)==null?void 0:ie.index)||0)+1,Y=k[J];if(Y&&(!(v==="alignment"?E!==lr(Y):!1)||re.every($=>lr($.placement)===E?$.overflows[0]>0:!0)))return{data:{index:J,overflows:re},reset:{placement:Y}};let ne=(oe=re.filter(ve=>ve.overflows[0]<=0).sort((ve,$)=>ve.overflows[1]-$.overflows[1])[0])==null?void 0:oe.placement;if(!ne)switch(P){case"bestFit":{var te;const ve=(te=re.filter($=>{if(U){const ce=lr($.placement);return ce===E||ce==="y"}return!0}).map($=>[$.placement,$.overflows.filter(ce=>ce>0).reduce((ce,H)=>ce+H,0)]).sort(($,ce)=>$[1]-ce[1])[0])==null?void 0:te[0];ve&&(ne=ve);break}case"initialPlacement":ne=f;break}if(c!==ne)return{reset:{placement:ne}}}return{}}}};function ux(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function hx(r){return O2.some(a=>r[a]>=0)}const J2=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...d}=Pr(r,a);switch(c){case"referenceHidden":{const m=await o.detectOverflow(a,{...d,elementContext:"reference"}),f=ux(m,l.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:hx(f)}}}case"escaped":{const m=await o.detectOverflow(a,{...d,altBoundary:!0}),f=ux(m,l.floating);return{data:{escapedOffsets:f,escaped:hx(f)}}}default:return{}}}}},m0=new Set(["left","top"]);async function Z2(r,a){const{placement:l,platform:o,elements:c}=r,d=await(o.isRTL==null?void 0:o.isRTL(c.floating)),m=Tr(l),f=za(l),p=lr(l)==="y",y=m0.has(m)?-1:1,g=d&&p?-1:1,v=Pr(a,r);let{mainAxis:C,crossAxis:P,alignmentAxis:T}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof T=="number"&&(P=f==="end"?T*-1:T),p?{x:P*g,y:C*y}:{x:C*y,y:P*g}}const e4=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,o;const{x:c,y:d,placement:m,middlewareData:f}=a,p=await Z2(a,r);return m===((l=f.offset)==null?void 0:l.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:c+p.x,y:d+p.y,data:{...p,placement:m}}}}},t4=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:o,placement:c,platform:d}=a,{mainAxis:m=!0,crossAxis:f=!1,limiter:p={fn:N=>{let{x:E,y:j}=N;return{x:E,y:j}}},...y}=Pr(r,a),g={x:l,y:o},v=await d.detectOverflow(a,y),C=lr(Tr(c)),P=Au(C);let T=g[P],S=g[C];if(m){const N=P==="y"?"top":"left",E=P==="y"?"bottom":"right",j=T+v[N],R=T-v[E];T=Zd(j,T,R)}if(f){const N=C==="y"?"top":"left",E=C==="y"?"bottom":"right",j=S+v[N],R=S-v[E];S=Zd(j,S,R)}const b=p.fn({...a,[P]:T,[C]:S});return{...b,data:{x:b.x-l,y:b.y-o,enabled:{[P]:m,[C]:f}}}}}},s4=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:o,placement:c,rects:d,middlewareData:m}=a,{offset:f=0,mainAxis:p=!0,crossAxis:y=!0}=Pr(r,a),g={x:l,y:o},v=lr(c),C=Au(v);let P=g[C],T=g[v];const S=Pr(f,a),b=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(p){const j=C==="y"?"height":"width",R=d.reference[C]-d.floating[j]+b.mainAxis,W=d.reference[C]+d.reference[j]-b.mainAxis;PW&&(P=W)}if(y){var N,E;const j=C==="y"?"width":"height",R=m0.has(Tr(c)),W=d.reference[v]-d.floating[j]+(R&&((N=m.offset)==null?void 0:N[v])||0)+(R?0:b.crossAxis),U=d.reference[v]+d.reference[j]+(R?0:((E=m.offset)==null?void 0:E[v])||0)-(R?b.crossAxis:0);TU&&(T=U)}return{[C]:P,[v]:T}}}},r4=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,o;const{placement:c,rects:d,platform:m,elements:f}=a,{apply:p=()=>{},...y}=Pr(r,a),g=await m.detectOverflow(a,y),v=Tr(c),C=za(c),P=lr(c)==="y",{width:T,height:S}=d.floating;let b,N;v==="top"||v==="bottom"?(b=v,N=C===(await(m.isRTL==null?void 0:m.isRTL(f.floating))?"start":"end")?"left":"right"):(N=v,b=C==="end"?"top":"bottom");const E=S-g.top-g.bottom,j=T-g.left-g.right,R=hn(S-g[b],E),W=hn(T-g[N],j),U=!a.middlewareData.shift;let k=R,A=W;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(A=j),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(k=E),U&&!C){const re=ws(g.left,0),ie=ws(g.right,0),oe=ws(g.top,0),te=ws(g.bottom,0);P?A=T-2*(re!==0||ie!==0?re+ie:ws(g.left,g.right)):k=S-2*(oe!==0||te!==0?oe+te:ws(g.top,g.bottom))}await p({...a,availableWidth:A,availableHeight:k});const I=await m.getDimensions(f.floating);return T!==I.width||S!==I.height?{reset:{rects:!0}}:{}}}};function Eo(){return typeof window<"u"}function $a(r){return f0(r)?(r.nodeName||"").toLowerCase():"#document"}function Ss(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function cr(r){var a;return(a=(f0(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function f0(r){return Eo()?r instanceof Node||r instanceof Ss(r).Node:!1}function Ys(r){return Eo()?r instanceof Element||r instanceof Ss(r).Element:!1}function or(r){return Eo()?r instanceof HTMLElement||r instanceof Ss(r).HTMLElement:!1}function mx(r){return!Eo()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Ss(r).ShadowRoot}const n4=new Set(["inline","contents"]);function Dl(r){const{overflow:a,overflowX:l,overflowY:o,display:c}=Gs(r);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!n4.has(c)}const a4=new Set(["table","td","th"]);function l4(r){return a4.has($a(r))}const i4=[":popover-open",":modal"];function Po(r){return i4.some(a=>{try{return r.matches(a)}catch{return!1}})}const o4=["transform","translate","scale","rotate","perspective"],c4=["transform","translate","scale","rotate","perspective","filter"],d4=["paint","layout","strict","content"];function Ou(r){const a=Fu(),l=Ys(r)?Gs(r):r;return o4.some(o=>l[o]?l[o]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||c4.some(o=>(l.willChange||"").includes(o))||d4.some(o=>(l.contain||"").includes(o))}function u4(r){let a=mn(r);for(;or(a)&&!_a(a);){if(Ou(a))return a;if(Po(a))return null;a=mn(a)}return null}function Fu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const h4=new Set(["html","body","#document"]);function _a(r){return h4.has($a(r))}function Gs(r){return Ss(r).getComputedStyle(r)}function To(r){return Ys(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function mn(r){if($a(r)==="html")return r;const a=r.assignedSlot||r.parentNode||mx(r)&&r.host||cr(r);return mx(a)?a.host:a}function x0(r){const a=mn(r);return _a(a)?r.ownerDocument?r.ownerDocument.body:r.body:or(a)&&Dl(a)?a:x0(a)}function Rl(r,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=x0(r),d=c===((o=r.ownerDocument)==null?void 0:o.body),m=Ss(c);if(d){const f=tu(m);return a.concat(m,m.visualViewport||[],Dl(c)?c:[],f&&l?Rl(f):[])}return a.concat(c,Rl(c,[],l))}function tu(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function p0(r){const a=Gs(r);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=or(r),d=c?r.offsetWidth:l,m=c?r.offsetHeight:o,f=mo(l)!==d||mo(o)!==m;return f&&(l=d,o=m),{width:l,height:o,$:f}}function zu(r){return Ys(r)?r:r.contextElement}function Pa(r){const a=zu(r);if(!or(a))return ir(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:d}=p0(a);let m=(d?mo(l.width):l.width)/o,f=(d?mo(l.height):l.height)/c;return(!m||!Number.isFinite(m))&&(m=1),(!f||!Number.isFinite(f))&&(f=1),{x:m,y:f}}const m4=ir(0);function g0(r){const a=Ss(r);return!Fu()||!a.visualViewport?m4:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function f4(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==Ss(r)?!1:a}function zn(r,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),d=zu(r);let m=ir(1);a&&(o?Ys(o)&&(m=Pa(o)):m=Pa(r));const f=f4(d,l,o)?g0(d):ir(0);let p=(c.left+f.x)/m.x,y=(c.top+f.y)/m.y,g=c.width/m.x,v=c.height/m.y;if(d){const C=Ss(d),P=o&&Ys(o)?Ss(o):o;let T=C,S=tu(T);for(;S&&o&&P!==T;){const b=Pa(S),N=S.getBoundingClientRect(),E=Gs(S),j=N.left+(S.clientLeft+parseFloat(E.paddingLeft))*b.x,R=N.top+(S.clientTop+parseFloat(E.paddingTop))*b.y;p*=b.x,y*=b.y,g*=b.x,v*=b.y,p+=j,y+=R,T=Ss(S),S=tu(T)}}return xo({width:g,height:v,x:p,y})}function Ro(r,a){const l=To(r).scrollLeft;return a?a.left+l:zn(cr(r)).left+l}function y0(r,a){const l=r.getBoundingClientRect(),o=l.left+a.scrollLeft-Ro(r,l),c=l.top+a.scrollTop;return{x:o,y:c}}function x4(r){let{elements:a,rect:l,offsetParent:o,strategy:c}=r;const d=c==="fixed",m=cr(o),f=a?Po(a.floating):!1;if(o===m||f&&d)return l;let p={scrollLeft:0,scrollTop:0},y=ir(1);const g=ir(0),v=or(o);if((v||!v&&!d)&&(($a(o)!=="body"||Dl(m))&&(p=To(o)),or(o))){const P=zn(o);y=Pa(o),g.x=P.x+o.clientLeft,g.y=P.y+o.clientTop}const C=m&&!v&&!d?y0(m,p):ir(0);return{width:l.width*y.x,height:l.height*y.y,x:l.x*y.x-p.scrollLeft*y.x+g.x+C.x,y:l.y*y.y-p.scrollTop*y.y+g.y+C.y}}function p4(r){return Array.from(r.getClientRects())}function g4(r){const a=cr(r),l=To(r),o=r.ownerDocument.body,c=ws(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),d=ws(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let m=-l.scrollLeft+Ro(r);const f=-l.scrollTop;return Gs(o).direction==="rtl"&&(m+=ws(a.clientWidth,o.clientWidth)-c),{width:c,height:d,x:m,y:f}}const fx=25;function y4(r,a){const l=Ss(r),o=cr(r),c=l.visualViewport;let d=o.clientWidth,m=o.clientHeight,f=0,p=0;if(c){d=c.width,m=c.height;const g=Fu();(!g||g&&a==="fixed")&&(f=c.offsetLeft,p=c.offsetTop)}const y=Ro(o);if(y<=0){const g=o.ownerDocument,v=g.body,C=getComputedStyle(v),P=g.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,T=Math.abs(o.clientWidth-v.clientWidth-P);T<=fx&&(d-=T)}else y<=fx&&(d+=y);return{width:d,height:m,x:f,y:p}}const v4=new Set(["absolute","fixed"]);function j4(r,a){const l=zn(r,!0,a==="fixed"),o=l.top+r.clientTop,c=l.left+r.clientLeft,d=or(r)?Pa(r):ir(1),m=r.clientWidth*d.x,f=r.clientHeight*d.y,p=c*d.x,y=o*d.y;return{width:m,height:f,x:p,y}}function xx(r,a,l){let o;if(a==="viewport")o=y4(r,l);else if(a==="document")o=g4(cr(r));else if(Ys(a))o=j4(a,l);else{const c=g0(r);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return xo(o)}function v0(r,a){const l=mn(r);return l===a||!Ys(l)||_a(l)?!1:Gs(l).position==="fixed"||v0(l,a)}function b4(r,a){const l=a.get(r);if(l)return l;let o=Rl(r,[],!1).filter(f=>Ys(f)&&$a(f)!=="body"),c=null;const d=Gs(r).position==="fixed";let m=d?mn(r):r;for(;Ys(m)&&!_a(m);){const f=Gs(m),p=Ou(m);!p&&f.position==="fixed"&&(c=null),(d?!p&&!c:!p&&f.position==="static"&&!!c&&v4.has(c.position)||Dl(m)&&!p&&v0(r,m))?o=o.filter(g=>g!==m):c=f,m=mn(m)}return a.set(r,o),o}function N4(r){let{element:a,boundary:l,rootBoundary:o,strategy:c}=r;const m=[...l==="clippingAncestors"?Po(a)?[]:b4(a,this._c):[].concat(l),o],f=m[0],p=m.reduce((y,g)=>{const v=xx(a,g,c);return y.top=ws(v.top,y.top),y.right=hn(v.right,y.right),y.bottom=hn(v.bottom,y.bottom),y.left=ws(v.left,y.left),y},xx(a,f,c));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function w4(r){const{width:a,height:l}=p0(r);return{width:a,height:l}}function S4(r,a,l){const o=or(a),c=cr(a),d=l==="fixed",m=zn(r,!0,d,a);let f={scrollLeft:0,scrollTop:0};const p=ir(0);function y(){p.x=Ro(c)}if(o||!o&&!d)if(($a(a)!=="body"||Dl(c))&&(f=To(a)),o){const P=zn(a,!0,d,a);p.x=P.x+a.clientLeft,p.y=P.y+a.clientTop}else c&&y();d&&!o&&c&&y();const g=c&&!o&&!d?y0(c,f):ir(0),v=m.left+f.scrollLeft-p.x-g.x,C=m.top+f.scrollTop-p.y-g.y;return{x:v,y:C,width:m.width,height:m.height}}function Ld(r){return Gs(r).position==="static"}function px(r,a){if(!or(r)||Gs(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return cr(r)===l&&(l=l.ownerDocument.body),l}function j0(r,a){const l=Ss(r);if(Po(r))return l;if(!or(r)){let c=mn(r);for(;c&&!_a(c);){if(Ys(c)&&!Ld(c))return c;c=mn(c)}return l}let o=px(r,a);for(;o&&l4(o)&&Ld(o);)o=px(o,a);return o&&_a(o)&&Ld(o)&&!Ou(o)?l:o||u4(r)||l}const C4=async function(r){const a=this.getOffsetParent||j0,l=this.getDimensions,o=await l(r.floating);return{reference:S4(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function k4(r){return Gs(r).direction==="rtl"}const E4={convertOffsetParentRelativeRectToViewportRelativeRect:x4,getDocumentElement:cr,getClippingRect:N4,getOffsetParent:j0,getElementRects:C4,getClientRects:p4,getDimensions:w4,getScale:Pa,isElement:Ys,isRTL:k4};function b0(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function P4(r,a){let l=null,o;const c=cr(r);function d(){var f;clearTimeout(o),(f=l)==null||f.disconnect(),l=null}function m(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),d();const y=r.getBoundingClientRect(),{left:g,top:v,width:C,height:P}=y;if(f||a(),!C||!P)return;const T=Xi(v),S=Xi(c.clientWidth-(g+C)),b=Xi(c.clientHeight-(v+P)),N=Xi(g),j={rootMargin:-T+"px "+-S+"px "+-b+"px "+-N+"px",threshold:ws(0,hn(1,p))||1};let R=!0;function W(U){const k=U[0].intersectionRatio;if(k!==p){if(!R)return m();k?m(!1,k):o=setTimeout(()=>{m(!1,1e-7)},1e3)}k===1&&!b0(y,r.getBoundingClientRect())&&m(),R=!1}try{l=new IntersectionObserver(W,{...j,root:c.ownerDocument})}catch{l=new IntersectionObserver(W,j)}l.observe(r)}return m(!0),d}function T4(r,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:p=!1}=o,y=zu(r),g=c||d?[...y?Rl(y):[],...Rl(a)]:[];g.forEach(N=>{c&&N.addEventListener("scroll",l,{passive:!0}),d&&N.addEventListener("resize",l)});const v=y&&f?P4(y,l):null;let C=-1,P=null;m&&(P=new ResizeObserver(N=>{let[E]=N;E&&E.target===y&&P&&(P.unobserve(a),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var j;(j=P)==null||j.observe(a)})),l()}),y&&!p&&P.observe(y),P.observe(a));let T,S=p?zn(r):null;p&&b();function b(){const N=zn(r);S&&!b0(S,N)&&l(),S=N,T=requestAnimationFrame(b)}return l(),()=>{var N;g.forEach(E=>{c&&E.removeEventListener("scroll",l),d&&E.removeEventListener("resize",l)}),v==null||v(),(N=P)==null||N.disconnect(),P=null,p&&cancelAnimationFrame(T)}}const R4=e4,I4=t4,_4=X2,M4=r4,A4=J2,gx=q2,D4=s4,L4=(r,a,l)=>{const o=new Map,c={platform:E4,...l},d={...c.platform,_c:o};return Q2(r,a,{...c,platform:d})};var O4=typeof document<"u",F4=function(){},to=O4?h.useLayoutEffect:F4;function po(r,a){if(r===a)return!0;if(typeof r!=typeof a)return!1;if(typeof r=="function"&&r.toString()===a.toString())return!0;let l,o,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!po(r[o],a[o]))return!1;return!0}if(c=Object.keys(r),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const d=c[o];if(!(d==="_owner"&&r.$$typeof)&&!po(r[d],a[d]))return!1}return!0}return r!==r&&a!==a}function N0(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function yx(r,a){const l=N0(r);return Math.round(a*l)/l}function Od(r){const a=h.useRef(r);return to(()=>{a.current=r}),a}function z4(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:d,floating:m}={},transform:f=!0,whileElementsMounted:p,open:y}=r,[g,v]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[C,P]=h.useState(o);po(C,o)||P(o);const[T,S]=h.useState(null),[b,N]=h.useState(null),E=h.useCallback($=>{$!==U.current&&(U.current=$,S($))},[]),j=h.useCallback($=>{$!==k.current&&(k.current=$,N($))},[]),R=d||T,W=m||b,U=h.useRef(null),k=h.useRef(null),A=h.useRef(g),I=p!=null,re=Od(p),ie=Od(c),oe=Od(y),te=h.useCallback(()=>{if(!U.current||!k.current)return;const $={placement:a,strategy:l,middleware:C};ie.current&&($.platform=ie.current),L4(U.current,k.current,$).then(ce=>{const H={...ce,isPositioned:oe.current!==!1};J.current&&!po(A.current,H)&&(A.current=H,Il.flushSync(()=>{v(H)}))})},[C,a,l,ie,oe]);to(()=>{y===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,v($=>({...$,isPositioned:!1})))},[y]);const J=h.useRef(!1);to(()=>(J.current=!0,()=>{J.current=!1}),[]),to(()=>{if(R&&(U.current=R),W&&(k.current=W),R&&W){if(re.current)return re.current(R,W,te);te()}},[R,W,te,re,I]);const Y=h.useMemo(()=>({reference:U,floating:k,setReference:E,setFloating:j}),[E,j]),ne=h.useMemo(()=>({reference:R,floating:W}),[R,W]),ve=h.useMemo(()=>{const $={position:l,left:0,top:0};if(!ne.floating)return $;const ce=yx(ne.floating,g.x),H=yx(ne.floating,g.y);return f?{...$,transform:"translate("+ce+"px, "+H+"px)",...N0(ne.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:ce,top:H}},[l,f,ne.floating,g.x,g.y]);return h.useMemo(()=>({...g,update:te,refs:Y,elements:ne,floatingStyles:ve}),[g,te,Y,ne,ve])}const $4=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:o,padding:c}=typeof r=="function"?r(l):r;return o&&a(o)?o.current!=null?gx({element:o.current,padding:c}).fn(l):{}:o?gx({element:o,padding:c}).fn(l):{}}}},B4=(r,a)=>({...R4(r),options:[r,a]}),U4=(r,a)=>({...I4(r),options:[r,a]}),V4=(r,a)=>({...D4(r),options:[r,a]}),W4=(r,a)=>({..._4(r),options:[r,a]}),H4=(r,a)=>({...M4(r),options:[r,a]}),K4=(r,a)=>({...A4(r),options:[r,a]}),Y4=(r,a)=>({...$4(r),options:[r,a]});var G4="Arrow",w0=h.forwardRef((r,a)=>{const{children:l,width:o=10,height:c=5,...d}=r;return e.jsx(qe.svg,{...d,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});w0.displayName=G4;var Q4=w0,$u="Popper",[S0,C0]=pn($u),[q4,k0]=S0($u),E0=r=>{const{__scopePopper:a,children:l}=r,[o,c]=h.useState(null);return e.jsx(q4,{scope:a,anchor:o,onAnchorChange:c,children:l})};E0.displayName=$u;var P0="PopperAnchor",T0=h.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:o,...c}=r,d=k0(P0,l),m=h.useRef(null),f=lt(a,m),p=h.useRef(null);return h.useEffect(()=>{const y=p.current;p.current=(o==null?void 0:o.current)||m.current,y!==p.current&&d.onAnchorChange(p.current)}),o?null:e.jsx(qe.div,{...c,ref:f})});T0.displayName=P0;var Bu="PopperContent",[X4,J4]=S0(Bu),R0=h.forwardRef((r,a)=>{var G,xe,we,D,ue,Se;const{__scopePopper:l,side:o="bottom",sideOffset:c=0,align:d="center",alignOffset:m=0,arrowPadding:f=0,avoidCollisions:p=!0,collisionBoundary:y=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:C=!1,updatePositionStrategy:P="optimized",onPlaced:T,...S}=r,b=k0(Bu,l),[N,E]=h.useState(null),j=lt(a,Ie=>E(Ie)),[R,W]=h.useState(null),U=Mu(R),k=(U==null?void 0:U.width)??0,A=(U==null?void 0:U.height)??0,I=o+(d!=="center"?"-"+d:""),re=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},ie=Array.isArray(y)?y:[y],oe=ie.length>0,te={padding:re,boundary:ie.filter(eS),altBoundary:oe},{refs:J,floatingStyles:Y,placement:ne,isPositioned:ve,middlewareData:$}=z4({strategy:"fixed",placement:I,whileElementsMounted:(...Ie)=>T4(...Ie,{animationFrame:P==="always"}),elements:{reference:b.anchor},middleware:[B4({mainAxis:c+A,alignmentAxis:m}),p&&U4({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?V4():void 0,...te}),p&&W4({...te}),H4({...te,apply:({elements:Ie,rects:Ue,availableWidth:Ze,availableHeight:et})=>{const{width:tt,height:pe}=Ue.reference,fe=Ie.floating.style;fe.setProperty("--radix-popper-available-width",`${Ze}px`),fe.setProperty("--radix-popper-available-height",`${et}px`),fe.setProperty("--radix-popper-anchor-width",`${tt}px`),fe.setProperty("--radix-popper-anchor-height",`${pe}px`)}}),R&&Y4({element:R,padding:f}),tS({arrowWidth:k,arrowHeight:A}),C&&K4({strategy:"referenceHidden",...te})]}),[ce,H]=M0(ne),M=un(T);ts(()=>{ve&&(M==null||M())},[ve,M]);const O=(G=$.arrow)==null?void 0:G.x,L=(xe=$.arrow)==null?void 0:xe.y,X=((we=$.arrow)==null?void 0:we.centerOffset)!==0,[K,de]=h.useState();return ts(()=>{N&&de(window.getComputedStyle(N).zIndex)},[N]),e.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:ve?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(D=$.transformOrigin)==null?void 0:D.x,(ue=$.transformOrigin)==null?void 0:ue.y].join(" "),...((Se=$.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:e.jsx(X4,{scope:l,placedSide:ce,onArrowChange:W,arrowX:O,arrowY:L,shouldHideArrow:X,children:e.jsx(qe.div,{"data-side":ce,"data-align":H,...S,ref:j,style:{...S.style,animation:ve?void 0:"none"}})})})});R0.displayName=Bu;var I0="PopperArrow",Z4={top:"bottom",right:"left",bottom:"top",left:"right"},_0=h.forwardRef(function(a,l){const{__scopePopper:o,...c}=a,d=J4(I0,o),m=Z4[d.placedSide];return e.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:e.jsx(Q4,{...c,ref:l,style:{...c.style,display:"block"}})})});_0.displayName=I0;function eS(r){return r!==null}var tS=r=>({name:"transformOrigin",options:r,fn(a){var b,N,E;const{placement:l,rects:o,middlewareData:c}=a,m=((b=c.arrow)==null?void 0:b.centerOffset)!==0,f=m?0:r.arrowWidth,p=m?0:r.arrowHeight,[y,g]=M0(l),v={start:"0%",center:"50%",end:"100%"}[g],C=(((N=c.arrow)==null?void 0:N.x)??0)+f/2,P=(((E=c.arrow)==null?void 0:E.y)??0)+p/2;let T="",S="";return y==="bottom"?(T=m?v:`${C}px`,S=`${-p}px`):y==="top"?(T=m?v:`${C}px`,S=`${o.floating.height+p}px`):y==="right"?(T=`${-p}px`,S=m?v:`${P}px`):y==="left"&&(T=`${o.floating.width+p}px`,S=m?v:`${P}px`),{data:{x:T,y:S}}}});function M0(r){const[a,l="center"]=r.split("-");return[a,l]}var sS=E0,rS=T0,nS=R0,aS=_0,A0=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),lS="VisuallyHidden",iS=h.forwardRef((r,a)=>e.jsx(qe.span,{...r,ref:a,style:{...A0,...r.style}}));iS.displayName=lS;var oS=[" ","Enter","ArrowUp","ArrowDown"],cS=[" ","Enter"],$n="Select",[Io,_o,dS]=Ru($n),[Ba]=pn($n,[dS,C0]),Mo=C0(),[uS,gn]=Ba($n),[hS,mS]=Ba($n),D0=r=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:d,value:m,defaultValue:f,onValueChange:p,dir:y,name:g,autoComplete:v,disabled:C,required:P,form:T}=r,S=Mo(a),[b,N]=h.useState(null),[E,j]=h.useState(null),[R,W]=h.useState(!1),U=So(y),[k,A]=On({prop:o,defaultProp:c??!1,onChange:d,caller:$n}),[I,re]=On({prop:m,defaultProp:f,onChange:p,caller:$n}),ie=h.useRef(null),oe=b?T||!!b.closest("form"):!0,[te,J]=h.useState(new Set),Y=Array.from(te).map(ne=>ne.props.value).join(";");return e.jsx(sS,{...S,children:e.jsxs(uS,{required:P,scope:a,trigger:b,onTriggerChange:N,valueNode:E,onValueNodeChange:j,valueNodeHasChildren:R,onValueNodeHasChildrenChange:W,contentId:cn(),value:I,onValueChange:re,open:k,onOpenChange:A,dir:U,triggerPointerDownPosRef:ie,disabled:C,children:[e.jsx(Io.Provider,{scope:a,children:e.jsx(hS,{scope:r.__scopeSelect,onNativeOptionAdd:h.useCallback(ne=>{J(ve=>new Set(ve).add(ne))},[]),onNativeOptionRemove:h.useCallback(ne=>{J(ve=>{const $=new Set(ve);return $.delete(ne),$})},[]),children:l})}),oe?e.jsxs(rg,{"aria-hidden":!0,required:P,tabIndex:-1,name:g,autoComplete:v,value:I,onChange:ne=>re(ne.target.value),disabled:C,form:T,children:[I===void 0?e.jsx("option",{value:""}):null,Array.from(te)]},Y):null]})})};D0.displayName=$n;var L0="SelectTrigger",O0=h.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=r,d=Mo(l),m=gn(L0,l),f=m.disabled||o,p=lt(a,m.onTriggerChange),y=_o(l),g=h.useRef("touch"),[v,C,P]=ag(S=>{const b=y().filter(j=>!j.disabled),N=b.find(j=>j.value===m.value),E=lg(b,S,N);E!==void 0&&m.onValueChange(E.value)}),T=S=>{f||(m.onOpenChange(!0),P()),S&&(m.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return e.jsx(rS,{asChild:!0,...d,children:e.jsx(qe.button,{type:"button",role:"combobox","aria-controls":m.contentId,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":ng(m.value)?"":void 0,...c,ref:p,onClick:He(c.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&T(S)}),onPointerDown:He(c.onPointerDown,S=>{g.current=S.pointerType;const b=S.target;b.hasPointerCapture(S.pointerId)&&b.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(T(S),S.preventDefault())}),onKeyDown:He(c.onKeyDown,S=>{const b=v.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&C(S.key),!(b&&S.key===" ")&&oS.includes(S.key)&&(T(),S.preventDefault())})})})});O0.displayName=L0;var F0="SelectValue",z0=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,children:d,placeholder:m="",...f}=r,p=gn(F0,l),{onValueNodeHasChildrenChange:y}=p,g=d!==void 0,v=lt(a,p.onValueNodeChange);return ts(()=>{y(g)},[y,g]),e.jsx(qe.span,{...f,ref:v,style:{pointerEvents:"none"},children:ng(p.value)?e.jsx(e.Fragment,{children:m}):d})});z0.displayName=F0;var fS="SelectIcon",$0=h.forwardRef((r,a)=>{const{__scopeSelect:l,children:o,...c}=r;return e.jsx(qe.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});$0.displayName=fS;var xS="SelectPortal",B0=r=>e.jsx(Su,{asChild:!0,...r});B0.displayName=xS;var Bn="SelectContent",U0=h.forwardRef((r,a)=>{const l=gn(Bn,r.__scopeSelect),[o,c]=h.useState();if(ts(()=>{c(new DocumentFragment)},[]),!l.open){const d=o;return d?Il.createPortal(e.jsx(V0,{scope:r.__scopeSelect,children:e.jsx(Io.Slot,{scope:r.__scopeSelect,children:e.jsx("div",{children:r.children})})}),d):null}return e.jsx(W0,{...r,ref:a})});U0.displayName=Bn;var Ws=10,[V0,yn]=Ba(Bn),pS="SelectContentImpl",gS=Tl("SelectContent.RemoveScroll"),W0=h.forwardRef((r,a)=>{const{__scopeSelect:l,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:m,side:f,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:C,collisionPadding:P,sticky:T,hideWhenDetached:S,avoidCollisions:b,...N}=r,E=gn(Bn,l),[j,R]=h.useState(null),[W,U]=h.useState(null),k=lt(a,G=>R(G)),[A,I]=h.useState(null),[re,ie]=h.useState(null),oe=_o(l),[te,J]=h.useState(!1),Y=h.useRef(!1);h.useEffect(()=>{if(j)return Np(j)},[j]),mp();const ne=h.useCallback(G=>{const[xe,...we]=oe().map(Se=>Se.ref.current),[D]=we.slice(-1),ue=document.activeElement;for(const Se of G)if(Se===ue||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===xe&&W&&(W.scrollTop=0),Se===D&&W&&(W.scrollTop=W.scrollHeight),Se==null||Se.focus(),document.activeElement!==ue))return},[oe,W]),ve=h.useCallback(()=>ne([A,j]),[ne,A,j]);h.useEffect(()=>{te&&ve()},[te,ve]);const{onOpenChange:$,triggerPointerDownPosRef:ce}=E;h.useEffect(()=>{if(j){let G={x:0,y:0};const xe=D=>{var ue,Se;G={x:Math.abs(Math.round(D.pageX)-(((ue=ce.current)==null?void 0:ue.x)??0)),y:Math.abs(Math.round(D.pageY)-(((Se=ce.current)==null?void 0:Se.y)??0))}},we=D=>{G.x<=10&&G.y<=10?D.preventDefault():j.contains(D.target)||$(!1),document.removeEventListener("pointermove",xe),ce.current=null};return ce.current!==null&&(document.addEventListener("pointermove",xe),document.addEventListener("pointerup",we,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",we,{capture:!0})}}},[j,$,ce]),h.useEffect(()=>{const G=()=>$(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[$]);const[H,M]=ag(G=>{const xe=oe().filter(ue=>!ue.disabled),we=xe.find(ue=>ue.ref.current===document.activeElement),D=lg(xe,G,we);D&&setTimeout(()=>D.ref.current.focus())}),O=h.useCallback((G,xe,we)=>{const D=!Y.current&&!we;(E.value!==void 0&&E.value===xe||D)&&(I(G),D&&(Y.current=!0))},[E.value]),L=h.useCallback(()=>j==null?void 0:j.focus(),[j]),X=h.useCallback((G,xe,we)=>{const D=!Y.current&&!we;(E.value!==void 0&&E.value===xe||D)&&ie(G)},[E.value]),K=o==="popper"?su:H0,de=K===su?{side:f,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:C,collisionPadding:P,sticky:T,hideWhenDetached:S,avoidCollisions:b}:{};return e.jsx(V0,{scope:l,content:j,viewport:W,onViewportChange:U,itemRefCallback:O,selectedItem:A,onItemLeave:L,itemTextRefCallback:X,focusSelectedItem:ve,selectedItemText:re,position:o,isPositioned:te,searchRef:H,children:e.jsx(Cu,{as:gS,allowPinchZoom:!0,children:e.jsx(wu,{asChild:!0,trapped:E.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:He(c,G=>{var xe;(xe=E.trigger)==null||xe.focus({preventScroll:!0}),G.preventDefault()}),children:e.jsx(Nu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:e.jsx(K,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:G=>G.preventDefault(),...N,...de,onPlaced:()=>J(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:He(N.onKeyDown,G=>{const xe=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!xe&&G.key.length===1&&M(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let D=oe().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);if(["ArrowUp","End"].includes(G.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const ue=G.target,Se=D.indexOf(ue);D=D.slice(Se+1)}setTimeout(()=>ne(D)),G.preventDefault()}})})})})})})});W0.displayName=pS;var yS="SelectItemAlignedPosition",H0=h.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=r,d=gn(Bn,l),m=yn(Bn,l),[f,p]=h.useState(null),[y,g]=h.useState(null),v=lt(a,k=>g(k)),C=_o(l),P=h.useRef(!1),T=h.useRef(!0),{viewport:S,selectedItem:b,selectedItemText:N,focusSelectedItem:E}=m,j=h.useCallback(()=>{if(d.trigger&&d.valueNode&&f&&y&&S&&b&&N){const k=d.trigger.getBoundingClientRect(),A=y.getBoundingClientRect(),I=d.valueNode.getBoundingClientRect(),re=N.getBoundingClientRect();if(d.dir!=="rtl"){const ue=re.left-A.left,Se=I.left-ue,Ie=k.left-Se,Ue=k.width+Ie,Ze=Math.max(Ue,A.width),et=window.innerWidth-Ws,tt=ho(Se,[Ws,Math.max(Ws,et-Ze)]);f.style.minWidth=Ue+"px",f.style.left=tt+"px"}else{const ue=A.right-re.right,Se=window.innerWidth-I.right-ue,Ie=window.innerWidth-k.right-Se,Ue=k.width+Ie,Ze=Math.max(Ue,A.width),et=window.innerWidth-Ws,tt=ho(Se,[Ws,Math.max(Ws,et-Ze)]);f.style.minWidth=Ue+"px",f.style.right=tt+"px"}const ie=C(),oe=window.innerHeight-Ws*2,te=S.scrollHeight,J=window.getComputedStyle(y),Y=parseInt(J.borderTopWidth,10),ne=parseInt(J.paddingTop,10),ve=parseInt(J.borderBottomWidth,10),$=parseInt(J.paddingBottom,10),ce=Y+ne+te+$+ve,H=Math.min(b.offsetHeight*5,ce),M=window.getComputedStyle(S),O=parseInt(M.paddingTop,10),L=parseInt(M.paddingBottom,10),X=k.top+k.height/2-Ws,K=oe-X,de=b.offsetHeight/2,G=b.offsetTop+de,xe=Y+ne+G,we=ce-xe;if(xe<=X){const ue=ie.length>0&&b===ie[ie.length-1].ref.current;f.style.bottom="0px";const Se=y.clientHeight-S.offsetTop-S.offsetHeight,Ie=Math.max(K,de+(ue?L:0)+Se+ve),Ue=xe+Ie;f.style.height=Ue+"px"}else{const ue=ie.length>0&&b===ie[0].ref.current;f.style.top="0px";const Ie=Math.max(X,Y+S.offsetTop+(ue?O:0)+de)+we;f.style.height=Ie+"px",S.scrollTop=xe-X+S.offsetTop}f.style.margin=`${Ws}px 0`,f.style.minHeight=H+"px",f.style.maxHeight=oe+"px",o==null||o(),requestAnimationFrame(()=>P.current=!0)}},[C,d.trigger,d.valueNode,f,y,S,b,N,d.dir,o]);ts(()=>j(),[j]);const[R,W]=h.useState();ts(()=>{y&&W(window.getComputedStyle(y).zIndex)},[y]);const U=h.useCallback(k=>{k&&T.current===!0&&(j(),E==null||E(),T.current=!1)},[j,E]);return e.jsx(jS,{scope:l,contentWrapper:f,shouldExpandOnScrollRef:P,onScrollButtonChange:U,children:e.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:e.jsx(qe.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});H0.displayName=yS;var vS="SelectPopperPosition",su=h.forwardRef((r,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=Ws,...d}=r,m=Mo(l);return e.jsx(nS,{...m,...d,ref:a,align:o,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});su.displayName=vS;var[jS,Uu]=Ba(Bn,{}),ru="SelectViewport",K0=h.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:o,...c}=r,d=yn(ru,l),m=Uu(ru,l),f=lt(a,d.onViewportChange),p=h.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),e.jsx(Io.Slot,{scope:l,children:e.jsx(qe.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:He(c.onScroll,y=>{const g=y.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:C}=m;if(C!=null&&C.current&&v){const P=Math.abs(p.current-g.scrollTop);if(P>0){const T=window.innerHeight-Ws*2,S=parseFloat(v.style.minHeight),b=parseFloat(v.style.height),N=Math.max(S,b);if(N0?R:0,v.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})});K0.displayName=ru;var Y0="SelectGroup",[bS,NS]=Ba(Y0),wS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=cn();return e.jsx(bS,{scope:l,id:c,children:e.jsx(qe.div,{role:"group","aria-labelledby":c,...o,ref:a})})});wS.displayName=Y0;var G0="SelectLabel",SS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=NS(G0,l);return e.jsx(qe.div,{id:c.id,...o,ref:a})});SS.displayName=G0;var go="SelectItem",[CS,Q0]=Ba(go),q0=h.forwardRef((r,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:d,...m}=r,f=gn(go,l),p=yn(go,l),y=f.value===o,[g,v]=h.useState(d??""),[C,P]=h.useState(!1),T=lt(a,E=>{var j;return(j=p.itemRefCallback)==null?void 0:j.call(p,E,o,c)}),S=cn(),b=h.useRef("touch"),N=()=>{c||(f.onValueChange(o),f.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(CS,{scope:l,value:o,disabled:c,textId:S,isSelected:y,onItemTextChange:h.useCallback(E=>{v(j=>j||((E==null?void 0:E.textContent)??"").trim())},[]),children:e.jsx(Io.ItemSlot,{scope:l,value:o,disabled:c,textValue:g,children:e.jsx(qe.div,{role:"option","aria-labelledby":S,"data-highlighted":C?"":void 0,"aria-selected":y&&C,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...m,ref:T,onFocus:He(m.onFocus,()=>P(!0)),onBlur:He(m.onBlur,()=>P(!1)),onClick:He(m.onClick,()=>{b.current!=="mouse"&&N()}),onPointerUp:He(m.onPointerUp,()=>{b.current==="mouse"&&N()}),onPointerDown:He(m.onPointerDown,E=>{b.current=E.pointerType}),onPointerMove:He(m.onPointerMove,E=>{var j;b.current=E.pointerType,c?(j=p.onItemLeave)==null||j.call(p):b.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:He(m.onPointerLeave,E=>{var j;E.currentTarget===document.activeElement&&((j=p.onItemLeave)==null||j.call(p))}),onKeyDown:He(m.onKeyDown,E=>{var R;((R=p.searchRef)==null?void 0:R.current)!==""&&E.key===" "||(cS.includes(E.key)&&N(),E.key===" "&&E.preventDefault())})})})})});q0.displayName=go;var kl="SelectItemText",X0=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,...d}=r,m=gn(kl,l),f=yn(kl,l),p=Q0(kl,l),y=mS(kl,l),[g,v]=h.useState(null),C=lt(a,N=>v(N),p.onItemTextChange,N=>{var E;return(E=f.itemTextRefCallback)==null?void 0:E.call(f,N,p.value,p.disabled)}),P=g==null?void 0:g.textContent,T=h.useMemo(()=>e.jsx("option",{value:p.value,disabled:p.disabled,children:P},p.value),[p.disabled,p.value,P]),{onNativeOptionAdd:S,onNativeOptionRemove:b}=y;return ts(()=>(S(T),()=>b(T)),[S,b,T]),e.jsxs(e.Fragment,{children:[e.jsx(qe.span,{id:p.textId,...d,ref:C}),p.isSelected&&m.valueNode&&!m.valueNodeHasChildren?Il.createPortal(d.children,m.valueNode):null]})});X0.displayName=kl;var J0="SelectItemIndicator",Z0=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return Q0(J0,l).isSelected?e.jsx(qe.span,{"aria-hidden":!0,...o,ref:a}):null});Z0.displayName=J0;var nu="SelectScrollUpButton",eg=h.forwardRef((r,a)=>{const l=yn(nu,r.__scopeSelect),o=Uu(nu,r.__scopeSelect),[c,d]=h.useState(!1),m=lt(a,o.onScrollButtonChange);return ts(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=p.scrollTop>0;d(y)};const p=l.viewport;return f(),p.addEventListener("scroll",f),()=>p.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(sg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:p}=l;f&&p&&(f.scrollTop=f.scrollTop-p.offsetHeight)}}):null});eg.displayName=nu;var au="SelectScrollDownButton",tg=h.forwardRef((r,a)=>{const l=yn(au,r.__scopeSelect),o=Uu(au,r.__scopeSelect),[c,d]=h.useState(!1),m=lt(a,o.onScrollButtonChange);return ts(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)p.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(sg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:p}=l;f&&p&&(f.scrollTop=f.scrollTop+p.offsetHeight)}}):null});tg.displayName=au;var sg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=r,d=yn("SelectScrollButton",l),m=h.useRef(null),f=_o(l),p=h.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return h.useEffect(()=>()=>p(),[p]),ts(()=>{var g;const y=f().find(v=>v.ref.current===document.activeElement);(g=y==null?void 0:y.ref.current)==null||g.scrollIntoView({block:"nearest"})},[f]),e.jsx(qe.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:He(c.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(o,50))}),onPointerMove:He(c.onPointerMove,()=>{var y;(y=d.onItemLeave)==null||y.call(d),m.current===null&&(m.current=window.setInterval(o,50))}),onPointerLeave:He(c.onPointerLeave,()=>{p()})})}),kS="SelectSeparator",ES=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return e.jsx(qe.div,{"aria-hidden":!0,...o,ref:a})});ES.displayName=kS;var lu="SelectArrow",PS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=Mo(l),d=gn(lu,l),m=yn(lu,l);return d.open&&m.position==="popper"?e.jsx(aS,{...c,...o,ref:a}):null});PS.displayName=lu;var TS="SelectBubbleInput",rg=h.forwardRef(({__scopeSelect:r,value:a,...l},o)=>{const c=h.useRef(null),d=lt(o,c),m=_u(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const p=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(m!==a&&g){const v=new Event("change",{bubbles:!0});g.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(qe.select,{...l,style:{...A0,...l.style},ref:d,defaultValue:a})});rg.displayName=TS;function ng(r){return r===""||r===void 0}function ag(r){const a=un(r),l=h.useRef(""),o=h.useRef(0),c=h.useCallback(m=>{const f=l.current+m;a(f),(function p(y){l.current=y,window.clearTimeout(o.current),y!==""&&(o.current=window.setTimeout(()=>p(""),1e3))})(f)},[a]),d=h.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,d]}function lg(r,a,l){const c=a.length>1&&Array.from(a).every(y=>y===a[0])?a[0]:a,d=l?r.indexOf(l):-1;let m=RS(r,Math.max(d,0));c.length===1&&(m=m.filter(y=>y!==l));const p=m.find(y=>y.textValue.toLowerCase().startsWith(c.toLowerCase()));return p!==l?p:void 0}function RS(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var IS=D0,ig=O0,_S=z0,MS=$0,AS=B0,og=U0,DS=K0,cg=q0,LS=X0,OS=Z0,FS=eg,zS=tg;const Sl=IS,Cl=_S,ba=h.forwardRef(({className:r,children:a,...l},o)=>e.jsxs(ig,{ref:o,className:it("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",r),...l,children:[a,e.jsx(MS,{asChild:!0,children:e.jsx(Ta,{className:"h-4 w-4 opacity-50"})})]}));ba.displayName=ig.displayName;const Na=h.forwardRef(({className:r,children:a,position:l="popper",...o},c)=>e.jsx(AS,{children:e.jsxs(og,{ref:c,className:it("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",l==="popper"&&"data-[side=bottom]:translate-y-1",r),position:l,...o,children:[e.jsx(FS,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(pu,{className:"h-4 w-4"})}),e.jsx(DS,{className:"p-1",children:a}),e.jsx(zS,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Ta,{className:"h-4 w-4"})})]})}));Na.displayName=og.displayName;const nr=h.forwardRef(({className:r,children:a,...l},o)=>e.jsxs(cg,{ref:o,className:it("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...l,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(OS,{children:e.jsx(jo,{className:"h-4 w-4"})})}),e.jsx(LS,{children:a})]}));nr.displayName=cg.displayName;const $S=["一","二","三","四","五","六","七","八","九","十"];function Fd(r){return r.startsWith("part:")?{type:"part",id:r.slice(5)}:r.startsWith("chapter:")?{type:"chapter",id:r.slice(8)}:r.startsWith("section:")?{type:"section",id:r.slice(8)}:null}function BS({parts:r,expandedParts:a,onTogglePart:l,onReorder:o,onReadSection:c,onDeleteSection:d,onAddSectionInPart:m,onAddChapterInPart:f,onDeleteChapter:p,onEditPart:y,onDeletePart:g,onEditChapter:v,selectedSectionIds:C=[],onToggleSectionSelect:P,onShowSectionOrders:T}){const[S,b]=h.useState(null),[N,E]=h.useState(null),j=(I,re)=>(S==null?void 0:S.type)===I&&(S==null?void 0:S.id)===re,R=(I,re)=>(N==null?void 0:N.type)===I&&(N==null?void 0:N.id)===re,W=h.useCallback(()=>{const I=[];for(const re of r)for(const ie of re.chapters)for(const oe of ie.sections)I.push({id:oe.id,partId:re.id,partTitle:re.title,chapterId:ie.id,chapterTitle:ie.title});return I},[r]),U=h.useCallback(async(I,re,ie,oe)=>{var ve;I.preventDefault(),I.stopPropagation();const te=I.dataTransfer.getData("text/plain"),J=Fd(te);if(!J||J.type===re&&J.id===ie)return;const Y=W(),ne=new Map(Y.map($=>[$.id,$]));if(J.type==="part"&&re==="part"){const $=r.map(L=>L.id),ce=$.indexOf(J.id),H=$.indexOf(ie);if(ce===-1||H===-1)return;const M=[...$];M.splice(ce,1),M.splice(ceK.id===L);if(X)for(const K of X.chapters)for(const de of K.sections){const G=ne.get(de.id);G&&O.push(G)}}await o(O);return}if(J.type==="chapter"&&(re==="chapter"||re==="section"||re==="part")){const $=r.find(G=>G.chapters.some(xe=>xe.id===J.id)),ce=$==null?void 0:$.chapters.find(G=>G.id===J.id);if(!$||!ce)return;let H,M,O=null;if(re==="section"){const G=ne.get(ie);if(!G)return;H=G.partId,M=G.partTitle,O=ie}else if(re==="chapter"){const G=r.find(D=>D.chapters.some(ue=>ue.id===ie)),xe=G==null?void 0:G.chapters.find(D=>D.id===ie);if(!G||!xe)return;H=G.id,M=G.title;const we=Y.filter(D=>D.chapterId===ie).pop();O=(we==null?void 0:we.id)??null}else{const G=r.find(we=>we.id===ie);if(!G||!G.chapters[0])return;H=G.id,M=G.title;const xe=Y.filter(we=>we.partId===G.id&&we.chapterId===G.chapters[0].id);O=((ve=xe[xe.length-1])==null?void 0:ve.id)??null}const L=ce.sections.map(G=>G.id),X=Y.filter(G=>!L.includes(G.id));let K=X.length;if(O){const G=X.findIndex(xe=>xe.id===O);G>=0&&(K=G+1)}const de=L.map(G=>({...ne.get(G),partId:H,partTitle:M,chapterId:ce.id,chapterTitle:ce.title}));await o([...X.slice(0,K),...de,...X.slice(K)]);return}if(J.type==="section"&&(re==="section"||re==="chapter"||re==="part")){if(!oe)return;const{partId:$,partTitle:ce,chapterId:H,chapterTitle:M}=oe;let O;if(re==="section")O=Y.findIndex(xe=>xe.id===ie);else if(re==="chapter"){const xe=Y.filter(we=>we.chapterId===ie).pop();O=xe?Y.findIndex(we=>we.id===xe.id)+1:Y.length}else{const xe=r.find(ue=>ue.id===ie);if(!(xe!=null&&xe.chapters[0]))return;const we=Y.filter(ue=>ue.partId===xe.id&&ue.chapterId===xe.chapters[0].id),D=we[we.length-1];O=D?Y.findIndex(ue=>ue.id===D.id)+1:0}const L=Y.findIndex(xe=>xe.id===J.id);if(L===-1)return;const X=Y.filter(xe=>xe.id!==J.id),K=L({onDragEnter:oe=>{oe.preventDefault(),oe.stopPropagation(),oe.dataTransfer.dropEffect="move",E({type:I,id:re})},onDragOver:oe=>{oe.preventDefault(),oe.stopPropagation(),oe.dataTransfer.dropEffect="move",E({type:I,id:re})},onDragLeave:()=>E(null),onDrop:oe=>{E(null);const te=Fd(oe.dataTransfer.getData("text/plain"));if(te&&!(I==="section"&&te.type==="section"&&te.id===re))if(I==="part")if(te.type==="part")U(oe,"part",re);else{const J=r.find(ne=>ne.id===re);(J==null?void 0:J.chapters[0])&&ie&&U(oe,"part",re,ie)}else I==="chapter"&&ie?(te.type==="section"||te.type==="chapter")&&U(oe,"chapter",re,ie):I==="section"&&ie&&U(oe,"section",re,ie)}}),A=I=>$S[I]??String(I+1);return e.jsx("div",{className:"space-y-3",children:r.map((I,re)=>{var ce,H,M,O;const ie=I.title==="序言"||I.title.includes("序言"),oe=I.title==="尾声"||I.title.includes("尾声"),te=I.title==="附录"||I.title.includes("附录"),J=R("part",I.id),Y=a.includes(I.id),ne=I.chapters.length,ve=I.chapters.reduce((L,X)=>L+X.sections.length,0);if(ie&&I.chapters.length===1&&I.chapters[0].sections.length===1){const L=I.chapters[0].sections[0],X=R("section",L.id),K={partId:I.id,partTitle:I.title,chapterId:I.chapters[0].id,chapterTitle:I.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+L.id),de.dataTransfer.effectAllowed="move",b({type:"section",id:L.id})},onDragEnd:()=>{b(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",L.id,K),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(Nr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:de=>de.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(L.id),onChange:()=>P(L.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(Ks,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[I.chapters[0].title," | ",L.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[L.price===0||L.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",L.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",L.clickCount??0," · 付款 ",L.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(L.hotScore??0).toFixed(1)," · 第",L.hotRank&&L.hotRank>0?L.hotRank:"-","名"]}),T&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(L),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(L),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]}),e.jsx(tn,{className:"w-4 h-4 text-gray-500"})]})]},I.id)}if(I.title==="2026每日派对干货"||I.title.includes("2026每日派对干货")){const L=R("part",I.id);return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-all duration-200 ${L?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50 bg-[#1C1C1E]"}`,...k("part",I.id,{partId:I.id,partTitle:I.title,chapterId:((ce=I.chapters[0])==null?void 0:ce.id)??"",chapterTitle:((H=I.chapters[0])==null?void 0:H.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:X=>{X.stopPropagation(),X.dataTransfer.setData("text/plain","part:"+I.id),X.dataTransfer.effectAllowed="move",b({type:"part",id:I.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",I.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/50"}`,onClick:()=>l(I.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(Nr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),e.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac]/80 flex items-center justify-center text-white font-bold shrink-0",children:"派"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:I.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",ve," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:X=>X.stopPropagation(),onClick:X=>X.stopPropagation(),children:[m&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(I),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(I),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(I),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ne,"章"]}),Y?e.jsx(Ta,{className:"w-5 h-5 text-gray-500"}):e.jsx(tn,{className:"w-5 h-5 text-gray-500"})]})]}),Y&&I.chapters.length>0&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:I.chapters.map(X=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:X.title}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:K=>K.stopPropagation(),children:[v&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>v(I,X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),f&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>f(I),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),p&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>p(I,X),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:X.sections.map(K=>{const de=R("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:G=>{G.stopPropagation(),G.dataTransfer.setData("text/plain","section:"+K.id),G.dataTransfer.effectAllowed="move",b({type:"section",id:K.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg min-h-[40px] cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",K.id,{partId:I.id,partTitle:I.title,chapterId:X.id,chapterTitle:X.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:G=>G.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(K.id),onChange:()=>P(K.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[K.id," ",K.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",K.clickCount??0," · 付款 ",K.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(K.hotScore??0).toFixed(1)," · 第",K.hotRank&&K.hotRank>0?K.hotRank:"-","名"]}),T&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(K),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(K),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]},K.id)})})]},X.id))})]},I.id)}if(te)return e.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"附录"}),e.jsx("div",{className:"space-y-3",children:I.chapters.map((L,X)=>L.sections.length>0?L.sections.map(K=>{const de=R("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:G=>{G.stopPropagation(),G.dataTransfer.setData("text/plain","section:"+K.id),G.dataTransfer.effectAllowed="move",b({type:"section",id:K.id})},onDragEnd:()=>{b(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 group cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",K.id,{partId:I.id,partTitle:I.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:G=>G.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(K.id),onChange:()=>P(K.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300 truncate",children:["附录",X+1," | ",L.title," | ",K.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",K.clickCount??0," · 付款 ",K.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(K.hotScore??0).toFixed(1)," · 第",K.hotRank&&K.hotRank>0?K.hotRank:"-","名"]}),T&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(K),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>d(K),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(tn,{className:"w-4 h-4 text-gray-500 shrink-0"})]},K.id)}):e.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2",children:[e.jsxs("span",{className:"text-sm text-gray-500",children:["附录",X+1," | ",L.title,"(空)"]}),e.jsx(tn,{className:"w-4 h-4 text-gray-500 shrink-0"})]},L.id))})]},I.id);if(oe&&I.chapters.length===1&&I.chapters[0].sections.length===1){const L=I.chapters[0].sections[0],X=R("section",L.id),K={partId:I.id,partTitle:I.title,chapterId:I.chapters[0].id,chapterTitle:I.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+L.id),de.dataTransfer.effectAllowed="move",b({type:"section",id:L.id})},onDragEnd:()=>{b(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",L.id,K),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(Nr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:de=>de.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(L.id),onChange:()=>P(L.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(Ks,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[I.chapters[0].title," | ",L.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[L.price===0||L.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",L.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",L.clickCount??0," · 付款 ",L.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(L.hotScore??0).toFixed(1)," · 第",L.hotRank&&L.hotRank>0?L.hotRank:"-","名"]}),T&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(L),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(L),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]}),e.jsx(tn,{className:"w-4 h-4 text-gray-500"})]})]},I.id)}return oe?e.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"尾声"}),e.jsx("div",{className:"space-y-3",children:I.chapters.map(L=>L.sections.map(X=>{const K=R("section",X.id);return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+X.id),de.dataTransfer.effectAllowed="move",b({type:"section",id:X.id})},onDragEnd:()=>{b(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${K?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",X.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",X.id,{partId:I.id,partTitle:I.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:de=>de.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(X.id),onChange:()=>P(X.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300",children:[L.title," | ",X.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",X.clickCount??0," · 付款 ",X.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(X.hotScore??0).toFixed(1)," · 第",X.hotRank&&X.hotRank>0?X.hotRank:"-","名"]}),T&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(X),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(X),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]})]},X.id)}))})]},I.id):e.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${J?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...k("part",I.id,{partId:I.id,partTitle:I.title,chapterId:((M=I.chapters[0])==null?void 0:M.id)??"",chapterTitle:((O=I.chapters[0])==null?void 0:O.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:L=>{L.stopPropagation(),L.dataTransfer.setData("text/plain","part:"+I.id),L.dataTransfer.effectAllowed="move",b({type:"part",id:I.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",I.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(I.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(Nr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),e.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac] flex items-center justify-center text-white font-bold shadow-lg shadow-[#38bdac]/30 shrink-0",children:A(re)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:I.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",ve," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:L=>L.stopPropagation(),onClick:L=>L.stopPropagation(),children:[m&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(I),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(I),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(I),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ne,"章"]}),Y?e.jsx(Ta,{className:"w-5 h-5 text-gray-500"}):e.jsx(tn,{className:"w-5 h-5 text-gray-500"})]})]}),Y&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:I.chapters.map(L=>{const X=R("chapter",L.id);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","chapter:"+L.id),K.dataTransfer.effectAllowed="move",b({type:"chapter",id:L.id})},onDragEnd:()=>{b(null),E(null)},onDragEnter:K=>{K.preventDefault(),K.stopPropagation(),K.dataTransfer.dropEffect="move",E({type:"chapter",id:L.id})},onDragOver:K=>{K.preventDefault(),K.stopPropagation(),K.dataTransfer.dropEffect="move",E({type:"chapter",id:L.id})},onDragLeave:()=>E(null),onDrop:K=>{E(null);const de=Fd(K.dataTransfer.getData("text/plain"));if(!de)return;const G={partId:I.id,partTitle:I.title,chapterId:L.id,chapterTitle:L.title};(de.type==="section"||de.type==="chapter")&&U(K,"chapter",L.id,G)},className:`flex-1 min-w-0 py-2 px-2 rounded cursor-grab active:cursor-grabbing select-none -mx-2 transition-all duration-200 flex items-center gap-2 ${X?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${j("chapter",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:L.title})]}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:K=>K.stopPropagation(),children:[v&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>v(I,L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),f&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>f(I),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),p&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>p(I,L),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:L.sections.map(K=>{const de=R("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:G=>{G.stopPropagation(),G.dataTransfer.setData("text/plain","section:"+K.id),G.dataTransfer.effectAllowed="move",b({type:"section",id:K.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg group cursor-grab active:cursor-grabbing select-none min-h-[40px] transition-all duration-200 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,...k("section",K.id,{partId:I.id,partTitle:I.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:G=>G.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(K.id),onChange:()=>P(K.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${K.price===0||K.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[K.id," ",K.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:G=>G.stopPropagation(),onClick:G=>G.stopPropagation(),children:[K.isNew&&e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),K.price===0||K.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",K.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",title:"点击次数 · 付款笔数",children:["点击 ",K.clickCount??0," · 付款 ",K.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(K.hotScore??0).toFixed(1)," · 第",K.hotRank&&K.hotRank>0?K.hotRank:"-","名"]}),T&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(K),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5 shrink-0",children:"付款记录"}),e.jsxs("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(K),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]}),e.jsx(tn,{className:"w-4 h-4 text-gray-500"})]})]},K.id)})})]},L.id)})})]},I.id)})})}function US(r){const a=new Map;for(const f of r){const p=f.partId||"part-1",y=f.partTitle||"未分类",g=f.chapterId||"chapter-1",v=f.chapterTitle||"未分类";a.has(p)||a.set(p,{id:p,title:y,chapters:new Map});const C=a.get(p);C.chapters.has(g)||C.chapters.set(g,{id:g,title:v,sections:[]}),C.chapters.get(g).sections.push({id:f.id,title:f.title,price:f.price??1,filePath:f.filePath,isFree:f.isFree,isNew:f.isNew,clickCount:f.clickCount??0,payCount:f.payCount??0,hotScore:f.hotScore??0,hotRank:f.hotRank??0})}const l="part-2026-daily",o="2026每日派对干货";Array.from(a.values()).some(f=>f.title===o||f.title.includes(o))||a.set(l,{id:l,title:o,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:o,sections:[]}]])});const d=Array.from(a.values()).map(f=>({...f,chapters:Array.from(f.chapters.values())})),m=f=>f.includes("序言")?0:f.includes(o)?1.5:f.includes("附录")?2:f.includes("尾声")?3:1;return d.sort((f,p)=>{const y=m(f.title),g=m(p.title);return y!==g?y-g:0})}function VS(){var Js,Gn,ys;const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState([]),[m,f]=h.useState(null),[p,y]=h.useState(!1),[g,v]=h.useState(!1),[C,P]=h.useState(!1),[T,S]=h.useState(""),[b,N]=h.useState([]),[E,j]=h.useState(!1),[R,W]=h.useState(!1),U=h.useRef(null),[k,A]=h.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[I,re]=h.useState(null),[ie,oe]=h.useState(!1),[te,J]=h.useState(!1),[Y,ne]=h.useState(null),[ve,$]=h.useState(!1),[ce,H]=h.useState([]),[M,O]=h.useState(!1),[L,X]=h.useState(""),[K,de]=h.useState(""),[G,xe]=h.useState(!1),[we,D]=h.useState(""),[ue,Se]=h.useState(!1),[Ie,Ue]=h.useState(null),[Ze,et]=h.useState(!1),[tt,pe]=h.useState(!1),[fe,ot]=h.useState({readWeight:.5,recencyWeight:.3,payWeight:.2}),[ss,dr]=h.useState(!1),[Ht,Cs]=h.useState(!1),Kt=US(r),vn=r.length,Mt=async()=>{o(!0);try{const F=await Be("/api/db/book?action=list",{cache:"no-store"});a(Array.isArray(F==null?void 0:F.sections)?F.sections:[])}catch(F){console.error(F),a([])}finally{o(!1)}};h.useEffect(()=>{Mt()},[]);const ur=F=>{d(ae=>ae.includes(F)?ae.filter(Ne=>Ne!==F):[...ae,F])},Un=h.useCallback(F=>{const ae=r,Ne=F.flatMap(Te=>{const ut=ae.find(rs=>rs.id===Te.id);return ut?[{...ut,partId:Te.partId,partTitle:Te.partTitle,chapterId:Te.chapterId,chapterTitle:Te.chapterTitle}]:[]});return a(Ne),gt("/api/db/book",{action:"reorder",items:F}).then(Te=>{Te&&Te.success===!1&&(a(ae),alert("排序失败: "+(Te&&typeof Te=="object"&&"error"in Te?Te.error:"未知错误")))}).catch(Te=>{a(ae),console.error("排序失败:",Te),alert("排序失败: "+(Te instanceof Error?Te.message:"网络或服务异常"))}),Promise.resolve()},[r]),ls=async F=>{if(confirm(`确定要删除章节「${F.title}」吗?此操作不可恢复。`))try{const ae=await Er(`/api/db/book?id=${encodeURIComponent(F.id)}`);ae&&ae.success!==!1?(alert("已删除"),Mt()):alert("删除失败: "+(ae&&typeof ae=="object"&&"error"in ae?ae.error:"未知错误"))}catch(ae){console.error(ae),alert("删除失败")}},ks=h.useCallback(async()=>{dr(!0);try{const F=await Be("/api/db/config/full?key=article_ranking_weights",{cache:"no-store"}),ae=F&&F.data;ae&&typeof ae.readWeight=="number"&&typeof ae.recencyWeight=="number"&&typeof ae.payWeight=="number"&&ot({readWeight:Math.max(0,Math.min(1,ae.readWeight)),recencyWeight:Math.max(0,Math.min(1,ae.recencyWeight)),payWeight:Math.max(0,Math.min(1,ae.payWeight))})}catch{}finally{dr(!1)}},[]);h.useEffect(()=>{tt&&ks()},[tt,ks]);const jn=async()=>{const{readWeight:F,recencyWeight:ae,payWeight:Ne}=fe,Te=F+ae+Ne;if(Math.abs(Te-1)>.001){alert("三个权重之和必须等于 1");return}Cs(!0);try{const ut=await yt("/api/db/config",{key:"article_ranking_weights",value:{readWeight:F,recencyWeight:ae,payWeight:Ne},description:"文章排名算法权重"});ut&&ut.success!==!1?(alert("已保存"),Mt()):alert("保存失败: "+(ut&&typeof ut=="object"&&"error"in ut?ut.error:""))}catch(ut){console.error(ut),alert("保存失败")}finally{Cs(!1)}},Es=async F=>{Ue({section:F,orders:[]}),et(!0);try{const ae=await Be(`/api/db/book?action=section-orders&id=${encodeURIComponent(F.id)}`),Ne=ae!=null&&ae.success&&Array.isArray(ae.orders)?ae.orders:[];Ue(Te=>Te?{...Te,orders:Ne}:null)}catch(ae){console.error(ae),Ue(Ne=>Ne?{...Ne,orders:[]}:null)}finally{et(!1)}},Ls=async F=>{v(!0);try{const ae=await Be(`/api/db/book?action=read&id=${encodeURIComponent(F.id)}`);if(ae!=null&&ae.success&&ae.section){const Ne=ae.section;f({id:F.id,title:ae.section.title??F.title,price:ae.section.price??F.price,content:ae.section.content??"",filePath:F.filePath,isFree:F.isFree||F.price===0,isNew:Ne.isNew??F.isNew})}else f({id:F.id,title:F.title,price:F.price,content:"",filePath:F.filePath,isFree:F.isFree,isNew:F.isNew}),ae&&!ae.success&&alert("无法读取文件内容: "+(ae.error||"未知错误"))}catch(ae){console.error(ae),f({id:F.id,title:F.title,price:F.price,content:"",filePath:F.filePath,isFree:F.isFree})}finally{v(!1)}},hr=async()=>{var F;if(m){P(!0);try{let ae=m.content||"";const Ne=[new RegExp(`^#+\\s*${m.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${m.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(F=m.title)==null?void 0:F.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const ut of Ne)ae=ae.replace(ut,"");ae=ae.replace(/^\s*\n+/,"").trim();const Te=await gt("/api/db/book",{id:m.id,title:m.title,price:m.isFree?0:m.price,content:ae,isFree:m.isFree||m.price===0,isNew:m.isNew,saveToFile:!0});Te&&Te.success!==!1?(alert(`已保存章节: ${m.title}`),f(null),Mt()):alert("保存失败: "+(Te&&typeof Te=="object"&&"error"in Te?Te.error:"未知错误"))}catch(ae){console.error(ae),alert("保存失败")}finally{P(!1)}}},bn=async()=>{if(!k.id||!k.title){alert("请填写章节ID和标题");return}P(!0);try{const F=await gt("/api/db/book",{id:k.id,title:k.title,price:k.price,content:k.content,partId:k.partId,chapterId:k.chapterId,saveToFile:!1});F&&F.success!==!1?(alert(`章节创建成功: ${k.title}`),y(!1),A({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),Mt()):alert("创建失败: "+(F&&typeof F=="object"&&"error"in F?F.error:"未知错误"))}catch(F){console.error(F),alert("创建失败")}finally{P(!1)}},mr=F=>{A(ae=>{var Ne;return{...ae,partId:F.id,chapterId:((Ne=F.chapters[0])==null?void 0:Ne.id)??"chapter-1"}}),y(!0)},Ir=F=>{re({id:F.id,title:F.title})},Ps=async()=>{var F;if((F=I==null?void 0:I.title)!=null&&F.trim()){oe(!0);try{const ae=r.map(Te=>({id:Te.id,partId:Te.partId||"part-1",partTitle:Te.partId===I.id?I.title.trim():Te.partTitle||"",chapterId:Te.chapterId||"chapter-1",chapterTitle:Te.chapterTitle||""})),Ne=await gt("/api/db/book",{action:"reorder",items:ae});Ne&&Ne.success!==!1?(re(null),Mt()):alert("更新篇名失败: "+(Ne&&typeof Ne=="object"&&"error"in Ne?Ne.error:"未知错误"))}catch(ae){console.error(ae),alert("更新篇名失败")}finally{oe(!1)}}},Nn=F=>{const ae=F.chapters.length+1,Ne=`chapter-${F.id}-${ae}-${Date.now()}`;A({id:`${ae}.1`,title:"新章节",price:1,partId:F.id,chapterId:Ne,content:""}),y(!0)},qs=(F,ae)=>{ne({part:F,chapter:ae,title:ae.title})},Xs=async()=>{var F;if((F=Y==null?void 0:Y.title)!=null&&F.trim()){$(!0);try{const ae=r.map(Te=>({id:Te.id,partId:Te.partId||Y.part.id,partTitle:Te.partId===Y.part.id?Y.part.title:Te.partTitle||"",chapterId:Te.chapterId||Y.chapter.id,chapterTitle:Te.partId===Y.part.id&&Te.chapterId===Y.chapter.id?Y.title.trim():Te.chapterTitle||""})),Ne=await gt("/api/db/book",{action:"reorder",items:ae});Ne&&Ne.success!==!1?(ne(null),Mt()):alert("保存失败: "+(Ne&&typeof Ne=="object"&&"error"in Ne?Ne.error:"未知错误"))}catch(ae){console.error(ae),alert("保存失败")}finally{$(!1)}}},Vn=async(F,ae)=>{const Ne=ae.sections.map(Te=>Te.id);if(Ne.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${F.chapters.indexOf(ae)+1}章 | ${ae.title}」吗?将删除共 ${Ne.length} 节,此操作不可恢复。`))try{for(const Te of Ne)await Er(`/api/db/book?id=${encodeURIComponent(Te)}`);Mt()}catch(Te){console.error(Te),alert("删除失败")}},Wn=async()=>{if(!we.trim()){alert("请输入篇名");return}Se(!0);try{const F=`part-new-${Date.now()}`,ae="chapter-1",Ne=`part-placeholder-${Date.now()}`,Te=await gt("/api/db/book",{id:Ne,title:"占位节(可编辑)",price:0,content:"",partId:F,partTitle:we.trim(),chapterId:ae,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Te&&Te.success!==!1?(alert(`篇「${we}」创建成功,请编辑占位节`),J(!1),D(""),Mt()):alert("创建失败: "+(Te&&typeof Te=="object"&&"error"in Te?Te.error:"未知错误"))}catch(F){console.error(F),alert("创建失败")}finally{Se(!1)}},Hn=async()=>{if(ce.length===0){alert("请先勾选要移动的章节");return}const F=Kt.find(Ne=>Ne.id===L),ae=F==null?void 0:F.chapters.find(Ne=>Ne.id===K);if(!F||!ae||!L||!K){alert("请选择目标篇和章");return}xe(!0);try{const Ne=()=>{const nt=new Set(ce),is=r.map(at=>({id:at.id,partId:at.partId||"",partTitle:at.partTitle||"",chapterId:at.chapterId||"",chapterTitle:at.chapterTitle||""})),B=is.filter(at=>nt.has(at.id)).map(at=>({...at,partId:L,partTitle:F.title||L,chapterId:K,chapterTitle:ae.title||K})),We=is.filter(at=>!nt.has(at.id));let Ge=We.length;for(let at=We.length-1;at>=0;at-=1){const Ts=We[at];if(Ts.partId===L&&Ts.chapterId===K){Ge=at+1;break}}return[...We.slice(0,Ge),...B,...We.slice(Ge)]},Te=async()=>{const nt=Ne(),is=await gt("/api/db/book",{action:"reorder",items:nt});return is&&is.success!==!1?(alert(`已移动 ${ce.length} 节到「${F.title}」-「${ae.title}」`),O(!1),H([]),await Mt(),!0):!1},ut={action:"move-sections",sectionIds:ce,targetPartId:L,targetChapterId:K,targetPartTitle:F.title||L,targetChapterTitle:ae.title||K},rs=await gt("/api/db/book",ut);if(rs&&rs.success!==!1)alert(`已移动 ${rs.count??ce.length} 节到「${F.title}」-「${ae.title}」`),O(!1),H([]),await Mt();else{const nt=rs&&typeof rs=="object"&&"error"in rs?rs.error||"":"未知错误";if((nt.includes("缺少 id")||nt.includes("无效的 action"))&&await Te())return;alert("移动失败: "+nt)}}catch(Ne){console.error(Ne),alert("移动失败: "+(Ne instanceof Error?Ne.message:"网络或服务异常"))}finally{xe(!1)}},Kn=F=>{H(ae=>ae.includes(F)?ae.filter(Ne=>Ne!==F):[...ae,F])},Yn=async F=>{const ae=r.filter(Ne=>Ne.partId===F.id).map(Ne=>Ne.id);if(ae.length===0){alert("该篇下暂无小节可删除");return}if(confirm(`确定要删除「${F.title}」整篇吗?将删除共 ${ae.length} 节内容,此操作不可恢复。`))try{for(const Ne of ae)await Er(`/api/db/book?id=${encodeURIComponent(Ne)}`);Mt()}catch(Ne){console.error(Ne),alert("删除失败")}},_r=async F=>{var Ne,Te;const ae=(Ne=F.target.files)==null?void 0:Ne[0];if(ae){W(!0);try{const ut=new FormData;ut.append("file",ae),ut.append("folder","book-images");const nt=await(await fetch(Ia("/api/upload"),{method:"POST",body:ut,credentials:"include"})).json();if(nt!=null&&nt.success&&((Te=nt==null?void 0:nt.data)!=null&&Te.url)){const is=`![${ae.name}](${nt.data.url})`;m&&f({...m,content:(m.content||"")+` - -`+is}),alert(`图片上传成功: ${nt.data.url}`)}else alert("上传失败: "+((nt==null?void 0:nt.error)||"未知错误"))}catch(ut){console.error(ut),alert("上传失败")}finally{W(!1),U.current&&(U.current.value="")}}},wn=async()=>{var F;if(T.trim()){j(!0);try{const ae=await Be(`/api/search?q=${encodeURIComponent(T)}`);ae!=null&&ae.success&&((F=ae.data)!=null&&F.results)?N(ae.data.results):(N([]),ae&&!ae.success&&alert("搜索失败: "+ae.error))}catch(ae){console.error(ae),N([]),alert("搜索失败")}finally{j(!1)}}},qt=Kt.find(F=>F.id===k.partId),Mr=(qt==null?void 0:qt.chapters)??[];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"内容管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",Kt.length," 篇 · ",vn," 节内容"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(q,{onClick:()=>pe(!0),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10 bg-transparent",children:[e.jsx(wd,{className:"w-4 h-4 mr-2"}),"排名算法"]}),e.jsxs(q,{onClick:()=>{const F=typeof window<"u"?`${window.location.origin}/api-doc`:"";F&&window.open(F,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ln,{className:"w-4 h-4 mr-2"}),"API 接口"]})]})]}),e.jsx(St,{open:p,onOpenChange:y,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Pt,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"章节ID *"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:k.id,onChange:F=>A({...k,id:F.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:k.price,onChange:F=>A({...k,price:Number(F.target.value)})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"章节标题 *"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:k.title,onChange:F=>A({...k,title:F.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"所属篇"}),e.jsxs(Sl,{value:k.partId,onValueChange:F=>A({...k,partId:F,chapterId:"chapter-1"}),children:[e.jsx(ba,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{})}),e.jsxs(Na,{className:"bg-[#0f2137] border-gray-700",children:[Kt.map(F=>e.jsx(nr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id)),Kt.length===0&&e.jsx(nr,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"所属章"}),e.jsxs(Sl,{value:k.chapterId,onValueChange:F=>A({...k,chapterId:F}),children:[e.jsx(ba,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{})}),e.jsxs(Na,{className:"bg-[#0f2137] border-gray-700",children:[Mr.map(F=>e.jsx(nr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id)),Mr.length===0&&e.jsx(nr,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsx(dn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:k.content,onChange:F=>A({...k,content:F.target.value})})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:bn,disabled:C||!k.id||!k.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),e.jsx(St,{open:!!I,onOpenChange:F=>!F&&re(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),I&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"篇名"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:I.title,onChange:F=>re({...I,title:F.target.value}),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>re(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Ps,disabled:ie||!((Js=I==null?void 0:I.title)!=null&&Js.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ie?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(St,{open:!!Y,onOpenChange:F=>!F&&ne(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节名称"]})}),Y&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"章节名称(如:第8章|底层结构)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:Y.title,onChange:F=>ne({...Y,title:F.target.value}),placeholder:"输入章节名称"})]})}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>ne(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Xs,disabled:ve||!((Gn=Y==null?void 0:Y.title)!=null&&Gn.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ve?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(St,{open:M,onOpenChange:F=>{var ae;if(O(F),F&&Kt.length>0){const Ne=Kt[0];X(Ne.id),de(((ae=Ne.chapters[0])==null?void 0:ae.id)??"")}},children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:"批量移动至指定目录"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["已选 ",e.jsx("span",{className:"text-[#38bdac] font-medium",children:ce.length})," 节,请选择目标篇与章。"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"目标篇"}),e.jsxs(Sl,{value:L,onValueChange:F=>{var Ne;X(F);const ae=Kt.find(Te=>Te.id===F);de(((Ne=ae==null?void 0:ae.chapters[0])==null?void 0:Ne.id)??"")},children:[e.jsx(ba,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{placeholder:"选择篇"})}),e.jsx(Na,{className:"bg-[#0f2137] border-gray-700",children:Kt.map(F=>e.jsx(nr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"目标章"}),e.jsxs(Sl,{value:K,onValueChange:de,children:[e.jsx(ba,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{placeholder:"选择章"})}),e.jsx(Na,{className:"bg-[#0f2137] border-gray-700",children:(((ys=Kt.find(F=>F.id===L))==null?void 0:ys.chapters)??[]).map(F=>e.jsx(nr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id))})]})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>O(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Hn,disabled:G||ce.length===0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:G?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"移动中..."]}):"确认移动"})]})]})}),e.jsx(St,{open:!!Ie,onOpenChange:F=>!F&&Ue(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white",children:["付款记录 — ",(Ie==null?void 0:Ie.section.title)??""]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:Ze?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):Ie&&Ie.orders.length===0?e.jsx("p",{className:"text-gray-500 text-center py-6",children:"暂无付款记录"}):Ie?e.jsxs("table",{className:"w-full text-sm border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"py-2 pr-2",children:"订单号"}),e.jsx("th",{className:"py-2 pr-2",children:"用户ID"}),e.jsx("th",{className:"py-2 pr-2",children:"金额"}),e.jsx("th",{className:"py-2 pr-2",children:"状态"}),e.jsx("th",{className:"py-2 pr-2",children:"支付时间"})]})}),e.jsx("tbody",{children:Ie.orders.map(F=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.orderSn??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.userId??F.openId??"-"}),e.jsxs("td",{className:"py-2 pr-2 text-gray-300",children:["¥",F.amount??0]}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.status??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-500",children:F.payTime??F.createdAt??"-"})]},F.id??F.orderSn??""))})]}):null})]})}),e.jsx(St,{open:tt,onOpenChange:pe,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(wd,{className:"w-5 h-5 text-amber-400"}),"文章排名算法"]})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsx("p",{className:"text-sm text-gray-400",children:"热度积分 = 阅读权重×阅读排名分 + 新度权重×新度排名分 + 付款权重×付款排名分(三权重之和须为 1)"}),ss?e.jsx("p",{className:"text-gray-500",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(ee,{className:"text-gray-400 text-xs",children:"阅读权重"}),e.jsx(le,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:fe.readWeight,onChange:F=>ot(ae=>({...ae,readWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(ee,{className:"text-gray-400 text-xs",children:"新度权重"}),e.jsx(le,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:fe.recencyWeight,onChange:F=>ot(ae=>({...ae,recencyWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(ee,{className:"text-gray-400 text-xs",children:"付款权重"}),e.jsx(le,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:fe.payWeight,onChange:F=>ot(ae=>({...ae,payWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前之和: ",(fe.readWeight+fe.recencyWeight+fe.payWeight).toFixed(1)]}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-xs text-gray-400",children:[e.jsx("li",{children:"阅读量前 20 名:得分 20~1"}),e.jsx("li",{children:"最近更新前 30 篇:得分 30~1"}),e.jsx("li",{children:"付款数前 20 名:得分 20~1"})]}),e.jsx(q,{onClick:jn,disabled:Ht||Math.abs(fe.readWeight+fe.recencyWeight+fe.payWeight-1)>.001,className:"w-full bg-amber-500 hover:bg-amber-600 text-white",children:Ht?"保存中...":"保存权重"})]})]})]})}),e.jsx(St,{open:te,onOpenChange:J,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Pt,{className:"w-5 h-5 text-amber-400"}),"新建篇"]})}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"篇名(如:第六篇|真实的社会)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:we,onChange:F=>D(F.target.value),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>{J(!1),D("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Wn,disabled:ue||!we.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:ue?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"创建篇"]})})]})]})}),e.jsx(St,{open:!!m,onOpenChange:()=>f(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] flex flex-col p-0 gap-0",showCloseButton:!0,children:[e.jsx(Ct,{className:"shrink-0 px-6 pt-6 pb-2",children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),m&&e.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 px-6 space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"章节ID"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:m.isFree?0:m.price,onChange:F=>f({...m,price:Number(F.target.value),isFree:Number(F.target.value)===0}),disabled:m.isFree})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"免费章节(唯一入口,小程序以 is_free 或 price=0 为准)"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m.isFree||m.price===0,onChange:F=>f({...m,isFree:F.target.checked,price:F.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"最新新增"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m.isNew??!1,onChange:F=>f({...m,isNew:F.target.checked}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"标记 NEW"})]})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"章节标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.title,onChange:F=>f({...m,title:F.target.value})})]}),m.filePath&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"文件路径"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:m.filePath,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ee,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:U,type:"file",accept:"image/*",onChange:_r,className:"hidden"}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>{var F;return(F=U.current)==null?void 0:F.click()},disabled:R,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[R?e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(Vx,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),g?e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(dn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[400px] font-mono text-sm placeholder:text-gray-500",placeholder:"此处输入章节内容,支持Markdown格式...",value:m.content,onChange:F=>f({...m,content:F.target.value})})]})]}),e.jsxs(Dt,{className:"shrink-0 px-6 py-4 border-t border-gray-700/50",children:[e.jsxs(q,{variant:"outline",onClick:()=>f(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsx(q,{onClick:hr,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),e.jsxs(Al,{defaultValue:"chapters",className:"space-y-6",children:[e.jsxs(Fa,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Lt,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(Ks,{className:"w-4 h-4 mr-2"}),"章节管理"]}),e.jsxs(Lt,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(on,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),e.jsxs(Lt,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(wd,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),e.jsxs(Ot,{value:"chapters",className:"space-y-4",children:[e.jsxs("div",{className:"rounded-2xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac] flex items-center justify-center text-white shadow-lg shadow-[#38bdac]/20 shrink-0",children:e.jsx(Ks,{className:"w-6 h-6"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-base text-white leading-tight mb-1",children:"一场SOUL的创业实验场"}),e.jsx("p",{className:"text-xs text-gray-500",children:"来自Soul派对房的真实商业故事"})]})]}),e.jsxs("div",{className:"text-center shrink-0",children:[e.jsx("span",{className:"block text-2xl font-bold text-[#38bdac]",children:vn}),e.jsx("span",{className:"text-xs text-gray-500",children:"章节"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(q,{onClick:()=>y(!0),className:"flex-1 min-w-[120px] bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"新建章节"]}),e.jsxs(q,{onClick:()=>J(!0),className:"flex-1 min-w-[120px] bg-amber-500/10 hover:bg-amber-500/20 text-amber-400 border border-amber-500/30",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"新建篇"]}),e.jsxs(q,{variant:"outline",onClick:()=>O(!0),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:["批量移动(已选 ",ce.length," 节)"]})]}),l?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(BS,{parts:Kt,expandedParts:c,onTogglePart:ur,onReorder:Un,onReadSection:Ls,onDeleteSection:ls,onAddSectionInPart:mr,onAddChapterInPart:Nn,onDeleteChapter:Vn,onEditPart:Ir,onDeletePart:Yn,onEditChapter:qs,selectedSectionIds:ce,onToggleSectionSelect:Kn,onShowSectionOrders:Es})]}),e.jsx(Ot,{value:"search",className:"space-y-4",children:e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"内容搜索"})}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:T,onChange:F=>S(F.target.value),onKeyDown:F=>F.key==="Enter"&&wn()}),e.jsx(q,{onClick:wn,disabled:E||!T.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?e.jsx($e,{className:"w-4 h-4 animate-spin"}):e.jsx(on,{className:"w-4 h-4"})})]}),b.length>0&&e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",b.length," 个结果"]}),b.map(F=>e.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>Ls({id:F.id,title:F.title,price:F.price??1,filePath:""}),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:F.id}),e.jsx("span",{className:"text-white",children:F.title})]}),e.jsx(Oe,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:F.matchType==="title"?"标题匹配":"内容匹配"})]}),F.snippet&&e.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:F.snippet}),(F.partTitle||F.chapterTitle)&&e.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[F.partTitle," · ",F.chapterTitle]})]},F.id))]})]})]})}),e.jsx(Ot,{value:"hooks",className:"space-y-4",children:e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"引流钩子配置"})}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[e.jsx(ee,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),e.jsxs(Sl,{defaultValue:"3",children:[e.jsx(ba,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{placeholder:"选择章节"})}),e.jsxs(Na,{className:"bg-[#0f2137] border-gray-700",children:[e.jsx(nr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),e.jsx(nr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),e.jsx(nr,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),e.jsxs("div",{className:"grid w-full gap-1.5",children:[e.jsx(ee,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),e.jsx(dn,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),e.jsx(q,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}var dg=["PageUp","PageDown"],ug=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],hg={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ua="Slider",[iu,WS,HS]=Ru(Ua),[mg]=pn(Ua,[HS]),[KS,Ao]=mg(Ua),fg=h.forwardRef((r,a)=>{const{name:l,min:o=0,max:c=100,step:d=1,orientation:m="horizontal",disabled:f=!1,minStepsBetweenThumbs:p=0,defaultValue:y=[o],value:g,onValueChange:v=()=>{},onValueCommit:C=()=>{},inverted:P=!1,form:T,...S}=r,b=h.useRef(new Set),N=h.useRef(0),j=m==="horizontal"?YS:GS,[R=[],W]=On({prop:g,defaultProp:y,onChange:ie=>{var te;(te=[...b.current][N.current])==null||te.focus(),v(ie)}}),U=h.useRef(R);function k(ie){const oe=ZS(R,ie);re(ie,oe)}function A(ie){re(ie,N.current)}function I(){const ie=U.current[N.current];R[N.current]!==ie&&C(R)}function re(ie,oe,{commit:te}={commit:!1}){const J=rC(d),Y=nC(Math.round((ie-o)/d)*d+o,J),ne=ho(Y,[o,c]);W((ve=[])=>{const $=XS(ve,ne,oe);if(sC($,p*d)){N.current=$.indexOf(ne);const ce=String($)!==String(ve);return ce&&te&&C($),ce?$:ve}else return ve})}return e.jsx(KS,{scope:r.__scopeSlider,name:l,disabled:f,min:o,max:c,valueIndexToChangeRef:N,thumbs:b.current,values:R,orientation:m,form:T,children:e.jsx(iu.Provider,{scope:r.__scopeSlider,children:e.jsx(iu.Slot,{scope:r.__scopeSlider,children:e.jsx(j,{"aria-disabled":f,"data-disabled":f?"":void 0,...S,ref:a,onPointerDown:He(S.onPointerDown,()=>{f||(U.current=R)}),min:o,max:c,inverted:P,onSlideStart:f?void 0:k,onSlideMove:f?void 0:A,onSlideEnd:f?void 0:I,onHomeKeyDown:()=>!f&&re(o,0,{commit:!0}),onEndKeyDown:()=>!f&&re(c,R.length-1,{commit:!0}),onStepKeyDown:({event:ie,direction:oe})=>{if(!f){const Y=dg.includes(ie.key)||ie.shiftKey&&ug.includes(ie.key)?10:1,ne=N.current,ve=R[ne],$=d*Y*oe;re(ve+$,ne,{commit:!0})}}})})})})});fg.displayName=Ua;var[xg,pg]=mg(Ua,{startEdge:"left",endEdge:"right",size:"width",direction:1}),YS=h.forwardRef((r,a)=>{const{min:l,max:o,dir:c,inverted:d,onSlideStart:m,onSlideMove:f,onSlideEnd:p,onStepKeyDown:y,...g}=r,[v,C]=h.useState(null),P=lt(a,j=>C(j)),T=h.useRef(void 0),S=So(c),b=S==="ltr",N=b&&!d||!b&&d;function E(j){const R=T.current||v.getBoundingClientRect(),W=[0,R.width],k=Vu(W,N?[l,o]:[o,l]);return T.current=R,k(j-R.left)}return e.jsx(xg,{scope:r.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:e.jsx(gg,{dir:S,"data-orientation":"horizontal",...g,ref:P,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const R=E(j.clientX);m==null||m(R)},onSlideMove:j=>{const R=E(j.clientX);f==null||f(R)},onSlideEnd:()=>{T.current=void 0,p==null||p()},onStepKeyDown:j=>{const W=hg[N?"from-left":"from-right"].includes(j.key);y==null||y({event:j,direction:W?-1:1})}})})}),GS=h.forwardRef((r,a)=>{const{min:l,max:o,inverted:c,onSlideStart:d,onSlideMove:m,onSlideEnd:f,onStepKeyDown:p,...y}=r,g=h.useRef(null),v=lt(a,g),C=h.useRef(void 0),P=!c;function T(S){const b=C.current||g.current.getBoundingClientRect(),N=[0,b.height],j=Vu(N,P?[o,l]:[l,o]);return C.current=b,j(S-b.top)}return e.jsx(xg,{scope:r.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:e.jsx(gg,{"data-orientation":"vertical",...y,ref:v,style:{...y.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const b=T(S.clientY);d==null||d(b)},onSlideMove:S=>{const b=T(S.clientY);m==null||m(b)},onSlideEnd:()=>{C.current=void 0,f==null||f()},onStepKeyDown:S=>{const N=hg[P?"from-bottom":"from-top"].includes(S.key);p==null||p({event:S,direction:N?-1:1})}})})}),gg=h.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:m,onEndKeyDown:f,onStepKeyDown:p,...y}=r,g=Ao(Ua,l);return e.jsx(qe.span,{...y,ref:a,onKeyDown:He(r.onKeyDown,v=>{v.key==="Home"?(m(v),v.preventDefault()):v.key==="End"?(f(v),v.preventDefault()):dg.concat(ug).includes(v.key)&&(p(v),v.preventDefault())}),onPointerDown:He(r.onPointerDown,v=>{const C=v.target;C.setPointerCapture(v.pointerId),v.preventDefault(),g.thumbs.has(C)?C.focus():o(v)}),onPointerMove:He(r.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&c(v)}),onPointerUp:He(r.onPointerUp,v=>{const C=v.target;C.hasPointerCapture(v.pointerId)&&(C.releasePointerCapture(v.pointerId),d(v))})})}),yg="SliderTrack",vg=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Ao(yg,l);return e.jsx(qe.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});vg.displayName=yg;var ou="SliderRange",jg=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Ao(ou,l),d=pg(ou,l),m=h.useRef(null),f=lt(a,m),p=c.values.length,y=c.values.map(C=>wg(C,c.min,c.max)),g=p>1?Math.min(...y):0,v=100-Math.max(...y);return e.jsx(qe.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:f,style:{...r.style,[d.startEdge]:g+"%",[d.endEdge]:v+"%"}})});jg.displayName=ou;var cu="SliderThumb",bg=h.forwardRef((r,a)=>{const l=WS(r.__scopeSlider),[o,c]=h.useState(null),d=lt(a,f=>c(f)),m=h.useMemo(()=>o?l().findIndex(f=>f.ref.current===o):-1,[l,o]);return e.jsx(QS,{...r,ref:d,index:m})}),QS=h.forwardRef((r,a)=>{const{__scopeSlider:l,index:o,name:c,...d}=r,m=Ao(cu,l),f=pg(cu,l),[p,y]=h.useState(null),g=lt(a,E=>y(E)),v=p?m.form||!!p.closest("form"):!0,C=Mu(p),P=m.values[o],T=P===void 0?0:wg(P,m.min,m.max),S=JS(o,m.values.length),b=C==null?void 0:C[f.size],N=b?eC(b,T,f.direction):0;return h.useEffect(()=>{if(p)return m.thumbs.add(p),()=>{m.thumbs.delete(p)}},[p,m.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${T}% + ${N}px)`},children:[e.jsx(iu.ItemSlot,{scope:r.__scopeSlider,children:e.jsx(qe.span,{role:"slider","aria-label":r["aria-label"]||S,"aria-valuemin":m.min,"aria-valuenow":P,"aria-valuemax":m.max,"aria-orientation":m.orientation,"data-orientation":m.orientation,"data-disabled":m.disabled?"":void 0,tabIndex:m.disabled?void 0:0,...d,ref:g,style:P===void 0?{display:"none"}:r.style,onFocus:He(r.onFocus,()=>{m.valueIndexToChangeRef.current=o})})}),v&&e.jsx(Ng,{name:c??(m.name?m.name+(m.values.length>1?"[]":""):void 0),form:m.form,value:P},o)]})});bg.displayName=cu;var qS="RadioBubbleInput",Ng=h.forwardRef(({__scopeSlider:r,value:a,...l},o)=>{const c=h.useRef(null),d=lt(c,o),m=_u(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(m!==a&&g){const v=new Event("input",{bubbles:!0});g.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(qe.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});Ng.displayName=qS;function XS(r=[],a,l){const o=[...r];return o[l]=a,o.sort((c,d)=>c-d)}function wg(r,a,l){const d=100/(l-a)*(r-a);return ho(d,[0,100])}function JS(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function ZS(r,a){if(r.length===1)return 0;const l=r.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function eC(r,a,l){const o=r/2,d=Vu([0,50],[0,o]);return(o-d(a)*l)*l}function tC(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function sC(r,a){if(a>0){const l=tC(r);return Math.min(...l)>=a}return!0}function Vu(r,a){return l=>{if(r[0]===r[1]||a[0]===a[1])return a[0];const o=(a[1]-a[0])/(r[1]-r[0]);return a[0]+o*(l-r[0])}}function rC(r){return(String(r).split(".")[1]||"").length}function nC(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var aC=fg,lC=vg,iC=jg,oC=bg;function cC({className:r,defaultValue:a,value:l,min:o=0,max:c=100,...d}){const m=h.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[o,c],[l,a,o,c]);return e.jsxs(aC,{defaultValue:a,value:l,min:o,max:c,className:it("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...d,children:[e.jsx(lC,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:e.jsx(iC,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:m.length},(f,p)=>e.jsx(oC,{className:"block size-4 shrink-0 rounded-full border-2 border-[#38bdac] bg-white shadow-sm focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},p))]})}const dC={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function uC(){const[r,a]=h.useState(dC),[l,o]=h.useState(!0),[c,d]=h.useState(!1);h.useEffect(()=>{Be("/api/admin/referral-settings").then(p=>{const y=p==null?void 0:p.data;y&&typeof y=="object"&&a({distributorShare:y.distributorShare??90,minWithdrawAmount:y.minWithdrawAmount??10,bindingDays:y.bindingDays??30,userDiscount:y.userDiscount??5,enableAutoWithdraw:y.enableAutoWithdraw??!1,vipOrderShareVip:y.vipOrderShareVip??20,vipOrderShareNonVip:y.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>o(!1))},[]);const m=async()=>{d(!0);try{const p={distributorShare:Number(r.distributorShare)||0,minWithdrawAmount:Number(r.minWithdrawAmount)||0,bindingDays:Number(r.bindingDays)||0,userDiscount:Number(r.userDiscount)||0,enableAutoWithdraw:!!r.enableAutoWithdraw,vipOrderShareVip:Number(r.vipOrderShareVip)||20,vipOrderShareNonVip:Number(r.vipOrderShareNonVip)||10},y=await yt("/api/admin/referral-settings",p);if(!y||y.success===!1){alert("保存失败: "+(y&&typeof y=="object"&&"error"in y?y.error:""));return}alert(`✅ 分销配置已保存成功! - -• 小程序与网站的推广规则会一起生效 -• 绑定关系会使用新的天数配置 -• 佣金比例会立即应用到新订单 - -如有缓存,请刷新前台/小程序页面。`)}catch(p){console.error(p),alert("保存失败: "+(p instanceof Error?p.message:String(p)))}finally{d(!1)}},f=p=>y=>{const g=parseFloat(y.target.value||"0");a(v=>({...v,[p]:isNaN(g)?0:g}))};return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Ra,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),e.jsxs(q,{onClick:m,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"flex items-center gap-2 text-white",children:[e.jsx(Kb,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),e.jsx(bt,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),e.jsx(ke,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Ui,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),e.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.userDiscount,onChange:f("userDiscount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Qt,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(cC,{className:"flex-1",min:10,max:100,step:1,value:[r.distributorShare],onValueChange:([p])=>a(y=>({...y,distributorShare:p}))}),e.jsx(le,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:r.distributorShare,onChange:f("distributorShare")})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["内容订单佣金 = 订单金额 ×"," ",e.jsxs("span",{className:"text-[#38bdac] font-mono",children:[r.distributorShare,"%"]}),";会员订单见下方。"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Ui,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),e.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.vipOrderShareVip,onChange:f("vipOrderShareVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Ui,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),e.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.vipOrderShareNonVip,onChange:f("vipOrderShareNonVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Qt,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),e.jsx(le,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:r.bindingDays,onChange:f("bindingDays")}),e.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"flex items-center gap-2 text-white",children:[e.jsx(Ra,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),e.jsx(bt,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),e.jsx(ke,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"最低提现金额(元)"}),e.jsx(le,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:r.minWithdrawAmount,onChange:f("minWithdrawAmount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",e.jsx(Oe,{variant:"outline",className:"border-[#38bdac]/40 text-[#38bdac] text-[10px]",children:"预留"})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[e.jsx(dt,{checked:r.enableAutoWithdraw,onCheckedChange:p=>a(y=>({...y,enableAutoWithdraw:p}))}),e.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsxs(Ye,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[e.jsx(Ui,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),e.jsxs(ke,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[e.jsxs("p",{children:["1. 以上配置会写入"," ",e.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),",小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),e.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),e.jsx("p",{children:"3. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}const Sr={name:"卡若",avatar:"K",avatarImg:"",title:"Soul派对房主理人 · 私域运营专家",bio:'每天早上6点到9点,在Soul派对房分享真实的创业故事。专注私域运营与项目变现,用"云阿米巴"模式帮助创业者构建可持续的商业体系。',stats:[{label:"商业案例",value:"62"},{label:"连续直播",value:"365天"},{label:"派对分享",value:"1000+"}],highlights:["5年私域运营经验","帮助100+品牌从0到1增长","连续创业者,擅长商业模式设计"]};function vx(r){return Array.isArray(r)?r.map(a=>a&&typeof a=="object"&&"label"in a&&"value"in a?{label:String(a.label),value:String(a.value)}:{label:"",value:""}).filter(a=>a.label||a.value):Sr.stats}function jx(r){return Array.isArray(r)?r.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):Sr.highlights}function hC(){const[r,a]=h.useState(Sr),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(!1),p=h.useRef(null);h.useEffect(()=>{Be("/api/admin/author-settings").then(N=>{const E=N==null?void 0:N.data;E&&typeof E=="object"&&a({name:String(E.name??Sr.name),avatar:String(E.avatar??Sr.avatar),avatarImg:String(E.avatarImg??""),title:String(E.title??Sr.title),bio:String(E.bio??Sr.bio),stats:vx(E.stats).length?vx(E.stats):Sr.stats,highlights:jx(E.highlights).length?jx(E.highlights):Sr.highlights})}).catch(console.error).finally(()=>o(!1))},[]);const y=async()=>{d(!0);try{const N={name:r.name,avatar:r.avatar||"K",avatarImg:r.avatarImg,title:r.title,bio:r.bio,stats:r.stats.filter(R=>R.label||R.value),highlights:r.highlights.filter(Boolean)},E=await yt("/api/admin/author-settings",N);if(!E||E.success===!1){alert("保存失败: "+(E&&typeof E=="object"&&"error"in E?E.error:""));return}d(!1);const j=document.createElement("div");j.className="fixed top-4 right-4 z-50 px-4 py-2 rounded-lg bg-[#38bdac] text-white text-sm shadow-lg",j.textContent="作者设置已保存",document.body.appendChild(j),setTimeout(()=>j.remove(),2e3)}catch(N){console.error(N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{d(!1)}},g=async N=>{var j;const E=(j=N.target.files)==null?void 0:j[0];if(E){f(!0);try{const R=new FormData;R.append("file",E),R.append("folder","avatars");const W=vu(),U={};W&&(U.Authorization=`Bearer ${W}`);const A=await(await fetch(Ia("/api/upload"),{method:"POST",body:R,credentials:"include",headers:U})).json();A!=null&&A.success&&(A!=null&&A.url)?a(I=>({...I,avatarImg:A.url})):alert("上传失败: "+((A==null?void 0:A.error)||"未知错误"))}catch(R){console.error(R),alert("上传失败")}finally{f(!1),p.current&&(p.current.value="")}}},v=()=>a(N=>({...N,stats:[...N.stats,{label:"",value:""}]})),C=N=>a(E=>({...E,stats:E.stats.filter((j,R)=>R!==N)})),P=(N,E,j)=>a(R=>({...R,stats:R.stats.map((W,U)=>U===N?{...W,[E]:j}:W)})),T=()=>a(N=>({...N,highlights:[...N.highlights,""]})),S=N=>a(E=>({...E,highlights:E.highlights.filter((j,R)=>R!==N)})),b=(N,E)=>a(j=>({...j,highlights:j.highlights.map((R,W)=>W===N?E:R)}));return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(ka,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),e.jsxs(q,{onClick:y,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"flex items-center gap-2 text-white",children:[e.jsx(ka,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),e.jsx(bt,{className:"text-gray-400",children:"作者姓名、头像、头衔与个人简介,将展示在「关于作者」页顶部。"})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"姓名"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.name,onChange:N=>a(E=>({...E,name:N.target.value})),placeholder:"卡若"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:r.avatar,onChange:N=>a(E=>({...E,avatar:N.target.value.slice(0,1)||"K"})),placeholder:"K"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Vx,{className:"w-3 h-3 text-[#38bdac]"}),"头像图片"]}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:r.avatarImg,onChange:N=>a(E=>({...E,avatarImg:N.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),e.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:g}),e.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:m,onClick:()=>{var N;return(N=p.current)==null?void 0:N.click()},children:[e.jsx(io,{className:"w-4 h-4 mr-2"}),m?"上传中...":"上传"]})]}),r.avatarImg&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:r.avatarImg.startsWith("http")?r.avatarImg:Ia(r.avatarImg),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"头衔"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.title,onChange:N=>a(E=>({...E,title:N.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"个人简介"}),e.jsx(dn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:r.bio,onChange:N=>a(E=>({...E,bio:N.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsx(Ye,{className:"text-white",children:"统计数据"}),e.jsx(bt,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),e.jsxs(ke,{className:"space-y-3",children:[r.stats.map((N,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N.label,onChange:j=>P(E,"label",j.target.value),placeholder:"标签"}),e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N.value,onChange:j=>P(E,"value",j.target.value),placeholder:"数值"}),e.jsx(q,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>C(E),children:e.jsx(fs,{className:"w-4 h-4"})})]},E)),e.jsxs(q,{variant:"outline",size:"sm",onClick:v,className:"border-gray-600 text-gray-400",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsx(Ye,{className:"text-white",children:"亮点标签"}),e.jsx(bt,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),e.jsxs(ke,{className:"space-y-3",children:[r.highlights.map((N,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N,onChange:j=>b(E,j.target.value),placeholder:"5年私域运营经验"}),e.jsx(q,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>S(E),children:e.jsx(fs,{className:"w-4 h-4"})})]},E)),e.jsxs(q,{variant:"outline",size:"sm",onClick:T,className:"border-gray-600 text-gray-400",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"添加亮点"]})]})]})]})]})}function mC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m]=h.useState(10),[f,p]=h.useState(0),[y,g]=h.useState(""),v=Tu(y,300),[C,P]=h.useState(!0),[T,S]=h.useState(null),[b,N]=h.useState(!1),[E,j]=h.useState(null),[R,W]=h.useState(""),[U,k]=h.useState(""),[A,I]=h.useState(""),[re,ie]=h.useState("admin"),[oe,te]=h.useState("active"),[J,Y]=h.useState(!1);async function ne(){var O;P(!0),S(null);try{const L=new URLSearchParams({page:String(c),pageSize:String(m)});v.trim()&&L.set("search",v.trim());const X=await Be(`/api/admin/users?${L}`);X!=null&&X.success?(a(X.records||[]),o(X.total??0),p(X.totalPages??0)):S(X.error||"加载失败")}catch(L){const X=L;S(X.status===403?"无权限访问":((O=X==null?void 0:X.data)==null?void 0:O.error)||"加载失败"),a([])}finally{P(!1)}}h.useEffect(()=>{ne()},[c,m,v]);const ve=()=>{j(null),W(""),k(""),I(""),ie("admin"),te("active"),N(!0)},$=O=>{j(O),W(O.username),k(""),I(O.name||""),ie(O.role==="super_admin"?"super_admin":"admin"),te(O.status==="disabled"?"disabled":"active"),N(!0)},ce=async()=>{var O;if(!R.trim()){S("用户名不能为空");return}if(!E&&!U){S("新建时密码必填,至少 6 位");return}if(U&&U.length<6){S("密码至少 6 位");return}S(null),Y(!0);try{if(E){const L=await gt("/api/admin/users",{id:E.id,password:U||void 0,name:A.trim(),role:re,status:oe});L!=null&&L.success?(N(!1),ne()):S((L==null?void 0:L.error)||"保存失败")}else{const L=await yt("/api/admin/users",{username:R.trim(),password:U,name:A.trim(),role:re});L!=null&&L.success?(N(!1),ne()):S((L==null?void 0:L.error)||"保存失败")}}catch(L){const X=L;S(((O=X==null?void 0:X.data)==null?void 0:O.error)||"保存失败")}finally{Y(!1)}},H=async O=>{var L;if(confirm("确定删除该管理员?"))try{const X=await Er(`/api/admin/users?id=${O}`);X!=null&&X.success?ne():S((X==null?void 0:X.error)||"删除失败")}catch(X){const K=X;S(((L=K==null?void 0:K.data)==null?void 0:L.error)||"删除失败")}},M=O=>{if(!O)return"-";try{const L=new Date(O);return isNaN(L.getTime())?O:L.toLocaleString("zh-CN")}catch{return O}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(gu,{className:"w-5 h-5 text-[#38bdac]"}),"管理员用户"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"后台登录账号管理,仅超级管理员可操作"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(le,{placeholder:"搜索用户名/昵称",value:y,onChange:O=>g(O.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),e.jsx(q,{variant:"outline",size:"sm",onClick:ne,disabled:C,className:"border-gray-600 text-gray-300",children:e.jsx($e,{className:`w-4 h-4 ${C?"animate-spin":""}`})}),e.jsxs(q,{onClick:ve,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"新增管理员"]})]})]}),T&&e.jsxs("div",{className:"mb-4 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm flex justify-between items-center",children:[e.jsx("span",{children:T}),e.jsx("button",{type:"button",onClick:()=>S(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-0",children:C?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"用户名"}),e.jsx(be,{className:"text-gray-400",children:"昵称"}),e.jsx(be,{className:"text-gray-400",children:"角色"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"创建时间"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(O=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(ye,{className:"text-gray-300",children:O.id}),e.jsx(ye,{className:"text-white font-medium",children:O.username}),e.jsx(ye,{className:"text-gray-400",children:O.name||"-"}),e.jsx(ye,{children:e.jsx(Oe,{variant:"outline",className:O.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:O.role==="super_admin"?"超级管理员":"管理员"})}),e.jsx(ye,{children:e.jsx(Oe,{variant:"outline",className:O.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:O.status==="active"?"正常":"已禁用"})}),e.jsx(ye,{className:"text-gray-500 text-sm",children:M(O.createdAt)}),e.jsxs(ye,{className:"text-right",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>$(O),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>H(O.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Wt,{className:"w-4 h-4"})})]})]},O.id)),r.length===0&&!C&&e.jsx(Je,{children:e.jsx(ye,{colSpan:7,className:"text-center py-12 text-gray-500",children:T==="无权限访问"?"仅超级管理员可查看":"暂无管理员"})})]})]}),f>1&&e.jsx("div",{className:"p-4 border-t border-gray-700/50",children:e.jsx(Hs,{page:c,pageSize:m,total:l,totalPages:f,onPageChange:d})})]})})}),e.jsx(St,{open:b,onOpenChange:N,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:E?"编辑管理员":"新增管理员"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"用户名"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:R,onChange:O=>W(O.target.value),disabled:!!E}),E&&e.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:E?"新密码(留空不改)":"密码"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:E?"留空表示不修改":"至少 6 位",value:U,onChange:O=>k(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"昵称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:A,onChange:O=>I(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{value:re,onChange:O=>ie(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"admin",children:"管理员"}),e.jsx("option",{value:"super_admin",children:"超级管理员"})]})]}),E&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"状态"}),e.jsxs("select",{value:oe,onChange:O=>te(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"active",children:"正常"}),e.jsx("option",{value:"disabled",children:"禁用"})]})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>N(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:ce,disabled:J,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),J?"保存中...":"保存"]})]})]})})]})}const fC={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},xC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},pC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...xC}},gC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0},yC=["system","author","admin"];function vC(){const[r,a]=Tj(),l=r.get("tab")??"system",o=yC.includes(l)?l:"system",[c,d]=h.useState(pC),[m,f]=h.useState(gC),[p,y]=h.useState(fC),[g,v]=h.useState(!1),[C,P]=h.useState(!0),[T,S]=h.useState(!1),[b,N]=h.useState(""),[E,j]=h.useState(""),[R,W]=h.useState(!1),[U,k]=h.useState(!1),A=(te,J,Y=!1)=>{N(te),j(J),W(Y),S(!0)};h.useEffect(()=>{(async()=>{try{const J=await Be("/api/admin/settings");if(!J||J.success===!1)return;if(J.featureConfig&&Object.keys(J.featureConfig).length&&f(Y=>({...Y,...J.featureConfig})),J.mpConfig&&typeof J.mpConfig=="object"&&y(Y=>({...Y,...J.mpConfig})),J.siteSettings&&typeof J.siteSettings=="object"){const Y=J.siteSettings;d(ne=>({...ne,...typeof Y.sectionPrice=="number"&&{sectionPrice:Y.sectionPrice},...typeof Y.baseBookPrice=="number"&&{baseBookPrice:Y.baseBookPrice},...typeof Y.distributorShare=="number"&&{distributorShare:Y.distributorShare},...Y.authorInfo&&typeof Y.authorInfo=="object"&&{authorInfo:{...ne.authorInfo,...Y.authorInfo}}}))}}catch(J){console.error("Load settings error:",J)}finally{P(!1)}})()},[]);const I=async(te,J)=>{k(!0);try{const Y=await yt("/api/admin/settings",{featureConfig:te});if(!Y||Y.success===!1){J(),A("保存失败",(Y==null?void 0:Y.error)??"未知错误",!0);return}A("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(Y){console.error("Save feature config error:",Y),J(),A("保存失败",Y instanceof Error?Y.message:String(Y),!0)}finally{k(!1)}},re=(te,J)=>{const Y=m,ne={...Y,[te]:J};f(ne),I(ne,()=>f(Y))},ie=async()=>{v(!0);try{const te=await yt("/api/admin/settings",{featureConfig:m,siteSettings:{sectionPrice:c.sectionPrice,baseBookPrice:c.baseBookPrice,distributorShare:c.distributorShare,authorInfo:c.authorInfo},mpConfig:{...p,appId:p.appId||"",withdrawSubscribeTmplId:p.withdrawSubscribeTmplId||"",mchId:p.mchId||"",minWithdraw:typeof p.minWithdraw=="number"?p.minWithdraw:10}});if(!te||te.success===!1){A("保存失败",(te==null?void 0:te.error)??"未知错误",!0);return}A("已保存","设置已保存成功。")}catch(te){console.error("Save settings error:",te),A("保存失败",te instanceof Error?te.message:String(te),!0)}finally{v(!1)}},oe=te=>{a(te==="system"?{}:{tab:te})};return C?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),o==="system"&&e.jsxs(q,{onClick:ie,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存设置"]})]}),e.jsxs(Al,{value:o,onValueChange:oe,className:"w-full",children:[e.jsxs(Fa,{className:"mb-6 bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Lt,{value:"system",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(Sa,{className:"w-4 h-4 mr-2"}),"系统设置"]}),e.jsxs(Lt,{value:"author",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(Nd,{className:"w-4 h-4 mr-2"}),"作者详情"]}),e.jsxs(Lt,{value:"admin",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(gu,{className:"w-4 h-4 mr-2"}),"管理员"]})]}),e.jsx(Ot,{value:"system",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Nd,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),e.jsx(bt,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Nd,{className:"w-3 h-3"}),"主理人名称"]}),e.jsx(le,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.name??"",onChange:te=>d(J=>({...J,authorInfo:{...J.authorInfo,name:te.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(ro,{className:"w-3 h-3"}),"开播日期"]}),e.jsx(le,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:c.authorInfo.startDate??"",onChange:te=>d(J=>({...J,authorInfo:{...J.authorInfo,startDate:te.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(ro,{className:"w-3 h-3"}),"直播时间"]}),e.jsx(le,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:c.authorInfo.liveTime??"",onChange:te=>d(J=>({...J,authorInfo:{...J.authorInfo,liveTime:te.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Wx,{className:"w-3 h-3"}),"直播平台"]}),e.jsx(le,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:c.authorInfo.platform??"",onChange:te=>d(J=>({...J,authorInfo:{...J.authorInfo,platform:te.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Ks,{className:"w-3 h-3"}),"简介描述"]}),e.jsx(le,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.description??"",onChange:te=>d(J=>({...J,authorInfo:{...J.authorInfo,description:te.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),e.jsx(dn,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:c.authorInfo.bio??"",onChange:te=>d(J=>({...J,authorInfo:{...J.authorInfo,bio:te.target.value}}))})]}),e.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-[#00CED1] to-[#20B2AA] flex items-center justify-center text-xl font-bold text-white",children:(c.authorInfo.name??"K").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-semibold",children:c.authorInfo.name}),e.jsx("p",{className:"text-gray-400 text-xs",children:c.authorInfo.description}),e.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",c.authorInfo.liveTime," · ",c.authorInfo.platform]})]})]})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(no,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),e.jsx(ke,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"单节价格 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.sectionPrice,onChange:te=>d(J=>({...J,sectionPrice:Number.parseFloat(te.target.value)||1}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"整本价格 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.baseBookPrice,onChange:te=>d(J=>({...J,baseBookPrice:Number.parseFloat(te.target.value)||9.9}))})]})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(lo,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),e.jsx(bt,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),e.jsx(ke,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"小程序 AppID"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:p.appId??"",onChange:te=>y(J=>({...J,appId:te.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"提现订阅模板 ID"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:p.withdrawSubscribeTmplId??"",onChange:te=>y(J=>({...J,withdrawSubscribeTmplId:te.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"微信支付商户号"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:p.mchId??"",onChange:te=>y(J=>({...J,mchId:te.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"最低提现金额 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.minWithdraw??10,onChange:te=>y(J=>({...J,minWithdraw:Number.parseFloat(te.target.value)||10}))})]})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Sa,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),e.jsx(bt,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qt,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(ee,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),e.jsx(dt,{id:"match-enabled",checked:m.matchEnabled,disabled:U,onCheckedChange:te=>re("matchEnabled",te)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(mb,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(ee,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),e.jsx(dt,{id:"referral-enabled",checked:m.referralEnabled,disabled:U,onCheckedChange:te=>re("referralEnabled",te)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ks,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(ee,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),e.jsx(dt,{id:"search-enabled",checked:m.searchEnabled,disabled:U,onCheckedChange:te=>re("searchEnabled",te)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Sa,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(ee,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),e.jsx(dt,{id:"about-enabled",checked:m.aboutEnabled,disabled:U,onCheckedChange:te=>re("aboutEnabled",te)})]})]}),e.jsx("div",{className:"p-3 rounded-lg bg-blue-500/10 border border-blue-500/30",children:e.jsx("p",{className:"text-xs text-blue-300",children:"💡 关闭功能后,相关入口会自动隐藏。建议在功能开发完成后再开启。"})})]})]})]})}),e.jsx(Ot,{value:"author",className:"mt-0",children:e.jsx(hC,{})}),e.jsx(Ot,{value:"admin",className:"mt-0",children:e.jsx(mC,{})})]}),e.jsx(St,{open:T,onOpenChange:S,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[e.jsxs(Ct,{children:[e.jsx(kt,{className:R?"text-red-400":"text-[#38bdac]",children:b}),e.jsx(l2,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:E})]}),e.jsx(Dt,{className:"mt-4",children:e.jsx(q,{onClick:()=>S(!1),className:R?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const bx={wechat:{enabled:!0,qrCode:"/images/wechat-pay.png",account:"卡若",websiteAppId:"",merchantId:"",groupQrCode:"/images/party-group-qr.png"},alipay:{enabled:!0,qrCode:"/images/alipay.png",account:"卡若",partnerId:"",securityKey:""},usdt:{enabled:!1,network:"TRC20",address:"",exchangeRate:7.2},paypal:{enabled:!1,email:"",exchangeRate:7.2}};function jC(){const[r,a]=h.useState(!1),[l,o]=h.useState(bx),[c,d]=h.useState(""),m=async()=>{a(!0);try{const N=await Be("/api/config");N!=null&&N.paymentMethods&&o({...bx,...N.paymentMethods})}catch(N){console.error(N)}finally{a(!1)}};h.useEffect(()=>{m()},[]);const f=async()=>{a(!0);try{await yt("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(N){console.error("保存失败:",N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{a(!1)}},p=(N,E)=>{navigator.clipboard.writeText(N),d(E),setTimeout(()=>d(""),2e3)},y=(N,E)=>{o(j=>({...j,wechat:{...j.wechat,[N]:E}}))},g=(N,E)=>{o(j=>({...j,alipay:{...j.alipay,[N]:E}}))},v=(N,E)=>{o(j=>({...j,usdt:{...j.usdt,[N]:E}}))},C=(N,E)=>{o(j=>({...j,paypal:{...j.paypal,[N]:E}}))},P=l.wechat,T=l.alipay,S=l.usdt,b=l.paypal;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),e.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(q,{variant:"outline",onClick:m,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${r?"animate-spin":""}`}),"同步配置"]}),e.jsxs(q,{onClick:f,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存配置"]})]})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(zx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"如何获取微信群跳转链接?"}),e.jsxs("ol",{className:"text-[#07C160]/80 space-y-1 list-decimal list-inside",children:[e.jsx("li",{children:"打开微信,进入目标微信群"}),e.jsx("li",{children:'点击右上角"..." → "群二维码"'}),e.jsx("li",{children:'点击右上角"..." → "发送到电脑"'}),e.jsx("li",{children:"在电脑上保存二维码图片,上传到图床获取URL"}),e.jsx("li",{children:"或使用草料二维码等工具解析二维码获取链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"提示:微信群二维码7天后失效,建议使用活码工具"})]})]})}),e.jsxs(Al,{defaultValue:"wechat",className:"space-y-6",children:[e.jsxs(Fa,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[e.jsxs(Lt,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[e.jsx(lo,{className:"w-4 h-4 mr-2"}),"微信"]}),e.jsxs(Lt,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[e.jsx(Hd,{className:"w-4 h-4 mr-2"}),"支付宝"]}),e.jsxs(Lt,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[e.jsx(Lf,{className:"w-4 h-4 mr-2"}),"USDT"]}),e.jsxs(Lt,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[e.jsx(Kd,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),e.jsx(Ot,{value:"wechat",className:"space-y-4",children:e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ye,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(lo,{className:"w-5 h-5"}),"微信支付配置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),e.jsx(dt,{checked:!!P.enabled,onCheckedChange:N=>y("enabled",N)})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"网站AppID"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.websiteAppId??""),onChange:N=>y("websiteAppId",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"商户号"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.merchantId??""),onChange:N=>y("merchantId",N.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(ao,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"微信收款码/支付链接"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(P.qrCode??""),onChange:N=>y("qrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),e.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[e.jsx(ee,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),e.jsx(le,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(P.groupQrCode??""),onChange:N=>y("groupQrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),e.jsx(Ot,{value:"alipay",className:"space-y-4",children:e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ye,{className:"text-[#1677FF] flex items-center gap-2",children:[e.jsx(Hd,{className:"w-5 h-5"}),"支付宝配置"]}),e.jsx(bt,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),e.jsx(dt,{checked:!!T.enabled,onCheckedChange:N=>g("enabled",N)})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"合作者身份 (PID)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.partnerId??""),onChange:N=>g("partnerId",N.target.value)}),e.jsx(q,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>p(String(T.partnerId??""),"pid"),children:c==="pid"?e.jsx(jo,{className:"w-4 h-4 text-green-500"}):e.jsx(Bx,{className:"w-4 h-4 text-gray-400"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"安全校验码 (Key)"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.securityKey??""),onChange:N=>g("securityKey",N.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(ao,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(T.qrCode??""),onChange:N=>g("qrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),e.jsx(Ot,{value:"usdt",className:"space-y-4",children:e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ye,{className:"text-[#26A17B] flex items-center gap-2",children:[e.jsx(Lf,{className:"w-5 h-5"}),"USDT配置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),e.jsx(dt,{checked:!!S.enabled,onCheckedChange:N=>v("enabled",N)})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"网络类型"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(S.network??"TRC20"),onChange:N=>v("network",N.target.value),children:[e.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),e.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),e.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"收款地址"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(S.address??""),onChange:N=>v("address",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(S.exchangeRate)??7.2,onChange:N=>v("exchangeRate",Number.parseFloat(N.target.value)||7.2)})]})]})]})}),e.jsx(Ot,{value:"paypal",className:"space-y-4",children:e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ye,{className:"text-[#169BD7] flex items-center gap-2",children:[e.jsx(Kd,{className:"w-5 h-5"}),"PayPal配置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),e.jsx(dt,{checked:!!b.enabled,onCheckedChange:N=>C("enabled",N)})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"PayPal邮箱"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(b.email??""),onChange:N=>C("email",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:N=>C("exchangeRate",Number(N.target.value)||7.2)})]})]})]})})]})]})}const bC={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},NC={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},wC={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function SC(){const[r,a]=h.useState({siteConfig:{...bC},menuConfig:{...NC},pageConfig:{...wC}}),[l,o]=h.useState(!1),[c,d]=h.useState(!1);h.useEffect(()=>{Be("/api/config").then(g=>{g!=null&&g.siteConfig&&a(v=>({...v,siteConfig:{...v.siteConfig,...g.siteConfig}})),g!=null&&g.menuConfig&&a(v=>({...v,menuConfig:{...v.menuConfig,...g.menuConfig}})),g!=null&&g.pageConfig&&a(v=>({...v,pageConfig:{...v.pageConfig,...g.pageConfig}}))}).catch(console.error)},[]);const m=async()=>{d(!0);try{await yt("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await yt("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await yt("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),o(!0),setTimeout(()=>o(!1),2e3),alert("配置已保存")}catch(g){console.error(g),alert("保存失败: "+(g instanceof Error?g.message:String(g)))}finally{d(!1)}},f=r.siteConfig,p=r.menuConfig,y=r.pageConfig;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"网站配置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置网站名称、图标、菜单和页面标题"})]}),e.jsxs(q,{onClick:m,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Kd,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),e.jsx(bt,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),e.jsx(le,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteName??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteName:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),e.jsx(le,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteTitle??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),e.jsx(le,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteDescription??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteDescription:g.target.value}}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),e.jsx(le,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:f.logo??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,logo:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),e.jsx(le,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:f.favicon??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,favicon:g.target.value}}))})]})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Vb,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),e.jsx(bt,{className:"text-gray-400",children:"配置网站主题色"})]}),e.jsx(ke,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(ee,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(le,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:f.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:f.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))})]})]}),e.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:f.primaryColor??"#00CED1"},children:"预览"})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Fb,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),e.jsx(bt,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),e.jsx(ke,{className:"space-y-4",children:Object.entries(p).map(([g,v])=>e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx(dt,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:C=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,enabled:C}}}))}),e.jsx("span",{className:"text-gray-300 w-16 capitalize",children:g}),e.jsx(le,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(v==null?void 0:v.label)??"",onChange:C=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,label:C.target.value}}}))})]}),e.jsx("span",{className:`text-sm ${v!=null&&v.enabled?"text-green-400":"text-gray-500"}`,children:v!=null&&v.enabled?"显示":"隐藏"})]},g))})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(cb,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"首页标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"首页副标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeSubtitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeSubtitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"目录页标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.chaptersTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,chaptersTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"匹配页标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.matchTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,matchTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"我的页标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.myTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,myTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"关于作者标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.aboutTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:g.target.value}}))})]})]})]})]})]})]})}function CC(){const[r,a]=h.useState(""),[l,o]=h.useState(""),[c,d]=h.useState(""),[m,f]=h.useState({}),p=async()=>{var P,T,S,b;try{const N=await Be("/api/config"),E=(T=(P=N==null?void 0:N.liveQRCodes)==null?void 0:P[0])==null?void 0:T.urls;Array.isArray(E)&&a(E.join(` -`));const j=(b=(S=N==null?void 0:N.paymentMethods)==null?void 0:S.wechat)==null?void 0:b.groupQrCode;j&&o(j),f({paymentMethods:N==null?void 0:N.paymentMethods,liveQRCodes:N==null?void 0:N.liveQRCodes})}catch(N){console.error(N)}};h.useEffect(()=>{p()},[]);const y=(P,T)=>{navigator.clipboard.writeText(P),d(T),setTimeout(()=>d(""),2e3)},g=async()=>{try{const P=r.split(` -`).map(S=>S.trim()).filter(Boolean),T=[...m.liveQRCodes||[]];T[0]?T[0].urls=P:T.push({id:"live-1",name:"微信群活码",urls:P,clickCount:0}),await yt("/api/db/config",{key:"live_qr_codes",value:T,description:"群活码配置"}),alert("群活码配置已保存!"),await p()}catch(P){console.error(P),alert("保存失败: "+(P instanceof Error?P.message:String(P)))}},v=async()=>{var P;try{await yt("/api/db/config",{key:"payment_methods",value:{...m.paymentMethods||{},wechat:{...((P=m.paymentMethods)==null?void 0:P.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await p()}catch(T){console.error(T),alert("保存失败: "+(T instanceof Error?T.message:String(T)))}},C=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(zx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),e.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[e.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:"访问草料二维码创建活码"}),e.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),e.jsx("li",{children:"复制生成的短链接填入下方配置"}),e.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),e.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),e.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意:微信原生群二维码7天后失效,建议使用草料活码"})]})]})]})}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx($f,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),e.jsx(bt,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(zf,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(le,{placeholder:"https://cli.im/xxxxx 或 https://weixin.qq.com/g/...",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",value:l,onChange:P=>o(P.target.value)}),e.jsx(q,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>y(l,"group"),children:c==="group"?e.jsx(jo,{className:"w-4 h-4 text-green-500"}):e.jsx(Bx,{className:"w-4 h-4 text-gray-400"})})]}),e.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[e.jsx(ao,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(q,{onClick:v,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[e.jsx(io,{className:"w-4 h-4 mr-2"}),"保存配置"]}),e.jsxs(q,{onClick:C,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[e.jsx(ao,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx($f,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),e.jsx(bt,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ee,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(zf,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),e.jsx(dn,{placeholder:"https://cli.im/group1\\nhttps://cli.im/group2",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 min-h-[120px] font-mono text-sm",value:r,onChange:P=>a(P.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"每行填写一个群链接,系统将按顺序或随机分配"})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"已配置群数量"}),e.jsxs("span",{className:"font-bold text-[#38bdac]",children:[r.split(` -`).filter(Boolean).length," 个"]})]}),e.jsxs(q,{onClick:g,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(io,{className:"w-4 h-4 mr-2"}),"保存多群配置"]})]})]})]}),e.jsxs("div",{className:"mt-6 bg-[#0f2137] rounded-xl p-4 border border-gray-700/50",children:[e.jsx("h4",{className:"text-white font-medium mb-3",children:"常见问题"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[#38bdac]",children:"Q: 为什么推荐使用草料活码?"}),e.jsx("p",{className:"text-gray-400",children:"A: 草料活码是永久链接,群满后可直接在后台更换新群码,无需修改网站配置。微信原生群码7天失效。"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[#38bdac]",children:"Q: 支付后没有跳转怎么办?"}),e.jsx("p",{className:"text-gray-400",children:"A: 1) 检查链接是否正确填写 2) 部分浏览器可能拦截弹窗,用户需手动允许 3) 建议使用https开头的链接"})]})]})]})]})}const Nx={matchTypes:[{id:"partner",label:"创业合伙",matchLabel:"创业伙伴",icon:"⭐",matchFromDB:!0,showJoinAfterMatch:!1,price:1,enabled:!0},{id:"investor",label:"资源对接",matchLabel:"资源对接",icon:"👥",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"mentor",label:"导师顾问",matchLabel:"导师顾问",icon:"❤️",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"team",label:"团队招募",matchLabel:"加入项目",icon:"🎮",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}],freeMatchLimit:3,matchPrice:1,settings:{enableFreeMatches:!0,enablePaidMatches:!0,maxMatchesPerDay:10}},kC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function EC(){const[r,a]=h.useState(Nx),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(!1),[p,y]=h.useState(null),[g,v]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await Be("/api/db/config/full?key=match_config"),R=(j==null?void 0:j.data)??(j==null?void 0:j.config);R&&a({...Nx,...R})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};h.useEffect(()=>{C()},[]);const P=async()=>{d(!0);try{const j=await yt("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});j&&j.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(j&&typeof j=="object"&&"error"in j?j.error:"未知错误"))}catch(j){console.error("保存配置失败:",j),alert("保存失败")}finally{d(!1)}},T=j=>{y(j),v({id:j.id,label:j.label,matchLabel:j.matchLabel,icon:j.icon,matchFromDB:j.matchFromDB,showJoinAfterMatch:j.showJoinAfterMatch,price:j.price,enabled:j.enabled}),f(!0)},S=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},b=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const j=[...r.matchTypes];if(p){const R=j.findIndex(W=>W.id===p.id);R!==-1&&(j[R]={...g})}else{if(j.some(R=>R.id===g.id)){alert("类型ID已存在");return}j.push({...g})}a({...r,matchTypes:j}),f(!1)},N=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(R=>R.id!==j)})},E=j=>{a({...r,matchTypes:r.matchTypes.map(R=>R.id===j?{...R,enabled:!R.enabled}:R)})};return e.jsxs("div",{className:"p-8 w-full space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Sa,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(q,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),e.jsxs(q,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(nn,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(ke,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:j=>a({...r,freeMatchLimit:parseInt(j.target.value,10)||0})}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:j=>a({...r,matchPrice:parseFloat(j.target.value)||1})}),e.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(le,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:j=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})}),e.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:r.settings.enableFreeMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enableFreeMatches:j}})}),e.jsx(ee,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:r.settings.enablePaidMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enablePaidMatches:j}})}),e.jsx(ee,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),e.jsx(bt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(q,{onClick:S,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),e.jsx(ke,{children:e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"图标"}),e.jsx(be,{className:"text-gray-400",children:"类型ID"}),e.jsx(be,{className:"text-gray-400",children:"显示名称"}),e.jsx(be,{className:"text-gray-400",children:"匹配标签"}),e.jsx(be,{className:"text-gray-400",children:"价格"}),e.jsx(be,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(gs,{children:r.matchTypes.map(j=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(ye,{className:"font-mono text-gray-300",children:j.id}),e.jsx(ye,{className:"text-white font-medium",children:j.label}),e.jsx(ye,{className:"text-gray-300",children:j.matchLabel}),e.jsx(ye,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(ye,{children:j.matchFromDB?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(ye,{children:e.jsx(dt,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(ye,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>N(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Wt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(St,{open:m,onOpenChange:f,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[p?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Pt,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:j=>v({...g,id:j.target.value}),disabled:!!p})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:kC.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"显示名称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:g.label,onChange:j=>v({...g,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"匹配标签"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:g.matchLabel,onChange:j=>v({...g,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:j=>v({...g,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:g.matchFromDB,onCheckedChange:j=>v({...g,matchFromDB:j})}),e.jsx(ee,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:g.showJoinAfterMatch,onCheckedChange:j=>v({...g,showJoinAfterMatch:j})}),e.jsx(ee,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:g.enabled,onCheckedChange:j=>v({...g,enabled:j})}),e.jsx(ee,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>f(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(q,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const wx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function PC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(""),[g,v]=h.useState(!0),[C,P]=h.useState(null);async function T(){v(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(m)});p&&b.set("matchType",p);const N=await Be(`/api/db/match-records?${b}`);N!=null&&N.success?(a(N.records||[]),o(N.total??0)):P("加载匹配记录失败")}catch(b){console.error("加载匹配记录失败",b),P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{T()},[c,p]);const S=Math.ceil(l/m)||1;return e.jsxs("div",{className:"p-8 w-full",children:[C&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"匹配记录"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["找伙伴匹配统计,共 ",l," 条记录"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:b=>{y(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(wx).map(([b,N])=>e.jsx("option",{value:b,children:N},b))]}),e.jsxs("button",{type:"button",onClick:T,disabled:g,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${g?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(gs,{children:[r.map(b=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.userAvatar?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none";const E=N.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.matchedUserAvatar?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none";const E=N.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(ye,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:wx[b.matchType]||b.matchType})}),e.jsxs(ye,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(ye,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Hs,{page:c,totalPages:S,total:l,pageSize:m,onPageChange:d,onPageSizeChange:b=>{f(b),d(1)}})]})})})]})}function TC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(null),[p,y]=h.useState(""),[g,v]=h.useState(0),[C,P]=h.useState(!1);async function T(){o(!0);try{const j=await Be("/api/db/vip-roles");j!=null&&j.success&&j.data&&a(j.data)}catch(j){console.error("Load roles error:",j)}finally{o(!1)}}h.useEffect(()=>{T()},[]);const S=()=>{f(null),y(""),v(r.length>0?Math.max(...r.map(j=>j.sort))+1:0),d(!0)},b=j=>{f(j),y(j.name),v(j.sort),d(!0)},N=async()=>{if(!p.trim()){alert("角色名称不能为空");return}P(!0);try{if(m){const j=await gt("/api/db/vip-roles",{id:m.id,name:p.trim(),sort:g});j!=null&&j.success?(d(!1),T()):alert("更新失败: "+(j==null?void 0:j.error))}else{const j=await yt("/api/db/vip-roles",{name:p.trim(),sort:g});j!=null&&j.success?(d(!1),T()):alert("新增失败: "+(j==null?void 0:j.error))}}catch(j){console.error("Save error:",j),alert("保存失败")}finally{P(!1)}},E=async j=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const R=await Er(`/api/db/vip-roles?id=${j}`);R!=null&&R.success?T():alert("删除失败: "+(R==null?void 0:R.error))}catch(R){console.error("Delete error:",R),alert("删除失败")}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(kr,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),e.jsxs(q,{onClick:S,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"角色名称"}),e.jsx(be,{className:"text-gray-400",children:"排序"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(j=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(ye,{className:"text-gray-300",children:j.id}),e.jsx(ye,{className:"text-white",children:j.name}),e.jsx(ye,{className:"text-gray-400",children:j.sort}),e.jsxs(ye,{className:"text-right",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>b(j),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>E(j.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Wt,{className:"w-4 h-4"})})]})]},j.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),e.jsx(St,{open:c,onOpenChange:d,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:m?"编辑角色":"新增角色"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"角色名称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:p,onChange:j=>y(j.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:g,onChange:j=>v(parseInt(j.target.value,10)||0)})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:N,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),C?"保存中...":"保存"]})]})]})})]})}function RC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(null),[p,y]=h.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[g,v]=h.useState(!1),[C,P]=h.useState(!1),T=h.useRef(null),S=async k=>{var I;const A=(I=k.target.files)==null?void 0:I[0];if(A){P(!0);try{const re=new FormData;re.append("file",A),re.append("folder","mentors");const ie=vu(),oe={};ie&&(oe.Authorization=`Bearer ${ie}`);const J=await(await fetch(Ia("/api/upload"),{method:"POST",body:re,credentials:"include",headers:oe})).json();J!=null&&J.success&&(J!=null&&J.url)?y(Y=>({...Y,avatar:J.url})):alert("上传失败: "+((J==null?void 0:J.error)||"未知错误"))}catch(re){console.error(re),alert("上传失败")}finally{P(!1),T.current&&(T.current.value="")}}};async function b(){o(!0);try{const k=await Be("/api/db/mentors");k!=null&&k.success&&k.data&&a(k.data)}catch(k){console.error("Load mentors error:",k)}finally{o(!1)}}h.useEffect(()=>{b()},[]);const N=()=>{y({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:r.length>0?Math.max(...r.map(k=>k.sort))+1:0,enabled:!0})},E=()=>{f(null),N(),d(!0)},j=k=>{f(k),y({name:k.name,avatar:k.avatar||"",intro:k.intro||"",tags:k.tags||"",priceSingle:k.priceSingle!=null?String(k.priceSingle):"",priceHalfYear:k.priceHalfYear!=null?String(k.priceHalfYear):"",priceYear:k.priceYear!=null?String(k.priceYear):"",quote:k.quote||"",whyFind:k.whyFind||"",offering:k.offering||"",judgmentStyle:k.judgmentStyle||"",sort:k.sort,enabled:k.enabled??!0}),d(!0)},R=async()=>{if(!p.name.trim()){alert("导师姓名不能为空");return}v(!0);try{const k=I=>I===""?void 0:parseFloat(I),A={name:p.name.trim(),avatar:p.avatar.trim()||void 0,intro:p.intro.trim()||void 0,tags:p.tags.trim()||void 0,priceSingle:k(p.priceSingle),priceHalfYear:k(p.priceHalfYear),priceYear:k(p.priceYear),quote:p.quote.trim()||void 0,whyFind:p.whyFind.trim()||void 0,offering:p.offering.trim()||void 0,judgmentStyle:p.judgmentStyle.trim()||void 0,sort:p.sort,enabled:p.enabled};if(m){const I=await gt("/api/db/mentors",{id:m.id,...A});I!=null&&I.success?(d(!1),b()):alert("更新失败: "+(I==null?void 0:I.error))}else{const I=await yt("/api/db/mentors",A);I!=null&&I.success?(d(!1),b()):alert("新增失败: "+(I==null?void 0:I.error))}}catch(k){console.error("Save error:",k),alert("保存失败")}finally{v(!1)}},W=async k=>{if(confirm("确定删除该导师?"))try{const A=await Er(`/api/db/mentors?id=${k}`);A!=null&&A.success?b():alert("删除失败: "+(A==null?void 0:A.error))}catch(A){console.error("Delete error:",A),alert("删除失败")}},U=k=>k!=null?`¥${k}`:"-";return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),e.jsxs(q,{onClick:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"姓名"}),e.jsx(be,{className:"text-gray-400",children:"简介"}),e.jsx(be,{className:"text-gray-400",children:"单次"}),e.jsx(be,{className:"text-gray-400",children:"半年"}),e.jsx(be,{className:"text-gray-400",children:"年度"}),e.jsx(be,{className:"text-gray-400",children:"排序"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(k=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(ye,{className:"text-gray-300",children:k.id}),e.jsx(ye,{className:"text-white",children:k.name}),e.jsx(ye,{className:"text-gray-400 max-w-[200px] truncate",children:k.intro||"-"}),e.jsx(ye,{className:"text-gray-400",children:U(k.priceSingle)}),e.jsx(ye,{className:"text-gray-400",children:U(k.priceHalfYear)}),e.jsx(ye,{className:"text-gray-400",children:U(k.priceYear)}),e.jsx(ye,{className:"text-gray-400",children:k.sort}),e.jsxs(ye,{className:"text-right",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>j(k),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>W(k.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Wt,{className:"w-4 h-4"})})]})]},k.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),e.jsx(St,{open:c,onOpenChange:d,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:m?"编辑导师":"新增导师"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"姓名 *"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:p.name,onChange:k=>y(A=>({...A,name:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"排序"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.sort,onChange:k=>y(A=>({...A,sort:parseInt(k.target.value,10)||0}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"头像"}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:p.avatar,onChange:k=>y(A=>({...A,avatar:k.target.value})),placeholder:"点击上传或粘贴图片地址"}),e.jsx("input",{ref:T,type:"file",accept:"image/*",className:"hidden",onChange:S}),e.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:C,onClick:()=>{var k;return(k=T.current)==null?void 0:k.click()},children:[e.jsx(io,{className:"w-4 h-4 mr-2"}),C?"上传中...":"上传"]})]}),p.avatar&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:p.avatar.startsWith("http")?p.avatar:Ia(p.avatar),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"简介"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:p.intro,onChange:k=>y(A=>({...A,intro:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:p.tags,onChange:k=>y(A=>({...A,tags:k.target.value}))})]}),e.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[e.jsx(ee,{className:"text-gray-300 block mb-2",children:"价格配置(每个导师独立)"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),e.jsx(le,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:p.priceSingle,onChange:k=>y(A=>({...A,priceSingle:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),e.jsx(le,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:p.priceHalfYear,onChange:k=>y(A=>({...A,priceHalfYear:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),e.jsx(le,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:p.priceYear,onChange:k=>y(A=>({...A,priceYear:k.target.value}))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"引言"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:p.quote,onChange:k=>y(A=>({...A,quote:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"为什么找(文本)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:p.whyFind,onChange:k=>y(A=>({...A,whyFind:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"提供什么(文本)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:p.offering,onChange:k=>y(A=>({...A,offering:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:p.judgmentStyle,onChange:k=>y(A=>({...A,judgmentStyle:k.target.value}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:p.enabled,onChange:k=>y(A=>({...A,enabled:k.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),e.jsx(ee,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:R,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存"]})]})]})})]})}function IC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState("");async function m(){o(!0);try{const y=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",g=await Be(y);g!=null&&g.success&&g.data&&a(g.data)}catch(y){console.error("Load consultations error:",y)}finally{o(!1)}}h.useEffect(()=>{m()},[c]);const f={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},p={single:"单次",half_year:"半年",year:"年度"};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(ro,{className:"w-5 h-5 text-[#38bdac]"}),"导师预约列表"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师咨询预约记录"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:y=>d(y.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(f).map(([y,g])=>e.jsx("option",{value:y,children:g},y))]}),e.jsxs(q,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"用户ID"}),e.jsx(be,{className:"text-gray-400",children:"导师ID"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"金额"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(gs,{children:[r.map(y=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(ye,{className:"text-gray-300",children:y.id}),e.jsx(ye,{className:"text-gray-400",children:y.userId}),e.jsx(ye,{className:"text-gray-400",children:y.mentorId}),e.jsx(ye,{className:"text-gray-400",children:p[y.consultationType]||y.consultationType}),e.jsxs(ye,{className:"text-white",children:["¥",y.amount]}),e.jsx(ye,{className:"text-gray-400",children:f[y.status]||y.status}),e.jsx(ye,{className:"text-gray-500 text-sm",children:y.createdAt})]},y.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}const Sx={matchTypes:[{id:"partner",label:"超级个体",matchLabel:"超级个体",icon:"⭐",matchFromDB:!0,showJoinAfterMatch:!1,price:1,enabled:!0},{id:"investor",label:"资源对接",matchLabel:"资源对接",icon:"👥",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"mentor",label:"导师顾问",matchLabel:"导师顾问",icon:"❤️",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"team",label:"团队招募",matchLabel:"加入项目",icon:"🎮",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}],freeMatchLimit:3,matchPrice:1,settings:{enableFreeMatches:!0,enablePaidMatches:!0,maxMatchesPerDay:10}},_C=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function MC(){const[r,a]=h.useState(Sx),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(!1),[p,y]=h.useState(null),[g,v]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await Be("/api/db/config/full?key=match_config"),R=(j==null?void 0:j.data)??(j==null?void 0:j.config);R&&a({...Sx,...R})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};h.useEffect(()=>{C()},[]);const P=async()=>{d(!0);try{const j=await yt("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});alert((j==null?void 0:j.success)!==!1?"配置保存成功!":"保存失败: "+((j==null?void 0:j.error)||"未知错误"))}catch(j){console.error(j),alert("保存失败")}finally{d(!1)}},T=j=>{y(j),v({...j}),f(!0)},S=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},b=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const j=[...r.matchTypes];if(p){const R=j.findIndex(W=>W.id===p.id);R!==-1&&(j[R]={...g})}else{if(j.some(R=>R.id===g.id)){alert("类型ID已存在");return}j.push({...g})}a({...r,matchTypes:j}),f(!1)},N=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(R=>R.id!==j)})},E=j=>{a({...r,matchTypes:r.matchTypes.map(R=>R.id===j?{...R,enabled:!R.enabled}:R)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsxs(q,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]}),e.jsxs(q,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"})," ",c?"保存中...":"保存配置"]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(nn,{className:"w-5 h-5 text-yellow-400"})," 基础设置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(ke,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:j=>a({...r,freeMatchLimit:parseInt(j.target.value,10)||0})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:j=>a({...r,matchPrice:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(le,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:j=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:r.settings.enableFreeMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enableFreeMatches:j}})}),e.jsx(ee,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:r.settings.enablePaidMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enablePaidMatches:j}})}),e.jsx(ee,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"})," 匹配类型管理"]}),e.jsx(bt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(q,{onClick:S,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-1"})," 添加类型"]})]}),e.jsx(ke,{children:e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"图标"}),e.jsx(be,{className:"text-gray-400",children:"类型ID"}),e.jsx(be,{className:"text-gray-400",children:"显示名称"}),e.jsx(be,{className:"text-gray-400",children:"匹配标签"}),e.jsx(be,{className:"text-gray-400",children:"价格"}),e.jsx(be,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(gs,{children:r.matchTypes.map(j=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(ye,{className:"font-mono text-gray-300",children:j.id}),e.jsx(ye,{className:"text-white font-medium",children:j.label}),e.jsx(ye,{className:"text-gray-300",children:j.matchLabel}),e.jsx(ye,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(ye,{children:j.matchFromDB?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(ye,{children:e.jsx(dt,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(ye,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>N(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Wt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(St,{open:m,onOpenChange:f,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[p?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Pt,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:j=>v({...g,id:j.target.value}),disabled:!!p})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:_C.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"显示名称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:g.label,onChange:j=>v({...g,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"匹配标签"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:g.matchLabel,onChange:j=>v({...g,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:j=>v({...g,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:g.matchFromDB,onCheckedChange:j=>v({...g,matchFromDB:j})}),e.jsx(ee,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:g.showJoinAfterMatch,onCheckedChange:j=>v({...g,showJoinAfterMatch:j})}),e.jsx(ee,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:g.enabled,onCheckedChange:j=>v({...g,enabled:j})}),e.jsx(ee,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>f(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(q,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"})," 保存"]})]})]})})]})}const Cx={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function AC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(""),[g,v]=h.useState(!0),[C,P]=h.useState(null);async function T(){v(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(m)});p&&b.set("matchType",p);const N=await Be(`/api/db/match-records?${b}`);N!=null&&N.success?(a(N.records||[]),o(N.total??0)):P("加载匹配记录失败")}catch{P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{T()},[c,p]);const S=Math.ceil(l/m)||1;return e.jsxs("div",{children:[C&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("p",{className:"text-gray-400",children:["共 ",l," 条匹配记录"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:b=>{y(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(Cx).map(([b,N])=>e.jsx("option",{value:b,children:N},b))]}),e.jsxs("button",{type:"button",onClick:T,disabled:g,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${g?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(gs,{children:[r.map(b=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.userAvatar?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none"}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.matchedUserAvatar?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none"}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(ye,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Cx[b.matchType]||b.matchType})}),e.jsxs(ye,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(ye,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Hs,{page:c,totalPages:S,total:l,pageSize:m,onPageChange:d,onPageSizeChange:b=>{f(b),d(1)}})]})})})]})}function DC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(!0);async function g(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(m),matchType:"investor"}),P=await Be(`/api/db/match-records?${C}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(C){console.error(C)}finally{y(!1)}}h.useEffect(()=>{g()},[c]);const v=Math.ceil(l/m)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["资源对接匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户填写「我能帮到你什么」和「我需要什么帮助」后提交到存客宝"})]}),e.jsxs("button",{type:"button",onClick:g,disabled:p,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${p?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(gs,{children:[r.map(C=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(ye,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(ye,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(ye,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无资源对接记录"})})]})]}),e.jsx(Hs,{page:c,totalPages:v,total:l,pageSize:m,onPageChange:d,onPageSizeChange:C=>{f(C),d(1)}})]})})})]})}const kx={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},LC={single:"单次",half_year:"半年",year:"年度"};function OC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState("");async function m(){o(!0);try{const f=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",p=await Be(f);p!=null&&p.success&&p.data&&a(p.data)}catch(f){console.error(f)}finally{o(!1)}}return h.useEffect(()=>{m()},[c]),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("p",{className:"text-gray-400",children:"导师咨询预约记录"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:f=>d(f.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(kx).map(([f,p])=>e.jsx("option",{value:f,children:p},f))]}),e.jsxs(q,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"用户ID"}),e.jsx(be,{className:"text-gray-400",children:"导师ID"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"金额"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(gs,{children:[r.map(f=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(ye,{className:"text-gray-300",children:f.id}),e.jsx(ye,{className:"text-gray-400",children:f.userId}),e.jsx(ye,{className:"text-gray-400",children:f.mentorId}),e.jsx(ye,{className:"text-gray-400",children:LC[f.consultationType]||f.consultationType}),e.jsxs(ye,{className:"text-white",children:["¥",f.amount]}),e.jsx(ye,{className:"text-gray-400",children:kx[f.status]||f.status}),e.jsx(ye,{className:"text-gray-500 text-sm",children:f.createdAt?new Date(f.createdAt).toLocaleString():"-"})]},f.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function FC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(!0);async function g(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(m),matchType:"team"}),P=await Be(`/api/db/match-records?${C}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(C){console.error(C)}finally{y(!1)}}h.useEffect(()=>{g()},[c]);const v=Math.ceil(l/m)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["团队招募匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户通过「团队招募」提交联系方式到存客宝"})]}),e.jsxs("button",{type:"button",onClick:g,disabled:p,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${p?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(gs,{children:[r.map(C=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(ye,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(ye,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(ye,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无团队招募记录"})})]})]}),e.jsx(Hs,{page:c,totalPages:v,total:l,pageSize:m,onPageChange:d,onPageSizeChange:C=>{f(C),d(1)}})]})})})]})}function zC(){const[r,a]=h.useState(null),[l,o]=h.useState(!0),[c,d]=h.useState([{endpoint:"/api/ckb/join",label:"CKB 加入(ckb/join)",status:"idle"},{endpoint:"/api/ckb/match",label:"CKB 匹配上报(ckb/match)",status:"idle"},{endpoint:"/api/miniprogram/ckb/lead",label:"CKB 链接卡若(ckb/lead)",status:"idle"},{endpoint:"/api/match/config",label:"匹配配置(match/config)",status:"idle"}]),m={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"},f=h.useCallback(async()=>{o(!0);try{const g=await Be("/api/db/match-records?stats=true");if(g!=null&&g.success&&g.data)a(g.data);else{const v=await Be("/api/db/match-records?page=1&pageSize=1");v!=null&&v.success&&a({totalMatches:v.total??0,todayMatches:0,byType:[],uniqueUsers:0})}}catch(g){console.error("加载统计失败:",g)}finally{o(!1)}},[]);h.useEffect(()=>{f()},[f]);const p=async g=>{const v=c[g],C=[...c];C[g]={...v,status:"testing",message:void 0,responseTime:void 0},d(C);const P=performance.now();try{let T;v.endpoint.includes("match/config")?T=await Be(v.endpoint):T=await yt(v.endpoint,{type:"partner",phone:"00000000000",wechat:"test_ping",userId:"test_admin_ping",matchType:"partner",name:"接口测试"});const S=Math.round(performance.now()-P),b=[...c],N=(T==null?void 0:T.success)!==void 0||(T==null?void 0:T.code)===200||(T==null?void 0:T.code)===400;b[g]={...v,status:N?"success":"error",message:(T==null?void 0:T.message)||(N?"接口可用":"响应异常"),responseTime:S},d(b)}catch(T){const S=Math.round(performance.now()-P),b=[...c];b[g]={...v,status:"error",message:T instanceof Error?T.message:"请求失败",responseTime:S},d(b)}},y=async()=>{for(let g=0;g0&&e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white text-lg",children:"按类型分布"})}),e.jsx(ke,{children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:r.byType.map(g=>e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-4 text-center",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:m[g.matchType]||g.matchType}),e.jsx("p",{className:"text-2xl font-bold text-white mt-2",children:g.count}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[r.totalMatches>0?(g.count/r.totalMatches*100).toFixed(1):0,"%"]})]},g.matchType))})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(ln,{className:"w-5 h-5 text-[#38bdac]"}),"存客宝接口连通性测试"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"测试所有找伙伴相关的 CKB 接口是否正常可用"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(q,{onClick:f,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新统计"]}),e.jsxs(q,{onClick:y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(nn,{className:"w-4 h-4 mr-2"})," 全部测试"]})]})]}),e.jsx(ke,{children:e.jsx("div",{className:"space-y-3",children:c.map((g,v)=>e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[g.status==="idle"&&e.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-500"}),g.status==="testing"&&e.jsx($e,{className:"w-4 h-4 text-yellow-400 animate-spin"}),g.status==="success"&&e.jsx(Vd,{className:"w-4 h-4 text-green-400"}),g.status==="error"&&e.jsx($x,{className:"w-4 h-4 text-red-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm font-medium",children:g.label}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:g.endpoint})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[g.message&&e.jsx("span",{className:`text-xs ${g.status==="success"?"text-green-400":g.status==="error"?"text-red-400":"text-gray-400"}`,children:g.message}),g.responseTime!==void 0&&e.jsxs(Oe,{className:"bg-gray-700 text-gray-300 border-0",children:[g.responseTime,"ms"]}),e.jsx(q,{size:"sm",variant:"outline",onClick:()=>p(v),disabled:g.status==="testing",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent text-xs",children:"测试"})]})]},g.endpoint))})})]})]})}const $C=[{id:"pool",label:"匹配池",icon:Qt},{id:"records",label:"匹配记录",icon:Ib},{id:"resource",label:"资源对接",icon:jb},{id:"mentor",label:"导师预约",icon:Ux},{id:"team",label:"团队招募",icon:Gd},{id:"stats",label:"存客宝统计",icon:Bj}];function BC(){const[r,a]=h.useState("pool");return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-6 h-6 text-[#38bdac]"}),"找伙伴"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理匹配池、匹配记录、资源对接、导师预约、团队招募及存客宝数据统计"})]}),e.jsx("div",{className:"flex gap-1 mb-6 bg-[#0f2137] rounded-lg p-1 border border-gray-700/50",children:$C.map(l=>{const o=r===l.id;return e.jsxs("button",{type:"button",onClick:()=>a(l.id),className:`flex items-center gap-2 px-4 py-2.5 rounded-md text-sm font-medium transition-all ${o?"bg-[#38bdac] text-white shadow-lg":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:[e.jsx(l.icon,{className:"w-4 h-4"}),l.label]},l.id)})}),r==="pool"&&e.jsx(MC,{}),r==="records"&&e.jsx(AC,{}),r==="resource"&&e.jsx(DC,{}),r==="mentor"&&e.jsx(OC,{}),r==="team"&&e.jsx(FC,{}),r==="stats"&&e.jsx(zC,{})]})}function UC(){return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[e.jsx(ln,{className:"w-8 h-8 text-[#38bdac]"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"API 接口文档"})]}),e.jsx("p",{className:"text-gray-400 mb-6",children:"API 风格:RESTful · 版本 v1.0 · 基础路径 /api · 简单、清晰、易用。"}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"1. 接口总览"})}),e.jsxs(ke,{className:"space-y-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"接口分类"}),e.jsxs("ul",{className:"space-y-1 text-gray-300 font-mono",children:[e.jsx("li",{children:"/api/book — 书籍内容(章节列表、内容获取、同步)"}),e.jsx("li",{children:"/api/payment — 支付系统(订单创建、回调、状态查询)"}),e.jsx("li",{children:"/api/referral — 分销系统(邀请码、收益、提现)"}),e.jsx("li",{children:"/api/user — 用户系统(登录、注册、信息更新)"}),e.jsx("li",{children:"/api/match — 匹配系统(寻找匹配、匹配历史)"}),e.jsx("li",{children:"/api/admin — 管理后台(内容/订单/用户/分销管理)"}),e.jsx("li",{children:"/api/config — 配置系统"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"认证方式"}),e.jsx("p",{className:"text-gray-300",children:"用户:Cookie session_id(可选)"}),e.jsx("p",{className:"text-gray-300",children:"管理端:Authorization: Bearer admin-token-secret"})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"2. 书籍内容"})}),e.jsxs(ke,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET /api/book/all-chapters — 获取所有章节"}),e.jsx("p",{children:"GET /api/book/chapter/:id — 获取单章内容"}),e.jsx("p",{children:"POST /api/book/sync — 同步章节(需管理员认证)"})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"3. 支付"})}),e.jsxs(ke,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"POST /api/payment/create-order — 创建订单"}),e.jsx("p",{children:"POST /api/payment/alipay/notify — 支付宝回调"}),e.jsx("p",{children:"POST /api/payment/wechat/notify — 微信回调"})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"4. 分销与用户"})}),e.jsxs(ke,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"/api/referral/* — 邀请码、收益查询、提现"}),e.jsx("p",{children:"/api/user/* — 登录、注册、信息更新"}),e.jsx("p",{children:"/api/match/* — 匹配、匹配历史"})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"5. 管理后台"})}),e.jsxs(ke,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET/POST /api/admin/referral-settings — 推广/分销设置(含 VIP 配置)"}),e.jsx("p",{children:"GET /api/db/users、/api/db/book — 用户与章节数据"}),e.jsx("p",{children:"GET /api/orders — 订单列表"})]})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"完整说明见项目内 开发文档/5、接口/API接口完整文档.md"})]})}function VC(){const r=xn();return e.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-red-500/20 text-red-400 mb-6",children:e.jsx(Yj,{className:"w-10 h-10"})}),e.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),e.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),e.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:r.pathname}),e.jsx(q,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:e.jsxs(Ji,{to:"/",children:[e.jsx(Nb,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function WC(){return e.jsxs(gj,{children:[e.jsx(pt,{path:"/login",element:e.jsx(jw,{})}),e.jsxs(pt,{path:"/",element:e.jsx(wN,{}),children:[e.jsx(pt,{index:!0,element:e.jsx(bd,{to:"/dashboard",replace:!0})}),e.jsx(pt,{path:"dashboard",element:e.jsx(Nw,{})}),e.jsx(pt,{path:"orders",element:e.jsx(i2,{})}),e.jsx(pt,{path:"users",element:e.jsx(A2,{})}),e.jsx(pt,{path:"distribution",element:e.jsx(D2,{})}),e.jsx(pt,{path:"withdrawals",element:e.jsx(L2,{})}),e.jsx(pt,{path:"content",element:e.jsx(VS,{})}),e.jsx(pt,{path:"referral-settings",element:e.jsx(uC,{})}),e.jsx(pt,{path:"author-settings",element:e.jsx(bd,{to:"/settings?tab=author",replace:!0})}),e.jsx(pt,{path:"admin-users",element:e.jsx(bd,{to:"/settings?tab=admin",replace:!0})}),e.jsx(pt,{path:"vip-roles",element:e.jsx(TC,{})}),e.jsx(pt,{path:"mentors",element:e.jsx(RC,{})}),e.jsx(pt,{path:"mentor-consultations",element:e.jsx(IC,{})}),e.jsx(pt,{path:"settings",element:e.jsx(vC,{})}),e.jsx(pt,{path:"payment",element:e.jsx(jC,{})}),e.jsx(pt,{path:"site",element:e.jsx(SC,{})}),e.jsx(pt,{path:"qrcodes",element:e.jsx(CC,{})}),e.jsx(pt,{path:"find-partner",element:e.jsx(BC,{})}),e.jsx(pt,{path:"match",element:e.jsx(EC,{})}),e.jsx(pt,{path:"match-records",element:e.jsx(PC,{})}),e.jsx(pt,{path:"api-doc",element:e.jsx(UC,{})})]}),e.jsx(pt,{path:"*",element:e.jsx(VC,{})})]})}bv.createRoot(document.getElementById("root")).render(e.jsx(h.StrictMode,{children:e.jsx(Cj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:e.jsx(WC,{})})})); diff --git a/soul-admin/dist/assets/index-N0mJ5XsI.js b/soul-admin/dist/assets/index-N0mJ5XsI.js new file mode 100644 index 00000000..8b822e27 --- /dev/null +++ b/soul-admin/dist/assets/index-N0mJ5XsI.js @@ -0,0 +1,505 @@ +function fv(r,a){for(var l=0;lo[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function l(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(c){if(c.ep)return;c.ep=!0;const u=l(c);fetch(c.href,u)}})();function Ex(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var xd={exports:{}},Nl={},pd={exports:{}},Xe={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var pf;function xv(){if(pf)return Xe;pf=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),m=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),v=Symbol.iterator;function C(A){return A===null||typeof A!="object"?null:(A=v&&A[v]||A["@@iterator"],typeof A=="function"?A:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},P=Object.assign,w={};function b(A,O,L){this.props=A,this.context=O,this.refs=w,this.updater=L||E}b.prototype.isReactComponent={},b.prototype.setState=function(A,O){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,O,"setState")},b.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function N(){}N.prototype=b.prototype;function k(A,O,L){this.props=A,this.context=O,this.refs=w,this.updater=L||E}var j=k.prototype=new N;j.constructor=k,P(j,b.prototype),j.isPureReactComponent=!0;var I=Array.isArray,W=Object.prototype.hasOwnProperty,U={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function R(A,O,L){var X,K={},de=null,G=null;if(O!=null)for(X in O.ref!==void 0&&(G=O.ref),O.key!==void 0&&(de=""+O.key),O)W.call(O,X)&&!_.hasOwnProperty(X)&&(K[X]=O[X]);var xe=arguments.length-2;if(xe===1)K.children=L;else if(1>>1,O=$[A];if(0>>1;Ac(K,H))dec(G,K)?($[A]=G,$[de]=H,A=de):($[A]=K,$[X]=H,A=X);else if(dec(G,H))$[A]=G,$[de]=H,A=de;else break e}}return ce}function c($,ce){var H=$.sortIndex-ce.sortIndex;return H!==0?H:$.id-ce.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;r.unstable_now=function(){return u.now()}}else{var m=Date,f=m.now();r.unstable_now=function(){return m.now()-f}}var g=[],y=[],x=1,v=null,C=3,E=!1,P=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j($){for(var ce=l(y);ce!==null;){if(ce.callback===null)o(y);else if(ce.startTime<=$)o(y),ce.sortIndex=ce.expirationTime,a(g,ce);else break;ce=l(y)}}function I($){if(w=!1,j($),!P)if(l(g)!==null)P=!0,ne(W);else{var ce=l(y);ce!==null&&ve(I,ce.startTime-$)}}function W($,ce){P=!1,w&&(w=!1,N(R),R=-1),E=!0;var H=C;try{for(j(ce),v=l(g);v!==null&&(!(v.expirationTime>ce)||$&&!ae());){var A=v.callback;if(typeof A=="function"){v.callback=null,C=v.priorityLevel;var O=A(v.expirationTime<=ce);ce=r.unstable_now(),typeof O=="function"?v.callback=O:v===l(g)&&o(g),j(ce)}else o(g);v=l(g)}if(v!==null)var L=!0;else{var X=l(y);X!==null&&ve(I,X.startTime-ce),L=!1}return L}finally{v=null,C=H,E=!1}}var U=!1,_=null,R=-1,T=5,re=-1;function ae(){return!(r.unstable_now()-re$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<$?Math.floor(1e3/$):5},r.unstable_getCurrentPriorityLevel=function(){return C},r.unstable_getFirstCallbackNode=function(){return l(g)},r.unstable_next=function($){switch(C){case 1:case 2:case 3:var ce=3;break;default:ce=C}var H=C;C=ce;try{return $()}finally{C=H}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function($,ce){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=C;C=$;try{return ce()}finally{C=H}},r.unstable_scheduleCallback=function($,ce,H){var A=r.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0A?($.sortIndex=H,a(y,$),l(g)===null&&$===l(y)&&(w?(N(R),R=-1):w=!0,ve(I,H-A))):($.sortIndex=O,a(g,$),P||E||(P=!0,ne(W))),$},r.unstable_shouldYield=ae,r.unstable_wrapCallback=function($){var ce=C;return function(){var H=C;C=ce;try{return $.apply(this,arguments)}finally{C=H}}}})(vd)),vd}var bf;function vv(){return bf||(bf=1,yd.exports=yv()),yd.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Nf;function jv(){if(Nf)return ms;Nf=1;var r=cu(),a=vv();function l(t){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,y=/^[: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]*$/,x={},v={};function C(t){return g.call(v,t)?!0:g.call(x,t)?!1:y.test(t)?v[t]=!0:(x[t]=!0,!1)}function E(t,s,n,i){if(n!==null&&n.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function P(t,s,n,i){if(s===null||typeof s>"u"||E(t,s,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function w(t,s,n,i,d,p,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=n,this.propertyName=t,this.type=s,this.sanitizeURL=p,this.removeEmptyString=S}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){b[t]=new w(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var s=t[0];b[s]=new w(s,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){b[t]=new w(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){b[t]=new w(t,2,!1,t,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(t){b[t]=new w(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){b[t]=new w(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){b[t]=new w(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){b[t]=new w(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){b[t]=new w(t,5,!1,t.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function k(t){return t[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(t){var s=t.replace(N,k);b[s]=new w(s,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var s=t.replace(N,k);b[s]=new w(s,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var s=t.replace(N,k);b[s]=new w(s,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){b[t]=new w(t,1,!1,t.toLowerCase(),null,!1,!1)}),b.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){b[t]=new w(t,1,!1,t.toLowerCase(),null,!0,!0)});function j(t,s,n,i){var d=b.hasOwnProperty(s)?b[s]:null;(d!==null?d.type!==0:i||!(2M||d[S]!==p[M]){var z=` +`+d[S].replace(" at new "," at ");return t.displayName&&z.includes("")&&(z=z.replace("",t.displayName)),z}while(1<=S&&0<=M);break}}}finally{L=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?O(t):""}function K(t){switch(t.tag){case 5:return O(t.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return t=X(t.type,!1),t;case 11:return t=X(t.type.render,!1),t;case 1:return t=X(t.type,!0),t;default:return""}}function de(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case _:return"Fragment";case U:return"Portal";case T:return"Profiler";case R:return"StrictMode";case ee:return"Suspense";case te:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case ae:return(t.displayName||"Context")+".Consumer";case re:return(t._context.displayName||"Context")+".Provider";case oe:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Y:return s=t.displayName||null,s!==null?s:de(t.type)||"Memo";case ne:s=t._payload,t=t._init;try{return de(t(s))}catch{}}return null}function G(t){var s=t.type;switch(t.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=s.render,t=t.displayName||t.name||"",s.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(s);case 8:return s===R?"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 s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function xe(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function we(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function D(t){var s=we(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,s),i=""+t[s];if(!t.hasOwnProperty(s)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var d=n.get,p=n.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return d.call(this)},set:function(S){i=""+S,p.call(this,S)}}),Object.defineProperty(t,s,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(S){i=""+S},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function ue(t){t._valueTracker||(t._valueTracker=D(t))}function Se(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var n=s.getValue(),i="";return t&&(i=we(t)?t.checked?"true":"false":t.value),t=i,t!==n?(s.setValue(t),!0):!1}function Ie(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Ue(t,s){var n=s.checked;return H({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Ze(t,s){var n=s.defaultValue==null?"":s.defaultValue,i=s.checked!=null?s.checked:s.defaultChecked;n=xe(s.value!=null?s.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function et(t,s){s=s.checked,s!=null&&j(t,"checked",s,!1)}function tt(t,s){et(t,s);var n=xe(s.value),i=s.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}s.hasOwnProperty("value")?fe(t,s.type,n):s.hasOwnProperty("defaultValue")&&fe(t,s.type,xe(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(t.defaultChecked=!!s.defaultChecked)}function pe(t,s,n){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var i=s.type;if(!(i!=="submit"&&i!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+t._wrapperState.initialValue,n||s===t.value||(t.value=s),t.defaultValue=s}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function fe(t,s,n){(s!=="number"||Ie(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ot=Array.isArray;function ss(t,s,n,i){if(t=t.options,s){s={};for(var d=0;d"+s.valueOf().toString()+"",s=ur.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;s.firstChild;)t.appendChild(s.firstChild)}});function ls(t,s){if(s){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=s;return}}t.textContent=s}var ks={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},jn=["Webkit","ms","Moz","O"];Object.keys(ks).forEach(function(t){jn.forEach(function(s){s=s+t.charAt(0).toUpperCase()+t.substring(1),ks[s]=ks[t]})});function Es(t,s,n){return s==null||typeof s=="boolean"||s===""?"":n||typeof s!="number"||s===0||ks.hasOwnProperty(t)&&ks[t]?(""+s).trim():s+"px"}function Ls(t,s){t=t.style;for(var n in s)if(s.hasOwnProperty(n)){var i=n.indexOf("--")===0,d=Es(n,s[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,d):t[n]=d}}var hr=H({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 bn(t,s){if(s){if(hr[t]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(l(137,t));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(l(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(l(61))}if(s.style!=null&&typeof s.style!="object")throw Error(l(62))}}function mr(t,s){if(t.indexOf("-")===-1)return typeof s.is=="string";switch(t){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 Rr=null;function Ps(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Nn=null,qs=null,Xs=null;function Wn(t){if(t=il(t)){if(typeof Nn!="function")throw Error(l(280));var s=t.stateNode;s&&(s=si(s),Nn(t.stateNode,t.type,s))}}function Hn(t){qs?Xs?Xs.push(t):Xs=[t]:qs=t}function Kn(){if(qs){var t=qs,s=Xs;if(Xs=qs=null,Wn(t),s)for(t=0;t>>=0,t===0?32:31-(Rg(t)/Ig|0)|0}var Fl=64,zl=4194304;function Va(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function $l(t,s){var n=t.pendingLanes;if(n===0)return 0;var i=0,d=t.suspendedLanes,p=t.pingedLanes,S=n&268435455;if(S!==0){var M=S&~d;M!==0?i=Va(M):(p&=S,p!==0&&(i=Va(p)))}else S=n&~d,S!==0?i=Va(S):p!==0&&(i=Va(p));if(i===0)return 0;if(s!==0&&s!==i&&(s&d)===0&&(d=i&-i,p=s&-s,d>=p||d===16&&(p&4194240)!==0))return s;if((i&4)!==0&&(i|=n&16),s=t.entangledLanes,s!==0)for(t=t.entanglements,s&=i;0n;n++)s.push(t);return s}function Wa(t,s,n){t.pendingLanes|=s,s!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,s=31-Os(s),t[s]=n}function Dg(t,s){var n=t.pendingLanes&~s;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=s,t.mutableReadLanes&=s,t.entangledLanes&=s,s=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0=Ja),oh=" ",ch=!1;function dh(t,s){switch(t){case"keyup":return cy.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Jn=!1;function uy(t,s){switch(t){case"compositionend":return uh(s);case"keypress":return s.which!==32?null:(ch=!0,oh);case"textInput":return t=s.data,t===oh&&ch?null:t;default:return null}}function hy(t,s){if(Jn)return t==="compositionend"||!Qo&&dh(t,s)?(t=sh(),Hl=Vo=Or=null,Jn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:n,offset:s-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=yh(n)}}function jh(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?jh(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function bh(){for(var t=window,s=Ie();s instanceof t.HTMLIFrameElement;){try{var n=typeof s.contentWindow.location.href=="string"}catch{n=!1}if(n)t=s.contentWindow;else break;s=Ie(t.document)}return s}function Jo(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}function by(t){var s=bh(),n=t.focusedElem,i=t.selectionRange;if(s!==n&&n&&n.ownerDocument&&jh(n.ownerDocument.documentElement,n)){if(i!==null&&Jo(n)){if(s=i.start,t=i.end,t===void 0&&(t=s),"selectionStart"in n)n.selectionStart=s,n.selectionEnd=Math.min(t,n.value.length);else if(t=(s=n.ownerDocument||document)&&s.defaultView||window,t.getSelection){t=t.getSelection();var d=n.textContent.length,p=Math.min(i.start,d);i=i.end===void 0?p:Math.min(i.end,d),!t.extend&&p>i&&(d=i,i=p,p=d),d=vh(n,p);var S=vh(n,i);d&&S&&(t.rangeCount!==1||t.anchorNode!==d.node||t.anchorOffset!==d.offset||t.focusNode!==S.node||t.focusOffset!==S.offset)&&(s=s.createRange(),s.setStart(d.node,d.offset),t.removeAllRanges(),p>i?(t.addRange(s),t.extend(S.node,S.offset)):(s.setEnd(S.node,S.offset),t.addRange(s)))}}for(s=[],t=n;t=t.parentNode;)t.nodeType===1&&s.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Zn=null,Zo=null,sl=null,ec=!1;function Nh(t,s,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ec||Zn==null||Zn!==Ie(i)||(i=Zn,"selectionStart"in i&&Jo(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),sl&&tl(sl,i)||(sl=i,i=Zl(Zo,"onSelect"),0na||(t.current=hc[na],hc[na]=null,na--)}function ht(t,s){na++,hc[na]=t.current,t.current=s}var Br={},Xt=$r(Br),os=$r(!1),Cn=Br;function aa(t,s){var n=t.type.contextTypes;if(!n)return Br;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===s)return i.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in n)d[p]=s[p];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=d),d}function cs(t){return t=t.childContextTypes,t!=null}function ri(){xt(os),xt(Xt)}function Oh(t,s,n){if(Xt.current!==Br)throw Error(l(168));ht(Xt,s),ht(os,n)}function Fh(t,s,n){var i=t.stateNode;if(s=s.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var d in i)if(!(d in s))throw Error(l(108,G(t)||"Unknown",d));return H({},n,i)}function ni(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Br,Cn=Xt.current,ht(Xt,t),ht(os,os.current),!0}function zh(t,s,n){var i=t.stateNode;if(!i)throw Error(l(169));n?(t=Fh(t,s,Cn),i.__reactInternalMemoizedMergedChildContext=t,xt(os),xt(Xt),ht(Xt,t)):xt(os),ht(os,n)}var xr=null,ai=!1,mc=!1;function $h(t){xr===null?xr=[t]:xr.push(t)}function My(t){ai=!0,$h(t)}function Ur(){if(!mc&&xr!==null){mc=!0;var t=0,s=ct;try{var n=xr;for(ct=1;t>=S,d-=S,pr=1<<32-Os(s)+d|n<Ve?(Vt=ze,ze=null):Vt=ze.sibling;var nt=he(Q,ze,J[Ve],je);if(nt===null){ze===null&&(ze=Vt);break}t&&ze&&nt.alternate===null&&s(Q,ze),V=p(nt,V,Ve),Fe===null?Le=nt:Fe.sibling=nt,Fe=nt,ze=Vt}if(Ve===J.length)return n(Q,ze),vt&&En(Q,Ve),Le;if(ze===null){for(;VeVe?(Vt=ze,ze=null):Vt=ze.sibling;var Xr=he(Q,ze,nt.value,je);if(Xr===null){ze===null&&(ze=Vt);break}t&&ze&&Xr.alternate===null&&s(Q,ze),V=p(Xr,V,Ve),Fe===null?Le=Xr:Fe.sibling=Xr,Fe=Xr,ze=Vt}if(nt.done)return n(Q,ze),vt&&En(Q,Ve),Le;if(ze===null){for(;!nt.done;Ve++,nt=J.next())nt=ge(Q,nt.value,je),nt!==null&&(V=p(nt,V,Ve),Fe===null?Le=nt:Fe.sibling=nt,Fe=nt);return vt&&En(Q,Ve),Le}for(ze=i(Q,ze);!nt.done;Ve++,nt=J.next())nt=Pe(ze,Q,Ve,nt.value,je),nt!==null&&(t&&nt.alternate!==null&&ze.delete(nt.key===null?Ve:nt.key),V=p(nt,V,Ve),Fe===null?Le=nt:Fe.sibling=nt,Fe=nt);return t&&ze.forEach(function(mv){return s(Q,mv)}),vt&&En(Q,Ve),Le}function Rt(Q,V,J,je){if(typeof J=="object"&&J!==null&&J.type===_&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case W:e:{for(var Le=J.key,Fe=V;Fe!==null;){if(Fe.key===Le){if(Le=J.type,Le===_){if(Fe.tag===7){n(Q,Fe.sibling),V=d(Fe,J.props.children),V.return=Q,Q=V;break e}}else if(Fe.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===ne&&Kh(Le)===Fe.type){n(Q,Fe.sibling),V=d(Fe,J.props),V.ref=ol(Q,Fe,J),V.return=Q,Q=V;break e}n(Q,Fe);break}else s(Q,Fe);Fe=Fe.sibling}J.type===_?(V=Dn(J.props.children,Q.mode,je,J.key),V.return=Q,Q=V):(je=Mi(J.type,J.key,J.props,null,Q.mode,je),je.ref=ol(Q,V,J),je.return=Q,Q=je)}return S(Q);case U:e:{for(Fe=J.key;V!==null;){if(V.key===Fe)if(V.tag===4&&V.stateNode.containerInfo===J.containerInfo&&V.stateNode.implementation===J.implementation){n(Q,V.sibling),V=d(V,J.children||[]),V.return=Q,Q=V;break e}else{n(Q,V);break}else s(Q,V);V=V.sibling}V=dd(J,Q.mode,je),V.return=Q,Q=V}return S(Q);case ne:return Fe=J._init,Rt(Q,V,Fe(J._payload),je)}if(ot(J))return _e(Q,V,J,je);if(ce(J))return De(Q,V,J,je);ci(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"?(J=""+J,V!==null&&V.tag===6?(n(Q,V.sibling),V=d(V,J),V.return=Q,Q=V):(n(Q,V),V=cd(J,Q.mode,je),V.return=Q,Q=V),S(Q)):n(Q,V)}return Rt}var ca=Yh(!0),Gh=Yh(!1),di=$r(null),ui=null,da=null,vc=null;function jc(){vc=da=ui=null}function bc(t){var s=di.current;xt(di),t._currentValue=s}function Nc(t,s,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,i!==null&&(i.childLanes|=s)):i!==null&&(i.childLanes&s)!==s&&(i.childLanes|=s),t===n)break;t=t.return}}function ua(t,s){ui=t,vc=da=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&s)!==0&&(ds=!0),t.firstContext=null)}function _s(t){var s=t._currentValue;if(vc!==t)if(t={context:t,memoizedValue:s,next:null},da===null){if(ui===null)throw Error(l(308));da=t,ui.dependencies={lanes:0,firstContext:t}}else da=da.next=t;return s}var Pn=null;function wc(t){Pn===null?Pn=[t]:Pn.push(t)}function Qh(t,s,n,i){var d=s.interleaved;return d===null?(n.next=n,wc(s)):(n.next=d.next,d.next=n),s.interleaved=n,yr(t,i)}function yr(t,s){t.lanes|=s;var n=t.alternate;for(n!==null&&(n.lanes|=s),n=t,t=t.return;t!==null;)t.childLanes|=s,n=t.alternate,n!==null&&(n.childLanes|=s),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Vr=!1;function Sc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qh(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function vr(t,s){return{eventTime:t,lane:s,tag:0,payload:null,callback:null,next:null}}function Wr(t,s,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(st&2)!==0){var d=i.pending;return d===null?s.next=s:(s.next=d.next,d.next=s),i.pending=s,yr(t,n)}return d=i.interleaved,d===null?(s.next=s,wc(i)):(s.next=d.next,d.next=s),i.interleaved=s,yr(t,n)}function hi(t,s,n){if(s=s.updateQueue,s!==null&&(s=s.shared,(n&4194240)!==0)){var i=s.lanes;i&=t.pendingLanes,n|=i,s.lanes=n,Fo(t,n)}}function Xh(t,s){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var d=null,p=null;if(n=n.firstBaseUpdate,n!==null){do{var S={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};p===null?d=p=S:p=p.next=S,n=n.next}while(n!==null);p===null?d=p=s:p=p.next=s}else d=p=s;n={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=s:t.next=s,n.lastBaseUpdate=s}function mi(t,s,n,i){var d=t.updateQueue;Vr=!1;var p=d.firstBaseUpdate,S=d.lastBaseUpdate,M=d.shared.pending;if(M!==null){d.shared.pending=null;var z=M,se=z.next;z.next=null,S===null?p=se:S.next=se,S=z;var me=t.alternate;me!==null&&(me=me.updateQueue,M=me.lastBaseUpdate,M!==S&&(M===null?me.firstBaseUpdate=se:M.next=se,me.lastBaseUpdate=z))}if(p!==null){var ge=d.baseState;S=0,me=se=z=null,M=p;do{var he=M.lane,Pe=M.eventTime;if((i&he)===he){me!==null&&(me=me.next={eventTime:Pe,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var _e=t,De=M;switch(he=s,Pe=n,De.tag){case 1:if(_e=De.payload,typeof _e=="function"){ge=_e.call(Pe,ge,he);break e}ge=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=De.payload,he=typeof _e=="function"?_e.call(Pe,ge,he):_e,he==null)break e;ge=H({},ge,he);break e;case 2:Vr=!0}}M.callback!==null&&M.lane!==0&&(t.flags|=64,he=d.effects,he===null?d.effects=[M]:he.push(M))}else Pe={eventTime:Pe,lane:he,tag:M.tag,payload:M.payload,callback:M.callback,next:null},me===null?(se=me=Pe,z=ge):me=me.next=Pe,S|=he;if(M=M.next,M===null){if(M=d.shared.pending,M===null)break;he=M,M=he.next,he.next=null,d.lastBaseUpdate=he,d.shared.pending=null}}while(!0);if(me===null&&(z=ge),d.baseState=z,d.firstBaseUpdate=se,d.lastBaseUpdate=me,s=d.shared.interleaved,s!==null){d=s;do S|=d.lane,d=d.next;while(d!==s)}else p===null&&(d.shared.lanes=0);In|=S,t.lanes=S,t.memoizedState=ge}}function Jh(t,s,n){if(t=s.effects,s.effects=null,t!==null)for(s=0;sn?n:4,t(!0);var i=Tc.transition;Tc.transition={};try{t(!1),s()}finally{ct=n,Tc.transition=i}}function gm(){return Ms().memoizedState}function Oy(t,s,n){var i=Gr(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},ym(t))vm(s,n);else if(n=Qh(t,s,n,i),n!==null){var d=as();Vs(n,t,i,d),jm(n,s,i)}}function Fy(t,s,n){var i=Gr(t),d={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(ym(t))vm(s,d);else{var p=t.alternate;if(t.lanes===0&&(p===null||p.lanes===0)&&(p=s.lastRenderedReducer,p!==null))try{var S=s.lastRenderedState,M=p(S,n);if(d.hasEagerState=!0,d.eagerState=M,Fs(M,S)){var z=s.interleaved;z===null?(d.next=d,wc(s)):(d.next=z.next,z.next=d),s.interleaved=d;return}}catch{}finally{}n=Qh(t,s,d,i),n!==null&&(d=as(),Vs(n,t,i,d),jm(n,s,i))}}function ym(t){var s=t.alternate;return t===wt||s!==null&&s===wt}function vm(t,s){hl=pi=!0;var n=t.pending;n===null?s.next=s:(s.next=n.next,n.next=s),t.pending=s}function jm(t,s,n){if((n&4194240)!==0){var i=s.lanes;i&=t.pendingLanes,n|=i,s.lanes=n,Fo(t,n)}}var vi={readContext:_s,useCallback:Jt,useContext:Jt,useEffect:Jt,useImperativeHandle:Jt,useInsertionEffect:Jt,useLayoutEffect:Jt,useMemo:Jt,useReducer:Jt,useRef:Jt,useState:Jt,useDebugValue:Jt,useDeferredValue:Jt,useTransition:Jt,useMutableSource:Jt,useSyncExternalStore:Jt,useId:Jt,unstable_isNewReconciler:!1},zy={readContext:_s,useCallback:function(t,s){return sr().memoizedState=[t,s===void 0?null:s],t},useContext:_s,useEffect:cm,useImperativeHandle:function(t,s,n){return n=n!=null?n.concat([t]):null,gi(4194308,4,hm.bind(null,s,t),n)},useLayoutEffect:function(t,s){return gi(4194308,4,t,s)},useInsertionEffect:function(t,s){return gi(4,2,t,s)},useMemo:function(t,s){var n=sr();return s=s===void 0?null:s,t=t(),n.memoizedState=[t,s],t},useReducer:function(t,s,n){var i=sr();return s=n!==void 0?n(s):s,i.memoizedState=i.baseState=s,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:s},i.queue=t,t=t.dispatch=Oy.bind(null,wt,t),[i.memoizedState,t]},useRef:function(t){var s=sr();return t={current:t},s.memoizedState=t},useState:im,useDebugValue:Lc,useDeferredValue:function(t){return sr().memoizedState=t},useTransition:function(){var t=im(!1),s=t[0];return t=Ly.bind(null,t[1]),sr().memoizedState=t,[s,t]},useMutableSource:function(){},useSyncExternalStore:function(t,s,n){var i=wt,d=sr();if(vt){if(n===void 0)throw Error(l(407));n=n()}else{if(n=s(),Ut===null)throw Error(l(349));(Rn&30)!==0||sm(i,s,n)}d.memoizedState=n;var p={value:n,getSnapshot:s};return d.queue=p,cm(nm.bind(null,i,p,t),[t]),i.flags|=2048,xl(9,rm.bind(null,i,p,n,s),void 0,null),n},useId:function(){var t=sr(),s=Ut.identifierPrefix;if(vt){var n=gr,i=pr;n=(i&~(1<<32-Os(i)-1)).toString(32)+n,s=":"+s+"R"+n,n=ml++,0<\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=S.createElement(n,{is:i.is}):(t=S.createElement(n),n==="select"&&(S=t,i.multiple?S.multiple=!0:i.size&&(S.size=i.size))):t=S.createElementNS(t,n),t[er]=s,t[ll]=i,$m(t,s,!1,!1),s.stateNode=t;e:{switch(S=mr(n,i),n){case"dialog":ft("cancel",t),ft("close",t),d=i;break;case"iframe":case"object":case"embed":ft("load",t),d=i;break;case"video":case"audio":for(d=0;dpa&&(s.flags|=128,i=!0,pl(p,!1),s.lanes=4194304)}else{if(!i)if(t=fi(S),t!==null){if(s.flags|=128,i=!0,n=t.updateQueue,n!==null&&(s.updateQueue=n,s.flags|=4),pl(p,!0),p.tail===null&&p.tailMode==="hidden"&&!S.alternate&&!vt)return Zt(s),null}else 2*Tt()-p.renderingStartTime>pa&&n!==1073741824&&(s.flags|=128,i=!0,pl(p,!1),s.lanes=4194304);p.isBackwards?(S.sibling=s.child,s.child=S):(n=p.last,n!==null?n.sibling=S:s.child=S,p.last=S)}return p.tail!==null?(s=p.tail,p.rendering=s,p.tail=s.sibling,p.renderingStartTime=Tt(),s.sibling=null,n=Nt.current,ht(Nt,i?n&1|2:n&1),s):(Zt(s),null);case 22:case 23:return ld(),i=s.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(s.flags|=8192),i&&(s.mode&1)!==0?(Ns&1073741824)!==0&&(Zt(s),s.subtreeFlags&6&&(s.flags|=8192)):Zt(s),null;case 24:return null;case 25:return null}throw Error(l(156,s.tag))}function Yy(t,s){switch(xc(s),s.tag){case 1:return cs(s.type)&&ri(),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return ha(),xt(os),xt(Xt),Pc(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 5:return kc(s),null;case 13:if(xt(Nt),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));oa()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return xt(Nt),null;case 4:return ha(),null;case 10:return bc(s.type._context),null;case 22:case 23:return ld(),null;case 24:return null;default:return null}}var wi=!1,es=!1,Gy=typeof WeakSet=="function"?WeakSet:Set,Re=null;function fa(t,s){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){Et(t,s,i)}else n.current=null}function Gc(t,s,n){try{n()}catch(i){Et(t,s,i)}}var Vm=!1;function Qy(t,s){if(lc=Vl,t=bh(),Jo(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var d=i.anchorOffset,p=i.focusNode;i=i.focusOffset;try{n.nodeType,p.nodeType}catch{n=null;break e}var S=0,M=-1,z=-1,se=0,me=0,ge=t,he=null;t:for(;;){for(var Pe;ge!==n||d!==0&&ge.nodeType!==3||(M=S+d),ge!==p||i!==0&&ge.nodeType!==3||(z=S+i),ge.nodeType===3&&(S+=ge.nodeValue.length),(Pe=ge.firstChild)!==null;)he=ge,ge=Pe;for(;;){if(ge===t)break t;if(he===n&&++se===d&&(M=S),he===p&&++me===i&&(z=S),(Pe=ge.nextSibling)!==null)break;ge=he,he=ge.parentNode}ge=Pe}n=M===-1||z===-1?null:{start:M,end:z}}else n=null}n=n||{start:0,end:0}}else n=null;for(ic={focusedElem:t,selectionRange:n},Vl=!1,Re=s;Re!==null;)if(s=Re,t=s.child,(s.subtreeFlags&1028)!==0&&t!==null)t.return=s,Re=t;else for(;Re!==null;){s=Re;try{var _e=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var De=_e.memoizedProps,Rt=_e.memoizedState,Q=s.stateNode,V=Q.getSnapshotBeforeUpdate(s.elementType===s.type?De:$s(s.type,De),Rt);Q.__reactInternalSnapshotBeforeUpdate=V}break;case 3:var J=s.stateNode.containerInfo;J.nodeType===1?J.textContent="":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(je){Et(s,s.return,je)}if(t=s.sibling,t!==null){t.return=s.return,Re=t;break}Re=s.return}return _e=Vm,Vm=!1,_e}function gl(t,s,n){var i=s.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var d=i=i.next;do{if((d.tag&t)===t){var p=d.destroy;d.destroy=void 0,p!==void 0&&Gc(s,n,p)}d=d.next}while(d!==i)}}function Si(t,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var n=s=s.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==s)}}function Qc(t){var s=t.ref;if(s!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof s=="function"?s(t):s.current=t}}function Wm(t){var s=t.alternate;s!==null&&(t.alternate=null,Wm(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&(delete s[er],delete s[ll],delete s[uc],delete s[Iy],delete s[_y])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Hm(t){return t.tag===5||t.tag===3||t.tag===4}function Km(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Hm(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function qc(t,s,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,s?n.nodeType===8?n.parentNode.insertBefore(t,s):n.insertBefore(t,s):(n.nodeType===8?(s=n.parentNode,s.insertBefore(t,n)):(s=n,s.appendChild(t)),n=n._reactRootContainer,n!=null||s.onclick!==null||(s.onclick=ti));else if(i!==4&&(t=t.child,t!==null))for(qc(t,s,n),t=t.sibling;t!==null;)qc(t,s,n),t=t.sibling}function Xc(t,s,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,s?n.insertBefore(t,s):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(Xc(t,s,n),t=t.sibling;t!==null;)Xc(t,s,n),t=t.sibling}var Yt=null,Bs=!1;function Hr(t,s,n){for(n=n.child;n!==null;)Ym(t,s,n),n=n.sibling}function Ym(t,s,n){if(Zs&&typeof Zs.onCommitFiberUnmount=="function")try{Zs.onCommitFiberUnmount(Ol,n)}catch{}switch(n.tag){case 5:es||fa(n,s);case 6:var i=Yt,d=Bs;Yt=null,Hr(t,s,n),Yt=i,Bs=d,Yt!==null&&(Bs?(t=Yt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Yt.removeChild(n.stateNode));break;case 18:Yt!==null&&(Bs?(t=Yt,n=n.stateNode,t.nodeType===8?dc(t.parentNode,n):t.nodeType===1&&dc(t,n),Qa(t)):dc(Yt,n.stateNode));break;case 4:i=Yt,d=Bs,Yt=n.stateNode.containerInfo,Bs=!0,Hr(t,s,n),Yt=i,Bs=d;break;case 0:case 11:case 14:case 15:if(!es&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){d=i=i.next;do{var p=d,S=p.destroy;p=p.tag,S!==void 0&&((p&2)!==0||(p&4)!==0)&&Gc(n,s,S),d=d.next}while(d!==i)}Hr(t,s,n);break;case 1:if(!es&&(fa(n,s),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(M){Et(n,s,M)}Hr(t,s,n);break;case 21:Hr(t,s,n);break;case 22:n.mode&1?(es=(i=es)||n.memoizedState!==null,Hr(t,s,n),es=i):Hr(t,s,n);break;default:Hr(t,s,n)}}function Gm(t){var s=t.updateQueue;if(s!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Gy),s.forEach(function(i){var d=nv.bind(null,t,i);n.has(i)||(n.add(i),i.then(d,d))})}}function Us(t,s){var n=s.deletions;if(n!==null)for(var i=0;id&&(d=S),i&=~p}if(i=d,i=Tt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Xy(i/1960))-i,10t?16:t,Yr===null)var i=!1;else{if(t=Yr,Yr=null,Ti=0,(st&6)!==0)throw Error(l(331));var d=st;for(st|=4,Re=t.current;Re!==null;){var p=Re,S=p.child;if((Re.flags&16)!==0){var M=p.deletions;if(M!==null){for(var z=0;zTt()-ed?Mn(t,0):Zc|=n),hs(t,s)}function of(t,s){s===0&&((t.mode&1)===0?s=1:(s=zl,zl<<=1,(zl&130023424)===0&&(zl=4194304)));var n=as();t=yr(t,s),t!==null&&(Wa(t,s,n),hs(t,n))}function rv(t){var s=t.memoizedState,n=0;s!==null&&(n=s.retryLane),of(t,n)}function nv(t,s){var n=0;switch(t.tag){case 13:var i=t.stateNode,d=t.memoizedState;d!==null&&(n=d.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(l(314))}i!==null&&i.delete(s),of(t,n)}var cf;cf=function(t,s,n){if(t!==null)if(t.memoizedProps!==s.pendingProps||os.current)ds=!0;else{if((t.lanes&n)===0&&(s.flags&128)===0)return ds=!1,Hy(t,s,n);ds=(t.flags&131072)!==0}else ds=!1,vt&&(s.flags&1048576)!==0&&Bh(s,ii,s.index);switch(s.lanes=0,s.tag){case 2:var i=s.type;Ni(t,s),t=s.pendingProps;var d=aa(s,Xt.current);ua(s,n),d=Ic(null,s,i,t,d,n);var p=_c();return s.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,cs(i)?(p=!0,ni(s)):p=!1,s.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,Sc(s),d.updater=ji,s.stateNode=d,d._reactInternals=s,Fc(s,i,t,n),s=Uc(null,s,i,!0,p,n)):(s.tag=0,vt&&p&&fc(s),ns(null,s,d,n),s=s.child),s;case 16:i=s.elementType;e:{switch(Ni(t,s),t=s.pendingProps,d=i._init,i=d(i._payload),s.type=i,d=s.tag=lv(i),t=$s(i,t),d){case 0:s=Bc(null,s,i,t,n);break e;case 1:s=Am(null,s,i,t,n);break e;case 11:s=Tm(null,s,i,t,n);break e;case 14:s=Rm(null,s,i,$s(i.type,t),n);break e}throw Error(l(306,i,""))}return s;case 0:return i=s.type,d=s.pendingProps,d=s.elementType===i?d:$s(i,d),Bc(t,s,i,d,n);case 1:return i=s.type,d=s.pendingProps,d=s.elementType===i?d:$s(i,d),Am(t,s,i,d,n);case 3:e:{if(Dm(s),t===null)throw Error(l(387));i=s.pendingProps,p=s.memoizedState,d=p.element,qh(t,s),mi(s,i,null,n);var S=s.memoizedState;if(i=S.element,p.isDehydrated)if(p={element:i,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},s.updateQueue.baseState=p,s.memoizedState=p,s.flags&256){d=ma(Error(l(423)),s),s=Lm(t,s,i,n,d);break e}else if(i!==d){d=ma(Error(l(424)),s),s=Lm(t,s,i,n,d);break e}else for(bs=zr(s.stateNode.containerInfo.firstChild),js=s,vt=!0,zs=null,n=Gh(s,null,i,n),s.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(oa(),i===d){s=jr(t,s,n);break e}ns(t,s,i,n)}s=s.child}return s;case 5:return Zh(s),t===null&&gc(s),i=s.type,d=s.pendingProps,p=t!==null?t.memoizedProps:null,S=d.children,oc(i,d)?S=null:p!==null&&oc(i,p)&&(s.flags|=32),Mm(t,s),ns(t,s,S,n),s.child;case 6:return t===null&&gc(s),null;case 13:return Om(t,s,n);case 4:return Cc(s,s.stateNode.containerInfo),i=s.pendingProps,t===null?s.child=ca(s,null,i,n):ns(t,s,i,n),s.child;case 11:return i=s.type,d=s.pendingProps,d=s.elementType===i?d:$s(i,d),Tm(t,s,i,d,n);case 7:return ns(t,s,s.pendingProps,n),s.child;case 8:return ns(t,s,s.pendingProps.children,n),s.child;case 12:return ns(t,s,s.pendingProps.children,n),s.child;case 10:e:{if(i=s.type._context,d=s.pendingProps,p=s.memoizedProps,S=d.value,ht(di,i._currentValue),i._currentValue=S,p!==null)if(Fs(p.value,S)){if(p.children===d.children&&!os.current){s=jr(t,s,n);break e}}else for(p=s.child,p!==null&&(p.return=s);p!==null;){var M=p.dependencies;if(M!==null){S=p.child;for(var z=M.firstContext;z!==null;){if(z.context===i){if(p.tag===1){z=vr(-1,n&-n),z.tag=2;var se=p.updateQueue;if(se!==null){se=se.shared;var me=se.pending;me===null?z.next=z:(z.next=me.next,me.next=z),se.pending=z}}p.lanes|=n,z=p.alternate,z!==null&&(z.lanes|=n),Nc(p.return,n,s),M.lanes|=n;break}z=z.next}}else if(p.tag===10)S=p.type===s.type?null:p.child;else if(p.tag===18){if(S=p.return,S===null)throw Error(l(341));S.lanes|=n,M=S.alternate,M!==null&&(M.lanes|=n),Nc(S,n,s),S=p.sibling}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===s){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}ns(t,s,d.children,n),s=s.child}return s;case 9:return d=s.type,i=s.pendingProps.children,ua(s,n),d=_s(d),i=i(d),s.flags|=1,ns(t,s,i,n),s.child;case 14:return i=s.type,d=$s(i,s.pendingProps),d=$s(i.type,d),Rm(t,s,i,d,n);case 15:return Im(t,s,s.type,s.pendingProps,n);case 17:return i=s.type,d=s.pendingProps,d=s.elementType===i?d:$s(i,d),Ni(t,s),s.tag=1,cs(i)?(t=!0,ni(s)):t=!1,ua(s,n),Nm(s,i,d),Fc(s,i,d,n),Uc(null,s,i,!0,t,n);case 19:return zm(t,s,n);case 22:return _m(t,s,n)}throw Error(l(156,s.tag))};function df(t,s){return Ts(t,s)}function av(t,s,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ds(t,s,n,i){return new av(t,s,n,i)}function od(t){return t=t.prototype,!(!t||!t.isReactComponent)}function lv(t){if(typeof t=="function")return od(t)?1:0;if(t!=null){if(t=t.$$typeof,t===oe)return 11;if(t===Y)return 14}return 2}function qr(t,s){var n=t.alternate;return n===null?(n=Ds(t.tag,s,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=s,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,s=t.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Mi(t,s,n,i,d,p){var S=2;if(i=t,typeof t=="function")od(t)&&(S=1);else if(typeof t=="string")S=5;else e:switch(t){case _:return Dn(n.children,d,p,s);case R:S=8,d|=8;break;case T:return t=Ds(12,n,s,d|2),t.elementType=T,t.lanes=p,t;case ee:return t=Ds(13,n,s,d),t.elementType=ee,t.lanes=p,t;case te:return t=Ds(19,n,s,d),t.elementType=te,t.lanes=p,t;case ve:return Ai(n,d,p,s);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case re:S=10;break e;case ae:S=9;break e;case oe:S=11;break e;case Y:S=14;break e;case ne:S=16,i=null;break e}throw Error(l(130,t==null?t:typeof t,""))}return s=Ds(S,n,s,d),s.elementType=t,s.type=i,s.lanes=p,s}function Dn(t,s,n,i){return t=Ds(7,t,i,s),t.lanes=n,t}function Ai(t,s,n,i){return t=Ds(22,t,i,s),t.elementType=ve,t.lanes=n,t.stateNode={isHidden:!1},t}function cd(t,s,n){return t=Ds(6,t,null,s),t.lanes=n,t}function dd(t,s,n){return s=Ds(4,t.children!==null?t.children:[],t.key,s),s.lanes=n,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}function iv(t,s,n,i,d){this.tag=s,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Oo(0),this.expirationTimes=Oo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oo(0),this.identifierPrefix=i,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function ud(t,s,n,i,d,p,S,M,z){return t=new iv(t,s,n,M,z),s===1?(s=1,p===!0&&(s|=8)):s=0,p=Ds(3,null,null,s),t.current=p,p.stateNode=t,p.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sc(p),t}function ov(t,s,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),gd.exports=jv(),gd.exports}var Sf;function bv(){if(Sf)return Bi;Sf=1;var r=Px();return Bi.createRoot=r.createRoot,Bi.hydrateRoot=r.hydrateRoot,Bi}var Nv=bv(),Il=Px();const wv=Ex(Il);/** + * @remix-run/router v1.23.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function El(){return El=Object.assign?Object.assign.bind():function(r){for(var a=1;a"u")throw new Error(a)}function du(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Cv(){return Math.random().toString(36).substr(2,8)}function kf(r,a){return{usr:r.state,key:r.key,idx:a}}function zd(r,a,l,o){return l===void 0&&(l=null),El({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?Ma(a):a,{state:l,key:a&&a.key||o||Cv()})}function so(r){let{pathname:a="/",search:l="",hash:o=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function Ma(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let o=r.indexOf("?");o>=0&&(a.search=r.substr(o),r=r.substr(0,o)),r&&(a.pathname=r)}return a}function kv(r,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:u=!1}=o,m=c.history,f=rn.Pop,g=null,y=x();y==null&&(y=0,m.replaceState(El({},m.state,{idx:y}),""));function x(){return(m.state||{idx:null}).idx}function v(){f=rn.Pop;let b=x(),N=b==null?null:b-y;y=b,g&&g({action:f,location:w.location,delta:N})}function C(b,N){f=rn.Push;let k=zd(w.location,b,N);y=x()+1;let j=kf(k,y),I=w.createHref(k);try{m.pushState(j,"",I)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;c.location.assign(I)}u&&g&&g({action:f,location:w.location,delta:1})}function E(b,N){f=rn.Replace;let k=zd(w.location,b,N);y=x();let j=kf(k,y),I=w.createHref(k);m.replaceState(j,"",I),u&&g&&g({action:f,location:w.location,delta:0})}function P(b){let N=c.location.origin!=="null"?c.location.origin:c.location.href,k=typeof b=="string"?b:so(b);return k=k.replace(/ $/,"%20"),It(N,"No window.location.(origin|href) available to create URL for href: "+k),new URL(k,N)}let w={get action(){return f},get location(){return r(c,m)},listen(b){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(Cf,v),g=b,()=>{c.removeEventListener(Cf,v),g=null}},createHref(b){return a(c,b)},createURL:P,encodeLocation(b){let N=P(b);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:C,replace:E,go(b){return m.go(b)}};return w}var Ef;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Ef||(Ef={}));function Ev(r,a,l){return l===void 0&&(l="/"),Pv(r,a,l)}function Pv(r,a,l,o){let c=typeof a=="string"?Ma(a):a,u=uu(c.pathname||"/",l);if(u==null)return null;let m=Tx(r);Tv(m);let f=null;for(let g=0;f==null&&g{let g={relativePath:f===void 0?u.path||"":f,caseSensitive:u.caseSensitive===!0,childrenIndex:m,route:u};g.relativePath.startsWith("/")&&(It(g.relativePath.startsWith(o),'Absolute route path "'+g.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),g.relativePath=g.relativePath.slice(o.length));let y=an([o,g.relativePath]),x=l.concat(g);u.children&&u.children.length>0&&(It(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Tx(u.children,a,x,y)),!(u.path==null&&!u.index)&&a.push({path:y,score:Lv(y,u.index),routesMeta:x})};return r.forEach((u,m)=>{var f;if(u.path===""||!((f=u.path)!=null&&f.includes("?")))c(u,m);else for(let g of Rx(u.path))c(u,m,g)}),a}function Rx(r){let a=r.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let m=Rx(o.join("/")),f=[];return f.push(...m.map(g=>g===""?u:[u,g].join("/"))),c&&f.push(...m),f.map(g=>r.startsWith("/")&&g===""?"/":g)}function Tv(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:Ov(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const Rv=/^:[\w-]+$/,Iv=3,_v=2,Mv=1,Av=10,Dv=-2,Pf=r=>r==="*";function Lv(r,a){let l=r.split("/"),o=l.length;return l.some(Pf)&&(o+=Dv),a&&(o+=_v),l.filter(c=>!Pf(c)).reduce((c,u)=>c+(Rv.test(u)?Iv:u===""?Mv:Av),o)}function Ov(r,a){return r.length===a.length&&r.slice(0,-1).every((o,c)=>o===a[c])?r[r.length-1]-a[a.length-1]:0}function Fv(r,a,l){let{routesMeta:o}=r,c={},u="/",m=[];for(let f=0;f{let{paramName:C,isOptional:E}=x;if(C==="*"){let w=f[v]||"";m=u.slice(0,u.length-w.length).replace(/(.)\/+$/,"$1")}const P=f[v];return E&&!P?y[C]=void 0:y[C]=(P||"").replace(/%2F/g,"/"),y},{}),pathname:u,pathnameBase:m,pattern:r}}function $v(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),du(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let o=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,f,g)=>(o.push({paramName:f,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(o.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function Bv(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return du(!1,'The URL path "'+r+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),r}}function uu(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=r.charAt(l);return o&&o!=="/"?null:r.slice(l)||"/"}const Uv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vv=r=>Uv.test(r);function Wv(r,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof r=="string"?Ma(r):r,u;if(l)if(Vv(l))u=l;else{if(l.includes("//")){let m=l;l=l.replace(/\/\/+/g,"/"),du(!1,"Pathnames cannot have embedded double slashes - normalizing "+(m+" -> "+l))}l.startsWith("/")?u=Tf(l.substring(1),"/"):u=Tf(l,a)}else u=a;return{pathname:u,search:Yv(o),hash:Gv(c)}}function Tf(r,a){let l=a.replace(/\/+$/,"").split("/");return r.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function jd(r,a,l,o){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Hv(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function hu(r,a){let l=Hv(r);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function mu(r,a,l,o){o===void 0&&(o=!1);let c;typeof r=="string"?c=Ma(r):(c=El({},r),It(!c.pathname||!c.pathname.includes("?"),jd("?","pathname","search",c)),It(!c.pathname||!c.pathname.includes("#"),jd("#","pathname","hash",c)),It(!c.search||!c.search.includes("#"),jd("#","search","hash",c)));let u=r===""||c.pathname==="",m=u?"/":c.pathname,f;if(m==null)f=l;else{let v=a.length-1;if(!o&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),v-=1;c.pathname=C.join("/")}f=v>=0?a[v]:"/"}let g=Wv(c,f),y=m&&m!=="/"&&m.endsWith("/"),x=(u||m===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(y||x)&&(g.pathname+="/"),g}const an=r=>r.join("/").replace(/\/\/+/g,"/"),Kv=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Yv=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Gv=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function Qv(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Ix=["post","put","patch","delete"];new Set(Ix);const qv=["get",...Ix];new Set(qv);/** + * React Router v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Pl(){return Pl=Object.assign?Object.assign.bind():function(r){for(var a=1;a{f.current=!0}),h.useCallback(function(y,x){if(x===void 0&&(x={}),!f.current)return;if(typeof y=="number"){o.go(y);return}let v=mu(y,JSON.parse(m),u,x.relative==="path");r==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:an([a,v.pathname])),(x.replace?o.replace:o.push)(v,x.state,x)},[a,o,m,u,r])}const ej=h.createContext(null);function tj(r){let a=h.useContext(Tr).outlet;return a&&h.createElement(ej.Provider,{value:r},a)}function Ax(r,a){let{relative:l}=a===void 0?{}:a,{future:o}=h.useContext(fn),{matches:c}=h.useContext(Tr),{pathname:u}=xn(),m=JSON.stringify(hu(c,o.v7_relativeSplatPath));return h.useMemo(()=>mu(r,JSON.parse(m),u,l==="path"),[r,m,u,l])}function sj(r,a){return rj(r,a)}function rj(r,a,l,o){Aa()||It(!1);let{navigator:c}=h.useContext(fn),{matches:u}=h.useContext(Tr),m=u[u.length-1],f=m?m.params:{};m&&m.pathname;let g=m?m.pathnameBase:"/";m&&m.route;let y=xn(),x;if(a){var v;let b=typeof a=="string"?Ma(a):a;g==="/"||(v=b.pathname)!=null&&v.startsWith(g)||It(!1),x=b}else x=y;let C=x.pathname||"/",E=C;if(g!=="/"){let b=g.replace(/^\//,"").split("/");E="/"+C.replace(/^\//,"").split("/").slice(b.length).join("/")}let P=Ev(r,{pathname:E}),w=oj(P&&P.map(b=>Object.assign({},b,{params:Object.assign({},f,b.params),pathname:an([g,c.encodeLocation?c.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?g:an([g,c.encodeLocation?c.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),u,l,o);return a&&w?h.createElement(vo.Provider,{value:{location:Pl({pathname:"/",search:"",hash:"",state:null,key:"default"},x),navigationType:rn.Pop}},w):w}function nj(){let r=hj(),a=Qv(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),l=r instanceof Error?r.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},a),l?h.createElement("pre",{style:c},l):null,null)}const aj=h.createElement(nj,null);class lj extends h.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){console.error("React Router caught the following error during render",a,l)}render(){return this.state.error!==void 0?h.createElement(Tr.Provider,{value:this.props.routeContext},h.createElement(_x.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ij(r){let{routeContext:a,match:l,children:o}=r,c=h.useContext(fu);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),h.createElement(Tr.Provider,{value:a},o)}function oj(r,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),r==null){var u;if(!l)return null;if(l.errors)r=l.matches;else if((u=o)!=null&&u.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)r=l.matches;else return null}let m=r,f=(c=l)==null?void 0:c.errors;if(f!=null){let x=m.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);x>=0||It(!1),m=m.slice(0,Math.min(m.length,x+1))}let g=!1,y=-1;if(l&&o&&o.v7_partialHydration)for(let x=0;x=0?m=m.slice(0,y+1):m=[m[0]];break}}}return m.reduceRight((x,v,C)=>{let E,P=!1,w=null,b=null;l&&(E=f&&v.route.id?f[v.route.id]:void 0,w=v.route.errorElement||aj,g&&(y<0&&C===0?(fj("route-fallback"),P=!0,b=null):y===C&&(P=!0,b=v.route.hydrateFallbackElement||null)));let N=a.concat(m.slice(0,C+1)),k=()=>{let j;return E?j=w:P?j=b:v.route.Component?j=h.createElement(v.route.Component,null):v.route.element?j=v.route.element:j=x,h.createElement(ij,{match:v,routeContext:{outlet:x,matches:N,isDataRoute:l!=null},children:j})};return l&&(v.route.ErrorBoundary||v.route.errorElement||C===0)?h.createElement(lj,{location:l.location,revalidation:l.revalidation,component:w,error:E,children:k(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):k()},null)}var Dx=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(Dx||{}),Lx=(function(r){return r.UseBlocker="useBlocker",r.UseLoaderData="useLoaderData",r.UseActionData="useActionData",r.UseRouteError="useRouteError",r.UseNavigation="useNavigation",r.UseRouteLoaderData="useRouteLoaderData",r.UseMatches="useMatches",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r.UseRouteId="useRouteId",r})(Lx||{});function cj(r){let a=h.useContext(fu);return a||It(!1),a}function dj(r){let a=h.useContext(Xv);return a||It(!1),a}function uj(r){let a=h.useContext(Tr);return a||It(!1),a}function Ox(r){let a=uj(),l=a.matches[a.matches.length-1];return l.route.id||It(!1),l.route.id}function hj(){var r;let a=h.useContext(_x),l=dj(),o=Ox();return a!==void 0?a:(r=l.errors)==null?void 0:r[o]}function mj(){let{router:r}=cj(Dx.UseNavigateStable),a=Ox(Lx.UseNavigateStable),l=h.useRef(!1);return Mx(()=>{l.current=!0}),h.useCallback(function(c,u){u===void 0&&(u={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,Pl({fromRouteId:a},u)))},[r,a])}const Rf={};function fj(r,a,l){Rf[r]||(Rf[r]=!0)}function xj(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function bd(r){let{to:a,replace:l,state:o,relative:c}=r;Aa()||It(!1);let{future:u,static:m}=h.useContext(fn),{matches:f}=h.useContext(Tr),{pathname:g}=xn(),y=Da(),x=mu(a,hu(f,u.v7_relativeSplatPath),g,c==="path"),v=JSON.stringify(x);return h.useEffect(()=>y(JSON.parse(v),{replace:l,state:o,relative:c}),[y,v,c,l,o]),null}function pj(r){return tj(r.context)}function pt(r){It(!1)}function gj(r){let{basename:a="/",children:l=null,location:o,navigationType:c=rn.Pop,navigator:u,static:m=!1,future:f}=r;Aa()&&It(!1);let g=a.replace(/^\/*/,"/"),y=h.useMemo(()=>({basename:g,navigator:u,static:m,future:Pl({v7_relativeSplatPath:!1},f)}),[g,f,u,m]);typeof o=="string"&&(o=Ma(o));let{pathname:x="/",search:v="",hash:C="",state:E=null,key:P="default"}=o,w=h.useMemo(()=>{let b=uu(x,g);return b==null?null:{location:{pathname:b,search:v,hash:C,state:E,key:P},navigationType:c}},[g,x,v,C,E,P,c]);return w==null?null:h.createElement(fn.Provider,{value:y},h.createElement(vo.Provider,{children:l,value:w}))}function yj(r){let{children:a,location:l}=r;return sj($d(a),l)}new Promise(()=>{});function $d(r,a){a===void 0&&(a=[]);let l=[];return h.Children.forEach(r,(o,c)=>{if(!h.isValidElement(o))return;let u=[...a,c];if(o.type===h.Fragment){l.push.apply(l,$d(o.props.children,u));return}o.type!==pt&&It(!1),!o.props.index||!o.props.children||It(!1);let m={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(m.children=$d(o.props.children,u)),l.push(m)}),l}/** + * React Router DOM v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Bd(){return Bd=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function jj(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function bj(r,a){return r.button===0&&(!a||a==="_self")&&!jj(r)}function Ud(r){return r===void 0&&(r=""),new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((a,l)=>{let o=r[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function Nj(r,a){let l=Ud(r);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(u=>{l.append(c,u)})}),l}const wj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Sj="6";try{window.__reactRouterVersion=Sj}catch{}const Cj="startTransition",If=yo[Cj];function kj(r){let{basename:a,children:l,future:o,window:c}=r,u=h.useRef();u.current==null&&(u.current=Sv({window:c,v5Compat:!0}));let m=u.current,[f,g]=h.useState({action:m.action,location:m.location}),{v7_startTransition:y}=o||{},x=h.useCallback(v=>{y&&If?If(()=>g(v)):g(v)},[g,y]);return h.useLayoutEffect(()=>m.listen(x),[m,x]),h.useEffect(()=>xj(o),[o]),h.createElement(gj,{basename:a,children:l,location:f.location,navigationType:f.action,navigator:m,future:o})}const Ej=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Pj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ji=h.forwardRef(function(a,l){let{onClick:o,relative:c,reloadDocument:u,replace:m,state:f,target:g,to:y,preventScrollReset:x,viewTransition:v}=a,C=vj(a,wj),{basename:E}=h.useContext(fn),P,w=!1;if(typeof y=="string"&&Pj.test(y)&&(P=y,Ej))try{let j=new URL(window.location.href),I=y.startsWith("//")?new URL(j.protocol+y):new URL(y),W=uu(I.pathname,E);I.origin===j.origin&&W!=null?y=W+I.search+I.hash:w=!0}catch{}let b=Jv(y,{relative:c}),N=Tj(y,{replace:m,state:f,target:g,preventScrollReset:x,relative:c,viewTransition:v});function k(j){o&&o(j),j.defaultPrevented||N(j)}return h.createElement("a",Bd({},C,{href:P||b,onClick:w||u?o:k,ref:l,target:g}))});var _f;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(_f||(_f={}));var Mf;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(Mf||(Mf={}));function Tj(r,a){let{target:l,replace:o,state:c,preventScrollReset:u,relative:m,viewTransition:f}=a===void 0?{}:a,g=Da(),y=xn(),x=Ax(r,{relative:m});return h.useCallback(v=>{if(bj(v,l)){v.preventDefault();let C=o!==void 0?o:so(y)===so(x);g(r,{replace:C,state:c,preventScrollReset:u,relative:m,viewTransition:f})}},[y,g,x,o,c,l,r,u,m,f])}function Rj(r){let a=h.useRef(Ud(r)),l=h.useRef(!1),o=xn(),c=h.useMemo(()=>Nj(o.search,l.current?null:a.current),[o.search]),u=Da(),m=h.useCallback((f,g)=>{const y=Ud(typeof f=="function"?f(c):f);l.current=!0,u("?"+y,g)},[u,c]);return[c,m]}/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ij=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_j=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,o)=>o?o.toUpperCase():l.toLowerCase()),Af=r=>{const a=_j(r);return a.charAt(0).toUpperCase()+a.slice(1)},Fx=(...r)=>r.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).join(" ").trim(),Mj=r=>{for(const a in r)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var Aj={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dj=h.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:u,iconNode:m,...f},g)=>h.createElement("svg",{ref:g,...Aj,width:a,height:a,stroke:r,strokeWidth:o?Number(l)*24/Number(a):l,className:Fx("lucide",c),...!u&&!Mj(f)&&{"aria-hidden":"true"},...f},[...m.map(([y,x])=>h.createElement(y,x)),...Array.isArray(u)?u:[u]]));/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ee=(r,a)=>{const l=h.forwardRef(({className:o,...c},u)=>h.createElement(Dj,{ref:u,iconNode:a,className:Fx(`lucide-${Ij(Af(r))}`,`lucide-${r}`,o),...c}));return l.displayName=Af(r),l};/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lj=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Oj=Ee("arrow-up-down",Lj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fj=[["path",{d:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",key:"yr8idg"}]],Df=Ee("bitcoin",Fj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zj=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Ks=Ee("book-open",zj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $j=[["path",{d:"M15 13a3 3 0 1 0-6 0",key:"10j68g"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}]],Bj=Ee("book-user",$j);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uj=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],ro=Ee("calendar",Uj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vj=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Wj=Ee("chart-column",Vj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jo=Ee("check",Hj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ta=Ee("chevron-down",Kj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],en=Ee("chevron-right",Yj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],xu=Ee("chevron-up",Gj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qj=[["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"}]],qj=Ee("circle-alert",Qj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Lf=Ee("circle-check-big",Xj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Vd=Ee("circle-check",Jj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],zx=Ee("circle-question-mark",Zj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],Nd=Ee("circle-user",eb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tb=[["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"}]],$x=Ee("circle-x",tb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sb=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Wd=Ee("clock",sb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rb=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Bx=Ee("copy",rb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nb=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Of=Ee("credit-card",nb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ab=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],sn=Ee("crown",ab);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lb=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],no=Ee("dollar-sign",lb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ib=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],ob=Ee("download",ib);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cb=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ao=Ee("external-link",cb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const db=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Cr=Ee("eye",db);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ub=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],hb=Ee("file-text",ub);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mb=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],fb=Ee("funnel",mb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xb=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],pb=Ee("gift",xb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gb=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],yb=Ee("git-merge",gb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vb=[["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"}]],Hd=Ee("globe",vb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jb=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],bb=Ee("graduation-cap",jb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nb=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Nr=Ee("grip-vertical",Nb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wb=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],Sb=Ee("handshake",wb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cb=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],kb=Ee("house",Cb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Eb=[["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"}]],Ux=Ee("image",Eb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ui=Ee("info",Pb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tb=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Ff=Ee("key",Tb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rb=[["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"}]],Ib=Ee("layout-dashboard",Rb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _b=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],ln=Ee("link-2",_b);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mb=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],zf=Ee("link",Mb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ab=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Db=Ee("list",Ab);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lb=[["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"}]],Ob=Ee("lock",Lb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fb=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],zb=Ee("log-out",Fb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $b=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Vx=Ee("map-pin",$b);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bb=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Ub=Ee("menu",Bb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vb=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Wb=Ee("message-circle",Vb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hb=[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]],Sa=Ee("navigation",Hb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kb=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Yb=Ee("palette",Kb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gb=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],mt=Ee("pen-line",Gb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qb=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],qb=Ee("percent",Qb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xb=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Jb=Ee("phone",Xb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Pt=Ee("plus",Zb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eN=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],$f=Ee("qr-code",eN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tN=[["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"}]],$e=Ee("refresh-cw",tN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sN=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],_t=Ee("save",sN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],on=Ee("search",rN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nN=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],On=Ee("settings",nN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aN=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],wd=Ee("settings-2",aN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],pu=Ee("shield-check",lN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iN=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],Kd=Ee("shopping-bag",iN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oN=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],lo=Ee("smartphone",oN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cN=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Sd=Ee("tag",cN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dN=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Wt=Ee("trash-2",dN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Ca=Ee("trending-up",uN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hN=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Wx=Ee("undo-2",hN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mN=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],io=Ee("upload",mN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fN=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["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"}]],xN=Ee("user-check",fN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pN=[["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:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Yd=Ee("user-plus",pN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gN=[["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"}]],ka=Ee("user",gN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Qt=Ee("users",yN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vN=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],Ra=Ee("wallet",vN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fs=Ee("x",jN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bN=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],nn=Ee("zap",bN),gu="admin_token";function yu(){try{return localStorage.getItem(gu)}catch{return null}}function NN(r){try{localStorage.setItem(gu,r)}catch{}}function wN(){try{localStorage.removeItem(gu)}catch{}}const SN="https://soulapi.quwanzhi.com",CN=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):SN};function Ia(r){const a=CN(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function bo(r,a={}){const{data:l,...o}=a,c=Ia(r),u=new Headers(o.headers),m=yu();m&&u.set("Authorization",`Bearer ${m}`),l!=null&&!u.has("Content-Type")&&u.set("Content-Type","application/json");const f=l!=null?JSON.stringify(l):o.body,g=await fetch(c,{...o,headers:u,body:f,credentials:"include"}),x=(g.headers.get("Content-Type")||"").includes("application/json")?await g.json():g;if(!g.ok){const v=new Error((x==null?void 0:x.error)||`HTTP ${g.status}`);throw v.status=g.status,v.data=x,v}return x}function Be(r,a){return bo(r,{...a,method:"GET"})}function yt(r,a,l){return bo(r,{...l,method:"POST",data:a})}function gt(r,a,l){return bo(r,{...l,method:"PUT",data:a})}function kr(r,a){return bo(r,{...a,method:"DELETE"})}const kN=[{icon:Ib,label:"数据概览",href:"/dashboard"},{icon:Ks,label:"内容管理",href:"/content"},{icon:Qt,label:"用户管理",href:"/users"}],Bf=[{icon:yb,label:"找伙伴",href:"/find-partner"},{icon:Ra,label:"推广中心",href:"/distribution"}];function EN(){const r=xn(),a=Da(),[l,o]=h.useState(!1),[c,u]=h.useState(!1),[m,f]=h.useState(!1);h.useEffect(()=>{o(!0)},[]),h.useEffect(()=>{Bf.some(x=>r.pathname===x.href)&&f(!0)},[r.pathname]),h.useEffect(()=>{if(!l)return;u(!1);let y=!1;return Be("/api/admin").then(x=>{y||(x&&x.success!==!1?u(!0):a("/login",{replace:!0}))}).catch(()=>{y||a("/login",{replace:!0})}),()=>{y=!0}},[l,a]);const g=async()=>{wN();try{await yt("/api/admin/logout",{})}catch{}a("/login",{replace:!0})};return!l||!c?e.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[e.jsx("div",{className:"w-64 bg-[#0f2137] border-r border-gray-700/50"}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"text-[#38bdac]",children:"加载中..."})})]}):e.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[e.jsxs("div",{className:"w-64 bg-[#0f2137] flex flex-col border-r border-gray-700/50 shadow-xl",children:[e.jsxs("div",{className:"p-6 border-b border-gray-700/50",children:[e.jsx("h1",{className:"text-xl font-bold text-[#38bdac]",children:"管理后台"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Soul创业派对"})]}),e.jsxs("nav",{className:"flex-1 p-4 space-y-1 overflow-y-auto",children:[kN.map(y=>{const x=r.pathname===y.href;return e.jsxs(Ji,{to:y.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${x?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(y.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:y.label})]},y.href)}),e.jsx("button",{type:"button",onClick:()=>f(!m),className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-gray-400 hover:bg-gray-700/50 hover:text-white rounded-lg transition-colors",children:e.jsxs("span",{className:"flex items-center gap-3",children:[m?e.jsx(xu,{className:"w-5 h-5"}):e.jsx(Ta,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"更多"})]})}),m&&e.jsx("div",{className:"space-y-1 pl-4",children:Bf.map(y=>{const x=r.pathname===y.href;return e.jsxs(Ji,{to:y.href,className:`flex items-center gap-3 px-4 py-2 rounded-lg transition-colors ${x?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(y.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:y.label})]},y.href)})}),e.jsx("div",{className:"pt-4 mt-4 border-t border-gray-700/50",children:e.jsxs(Ji,{to:"/settings",className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${r.pathname==="/settings"?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(On,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:"系统设置"})]})})]}),e.jsx("div",{className:"p-4 border-t border-gray-700/50 space-y-1",children:e.jsxs("button",{type:"button",onClick:g,className:"w-full flex items-center gap-3 px-4 py-3 text-gray-400 hover:text-white rounded-lg hover:bg-gray-700/50 transition-colors",children:[e.jsx(zb,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"退出登录"})]})})]}),e.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628] min-w-0",children:e.jsx("div",{className:"w-full min-w-[1024px] min-h-full",children:e.jsx(pj,{})})})]})}function Uf(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function vu(...r){return a=>{let l=!1;const o=r.map(c=>{const u=Uf(c,a);return!l&&typeof u=="function"&&(l=!0),u});if(l)return()=>{for(let c=0;c{let{children:u,...m}=o;Hx(u)&&typeof oo=="function"&&(u=oo(u._payload));const f=h.Children.toArray(u),g=f.find(_N);if(g){const y=g.props.children,x=f.map(v=>v===g?h.Children.count(y)>1?h.Children.only(null):h.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...m,ref:c,children:h.isValidElement(y)?h.cloneElement(y,void 0,x):null})}return e.jsx(a,{...m,ref:c,children:u})});return l.displayName=`${r}.Slot`,l}var Yx=Kx("Slot");function RN(r){const a=h.forwardRef((l,o)=>{let{children:c,...u}=l;if(Hx(c)&&typeof oo=="function"&&(c=oo(c._payload)),h.isValidElement(c)){const m=AN(c),f=MN(u,c.props);return c.type!==h.Fragment&&(f.ref=o?vu(o,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var IN=Symbol("radix.slottable");function _N(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===IN}function MN(r,a){const l={...a};for(const o in a){const c=r[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...f)=>{const g=u(...f);return c(...f),g}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...r,...l}}function AN(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}function Gx(r){var a,l,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;atypeof r=="boolean"?`${r}`:r===0?"0":r,Wf=Qx,qx=(r,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return Wf(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:u}=a,m=Object.keys(c).map(y=>{const x=l==null?void 0:l[y],v=u==null?void 0:u[y];if(x===null)return null;const C=Vf(x)||Vf(v);return c[y][C]}),f=l&&Object.entries(l).reduce((y,x)=>{let[v,C]=x;return C===void 0||(y[v]=C),y},{}),g=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((y,x)=>{let{class:v,className:C,...E}=x;return Object.entries(E).every(P=>{let[w,b]=P;return Array.isArray(b)?b.includes({...u,...f}[w]):{...u,...f}[w]===b})?[...y,v,C]:y},[]);return Wf(r,m,g,l==null?void 0:l.class,l==null?void 0:l.className)},DN=(r,a)=>{const l=new Array(r.length+a.length);for(let o=0;o({classGroupId:r,validator:a}),Xx=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),co="-",Hf=[],ON="arbitrary..",FN=r=>{const a=$N(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return zN(m);const f=m.split(co),g=f[0]===""&&f.length>1?1:0;return Jx(f,g,a)},getConflictingClassGroupIds:(m,f)=>{if(f){const g=o[m],y=l[m];return g?y?DN(y,g):g:y||Hf}return l[m]||Hf}}},Jx=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],u=l.nextPart.get(c);if(u){const y=Jx(r,a+1,u);if(y)return y}const m=l.validators;if(m===null)return;const f=a===0?r.join(co):r.slice(a).join(co),g=m.length;for(let y=0;yr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?ON+o:void 0})(),$N=r=>{const{theme:a,classGroups:l}=r;return BN(l,a)},BN=(r,a)=>{const l=Xx();for(const o in r){const c=r[o];ju(c,l,o,a)}return l},ju=(r,a,l,o)=>{const c=r.length;for(let u=0;u{if(typeof r=="string"){VN(r,a,l);return}if(typeof r=="function"){WN(r,a,l,o);return}HN(r,a,l,o)},VN=(r,a,l)=>{const o=r===""?a:Zx(a,r);o.classGroupId=l},WN=(r,a,l,o)=>{if(KN(r)){ju(r(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(LN(l,r))},HN=(r,a,l,o)=>{const c=Object.entries(r),u=c.length;for(let m=0;m{let l=r;const o=a.split(co),c=o.length;for(let u=0;u"isThemeGetter"in r&&r.isThemeGetter===!0,YN=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(u,m)=>{l[u]=m,a++,a>r&&(a=0,o=l,l=Object.create(null))};return{get(u){let m=l[u];if(m!==void 0)return m;if((m=o[u])!==void 0)return c(u,m),m},set(u,m){u in l?l[u]=m:c(u,m)}}},Gd="!",Kf=":",GN=[],Yf=(r,a,l,o,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),QN=r=>{const{prefix:a,experimentalParseClassName:l}=r;let o=c=>{const u=[];let m=0,f=0,g=0,y;const x=c.length;for(let w=0;wg?y-g:void 0;return Yf(u,E,C,P)};if(a){const c=a+Kf,u=o;o=m=>m.startsWith(c)?u(m.slice(c.length)):Yf(GN,!1,m,void 0,!0)}if(l){const c=o;o=u=>l({className:u,parseClassName:c})}return o},qN=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,o)=>{a.set(l,1e6+o)}),l=>{const o=[];let c=[];for(let u=0;u0&&(c.sort(),o.push(...c),c=[]),o.push(m)):c.push(m)}return c.length>0&&(c.sort(),o.push(...c)),o}},XN=r=>({cache:YN(r.cacheSize),parseClassName:QN(r),sortModifiers:qN(r),...FN(r)}),JN=/\s+/,ZN=(r,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:u}=a,m=[],f=r.trim().split(JN);let g="";for(let y=f.length-1;y>=0;y-=1){const x=f[y],{isExternal:v,modifiers:C,hasImportantModifier:E,baseClassName:P,maybePostfixModifierPosition:w}=l(x);if(v){g=x+(g.length>0?" "+g:g);continue}let b=!!w,N=o(b?P.substring(0,w):P);if(!N){if(!b){g=x+(g.length>0?" "+g:g);continue}if(N=o(P),!N){g=x+(g.length>0?" "+g:g);continue}b=!1}const k=C.length===0?"":C.length===1?C[0]:u(C).join(":"),j=E?k+Gd:k,I=j+N;if(m.indexOf(I)>-1)continue;m.push(I);const W=c(N,b);for(let U=0;U0?" "+g:g)}return g},ew=(...r)=>{let a=0,l,o,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let o=0;o{let l,o,c,u;const m=g=>{const y=a.reduce((x,v)=>v(x),r());return l=XN(y),o=l.cache.get,c=l.cache.set,u=f,f(g)},f=g=>{const y=o(g);if(y)return y;const x=ZN(g,l);return c(g,x),x};return u=m,(...g)=>u(ew(...g))},sw=[],$t=r=>{const a=l=>l[r]||sw;return a.isThemeGetter=!0,a},tp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rw=/^\d+\/\d+$/,nw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,iw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ow=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ya=r=>rw.test(r),Qe=r=>!!r&&!Number.isNaN(Number(r)),Jr=r=>!!r&&Number.isInteger(Number(r)),Cd=r=>r.endsWith("%")&&Qe(r.slice(0,-1)),wr=r=>nw.test(r),cw=()=>!0,dw=r=>aw.test(r)&&!lw.test(r),rp=()=>!1,uw=r=>iw.test(r),hw=r=>ow.test(r),mw=r=>!Me(r)&&!Ae(r),fw=r=>La(r,lp,rp),Me=r=>tp.test(r),Ln=r=>La(r,ip,dw),kd=r=>La(r,vw,Qe),Gf=r=>La(r,np,rp),xw=r=>La(r,ap,hw),Vi=r=>La(r,op,uw),Ae=r=>sp.test(r),wl=r=>Oa(r,ip),pw=r=>Oa(r,jw),Qf=r=>Oa(r,np),gw=r=>Oa(r,lp),yw=r=>Oa(r,ap),Wi=r=>Oa(r,op,!0),La=(r,a,l)=>{const o=tp.exec(r);return o?o[1]?a(o[1]):l(o[2]):!1},Oa=(r,a,l=!1)=>{const o=sp.exec(r);return o?o[1]?a(o[1]):l:!1},np=r=>r==="position"||r==="percentage",ap=r=>r==="image"||r==="url",lp=r=>r==="length"||r==="size"||r==="bg-size",ip=r=>r==="length",vw=r=>r==="number",jw=r=>r==="family-name",op=r=>r==="shadow",bw=()=>{const r=$t("color"),a=$t("font"),l=$t("text"),o=$t("font-weight"),c=$t("tracking"),u=$t("leading"),m=$t("breakpoint"),f=$t("container"),g=$t("spacing"),y=$t("radius"),x=$t("shadow"),v=$t("inset-shadow"),C=$t("text-shadow"),E=$t("drop-shadow"),P=$t("blur"),w=$t("perspective"),b=$t("aspect"),N=$t("ease"),k=$t("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],W=()=>[...I(),Ae,Me],U=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],R=()=>[Ae,Me,g],T=()=>[ya,"full","auto",...R()],re=()=>[Jr,"none","subgrid",Ae,Me],ae=()=>["auto",{span:["full",Jr,Ae,Me]},Jr,Ae,Me],oe=()=>[Jr,"auto",Ae,Me],ee=()=>["auto","min","max","fr",Ae,Me],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],ne=()=>["auto",...R()],ve=()=>[ya,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],$=()=>[r,Ae,Me],ce=()=>[...I(),Qf,Gf,{position:[Ae,Me]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",gw,fw,{size:[Ae,Me]}],O=()=>[Cd,wl,Ln],L=()=>["","none","full",y,Ae,Me],X=()=>["",Qe,wl,Ln],K=()=>["solid","dashed","dotted","double"],de=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>[Qe,Cd,Qf,Gf],xe=()=>["","none",P,Ae,Me],we=()=>["none",Qe,Ae,Me],D=()=>["none",Qe,Ae,Me],ue=()=>[Qe,Ae,Me],Se=()=>[ya,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[wr],breakpoint:[wr],color:[cw],container:[wr],"drop-shadow":[wr],ease:["in","out","in-out"],font:[mw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[wr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[wr],shadow:[wr],spacing:["px",Qe],text:[wr],"text-shadow":[wr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ya,Me,Ae,b]}],container:["container"],columns:[{columns:[Qe,Me,Ae,f]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:W()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[Jr,"auto",Ae,Me]}],basis:[{basis:[ya,"full","auto",f,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,ya,"auto","initial","none",Me]}],grow:[{grow:["",Qe,Ae,Me]}],shrink:[{shrink:["",Qe,Ae,Me]}],order:[{order:[Jr,"first","last","none",Ae,Me]}],"grid-cols":[{"grid-cols":re()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":re()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:ne()}],mx:[{mx:ne()}],my:[{my:ne()}],ms:[{ms:ne()}],me:[{me:ne()}],mt:[{mt:ne()}],mr:[{mr:ne()}],mb:[{mb:ne()}],ml:[{ml:ne()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:ve()}],w:[{w:[f,"screen",...ve()]}],"min-w":[{"min-w":[f,"screen","none",...ve()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[m]},...ve()]}],h:[{h:["screen","lh",...ve()]}],"min-h":[{"min-h":["screen","lh","none",...ve()]}],"max-h":[{"max-h":["screen","lh",...ve()]}],"font-size":[{text:["base",l,wl,Ln]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ae,kd]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cd,Me]}],"font-family":[{font:[pw,Me,a]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,Ae,Me]}],"line-clamp":[{"line-clamp":[Qe,"none",Ae,kd]}],leading:[{leading:[u,...R()]}],"list-image":[{"list-image":["none",Ae,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",Ae,Ln]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Qe,"auto",Ae,Me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Jr,Ae,Me],radial:["",Ae,Me],conic:[Jr,Ae,Me]},yw,xw]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,Ae,Me]}],"outline-w":[{outline:["",Qe,wl,Ln]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",x,Wi,Vi]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",v,Wi,Vi]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Qe,Ln]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",C,Wi,Vi]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Qe,Ae,Me]}],"mix-blend":[{"mix-blend":[...de(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":de()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":G()}],"mask-image-linear-to-pos":[{"mask-linear-to":G()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":G()}],"mask-image-t-to-pos":[{"mask-t-to":G()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":G()}],"mask-image-r-to-pos":[{"mask-r-to":G()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":G()}],"mask-image-b-to-pos":[{"mask-b-to":G()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":G()}],"mask-image-l-to-pos":[{"mask-l-to":G()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":G()}],"mask-image-x-to-pos":[{"mask-x-to":G()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":G()}],"mask-image-y-to-pos":[{"mask-y-to":G()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Ae,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":G()}],"mask-image-radial-to-pos":[{"mask-radial-to":G()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":G()}],"mask-image-conic-to-pos":[{"mask-conic-to":G()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,Me]}],filter:[{filter:["","none",Ae,Me]}],blur:[{blur:xe()}],brightness:[{brightness:[Qe,Ae,Me]}],contrast:[{contrast:[Qe,Ae,Me]}],"drop-shadow":[{"drop-shadow":["","none",E,Wi,Vi]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Qe,Ae,Me]}],"hue-rotate":[{"hue-rotate":[Qe,Ae,Me]}],invert:[{invert:["",Qe,Ae,Me]}],saturate:[{saturate:[Qe,Ae,Me]}],sepia:[{sepia:["",Qe,Ae,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,Me]}],"backdrop-blur":[{"backdrop-blur":xe()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,Ae,Me]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,Ae,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,Ae,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,Ae,Me]}],"backdrop-invert":[{"backdrop-invert":["",Qe,Ae,Me]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,Ae,Me]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,Ae,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,Ae,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",Ae,Me]}],ease:[{ease:["linear","initial",N,Ae,Me]}],delay:[{delay:[Qe,Ae,Me]}],animate:[{animate:["none",k,Ae,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ae,Me]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[Ae,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae,Me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae,Me]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Qe,wl,Ln,kd]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Nw=tw(bw);function it(...r){return Nw(Qx(r))}const ww=qx("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function q({className:r,variant:a,size:l,asChild:o=!1,...c}){const u=o?Yx:"button";return e.jsx(u,{"data-slot":"button",className:it(ww({variant:a,size:l,className:r})),...c})}function ie({className:r,type:a,...l}){return e.jsx("input",{type:a,"data-slot":"input",className:it("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none placeholder:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 md:text-sm focus-visible:ring-2 focus-visible:ring-ring",r),...l})}function Sw(){const r=Da(),[a,l]=h.useState(""),[o,c]=h.useState(""),[u,m]=h.useState(""),[f,g]=h.useState(!1),y=async()=>{m(""),g(!0);try{const x=await yt("/api/admin",{username:a.trim(),password:o});if((x==null?void 0:x.success)!==!1&&(x!=null&&x.token)){NN(x.token),r("/dashboard",{replace:!0});return}m(x.error||"用户名或密码错误")}catch(x){const v=x;m(v.status===401?"用户名或密码错误":(v==null?void 0:v.message)||"网络错误,请重试")}finally{g(!1)}};return e.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"w-full max-w-md relative z-10",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 bg-[#38bdac]/20 rounded-2xl flex items-center justify-center mx-auto mb-4 border border-[#38bdac]/30",children:e.jsx(pu,{className:"w-8 h-8 text-[#38bdac]"})}),e.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),e.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),e.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[e.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),e.jsxs("div",{className:"relative",children:[e.jsx(ka,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(ie,{type:"text",value:a,onChange:x=>l(x.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ob,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(ie,{type:"password",value:o,onChange:x=>c(x.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:x=>x.key==="Enter"&&y()})]})]}),u&&e.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:u}),e.jsx(q,{onClick:y,disabled:f,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:f?"登录中...":"登录"})]})]}),e.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const Ce=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:it("rounded-xl border bg-card text-card-foreground shadow",r),...a}));Ce.displayName="Card";const Ye=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:it("flex flex-col space-y-1.5 p-6",r),...a}));Ye.displayName="CardHeader";const Ge=h.forwardRef(({className:r,...a},l)=>e.jsx("h3",{ref:l,className:it("font-semibold leading-none tracking-tight",r),...a}));Ge.displayName="CardTitle";const bt=h.forwardRef(({className:r,...a},l)=>e.jsx("p",{ref:l,className:it("text-sm text-muted-foreground",r),...a}));bt.displayName="CardDescription";const ke=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:it("p-6 pt-0",r),...a}));ke.displayName="CardContent";const Cw=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:it("flex items-center p-6 pt-0",r),...a}));Cw.displayName="CardFooter";function kw(){const r=Da(),[a,l]=h.useState(!0),[o,c]=h.useState([]),[u,m]=h.useState([]),[f,g]=h.useState(0),[y,x]=h.useState(0),[v,C]=h.useState(0),[E,P]=h.useState(0),[w,b]=h.useState(null);async function N(){var W;l(!0),b(null);try{const U=await Be("/api/admin/dashboard/overview");if(U!=null&&U.success){g(U.totalUsers??0),x(U.paidOrderCount??0),C(U.totalRevenue??0),P(U.conversionRate??0),m(U.recentOrders??[]),c(U.newUsers??[]);return}}catch(U){console.error("数据概览接口失败,尝试降级拉取",U)}try{const[U,_]=await Promise.all([Be("/api/db/users?page=1&pageSize=10"),Be("/api/orders?page=1&pageSize=20&status=paid")]),R=typeof(U==null?void 0:U.total)=="number"?U.total:((W=U==null?void 0:U.users)==null?void 0:W.length)??0,T=(_==null?void 0:_.orders)??[],re=typeof(_==null?void 0:_.total)=="number"?_.total:T.length,ae=T.filter(Y=>Y.status==="paid"||Y.status==="completed"||Y.status==="success"),oe=ae.reduce((Y,ne)=>Y+Number(ne.amount||0),0),ee=new Set(ae.map(Y=>Y.userId).filter(Boolean)),te=R>0&&ee.size>0?ee.size/R*100:0;g(R),x(re),C(oe),P(te),m(T.slice(0,5)),c((U==null?void 0:U.users)??[])}catch(U){console.error("降级拉取失败",U);const _=U;(_==null?void 0:_.status)===401?b("登录已过期,请重新登录"):b("加载失败,请检查网络或联系管理员")}finally{l(!1)}}if(h.useEffect(()=>{N();const W=setInterval(N,3e4);return()=>clearInterval(W)},[]),a)return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-24",children:[e.jsx($e,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),e.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const k=f,j=W=>{const U=W.productType||"",_=W.description||"";if(_){if(U==="section"&&_.includes("章节")){if(_.includes("-")){const R=_.split("-");if(R.length>=3)return{title:`第${R[1]}章 第${R[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:_,subtitle:"章节购买"}}return U==="fullbook"||_.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"||_.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:_,subtitle:U==="section"?"单章":U==="fullbook"?"全书":"其他"}}return U==="section"?{title:`章节 ${W.productId||""}`,subtitle:"单章购买"}:U==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:U||"其他"}},I=[{title:"总用户数",value:k,icon:Qt,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${(v??0).toFixed(2)}`,icon:Ca,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:Kd,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${typeof E=="number"?E.toFixed(1):0}%`,icon:Ks,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"}];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),w&&e.jsxs("div",{className:"mb-6 px-4 py-3 rounded-lg bg-amber-500/20 border border-amber-500/50 text-amber-200 text-sm flex items-center justify-between",children:[e.jsx("span",{children:w}),e.jsx("button",{type:"button",onClick:()=>N(),className:"text-amber-400 hover:text-amber-300 underline",children:"重试"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:I.map((W,U)=>e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>W.link&&r(W.link),children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(Ge,{className:"text-sm font-medium text-gray-400",children:W.title}),e.jsx("div",{className:`p-2 rounded-lg ${W.bg}`,children:e.jsx(W.icon,{className:`w-4 h-4 ${W.color}`})})]}),e.jsx(ke,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-2xl font-bold text-white",children:W.value}),e.jsx(en,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},U))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between",children:[e.jsx(Ge,{className:"text-white",children:"最近订单"}),e.jsxs("button",{type:"button",onClick:()=>N(),className:"text-xs text-gray-400 hover:text-[#38bdac] flex items-center gap-1",title:"刷新",children:[e.jsx($e,{className:"w-3.5 h-3.5"}),"刷新(每 30 秒自动更新)"]})]}),e.jsx(ke,{children:e.jsxs("div",{className:"space-y-3",children:[u.slice(0,5).map(W=>{var re;const U=W.referrerId?o.find(ae=>ae.id===W.referrerId):void 0,_=W.referralCode||(U==null?void 0:U.referralCode)||(U==null?void 0:U.nickname)||(W.referrerId?String(W.referrerId).slice(0,8):""),R=j(W),T=W.userNickname||((re=o.find(ae=>ae.id===W.userId))==null?void 0:re.nickname)||"匿名用户";return e.jsxs("div",{className:"flex items-start justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30 hover:border-[#38bdac]/30 transition-colors",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[W.userAvatar?e.jsx("img",{src:W.userAvatar,alt:T,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:ae=>{ae.currentTarget.style.display="none";const oe=ae.currentTarget.nextElementSibling;oe&&oe.classList.remove("hidden")}}):null,e.jsx("div",{className:`w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 mt-0.5 ${W.userAvatar?"hidden":""}`,children:T.charAt(0)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm text-gray-300",children:T}),e.jsx("span",{className:"text-gray-600",children:"·"}),e.jsx("span",{className:"text-sm font-medium text-white truncate",children:R.title})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[e.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700/50 rounded",children:R.subtitle}),e.jsx("span",{children:new Date(W.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),_&&e.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",_]})]})]}),e.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[e.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(W.amount).toFixed(2)]}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:W.paymentMethod||"微信"})]})]},W.id)}),u.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Kd,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ye,{children:e.jsx(Ge,{className:"text-white",children:"新注册用户"})}),e.jsx(ke,{children:e.jsxs("div",{className:"space-y-3",children:[o.slice(0,5).map(W=>{var U;return e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((U=W.nickname)==null?void 0:U.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-white",children:W.nickname||"匿名用户"}),e.jsx("p",{className:"text-xs text-gray-500",children:W.phone||"-"})]})]}),e.jsx("p",{className:"text-xs text-gray-400",children:W.createdAt?new Date(W.createdAt).toLocaleDateString():"-"})]},W.id)}),o.length===0&&e.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const xs=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:l,className:it("w-full caption-bottom text-sm",r),...a})}));xs.displayName="Table";const ps=h.forwardRef(({className:r,...a},l)=>e.jsx("thead",{ref:l,className:it("[&_tr]:border-b",r),...a}));ps.displayName="TableHeader";const gs=h.forwardRef(({className:r,...a},l)=>e.jsx("tbody",{ref:l,className:it("[&_tr:last-child]:border-0",r),...a}));gs.displayName="TableBody";const Je=h.forwardRef(({className:r,...a},l)=>e.jsx("tr",{ref:l,className:it("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));Je.displayName="TableRow";const be=h.forwardRef(({className:r,...a},l)=>e.jsx("th",{ref:l,className:it("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));be.displayName="TableHead";const ye=h.forwardRef(({className:r,...a},l)=>e.jsx("td",{ref:l,className:it("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));ye.displayName="TableCell";const Ew=qx("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Oe({className:r,variant:a,asChild:l=!1,...o}){const c=l?Yx:"span";return e.jsx(c,{className:it(Ew({variant:a}),r),...o})}function Ke(r,a,{checkForDefaultPrevented:l=!0}={}){return function(c){if(r==null||r(c),l===!1||!c.defaultPrevented)return a==null?void 0:a(c)}}function Pw(r,a){const l=h.createContext(a),o=u=>{const{children:m,...f}=u,g=h.useMemo(()=>f,Object.values(f));return e.jsx(l.Provider,{value:g,children:m})};o.displayName=r+"Provider";function c(u){const m=h.useContext(l);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${r}\``)}return[o,c]}function pn(r,a=[]){let l=[];function o(u,m){const f=h.createContext(m),g=l.length;l=[...l,m];const y=v=>{var N;const{scope:C,children:E,...P}=v,w=((N=C==null?void 0:C[r])==null?void 0:N[g])||f,b=h.useMemo(()=>P,Object.values(P));return e.jsx(w.Provider,{value:b,children:E})};y.displayName=u+"Provider";function x(v,C){var w;const E=((w=C==null?void 0:C[r])==null?void 0:w[g])||f,P=h.useContext(E);if(P)return P;if(m!==void 0)return m;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[y,x]}const c=()=>{const u=l.map(m=>h.createContext(m));return function(f){const g=(f==null?void 0:f[r])||u;return h.useMemo(()=>({[`__scope${r}`]:{...f,[r]:g}}),[f,g])}};return c.scopeName=r,[o,Tw(c,...a)]}function Tw(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const o=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(u){const m=o.reduce((f,{useScope:g,scopeName:y})=>{const v=g(u)[`__scope${y}`];return{...f,...v}},{});return h.useMemo(()=>({[`__scope${a.scopeName}`]:m}),[m])}};return l.scopeName=a.scopeName,l}var ts=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Rw=yo[" useId ".trim().toString()]||(()=>{}),Iw=0;function cn(r){const[a,l]=h.useState(Rw());return ts(()=>{l(o=>o??String(Iw++))},[r]),a?`radix-${a}`:""}var _w=yo[" useInsertionEffect ".trim().toString()]||ts;function Fn({prop:r,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,u,m]=Mw({defaultProp:a,onChange:l}),f=r!==void 0,g=f?r:c;{const x=h.useRef(r!==void 0);h.useEffect(()=>{const v=x.current;v!==f&&console.warn(`${o} is changing from ${v?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=f},[f,o])}const y=h.useCallback(x=>{var v;if(f){const C=Aw(x)?x(r):x;C!==r&&((v=m.current)==null||v.call(m,C))}else u(x)},[f,r,u,m]);return[g,y]}function Mw({defaultProp:r,onChange:a}){const[l,o]=h.useState(r),c=h.useRef(l),u=h.useRef(a);return _w(()=>{u.current=a},[a]),h.useEffect(()=>{var m;c.current!==l&&((m=u.current)==null||m.call(u,l),c.current=l)},[l,c]),[l,o,u]}function Aw(r){return typeof r=="function"}function Tl(r){const a=Dw(r),l=h.forwardRef((o,c)=>{const{children:u,...m}=o,f=h.Children.toArray(u),g=f.find(Ow);if(g){const y=g.props.children,x=f.map(v=>v===g?h.Children.count(y)>1?h.Children.only(null):h.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...m,ref:c,children:h.isValidElement(y)?h.cloneElement(y,void 0,x):null})}return e.jsx(a,{...m,ref:c,children:u})});return l.displayName=`${r}.Slot`,l}function Dw(r){const a=h.forwardRef((l,o)=>{const{children:c,...u}=l;if(h.isValidElement(c)){const m=zw(c),f=Fw(u,c.props);return c.type!==h.Fragment&&(f.ref=o?vu(o,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var Lw=Symbol("radix.slottable");function Ow(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===Lw}function Fw(r,a){const l={...a};for(const o in a){const c=r[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...f)=>{const g=u(...f);return c(...f),g}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...r,...l}}function zw(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var $w=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=$w.reduce((r,a)=>{const l=Tl(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:m,...f}=c,g=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(g,{...f,ref:u})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{});function Bw(r,a){r&&Il.flushSync(()=>r.dispatchEvent(a))}function un(r){const a=h.useRef(r);return h.useEffect(()=>{a.current=r}),h.useMemo(()=>(...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function Uw(r,a=globalThis==null?void 0:globalThis.document){const l=un(r);h.useEffect(()=>{const o=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",o,{capture:!0}),()=>a.removeEventListener("keydown",o,{capture:!0})},[l,a])}var Vw="DismissableLayer",Qd="dismissableLayer.update",Ww="dismissableLayer.pointerDownOutside",Hw="dismissableLayer.focusOutside",qf,cp=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bu=h.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:m,onDismiss:f,...g}=r,y=h.useContext(cp),[x,v]=h.useState(null),C=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=h.useState({}),P=lt(a,_=>v(_)),w=Array.from(y.layers),[b]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),N=w.indexOf(b),k=x?w.indexOf(x):-1,j=y.layersWithOutsidePointerEventsDisabled.size>0,I=k>=N,W=Gw(_=>{const R=_.target,T=[...y.branches].some(re=>re.contains(R));!I||T||(c==null||c(_),m==null||m(_),_.defaultPrevented||f==null||f())},C),U=Qw(_=>{const R=_.target;[...y.branches].some(re=>re.contains(R))||(u==null||u(_),m==null||m(_),_.defaultPrevented||f==null||f())},C);return Uw(_=>{k===y.layers.size-1&&(o==null||o(_),!_.defaultPrevented&&f&&(_.preventDefault(),f()))},C),h.useEffect(()=>{if(x)return l&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(qf=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(x)),y.layers.add(x),Xf(),()=>{l&&y.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=qf)}},[x,C,l,y]),h.useEffect(()=>()=>{x&&(y.layers.delete(x),y.layersWithOutsidePointerEventsDisabled.delete(x),Xf())},[x,y]),h.useEffect(()=>{const _=()=>E({});return document.addEventListener(Qd,_),()=>document.removeEventListener(Qd,_)},[]),e.jsx(qe.div,{...g,ref:P,style:{pointerEvents:j?I?"auto":"none":void 0,...r.style},onFocusCapture:Ke(r.onFocusCapture,U.onFocusCapture),onBlurCapture:Ke(r.onBlurCapture,U.onBlurCapture),onPointerDownCapture:Ke(r.onPointerDownCapture,W.onPointerDownCapture)})});bu.displayName=Vw;var Kw="DismissableLayerBranch",Yw=h.forwardRef((r,a)=>{const l=h.useContext(cp),o=h.useRef(null),c=lt(a,o);return h.useEffect(()=>{const u=o.current;if(u)return l.branches.add(u),()=>{l.branches.delete(u)}},[l.branches]),e.jsx(qe.div,{...r,ref:c})});Yw.displayName=Kw;function Gw(r,a=globalThis==null?void 0:globalThis.document){const l=un(r),o=h.useRef(!1),c=h.useRef(()=>{});return h.useEffect(()=>{const u=f=>{if(f.target&&!o.current){let g=function(){dp(Ww,l,y,{discrete:!0})};const y={originalEvent:f};f.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=g,a.addEventListener("click",c.current,{once:!0})):g()}else a.removeEventListener("click",c.current);o.current=!1},m=window.setTimeout(()=>{a.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(m),a.removeEventListener("pointerdown",u),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>o.current=!0}}function Qw(r,a=globalThis==null?void 0:globalThis.document){const l=un(r),o=h.useRef(!1);return h.useEffect(()=>{const c=u=>{u.target&&!o.current&&dp(Hw,l,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Xf(){const r=new CustomEvent(Qd);document.dispatchEvent(r)}function dp(r,a,l,{discrete:o}){const c=l.originalEvent.target,u=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),o?Bw(c,u):c.dispatchEvent(u)}var Ed="focusScope.autoFocusOnMount",Pd="focusScope.autoFocusOnUnmount",Jf={bubbles:!1,cancelable:!0},qw="FocusScope",Nu=h.forwardRef((r,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:u,...m}=r,[f,g]=h.useState(null),y=un(c),x=un(u),v=h.useRef(null),C=lt(a,w=>g(w)),E=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let w=function(j){if(E.paused||!f)return;const I=j.target;f.contains(I)?v.current=I:tn(v.current,{select:!0})},b=function(j){if(E.paused||!f)return;const I=j.relatedTarget;I!==null&&(f.contains(I)||tn(v.current,{select:!0}))},N=function(j){if(document.activeElement===document.body)for(const W of j)W.removedNodes.length>0&&tn(f)};document.addEventListener("focusin",w),document.addEventListener("focusout",b);const k=new MutationObserver(N);return f&&k.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",b),k.disconnect()}}},[o,f,E.paused]),h.useEffect(()=>{if(f){ex.add(E);const w=document.activeElement;if(!f.contains(w)){const N=new CustomEvent(Ed,Jf);f.addEventListener(Ed,y),f.dispatchEvent(N),N.defaultPrevented||(Xw(s1(up(f)),{select:!0}),document.activeElement===w&&tn(f))}return()=>{f.removeEventListener(Ed,y),setTimeout(()=>{const N=new CustomEvent(Pd,Jf);f.addEventListener(Pd,x),f.dispatchEvent(N),N.defaultPrevented||tn(w??document.body,{select:!0}),f.removeEventListener(Pd,x),ex.remove(E)},0)}}},[f,y,x,E]);const P=h.useCallback(w=>{if(!l&&!o||E.paused)return;const b=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,N=document.activeElement;if(b&&N){const k=w.currentTarget,[j,I]=Jw(k);j&&I?!w.shiftKey&&N===I?(w.preventDefault(),l&&tn(j,{select:!0})):w.shiftKey&&N===j&&(w.preventDefault(),l&&tn(I,{select:!0})):N===k&&w.preventDefault()}},[l,o,E.paused]);return e.jsx(qe.div,{tabIndex:-1,...m,ref:C,onKeyDown:P})});Nu.displayName=qw;function Xw(r,{select:a=!1}={}){const l=document.activeElement;for(const o of r)if(tn(o,{select:a}),document.activeElement!==l)return}function Jw(r){const a=up(r),l=Zf(a,r),o=Zf(a.reverse(),r);return[l,o]}function up(r){const a=[],l=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function Zf(r,a){for(const l of r)if(!Zw(l,{upTo:a}))return l}function Zw(r,{upTo:a}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(a!==void 0&&r===a)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function e1(r){return r instanceof HTMLInputElement&&"select"in r}function tn(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&e1(r)&&a&&r.select()}}var ex=t1();function t1(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=tx(r,a),r.unshift(a)},remove(a){var l;r=tx(r,a),(l=r[0])==null||l.resume()}}}function tx(r,a){const l=[...r],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function s1(r){return r.filter(a=>a.tagName!=="A")}var r1="Portal",wu=h.forwardRef((r,a)=>{var f;const{container:l,...o}=r,[c,u]=h.useState(!1);ts(()=>u(!0),[]);const m=l||c&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return m?wv.createPortal(e.jsx(qe.div,{...o,ref:a}),m):null});wu.displayName=r1;function n1(r,a){return h.useReducer((l,o)=>a[l][o]??l,r)}var _l=r=>{const{present:a,children:l}=r,o=a1(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),u=lt(o.ref,l1(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:u}):null};_l.displayName="Presence";function a1(r){const[a,l]=h.useState(),o=h.useRef(null),c=h.useRef(r),u=h.useRef("none"),m=r?"mounted":"unmounted",[f,g]=n1(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const y=Hi(o.current);u.current=f==="mounted"?y:"none"},[f]),ts(()=>{const y=o.current,x=c.current;if(x!==r){const C=u.current,E=Hi(y);r?g("MOUNT"):E==="none"||(y==null?void 0:y.display)==="none"?g("UNMOUNT"):g(x&&C!==E?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,g]),ts(()=>{if(a){let y;const x=a.ownerDocument.defaultView??window,v=E=>{const w=Hi(o.current).includes(CSS.escape(E.animationName));if(E.target===a&&w&&(g("ANIMATION_END"),!c.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",y=x.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},C=E=>{E.target===a&&(u.current=Hi(o.current))};return a.addEventListener("animationstart",C),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{x.clearTimeout(y),a.removeEventListener("animationstart",C),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else g("ANIMATION_END")},[a,g]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:h.useCallback(y=>{o.current=y?getComputedStyle(y):null,l(y)},[])}}function Hi(r){return(r==null?void 0:r.animationName)||"none"}function l1(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Td=0;function hp(){h.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??sx()),document.body.insertAdjacentElement("beforeend",r[1]??sx()),Td++,()=>{Td===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Td--}},[])}function sx(){const r=document.createElement("span");return r.setAttribute("data-radix-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}var ar=function(){return ar=Object.assign||function(a){for(var l,o=1,c=arguments.length;o"u")return w1;var a=S1(r),l=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-l+a[2]-a[0])}},k1=pp(),Ea="data-scroll-locked",E1=function(r,a,l,o){var c=r.left,u=r.top,m=r.right,f=r.gap;return l===void 0&&(l="margin"),` + .`.concat(o1,` { + overflow: hidden `).concat(o,`; + padding-right: `).concat(f,"px ").concat(o,`; + } + body[`).concat(Ea,`] { + overflow: hidden `).concat(o,`; + overscroll-behavior: contain; + `).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&` + padding-left: `.concat(c,`px; + padding-top: `).concat(u,`px; + padding-right: `).concat(m,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(f,"px ").concat(o,`; + `),l==="padding"&&"padding-right: ".concat(f,"px ").concat(o,";")].filter(Boolean).join(""),` + } + + .`).concat(Zi,` { + right: `).concat(f,"px ").concat(o,`; + } + + .`).concat(eo,` { + margin-right: `).concat(f,"px ").concat(o,`; + } + + .`).concat(Zi," .").concat(Zi,` { + right: 0 `).concat(o,`; + } + + .`).concat(eo," .").concat(eo,` { + margin-right: 0 `).concat(o,`; + } + + body[`).concat(Ea,`] { + `).concat(c1,": ").concat(f,`px; + } +`)},nx=function(){var r=parseInt(document.body.getAttribute(Ea)||"0",10);return isFinite(r)?r:0},P1=function(){h.useEffect(function(){return document.body.setAttribute(Ea,(nx()+1).toString()),function(){var r=nx()-1;r<=0?document.body.removeAttribute(Ea):document.body.setAttribute(Ea,r.toString())}},[])},T1=function(r){var a=r.noRelative,l=r.noImportant,o=r.gapMode,c=o===void 0?"margin":o;P1();var u=h.useMemo(function(){return C1(c)},[c]);return h.createElement(k1,{styles:E1(u,!a,c,l?"":"!important")})},qd=!1;if(typeof window<"u")try{var Ki=Object.defineProperty({},"passive",{get:function(){return qd=!0,!0}});window.addEventListener("test",Ki,Ki),window.removeEventListener("test",Ki,Ki)}catch{qd=!1}var va=qd?{passive:!1}:!1,R1=function(r){return r.tagName==="TEXTAREA"},gp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!R1(r)&&l[a]==="visible")},I1=function(r){return gp(r,"overflowY")},_1=function(r){return gp(r,"overflowX")},ax=function(r,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=yp(r,o);if(c){var u=vp(r,o),m=u[1],f=u[2];if(m>f)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},M1=function(r){var a=r.scrollTop,l=r.scrollHeight,o=r.clientHeight;return[a,l,o]},A1=function(r){var a=r.scrollLeft,l=r.scrollWidth,o=r.clientWidth;return[a,l,o]},yp=function(r,a){return r==="v"?I1(a):_1(a)},vp=function(r,a){return r==="v"?M1(a):A1(a)},D1=function(r,a){return r==="h"&&a==="rtl"?-1:1},L1=function(r,a,l,o,c){var u=D1(r,window.getComputedStyle(a).direction),m=u*o,f=l.target,g=a.contains(f),y=!1,x=m>0,v=0,C=0;do{if(!f)break;var E=vp(r,f),P=E[0],w=E[1],b=E[2],N=w-b-u*P;(P||N)&&yp(r,f)&&(v+=N,C+=P);var k=f.parentNode;f=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!g&&f!==document.body||g&&(a.contains(f)||a===f));return(x&&Math.abs(v)<1||!x&&Math.abs(C)<1)&&(y=!0),y},Yi=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},lx=function(r){return[r.deltaX,r.deltaY]},ix=function(r){return r&&"current"in r?r.current:r},O1=function(r,a){return r[0]===a[0]&&r[1]===a[1]},F1=function(r){return` + .block-interactivity-`.concat(r,` {pointer-events: none;} + .allow-interactivity-`).concat(r,` {pointer-events: all;} +`)},z1=0,ja=[];function $1(r){var a=h.useRef([]),l=h.useRef([0,0]),o=h.useRef(),c=h.useState(z1++)[0],u=h.useState(pp)[0],m=h.useRef(r);h.useEffect(function(){m.current=r},[r]),h.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var w=i1([r.lockRef.current],(r.shards||[]).map(ix),!0).filter(Boolean);return w.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),w.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var f=h.useCallback(function(w,b){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!m.current.allowPinchZoom;var N=Yi(w),k=l.current,j="deltaX"in w?w.deltaX:k[0]-N[0],I="deltaY"in w?w.deltaY:k[1]-N[1],W,U=w.target,_=Math.abs(j)>Math.abs(I)?"h":"v";if("touches"in w&&_==="h"&&U.type==="range")return!1;var R=window.getSelection(),T=R&&R.anchorNode,re=T?T===U||T.contains(U):!1;if(re)return!1;var ae=ax(_,U);if(!ae)return!0;if(ae?W=_:(W=_==="v"?"h":"v",ae=ax(_,U)),!ae)return!1;if(!o.current&&"changedTouches"in w&&(j||I)&&(o.current=W),!W)return!0;var oe=o.current||W;return L1(oe,b,w,oe==="h"?j:I)},[]),g=h.useCallback(function(w){var b=w;if(!(!ja.length||ja[ja.length-1]!==u)){var N="deltaY"in b?lx(b):Yi(b),k=a.current.filter(function(W){return W.name===b.type&&(W.target===b.target||b.target===W.shadowParent)&&O1(W.delta,N)})[0];if(k&&k.should){b.cancelable&&b.preventDefault();return}if(!k){var j=(m.current.shards||[]).map(ix).filter(Boolean).filter(function(W){return W.contains(b.target)}),I=j.length>0?f(b,j[0]):!m.current.noIsolation;I&&b.cancelable&&b.preventDefault()}}},[]),y=h.useCallback(function(w,b,N,k){var j={name:w,delta:b,target:N,should:k,shadowParent:B1(N)};a.current.push(j),setTimeout(function(){a.current=a.current.filter(function(I){return I!==j})},1)},[]),x=h.useCallback(function(w){l.current=Yi(w),o.current=void 0},[]),v=h.useCallback(function(w){y(w.type,lx(w),w.target,f(w,r.lockRef.current))},[]),C=h.useCallback(function(w){y(w.type,Yi(w),w.target,f(w,r.lockRef.current))},[]);h.useEffect(function(){return ja.push(u),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:C}),document.addEventListener("wheel",g,va),document.addEventListener("touchmove",g,va),document.addEventListener("touchstart",x,va),function(){ja=ja.filter(function(w){return w!==u}),document.removeEventListener("wheel",g,va),document.removeEventListener("touchmove",g,va),document.removeEventListener("touchstart",x,va)}},[]);var E=r.removeScrollBar,P=r.inert;return h.createElement(h.Fragment,null,P?h.createElement(u,{styles:F1(c)}):null,E?h.createElement(T1,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function B1(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const U1=p1(xp,$1);var Su=h.forwardRef(function(r,a){return h.createElement(No,ar({},r,{ref:a,sideCar:U1}))});Su.classNames=No.classNames;var V1=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},ba=new WeakMap,Gi=new WeakMap,Qi={},Md=0,jp=function(r){return r&&(r.host||jp(r.parentNode))},W1=function(r,a){return a.map(function(l){if(r.contains(l))return l;var o=jp(l);return o&&r.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},H1=function(r,a,l,o){var c=W1(a,Array.isArray(r)?r:[r]);Qi[l]||(Qi[l]=new WeakMap);var u=Qi[l],m=[],f=new Set,g=new Set(c),y=function(v){!v||f.has(v)||(f.add(v),y(v.parentNode))};c.forEach(y);var x=function(v){!v||g.has(v)||Array.prototype.forEach.call(v.children,function(C){if(f.has(C))x(C);else try{var E=C.getAttribute(o),P=E!==null&&E!=="false",w=(ba.get(C)||0)+1,b=(u.get(C)||0)+1;ba.set(C,w),u.set(C,b),m.push(C),w===1&&P&&Gi.set(C,!0),b===1&&C.setAttribute(l,"true"),P||C.setAttribute(o,"true")}catch(N){console.error("aria-hidden: cannot operate on ",C,N)}})};return x(a),f.clear(),Md++,function(){m.forEach(function(v){var C=ba.get(v)-1,E=u.get(v)-1;ba.set(v,C),u.set(v,E),C||(Gi.has(v)||v.removeAttribute(o),Gi.delete(v)),E||v.removeAttribute(l)}),Md--,Md||(ba=new WeakMap,ba=new WeakMap,Gi=new WeakMap,Qi={})}},bp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(r)?r:[r]),c=V1(r);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),H1(o,c,l,"aria-hidden")):function(){return null}},wo="Dialog",[Np]=pn(wo),[K1,Qs]=Np(wo),wp=r=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:u,modal:m=!0}=r,f=h.useRef(null),g=h.useRef(null),[y,x]=Fn({prop:o,defaultProp:c??!1,onChange:u,caller:wo});return e.jsx(K1,{scope:a,triggerRef:f,contentRef:g,contentId:cn(),titleId:cn(),descriptionId:cn(),open:y,onOpenChange:x,onOpenToggle:h.useCallback(()=>x(v=>!v),[x]),modal:m,children:l})};wp.displayName=wo;var Sp="DialogTrigger",Y1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(Sp,l),u=lt(a,c.triggerRef);return e.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Eu(c.open),...o,ref:u,onClick:Ke(r.onClick,c.onOpenToggle)})});Y1.displayName=Sp;var Cu="DialogPortal",[G1,Cp]=Np(Cu,{forceMount:void 0}),kp=r=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=r,u=Qs(Cu,a);return e.jsx(G1,{scope:a,forceMount:l,children:h.Children.map(o,m=>e.jsx(_l,{present:l||u.open,children:e.jsx(wu,{asChild:!0,container:c,children:m})}))})};kp.displayName=Cu;var uo="DialogOverlay",Ep=h.forwardRef((r,a)=>{const l=Cp(uo,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,u=Qs(uo,r.__scopeDialog);return u.modal?e.jsx(_l,{present:o||u.open,children:e.jsx(q1,{...c,ref:a})}):null});Ep.displayName=uo;var Q1=Tl("DialogOverlay.RemoveScroll"),q1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(uo,l);return e.jsx(Su,{as:Q1,allowPinchZoom:!0,shards:[c.contentRef],children:e.jsx(qe.div,{"data-state":Eu(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),zn="DialogContent",Pp=h.forwardRef((r,a)=>{const l=Cp(zn,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,u=Qs(zn,r.__scopeDialog);return e.jsx(_l,{present:o||u.open,children:u.modal?e.jsx(X1,{...c,ref:a}):e.jsx(J1,{...c,ref:a})})});Pp.displayName=zn;var X1=h.forwardRef((r,a)=>{const l=Qs(zn,r.__scopeDialog),o=h.useRef(null),c=lt(a,l.contentRef,o);return h.useEffect(()=>{const u=o.current;if(u)return bp(u)},[]),e.jsx(Tp,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ke(r.onCloseAutoFocus,u=>{var m;u.preventDefault(),(m=l.triggerRef.current)==null||m.focus()}),onPointerDownOutside:Ke(r.onPointerDownOutside,u=>{const m=u.detail.originalEvent,f=m.button===0&&m.ctrlKey===!0;(m.button===2||f)&&u.preventDefault()}),onFocusOutside:Ke(r.onFocusOutside,u=>u.preventDefault())})}),J1=h.forwardRef((r,a)=>{const l=Qs(zn,r.__scopeDialog),o=h.useRef(!1),c=h.useRef(!1);return e.jsx(Tp,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var m,f;(m=r.onCloseAutoFocus)==null||m.call(r,u),u.defaultPrevented||(o.current||(f=l.triggerRef.current)==null||f.focus(),u.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:u=>{var g,y;(g=r.onInteractOutside)==null||g.call(r,u),u.defaultPrevented||(o.current=!0,u.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const m=u.target;((y=l.triggerRef.current)==null?void 0:y.contains(m))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&c.current&&u.preventDefault()}})}),Tp=h.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:u,...m}=r,f=Qs(zn,l),g=h.useRef(null),y=lt(a,g);return hp(),e.jsxs(e.Fragment,{children:[e.jsx(Nu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:u,children:e.jsx(bu,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Eu(f.open),...m,ref:y,onDismiss:()=>f.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Z1,{titleId:f.titleId}),e.jsx(t2,{contentRef:g,descriptionId:f.descriptionId})]})]})}),ku="DialogTitle",Rp=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(ku,l);return e.jsx(qe.h2,{id:c.titleId,...o,ref:a})});Rp.displayName=ku;var Ip="DialogDescription",_p=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(Ip,l);return e.jsx(qe.p,{id:c.descriptionId,...o,ref:a})});_p.displayName=Ip;var Mp="DialogClose",Ap=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(Mp,l);return e.jsx(qe.button,{type:"button",...o,ref:a,onClick:Ke(r.onClick,()=>c.onOpenChange(!1))})});Ap.displayName=Mp;function Eu(r){return r?"open":"closed"}var Dp="DialogTitleWarning",[YC,Lp]=Pw(Dp,{contentName:zn,titleName:ku,docsSlug:"dialog"}),Z1=({titleId:r})=>{const a=Lp(Dp),l=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return h.useEffect(()=>{r&&(document.getElementById(r)||console.error(l))},[l,r]),null},e2="DialogDescriptionWarning",t2=({contentRef:r,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Lp(e2).contentName}}.`;return h.useEffect(()=>{var u;const c=(u=r.current)==null?void 0:u.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(o))},[o,r,a]),null},s2=wp,r2=kp,n2=Ep,a2=Pp,l2=Rp,i2=_p,o2=Ap;function St(r){return e.jsx(s2,{"data-slot":"dialog",...r})}function c2(r){return e.jsx(r2,{...r})}const Op=h.forwardRef(({className:r,...a},l)=>e.jsx(n2,{ref:l,className:it("fixed inset-0 z-50 bg-black/50",r),...a}));Op.displayName="DialogOverlay";const jt=h.forwardRef(({className:r,children:a,showCloseButton:l=!0,...o},c)=>e.jsxs(c2,{children:[e.jsx(Op,{}),e.jsxs(a2,{ref:c,"aria-describedby":void 0,className:it("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border bg-background p-6 shadow-lg sm:max-w-lg",r),...o,children:[a,l&&e.jsxs(o2,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(fs,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));jt.displayName="DialogContent";function Ct({className:r,...a}){return e.jsx("div",{className:it("flex flex-col gap-2 text-center sm:text-left",r),...a})}function Dt({className:r,...a}){return e.jsx("div",{className:it("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function kt(r){return e.jsx(l2,{className:"text-lg font-semibold leading-none",...r})}function d2(r){return e.jsx(i2,{className:"text-sm text-muted-foreground",...r})}function Pu(r,a){const[l,o]=h.useState(r);return h.useEffect(()=>{const c=setTimeout(()=>o(r),a);return()=>clearTimeout(c)},[r,a]),l}function Hs({page:r,totalPages:a,total:l,pageSize:o,onPageChange:c,onPageSizeChange:u,pageSizeOptions:m=[10,20,50,100]}){return a<=1&&!u?null:e.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[e.jsxs("span",{children:["共 ",l," 条"]}),u&&e.jsx("select",{value:o,onChange:f=>u(Number(f.target.value)),className:"bg-[#0f2137] border border-gray-600 rounded px-2 py-1 text-gray-300 text-sm",children:m.map(f=>e.jsxs("option",{value:f,children:[f," 条/页"]},f))})]}),a>1&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>c(1),disabled:r<=1,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"首页"}),e.jsx("button",{type:"button",onClick:()=>c(r-1),disabled:r<=1,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"上一页"}),e.jsxs("span",{className:"px-3 py-1 text-gray-400 text-sm",children:[r," / ",a]}),e.jsx("button",{type:"button",onClick:()=>c(r+1),disabled:r>=a,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"下一页"}),e.jsx("button",{type:"button",onClick:()=>c(a),disabled:r>=a,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"末页"})]})]})}function u2(){const[r,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState(0),[m,f]=h.useState(0),[g,y]=h.useState(0),[x,v]=h.useState(1),[C,E]=h.useState(10),[P,w]=h.useState(""),b=Pu(P,300),[N,k]=h.useState("all"),[j,I]=h.useState(!0),[W,U]=h.useState(null),[_,R]=h.useState(null),[T,re]=h.useState(""),[ae,oe]=h.useState(!1);async function ee(){I(!0),U(null);try{const H=N==="all"?"":N==="completed"?"completed":N,A=new URLSearchParams({page:String(x),pageSize:String(C),...H&&{status:H},...b&&{search:b}}),[O,L]=await Promise.all([Be(`/api/orders?${A}`),Be("/api/db/users?page=1&pageSize=500")]);O!=null&&O.success&&(a(O.orders||[]),u(O.total??0),f(O.totalRevenue??0),y(O.todayRevenue??0)),L!=null&&L.success&&L.users&&o(L.users)}catch(H){console.error("加载订单失败",H),U("加载订单失败,请检查网络后重试")}finally{I(!1)}}h.useEffect(()=>{v(1)},[b,N]),h.useEffect(()=>{ee()},[x,C,b,N]);const te=H=>{var A;return H.userNickname||((A=l.find(O=>O.id===H.userId))==null?void 0:A.nickname)||"匿名用户"},Y=H=>{var A;return((A=l.find(O=>O.id===H))==null?void 0:A.phone)||"-"},ne=H=>{const A=H.productType||H.type||"",O=H.description||"";if(O){if(A==="section"&&O.includes("章节")){if(O.includes("-")){const L=O.split("-");if(L.length>=3)return{name:`第${L[1]}章 第${L[2]}节`,type:"《一场Soul的创业实验》"}}return{name:O,type:"章节购买"}}return A==="fullbook"||O.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:A==="vip"||O.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:A==="match"||O.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:O,type:"其他"}}return A==="section"?{name:`章节 ${H.productId||H.sectionId||""}`,type:"单章"}:A==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:A==="vip"?{name:"VIP年度会员",type:"VIP"}:A==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:A||"其他"}},ve=Math.ceil(c/C)||1;async function $(){var H;if(!(!(_!=null&&_.orderSn)&&!(_!=null&&_.id))){oe(!0),U(null);try{const A=await gt("/api/admin/orders/refund",{orderSn:_.orderSn||_.id,reason:T||void 0});A!=null&&A.success?(R(null),re(""),ee()):U((A==null?void 0:A.error)||"退款失败")}catch(A){const O=A;U(((H=O==null?void 0:O.data)==null?void 0:H.error)||"退款失败,请检查网络后重试")}finally{oe(!1)}}}function ce(){if(r.length===0){alert("暂无数据可导出");return}const H=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],A=r.map(de=>{const G=ne(de);return[de.orderSn||de.id||"",te(de),Y(de.userId),G.name,Number(de.amount||0).toFixed(2),de.paymentMethod==="wechat"?"微信支付":de.paymentMethod==="alipay"?"支付宝":de.paymentMethod||"微信支付",de.status==="refunded"?"已退款":de.status==="paid"||de.status==="completed"?"已完成":de.status==="pending"||de.status==="created"?"待支付":"已失败",de.status==="refunded"&&de.refundReason?de.refundReason:"-",de.referrerEarnings?Number(de.referrerEarnings).toFixed(2):"-",de.createdAt?new Date(de.createdAt).toLocaleString("zh-CN"):""].join(",")}),O="\uFEFF"+[H.join(","),...A].join(` +`),L=new Blob([O],{type:"text/csv;charset=utf-8"}),X=URL.createObjectURL(L),K=document.createElement("a");K.href=X,K.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,K.click(),URL.revokeObjectURL(X)}return e.jsxs("div",{className:"p-8 w-full",children:[W&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:W}),e.jsx("button",{type:"button",onClick:()=>U(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"订单管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",r.length," 笔订单"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(q,{variant:"outline",onClick:ee,disabled:j,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${j?"animate-spin":""}`}),"刷新"]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-gray-400",children:"总收入:"}),e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",m.toFixed(2)]}),e.jsx("span",{className:"text-gray-600",children:"|"}),e.jsx("span",{className:"text-gray-400",children:"今日:"}),e.jsxs("span",{className:"text-[#FFD700] font-bold",children:["¥",g.toFixed(2)]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(ie,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:P,onChange:H=>w(H.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(fb,{className:"w-4 h-4 text-gray-400"}),e.jsxs("select",{value:N,onChange:H=>k(H.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"created",children:"已创建"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsxs(q,{variant:"outline",onClick:ce,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ob,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:j?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs("div",{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"订单号"}),e.jsx(be,{className:"text-gray-400",children:"用户"}),e.jsx(be,{className:"text-gray-400",children:"商品"}),e.jsx(be,{className:"text-gray-400",children:"金额"}),e.jsx(be,{className:"text-gray-400",children:"支付方式"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"退款原因"}),e.jsx(be,{className:"text-gray-400",children:"分销佣金"}),e.jsx(be,{className:"text-gray-400",children:"下单时间"}),e.jsx(be,{className:"text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(H=>{const A=ne(H);return e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsxs(ye,{className:"font-mono text-xs text-gray-400",children:[(H.orderSn||H.id||"").slice(0,12),"..."]}),e.jsx(ye,{children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:te(H)}),e.jsx("p",{className:"text-gray-500 text-xs",children:Y(H.userId)})]})}),e.jsx(ye,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[A.name,(H.productType||H.type)==="vip"&&e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0 text-xs",children:"VIP"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:A.type})]})}),e.jsxs(ye,{className:"text-[#38bdac] font-bold",children:["¥",Number(H.amount||0).toFixed(2)]}),e.jsx(ye,{className:"text-gray-300",children:H.paymentMethod==="wechat"?"微信支付":H.paymentMethod==="alipay"?"支付宝":H.paymentMethod||"微信支付"}),e.jsx(ye,{children:H.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):H.status==="paid"||H.status==="completed"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):H.status==="pending"||H.status==="created"?e.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):e.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),e.jsx(ye,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:H.refundReason,children:H.status==="refunded"&&H.refundReason?H.refundReason:"-"}),e.jsx(ye,{className:"text-[#FFD700]",children:H.referrerEarnings?`¥${Number(H.referrerEarnings).toFixed(2)}`:"-"}),e.jsx(ye,{className:"text-gray-400 text-sm",children:new Date(H.createdAt).toLocaleString("zh-CN")}),e.jsx(ye,{children:(H.status==="paid"||H.status==="completed")&&e.jsxs(q,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{R(H),re("")},children:[e.jsx(Wx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},H.id)}),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),e.jsx(Hs,{page:x,totalPages:ve,total:c,pageSize:C,onPageChange:v,onPageSizeChange:H=>{E(H),v(1)}})]})})}),e.jsx(St,{open:!!_,onOpenChange:H=>!H&&R(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:"订单退款"})}),_&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",_.orderSn||_.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(_.amount||0).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:T,onChange:H=>re(H.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>R(null),disabled:ae,children:"取消"}),e.jsx(q,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:$,disabled:ae,children:ae?"退款中...":"确认退款"})]})]})})]})}var h2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],m2=h2.reduce((r,a)=>{const l=Kx(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:m,...f}=c,g=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(g,{...f,ref:u})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{}),f2="Label",Fp=h.forwardRef((r,a)=>e.jsx(m2.label,{...r,ref:a,onMouseDown:l=>{var c;l.target.closest("button, input, select, textarea")||((c=r.onMouseDown)==null||c.call(r,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));Fp.displayName=f2;var zp=Fp;const Z=h.forwardRef(({className:r,...a},l)=>e.jsx(zp,{ref:l,className:it("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));Z.displayName=zp.displayName;function Tu(r){const a=r+"CollectionProvider",[l,o]=pn(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),m=w=>{const{scope:b,children:N}=w,k=Zr.useRef(null),j=Zr.useRef(new Map).current;return e.jsx(c,{scope:b,itemMap:j,collectionRef:k,children:N})};m.displayName=a;const f=r+"CollectionSlot",g=Tl(f),y=Zr.forwardRef((w,b)=>{const{scope:N,children:k}=w,j=u(f,N),I=lt(b,j.collectionRef);return e.jsx(g,{ref:I,children:k})});y.displayName=f;const x=r+"CollectionItemSlot",v="data-radix-collection-item",C=Tl(x),E=Zr.forwardRef((w,b)=>{const{scope:N,children:k,...j}=w,I=Zr.useRef(null),W=lt(b,I),U=u(x,N);return Zr.useEffect(()=>(U.itemMap.set(I,{ref:I,...j}),()=>void U.itemMap.delete(I))),e.jsx(C,{[v]:"",ref:W,children:k})});E.displayName=x;function P(w){const b=u(r+"CollectionConsumer",w);return Zr.useCallback(()=>{const k=b.collectionRef.current;if(!k)return[];const j=Array.from(k.querySelectorAll(`[${v}]`));return Array.from(b.itemMap.values()).sort((U,_)=>j.indexOf(U.ref.current)-j.indexOf(_.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:m,Slot:y,ItemSlot:E},P,o]}var x2=h.createContext(void 0);function So(r){const a=h.useContext(x2);return r||a||"ltr"}var Ad="rovingFocusGroup.onEntryFocus",p2={bubbles:!1,cancelable:!0},Ml="RovingFocusGroup",[Xd,$p,g2]=Tu(Ml),[y2,Bp]=pn(Ml,[g2]),[v2,j2]=y2(Ml),Up=h.forwardRef((r,a)=>e.jsx(Xd.Provider,{scope:r.__scopeRovingFocusGroup,children:e.jsx(Xd.Slot,{scope:r.__scopeRovingFocusGroup,children:e.jsx(b2,{...r,ref:a})})}));Up.displayName=Ml;var b2=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:u,currentTabStopId:m,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:g,onEntryFocus:y,preventScrollOnEntryFocus:x=!1,...v}=r,C=h.useRef(null),E=lt(a,C),P=So(u),[w,b]=Fn({prop:m,defaultProp:f??null,onChange:g,caller:Ml}),[N,k]=h.useState(!1),j=un(y),I=$p(l),W=h.useRef(!1),[U,_]=h.useState(0);return h.useEffect(()=>{const R=C.current;if(R)return R.addEventListener(Ad,j),()=>R.removeEventListener(Ad,j)},[j]),e.jsx(v2,{scope:l,orientation:o,dir:P,loop:c,currentTabStopId:w,onItemFocus:h.useCallback(R=>b(R),[b]),onItemShiftTab:h.useCallback(()=>k(!0),[]),onFocusableItemAdd:h.useCallback(()=>_(R=>R+1),[]),onFocusableItemRemove:h.useCallback(()=>_(R=>R-1),[]),children:e.jsx(qe.div,{tabIndex:N||U===0?-1:0,"data-orientation":o,...v,ref:E,style:{outline:"none",...r.style},onMouseDown:Ke(r.onMouseDown,()=>{W.current=!0}),onFocus:Ke(r.onFocus,R=>{const T=!W.current;if(R.target===R.currentTarget&&T&&!N){const re=new CustomEvent(Ad,p2);if(R.currentTarget.dispatchEvent(re),!re.defaultPrevented){const ae=I().filter(ne=>ne.focusable),oe=ae.find(ne=>ne.active),ee=ae.find(ne=>ne.id===w),Y=[oe,ee,...ae].filter(Boolean).map(ne=>ne.ref.current);Hp(Y,x)}}W.current=!1}),onBlur:Ke(r.onBlur,()=>k(!1))})})}),Vp="RovingFocusGroupItem",Wp=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:u,children:m,...f}=r,g=cn(),y=u||g,x=j2(Vp,l),v=x.currentTabStopId===y,C=$p(l),{onFocusableItemAdd:E,onFocusableItemRemove:P,currentTabStopId:w}=x;return h.useEffect(()=>{if(o)return E(),()=>P()},[o,E,P]),e.jsx(Xd.ItemSlot,{scope:l,id:y,focusable:o,active:c,children:e.jsx(qe.span,{tabIndex:v?0:-1,"data-orientation":x.orientation,...f,ref:a,onMouseDown:Ke(r.onMouseDown,b=>{o?x.onItemFocus(y):b.preventDefault()}),onFocus:Ke(r.onFocus,()=>x.onItemFocus(y)),onKeyDown:Ke(r.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){x.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const N=S2(b,x.orientation,x.dir);if(N!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let j=C().filter(I=>I.focusable).map(I=>I.ref.current);if(N==="last")j.reverse();else if(N==="prev"||N==="next"){N==="prev"&&j.reverse();const I=j.indexOf(b.currentTarget);j=x.loop?C2(j,I+1):j.slice(I+1)}setTimeout(()=>Hp(j))}}),children:typeof m=="function"?m({isCurrentTabStop:v,hasTabStop:w!=null}):m})})});Wp.displayName=Vp;var N2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function w2(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function S2(r,a,l){const o=w2(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return N2[o]}function Hp(r,a=!1){const l=document.activeElement;for(const o of r)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function C2(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var k2=Up,E2=Wp,Co="Tabs",[P2]=pn(Co,[Bp]),Kp=Bp(),[T2,Ru]=P2(Co),Yp=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:u,orientation:m="horizontal",dir:f,activationMode:g="automatic",...y}=r,x=So(f),[v,C]=Fn({prop:o,onChange:c,defaultProp:u??"",caller:Co});return e.jsx(T2,{scope:l,baseId:cn(),value:v,onValueChange:C,orientation:m,dir:x,activationMode:g,children:e.jsx(qe.div,{dir:x,"data-orientation":m,...y,ref:a})})});Yp.displayName=Co;var Gp="TabsList",Qp=h.forwardRef((r,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=r,u=Ru(Gp,l),m=Kp(l);return e.jsx(k2,{asChild:!0,...m,orientation:u.orientation,dir:u.dir,loop:o,children:e.jsx(qe.div,{role:"tablist","aria-orientation":u.orientation,...c,ref:a})})});Qp.displayName=Gp;var qp="TabsTrigger",Xp=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...u}=r,m=Ru(qp,l),f=Kp(l),g=e0(m.baseId,o),y=t0(m.baseId,o),x=o===m.value;return e.jsx(E2,{asChild:!0,...f,focusable:!c,active:x,children:e.jsx(qe.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":y,"data-state":x?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:g,...u,ref:a,onMouseDown:Ke(r.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?m.onValueChange(o):v.preventDefault()}),onKeyDown:Ke(r.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&m.onValueChange(o)}),onFocus:Ke(r.onFocus,()=>{const v=m.activationMode!=="manual";!x&&!c&&v&&m.onValueChange(o)})})})});Xp.displayName=qp;var Jp="TabsContent",Zp=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:u,...m}=r,f=Ru(Jp,l),g=e0(f.baseId,o),y=t0(f.baseId,o),x=o===f.value,v=h.useRef(x);return h.useEffect(()=>{const C=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(C)},[]),e.jsx(_l,{present:c||x,children:({present:C})=>e.jsx(qe.div,{"data-state":x?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":g,hidden:!C,id:y,tabIndex:0,...m,ref:a,style:{...r.style,animationDuration:v.current?"0s":void 0},children:C&&u})})});Zp.displayName=Jp;function e0(r,a){return`${r}-trigger-${a}`}function t0(r,a){return`${r}-content-${a}`}var R2=Yp,s0=Qp,r0=Xp,n0=Zp;const Al=R2,Fa=h.forwardRef(({className:r,...a},l)=>e.jsx(s0,{ref:l,className:it("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));Fa.displayName=s0.displayName;const Lt=h.forwardRef(({className:r,...a},l)=>e.jsx(r0,{ref:l,className:it("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",r),...a}));Lt.displayName=r0.displayName;const Ot=h.forwardRef(({className:r,...a},l)=>e.jsx(n0,{ref:l,className:it("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...a}));Ot.displayName=n0.displayName;function Iu(r){const a=h.useRef({value:r,previous:r});return h.useMemo(()=>(a.current.value!==r&&(a.current.previous=a.current.value,a.current.value=r),a.current.previous),[r])}function _u(r){const[a,l]=h.useState(void 0);return ts(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const u=c[0];let m,f;if("borderBoxSize"in u){const g=u.borderBoxSize,y=Array.isArray(g)?g[0]:g;m=y.inlineSize,f=y.blockSize}else m=r.offsetWidth,f=r.offsetHeight;l({width:m,height:f})});return o.observe(r,{box:"border-box"}),()=>o.unobserve(r)}else l(void 0)},[r]),a}var ko="Switch",[I2]=pn(ko),[_2,M2]=I2(ko),a0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:u,required:m,disabled:f,value:g="on",onCheckedChange:y,form:x,...v}=r,[C,E]=h.useState(null),P=lt(a,j=>E(j)),w=h.useRef(!1),b=C?x||!!C.closest("form"):!0,[N,k]=Fn({prop:c,defaultProp:u??!1,onChange:y,caller:ko});return e.jsxs(_2,{scope:l,checked:N,disabled:f,children:[e.jsx(qe.button,{type:"button",role:"switch","aria-checked":N,"aria-required":m,"data-state":c0(N),"data-disabled":f?"":void 0,disabled:f,value:g,...v,ref:P,onClick:Ke(r.onClick,j=>{k(I=>!I),b&&(w.current=j.isPropagationStopped(),w.current||j.stopPropagation())})}),b&&e.jsx(o0,{control:C,bubbles:!w.current,name:o,value:g,checked:N,required:m,disabled:f,form:x,style:{transform:"translateX(-100%)"}})]})});a0.displayName=ko;var l0="SwitchThumb",i0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,...o}=r,c=M2(l0,l);return e.jsx(qe.span,{"data-state":c0(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:a})});i0.displayName=l0;var A2="SwitchBubbleInput",o0=h.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:o=!0,...c},u)=>{const m=h.useRef(null),f=lt(m,u),g=Iu(l),y=_u(a);return h.useEffect(()=>{const x=m.current;if(!x)return;const v=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(v,"checked").set;if(g!==l&&E){const P=new Event("click",{bubbles:o});E.call(x,l),x.dispatchEvent(P)}},[g,l,o]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:f,style:{...c.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});o0.displayName=A2;function c0(r){return r?"checked":"unchecked"}var d0=a0,D2=i0;const dt=h.forwardRef(({className:r,...a},l)=>e.jsx(d0,{className:it("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a1628] disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-gray-600 data-[state=checked]:bg-[#38bdac]",r),...a,ref:l,children:e.jsx(D2,{className:it("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));dt.displayName=d0.displayName;const dn=h.forwardRef(({className:r,...a},l)=>e.jsx("textarea",{className:it("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:l,...a}));dn.displayName="Textarea";function L2({open:r,onClose:a,userId:l,onUserUpdated:o}){var tt;const[c,u]=h.useState(null),[m,f]=h.useState([]),[g,y]=h.useState([]),[x,v]=h.useState(!1),[C,E]=h.useState(!1),[P,w]=h.useState(!1),[b,N]=h.useState("info"),[k,j]=h.useState(""),[I,W]=h.useState(""),[U,_]=h.useState([]),[R,T]=h.useState(""),[re,ae]=h.useState(!1),[oe,ee]=h.useState(null),[te,Y]=h.useState(null),[ne,ve]=h.useState(""),[$,ce]=h.useState(""),[H,A]=h.useState(""),[O,L]=h.useState(!1),[X,K]=h.useState(null),[de,G]=h.useState("");h.useEffect(()=>{r&&l&&(N("info"),ee(null),Y(null),K(null),G(""),xe())},[r,l]);async function xe(){if(l){v(!0);try{const pe=await Be(`/api/db/users?id=${encodeURIComponent(l)}`);if(pe!=null&&pe.success&&pe.user){const fe=pe.user;u(fe),j(fe.phone||""),W(fe.nickname||""),ve(fe.phone||""),ce(fe.wechatId||""),A(fe.openId||"");try{_(typeof fe.tags=="string"?JSON.parse(fe.tags||"[]"):[])}catch{_([])}}try{const fe=await Be(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);fe!=null&&fe.success&&fe.tracks&&f(fe.tracks)}catch{f([])}try{const fe=await Be(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);fe!=null&&fe.success&&fe.referrals&&y(fe.referrals)}catch{y([])}}catch(pe){console.error("Load user detail error:",pe)}finally{v(!1)}}}async function we(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}E(!0);try{const pe=await yt("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});pe!=null&&pe.success?(alert("同步成功"),xe()):alert("同步失败: "+(pe==null?void 0:pe.error))}catch(pe){console.error("Sync CKB error:",pe),alert("同步失败")}finally{E(!1)}}async function D(){if(c){w(!0);try{const pe={id:c.id,phone:k||void 0,nickname:I||void 0,tags:JSON.stringify(U)},fe=await gt("/api/db/users",pe);fe!=null&&fe.success?(alert("保存成功"),xe(),o==null||o()):alert("保存失败: "+(fe==null?void 0:fe.error))}catch(pe){console.error("Save user error:",pe),alert("保存失败")}finally{w(!1)}}}const ue=()=>{R&&!U.includes(R)&&(_([...U,R]),T(""))},Se=pe=>_(U.filter(fe=>fe!==pe));async function Ie(){if(!ne&&!H&&!$){Y("请至少输入手机号、微信号或 OpenID 中的一项");return}ae(!0),Y(null),ee(null);try{const pe=new URLSearchParams;ne&&pe.set("phone",ne),H&&pe.set("openId",H),$&&pe.set("wechatId",$);const fe=await Be(`/api/admin/shensheshou/query?${pe}`);fe!=null&&fe.success&&fe.data?(ee(fe.data),c&&await Ue(fe.data)):Y((fe==null?void 0:fe.error)||"未查询到数据,该用户可能未在神射手收录")}catch(pe){console.error("SSS query error:",pe),Y("请求失败,请检查神射手接口配置")}finally{ae(!1)}}async function Ue(pe){if(c)try{await yt("/api/admin/shensheshou/enrich",{userId:c.id,phone:ne||c.phone||"",openId:H||c.openId||"",wechatId:$||c.wechatId||""}),xe()}catch(fe){console.error("SSS enrich error:",fe)}}async function Ze(){if(c){L(!0),K(null);try{const pe={users:[{phone:c.phone||"",name:c.nickname||"",openId:c.openId||"",tags:U}]},fe=await yt("/api/admin/shensheshou/ingest",pe);fe!=null&&fe.success&&fe.data?K(fe.data):K({error:(fe==null?void 0:fe.error)||"推送失败"})}catch(pe){console.error("SSS ingest error:",pe),K({error:"请求失败"})}finally{L(!1)}}}const et=pe=>{const ot={view_chapter:Ks,purchase:Kd,match:Qt,login:ka,register:ka,share:ln,bind_phone:Jb,bind_wechat:Wb,fill_profile:Sd,visit_page:Sa}[pe]||Wd;return e.jsx(ot,{className:"w-4 h-4"})};return r?e.jsx(St,{open:r,onOpenChange:()=>a(),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(ka,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"}),(c==null?void 0:c.isVip)&&e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 border-0",children:"VIP"})]})}),x?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):c?e.jsxs("div",{className:"flex flex-col h-[75vh]",children:[e.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-3",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac] shrink-0",children:c.avatar?e.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((tt=c.nickname)==null?void 0:tt.charAt(0))||"?"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"text-lg font-bold text-white",children:c.nickname}),c.isAdmin&&e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"}),c.vipRole&&e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 border-0",children:c.vipRole})]}),e.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechatId&&` · 💬 ${c.wechatId}`,c.mbti&&` · ${c.mbti}`]}),e.jsxs("div",{className:"flex items-center gap-4 mt-1",children:[e.jsxs("p",{className:"text-gray-600 text-xs",children:["ID: ",c.id.slice(0,16),"…"]}),c.referralCode&&e.jsxs("p",{className:"text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"推广码:"}),e.jsx("code",{className:"text-[#38bdac] bg-[#38bdac]/10 px-1.5 py-0.5 rounded",children:c.referralCode})]})]})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsxs("p",{className:"text-[#38bdac] font-bold text-lg",children:["¥",(c.earnings||0).toFixed(2)]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"})]})]}),e.jsxs(Al,{value:b,onValueChange:N,className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(Fa,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-3 flex-wrap h-auto gap-1",children:[e.jsx(Lt,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"基础信息"}),e.jsx(Lt,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"标签体系"}),e.jsxs(Lt,{value:"journey",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:[e.jsx(Sa,{className:"w-3 h-3 mr-1"}),"用户旅程"]}),e.jsx(Lt,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"关系链路"}),e.jsxs(Lt,{value:"shensheshou",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:[e.jsx(nn,{className:"w-3 h-3 mr-1"}),"用户资料完善"]})]}),e.jsxs(Ot,{value:"info",className:"flex-1 overflow-auto space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"手机号"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:k,onChange:pe=>j(pe.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"昵称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:I,onChange:pe=>W(pe.target.value)})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.openId&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"微信 OpenID"}),e.jsx("p",{className:"text-gray-300 font-mono text-xs break-all",children:c.openId})]}),c.region&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg flex items-center gap-2",children:[e.jsx(Vx,{className:"w-4 h-4 text-gray-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs",children:"地区"}),e.jsx("p",{className:"text-white",children:c.region})]})]}),c.industry&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"行业"}),e.jsx("p",{className:"text-white",children:c.industry})]}),c.position&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"职位"}),e.jsx("p",{className:"text-white",children:c.position})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"推荐人数"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:c.referralCount??0})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"待提现"}),e.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["¥",(c.pendingEarnings??0).toFixed(2)]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"创建时间"}),e.jsx("p",{className:"text-sm text-white",children:c.createdAt?new Date(c.createdAt).toLocaleDateString():"-"})]})]}),c.isVip&&e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg border border-amber-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(sn,{className:"w-4 h-4 text-amber-400"}),e.jsx("span",{className:"text-white font-medium",children:"VIP 信息"}),e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 border-0 text-xs",children:c.vipRole||"VIP"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.vipName&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"展示名:"}),e.jsx("span",{className:"text-white",children:c.vipName})]}),c.vipProject&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"项目:"}),e.jsx("span",{className:"text-white",children:c.vipProject})]}),c.vipContact&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"联系方式:"}),e.jsx("span",{className:"text-white",children:c.vipContact})]}),c.vipExpireDate&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"到期时间:"}),e.jsx("span",{className:"text-white",children:new Date(c.vipExpireDate).toLocaleDateString()})]})]}),c.vipBio&&e.jsx("p",{className:"text-gray-400 text-sm mt-2",children:c.vipBio})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg border border-purple-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(lo,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"微信归属"}),e.jsx("span",{className:"text-gray-500 text-xs",children:"该用户归属在哪个微信号下"})]}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(ie,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"输入归属微信号(如 wxid_xxxx)",value:de,onChange:pe=>G(pe.target.value)}),e.jsxs(q,{size:"sm",onClick:async()=>{if(!(!de||!c))try{await gt("/api/db/users",{id:c.id,wechatId:de}),alert("已保存微信归属"),xe()}catch{alert("保存失败")}},className:"bg-purple-500/20 hover:bg-purple-500/30 text-purple-400 border border-purple-500/30 shrink-0",children:[e.jsx(_t,{className:"w-4 h-4 mr-1"})," 保存"]})]}),c.wechatId&&e.jsxs("p",{className:"text-gray-500 text-xs mt-2",children:["当前归属:",e.jsx("span",{className:"text-purple-400",children:c.wechatId})]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ln,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),e.jsx(q,{size:"sm",onClick:we,disabled:C||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1"})," 同步数据"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"同步状态:"}),c.ckbSyncedAt?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 ml-1",children:"未同步"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"最后同步:"}),e.jsx("span",{className:"text-gray-300 ml-1",children:c.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),e.jsxs(Ot,{value:"tags",className:"flex-1 overflow-auto space-y-4",children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Sd,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"用户标签"}),e.jsx("span",{className:"text-gray-500 text-xs",children:"基于《一场 Soul 的创业实验》维度打标"})]}),e.jsxs("div",{className:"mb-3 p-2.5 bg-[#38bdac]/5 border border-[#38bdac]/20 rounded-lg flex items-center gap-2 text-xs text-gray-400",children:[e.jsx(Vd,{className:"w-3.5 h-3.5 text-[#38bdac] shrink-0"}),"命中的标签自动高亮 · 系统根据行为轨迹和填写资料自动打标 · 手动点击补充或取消"]}),e.jsx("div",{className:"mb-4 space-y-3",children:[{category:"身份类型",tags:["创业者","打工人","自由职业","学生","投资人","合伙人"]},{category:"行业背景",tags:["电商","内容","传统行业","科技/AI","金融","教育","餐饮"]},{category:"痛点标签",tags:["找资源","找方向","找合伙人","想赚钱","想学习","找情感出口"]},{category:"付费意愿",tags:["高意向","已付费","观望中","薅羊毛"]},{category:"MBTI",tags:["ENTJ","INTJ","ENFP","INFP","ENTP","INTP","ESTJ","ISFJ"]}].map(pe=>e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1.5",children:pe.category}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:pe.tags.map(fe=>e.jsxs("button",{type:"button",onClick:()=>{U.includes(fe)?Se(fe):_([...U,fe])},className:`px-2 py-0.5 rounded text-xs border transition-all ${U.includes(fe)?"bg-[#38bdac]/20 border-[#38bdac]/50 text-[#38bdac]":"bg-transparent border-gray-700 text-gray-500 hover:border-gray-500 hover:text-gray-300"}`,children:[U.includes(fe)?"✓ ":"",fe]},fe))})]},pe.category))}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-3",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-2",children:"已选标签"}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-3 min-h-[32px]",children:[U.map((pe,fe)=>e.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[pe,e.jsx("button",{type:"button",onClick:()=>Se(pe),className:"ml-1 hover:text-red-400",children:e.jsx(fs,{className:"w-3 h-3"})})]},fe)),U.length===0&&e.jsx("span",{className:"text-gray-600 text-sm",children:"暂未选择标签"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ie,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"自定义标签(回车添加)",value:R,onChange:pe=>T(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&ue()}),e.jsx(q,{onClick:ue,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})]}),c.ckbTags&&e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Sd,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝标签"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:(typeof c.ckbTags=="string"?c.ckbTags.split(","):[]).map((pe,fe)=>e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:pe.trim()},fe))})]})]}),e.jsxs(Ot,{value:"journey",className:"flex-1 overflow-auto",children:[e.jsxs("div",{className:"mb-3 p-3 bg-[#0a1628] rounded-lg flex items-center gap-2",children:[e.jsx(Sa,{className:"w-4 h-4 text-[#38bdac]"}),e.jsxs("span",{className:"text-gray-400 text-sm",children:["记录用户从注册到付费的完整行动路径,共 ",m.length," 条记录"]})]}),e.jsx("div",{className:"space-y-2",children:m.length>0?m.map((pe,fe)=>e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:et(pe.action)}),fe0?g.map((pe,fe)=>{var ss;const ot=pe;return e.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#162840] rounded",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:((ss=ot.nickname)==null?void 0:ss.charAt(0))||"?"}),e.jsx("span",{className:"text-white text-sm",children:ot.nickname})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[ot.status==="vip"&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),e.jsx("span",{className:"text-gray-500 text-xs",children:ot.createdAt?new Date(ot.createdAt).toLocaleDateString():""})]})]},ot.id||fe)}):e.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})}),e.jsxs(Ot,{value:"shensheshou",className:"flex-1 overflow-auto space-y-4",children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(nn,{className:"w-5 h-5 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"用户资料完善"}),e.jsx("span",{className:"text-gray-500 text-xs",children:"通过多维度查询神射手数据,自动回填用户基础信息"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[e.jsxs("div",{children:[e.jsx(Z,{className:"text-gray-500 text-xs mb-1 block",children:"手机号"}),e.jsx(ie,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"11位手机号",value:ne,onChange:pe=>ve(pe.target.value)})]}),e.jsxs("div",{children:[e.jsx(Z,{className:"text-gray-500 text-xs mb-1 block",children:"微信号"}),e.jsx(ie,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"微信 ID",value:$,onChange:pe=>ce(pe.target.value)})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx(Z,{className:"text-gray-500 text-xs mb-1 block",children:"微信 OpenID"}),e.jsx(ie,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"openid_xxxx(自动填入)",value:H,onChange:pe=>A(pe.target.value)})]})]}),e.jsx(q,{onClick:Ie,disabled:re,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:re?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"})," 查询并自动回填中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(on,{className:"w-4 h-4 mr-1"})," 查询并自动完善用户资料"]})}),e.jsx("p",{className:"text-gray-600 text-xs mt-2",children:"查询成功后,神射手返回的标签将自动同步到该用户"}),te&&e.jsx("div",{className:"mt-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg text-red-400 text-sm",children:te}),oe&&e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"神射手 RFM 分"}),e.jsx("p",{className:"text-2xl font-bold text-[#38bdac]",children:oe.rfm_score??"-"})]}),e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"用户等级"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:oe.user_level??"-"})]})]}),oe.tags&&oe.tags.length>0&&e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-2",children:"神射手标签"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:oe.tags.map((pe,fe)=>e.jsx(Oe,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/20",children:pe},fe))})]}),oe.last_active&&e.jsxs("div",{className:"text-sm text-gray-500",children:["最近活跃:",oe.last_active]})]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(nn,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"推送用户数据到神射手"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"将本用户信息(手机号、昵称、标签等)同步至神射手,自动完善用户画像"})]}),e.jsx(q,{onClick:Ze,disabled:O||!c.phone,variant:"outline",className:"border-purple-500/40 text-purple-400 hover:bg-purple-500/10 bg-transparent shrink-0 ml-4",children:O?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"})," 推送中"]}):e.jsxs(e.Fragment,{children:[e.jsx(nn,{className:"w-4 h-4 mr-1"})," 推送"]})})]}),!c.phone&&e.jsx("p",{className:"text-yellow-500/70 text-xs",children:"⚠ 用户未绑定手机号,无法推送"}),X&&e.jsx("div",{className:"mt-3 p-3 bg-[#162840] rounded-lg text-sm",children:X.error?e.jsx("p",{className:"text-red-400",children:String(X.error)}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-green-400 flex items-center gap-1",children:[e.jsx(Vd,{className:"w-4 h-4"})," 推送成功"]}),X.enriched!==void 0&&e.jsxs("p",{className:"text-gray-400",children:["自动补全标签数:",String(X.new_tags_added??0)]})]})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-3 border-t border-gray-700 mt-3",children:[e.jsxs(q,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"关闭"]}),e.jsxs(q,{onClick:D,disabled:P,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),P?"保存中...":"保存修改"]})]})]}):e.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const Dd={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function O2({open:r,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[u,m]=h.useState(Dd),[f,g]=h.useState([]),[y,x]=h.useState(!1),[v,C]=h.useState(!1);h.useEffect(()=>{if(!r){m(Dd);return}let P=!1;return x(!0),Promise.all([Be("/api/db/vip-roles"),l?Be(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([w,b])=>{if(P)return;const N=w!=null&&w.success&&w.data?w.data:[];g(N);const k=b&&b.user?b.user:null;if(k){const j=String(k.vipRole??""),I=N.some(W=>W.name===j);m({isVip:!!(k.isVip??!1),vipExpireDate:k.vipExpireDate?String(k.vipExpireDate).slice(0,10):"",vipSort:typeof k.vipSort=="number"?k.vipSort:"",vipRole:I?j:j?"__custom__":"",vipRoleCustom:I?"":j,vipName:String(k.vipName??""),vipProject:String(k.vipProject??""),vipContact:String(k.vipContact??""),vipBio:String(k.vipBio??"")})}else m(Dd)}).catch(w=>{P||console.error("Load error:",w)}).finally(()=>{P||x(!1)}),()=>{P=!0}},[r,l]);async function E(){if(l){if(u.isVip&&!u.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(u.isVip&&u.vipExpireDate.trim()){const P=new Date(u.vipExpireDate);if(isNaN(P.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}C(!0);try{const P=u.vipRole==="__custom__"?u.vipRoleCustom.trim():u.vipRole,w={id:l,isVip:u.isVip,vipExpireDate:u.isVip?u.vipExpireDate:void 0,vipSort:u.vipSort===""?void 0:u.vipSort,vipRole:P||void 0,vipName:u.vipName||void 0,vipProject:u.vipProject||void 0,vipContact:u.vipContact||void 0,vipBio:u.vipBio||void 0},b=await gt("/api/db/users",w);b!=null&&b.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(b==null?void 0:b.error))}catch(P){console.error("Save VIP error:",P),alert("保存失败")}finally{C(!1)}}}return r?e.jsx(St,{open:r,onOpenChange:()=>a(),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(sn,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",o||l]})}),y?e.jsx("div",{className:"py-8 text-center text-gray-400",children:"加载中..."}):e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Z,{className:"text-gray-300",children:"VIP 会员"}),e.jsx(dt,{checked:u.isVip,onCheckedChange:P=>m(w=>({...w,isVip:P}))})]}),u.isVip&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",e.jsx("span",{className:"text-amber-400",children:"*"})]}),e.jsx(ie,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:u.vipExpireDate,onChange:P=>m(w=>({...w,vipExpireDate:P.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"排序"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:u.vipSort===""?"":u.vipSort,onChange:P=>{const w=P.target.value;m(b=>({...b,vipSort:w===""?"":parseInt(w,10)||0}))}})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md px-3 py-2",value:u.vipRole,onChange:P=>m(w=>({...w,vipRole:P.target.value})),children:[e.jsx("option",{value:"",children:"请选择或下方手动填写"}),f.map(P=>e.jsx("option",{value:P.name,children:P.name},P.id)),e.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),u.vipRole==="__custom__"&&e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:u.vipRoleCustom,onChange:P=>m(w=>({...w,vipRoleCustom:P.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"VIP 展示名"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:u.vipName,onChange:P=>m(w=>({...w,vipName:P.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"项目/公司"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:u.vipProject,onChange:P=>m(w=>({...w,vipProject:P.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"联系方式"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:u.vipContact,onChange:P=>m(w=>({...w,vipContact:P.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"一句话简介"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:u.vipBio,onChange:P=>m(w=>({...w,vipBio:P.target.value}))})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:E,disabled:v||y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})}):null}const qi=[{id:"register",label:"注册/登录",icon:"👤",color:"bg-blue-500/20 border-blue-500/40 text-blue-400",desc:"微信授权登录或手机号注册"},{id:"browse",label:"浏览章节",icon:"📖",color:"bg-purple-500/20 border-purple-500/40 text-purple-400",desc:"点击免费/付费章节预览"},{id:"bind_phone",label:"绑定手机",icon:"📱",color:"bg-cyan-500/20 border-cyan-500/40 text-cyan-400",desc:"触发付费章节后绑定手机"},{id:"first_pay",label:"首次付款",icon:"💳",color:"bg-green-500/20 border-green-500/40 text-green-400",desc:"购买单章或全书"},{id:"fill_profile",label:"完善资料",icon:"✍️",color:"bg-yellow-500/20 border-yellow-500/40 text-yellow-400",desc:"填写头像、MBTI、行业等"},{id:"match",label:"派对房匹配",icon:"🤝",color:"bg-orange-500/20 border-orange-500/40 text-orange-400",desc:"参与 Soul 派对房"},{id:"vip",label:"升级 VIP",icon:"👑",color:"bg-amber-500/20 border-amber-500/40 text-amber-400",desc:"付款 ¥1980 购买全书"},{id:"distribution",label:"开启分销",icon:"🔗",color:"bg-[#38bdac]/20 border-[#38bdac]/40 text-[#38bdac]",desc:"生成推广码并推荐好友"}];function F2(){var Te,ut,rs,at,is;const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[g,y]=h.useState(""),x=Pu(g,300),[v,C]=h.useState("all"),[E,P]=h.useState(!0),[w,b]=h.useState(null),[N,k]=h.useState(!1),[j,I]=h.useState("desc"),[W,U]=h.useState(!1),[_,R]=h.useState(!1),[T,re]=h.useState(null),[ae,oe]=h.useState(""),[ee,te]=h.useState(""),[Y,ne]=h.useState(!1),[ve,$]=h.useState(!1),[ce,H]=h.useState({referrals:[],stats:{}}),[A,O]=h.useState(!1),[L,X]=h.useState(null),[K,de]=h.useState(!1),[G,xe]=h.useState(null),[we,D]=h.useState(!1),[ue,Se]=h.useState(null),[Ie,Ue]=h.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),[Ze,et]=h.useState([]),[tt,pe]=h.useState(!1),[fe,ot]=h.useState(!1),[ss,dr]=h.useState(null),[Ht,Cs]=h.useState({title:"",description:"",trigger:"",sort:0,enabled:!0}),[Kt,vn]=h.useState([]),[Mt,ur]=h.useState(!1),[Vn,ls]=h.useState(!1),[ks,jn]=h.useState(null),[Es,Ls]=h.useState({name:"",sort:0}),[hr,bn]=h.useState({}),[mr,Rr]=h.useState(!1);async function Ps(){var B;P(!0),b(null);try{if(N){const We=new URLSearchParams({search:x,limit:String(m*5)}),He=await Be(`/api/db/users/rfm?${We}`);if(He!=null&&He.success){let rt=He.users||[];j==="asc"&&(rt=[...rt].reverse());const Ts=(c-1)*m;a(rt.slice(Ts,Ts+m)),o(((B=He.users)==null?void 0:B.length)??0),rt.length===0&&(k(!1),b("暂无订单数据,RFM 排序需要用户有购买记录后才能生效"))}else k(!1),b((He==null?void 0:He.error)||"RFM 加载失败,已切回普通模式")}else{const We=new URLSearchParams({page:String(c),pageSize:String(m),search:x,...v==="vip"&&{vip:"true"}}),He=await Be(`/api/db/users?${We}`);He!=null&&He.success?(a(He.users||[]),o(He.total??0)):b((He==null?void 0:He.error)||"加载失败")}}catch(We){console.error("Load users error:",We),b("网络错误")}finally{P(!1)}}h.useEffect(()=>{u(1)},[x,v,N]),h.useEffect(()=>{Ps()},[c,m,x,v,N,j]);const Nn=Math.ceil(l/m)||1,qs=()=>{N?j==="desc"?I("asc"):(k(!1),I("desc")):(k(!0),I("desc"))},Xs=B=>({S:"bg-amber-500/20 text-amber-400",A:"bg-green-500/20 text-green-400",B:"bg-blue-500/20 text-blue-400",C:"bg-gray-500/20 text-gray-400",D:"bg-red-500/20 text-red-400"})[B||""]||"bg-gray-500/20 text-gray-400";async function Wn(B){if(confirm("确定要删除这个用户吗?"))try{const We=await kr(`/api/db/users?id=${encodeURIComponent(B)}`);We!=null&&We.success?Ps():alert("删除失败: "+((We==null?void 0:We.error)||""))}catch{alert("删除失败")}}const Hn=B=>{re(B),Ue({phone:B.phone||"",nickname:B.nickname||"",password:"",isAdmin:!!(B.isAdmin??!1),hasFullBook:!!(B.hasFullBook??!1)}),U(!0)},Kn=()=>{re(null),Ue({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),U(!0)};async function Yn(){if(!Ie.phone||!Ie.nickname){alert("请填写手机号和昵称");return}ne(!0);try{if(T){const B=await gt("/api/db/users",{id:T.id,nickname:Ie.nickname,isAdmin:Ie.isAdmin,hasFullBook:Ie.hasFullBook,...Ie.password&&{password:Ie.password}});if(!(B!=null&&B.success)){alert("更新失败: "+((B==null?void 0:B.error)||""));return}}else{const B=await yt("/api/db/users",{phone:Ie.phone,nickname:Ie.nickname,password:Ie.password,isAdmin:Ie.isAdmin});if(!(B!=null&&B.success)){alert("创建失败: "+((B==null?void 0:B.error)||""));return}}U(!1),Ps()}catch{alert("保存失败")}finally{ne(!1)}}const Gn=B=>{re(B),oe(""),te(""),R(!0)};async function Ir(B){X(B),$(!0),O(!0);try{const We=await Be(`/api/db/users/referrals?userId=${encodeURIComponent(B.id)}`);We!=null&&We.success?H({referrals:We.referrals||[],stats:We.stats||{}}):H({referrals:[],stats:{}})}catch{H({referrals:[],stats:{}})}finally{O(!1)}}async function wn(){if(!ae){alert("请输入新密码");return}if(ae!==ee){alert("两次密码不一致");return}if(ae.length<6){alert("密码至少6位");return}ne(!0);try{const B=await gt("/api/db/users",{id:T==null?void 0:T.id,password:ae});B!=null&&B.success?(alert("修改成功"),R(!1)):alert("修改失败: "+((B==null?void 0:B.error)||""))}catch{alert("修改失败")}finally{ne(!1)}}const qt=h.useCallback(async()=>{pe(!0);try{const B=await Be("/api/db/user-rules");B!=null&&B.success&&et(B.rules||[])}catch{}finally{pe(!1)}},[]);async function _r(){if(!Ht.title){alert("请填写规则标题");return}ne(!0);try{if(ss){const B=await gt("/api/db/user-rules",{id:ss.id,...Ht});if(!(B!=null&&B.success)){alert("更新失败: "+((B==null?void 0:B.error)||""));return}}else{const B=await yt("/api/db/user-rules",Ht);if(!(B!=null&&B.success)){alert("创建失败: "+((B==null?void 0:B.error)||""));return}}ot(!1),qt()}catch{alert("保存失败")}finally{ne(!1)}}async function Js(B){if(confirm("确定删除?"))try{const We=await kr(`/api/db/user-rules?id=${B}`);We!=null&&We.success&&qt()}catch{}}async function Qn(B){try{await gt("/api/db/user-rules",{id:B.id,enabled:!B.enabled}),qt()}catch{}}const ys=h.useCallback(async()=>{ur(!0);try{const B=await Be("/api/db/vip-roles");B!=null&&B.success&&vn(B.roles||[])}catch{}finally{ur(!1)}},[]);async function F(){if(!Es.name){alert("请填写角色名称");return}ne(!0);try{if(ks){const B=await gt("/api/db/vip-roles",{id:ks.id,...Es});if(!(B!=null&&B.success)){alert("更新失败");return}}else{const B=await yt("/api/db/vip-roles",Es);if(!(B!=null&&B.success)){alert("创建失败");return}}ls(!1),ys()}catch{alert("保存失败")}finally{ne(!1)}}async function le(B){if(confirm("确定删除?"))try{const We=await kr(`/api/db/vip-roles?id=${B}`);We!=null&&We.success&&ys()}catch{}}const Ne=h.useCallback(async()=>{Rr(!0);try{const B=await Be("/api/db/users/journey-stats");B!=null&&B.success&&B.stats&&bn(B.stats)}catch{}finally{Rr(!1)}},[]);return e.jsxs("div",{className:"p-8 w-full",children:[w&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:w}),e.jsx("button",{type:"button",onClick:()=>b(null),children:"×"})]}),e.jsx("div",{className:"flex justify-between items-center mb-6",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"用户管理"}),e.jsxs("p",{className:"text-gray-400 mt-1 text-sm",children:["共 ",l," 位注册用户",N&&" · RFM 排序中"]})]})}),e.jsxs(Al,{defaultValue:"users",className:"w-full",children:[e.jsxs(Fa,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-6 flex-wrap h-auto gap-1",children:[e.jsxs(Lt,{value:"users",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",children:[e.jsx(Qt,{className:"w-4 h-4"})," 用户列表"]}),e.jsxs(Lt,{value:"journey",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",onClick:Ne,children:[e.jsx(Sa,{className:"w-4 h-4"})," 用户旅程总览"]}),e.jsxs(Lt,{value:"rules",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",onClick:qt,children:[e.jsx(On,{className:"w-4 h-4"})," 规则配置"]}),e.jsxs(Lt,{value:"vip-roles",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",onClick:ys,children:[e.jsx(sn,{className:"w-4 h-4"})," VIP 角色"]})]}),e.jsxs(Ot,{value:"users",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4 justify-end flex-wrap",children:[e.jsxs(q,{variant:"outline",onClick:Ps,disabled:E,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${E?"animate-spin":""}`})," 刷新"]}),e.jsxs("select",{value:v,onChange:B=>{C(B.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",disabled:N,children:[e.jsx("option",{value:"all",children:"全部用户"}),e.jsx("option",{value:"vip",children:"VIP会员"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(ie,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-56",value:g,onChange:B=>y(B.target.value)})]}),e.jsxs(q,{onClick:Kn,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Yd,{className:"w-4 h-4 mr-2"})," 添加用户"]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:E?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs("div",{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"用户信息"}),e.jsx(be,{className:"text-gray-400",children:"绑定信息"}),e.jsx(be,{className:"text-gray-400",children:"购买状态"}),e.jsx(be,{className:"text-gray-400",children:"分销收益"}),e.jsxs(be,{className:"text-gray-400 cursor-pointer select-none",onClick:qs,children:[e.jsxs("div",{className:"flex items-center gap-1 group",children:[e.jsx(Ca,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"RFM分值"}),N?j==="desc"?e.jsx(Ta,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(xu,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Oj,{className:"w-3.5 h-3.5 text-gray-600 group-hover:text-gray-400"})]}),N&&e.jsx("div",{className:"text-[10px] text-[#38bdac] font-normal mt-0.5",children:"点击切换方向/关闭"})]}),e.jsx(be,{className:"text-gray-400",children:"注册时间"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(B=>{var We,He,rt;return e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:B.avatar?e.jsx("img",{src:B.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((We=B.nickname)==null?void 0:We.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("p",{className:"font-medium text-white",children:B.nickname}),B.isAdmin&&e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),B.openId&&!((He=B.id)!=null&&He.startsWith("user_"))&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0 text-xs",children:"微信"})]}),e.jsx("p",{className:"text-xs text-gray-500 font-mono",children:B.openId?B.openId.slice(0,12)+"...":(rt=B.id)==null?void 0:rt.slice(0,12)})]})]})}),e.jsx(ye,{children:e.jsxs("div",{className:"space-y-1",children:[B.phone&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"📱"}),e.jsx("span",{className:"text-gray-300",children:B.phone})]}),B.wechatId&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"💬"}),e.jsx("span",{className:"text-gray-300",children:B.wechatId})]}),B.openId&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"🔗"}),e.jsxs("span",{className:"text-gray-500 truncate max-w-[100px]",title:B.openId,children:[B.openId.slice(0,12),"..."]})]}),!B.phone&&!B.wechatId&&!B.openId&&e.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),e.jsx(ye,{children:B.hasFullBook?e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),e.jsx(ye,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(B.earnings||0)).toFixed(2)]}),parseFloat(String(B.pendingEarnings||0))>0&&e.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(B.pendingEarnings||0)).toFixed(2)]}),e.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>Ir(B),role:"button",tabIndex:0,onKeyDown:Ts=>Ts.key==="Enter"&&Ir(B),children:[e.jsx(Qt,{className:"w-3 h-3"})," 绑定",B.referralCount||0,"人"]})]})}),e.jsx(ye,{children:B.rfmScore!==void 0?e.jsx("div",{className:"flex flex-col gap-1",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-white font-bold text-base",children:B.rfmScore}),e.jsx(Oe,{className:`border-0 text-xs ${Xs(B.rfmLevel)}`,children:B.rfmLevel})]})}):e.jsxs("span",{className:"text-gray-600 text-sm",children:["— ",e.jsx("span",{className:"text-xs text-gray-700",children:"点列头排序"})]})}),e.jsx(ye,{className:"text-gray-400",children:B.createdAt?new Date(B.createdAt).toLocaleDateString():"-"}),e.jsx(ye,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{Se(B),D(!0)},className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:e.jsx(sn,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{xe(B.id),de(!0)},className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:e.jsx(Cr,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>Hn(B),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>Gn(B),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:e.jsx(Ff,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>Wn(B.id),title:"删除",children:e.jsx(Wt,{className:"w-4 h-4"})})]})})]},B.id)}),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),e.jsx(Hs,{page:c,totalPages:Nn,total:l,pageSize:m,onPageChange:u,onPageSizeChange:B=>{f(B),u(1)}})]})})})]}),e.jsxs(Ot,{value:"journey",children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"用户从注册到 VIP 的完整行动路径,点击各阶段查看用户动态"}),e.jsxs(q,{variant:"outline",onClick:Ne,disabled:mr,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${mr?"animate-spin":""}`})," 刷新数据"]})]}),e.jsxs("div",{className:"relative mb-8",children:[e.jsx("div",{className:"absolute top-16 left-0 right-0 h-0.5 bg-gradient-to-r from-blue-500/20 via-[#38bdac]/30 to-amber-500/20 mx-20"}),e.jsx("div",{className:"grid grid-cols-4 gap-4 lg:grid-cols-8",children:qi.map((B,We)=>e.jsxs("div",{className:"relative flex flex-col items-center",children:[e.jsxs("div",{className:`relative w-full p-3 rounded-xl border ${B.color} text-center cursor-default`,children:[e.jsx("div",{className:"text-2xl mb-1",children:B.icon}),e.jsx("div",{className:`text-xs font-medium ${B.color.split(" ").find(He=>He.startsWith("text-"))}`,children:B.label}),hr[B.id]!==void 0&&e.jsxs("div",{className:"mt-1.5 text-xs text-gray-400",children:[e.jsx("span",{className:"font-bold text-white",children:hr[B.id]})," 人"]}),e.jsx("div",{className:"absolute -top-2.5 -left-2.5 w-5 h-5 rounded-full bg-[#0a1628] border border-gray-700 flex items-center justify-center text-[10px] text-gray-500",children:We+1})]}),Wee.jsxs("div",{className:"flex items-start gap-3 p-2 bg-[#0a1628] rounded",children:[e.jsx("span",{className:"text-[#38bdac] font-mono text-xs shrink-0 mt-0.5",children:B.step}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-300",children:B.action}),e.jsxs("p",{className:"text-gray-600 text-xs",children:["→ ",B.next]})]})]},B.step))})]}),e.jsxs("div",{className:"bg-[#0f2137] border border-gray-700/50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Ks,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"行为锚点统计"}),e.jsx("span",{className:"text-gray-500 text-xs ml-auto",children:"实时更新"})]}),mr?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx($e,{className:"w-5 h-5 text-[#38bdac] animate-spin"})}):Object.keys(hr).length>0?e.jsx("div",{className:"space-y-2",children:qi.map(B=>{const We=hr[B.id]||0,He=Math.max(...qi.map(Ts=>hr[Ts.id]||0),1),rt=Math.round(We/He*100);return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-gray-500 text-xs w-20 shrink-0",children:[B.icon," ",B.label]}),e.jsx("div",{className:"flex-1 h-2 bg-[#0a1628] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#38bdac]/60 rounded-full transition-all",style:{width:`${rt}%`}})}),e.jsx("span",{className:"text-gray-400 text-xs w-10 text-right",children:We})]},B.id)})}):e.jsx("div",{className:"text-center py-8",children:e.jsx("p",{className:"text-gray-500 text-sm",children:"点击「刷新数据」加载统计"})})]})]})]}),e.jsxs(Ot,{value:"rules",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"用户旅程引导规则,定义各行为节点的触发条件与引导内容"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(q,{variant:"outline",onClick:qt,disabled:tt,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${tt?"animate-spin":""}`})," 刷新"]}),e.jsxs(q,{onClick:()=>{dr(null),Cs({title:"",description:"",trigger:"",sort:0,enabled:!0}),ot(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"})," 添加规则"]})]})]}),tt?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"})}):Ze.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(Ks,{className:"w-12 h-12 text-[#38bdac]/30 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400 mb-4",children:"暂无规则(重启服务将自动写入10条默认规则)"}),e.jsxs(q,{onClick:qt,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($e,{className:"w-4 h-4 mr-2"})," 重新加载"]})]}):e.jsx("div",{className:"space-y-2",children:Ze.map(B=>e.jsx("div",{className:`p-4 rounded-lg border transition-all ${B.enabled?"bg-[#0f2137] border-gray-700/50":"bg-[#0a1628]/50 border-gray-700/30 opacity-55"}`,children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[e.jsx(mt,{className:"w-4 h-4 text-[#38bdac] shrink-0"}),e.jsx("span",{className:"text-white font-medium",children:B.title}),B.trigger&&e.jsxs(Oe,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/30 text-xs",children:["触发:",B.trigger]}),e.jsx(Oe,{className:`text-xs border-0 ${B.enabled?"bg-green-500/20 text-green-400":"bg-gray-500/20 text-gray-400"}`,children:B.enabled?"启用":"禁用"})]}),B.description&&e.jsx("p",{className:"text-gray-400 text-sm ml-6",children:B.description})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4 shrink-0",children:[e.jsx(dt,{checked:B.enabled,onCheckedChange:()=>Qn(B)}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{dr(B),Cs({title:B.title,description:B.description,trigger:B.trigger,sort:B.sort,enabled:B.enabled}),ot(!0)},className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>Js(B.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Wt,{className:"w-4 h-4"})})]})]})},B.id))})]}),e.jsxs(Ot,{value:"vip-roles",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"管理用户 VIP 角色分类,这些角色将在用户详情和会员展示中使用"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(q,{variant:"outline",onClick:ys,disabled:Mt,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${Mt?"animate-spin":""}`})," 刷新"]}),e.jsxs(q,{onClick:()=>{jn(null),Ls({name:"",sort:0}),ls(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"})," 添加角色"]})]})]}),Mt?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"})}):Kt.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(sn,{className:"w-12 h-12 text-amber-400/30 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400 mb-4",children:"暂无 VIP 角色"}),e.jsxs(q,{onClick:()=>{jn(null),Ls({name:"",sort:0}),ls(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"})," 添加第一个角色"]})]}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Kt.map(B=>e.jsxs("div",{className:"p-4 bg-[#0f2137] border border-amber-500/20 rounded-xl hover:border-amber-500/40 transition-all group",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(sn,{className:"w-4 h-4 text-amber-400"}),e.jsx("span",{className:"text-white font-medium",children:B.name})]}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{type:"button",onClick:()=>{jn(B),Ls({name:B.name,sort:B.sort}),ls(!0)},className:"text-gray-500 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:()=>le(B.id),className:"text-gray-500 hover:text-red-400",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("p",{className:"text-gray-600 text-xs",children:["排序: ",B.sort]})]},B.id))})]})]}),e.jsx(St,{open:W,onOpenChange:U,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[T?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Yd,{className:"w-5 h-5 text-[#38bdac]"}),T?"编辑用户":"添加用户"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"手机号"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:Ie.phone,onChange:B=>Ue({...Ie,phone:B.target.value}),disabled:!!T})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"昵称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:Ie.nickname,onChange:B=>Ue({...Ie,nickname:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:T?"新密码 (留空则不修改)":"密码"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:T?"留空则不修改":"请输入密码",value:Ie.password,onChange:B=>Ue({...Ie,password:B.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Z,{className:"text-gray-300",children:"管理员权限"}),e.jsx(dt,{checked:Ie.isAdmin,onCheckedChange:B=>Ue({...Ie,isAdmin:B})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Z,{className:"text-gray-300",children:"已购全书"}),e.jsx(dt,{checked:Ie.hasFullBook,onCheckedChange:B=>Ue({...Ie,hasFullBook:B})})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>U(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:Yn,disabled:Y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),Y?"保存中...":"保存"]})]})]})}),e.jsx(St,{open:_,onOpenChange:R,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Ff,{className:"w-5 h-5 text-[#38bdac]"}),"修改密码"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["用户:",T==null?void 0:T.nickname]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",T==null?void 0:T.phone]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"新密码"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:ae,onChange:B=>oe(B.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"确认密码"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入",value:ee,onChange:B=>te(B.target.value)})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>R(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:wn,disabled:Y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:Y?"保存中...":"确认修改"})]})]})}),e.jsx(St,{open:fe,onOpenChange:ot,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),ss?"编辑规则":"添加规则"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"规则标题 *"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:匹配后填写头像、付款1980需填写信息",value:Ht.title,onChange:B=>Cs({...Ht,title:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"规则描述"}),e.jsx(dn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[80px] resize-none",placeholder:"详细说明规则内容...",value:Ht.description,onChange:B=>Cs({...Ht,description:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"触发条件"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:完成匹配、付款后、注册时",value:Ht.trigger,onChange:B=>Cs({...Ht,trigger:B.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx(Z,{className:"text-gray-300",children:"启用状态"})}),e.jsx(dt,{checked:Ht.enabled,onCheckedChange:B=>Cs({...Ht,enabled:B})})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>ot(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:_r,disabled:Y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),Y?"保存中...":"保存"]})]})]})}),e.jsx(St,{open:Vn,onOpenChange:ls,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(sn,{className:"w-5 h-5 text-amber-400"}),ks?"编辑 VIP 角色":"添加 VIP 角色"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"角色名称 *"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:创业者、资源整合者、技术咖",value:Es.name,onChange:B=>Ls({...Es,name:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"排序(越小越前)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Es.sort,onChange:B=>Ls({...Es,sort:parseInt(B.target.value)||0})})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>ls(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:F,disabled:Y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),Y?"保存中...":"保存"]})]})]})}),e.jsx(St,{open:ve,onOpenChange:$,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系 - ",L==null?void 0:L.nickname]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-[#38bdac]",children:((Te=ce.stats)==null?void 0:Te.total)||0}),e.jsx("div",{className:"text-xs text-gray-400",children:"绑定总数"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-green-400",children:((ut=ce.stats)==null?void 0:ut.purchased)||0}),e.jsx("div",{className:"text-xs text-gray-400",children:"已付费"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-yellow-400",children:["¥",(((rs=ce.stats)==null?void 0:rs.earnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"累计收益"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-orange-400",children:["¥",(((at=ce.stats)==null?void 0:at.pendingEarnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),A?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx($e,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((is=ce.referrals)==null?void 0:is.length)??0)>0?e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(ce.referrals??[]).map((B,We)=>{var rt;const He=B;return e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:((rt=He.nickname)==null?void 0:rt.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white text-sm",children:He.nickname}),e.jsx("div",{className:"text-xs text-gray-500",children:He.phone||(He.hasOpenId?"微信用户":"未绑定")})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[He.status==="vip"&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),He.status==="paid"&&e.jsxs(Oe,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",He.purchasedSections,"章"]}),He.status==="free"&&e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),e.jsx("span",{className:"text-xs text-gray-500",children:He.createdAt?new Date(He.createdAt).toLocaleDateString():""})]})]},He.id||We)})}):e.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),e.jsx(Dt,{children:e.jsx(q,{variant:"outline",onClick:()=>$(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),e.jsx(L2,{open:K,onClose:()=>de(!1),userId:G,onUserUpdated:Ps}),e.jsx(O2,{open:we,onClose:()=>{D(!1),Se(null)},userId:(ue==null?void 0:ue.id)??null,userNickname:ue==null?void 0:ue.nickname,onSaved:Ps})]})}function ho(r,[a,l]){return Math.min(l,Math.max(a,r))}var u0=["PageUp","PageDown"],h0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],m0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},za="Slider",[Jd,z2,$2]=Tu(za),[f0]=pn(za,[$2]),[B2,Eo]=f0(za),x0=h.forwardRef((r,a)=>{const{name:l,min:o=0,max:c=100,step:u=1,orientation:m="horizontal",disabled:f=!1,minStepsBetweenThumbs:g=0,defaultValue:y=[o],value:x,onValueChange:v=()=>{},onValueCommit:C=()=>{},inverted:E=!1,form:P,...w}=r,b=h.useRef(new Set),N=h.useRef(0),j=m==="horizontal"?U2:V2,[I=[],W]=Fn({prop:x,defaultProp:y,onChange:ae=>{var ee;(ee=[...b.current][N.current])==null||ee.focus(),v(ae)}}),U=h.useRef(I);function _(ae){const oe=G2(I,ae);re(ae,oe)}function R(ae){re(ae,N.current)}function T(){const ae=U.current[N.current];I[N.current]!==ae&&C(I)}function re(ae,oe,{commit:ee}={commit:!1}){const te=J2(u),Y=Z2(Math.round((ae-o)/u)*u+o,te),ne=ho(Y,[o,c]);W((ve=[])=>{const $=K2(ve,ne,oe);if(X2($,g*u)){N.current=$.indexOf(ne);const ce=String($)!==String(ve);return ce&&ee&&C($),ce?$:ve}else return ve})}return e.jsx(B2,{scope:r.__scopeSlider,name:l,disabled:f,min:o,max:c,valueIndexToChangeRef:N,thumbs:b.current,values:I,orientation:m,form:P,children:e.jsx(Jd.Provider,{scope:r.__scopeSlider,children:e.jsx(Jd.Slot,{scope:r.__scopeSlider,children:e.jsx(j,{"aria-disabled":f,"data-disabled":f?"":void 0,...w,ref:a,onPointerDown:Ke(w.onPointerDown,()=>{f||(U.current=I)}),min:o,max:c,inverted:E,onSlideStart:f?void 0:_,onSlideMove:f?void 0:R,onSlideEnd:f?void 0:T,onHomeKeyDown:()=>!f&&re(o,0,{commit:!0}),onEndKeyDown:()=>!f&&re(c,I.length-1,{commit:!0}),onStepKeyDown:({event:ae,direction:oe})=>{if(!f){const Y=u0.includes(ae.key)||ae.shiftKey&&h0.includes(ae.key)?10:1,ne=N.current,ve=I[ne],$=u*Y*oe;re(ve+$,ne,{commit:!0})}}})})})})});x0.displayName=za;var[p0,g0]=f0(za,{startEdge:"left",endEdge:"right",size:"width",direction:1}),U2=h.forwardRef((r,a)=>{const{min:l,max:o,dir:c,inverted:u,onSlideStart:m,onSlideMove:f,onSlideEnd:g,onStepKeyDown:y,...x}=r,[v,C]=h.useState(null),E=lt(a,j=>C(j)),P=h.useRef(void 0),w=So(c),b=w==="ltr",N=b&&!u||!b&&u;function k(j){const I=P.current||v.getBoundingClientRect(),W=[0,I.width],_=Mu(W,N?[l,o]:[o,l]);return P.current=I,_(j-I.left)}return e.jsx(p0,{scope:r.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:e.jsx(y0,{dir:w,"data-orientation":"horizontal",...x,ref:E,style:{...x.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const I=k(j.clientX);m==null||m(I)},onSlideMove:j=>{const I=k(j.clientX);f==null||f(I)},onSlideEnd:()=>{P.current=void 0,g==null||g()},onStepKeyDown:j=>{const W=m0[N?"from-left":"from-right"].includes(j.key);y==null||y({event:j,direction:W?-1:1})}})})}),V2=h.forwardRef((r,a)=>{const{min:l,max:o,inverted:c,onSlideStart:u,onSlideMove:m,onSlideEnd:f,onStepKeyDown:g,...y}=r,x=h.useRef(null),v=lt(a,x),C=h.useRef(void 0),E=!c;function P(w){const b=C.current||x.current.getBoundingClientRect(),N=[0,b.height],j=Mu(N,E?[o,l]:[l,o]);return C.current=b,j(w-b.top)}return e.jsx(p0,{scope:r.__scopeSlider,startEdge:E?"bottom":"top",endEdge:E?"top":"bottom",size:"height",direction:E?1:-1,children:e.jsx(y0,{"data-orientation":"vertical",...y,ref:v,style:{...y.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const b=P(w.clientY);u==null||u(b)},onSlideMove:w=>{const b=P(w.clientY);m==null||m(b)},onSlideEnd:()=>{C.current=void 0,f==null||f()},onStepKeyDown:w=>{const N=m0[E?"from-bottom":"from-top"].includes(w.key);g==null||g({event:w,direction:N?-1:1})}})})}),y0=h.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:u,onHomeKeyDown:m,onEndKeyDown:f,onStepKeyDown:g,...y}=r,x=Eo(za,l);return e.jsx(qe.span,{...y,ref:a,onKeyDown:Ke(r.onKeyDown,v=>{v.key==="Home"?(m(v),v.preventDefault()):v.key==="End"?(f(v),v.preventDefault()):u0.concat(h0).includes(v.key)&&(g(v),v.preventDefault())}),onPointerDown:Ke(r.onPointerDown,v=>{const C=v.target;C.setPointerCapture(v.pointerId),v.preventDefault(),x.thumbs.has(C)?C.focus():o(v)}),onPointerMove:Ke(r.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&c(v)}),onPointerUp:Ke(r.onPointerUp,v=>{const C=v.target;C.hasPointerCapture(v.pointerId)&&(C.releasePointerCapture(v.pointerId),u(v))})})}),v0="SliderTrack",j0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Eo(v0,l);return e.jsx(qe.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});j0.displayName=v0;var Zd="SliderRange",b0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Eo(Zd,l),u=g0(Zd,l),m=h.useRef(null),f=lt(a,m),g=c.values.length,y=c.values.map(C=>S0(C,c.min,c.max)),x=g>1?Math.min(...y):0,v=100-Math.max(...y);return e.jsx(qe.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:f,style:{...r.style,[u.startEdge]:x+"%",[u.endEdge]:v+"%"}})});b0.displayName=Zd;var eu="SliderThumb",N0=h.forwardRef((r,a)=>{const l=z2(r.__scopeSlider),[o,c]=h.useState(null),u=lt(a,f=>c(f)),m=h.useMemo(()=>o?l().findIndex(f=>f.ref.current===o):-1,[l,o]);return e.jsx(W2,{...r,ref:u,index:m})}),W2=h.forwardRef((r,a)=>{const{__scopeSlider:l,index:o,name:c,...u}=r,m=Eo(eu,l),f=g0(eu,l),[g,y]=h.useState(null),x=lt(a,k=>y(k)),v=g?m.form||!!g.closest("form"):!0,C=_u(g),E=m.values[o],P=E===void 0?0:S0(E,m.min,m.max),w=Y2(o,m.values.length),b=C==null?void 0:C[f.size],N=b?Q2(b,P,f.direction):0;return h.useEffect(()=>{if(g)return m.thumbs.add(g),()=>{m.thumbs.delete(g)}},[g,m.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${P}% + ${N}px)`},children:[e.jsx(Jd.ItemSlot,{scope:r.__scopeSlider,children:e.jsx(qe.span,{role:"slider","aria-label":r["aria-label"]||w,"aria-valuemin":m.min,"aria-valuenow":E,"aria-valuemax":m.max,"aria-orientation":m.orientation,"data-orientation":m.orientation,"data-disabled":m.disabled?"":void 0,tabIndex:m.disabled?void 0:0,...u,ref:x,style:E===void 0?{display:"none"}:r.style,onFocus:Ke(r.onFocus,()=>{m.valueIndexToChangeRef.current=o})})}),v&&e.jsx(w0,{name:c??(m.name?m.name+(m.values.length>1?"[]":""):void 0),form:m.form,value:E},o)]})});N0.displayName=eu;var H2="RadioBubbleInput",w0=h.forwardRef(({__scopeSlider:r,value:a,...l},o)=>{const c=h.useRef(null),u=lt(c,o),m=Iu(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const g=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(g,"value").set;if(m!==a&&x){const v=new Event("input",{bubbles:!0});x.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(qe.input,{style:{display:"none"},...l,ref:u,defaultValue:a})});w0.displayName=H2;function K2(r=[],a,l){const o=[...r];return o[l]=a,o.sort((c,u)=>c-u)}function S0(r,a,l){const u=100/(l-a)*(r-a);return ho(u,[0,100])}function Y2(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function G2(r,a){if(r.length===1)return 0;const l=r.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function Q2(r,a,l){const o=r/2,u=Mu([0,50],[0,o]);return(o-u(a)*l)*l}function q2(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function X2(r,a){if(a>0){const l=q2(r);return Math.min(...l)>=a}return!0}function Mu(r,a){return l=>{if(r[0]===r[1]||a[0]===a[1])return a[0];const o=(a[1]-a[0])/(r[1]-r[0]);return a[0]+o*(l-r[0])}}function J2(r){return(String(r).split(".")[1]||"").length}function Z2(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var e4=x0,t4=j0,s4=b0,r4=N0;function n4({className:r,defaultValue:a,value:l,min:o=0,max:c=100,...u}){const m=h.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[o,c],[l,a,o,c]);return e.jsxs(e4,{defaultValue:a,value:l,min:o,max:c,className:it("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...u,children:[e.jsx(t4,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:e.jsx(s4,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:m.length},(f,g)=>e.jsx(r4,{className:"block size-4 shrink-0 rounded-full border-2 border-[#38bdac] bg-white shadow-sm focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},g))]})}const a4={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function C0({embedded:r=!1}){const[a,l]=h.useState(a4),[o,c]=h.useState(!0),[u,m]=h.useState(!1);h.useEffect(()=>{Be("/api/admin/referral-settings").then(y=>{const x=y==null?void 0:y.data;x&&typeof x=="object"&&l({distributorShare:x.distributorShare??90,minWithdrawAmount:x.minWithdrawAmount??10,bindingDays:x.bindingDays??30,userDiscount:x.userDiscount??5,enableAutoWithdraw:x.enableAutoWithdraw??!1,vipOrderShareVip:x.vipOrderShareVip??20,vipOrderShareNonVip:x.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>c(!1))},[]);const f=async()=>{m(!0);try{const y={distributorShare:Number(a.distributorShare)||0,minWithdrawAmount:Number(a.minWithdrawAmount)||0,bindingDays:Number(a.bindingDays)||0,userDiscount:Number(a.userDiscount)||0,enableAutoWithdraw:!!a.enableAutoWithdraw,vipOrderShareVip:Number(a.vipOrderShareVip)||20,vipOrderShareNonVip:Number(a.vipOrderShareNonVip)||10},x=await yt("/api/admin/referral-settings",y);if(!x||x.success===!1){alert("保存失败: "+(x&&typeof x=="object"&&"error"in x?x.error:""));return}alert(`✅ 分销配置已保存成功! + +• 小程序与网站的推广规则会一起生效 +• 绑定关系会使用新的天数配置 +• 佣金比例会立即应用到新订单 + +如有缓存,请刷新前台/小程序页面。`)}catch(y){console.error(y),alert("保存失败: "+(y instanceof Error?y.message:String(y)))}finally{m(!1)}},g=y=>x=>{const v=parseFloat(x.target.value||"0");l(C=>({...C,[y]:isNaN(v)?0:v}))};return o?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Ra,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),e.jsxs(q,{onClick:f,disabled:u||o,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),u?"保存中...":"保存配置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"flex items-center gap-2 text-white",children:[e.jsx(qb,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),e.jsx(bt,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),e.jsx(ke,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Ui,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),e.jsx(ie,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.userDiscount,onChange:g("userDiscount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Qt,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(n4,{className:"flex-1",min:10,max:100,step:1,value:[a.distributorShare],onValueChange:([y])=>l(x=>({...x,distributorShare:y}))}),e.jsx(ie,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:a.distributorShare,onChange:g("distributorShare")})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["内容订单佣金 = 订单金额 ×"," ",e.jsxs("span",{className:"text-[#38bdac] font-mono",children:[a.distributorShare,"%"]}),";会员订单见下方。"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Ui,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),e.jsx(ie,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.vipOrderShareVip,onChange:g("vipOrderShareVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Ui,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),e.jsx(ie,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.vipOrderShareNonVip,onChange:g("vipOrderShareNonVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Qt,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),e.jsx(ie,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:a.bindingDays,onChange:g("bindingDays")}),e.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"flex items-center gap-2 text-white",children:[e.jsx(Ra,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),e.jsx(bt,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),e.jsx(ke,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"最低提现金额(元)"}),e.jsx(ie,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:a.minWithdrawAmount,onChange:g("minWithdrawAmount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",e.jsx(Oe,{variant:"outline",className:"border-[#38bdac]/40 text-[#38bdac] text-[10px]",children:"预留"})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[e.jsx(dt,{checked:a.enableAutoWithdraw,onCheckedChange:y=>l(x=>({...x,enableAutoWithdraw:y}))}),e.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsxs(Ge,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[e.jsx(Ui,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),e.jsxs(ke,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[e.jsxs("p",{children:["1. 以上配置会写入"," ",e.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),",小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),e.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),e.jsx("p",{children:"3. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}function l4(){var we;const[r,a]=h.useState("overview"),[l,o]=h.useState([]),[c,u]=h.useState(null),[m,f]=h.useState([]),[g,y]=h.useState([]),[x,v]=h.useState([]),[C,E]=h.useState(!0),[P,w]=h.useState(null),[b,N]=h.useState(""),[k,j]=h.useState("all"),[I,W]=h.useState(1),[U,_]=h.useState(10),[R,T]=h.useState(0),[re,ae]=h.useState(new Set),[oe,ee]=h.useState(null),[te,Y]=h.useState(""),[ne,ve]=h.useState(!1);h.useEffect(()=>{$()},[]),h.useEffect(()=>{W(1)},[r,k]),h.useEffect(()=>{ce(r)},[r]),h.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&ce(r,!0)},[I,U,k,b]);async function $(){w(null);try{const D=await Be("/api/admin/distribution/overview");D!=null&&D.success&&D.overview&&u(D.overview)}catch(D){console.error("[Admin] 概览接口异常:",D),w("加载概览失败")}try{const D=await Be("/api/db/users");v((D==null?void 0:D.users)||[])}catch(D){console.error("[Admin] 用户数据加载失败:",D)}}async function ce(D,ue=!1){var Se;if(!(!ue&&re.has(D))){E(!0);try{const Ie=x;switch(D){case"overview":break;case"orders":{try{const Ue=new URLSearchParams({page:String(I),pageSize:String(U),...k!=="all"&&{status:k},...b&&{search:b}}),Ze=await Be(`/api/orders?${Ue}`);if(Ze!=null&&Ze.success&&Ze.orders){const et=Ze.orders.map(tt=>{const pe=Ie.find(ot=>ot.id===tt.userId),fe=tt.referrerId?Ie.find(ot=>ot.id===tt.referrerId):null;return{...tt,amount:parseFloat(String(tt.amount))||0,userNickname:(pe==null?void 0:pe.nickname)||tt.userNickname||"未知用户",userPhone:(pe==null?void 0:pe.phone)||tt.userPhone||"-",referrerNickname:(fe==null?void 0:fe.nickname)||null,referrerCode:(fe==null?void 0:fe.referralCode)??null,type:tt.productType||tt.type}});o(et),T(Ze.total??et.length)}else o([]),T(0)}catch(Ue){console.error(Ue),w("加载订单失败"),o([])}break}case"bindings":{try{const Ue=new URLSearchParams({page:String(I),pageSize:String(U),...k!=="all"&&{status:k}}),Ze=await Be(`/api/db/distribution?${Ue}`);f((Ze==null?void 0:Ze.bindings)||[]),T((Ze==null?void 0:Ze.total)??((Se=Ze==null?void 0:Ze.bindings)==null?void 0:Se.length)??0)}catch(Ue){console.error(Ue),w("加载绑定数据失败"),f([])}break}case"withdrawals":{try{const Ue=k==="completed"?"success":k==="rejected"?"failed":k,Ze=new URLSearchParams({...Ue&&Ue!=="all"&&{status:Ue},page:String(I),pageSize:String(U)}),et=await Be(`/api/admin/withdrawals?${Ze}`);if(et!=null&&et.success&&et.withdrawals){const tt=et.withdrawals.map(pe=>({...pe,account:pe.account??"未绑定微信号",status:pe.status==="success"?"completed":pe.status==="failed"?"rejected":pe.status}));y(tt),T((et==null?void 0:et.total)??tt.length)}else et!=null&&et.success||w(`获取提现记录失败: ${(et==null?void 0:et.error)||"未知错误"}`),y([])}catch(Ue){console.error(Ue),w("加载提现数据失败"),y([])}break}}ae(Ue=>new Set(Ue).add(D))}catch(Ie){console.error(Ie)}finally{E(!1)}}}async function H(){w(null),ae(D=>{const ue=new Set(D);return ue.delete(r),ue}),r==="overview"&&$(),await ce(r,!0)}async function A(D){if(confirm("确认审核通过并打款?"))try{const ue=await gt("/api/admin/withdrawals",{id:D,action:"approve"});if(!(ue!=null&&ue.success)){const Se=(ue==null?void 0:ue.message)||(ue==null?void 0:ue.error)||"操作失败";alert(Se);return}await H()}catch(ue){console.error(ue),alert("操作失败")}}async function O(D){const ue=prompt("请输入拒绝原因:");if(ue)try{const Se=await gt("/api/admin/withdrawals",{id:D,action:"reject",errorMessage:ue});if(!(Se!=null&&Se.success)){alert((Se==null?void 0:Se.error)||"操作失败");return}await H()}catch(Se){console.error(Se),alert("操作失败")}}async function L(){var D;if(!(!(oe!=null&&oe.orderSn)&&!(oe!=null&&oe.id))){ve(!0),w(null);try{const ue=await gt("/api/admin/orders/refund",{orderSn:oe.orderSn||oe.id,reason:te||void 0});ue!=null&&ue.success?(ee(null),Y(""),await ce("orders",!0)):w((ue==null?void 0:ue.error)||"退款失败")}catch(ue){const Se=ue;w(((D=Se==null?void 0:Se.data)==null?void 0:D.error)||"退款失败,请检查网络后重试")}finally{ve(!1)}}}function X(D){const ue={active:"bg-green-500/20 text-green-400",converted:"bg-blue-500/20 text-blue-400",expired:"bg-gray-500/20 text-gray-400",cancelled:"bg-red-500/20 text-red-400",pending:"bg-orange-500/20 text-orange-400",pending_confirm:"bg-orange-500/20 text-orange-400",processing:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400"},Se={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return e.jsx(Oe,{className:`${ue[D]||"bg-gray-500/20 text-gray-400"} border-0`,children:Se[D]||D})}const K=Math.ceil(R/U)||1,de=l,G=m.filter(D=>{var Se,Ie,Ue,Ze;if(!b)return!0;const ue=b.toLowerCase();return((Se=D.refereeNickname)==null?void 0:Se.toLowerCase().includes(ue))||((Ie=D.refereePhone)==null?void 0:Ie.includes(ue))||((Ue=D.referrerName)==null?void 0:Ue.toLowerCase().includes(ue))||((Ze=D.referrerCode)==null?void 0:Ze.toLowerCase().includes(ue))}),xe=g.filter(D=>{var Se;if(!b)return!0;const ue=b.toLowerCase();return((Se=D.userName)==null?void 0:Se.toLowerCase().includes(ue))||D.account&&D.account.toLowerCase().includes(ue)});return e.jsxs("div",{className:"p-8 w-full",children:[P&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:P}),e.jsx("button",{type:"button",onClick:()=>w(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"推广中心"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),e.jsxs(q,{onClick:H,disabled:C,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${C?"animate-spin":""}`}),"刷新数据"]})]}),e.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4 flex-wrap",children:[{key:"overview",label:"数据概览",icon:Ca},{key:"orders",label:"订单管理",icon:no},{key:"bindings",label:"绑定管理",icon:ln},{key:"withdrawals",label:"提现审核",icon:Ra},{key:"settings",label:"推广设置",icon:On}].map(D=>e.jsxs("button",{type:"button",onClick:()=>{a(D.key),j("all"),N("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===D.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[e.jsx(D.icon,{className:"w-4 h-4"}),D.label]},D.key))}),C?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx($e,{className:"w-8 h-8 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[r==="overview"&&c&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"总点击次数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(Cr,{className:"w-6 h-6 text-blue-400"})})]})})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日独立用户"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayUniqueVisitors??0}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"去重访客数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-cyan-500/20 flex items-center justify-center",children:e.jsx(Qt,{className:"w-6 h-6 text-cyan-400"})})]})})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日总文章点击率"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:(c.todayClickRate??0).toFixed(2)}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"人均点击(总点击/独立用户)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-amber-500/20 flex items-center justify-center",children:e.jsx(Ca,{className:"w-6 h-6 text-amber-400"})})]})})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:e.jsx(ln,{className:"w-6 h-6 text-green-400"})})]})})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:e.jsx(Lf,{className:"w-6 h-6 text-purple-400"})})]})})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),e.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:e.jsx(no,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),(((we=c.todayClicksByPage)==null?void 0:we.length)??0)>0&&e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Cr,{className:"w-5 h-5 text-[#38bdac]"}),"每篇文章今日点击(按来源页/文章统计)"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"实际用户与实际文章的点击均计入;今日总点击与上表一致"})]}),e.jsx(ke,{children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"pb-3 pr-4",children:"来源页/文章"}),e.jsx("th",{className:"pb-3 pr-4 text-right",children:"今日点击"}),e.jsx("th",{className:"pb-3 text-right",children:"占比"})]})}),e.jsx("tbody",{children:[...c.todayClicksByPage??[]].sort((D,ue)=>ue.clicks-D.clicks).map((D,ue)=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-4 text-white font-mono",children:D.page||"(未区分)"}),e.jsx("td",{className:"py-2 pr-4 text-right text-white",children:D.clicks}),e.jsxs("td",{className:"py-2 text-right text-gray-400",children:[c.todayClicks>0?(D.clicks/c.todayClicks*100).toFixed(1):0,"%"]})]},ue))})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Ce,{className:"bg-orange-500/10 border-orange-500/30",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:e.jsx(Wd,{className:"w-6 h-6 text-orange-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),e.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期,需关注转化"})]})]})})}),e.jsx(Ce,{className:"bg-blue-500/10 border-blue-500/30",children:e.jsx(ke,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(Ra,{className:"w-6 h-6 text-blue-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),e.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),e.jsx(q,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(ro,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),e.jsx(ke,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Ca,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),e.jsxs(ke,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),e.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-300",children:"点击转化率"}),e.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),e.jsx(ke,{children:e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),r==="orders"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(ie,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:k,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-0",children:[l.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"退款原因"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:de.map(D=>{var ue,Se;return e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsxs("td",{className:"p-4 font-mono text-xs text-gray-400",children:[(ue=D.id)==null?void 0:ue.slice(0,12),"..."]}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:D.userNickname}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.userPhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:(()=>{const Ie=D.productType||D.type;return Ie==="fullbook"?`${D.bookName||"《底层逻辑》"} - 全本`:Ie==="match"?"匹配次数购买":`${D.bookName||"《底层逻辑》"} - ${D.sectionTitle||D.chapterTitle||`章节${D.productId||D.sectionId||""}`}`})()}),e.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const Ie=D.productType||D.type;return Ie==="fullbook"?"全书解锁":Ie==="match"?"功能权益":D.chapterTitle||"单章购买"})()})]})}),e.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof D.amount=="number"?D.amount.toFixed(2):parseFloat(String(D.amount||"0")).toFixed(2)]}),e.jsx("td",{className:"p-4 text-gray-300",children:D.paymentMethod==="wechat"?"微信支付":D.paymentMethod==="alipay"?"支付宝":D.paymentMethod||"微信支付"}),e.jsx("td",{className:"p-4",children:D.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):D.status==="completed"||D.status==="paid"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):D.status==="pending"||D.status==="created"?e.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):e.jsx(Oe,{className:"bg-red-500/20 text-red-400 border-0",children:"已失败"})}),e.jsx("td",{className:"p-4 text-gray-400 text-sm max-w-[120px]",title:D.refundReason,children:D.status==="refunded"&&D.refundReason?D.refundReason:"-"}),e.jsx("td",{className:"p-4 text-gray-300 text-sm",children:D.referrerId||D.referralCode?e.jsxs("span",{title:D.referralCode||D.referrerCode||D.referrerId||"",children:[D.referrerNickname||D.referralCode||D.referrerCode||((Se=D.referrerId)==null?void 0:Se.slice(0,8)),(D.referralCode||D.referrerCode)&&` (${D.referralCode||D.referrerCode})`]}):"-"}),e.jsx("td",{className:"p-4 text-[#FFD700]",children:D.referrerEarnings?`¥${(typeof D.referrerEarnings=="number"?D.referrerEarnings:parseFloat(String(D.referrerEarnings))).toFixed(2)}`:"-"}),e.jsx("td",{className:"p-4 text-gray-400 text-sm",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:(D.status==="paid"||D.status==="completed")&&e.jsxs(q,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{ee(D),Y("")},children:[e.jsx(Wx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},D.id)})})]})}),r==="orders"&&e.jsx(Hs,{page:I,totalPages:K,total:R,pageSize:U,onPageChange:W,onPageSizeChange:D=>{_(D),W(1)}})]})})]}),r==="bindings"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(ie,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:k,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"active",children:"有效"}),e.jsx("option",{value:"converted",children:"已转化"}),e.jsx("option",{value:"expired",children:"已过期"})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-0",children:[G.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:G.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-medium",children:D.refereeNickname||"匿名用户"}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.refereePhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white",children:D.referrerName||"-"}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:D.referrerCode})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.boundAt?new Date(D.boundAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:D.expiresAt?new Date(D.expiresAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4",children:D.commission?e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",D.commission.toFixed(2)]}):e.jsx("span",{className:"text-gray-500",children:"-"})})]},D.id))})]})}),r==="bindings"&&e.jsx(Hs,{page:I,totalPages:K,total:R,pageSize:U,onPageChange:W,onPageSizeChange:D=>{_(D),W(1)}})]})})]}),r==="withdrawals"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(ie,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:k,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"pending",children:"待审核"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-0",children:[xe.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:xe.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[D.userAvatar?e.jsx("img",{src:D.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(D.userName||D.name||"?").slice(0,1)}),e.jsx("p",{className:"text-white font-medium",children:D.userName||D.name})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",D.amount.toFixed(2)]})}),e.jsx("td",{className:"p-4",children:e.jsx(Oe,{className:D.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:D.method==="wechat"?"微信":"支付宝"})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-mono text-xs",children:D.account}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.name})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4 text-right",children:D.status==="pending"&&e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsxs(q,{size:"sm",onClick:()=>A(D.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Lf,{className:"w-4 h-4 mr-1"}),"通过"]}),e.jsxs(q,{size:"sm",variant:"outline",onClick:()=>O(D.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[e.jsx($x,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},D.id))})]})}),r==="withdrawals"&&e.jsx(Hs,{page:I,totalPages:K,total:R,pageSize:U,onPageChange:W,onPageSizeChange:D=>{_(D),W(1)}})]})})]})]}),e.jsx(St,{open:!!oe,onOpenChange:D=>!D&&ee(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:"订单退款"})}),oe&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",oe.orderSn||oe.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof oe.amount=="number"?oe.amount.toFixed(2):parseFloat(String(oe.amount||"0")).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:te,onChange:D=>Y(D.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>ee(null),disabled:ne,children:"取消"}),e.jsx(q,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:L,disabled:ne,children:ne?"退款中...":"确认退款"})]})]})}),r==="settings"&&e.jsx("div",{className:"-mx-8 -mt-6",children:e.jsx(C0,{embedded:!0})})]})}function i4(){const[r,a]=h.useState([]),[l,o]=h.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,u]=h.useState(!0),[m,f]=h.useState(null),[g,y]=h.useState("all"),[x,v]=h.useState(1),[C,E]=h.useState(10),[P,w]=h.useState(0),[b,N]=h.useState(null);async function k(){var _,R,T,re,ae,oe,ee;u(!0),f(null);try{const te=new URLSearchParams({status:g,page:String(x),pageSize:String(C)}),Y=await Be(`/api/admin/withdrawals?${te}`);if(Y!=null&&Y.success){const ne=Y.withdrawals||[];a(ne),w(Y.total??((_=Y.stats)==null?void 0:_.total)??ne.length),o({total:((R=Y.stats)==null?void 0:R.total)??Y.total??ne.length,pendingCount:((T=Y.stats)==null?void 0:T.pendingCount)??0,pendingAmount:((re=Y.stats)==null?void 0:re.pendingAmount)??0,successCount:((ae=Y.stats)==null?void 0:ae.successCount)??0,successAmount:((oe=Y.stats)==null?void 0:oe.successAmount)??0,failedCount:((ee=Y.stats)==null?void 0:ee.failedCount)??0})}else f("加载提现记录失败")}catch(te){console.error("Load withdrawals error:",te),f("加载失败,请检查网络后重试")}finally{u(!1)}}h.useEffect(()=>{v(1)},[g]),h.useEffect(()=>{k()},[g,x,C]);const j=Math.ceil(P/C)||1;async function I(_){const R=r.find(T=>T.id===_);if(R!=null&&R.userCommissionInfo&&R.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${R.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 + +确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;N(_);try{const T=await gt("/api/admin/withdrawals",{id:_,action:"approve"});T!=null&&T.success?k():alert("操作失败: "+((T==null?void 0:T.error)??""))}catch{alert("操作失败")}finally{N(null)}}async function W(_){const R=prompt("请输入拒绝原因(将返还用户余额):");if(R){N(_);try{const T=await gt("/api/admin/withdrawals",{id:_,action:"reject",errorMessage:R});T!=null&&T.success?k():alert("操作失败: "+((T==null?void 0:T.error)??""))}catch{alert("操作失败")}finally{N(null)}}}function U(_){switch(_){case"pending":return e.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"pending_confirm":return e.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待用户确认"});case"processing":return e.jsx(Oe,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"已审批等待打款"});case"success":case"completed":return e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return e.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:_})}}return e.jsxs("div",{className:"p-8 w-full",children:[m&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:m}),e.jsx("button",{type:"button",onClick:()=>f(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-start mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),e.jsxs(q,{variant:"outline",onClick:k,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),e.jsx(Ce,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:e.jsx(ke,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(no,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),e.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",e.jsx("span",{className:"text-white font-medium",children:"90%"})]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),e.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),e.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),e.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(ke,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),e.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(_=>e.jsx(q,{variant:g===_?"default":"outline",size:"sm",onClick:()=>y(_),className:g===_?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:_==="all"?"全部":_==="pending"?"待处理":_==="success"?"已完成":"已拒绝"},_))}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:c?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):r.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Ra,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"确认收款"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:r.map(_=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4 text-gray-400",children:new Date(_.createdAt??"").toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[_.userAvatar?e.jsx("img",{src:_.userAvatar,alt:_.userName??"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:(_.userName??"?").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-white",children:_.userName??"未知"}),e.jsx("p",{className:"text-xs text-gray-500",children:_.userPhone??_.referralCode??(_.userId??"").slice(0,10)})]})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(_.amount).toFixed(2)]})}),e.jsx("td",{className:"p-4",children:_.userCommissionInfo?e.jsxs("div",{className:"text-xs space-y-1",children:[e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",_.userCommissionInfo.totalCommission.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"已提现:"}),e.jsxs("span",{className:"text-gray-400",children:["¥",_.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"待审核:"}),e.jsxs("span",{className:"text-orange-400",children:["¥",_.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[e.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),e.jsxs("span",{className:_.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",_.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):e.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),e.jsxs("td",{className:"p-4",children:[U(_.status),_.errorMessage&&e.jsx("p",{className:"text-xs text-red-400 mt-1",children:_.errorMessage})]}),e.jsx("td",{className:"p-4 text-gray-400",children:_.processedAt?new Date(_.processedAt).toLocaleString():"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:_.userConfirmedAt?e.jsxs("span",{className:"text-green-400",title:_.userConfirmedAt,children:["已确认 ",new Date(_.userConfirmedAt).toLocaleString()]}):"-"}),e.jsxs("td",{className:"p-4 text-right",children:[(_.status==="pending"||_.status==="pending_confirm")&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs(q,{size:"sm",onClick:()=>I(_.id),disabled:b===_.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(jo,{className:"w-4 h-4 mr-1"}),"批准"]}),e.jsxs(q,{size:"sm",variant:"outline",onClick:()=>W(_.id),disabled:b===_.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(_.status==="success"||_.status==="completed")&&_.transactionId&&e.jsx("span",{className:"text-xs text-gray-500 font-mono",children:_.transactionId})]})]},_.id))})]})}),e.jsx(Hs,{page:x,totalPages:j,total:P,pageSize:C,onPageChange:v,onPageSizeChange:_=>{E(_),v(1)}})]})})})]})}const o4=["top","right","bottom","left"],hn=Math.min,ws=Math.max,mo=Math.round,Xi=Math.floor,ir=r=>({x:r,y:r}),c4={left:"right",right:"left",bottom:"top",top:"bottom"},d4={start:"end",end:"start"};function tu(r,a,l){return ws(r,hn(a,l))}function Er(r,a){return typeof r=="function"?r(a):r}function Pr(r){return r.split("-")[0]}function $a(r){return r.split("-")[1]}function Au(r){return r==="x"?"y":"x"}function Du(r){return r==="y"?"height":"width"}const u4=new Set(["top","bottom"]);function lr(r){return u4.has(Pr(r))?"y":"x"}function Lu(r){return Au(lr(r))}function h4(r,a,l){l===void 0&&(l=!1);const o=$a(r),c=Lu(r),u=Du(c);let m=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(m=fo(m)),[m,fo(m)]}function m4(r){const a=fo(r);return[su(r),a,su(a)]}function su(r){return r.replace(/start|end/g,a=>d4[a])}const ox=["left","right"],cx=["right","left"],f4=["top","bottom"],x4=["bottom","top"];function p4(r,a,l){switch(r){case"top":case"bottom":return l?a?cx:ox:a?ox:cx;case"left":case"right":return a?f4:x4;default:return[]}}function g4(r,a,l,o){const c=$a(r);let u=p4(Pr(r),l==="start",o);return c&&(u=u.map(m=>m+"-"+c),a&&(u=u.concat(u.map(su)))),u}function fo(r){return r.replace(/left|right|bottom|top/g,a=>c4[a])}function y4(r){return{top:0,right:0,bottom:0,left:0,...r}}function k0(r){return typeof r!="number"?y4(r):{top:r,right:r,bottom:r,left:r}}function xo(r){const{x:a,y:l,width:o,height:c}=r;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function dx(r,a,l){let{reference:o,floating:c}=r;const u=lr(a),m=Lu(a),f=Du(m),g=Pr(a),y=u==="y",x=o.x+o.width/2-c.width/2,v=o.y+o.height/2-c.height/2,C=o[f]/2-c[f]/2;let E;switch(g){case"top":E={x,y:o.y-c.height};break;case"bottom":E={x,y:o.y+o.height};break;case"right":E={x:o.x+o.width,y:v};break;case"left":E={x:o.x-c.width,y:v};break;default:E={x:o.x,y:o.y}}switch($a(a)){case"start":E[m]-=C*(l&&y?-1:1);break;case"end":E[m]+=C*(l&&y?-1:1);break}return E}async function v4(r,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:u,rects:m,elements:f,strategy:g}=r,{boundary:y="clippingAncestors",rootBoundary:x="viewport",elementContext:v="floating",altBoundary:C=!1,padding:E=0}=Er(a,r),P=k0(E),b=f[C?v==="floating"?"reference":"floating":v],N=xo(await u.getClippingRect({element:(l=await(u.isElement==null?void 0:u.isElement(b)))==null||l?b:b.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(f.floating)),boundary:y,rootBoundary:x,strategy:g})),k=v==="floating"?{x:o,y:c,width:m.floating.width,height:m.floating.height}:m.reference,j=await(u.getOffsetParent==null?void 0:u.getOffsetParent(f.floating)),I=await(u.isElement==null?void 0:u.isElement(j))?await(u.getScale==null?void 0:u.getScale(j))||{x:1,y:1}:{x:1,y:1},W=xo(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:k,offsetParent:j,strategy:g}):k);return{top:(N.top-W.top+P.top)/I.y,bottom:(W.bottom-N.bottom+P.bottom)/I.y,left:(N.left-W.left+P.left)/I.x,right:(W.right-N.right+P.right)/I.x}}const j4=async(r,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:m}=l,f=u.filter(Boolean),g=await(m.isRTL==null?void 0:m.isRTL(a));let y=await m.getElementRects({reference:r,floating:a,strategy:c}),{x,y:v}=dx(y,o,g),C=o,E={},P=0;for(let b=0;b({name:"arrow",options:r,async fn(a){const{x:l,y:o,placement:c,rects:u,platform:m,elements:f,middlewareData:g}=a,{element:y,padding:x=0}=Er(r,a)||{};if(y==null)return{};const v=k0(x),C={x:l,y:o},E=Lu(c),P=Du(E),w=await m.getDimensions(y),b=E==="y",N=b?"top":"left",k=b?"bottom":"right",j=b?"clientHeight":"clientWidth",I=u.reference[P]+u.reference[E]-C[E]-u.floating[P],W=C[E]-u.reference[E],U=await(m.getOffsetParent==null?void 0:m.getOffsetParent(y));let _=U?U[j]:0;(!_||!await(m.isElement==null?void 0:m.isElement(U)))&&(_=f.floating[j]||u.floating[P]);const R=I/2-W/2,T=_/2-w[P]/2-1,re=hn(v[N],T),ae=hn(v[k],T),oe=re,ee=_-w[P]-ae,te=_/2-w[P]/2+R,Y=tu(oe,te,ee),ne=!g.arrow&&$a(c)!=null&&te!==Y&&u.reference[P]/2-(tete<=0)){var ae,oe;const te=(((ae=u.flip)==null?void 0:ae.index)||0)+1,Y=_[te];if(Y&&(!(v==="alignment"?k!==lr(Y):!1)||re.every($=>lr($.placement)===k?$.overflows[0]>0:!0)))return{data:{index:te,overflows:re},reset:{placement:Y}};let ne=(oe=re.filter(ve=>ve.overflows[0]<=0).sort((ve,$)=>ve.overflows[1]-$.overflows[1])[0])==null?void 0:oe.placement;if(!ne)switch(E){case"bestFit":{var ee;const ve=(ee=re.filter($=>{if(U){const ce=lr($.placement);return ce===k||ce==="y"}return!0}).map($=>[$.placement,$.overflows.filter(ce=>ce>0).reduce((ce,H)=>ce+H,0)]).sort(($,ce)=>$[1]-ce[1])[0])==null?void 0:ee[0];ve&&(ne=ve);break}case"initialPlacement":ne=f;break}if(c!==ne)return{reset:{placement:ne}}}return{}}}};function ux(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function hx(r){return o4.some(a=>r[a]>=0)}const w4=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...u}=Er(r,a);switch(c){case"referenceHidden":{const m=await o.detectOverflow(a,{...u,elementContext:"reference"}),f=ux(m,l.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:hx(f)}}}case"escaped":{const m=await o.detectOverflow(a,{...u,altBoundary:!0}),f=ux(m,l.floating);return{data:{escapedOffsets:f,escaped:hx(f)}}}default:return{}}}}},E0=new Set(["left","top"]);async function S4(r,a){const{placement:l,platform:o,elements:c}=r,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),m=Pr(l),f=$a(l),g=lr(l)==="y",y=E0.has(m)?-1:1,x=u&&g?-1:1,v=Er(a,r);let{mainAxis:C,crossAxis:E,alignmentAxis:P}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof P=="number"&&(E=f==="end"?P*-1:P),g?{x:E*x,y:C*y}:{x:C*y,y:E*x}}const C4=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,o;const{x:c,y:u,placement:m,middlewareData:f}=a,g=await S4(a,r);return m===((l=f.offset)==null?void 0:l.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:c+g.x,y:u+g.y,data:{...g,placement:m}}}}},k4=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:o,placement:c,platform:u}=a,{mainAxis:m=!0,crossAxis:f=!1,limiter:g={fn:N=>{let{x:k,y:j}=N;return{x:k,y:j}}},...y}=Er(r,a),x={x:l,y:o},v=await u.detectOverflow(a,y),C=lr(Pr(c)),E=Au(C);let P=x[E],w=x[C];if(m){const N=E==="y"?"top":"left",k=E==="y"?"bottom":"right",j=P+v[N],I=P-v[k];P=tu(j,P,I)}if(f){const N=C==="y"?"top":"left",k=C==="y"?"bottom":"right",j=w+v[N],I=w-v[k];w=tu(j,w,I)}const b=g.fn({...a,[E]:P,[C]:w});return{...b,data:{x:b.x-l,y:b.y-o,enabled:{[E]:m,[C]:f}}}}}},E4=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:o,placement:c,rects:u,middlewareData:m}=a,{offset:f=0,mainAxis:g=!0,crossAxis:y=!0}=Er(r,a),x={x:l,y:o},v=lr(c),C=Au(v);let E=x[C],P=x[v];const w=Er(f,a),b=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(g){const j=C==="y"?"height":"width",I=u.reference[C]-u.floating[j]+b.mainAxis,W=u.reference[C]+u.reference[j]-b.mainAxis;EW&&(E=W)}if(y){var N,k;const j=C==="y"?"width":"height",I=E0.has(Pr(c)),W=u.reference[v]-u.floating[j]+(I&&((N=m.offset)==null?void 0:N[v])||0)+(I?0:b.crossAxis),U=u.reference[v]+u.reference[j]+(I?0:((k=m.offset)==null?void 0:k[v])||0)-(I?b.crossAxis:0);PU&&(P=U)}return{[C]:E,[v]:P}}}},P4=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,o;const{placement:c,rects:u,platform:m,elements:f}=a,{apply:g=()=>{},...y}=Er(r,a),x=await m.detectOverflow(a,y),v=Pr(c),C=$a(c),E=lr(c)==="y",{width:P,height:w}=u.floating;let b,N;v==="top"||v==="bottom"?(b=v,N=C===(await(m.isRTL==null?void 0:m.isRTL(f.floating))?"start":"end")?"left":"right"):(N=v,b=C==="end"?"top":"bottom");const k=w-x.top-x.bottom,j=P-x.left-x.right,I=hn(w-x[b],k),W=hn(P-x[N],j),U=!a.middlewareData.shift;let _=I,R=W;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(R=j),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(_=k),U&&!C){const re=ws(x.left,0),ae=ws(x.right,0),oe=ws(x.top,0),ee=ws(x.bottom,0);E?R=P-2*(re!==0||ae!==0?re+ae:ws(x.left,x.right)):_=w-2*(oe!==0||ee!==0?oe+ee:ws(x.top,x.bottom))}await g({...a,availableWidth:R,availableHeight:_});const T=await m.getDimensions(f.floating);return P!==T.width||w!==T.height?{reset:{rects:!0}}:{}}}};function Po(){return typeof window<"u"}function Ba(r){return P0(r)?(r.nodeName||"").toLowerCase():"#document"}function Ss(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function cr(r){var a;return(a=(P0(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function P0(r){return Po()?r instanceof Node||r instanceof Ss(r).Node:!1}function Ys(r){return Po()?r instanceof Element||r instanceof Ss(r).Element:!1}function or(r){return Po()?r instanceof HTMLElement||r instanceof Ss(r).HTMLElement:!1}function mx(r){return!Po()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Ss(r).ShadowRoot}const T4=new Set(["inline","contents"]);function Dl(r){const{overflow:a,overflowX:l,overflowY:o,display:c}=Gs(r);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!T4.has(c)}const R4=new Set(["table","td","th"]);function I4(r){return R4.has(Ba(r))}const _4=[":popover-open",":modal"];function To(r){return _4.some(a=>{try{return r.matches(a)}catch{return!1}})}const M4=["transform","translate","scale","rotate","perspective"],A4=["transform","translate","scale","rotate","perspective","filter"],D4=["paint","layout","strict","content"];function Ou(r){const a=Fu(),l=Ys(r)?Gs(r):r;return M4.some(o=>l[o]?l[o]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||A4.some(o=>(l.willChange||"").includes(o))||D4.some(o=>(l.contain||"").includes(o))}function L4(r){let a=mn(r);for(;or(a)&&!_a(a);){if(Ou(a))return a;if(To(a))return null;a=mn(a)}return null}function Fu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const O4=new Set(["html","body","#document"]);function _a(r){return O4.has(Ba(r))}function Gs(r){return Ss(r).getComputedStyle(r)}function Ro(r){return Ys(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function mn(r){if(Ba(r)==="html")return r;const a=r.assignedSlot||r.parentNode||mx(r)&&r.host||cr(r);return mx(a)?a.host:a}function T0(r){const a=mn(r);return _a(a)?r.ownerDocument?r.ownerDocument.body:r.body:or(a)&&Dl(a)?a:T0(a)}function Rl(r,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=T0(r),u=c===((o=r.ownerDocument)==null?void 0:o.body),m=Ss(c);if(u){const f=ru(m);return a.concat(m,m.visualViewport||[],Dl(c)?c:[],f&&l?Rl(f):[])}return a.concat(c,Rl(c,[],l))}function ru(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function R0(r){const a=Gs(r);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=or(r),u=c?r.offsetWidth:l,m=c?r.offsetHeight:o,f=mo(l)!==u||mo(o)!==m;return f&&(l=u,o=m),{width:l,height:o,$:f}}function zu(r){return Ys(r)?r:r.contextElement}function Pa(r){const a=zu(r);if(!or(a))return ir(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:u}=R0(a);let m=(u?mo(l.width):l.width)/o,f=(u?mo(l.height):l.height)/c;return(!m||!Number.isFinite(m))&&(m=1),(!f||!Number.isFinite(f))&&(f=1),{x:m,y:f}}const F4=ir(0);function I0(r){const a=Ss(r);return!Fu()||!a.visualViewport?F4:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function z4(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==Ss(r)?!1:a}function $n(r,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),u=zu(r);let m=ir(1);a&&(o?Ys(o)&&(m=Pa(o)):m=Pa(r));const f=z4(u,l,o)?I0(u):ir(0);let g=(c.left+f.x)/m.x,y=(c.top+f.y)/m.y,x=c.width/m.x,v=c.height/m.y;if(u){const C=Ss(u),E=o&&Ys(o)?Ss(o):o;let P=C,w=ru(P);for(;w&&o&&E!==P;){const b=Pa(w),N=w.getBoundingClientRect(),k=Gs(w),j=N.left+(w.clientLeft+parseFloat(k.paddingLeft))*b.x,I=N.top+(w.clientTop+parseFloat(k.paddingTop))*b.y;g*=b.x,y*=b.y,x*=b.x,v*=b.y,g+=j,y+=I,P=Ss(w),w=ru(P)}}return xo({width:x,height:v,x:g,y})}function Io(r,a){const l=Ro(r).scrollLeft;return a?a.left+l:$n(cr(r)).left+l}function _0(r,a){const l=r.getBoundingClientRect(),o=l.left+a.scrollLeft-Io(r,l),c=l.top+a.scrollTop;return{x:o,y:c}}function $4(r){let{elements:a,rect:l,offsetParent:o,strategy:c}=r;const u=c==="fixed",m=cr(o),f=a?To(a.floating):!1;if(o===m||f&&u)return l;let g={scrollLeft:0,scrollTop:0},y=ir(1);const x=ir(0),v=or(o);if((v||!v&&!u)&&((Ba(o)!=="body"||Dl(m))&&(g=Ro(o)),or(o))){const E=$n(o);y=Pa(o),x.x=E.x+o.clientLeft,x.y=E.y+o.clientTop}const C=m&&!v&&!u?_0(m,g):ir(0);return{width:l.width*y.x,height:l.height*y.y,x:l.x*y.x-g.scrollLeft*y.x+x.x+C.x,y:l.y*y.y-g.scrollTop*y.y+x.y+C.y}}function B4(r){return Array.from(r.getClientRects())}function U4(r){const a=cr(r),l=Ro(r),o=r.ownerDocument.body,c=ws(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),u=ws(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let m=-l.scrollLeft+Io(r);const f=-l.scrollTop;return Gs(o).direction==="rtl"&&(m+=ws(a.clientWidth,o.clientWidth)-c),{width:c,height:u,x:m,y:f}}const fx=25;function V4(r,a){const l=Ss(r),o=cr(r),c=l.visualViewport;let u=o.clientWidth,m=o.clientHeight,f=0,g=0;if(c){u=c.width,m=c.height;const x=Fu();(!x||x&&a==="fixed")&&(f=c.offsetLeft,g=c.offsetTop)}const y=Io(o);if(y<=0){const x=o.ownerDocument,v=x.body,C=getComputedStyle(v),E=x.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,P=Math.abs(o.clientWidth-v.clientWidth-E);P<=fx&&(u-=P)}else y<=fx&&(u+=y);return{width:u,height:m,x:f,y:g}}const W4=new Set(["absolute","fixed"]);function H4(r,a){const l=$n(r,!0,a==="fixed"),o=l.top+r.clientTop,c=l.left+r.clientLeft,u=or(r)?Pa(r):ir(1),m=r.clientWidth*u.x,f=r.clientHeight*u.y,g=c*u.x,y=o*u.y;return{width:m,height:f,x:g,y}}function xx(r,a,l){let o;if(a==="viewport")o=V4(r,l);else if(a==="document")o=U4(cr(r));else if(Ys(a))o=H4(a,l);else{const c=I0(r);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return xo(o)}function M0(r,a){const l=mn(r);return l===a||!Ys(l)||_a(l)?!1:Gs(l).position==="fixed"||M0(l,a)}function K4(r,a){const l=a.get(r);if(l)return l;let o=Rl(r,[],!1).filter(f=>Ys(f)&&Ba(f)!=="body"),c=null;const u=Gs(r).position==="fixed";let m=u?mn(r):r;for(;Ys(m)&&!_a(m);){const f=Gs(m),g=Ou(m);!g&&f.position==="fixed"&&(c=null),(u?!g&&!c:!g&&f.position==="static"&&!!c&&W4.has(c.position)||Dl(m)&&!g&&M0(r,m))?o=o.filter(x=>x!==m):c=f,m=mn(m)}return a.set(r,o),o}function Y4(r){let{element:a,boundary:l,rootBoundary:o,strategy:c}=r;const m=[...l==="clippingAncestors"?To(a)?[]:K4(a,this._c):[].concat(l),o],f=m[0],g=m.reduce((y,x)=>{const v=xx(a,x,c);return y.top=ws(v.top,y.top),y.right=hn(v.right,y.right),y.bottom=hn(v.bottom,y.bottom),y.left=ws(v.left,y.left),y},xx(a,f,c));return{width:g.right-g.left,height:g.bottom-g.top,x:g.left,y:g.top}}function G4(r){const{width:a,height:l}=R0(r);return{width:a,height:l}}function Q4(r,a,l){const o=or(a),c=cr(a),u=l==="fixed",m=$n(r,!0,u,a);let f={scrollLeft:0,scrollTop:0};const g=ir(0);function y(){g.x=Io(c)}if(o||!o&&!u)if((Ba(a)!=="body"||Dl(c))&&(f=Ro(a)),o){const E=$n(a,!0,u,a);g.x=E.x+a.clientLeft,g.y=E.y+a.clientTop}else c&&y();u&&!o&&c&&y();const x=c&&!o&&!u?_0(c,f):ir(0),v=m.left+f.scrollLeft-g.x-x.x,C=m.top+f.scrollTop-g.y-x.y;return{x:v,y:C,width:m.width,height:m.height}}function Ld(r){return Gs(r).position==="static"}function px(r,a){if(!or(r)||Gs(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return cr(r)===l&&(l=l.ownerDocument.body),l}function A0(r,a){const l=Ss(r);if(To(r))return l;if(!or(r)){let c=mn(r);for(;c&&!_a(c);){if(Ys(c)&&!Ld(c))return c;c=mn(c)}return l}let o=px(r,a);for(;o&&I4(o)&&Ld(o);)o=px(o,a);return o&&_a(o)&&Ld(o)&&!Ou(o)?l:o||L4(r)||l}const q4=async function(r){const a=this.getOffsetParent||A0,l=this.getDimensions,o=await l(r.floating);return{reference:Q4(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function X4(r){return Gs(r).direction==="rtl"}const J4={convertOffsetParentRelativeRectToViewportRelativeRect:$4,getDocumentElement:cr,getClippingRect:Y4,getOffsetParent:A0,getElementRects:q4,getClientRects:B4,getDimensions:G4,getScale:Pa,isElement:Ys,isRTL:X4};function D0(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function Z4(r,a){let l=null,o;const c=cr(r);function u(){var f;clearTimeout(o),(f=l)==null||f.disconnect(),l=null}function m(f,g){f===void 0&&(f=!1),g===void 0&&(g=1),u();const y=r.getBoundingClientRect(),{left:x,top:v,width:C,height:E}=y;if(f||a(),!C||!E)return;const P=Xi(v),w=Xi(c.clientWidth-(x+C)),b=Xi(c.clientHeight-(v+E)),N=Xi(x),j={rootMargin:-P+"px "+-w+"px "+-b+"px "+-N+"px",threshold:ws(0,hn(1,g))||1};let I=!0;function W(U){const _=U[0].intersectionRatio;if(_!==g){if(!I)return m();_?m(!1,_):o=setTimeout(()=>{m(!1,1e-7)},1e3)}_===1&&!D0(y,r.getBoundingClientRect())&&m(),I=!1}try{l=new IntersectionObserver(W,{...j,root:c.ownerDocument})}catch{l=new IntersectionObserver(W,j)}l.observe(r)}return m(!0),u}function eS(r,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,y=zu(r),x=c||u?[...y?Rl(y):[],...Rl(a)]:[];x.forEach(N=>{c&&N.addEventListener("scroll",l,{passive:!0}),u&&N.addEventListener("resize",l)});const v=y&&f?Z4(y,l):null;let C=-1,E=null;m&&(E=new ResizeObserver(N=>{let[k]=N;k&&k.target===y&&E&&(E.unobserve(a),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var j;(j=E)==null||j.observe(a)})),l()}),y&&!g&&E.observe(y),E.observe(a));let P,w=g?$n(r):null;g&&b();function b(){const N=$n(r);w&&!D0(w,N)&&l(),w=N,P=requestAnimationFrame(b)}return l(),()=>{var N;x.forEach(k=>{c&&k.removeEventListener("scroll",l),u&&k.removeEventListener("resize",l)}),v==null||v(),(N=E)==null||N.disconnect(),E=null,g&&cancelAnimationFrame(P)}}const tS=C4,sS=k4,rS=N4,nS=P4,aS=w4,gx=b4,lS=E4,iS=(r,a,l)=>{const o=new Map,c={platform:J4,...l},u={...c.platform,_c:o};return j4(r,a,{...c,platform:u})};var oS=typeof document<"u",cS=function(){},to=oS?h.useLayoutEffect:cS;function po(r,a){if(r===a)return!0;if(typeof r!=typeof a)return!1;if(typeof r=="function"&&r.toString()===a.toString())return!0;let l,o,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!po(r[o],a[o]))return!1;return!0}if(c=Object.keys(r),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const u=c[o];if(!(u==="_owner"&&r.$$typeof)&&!po(r[u],a[u]))return!1}return!0}return r!==r&&a!==a}function L0(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function yx(r,a){const l=L0(r);return Math.round(a*l)/l}function Od(r){const a=h.useRef(r);return to(()=>{a.current=r}),a}function dS(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:u,floating:m}={},transform:f=!0,whileElementsMounted:g,open:y}=r,[x,v]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[C,E]=h.useState(o);po(C,o)||E(o);const[P,w]=h.useState(null),[b,N]=h.useState(null),k=h.useCallback($=>{$!==U.current&&(U.current=$,w($))},[]),j=h.useCallback($=>{$!==_.current&&(_.current=$,N($))},[]),I=u||P,W=m||b,U=h.useRef(null),_=h.useRef(null),R=h.useRef(x),T=g!=null,re=Od(g),ae=Od(c),oe=Od(y),ee=h.useCallback(()=>{if(!U.current||!_.current)return;const $={placement:a,strategy:l,middleware:C};ae.current&&($.platform=ae.current),iS(U.current,_.current,$).then(ce=>{const H={...ce,isPositioned:oe.current!==!1};te.current&&!po(R.current,H)&&(R.current=H,Il.flushSync(()=>{v(H)}))})},[C,a,l,ae,oe]);to(()=>{y===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,v($=>({...$,isPositioned:!1})))},[y]);const te=h.useRef(!1);to(()=>(te.current=!0,()=>{te.current=!1}),[]),to(()=>{if(I&&(U.current=I),W&&(_.current=W),I&&W){if(re.current)return re.current(I,W,ee);ee()}},[I,W,ee,re,T]);const Y=h.useMemo(()=>({reference:U,floating:_,setReference:k,setFloating:j}),[k,j]),ne=h.useMemo(()=>({reference:I,floating:W}),[I,W]),ve=h.useMemo(()=>{const $={position:l,left:0,top:0};if(!ne.floating)return $;const ce=yx(ne.floating,x.x),H=yx(ne.floating,x.y);return f?{...$,transform:"translate("+ce+"px, "+H+"px)",...L0(ne.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:ce,top:H}},[l,f,ne.floating,x.x,x.y]);return h.useMemo(()=>({...x,update:ee,refs:Y,elements:ne,floatingStyles:ve}),[x,ee,Y,ne,ve])}const uS=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:o,padding:c}=typeof r=="function"?r(l):r;return o&&a(o)?o.current!=null?gx({element:o.current,padding:c}).fn(l):{}:o?gx({element:o,padding:c}).fn(l):{}}}},hS=(r,a)=>({...tS(r),options:[r,a]}),mS=(r,a)=>({...sS(r),options:[r,a]}),fS=(r,a)=>({...lS(r),options:[r,a]}),xS=(r,a)=>({...rS(r),options:[r,a]}),pS=(r,a)=>({...nS(r),options:[r,a]}),gS=(r,a)=>({...aS(r),options:[r,a]}),yS=(r,a)=>({...uS(r),options:[r,a]});var vS="Arrow",O0=h.forwardRef((r,a)=>{const{children:l,width:o=10,height:c=5,...u}=r;return e.jsx(qe.svg,{...u,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});O0.displayName=vS;var jS=O0,$u="Popper",[F0,z0]=pn($u),[bS,$0]=F0($u),B0=r=>{const{__scopePopper:a,children:l}=r,[o,c]=h.useState(null);return e.jsx(bS,{scope:a,anchor:o,onAnchorChange:c,children:l})};B0.displayName=$u;var U0="PopperAnchor",V0=h.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:o,...c}=r,u=$0(U0,l),m=h.useRef(null),f=lt(a,m),g=h.useRef(null);return h.useEffect(()=>{const y=g.current;g.current=(o==null?void 0:o.current)||m.current,y!==g.current&&u.onAnchorChange(g.current)}),o?null:e.jsx(qe.div,{...c,ref:f})});V0.displayName=U0;var Bu="PopperContent",[NS,wS]=F0(Bu),W0=h.forwardRef((r,a)=>{var G,xe,we,D,ue,Se;const{__scopePopper:l,side:o="bottom",sideOffset:c=0,align:u="center",alignOffset:m=0,arrowPadding:f=0,avoidCollisions:g=!0,collisionBoundary:y=[],collisionPadding:x=0,sticky:v="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:P,...w}=r,b=$0(Bu,l),[N,k]=h.useState(null),j=lt(a,Ie=>k(Ie)),[I,W]=h.useState(null),U=_u(I),_=(U==null?void 0:U.width)??0,R=(U==null?void 0:U.height)??0,T=o+(u!=="center"?"-"+u:""),re=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},ae=Array.isArray(y)?y:[y],oe=ae.length>0,ee={padding:re,boundary:ae.filter(CS),altBoundary:oe},{refs:te,floatingStyles:Y,placement:ne,isPositioned:ve,middlewareData:$}=dS({strategy:"fixed",placement:T,whileElementsMounted:(...Ie)=>eS(...Ie,{animationFrame:E==="always"}),elements:{reference:b.anchor},middleware:[hS({mainAxis:c+R,alignmentAxis:m}),g&&mS({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?fS():void 0,...ee}),g&&xS({...ee}),pS({...ee,apply:({elements:Ie,rects:Ue,availableWidth:Ze,availableHeight:et})=>{const{width:tt,height:pe}=Ue.reference,fe=Ie.floating.style;fe.setProperty("--radix-popper-available-width",`${Ze}px`),fe.setProperty("--radix-popper-available-height",`${et}px`),fe.setProperty("--radix-popper-anchor-width",`${tt}px`),fe.setProperty("--radix-popper-anchor-height",`${pe}px`)}}),I&&yS({element:I,padding:f}),kS({arrowWidth:_,arrowHeight:R}),C&&gS({strategy:"referenceHidden",...ee})]}),[ce,H]=Y0(ne),A=un(P);ts(()=>{ve&&(A==null||A())},[ve,A]);const O=(G=$.arrow)==null?void 0:G.x,L=(xe=$.arrow)==null?void 0:xe.y,X=((we=$.arrow)==null?void 0:we.centerOffset)!==0,[K,de]=h.useState();return ts(()=>{N&&de(window.getComputedStyle(N).zIndex)},[N]),e.jsx("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:ve?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(D=$.transformOrigin)==null?void 0:D.x,(ue=$.transformOrigin)==null?void 0:ue.y].join(" "),...((Se=$.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:e.jsx(NS,{scope:l,placedSide:ce,onArrowChange:W,arrowX:O,arrowY:L,shouldHideArrow:X,children:e.jsx(qe.div,{"data-side":ce,"data-align":H,...w,ref:j,style:{...w.style,animation:ve?void 0:"none"}})})})});W0.displayName=Bu;var H0="PopperArrow",SS={top:"bottom",right:"left",bottom:"top",left:"right"},K0=h.forwardRef(function(a,l){const{__scopePopper:o,...c}=a,u=wS(H0,o),m=SS[u.placedSide];return e.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:e.jsx(jS,{...c,ref:l,style:{...c.style,display:"block"}})})});K0.displayName=H0;function CS(r){return r!==null}var kS=r=>({name:"transformOrigin",options:r,fn(a){var b,N,k;const{placement:l,rects:o,middlewareData:c}=a,m=((b=c.arrow)==null?void 0:b.centerOffset)!==0,f=m?0:r.arrowWidth,g=m?0:r.arrowHeight,[y,x]=Y0(l),v={start:"0%",center:"50%",end:"100%"}[x],C=(((N=c.arrow)==null?void 0:N.x)??0)+f/2,E=(((k=c.arrow)==null?void 0:k.y)??0)+g/2;let P="",w="";return y==="bottom"?(P=m?v:`${C}px`,w=`${-g}px`):y==="top"?(P=m?v:`${C}px`,w=`${o.floating.height+g}px`):y==="right"?(P=`${-g}px`,w=m?v:`${E}px`):y==="left"&&(P=`${o.floating.width+g}px`,w=m?v:`${E}px`),{data:{x:P,y:w}}}});function Y0(r){const[a,l="center"]=r.split("-");return[a,l]}var ES=B0,PS=V0,TS=W0,RS=K0,G0=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),IS="VisuallyHidden",_S=h.forwardRef((r,a)=>e.jsx(qe.span,{...r,ref:a,style:{...G0,...r.style}}));_S.displayName=IS;var MS=[" ","Enter","ArrowUp","ArrowDown"],AS=[" ","Enter"],Bn="Select",[_o,Mo,DS]=Tu(Bn),[Ua]=pn(Bn,[DS,z0]),Ao=z0(),[LS,gn]=Ua(Bn),[OS,FS]=Ua(Bn),Q0=r=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:u,value:m,defaultValue:f,onValueChange:g,dir:y,name:x,autoComplete:v,disabled:C,required:E,form:P}=r,w=Ao(a),[b,N]=h.useState(null),[k,j]=h.useState(null),[I,W]=h.useState(!1),U=So(y),[_,R]=Fn({prop:o,defaultProp:c??!1,onChange:u,caller:Bn}),[T,re]=Fn({prop:m,defaultProp:f,onChange:g,caller:Bn}),ae=h.useRef(null),oe=b?P||!!b.closest("form"):!0,[ee,te]=h.useState(new Set),Y=Array.from(ee).map(ne=>ne.props.value).join(";");return e.jsx(ES,{...w,children:e.jsxs(LS,{required:E,scope:a,trigger:b,onTriggerChange:N,valueNode:k,onValueNodeChange:j,valueNodeHasChildren:I,onValueNodeHasChildrenChange:W,contentId:cn(),value:T,onValueChange:re,open:_,onOpenChange:R,dir:U,triggerPointerDownPosRef:ae,disabled:C,children:[e.jsx(_o.Provider,{scope:a,children:e.jsx(OS,{scope:r.__scopeSelect,onNativeOptionAdd:h.useCallback(ne=>{te(ve=>new Set(ve).add(ne))},[]),onNativeOptionRemove:h.useCallback(ne=>{te(ve=>{const $=new Set(ve);return $.delete(ne),$})},[]),children:l})}),oe?e.jsxs(gg,{"aria-hidden":!0,required:E,tabIndex:-1,name:x,autoComplete:v,value:T,onChange:ne=>re(ne.target.value),disabled:C,form:P,children:[T===void 0?e.jsx("option",{value:""}):null,Array.from(ee)]},Y):null]})})};Q0.displayName=Bn;var q0="SelectTrigger",X0=h.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=r,u=Ao(l),m=gn(q0,l),f=m.disabled||o,g=lt(a,m.onTriggerChange),y=Mo(l),x=h.useRef("touch"),[v,C,E]=vg(w=>{const b=y().filter(j=>!j.disabled),N=b.find(j=>j.value===m.value),k=jg(b,w,N);k!==void 0&&m.onValueChange(k.value)}),P=w=>{f||(m.onOpenChange(!0),E()),w&&(m.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return e.jsx(PS,{asChild:!0,...u,children:e.jsx(qe.button,{type:"button",role:"combobox","aria-controls":m.contentId,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":yg(m.value)?"":void 0,...c,ref:g,onClick:Ke(c.onClick,w=>{w.currentTarget.focus(),x.current!=="mouse"&&P(w)}),onPointerDown:Ke(c.onPointerDown,w=>{x.current=w.pointerType;const b=w.target;b.hasPointerCapture(w.pointerId)&&b.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(P(w),w.preventDefault())}),onKeyDown:Ke(c.onKeyDown,w=>{const b=v.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&C(w.key),!(b&&w.key===" ")&&MS.includes(w.key)&&(P(),w.preventDefault())})})})});X0.displayName=q0;var J0="SelectValue",Z0=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,children:u,placeholder:m="",...f}=r,g=gn(J0,l),{onValueNodeHasChildrenChange:y}=g,x=u!==void 0,v=lt(a,g.onValueNodeChange);return ts(()=>{y(x)},[y,x]),e.jsx(qe.span,{...f,ref:v,style:{pointerEvents:"none"},children:yg(g.value)?e.jsx(e.Fragment,{children:m}):u})});Z0.displayName=J0;var zS="SelectIcon",eg=h.forwardRef((r,a)=>{const{__scopeSelect:l,children:o,...c}=r;return e.jsx(qe.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});eg.displayName=zS;var $S="SelectPortal",tg=r=>e.jsx(wu,{asChild:!0,...r});tg.displayName=$S;var Un="SelectContent",sg=h.forwardRef((r,a)=>{const l=gn(Un,r.__scopeSelect),[o,c]=h.useState();if(ts(()=>{c(new DocumentFragment)},[]),!l.open){const u=o;return u?Il.createPortal(e.jsx(rg,{scope:r.__scopeSelect,children:e.jsx(_o.Slot,{scope:r.__scopeSelect,children:e.jsx("div",{children:r.children})})}),u):null}return e.jsx(ng,{...r,ref:a})});sg.displayName=Un;var Ws=10,[rg,yn]=Ua(Un),BS="SelectContentImpl",US=Tl("SelectContent.RemoveScroll"),ng=h.forwardRef((r,a)=>{const{__scopeSelect:l,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:u,onPointerDownOutside:m,side:f,sideOffset:g,align:y,alignOffset:x,arrowPadding:v,collisionBoundary:C,collisionPadding:E,sticky:P,hideWhenDetached:w,avoidCollisions:b,...N}=r,k=gn(Un,l),[j,I]=h.useState(null),[W,U]=h.useState(null),_=lt(a,G=>I(G)),[R,T]=h.useState(null),[re,ae]=h.useState(null),oe=Mo(l),[ee,te]=h.useState(!1),Y=h.useRef(!1);h.useEffect(()=>{if(j)return bp(j)},[j]),hp();const ne=h.useCallback(G=>{const[xe,...we]=oe().map(Se=>Se.ref.current),[D]=we.slice(-1),ue=document.activeElement;for(const Se of G)if(Se===ue||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===xe&&W&&(W.scrollTop=0),Se===D&&W&&(W.scrollTop=W.scrollHeight),Se==null||Se.focus(),document.activeElement!==ue))return},[oe,W]),ve=h.useCallback(()=>ne([R,j]),[ne,R,j]);h.useEffect(()=>{ee&&ve()},[ee,ve]);const{onOpenChange:$,triggerPointerDownPosRef:ce}=k;h.useEffect(()=>{if(j){let G={x:0,y:0};const xe=D=>{var ue,Se;G={x:Math.abs(Math.round(D.pageX)-(((ue=ce.current)==null?void 0:ue.x)??0)),y:Math.abs(Math.round(D.pageY)-(((Se=ce.current)==null?void 0:Se.y)??0))}},we=D=>{G.x<=10&&G.y<=10?D.preventDefault():j.contains(D.target)||$(!1),document.removeEventListener("pointermove",xe),ce.current=null};return ce.current!==null&&(document.addEventListener("pointermove",xe),document.addEventListener("pointerup",we,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",we,{capture:!0})}}},[j,$,ce]),h.useEffect(()=>{const G=()=>$(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[$]);const[H,A]=vg(G=>{const xe=oe().filter(ue=>!ue.disabled),we=xe.find(ue=>ue.ref.current===document.activeElement),D=jg(xe,G,we);D&&setTimeout(()=>D.ref.current.focus())}),O=h.useCallback((G,xe,we)=>{const D=!Y.current&&!we;(k.value!==void 0&&k.value===xe||D)&&(T(G),D&&(Y.current=!0))},[k.value]),L=h.useCallback(()=>j==null?void 0:j.focus(),[j]),X=h.useCallback((G,xe,we)=>{const D=!Y.current&&!we;(k.value!==void 0&&k.value===xe||D)&&ae(G)},[k.value]),K=o==="popper"?nu:ag,de=K===nu?{side:f,sideOffset:g,align:y,alignOffset:x,arrowPadding:v,collisionBoundary:C,collisionPadding:E,sticky:P,hideWhenDetached:w,avoidCollisions:b}:{};return e.jsx(rg,{scope:l,content:j,viewport:W,onViewportChange:U,itemRefCallback:O,selectedItem:R,onItemLeave:L,itemTextRefCallback:X,focusSelectedItem:ve,selectedItemText:re,position:o,isPositioned:ee,searchRef:H,children:e.jsx(Su,{as:US,allowPinchZoom:!0,children:e.jsx(Nu,{asChild:!0,trapped:k.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:Ke(c,G=>{var xe;(xe=k.trigger)==null||xe.focus({preventScroll:!0}),G.preventDefault()}),children:e.jsx(bu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:e.jsx(K,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:G=>G.preventDefault(),...N,...de,onPlaced:()=>te(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Ke(N.onKeyDown,G=>{const xe=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!xe&&G.key.length===1&&A(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let D=oe().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);if(["ArrowUp","End"].includes(G.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const ue=G.target,Se=D.indexOf(ue);D=D.slice(Se+1)}setTimeout(()=>ne(D)),G.preventDefault()}})})})})})})});ng.displayName=BS;var VS="SelectItemAlignedPosition",ag=h.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=r,u=gn(Un,l),m=yn(Un,l),[f,g]=h.useState(null),[y,x]=h.useState(null),v=lt(a,_=>x(_)),C=Mo(l),E=h.useRef(!1),P=h.useRef(!0),{viewport:w,selectedItem:b,selectedItemText:N,focusSelectedItem:k}=m,j=h.useCallback(()=>{if(u.trigger&&u.valueNode&&f&&y&&w&&b&&N){const _=u.trigger.getBoundingClientRect(),R=y.getBoundingClientRect(),T=u.valueNode.getBoundingClientRect(),re=N.getBoundingClientRect();if(u.dir!=="rtl"){const ue=re.left-R.left,Se=T.left-ue,Ie=_.left-Se,Ue=_.width+Ie,Ze=Math.max(Ue,R.width),et=window.innerWidth-Ws,tt=ho(Se,[Ws,Math.max(Ws,et-Ze)]);f.style.minWidth=Ue+"px",f.style.left=tt+"px"}else{const ue=R.right-re.right,Se=window.innerWidth-T.right-ue,Ie=window.innerWidth-_.right-Se,Ue=_.width+Ie,Ze=Math.max(Ue,R.width),et=window.innerWidth-Ws,tt=ho(Se,[Ws,Math.max(Ws,et-Ze)]);f.style.minWidth=Ue+"px",f.style.right=tt+"px"}const ae=C(),oe=window.innerHeight-Ws*2,ee=w.scrollHeight,te=window.getComputedStyle(y),Y=parseInt(te.borderTopWidth,10),ne=parseInt(te.paddingTop,10),ve=parseInt(te.borderBottomWidth,10),$=parseInt(te.paddingBottom,10),ce=Y+ne+ee+$+ve,H=Math.min(b.offsetHeight*5,ce),A=window.getComputedStyle(w),O=parseInt(A.paddingTop,10),L=parseInt(A.paddingBottom,10),X=_.top+_.height/2-Ws,K=oe-X,de=b.offsetHeight/2,G=b.offsetTop+de,xe=Y+ne+G,we=ce-xe;if(xe<=X){const ue=ae.length>0&&b===ae[ae.length-1].ref.current;f.style.bottom="0px";const Se=y.clientHeight-w.offsetTop-w.offsetHeight,Ie=Math.max(K,de+(ue?L:0)+Se+ve),Ue=xe+Ie;f.style.height=Ue+"px"}else{const ue=ae.length>0&&b===ae[0].ref.current;f.style.top="0px";const Ie=Math.max(X,Y+w.offsetTop+(ue?O:0)+de)+we;f.style.height=Ie+"px",w.scrollTop=xe-X+w.offsetTop}f.style.margin=`${Ws}px 0`,f.style.minHeight=H+"px",f.style.maxHeight=oe+"px",o==null||o(),requestAnimationFrame(()=>E.current=!0)}},[C,u.trigger,u.valueNode,f,y,w,b,N,u.dir,o]);ts(()=>j(),[j]);const[I,W]=h.useState();ts(()=>{y&&W(window.getComputedStyle(y).zIndex)},[y]);const U=h.useCallback(_=>{_&&P.current===!0&&(j(),k==null||k(),P.current=!1)},[j,k]);return e.jsx(HS,{scope:l,contentWrapper:f,shouldExpandOnScrollRef:E,onScrollButtonChange:U,children:e.jsx("div",{ref:g,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:e.jsx(qe.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});ag.displayName=VS;var WS="SelectPopperPosition",nu=h.forwardRef((r,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=Ws,...u}=r,m=Ao(l);return e.jsx(TS,{...m,...u,ref:a,align:o,collisionPadding:c,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nu.displayName=WS;var[HS,Uu]=Ua(Un,{}),au="SelectViewport",lg=h.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:o,...c}=r,u=yn(au,l),m=Uu(au,l),f=lt(a,u.onViewportChange),g=h.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),e.jsx(_o.Slot,{scope:l,children:e.jsx(qe.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Ke(c.onScroll,y=>{const x=y.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:C}=m;if(C!=null&&C.current&&v){const E=Math.abs(g.current-x.scrollTop);if(E>0){const P=window.innerHeight-Ws*2,w=parseFloat(v.style.minHeight),b=parseFloat(v.style.height),N=Math.max(w,b);if(N0?I:0,v.style.justifyContent="flex-end")}}}g.current=x.scrollTop})})})]})});lg.displayName=au;var ig="SelectGroup",[KS,YS]=Ua(ig),GS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=cn();return e.jsx(KS,{scope:l,id:c,children:e.jsx(qe.div,{role:"group","aria-labelledby":c,...o,ref:a})})});GS.displayName=ig;var og="SelectLabel",QS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=YS(og,l);return e.jsx(qe.div,{id:c.id,...o,ref:a})});QS.displayName=og;var go="SelectItem",[qS,cg]=Ua(go),dg=h.forwardRef((r,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:u,...m}=r,f=gn(go,l),g=yn(go,l),y=f.value===o,[x,v]=h.useState(u??""),[C,E]=h.useState(!1),P=lt(a,k=>{var j;return(j=g.itemRefCallback)==null?void 0:j.call(g,k,o,c)}),w=cn(),b=h.useRef("touch"),N=()=>{c||(f.onValueChange(o),f.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(qS,{scope:l,value:o,disabled:c,textId:w,isSelected:y,onItemTextChange:h.useCallback(k=>{v(j=>j||((k==null?void 0:k.textContent)??"").trim())},[]),children:e.jsx(_o.ItemSlot,{scope:l,value:o,disabled:c,textValue:x,children:e.jsx(qe.div,{role:"option","aria-labelledby":w,"data-highlighted":C?"":void 0,"aria-selected":y&&C,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...m,ref:P,onFocus:Ke(m.onFocus,()=>E(!0)),onBlur:Ke(m.onBlur,()=>E(!1)),onClick:Ke(m.onClick,()=>{b.current!=="mouse"&&N()}),onPointerUp:Ke(m.onPointerUp,()=>{b.current==="mouse"&&N()}),onPointerDown:Ke(m.onPointerDown,k=>{b.current=k.pointerType}),onPointerMove:Ke(m.onPointerMove,k=>{var j;b.current=k.pointerType,c?(j=g.onItemLeave)==null||j.call(g):b.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ke(m.onPointerLeave,k=>{var j;k.currentTarget===document.activeElement&&((j=g.onItemLeave)==null||j.call(g))}),onKeyDown:Ke(m.onKeyDown,k=>{var I;((I=g.searchRef)==null?void 0:I.current)!==""&&k.key===" "||(AS.includes(k.key)&&N(),k.key===" "&&k.preventDefault())})})})})});dg.displayName=go;var kl="SelectItemText",ug=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,...u}=r,m=gn(kl,l),f=yn(kl,l),g=cg(kl,l),y=FS(kl,l),[x,v]=h.useState(null),C=lt(a,N=>v(N),g.onItemTextChange,N=>{var k;return(k=f.itemTextRefCallback)==null?void 0:k.call(f,N,g.value,g.disabled)}),E=x==null?void 0:x.textContent,P=h.useMemo(()=>e.jsx("option",{value:g.value,disabled:g.disabled,children:E},g.value),[g.disabled,g.value,E]),{onNativeOptionAdd:w,onNativeOptionRemove:b}=y;return ts(()=>(w(P),()=>b(P)),[w,b,P]),e.jsxs(e.Fragment,{children:[e.jsx(qe.span,{id:g.textId,...u,ref:C}),g.isSelected&&m.valueNode&&!m.valueNodeHasChildren?Il.createPortal(u.children,m.valueNode):null]})});ug.displayName=kl;var hg="SelectItemIndicator",mg=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return cg(hg,l).isSelected?e.jsx(qe.span,{"aria-hidden":!0,...o,ref:a}):null});mg.displayName=hg;var lu="SelectScrollUpButton",fg=h.forwardRef((r,a)=>{const l=yn(lu,r.__scopeSelect),o=Uu(lu,r.__scopeSelect),[c,u]=h.useState(!1),m=lt(a,o.onScrollButtonChange);return ts(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=g.scrollTop>0;u(y)};const g=l.viewport;return f(),g.addEventListener("scroll",f),()=>g.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(pg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:g}=l;f&&g&&(f.scrollTop=f.scrollTop-g.offsetHeight)}}):null});fg.displayName=lu;var iu="SelectScrollDownButton",xg=h.forwardRef((r,a)=>{const l=yn(iu,r.__scopeSelect),o=Uu(iu,r.__scopeSelect),[c,u]=h.useState(!1),m=lt(a,o.onScrollButtonChange);return ts(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=g.scrollHeight-g.clientHeight,x=Math.ceil(g.scrollTop)g.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(pg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:g}=l;f&&g&&(f.scrollTop=f.scrollTop+g.offsetHeight)}}):null});xg.displayName=iu;var pg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=r,u=yn("SelectScrollButton",l),m=h.useRef(null),f=Mo(l),g=h.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return h.useEffect(()=>()=>g(),[g]),ts(()=>{var x;const y=f().find(v=>v.ref.current===document.activeElement);(x=y==null?void 0:y.ref.current)==null||x.scrollIntoView({block:"nearest"})},[f]),e.jsx(qe.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Ke(c.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(o,50))}),onPointerMove:Ke(c.onPointerMove,()=>{var y;(y=u.onItemLeave)==null||y.call(u),m.current===null&&(m.current=window.setInterval(o,50))}),onPointerLeave:Ke(c.onPointerLeave,()=>{g()})})}),XS="SelectSeparator",JS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return e.jsx(qe.div,{"aria-hidden":!0,...o,ref:a})});JS.displayName=XS;var ou="SelectArrow",ZS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=Ao(l),u=gn(ou,l),m=yn(ou,l);return u.open&&m.position==="popper"?e.jsx(RS,{...c,...o,ref:a}):null});ZS.displayName=ou;var eC="SelectBubbleInput",gg=h.forwardRef(({__scopeSelect:r,value:a,...l},o)=>{const c=h.useRef(null),u=lt(o,c),m=Iu(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const g=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(g,"value").set;if(m!==a&&x){const v=new Event("change",{bubbles:!0});x.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(qe.select,{...l,style:{...G0,...l.style},ref:u,defaultValue:a})});gg.displayName=eC;function yg(r){return r===""||r===void 0}function vg(r){const a=un(r),l=h.useRef(""),o=h.useRef(0),c=h.useCallback(m=>{const f=l.current+m;a(f),(function g(y){l.current=y,window.clearTimeout(o.current),y!==""&&(o.current=window.setTimeout(()=>g(""),1e3))})(f)},[a]),u=h.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,u]}function jg(r,a,l){const c=a.length>1&&Array.from(a).every(y=>y===a[0])?a[0]:a,u=l?r.indexOf(l):-1;let m=tC(r,Math.max(u,0));c.length===1&&(m=m.filter(y=>y!==l));const g=m.find(y=>y.textValue.toLowerCase().startsWith(c.toLowerCase()));return g!==l?g:void 0}function tC(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var sC=Q0,bg=X0,rC=Z0,nC=eg,aC=tg,Ng=sg,lC=lg,wg=dg,iC=ug,oC=mg,cC=fg,dC=xg;const Sl=sC,Cl=rC,Na=h.forwardRef(({className:r,children:a,...l},o)=>e.jsxs(bg,{ref:o,className:it("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",r),...l,children:[a,e.jsx(nC,{asChild:!0,children:e.jsx(Ta,{className:"h-4 w-4 opacity-50"})})]}));Na.displayName=bg.displayName;const wa=h.forwardRef(({className:r,children:a,position:l="popper",...o},c)=>e.jsx(aC,{children:e.jsxs(Ng,{ref:c,className:it("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",l==="popper"&&"data-[side=bottom]:translate-y-1",r),position:l,...o,children:[e.jsx(cC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(xu,{className:"h-4 w-4"})}),e.jsx(lC,{className:"p-1",children:a}),e.jsx(dC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Ta,{className:"h-4 w-4"})})]})}));wa.displayName=Ng.displayName;const nr=h.forwardRef(({className:r,children:a,...l},o)=>e.jsxs(wg,{ref:o,className:it("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...l,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(oC,{children:e.jsx(jo,{className:"h-4 w-4"})})}),e.jsx(iC,{children:a})]}));nr.displayName=wg.displayName;const uC=["一","二","三","四","五","六","七","八","九","十"];function Fd(r){return r.startsWith("part:")?{type:"part",id:r.slice(5)}:r.startsWith("chapter:")?{type:"chapter",id:r.slice(8)}:r.startsWith("section:")?{type:"section",id:r.slice(8)}:null}function hC({parts:r,expandedParts:a,onTogglePart:l,onReorder:o,onReadSection:c,onDeleteSection:u,onAddSectionInPart:m,onAddChapterInPart:f,onDeleteChapter:g,onEditPart:y,onDeletePart:x,onEditChapter:v,selectedSectionIds:C=[],onToggleSectionSelect:E,onShowSectionOrders:P}){const[w,b]=h.useState(null),[N,k]=h.useState(null),j=(T,re)=>(w==null?void 0:w.type)===T&&(w==null?void 0:w.id)===re,I=(T,re)=>(N==null?void 0:N.type)===T&&(N==null?void 0:N.id)===re,W=h.useCallback(()=>{const T=[];for(const re of r)for(const ae of re.chapters)for(const oe of ae.sections)T.push({id:oe.id,partId:re.id,partTitle:re.title,chapterId:ae.id,chapterTitle:ae.title});return T},[r]),U=h.useCallback(async(T,re,ae,oe)=>{var ve;T.preventDefault(),T.stopPropagation();const ee=T.dataTransfer.getData("text/plain"),te=Fd(ee);if(!te||te.type===re&&te.id===ae)return;const Y=W(),ne=new Map(Y.map($=>[$.id,$]));if(te.type==="part"&&re==="part"){const $=r.map(L=>L.id),ce=$.indexOf(te.id),H=$.indexOf(ae);if(ce===-1||H===-1)return;const A=[...$];A.splice(ce,1),A.splice(ceK.id===L);if(X)for(const K of X.chapters)for(const de of K.sections){const G=ne.get(de.id);G&&O.push(G)}}await o(O);return}if(te.type==="chapter"&&(re==="chapter"||re==="section"||re==="part")){const $=r.find(G=>G.chapters.some(xe=>xe.id===te.id)),ce=$==null?void 0:$.chapters.find(G=>G.id===te.id);if(!$||!ce)return;let H,A,O=null;if(re==="section"){const G=ne.get(ae);if(!G)return;H=G.partId,A=G.partTitle,O=ae}else if(re==="chapter"){const G=r.find(D=>D.chapters.some(ue=>ue.id===ae)),xe=G==null?void 0:G.chapters.find(D=>D.id===ae);if(!G||!xe)return;H=G.id,A=G.title;const we=Y.filter(D=>D.chapterId===ae).pop();O=(we==null?void 0:we.id)??null}else{const G=r.find(we=>we.id===ae);if(!G||!G.chapters[0])return;H=G.id,A=G.title;const xe=Y.filter(we=>we.partId===G.id&&we.chapterId===G.chapters[0].id);O=((ve=xe[xe.length-1])==null?void 0:ve.id)??null}const L=ce.sections.map(G=>G.id),X=Y.filter(G=>!L.includes(G.id));let K=X.length;if(O){const G=X.findIndex(xe=>xe.id===O);G>=0&&(K=G+1)}const de=L.map(G=>({...ne.get(G),partId:H,partTitle:A,chapterId:ce.id,chapterTitle:ce.title}));await o([...X.slice(0,K),...de,...X.slice(K)]);return}if(te.type==="section"&&(re==="section"||re==="chapter"||re==="part")){if(!oe)return;const{partId:$,partTitle:ce,chapterId:H,chapterTitle:A}=oe;let O;if(re==="section")O=Y.findIndex(xe=>xe.id===ae);else if(re==="chapter"){const xe=Y.filter(we=>we.chapterId===ae).pop();O=xe?Y.findIndex(we=>we.id===xe.id)+1:Y.length}else{const xe=r.find(ue=>ue.id===ae);if(!(xe!=null&&xe.chapters[0]))return;const we=Y.filter(ue=>ue.partId===xe.id&&ue.chapterId===xe.chapters[0].id),D=we[we.length-1];O=D?Y.findIndex(ue=>ue.id===D.id)+1:0}const L=Y.findIndex(xe=>xe.id===te.id);if(L===-1)return;const X=Y.filter(xe=>xe.id!==te.id),K=L({onDragEnter:oe=>{oe.preventDefault(),oe.stopPropagation(),oe.dataTransfer.dropEffect="move",k({type:T,id:re})},onDragOver:oe=>{oe.preventDefault(),oe.stopPropagation(),oe.dataTransfer.dropEffect="move",k({type:T,id:re})},onDragLeave:()=>k(null),onDrop:oe=>{k(null);const ee=Fd(oe.dataTransfer.getData("text/plain"));if(ee&&!(T==="section"&&ee.type==="section"&&ee.id===re))if(T==="part")if(ee.type==="part")U(oe,"part",re);else{const te=r.find(ne=>ne.id===re);(te==null?void 0:te.chapters[0])&&ae&&U(oe,"part",re,ae)}else T==="chapter"&&ae?(ee.type==="section"||ee.type==="chapter")&&U(oe,"chapter",re,ae):T==="section"&&ae&&U(oe,"section",re,ae)}}),R=T=>uC[T]??String(T+1);return e.jsx("div",{className:"space-y-3",children:r.map((T,re)=>{var ce,H,A,O;const ae=T.title==="序言"||T.title.includes("序言"),oe=T.title==="尾声"||T.title.includes("尾声"),ee=T.title==="附录"||T.title.includes("附录"),te=I("part",T.id),Y=a.includes(T.id),ne=T.chapters.length,ve=T.chapters.reduce((L,X)=>L+X.sections.length,0);if(ae&&T.chapters.length===1&&T.chapters[0].sections.length===1){const L=T.chapters[0].sections[0],X=I("section",L.id),K={partId:T.id,partTitle:T.title,chapterId:T.chapters[0].id,chapterTitle:T.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+L.id),de.dataTransfer.effectAllowed="move",b({type:"section",id:L.id})},onDragEnd:()=>{b(null),k(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,..._("section",L.id,K),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(Nr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),E&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:de=>de.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(L.id),onChange:()=>E(L.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(Ks,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[T.chapters[0].title," | ",L.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[L.price===0||L.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",L.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",L.clickCount??0," · 付款 ",L.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(L.hotScore??0).toFixed(1)," · 第",L.hotRank&&L.hotRank>0?L.hotRank:"-","名"]}),P&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>P(L),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(L),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]}),e.jsx(en,{className:"w-4 h-4 text-gray-500"})]})]},T.id)}if(T.title==="2026每日派对干货"||T.title.includes("2026每日派对干货")){const L=I("part",T.id);return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-all duration-200 ${L?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50 bg-[#1C1C1E]"}`,..._("part",T.id,{partId:T.id,partTitle:T.title,chapterId:((ce=T.chapters[0])==null?void 0:ce.id)??"",chapterTitle:((H=T.chapters[0])==null?void 0:H.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:X=>{X.stopPropagation(),X.dataTransfer.setData("text/plain","part:"+T.id),X.dataTransfer.effectAllowed="move",b({type:"part",id:T.id})},onDragEnd:()=>{b(null),k(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",T.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/50"}`,onClick:()=>l(T.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(Nr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),e.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac]/80 flex items-center justify-center text-white font-bold shrink-0",children:"派"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:T.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",ve," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:X=>X.stopPropagation(),onClick:X=>X.stopPropagation(),children:[m&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(T),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(T),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),x&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>x(T),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ne,"章"]}),Y?e.jsx(Ta,{className:"w-5 h-5 text-gray-500"}):e.jsx(en,{className:"w-5 h-5 text-gray-500"})]})]}),Y&&T.chapters.length>0&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:T.chapters.map(X=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:X.title}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:K=>K.stopPropagation(),children:[v&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>v(T,X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),f&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>f(T),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>g(T,X),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:X.sections.map(K=>{const de=I("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:G=>{G.stopPropagation(),G.dataTransfer.setData("text/plain","section:"+K.id),G.dataTransfer.effectAllowed="move",b({type:"section",id:K.id})},onDragEnd:()=>{b(null),k(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg min-h-[40px] cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,..._("section",K.id,{partId:T.id,partTitle:T.title,chapterId:X.id,chapterTitle:X.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),E&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:G=>G.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(K.id),onChange:()=>E(K.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[K.id," ",K.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",K.clickCount??0," · 付款 ",K.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(K.hotScore??0).toFixed(1)," · 第",K.hotRank&&K.hotRank>0?K.hotRank:"-","名"]}),P&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>P(K),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(K),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]},K.id)})})]},X.id))})]},T.id)}if(ee)return e.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"附录"}),e.jsx("div",{className:"space-y-3",children:T.chapters.map((L,X)=>L.sections.length>0?L.sections.map(K=>{const de=I("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:G=>{G.stopPropagation(),G.dataTransfer.setData("text/plain","section:"+K.id),G.dataTransfer.effectAllowed="move",b({type:"section",id:K.id})},onDragEnd:()=>{b(null),k(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 group cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,..._("section",K.id,{partId:T.id,partTitle:T.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),E&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:G=>G.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(K.id),onChange:()=>E(K.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300 truncate",children:["附录",X+1," | ",L.title," | ",K.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",K.clickCount??0," · 付款 ",K.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(K.hotScore??0).toFixed(1)," · 第",K.hotRank&&K.hotRank>0?K.hotRank:"-","名"]}),P&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>P(K),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>u(K),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(en,{className:"w-4 h-4 text-gray-500 shrink-0"})]},K.id)}):e.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2",children:[e.jsxs("span",{className:"text-sm text-gray-500",children:["附录",X+1," | ",L.title,"(空)"]}),e.jsx(en,{className:"w-4 h-4 text-gray-500 shrink-0"})]},L.id))})]},T.id);if(oe&&T.chapters.length===1&&T.chapters[0].sections.length===1){const L=T.chapters[0].sections[0],X=I("section",L.id),K={partId:T.id,partTitle:T.title,chapterId:T.chapters[0].id,chapterTitle:T.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+L.id),de.dataTransfer.effectAllowed="move",b({type:"section",id:L.id})},onDragEnd:()=>{b(null),k(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,..._("section",L.id,K),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(Nr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),E&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:de=>de.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(L.id),onChange:()=>E(L.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(Ks,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[T.chapters[0].title," | ",L.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[L.price===0||L.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",L.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",L.clickCount??0," · 付款 ",L.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(L.hotScore??0).toFixed(1)," · 第",L.hotRank&&L.hotRank>0?L.hotRank:"-","名"]}),P&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>P(L),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(L),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]}),e.jsx(en,{className:"w-4 h-4 text-gray-500"})]})]},T.id)}return oe?e.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"尾声"}),e.jsx("div",{className:"space-y-3",children:T.chapters.map(L=>L.sections.map(X=>{const K=I("section",X.id);return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+X.id),de.dataTransfer.effectAllowed="move",b({type:"section",id:X.id})},onDragEnd:()=>{b(null),k(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${K?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",X.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,..._("section",X.id,{partId:T.id,partTitle:T.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),E&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:de=>de.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(X.id),onChange:()=>E(X.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300",children:[L.title," | ",X.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",X.clickCount??0," · 付款 ",X.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(X.hotScore??0).toFixed(1)," · 第",X.hotRank&&X.hotRank>0?X.hotRank:"-","名"]}),P&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>P(X),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(X),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]})]},X.id)}))})]},T.id):e.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${te?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,..._("part",T.id,{partId:T.id,partTitle:T.title,chapterId:((A=T.chapters[0])==null?void 0:A.id)??"",chapterTitle:((O=T.chapters[0])==null?void 0:O.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:L=>{L.stopPropagation(),L.dataTransfer.setData("text/plain","part:"+T.id),L.dataTransfer.effectAllowed="move",b({type:"part",id:T.id})},onDragEnd:()=>{b(null),k(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",T.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(T.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(Nr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),e.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac] flex items-center justify-center text-white font-bold shadow-lg shadow-[#38bdac]/30 shrink-0",children:R(re)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:T.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",ve," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:L=>L.stopPropagation(),onClick:L=>L.stopPropagation(),children:[m&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(T),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(T),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),x&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>x(T),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ne,"章"]}),Y?e.jsx(Ta,{className:"w-5 h-5 text-gray-500"}):e.jsx(en,{className:"w-5 h-5 text-gray-500"})]})]}),Y&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:T.chapters.map(L=>{const X=I("chapter",L.id);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","chapter:"+L.id),K.dataTransfer.effectAllowed="move",b({type:"chapter",id:L.id})},onDragEnd:()=>{b(null),k(null)},onDragEnter:K=>{K.preventDefault(),K.stopPropagation(),K.dataTransfer.dropEffect="move",k({type:"chapter",id:L.id})},onDragOver:K=>{K.preventDefault(),K.stopPropagation(),K.dataTransfer.dropEffect="move",k({type:"chapter",id:L.id})},onDragLeave:()=>k(null),onDrop:K=>{k(null);const de=Fd(K.dataTransfer.getData("text/plain"));if(!de)return;const G={partId:T.id,partTitle:T.title,chapterId:L.id,chapterTitle:L.title};(de.type==="section"||de.type==="chapter")&&U(K,"chapter",L.id,G)},className:`flex-1 min-w-0 py-2 px-2 rounded cursor-grab active:cursor-grabbing select-none -mx-2 transition-all duration-200 flex items-center gap-2 ${X?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${j("chapter",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:L.title})]}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:K=>K.stopPropagation(),children:[v&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>v(T,L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),f&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>f(T),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>g(T,L),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:L.sections.map(K=>{const de=I("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:G=>{G.stopPropagation(),G.dataTransfer.setData("text/plain","section:"+K.id),G.dataTransfer.effectAllowed="move",b({type:"section",id:K.id})},onDragEnd:()=>{b(null),k(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg group cursor-grab active:cursor-grabbing select-none min-h-[40px] transition-all duration-200 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,..._("section",K.id,{partId:T.id,partTitle:T.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[E&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:G=>G.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(K.id),onChange:()=>E(K.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${K.price===0||K.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[K.id," ",K.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:G=>G.stopPropagation(),onClick:G=>G.stopPropagation(),children:[K.isNew&&e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),K.price===0||K.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",K.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",title:"点击次数 · 付款笔数",children:["点击 ",K.clickCount??0," · 付款 ",K.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(K.hotScore??0).toFixed(1)," · 第",K.hotRank&&K.hotRank>0?K.hotRank:"-","名"]}),P&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>P(K),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5 shrink-0",children:"付款记录"}),e.jsxs("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(K),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]}),e.jsx(en,{className:"w-4 h-4 text-gray-500"})]})]},K.id)})})]},L.id)})})]},T.id)})})}function mC(r){const a=new Map;for(const f of r){const g=f.partId||"part-1",y=f.partTitle||"未分类",x=f.chapterId||"chapter-1",v=f.chapterTitle||"未分类";a.has(g)||a.set(g,{id:g,title:y,chapters:new Map});const C=a.get(g);C.chapters.has(x)||C.chapters.set(x,{id:x,title:v,sections:[]}),C.chapters.get(x).sections.push({id:f.id,title:f.title,price:f.price??1,filePath:f.filePath,isFree:f.isFree,isNew:f.isNew,clickCount:f.clickCount??0,payCount:f.payCount??0,hotScore:f.hotScore??0,hotRank:f.hotRank??0})}const l="part-2026-daily",o="2026每日派对干货";Array.from(a.values()).some(f=>f.title===o||f.title.includes(o))||a.set(l,{id:l,title:o,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:o,sections:[]}]])});const u=Array.from(a.values()).map(f=>({...f,chapters:Array.from(f.chapters.values())})),m=f=>f.includes("序言")?0:f.includes(o)?1.5:f.includes("附录")?2:f.includes("尾声")?3:1;return u.sort((f,g)=>{const y=m(f.title),x=m(g.title);return y!==x?y-x:0})}function fC(){var Js,Qn,ys;const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState([]),[m,f]=h.useState(null),[g,y]=h.useState(!1),[x,v]=h.useState(!1),[C,E]=h.useState(!1),[P,w]=h.useState(""),[b,N]=h.useState([]),[k,j]=h.useState(!1),[I,W]=h.useState(!1),U=h.useRef(null),[_,R]=h.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[T,re]=h.useState(null),[ae,oe]=h.useState(!1),[ee,te]=h.useState(!1),[Y,ne]=h.useState(null),[ve,$]=h.useState(!1),[ce,H]=h.useState([]),[A,O]=h.useState(!1),[L,X]=h.useState(""),[K,de]=h.useState(""),[G,xe]=h.useState(!1),[we,D]=h.useState(""),[ue,Se]=h.useState(!1),[Ie,Ue]=h.useState(null),[Ze,et]=h.useState(!1),[tt,pe]=h.useState(!1),[fe,ot]=h.useState({readWeight:.5,recencyWeight:.3,payWeight:.2}),[ss,dr]=h.useState(!1),[Ht,Cs]=h.useState(!1),Kt=mC(r),vn=r.length,Mt=async()=>{o(!0);try{const F=await Be("/api/db/book?action=list",{cache:"no-store"});a(Array.isArray(F==null?void 0:F.sections)?F.sections:[])}catch(F){console.error(F),a([])}finally{o(!1)}};h.useEffect(()=>{Mt()},[]);const ur=F=>{u(le=>le.includes(F)?le.filter(Ne=>Ne!==F):[...le,F])},Vn=h.useCallback(F=>{const le=r,Ne=F.flatMap(Te=>{const ut=le.find(rs=>rs.id===Te.id);return ut?[{...ut,partId:Te.partId,partTitle:Te.partTitle,chapterId:Te.chapterId,chapterTitle:Te.chapterTitle}]:[]});return a(Ne),gt("/api/db/book",{action:"reorder",items:F}).then(Te=>{Te&&Te.success===!1&&(a(le),alert("排序失败: "+(Te&&typeof Te=="object"&&"error"in Te?Te.error:"未知错误")))}).catch(Te=>{a(le),console.error("排序失败:",Te),alert("排序失败: "+(Te instanceof Error?Te.message:"网络或服务异常"))}),Promise.resolve()},[r]),ls=async F=>{if(confirm(`确定要删除章节「${F.title}」吗?此操作不可恢复。`))try{const le=await kr(`/api/db/book?id=${encodeURIComponent(F.id)}`);le&&le.success!==!1?(alert("已删除"),Mt()):alert("删除失败: "+(le&&typeof le=="object"&&"error"in le?le.error:"未知错误"))}catch(le){console.error(le),alert("删除失败")}},ks=h.useCallback(async()=>{dr(!0);try{const F=await Be("/api/db/config/full?key=article_ranking_weights",{cache:"no-store"}),le=F&&F.data;le&&typeof le.readWeight=="number"&&typeof le.recencyWeight=="number"&&typeof le.payWeight=="number"&&ot({readWeight:Math.max(0,Math.min(1,le.readWeight)),recencyWeight:Math.max(0,Math.min(1,le.recencyWeight)),payWeight:Math.max(0,Math.min(1,le.payWeight))})}catch{}finally{dr(!1)}},[]);h.useEffect(()=>{tt&&ks()},[tt,ks]);const jn=async()=>{const{readWeight:F,recencyWeight:le,payWeight:Ne}=fe,Te=F+le+Ne;if(Math.abs(Te-1)>.001){alert("三个权重之和必须等于 1");return}Cs(!0);try{const ut=await yt("/api/db/config",{key:"article_ranking_weights",value:{readWeight:F,recencyWeight:le,payWeight:Ne},description:"文章排名算法权重"});ut&&ut.success!==!1?(alert("已保存"),Mt()):alert("保存失败: "+(ut&&typeof ut=="object"&&"error"in ut?ut.error:""))}catch(ut){console.error(ut),alert("保存失败")}finally{Cs(!1)}},Es=async F=>{Ue({section:F,orders:[]}),et(!0);try{const le=await Be(`/api/db/book?action=section-orders&id=${encodeURIComponent(F.id)}`),Ne=le!=null&&le.success&&Array.isArray(le.orders)?le.orders:[];Ue(Te=>Te?{...Te,orders:Ne}:null)}catch(le){console.error(le),Ue(Ne=>Ne?{...Ne,orders:[]}:null)}finally{et(!1)}},Ls=async F=>{v(!0);try{const le=await Be(`/api/db/book?action=read&id=${encodeURIComponent(F.id)}`);if(le!=null&&le.success&&le.section){const Ne=le.section;f({id:F.id,title:le.section.title??F.title,price:le.section.price??F.price,content:le.section.content??"",filePath:F.filePath,isFree:F.isFree||F.price===0,isNew:Ne.isNew??F.isNew})}else f({id:F.id,title:F.title,price:F.price,content:"",filePath:F.filePath,isFree:F.isFree,isNew:F.isNew}),le&&!le.success&&alert("无法读取文件内容: "+(le.error||"未知错误"))}catch(le){console.error(le),f({id:F.id,title:F.title,price:F.price,content:"",filePath:F.filePath,isFree:F.isFree})}finally{v(!1)}},hr=async()=>{var F;if(m){E(!0);try{let le=m.content||"";const Ne=[new RegExp(`^#+\\s*${m.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${m.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(F=m.title)==null?void 0:F.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const ut of Ne)le=le.replace(ut,"");le=le.replace(/^\s*\n+/,"").trim();const Te=await gt("/api/db/book",{id:m.id,title:m.title,price:m.isFree?0:m.price,content:le,isFree:m.isFree||m.price===0,isNew:m.isNew,saveToFile:!0});Te&&Te.success!==!1?(alert(`已保存章节: ${m.title}`),f(null),Mt()):alert("保存失败: "+(Te&&typeof Te=="object"&&"error"in Te?Te.error:"未知错误"))}catch(le){console.error(le),alert("保存失败")}finally{E(!1)}}},bn=async()=>{if(!_.id||!_.title){alert("请填写章节ID和标题");return}E(!0);try{const F=await gt("/api/db/book",{id:_.id,title:_.title,price:_.price,content:_.content,partId:_.partId,chapterId:_.chapterId,saveToFile:!1});F&&F.success!==!1?(alert(`章节创建成功: ${_.title}`),y(!1),R({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),Mt()):alert("创建失败: "+(F&&typeof F=="object"&&"error"in F?F.error:"未知错误"))}catch(F){console.error(F),alert("创建失败")}finally{E(!1)}},mr=F=>{R(le=>{var Ne;return{...le,partId:F.id,chapterId:((Ne=F.chapters[0])==null?void 0:Ne.id)??"chapter-1"}}),y(!0)},Rr=F=>{re({id:F.id,title:F.title})},Ps=async()=>{var F;if((F=T==null?void 0:T.title)!=null&&F.trim()){oe(!0);try{const le=r.map(Te=>({id:Te.id,partId:Te.partId||"part-1",partTitle:Te.partId===T.id?T.title.trim():Te.partTitle||"",chapterId:Te.chapterId||"chapter-1",chapterTitle:Te.chapterTitle||""})),Ne=await gt("/api/db/book",{action:"reorder",items:le});Ne&&Ne.success!==!1?(re(null),Mt()):alert("更新篇名失败: "+(Ne&&typeof Ne=="object"&&"error"in Ne?Ne.error:"未知错误"))}catch(le){console.error(le),alert("更新篇名失败")}finally{oe(!1)}}},Nn=F=>{const le=F.chapters.length+1,Ne=`chapter-${F.id}-${le}-${Date.now()}`;R({id:`${le}.1`,title:"新章节",price:1,partId:F.id,chapterId:Ne,content:""}),y(!0)},qs=(F,le)=>{ne({part:F,chapter:le,title:le.title})},Xs=async()=>{var F;if((F=Y==null?void 0:Y.title)!=null&&F.trim()){$(!0);try{const le=r.map(Te=>({id:Te.id,partId:Te.partId||Y.part.id,partTitle:Te.partId===Y.part.id?Y.part.title:Te.partTitle||"",chapterId:Te.chapterId||Y.chapter.id,chapterTitle:Te.partId===Y.part.id&&Te.chapterId===Y.chapter.id?Y.title.trim():Te.chapterTitle||""})),Ne=await gt("/api/db/book",{action:"reorder",items:le});Ne&&Ne.success!==!1?(ne(null),Mt()):alert("保存失败: "+(Ne&&typeof Ne=="object"&&"error"in Ne?Ne.error:"未知错误"))}catch(le){console.error(le),alert("保存失败")}finally{$(!1)}}},Wn=async(F,le)=>{const Ne=le.sections.map(Te=>Te.id);if(Ne.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${F.chapters.indexOf(le)+1}章 | ${le.title}」吗?将删除共 ${Ne.length} 节,此操作不可恢复。`))try{for(const Te of Ne)await kr(`/api/db/book?id=${encodeURIComponent(Te)}`);Mt()}catch(Te){console.error(Te),alert("删除失败")}},Hn=async()=>{if(!we.trim()){alert("请输入篇名");return}Se(!0);try{const F=`part-new-${Date.now()}`,le="chapter-1",Ne=`part-placeholder-${Date.now()}`,Te=await gt("/api/db/book",{id:Ne,title:"占位节(可编辑)",price:0,content:"",partId:F,partTitle:we.trim(),chapterId:le,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Te&&Te.success!==!1?(alert(`篇「${we}」创建成功,请编辑占位节`),te(!1),D(""),Mt()):alert("创建失败: "+(Te&&typeof Te=="object"&&"error"in Te?Te.error:"未知错误"))}catch(F){console.error(F),alert("创建失败")}finally{Se(!1)}},Kn=async()=>{if(ce.length===0){alert("请先勾选要移动的章节");return}const F=Kt.find(Ne=>Ne.id===L),le=F==null?void 0:F.chapters.find(Ne=>Ne.id===K);if(!F||!le||!L||!K){alert("请选择目标篇和章");return}xe(!0);try{const Ne=()=>{const at=new Set(ce),is=r.map(rt=>({id:rt.id,partId:rt.partId||"",partTitle:rt.partTitle||"",chapterId:rt.chapterId||"",chapterTitle:rt.chapterTitle||""})),B=is.filter(rt=>at.has(rt.id)).map(rt=>({...rt,partId:L,partTitle:F.title||L,chapterId:K,chapterTitle:le.title||K})),We=is.filter(rt=>!at.has(rt.id));let He=We.length;for(let rt=We.length-1;rt>=0;rt-=1){const Ts=We[rt];if(Ts.partId===L&&Ts.chapterId===K){He=rt+1;break}}return[...We.slice(0,He),...B,...We.slice(He)]},Te=async()=>{const at=Ne(),is=await gt("/api/db/book",{action:"reorder",items:at});return is&&is.success!==!1?(alert(`已移动 ${ce.length} 节到「${F.title}」-「${le.title}」`),O(!1),H([]),await Mt(),!0):!1},ut={action:"move-sections",sectionIds:ce,targetPartId:L,targetChapterId:K,targetPartTitle:F.title||L,targetChapterTitle:le.title||K},rs=await gt("/api/db/book",ut);if(rs&&rs.success!==!1)alert(`已移动 ${rs.count??ce.length} 节到「${F.title}」-「${le.title}」`),O(!1),H([]),await Mt();else{const at=rs&&typeof rs=="object"&&"error"in rs?rs.error||"":"未知错误";if((at.includes("缺少 id")||at.includes("无效的 action"))&&await Te())return;alert("移动失败: "+at)}}catch(Ne){console.error(Ne),alert("移动失败: "+(Ne instanceof Error?Ne.message:"网络或服务异常"))}finally{xe(!1)}},Yn=F=>{H(le=>le.includes(F)?le.filter(Ne=>Ne!==F):[...le,F])},Gn=async F=>{const le=r.filter(Ne=>Ne.partId===F.id).map(Ne=>Ne.id);if(le.length===0){alert("该篇下暂无小节可删除");return}if(confirm(`确定要删除「${F.title}」整篇吗?将删除共 ${le.length} 节内容,此操作不可恢复。`))try{for(const Ne of le)await kr(`/api/db/book?id=${encodeURIComponent(Ne)}`);Mt()}catch(Ne){console.error(Ne),alert("删除失败")}},Ir=async F=>{var Ne,Te;const le=(Ne=F.target.files)==null?void 0:Ne[0];if(le){W(!0);try{const ut=new FormData;ut.append("file",le),ut.append("folder","book-images");const at=await(await fetch(Ia("/api/upload"),{method:"POST",body:ut,credentials:"include"})).json();if(at!=null&&at.success&&((Te=at==null?void 0:at.data)!=null&&Te.url)){const is=`![${le.name}](${at.data.url})`;m&&f({...m,content:(m.content||"")+` + +`+is}),alert(`图片上传成功: ${at.data.url}`)}else alert("上传失败: "+((at==null?void 0:at.error)||"未知错误"))}catch(ut){console.error(ut),alert("上传失败")}finally{W(!1),U.current&&(U.current.value="")}}},wn=async()=>{var F;if(P.trim()){j(!0);try{const le=await Be(`/api/search?q=${encodeURIComponent(P)}`);le!=null&&le.success&&((F=le.data)!=null&&F.results)?N(le.data.results):(N([]),le&&!le.success&&alert("搜索失败: "+le.error))}catch(le){console.error(le),N([]),alert("搜索失败")}finally{j(!1)}}},qt=Kt.find(F=>F.id===_.partId),_r=(qt==null?void 0:qt.chapters)??[];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"内容管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",Kt.length," 篇 · ",vn," 节内容"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(q,{onClick:()=>pe(!0),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10 bg-transparent",children:[e.jsx(wd,{className:"w-4 h-4 mr-2"}),"排名算法"]}),e.jsxs(q,{onClick:()=>{const F=typeof window<"u"?`${window.location.origin}/api-doc`:"";F&&window.open(F,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ln,{className:"w-4 h-4 mr-2"}),"API 接口"]})]})]}),e.jsx(St,{open:g,onOpenChange:y,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Pt,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"章节ID *"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:_.id,onChange:F=>R({..._,id:F.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:_.price,onChange:F=>R({..._,price:Number(F.target.value)})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"章节标题 *"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:_.title,onChange:F=>R({..._,title:F.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"所属篇"}),e.jsxs(Sl,{value:_.partId,onValueChange:F=>R({..._,partId:F,chapterId:"chapter-1"}),children:[e.jsx(Na,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{})}),e.jsxs(wa,{className:"bg-[#0f2137] border-gray-700",children:[Kt.map(F=>e.jsx(nr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id)),Kt.length===0&&e.jsx(nr,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"所属章"}),e.jsxs(Sl,{value:_.chapterId,onValueChange:F=>R({..._,chapterId:F}),children:[e.jsx(Na,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{})}),e.jsxs(wa,{className:"bg-[#0f2137] border-gray-700",children:[_r.map(F=>e.jsx(nr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id)),_r.length===0&&e.jsx(nr,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsx(dn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:_.content,onChange:F=>R({..._,content:F.target.value})})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:bn,disabled:C||!_.id||!_.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),e.jsx(St,{open:!!T,onOpenChange:F=>!F&&re(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),T&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"篇名"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:T.title,onChange:F=>re({...T,title:F.target.value}),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>re(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Ps,disabled:ae||!((Js=T==null?void 0:T.title)!=null&&Js.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ae?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(St,{open:!!Y,onOpenChange:F=>!F&&ne(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节名称"]})}),Y&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"章节名称(如:第8章|底层结构)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:Y.title,onChange:F=>ne({...Y,title:F.target.value}),placeholder:"输入章节名称"})]})}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>ne(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Xs,disabled:ve||!((Qn=Y==null?void 0:Y.title)!=null&&Qn.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ve?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(St,{open:A,onOpenChange:F=>{var le;if(O(F),F&&Kt.length>0){const Ne=Kt[0];X(Ne.id),de(((le=Ne.chapters[0])==null?void 0:le.id)??"")}},children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:"批量移动至指定目录"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["已选 ",e.jsx("span",{className:"text-[#38bdac] font-medium",children:ce.length})," 节,请选择目标篇与章。"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"目标篇"}),e.jsxs(Sl,{value:L,onValueChange:F=>{var Ne;X(F);const le=Kt.find(Te=>Te.id===F);de(((Ne=le==null?void 0:le.chapters[0])==null?void 0:Ne.id)??"")},children:[e.jsx(Na,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{placeholder:"选择篇"})}),e.jsx(wa,{className:"bg-[#0f2137] border-gray-700",children:Kt.map(F=>e.jsx(nr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"目标章"}),e.jsxs(Sl,{value:K,onValueChange:de,children:[e.jsx(Na,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{placeholder:"选择章"})}),e.jsx(wa,{className:"bg-[#0f2137] border-gray-700",children:(((ys=Kt.find(F=>F.id===L))==null?void 0:ys.chapters)??[]).map(F=>e.jsx(nr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id))})]})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>O(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Kn,disabled:G||ce.length===0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:G?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"移动中..."]}):"确认移动"})]})]})}),e.jsx(St,{open:!!Ie,onOpenChange:F=>!F&&Ue(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white",children:["付款记录 — ",(Ie==null?void 0:Ie.section.title)??""]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:Ze?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):Ie&&Ie.orders.length===0?e.jsx("p",{className:"text-gray-500 text-center py-6",children:"暂无付款记录"}):Ie?e.jsxs("table",{className:"w-full text-sm border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"py-2 pr-2",children:"订单号"}),e.jsx("th",{className:"py-2 pr-2",children:"用户ID"}),e.jsx("th",{className:"py-2 pr-2",children:"金额"}),e.jsx("th",{className:"py-2 pr-2",children:"状态"}),e.jsx("th",{className:"py-2 pr-2",children:"支付时间"})]})}),e.jsx("tbody",{children:Ie.orders.map(F=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.orderSn??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.userId??F.openId??"-"}),e.jsxs("td",{className:"py-2 pr-2 text-gray-300",children:["¥",F.amount??0]}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.status??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-500",children:F.payTime??F.createdAt??"-"})]},F.id??F.orderSn??""))})]}):null})]})}),e.jsx(St,{open:tt,onOpenChange:pe,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(wd,{className:"w-5 h-5 text-amber-400"}),"文章排名算法"]})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsx("p",{className:"text-sm text-gray-400",children:"热度积分 = 阅读权重×阅读排名分 + 新度权重×新度排名分 + 付款权重×付款排名分(三权重之和须为 1)"}),ss?e.jsx("p",{className:"text-gray-500",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(Z,{className:"text-gray-400 text-xs",children:"阅读权重"}),e.jsx(ie,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:fe.readWeight,onChange:F=>ot(le=>({...le,readWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(Z,{className:"text-gray-400 text-xs",children:"新度权重"}),e.jsx(ie,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:fe.recencyWeight,onChange:F=>ot(le=>({...le,recencyWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(Z,{className:"text-gray-400 text-xs",children:"付款权重"}),e.jsx(ie,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:fe.payWeight,onChange:F=>ot(le=>({...le,payWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前之和: ",(fe.readWeight+fe.recencyWeight+fe.payWeight).toFixed(1)]}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-xs text-gray-400",children:[e.jsx("li",{children:"阅读量前 20 名:得分 20~1"}),e.jsx("li",{children:"最近更新前 30 篇:得分 30~1"}),e.jsx("li",{children:"付款数前 20 名:得分 20~1"})]}),e.jsx(q,{onClick:jn,disabled:Ht||Math.abs(fe.readWeight+fe.recencyWeight+fe.payWeight-1)>.001,className:"w-full bg-amber-500 hover:bg-amber-600 text-white",children:Ht?"保存中...":"保存权重"})]})]})]})}),e.jsx(St,{open:ee,onOpenChange:te,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Pt,{className:"w-5 h-5 text-amber-400"}),"新建篇"]})}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"篇名(如:第六篇|真实的社会)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:we,onChange:F=>D(F.target.value),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>{te(!1),D("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Hn,disabled:ue||!we.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:ue?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"创建篇"]})})]})]})}),e.jsx(St,{open:!!m,onOpenChange:()=>f(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] flex flex-col p-0 gap-0",showCloseButton:!0,children:[e.jsx(Ct,{className:"shrink-0 px-6 pt-6 pb-2",children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),m&&e.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 px-6 space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"章节ID"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:m.isFree?0:m.price,onChange:F=>f({...m,price:Number(F.target.value),isFree:Number(F.target.value)===0}),disabled:m.isFree})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"免费章节(唯一入口,小程序以 is_free 或 price=0 为准)"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m.isFree||m.price===0,onChange:F=>f({...m,isFree:F.target.checked,price:F.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"最新新增"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m.isNew??!1,onChange:F=>f({...m,isNew:F.target.checked}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"标记 NEW"})]})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"章节标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.title,onChange:F=>f({...m,title:F.target.value})})]}),m.filePath&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"文件路径"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:m.filePath,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Z,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:U,type:"file",accept:"image/*",onChange:Ir,className:"hidden"}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>{var F;return(F=U.current)==null?void 0:F.click()},disabled:I,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[I?e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(Ux,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),x?e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(dn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[400px] font-mono text-sm placeholder:text-gray-500",placeholder:"此处输入章节内容,支持Markdown格式...",value:m.content,onChange:F=>f({...m,content:F.target.value})})]})]}),e.jsxs(Dt,{className:"shrink-0 px-6 py-4 border-t border-gray-700/50",children:[e.jsxs(q,{variant:"outline",onClick:()=>f(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsx(q,{onClick:hr,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),e.jsxs(Al,{defaultValue:"chapters",className:"space-y-6",children:[e.jsxs(Fa,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Lt,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(Ks,{className:"w-4 h-4 mr-2"}),"章节管理"]}),e.jsxs(Lt,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(on,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),e.jsxs(Lt,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(wd,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),e.jsxs(Ot,{value:"chapters",className:"space-y-4",children:[e.jsxs("div",{className:"rounded-2xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac] flex items-center justify-center text-white shadow-lg shadow-[#38bdac]/20 shrink-0",children:e.jsx(Ks,{className:"w-6 h-6"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-base text-white leading-tight mb-1",children:"一场SOUL的创业实验场"}),e.jsx("p",{className:"text-xs text-gray-500",children:"来自Soul派对房的真实商业故事"})]})]}),e.jsxs("div",{className:"text-center shrink-0",children:[e.jsx("span",{className:"block text-2xl font-bold text-[#38bdac]",children:vn}),e.jsx("span",{className:"text-xs text-gray-500",children:"章节"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(q,{onClick:()=>y(!0),className:"flex-1 min-w-[120px] bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"新建章节"]}),e.jsxs(q,{onClick:()=>te(!0),className:"flex-1 min-w-[120px] bg-amber-500/10 hover:bg-amber-500/20 text-amber-400 border border-amber-500/30",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"新建篇"]}),e.jsxs(q,{variant:"outline",onClick:()=>O(!0),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:["批量移动(已选 ",ce.length," 节)"]})]}),l?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(hC,{parts:Kt,expandedParts:c,onTogglePart:ur,onReorder:Vn,onReadSection:Ls,onDeleteSection:ls,onAddSectionInPart:mr,onAddChapterInPart:Nn,onDeleteChapter:Wn,onEditPart:Rr,onDeletePart:Gn,onEditChapter:qs,selectedSectionIds:ce,onToggleSectionSelect:Yn,onShowSectionOrders:Es})]}),e.jsx(Ot,{value:"search",className:"space-y-4",children:e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ye,{children:e.jsx(Ge,{className:"text-white",children:"内容搜索"})}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:P,onChange:F=>w(F.target.value),onKeyDown:F=>F.key==="Enter"&&wn()}),e.jsx(q,{onClick:wn,disabled:k||!P.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:k?e.jsx($e,{className:"w-4 h-4 animate-spin"}):e.jsx(on,{className:"w-4 h-4"})})]}),b.length>0&&e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",b.length," 个结果"]}),b.map(F=>e.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>Ls({id:F.id,title:F.title,price:F.price??1,filePath:""}),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:F.id}),e.jsx("span",{className:"text-white",children:F.title})]}),e.jsx(Oe,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:F.matchType==="title"?"标题匹配":"内容匹配"})]}),F.snippet&&e.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:F.snippet}),(F.partTitle||F.chapterTitle)&&e.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[F.partTitle," · ",F.chapterTitle]})]},F.id))]})]})]})}),e.jsx(Ot,{value:"hooks",className:"space-y-4",children:e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ye,{children:e.jsx(Ge,{className:"text-white",children:"引流钩子配置"})}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[e.jsx(Z,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),e.jsxs(Sl,{defaultValue:"3",children:[e.jsx(Na,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{placeholder:"选择章节"})}),e.jsxs(wa,{className:"bg-[#0f2137] border-gray-700",children:[e.jsx(nr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),e.jsx(nr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),e.jsx(nr,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),e.jsxs("div",{className:"grid w-full gap-1.5",children:[e.jsx(Z,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),e.jsx(dn,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),e.jsx(q,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}const Sr={name:"卡若",avatar:"K",avatarImg:"",title:"Soul派对房主理人 · 私域运营专家",bio:'每天早上6点到9点,在Soul派对房分享真实的创业故事。专注私域运营与项目变现,用"云阿米巴"模式帮助创业者构建可持续的商业体系。',stats:[{label:"商业案例",value:"62"},{label:"连续直播",value:"365天"},{label:"派对分享",value:"1000+"}],highlights:["5年私域运营经验","帮助100+品牌从0到1增长","连续创业者,擅长商业模式设计"]};function vx(r){return Array.isArray(r)?r.map(a=>a&&typeof a=="object"&&"label"in a&&"value"in a?{label:String(a.label),value:String(a.value)}:{label:"",value:""}).filter(a=>a.label||a.value):Sr.stats}function jx(r){return Array.isArray(r)?r.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):Sr.highlights}function xC(){const[r,a]=h.useState(Sr),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[m,f]=h.useState(!1),g=h.useRef(null);h.useEffect(()=>{Be("/api/admin/author-settings").then(N=>{const k=N==null?void 0:N.data;k&&typeof k=="object"&&a({name:String(k.name??Sr.name),avatar:String(k.avatar??Sr.avatar),avatarImg:String(k.avatarImg??""),title:String(k.title??Sr.title),bio:String(k.bio??Sr.bio),stats:vx(k.stats).length?vx(k.stats):Sr.stats,highlights:jx(k.highlights).length?jx(k.highlights):Sr.highlights})}).catch(console.error).finally(()=>o(!1))},[]);const y=async()=>{u(!0);try{const N={name:r.name,avatar:r.avatar||"K",avatarImg:r.avatarImg,title:r.title,bio:r.bio,stats:r.stats.filter(I=>I.label||I.value),highlights:r.highlights.filter(Boolean)},k=await yt("/api/admin/author-settings",N);if(!k||k.success===!1){alert("保存失败: "+(k&&typeof k=="object"&&"error"in k?k.error:""));return}u(!1);const j=document.createElement("div");j.className="fixed top-4 right-4 z-50 px-4 py-2 rounded-lg bg-[#38bdac] text-white text-sm shadow-lg",j.textContent="作者设置已保存",document.body.appendChild(j),setTimeout(()=>j.remove(),2e3)}catch(N){console.error(N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{u(!1)}},x=async N=>{var j;const k=(j=N.target.files)==null?void 0:j[0];if(k){f(!0);try{const I=new FormData;I.append("file",k),I.append("folder","avatars");const W=yu(),U={};W&&(U.Authorization=`Bearer ${W}`);const R=await(await fetch(Ia("/api/upload"),{method:"POST",body:I,credentials:"include",headers:U})).json();R!=null&&R.success&&(R!=null&&R.url)?a(T=>({...T,avatarImg:R.url})):alert("上传失败: "+((R==null?void 0:R.error)||"未知错误"))}catch(I){console.error(I),alert("上传失败")}finally{f(!1),g.current&&(g.current.value="")}}},v=()=>a(N=>({...N,stats:[...N.stats,{label:"",value:""}]})),C=N=>a(k=>({...k,stats:k.stats.filter((j,I)=>I!==N)})),E=(N,k,j)=>a(I=>({...I,stats:I.stats.map((W,U)=>U===N?{...W,[k]:j}:W)})),P=()=>a(N=>({...N,highlights:[...N.highlights,""]})),w=N=>a(k=>({...k,highlights:k.highlights.filter((j,I)=>I!==N)})),b=(N,k)=>a(j=>({...j,highlights:j.highlights.map((I,W)=>W===N?k:I)}));return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(ka,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),e.jsxs(q,{onClick:y,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"flex items-center gap-2 text-white",children:[e.jsx(ka,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),e.jsx(bt,{className:"text-gray-400",children:"作者姓名、头像、头衔与个人简介,将展示在「关于作者」页顶部。"})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"姓名"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.name,onChange:N=>a(k=>({...k,name:N.target.value})),placeholder:"卡若"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:r.avatar,onChange:N=>a(k=>({...k,avatar:N.target.value.slice(0,1)||"K"})),placeholder:"K"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Ux,{className:"w-3 h-3 text-[#38bdac]"}),"头像图片"]}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:r.avatarImg,onChange:N=>a(k=>({...k,avatarImg:N.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),e.jsx("input",{ref:g,type:"file",accept:"image/*",className:"hidden",onChange:x}),e.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:m,onClick:()=>{var N;return(N=g.current)==null?void 0:N.click()},children:[e.jsx(io,{className:"w-4 h-4 mr-2"}),m?"上传中...":"上传"]})]}),r.avatarImg&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:r.avatarImg.startsWith("http")?r.avatarImg:Ia(r.avatarImg),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"头衔"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.title,onChange:N=>a(k=>({...k,title:N.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"个人简介"}),e.jsx(dn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:r.bio,onChange:N=>a(k=>({...k,bio:N.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsx(Ge,{className:"text-white",children:"统计数据"}),e.jsx(bt,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),e.jsxs(ke,{className:"space-y-3",children:[r.stats.map((N,k)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N.label,onChange:j=>E(k,"label",j.target.value),placeholder:"标签"}),e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N.value,onChange:j=>E(k,"value",j.target.value),placeholder:"数值"}),e.jsx(q,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>C(k),children:e.jsx(fs,{className:"w-4 h-4"})})]},k)),e.jsxs(q,{variant:"outline",size:"sm",onClick:v,className:"border-gray-600 text-gray-400",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsx(Ge,{className:"text-white",children:"亮点标签"}),e.jsx(bt,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),e.jsxs(ke,{className:"space-y-3",children:[r.highlights.map((N,k)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N,onChange:j=>b(k,j.target.value),placeholder:"5年私域运营经验"}),e.jsx(q,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>w(k),children:e.jsx(fs,{className:"w-4 h-4"})})]},k)),e.jsxs(q,{variant:"outline",size:"sm",onClick:P,className:"border-gray-600 text-gray-400",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"添加亮点"]})]})]})]})]})}function pC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m]=h.useState(10),[f,g]=h.useState(0),[y,x]=h.useState(""),v=Pu(y,300),[C,E]=h.useState(!0),[P,w]=h.useState(null),[b,N]=h.useState(!1),[k,j]=h.useState(null),[I,W]=h.useState(""),[U,_]=h.useState(""),[R,T]=h.useState(""),[re,ae]=h.useState("admin"),[oe,ee]=h.useState("active"),[te,Y]=h.useState(!1);async function ne(){var O;E(!0),w(null);try{const L=new URLSearchParams({page:String(c),pageSize:String(m)});v.trim()&&L.set("search",v.trim());const X=await Be(`/api/admin/users?${L}`);X!=null&&X.success?(a(X.records||[]),o(X.total??0),g(X.totalPages??0)):w(X.error||"加载失败")}catch(L){const X=L;w(X.status===403?"无权限访问":((O=X==null?void 0:X.data)==null?void 0:O.error)||"加载失败"),a([])}finally{E(!1)}}h.useEffect(()=>{ne()},[c,m,v]);const ve=()=>{j(null),W(""),_(""),T(""),ae("admin"),ee("active"),N(!0)},$=O=>{j(O),W(O.username),_(""),T(O.name||""),ae(O.role==="super_admin"?"super_admin":"admin"),ee(O.status==="disabled"?"disabled":"active"),N(!0)},ce=async()=>{var O;if(!I.trim()){w("用户名不能为空");return}if(!k&&!U){w("新建时密码必填,至少 6 位");return}if(U&&U.length<6){w("密码至少 6 位");return}w(null),Y(!0);try{if(k){const L=await gt("/api/admin/users",{id:k.id,password:U||void 0,name:R.trim(),role:re,status:oe});L!=null&&L.success?(N(!1),ne()):w((L==null?void 0:L.error)||"保存失败")}else{const L=await yt("/api/admin/users",{username:I.trim(),password:U,name:R.trim(),role:re});L!=null&&L.success?(N(!1),ne()):w((L==null?void 0:L.error)||"保存失败")}}catch(L){const X=L;w(((O=X==null?void 0:X.data)==null?void 0:O.error)||"保存失败")}finally{Y(!1)}},H=async O=>{var L;if(confirm("确定删除该管理员?"))try{const X=await kr(`/api/admin/users?id=${O}`);X!=null&&X.success?ne():w((X==null?void 0:X.error)||"删除失败")}catch(X){const K=X;w(((L=K==null?void 0:K.data)==null?void 0:L.error)||"删除失败")}},A=O=>{if(!O)return"-";try{const L=new Date(O);return isNaN(L.getTime())?O:L.toLocaleString("zh-CN")}catch{return O}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(pu,{className:"w-5 h-5 text-[#38bdac]"}),"管理员用户"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"后台登录账号管理,仅超级管理员可操作"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{placeholder:"搜索用户名/昵称",value:y,onChange:O=>x(O.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),e.jsx(q,{variant:"outline",size:"sm",onClick:ne,disabled:C,className:"border-gray-600 text-gray-300",children:e.jsx($e,{className:`w-4 h-4 ${C?"animate-spin":""}`})}),e.jsxs(q,{onClick:ve,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"新增管理员"]})]})]}),P&&e.jsxs("div",{className:"mb-4 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm flex justify-between items-center",children:[e.jsx("span",{children:P}),e.jsx("button",{type:"button",onClick:()=>w(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-0",children:C?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"用户名"}),e.jsx(be,{className:"text-gray-400",children:"昵称"}),e.jsx(be,{className:"text-gray-400",children:"角色"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"创建时间"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(O=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(ye,{className:"text-gray-300",children:O.id}),e.jsx(ye,{className:"text-white font-medium",children:O.username}),e.jsx(ye,{className:"text-gray-400",children:O.name||"-"}),e.jsx(ye,{children:e.jsx(Oe,{variant:"outline",className:O.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:O.role==="super_admin"?"超级管理员":"管理员"})}),e.jsx(ye,{children:e.jsx(Oe,{variant:"outline",className:O.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:O.status==="active"?"正常":"已禁用"})}),e.jsx(ye,{className:"text-gray-500 text-sm",children:A(O.createdAt)}),e.jsxs(ye,{className:"text-right",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>$(O),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>H(O.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Wt,{className:"w-4 h-4"})})]})]},O.id)),r.length===0&&!C&&e.jsx(Je,{children:e.jsx(ye,{colSpan:7,className:"text-center py-12 text-gray-500",children:P==="无权限访问"?"仅超级管理员可查看":"暂无管理员"})})]})]}),f>1&&e.jsx("div",{className:"p-4 border-t border-gray-700/50",children:e.jsx(Hs,{page:c,pageSize:m,total:l,totalPages:f,onPageChange:u})})]})})}),e.jsx(St,{open:b,onOpenChange:N,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:k?"编辑管理员":"新增管理员"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"用户名"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:I,onChange:O=>W(O.target.value),disabled:!!k}),k&&e.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:k?"新密码(留空不改)":"密码"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:k?"留空表示不修改":"至少 6 位",value:U,onChange:O=>_(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"昵称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:R,onChange:O=>T(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{value:re,onChange:O=>ae(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"admin",children:"管理员"}),e.jsx("option",{value:"super_admin",children:"超级管理员"})]})]}),k&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"状态"}),e.jsxs("select",{value:oe,onChange:O=>ee(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"active",children:"正常"}),e.jsx("option",{value:"disabled",children:"禁用"})]})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>N(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:ce,disabled:te,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),te?"保存中...":"保存"]})]})]})})]})}const gC={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},yC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},vC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...yC}},jC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0},bC=["system","author","admin"];function NC(){const[r,a]=Rj(),l=r.get("tab")??"system",o=bC.includes(l)?l:"system",[c,u]=h.useState(vC),[m,f]=h.useState(jC),[g,y]=h.useState(gC),[x,v]=h.useState(!1),[C,E]=h.useState(!0),[P,w]=h.useState(!1),[b,N]=h.useState(""),[k,j]=h.useState(""),[I,W]=h.useState(!1),[U,_]=h.useState(!1),R=(ee,te,Y=!1)=>{N(ee),j(te),W(Y),w(!0)};h.useEffect(()=>{(async()=>{try{const te=await Be("/api/admin/settings");if(!te||te.success===!1)return;if(te.featureConfig&&Object.keys(te.featureConfig).length&&f(Y=>({...Y,...te.featureConfig})),te.mpConfig&&typeof te.mpConfig=="object"&&y(Y=>({...Y,...te.mpConfig})),te.siteSettings&&typeof te.siteSettings=="object"){const Y=te.siteSettings;u(ne=>({...ne,...typeof Y.sectionPrice=="number"&&{sectionPrice:Y.sectionPrice},...typeof Y.baseBookPrice=="number"&&{baseBookPrice:Y.baseBookPrice},...typeof Y.distributorShare=="number"&&{distributorShare:Y.distributorShare},...Y.authorInfo&&typeof Y.authorInfo=="object"&&{authorInfo:{...ne.authorInfo,...Y.authorInfo}}}))}}catch(te){console.error("Load settings error:",te)}finally{E(!1)}})()},[]);const T=async(ee,te)=>{_(!0);try{const Y=await yt("/api/admin/settings",{featureConfig:ee});if(!Y||Y.success===!1){te(),R("保存失败",(Y==null?void 0:Y.error)??"未知错误",!0);return}R("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(Y){console.error("Save feature config error:",Y),te(),R("保存失败",Y instanceof Error?Y.message:String(Y),!0)}finally{_(!1)}},re=(ee,te)=>{const Y=m,ne={...Y,[ee]:te};f(ne),T(ne,()=>f(Y))},ae=async()=>{v(!0);try{const ee=await yt("/api/admin/settings",{featureConfig:m,siteSettings:{sectionPrice:c.sectionPrice,baseBookPrice:c.baseBookPrice,distributorShare:c.distributorShare,authorInfo:c.authorInfo},mpConfig:{...g,appId:g.appId||"",withdrawSubscribeTmplId:g.withdrawSubscribeTmplId||"",mchId:g.mchId||"",minWithdraw:typeof g.minWithdraw=="number"?g.minWithdraw:10}});if(!ee||ee.success===!1){R("保存失败",(ee==null?void 0:ee.error)??"未知错误",!0);return}R("已保存","设置已保存成功。")}catch(ee){console.error("Save settings error:",ee),R("保存失败",ee instanceof Error?ee.message:String(ee),!0)}finally{v(!1)}},oe=ee=>{a(ee==="system"?{}:{tab:ee})};return C?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),o==="system"&&e.jsxs(q,{onClick:ae,disabled:x,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),x?"保存中...":"保存设置"]})]}),e.jsxs(Al,{value:o,onValueChange:oe,className:"w-full",children:[e.jsxs(Fa,{className:"mb-6 bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Lt,{value:"system",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(On,{className:"w-4 h-4 mr-2"}),"系统设置"]}),e.jsxs(Lt,{value:"author",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(Nd,{className:"w-4 h-4 mr-2"}),"作者详情"]}),e.jsxs(Lt,{value:"admin",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(pu,{className:"w-4 h-4 mr-2"}),"管理员"]})]}),e.jsx(Ot,{value:"system",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Nd,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),e.jsx(bt,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Nd,{className:"w-3 h-3"}),"主理人名称"]}),e.jsx(ie,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.name??"",onChange:ee=>u(te=>({...te,authorInfo:{...te.authorInfo,name:ee.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(ro,{className:"w-3 h-3"}),"开播日期"]}),e.jsx(ie,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:c.authorInfo.startDate??"",onChange:ee=>u(te=>({...te,authorInfo:{...te.authorInfo,startDate:ee.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(ro,{className:"w-3 h-3"}),"直播时间"]}),e.jsx(ie,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:c.authorInfo.liveTime??"",onChange:ee=>u(te=>({...te,authorInfo:{...te.authorInfo,liveTime:ee.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Vx,{className:"w-3 h-3"}),"直播平台"]}),e.jsx(ie,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:c.authorInfo.platform??"",onChange:ee=>u(te=>({...te,authorInfo:{...te.authorInfo,platform:ee.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Ks,{className:"w-3 h-3"}),"简介描述"]}),e.jsx(ie,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.description??"",onChange:ee=>u(te=>({...te,authorInfo:{...te.authorInfo,description:ee.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),e.jsx(dn,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:c.authorInfo.bio??"",onChange:ee=>u(te=>({...te,authorInfo:{...te.authorInfo,bio:ee.target.value}}))})]}),e.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-[#00CED1] to-[#20B2AA] flex items-center justify-center text-xl font-bold text-white",children:(c.authorInfo.name??"K").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-semibold",children:c.authorInfo.name}),e.jsx("p",{className:"text-gray-400 text-xs",children:c.authorInfo.description}),e.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",c.authorInfo.liveTime," · ",c.authorInfo.platform]})]})]})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(no,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),e.jsx(ke,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"单节价格 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.sectionPrice,onChange:ee=>u(te=>({...te,sectionPrice:Number.parseFloat(ee.target.value)||1}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"整本价格 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.baseBookPrice,onChange:ee=>u(te=>({...te,baseBookPrice:Number.parseFloat(ee.target.value)||9.9}))})]})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(lo,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),e.jsx(bt,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),e.jsx(ke,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"小程序 AppID"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:g.appId??"",onChange:ee=>y(te=>({...te,appId:ee.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"提现订阅模板 ID"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:g.withdrawSubscribeTmplId??"",onChange:ee=>y(te=>({...te,withdrawSubscribeTmplId:ee.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"微信支付商户号"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:g.mchId??"",onChange:ee=>y(te=>({...te,mchId:ee.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"最低提现金额 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:g.minWithdraw??10,onChange:ee=>y(te=>({...te,minWithdraw:Number.parseFloat(ee.target.value)||10}))})]})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(On,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),e.jsx(bt,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qt,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(Z,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),e.jsx(dt,{id:"match-enabled",checked:m.matchEnabled,disabled:U,onCheckedChange:ee=>re("matchEnabled",ee)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pb,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(Z,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),e.jsx(dt,{id:"referral-enabled",checked:m.referralEnabled,disabled:U,onCheckedChange:ee=>re("referralEnabled",ee)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ks,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(Z,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),e.jsx(dt,{id:"search-enabled",checked:m.searchEnabled,disabled:U,onCheckedChange:ee=>re("searchEnabled",ee)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(On,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(Z,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),e.jsx(dt,{id:"about-enabled",checked:m.aboutEnabled,disabled:U,onCheckedChange:ee=>re("aboutEnabled",ee)})]})]}),e.jsx("div",{className:"p-3 rounded-lg bg-blue-500/10 border border-blue-500/30",children:e.jsx("p",{className:"text-xs text-blue-300",children:"💡 关闭功能后,相关入口会自动隐藏。建议在功能开发完成后再开启。"})})]})]})]})}),e.jsx(Ot,{value:"author",className:"mt-0",children:e.jsx(xC,{})}),e.jsx(Ot,{value:"admin",className:"mt-0",children:e.jsx(pC,{})})]}),e.jsx(St,{open:P,onOpenChange:w,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[e.jsxs(Ct,{children:[e.jsx(kt,{className:I?"text-red-400":"text-[#38bdac]",children:b}),e.jsx(d2,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:k})]}),e.jsx(Dt,{className:"mt-4",children:e.jsx(q,{onClick:()=>w(!1),className:I?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const bx={wechat:{enabled:!0,qrCode:"/images/wechat-pay.png",account:"卡若",websiteAppId:"",merchantId:"",groupQrCode:"/images/party-group-qr.png"},alipay:{enabled:!0,qrCode:"/images/alipay.png",account:"卡若",partnerId:"",securityKey:""},usdt:{enabled:!1,network:"TRC20",address:"",exchangeRate:7.2},paypal:{enabled:!1,email:"",exchangeRate:7.2}};function wC(){const[r,a]=h.useState(!1),[l,o]=h.useState(bx),[c,u]=h.useState(""),m=async()=>{a(!0);try{const N=await Be("/api/config");N!=null&&N.paymentMethods&&o({...bx,...N.paymentMethods})}catch(N){console.error(N)}finally{a(!1)}};h.useEffect(()=>{m()},[]);const f=async()=>{a(!0);try{await yt("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(N){console.error("保存失败:",N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{a(!1)}},g=(N,k)=>{navigator.clipboard.writeText(N),u(k),setTimeout(()=>u(""),2e3)},y=(N,k)=>{o(j=>({...j,wechat:{...j.wechat,[N]:k}}))},x=(N,k)=>{o(j=>({...j,alipay:{...j.alipay,[N]:k}}))},v=(N,k)=>{o(j=>({...j,usdt:{...j.usdt,[N]:k}}))},C=(N,k)=>{o(j=>({...j,paypal:{...j.paypal,[N]:k}}))},E=l.wechat,P=l.alipay,w=l.usdt,b=l.paypal;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),e.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(q,{variant:"outline",onClick:m,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${r?"animate-spin":""}`}),"同步配置"]}),e.jsxs(q,{onClick:f,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存配置"]})]})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(zx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"如何获取微信群跳转链接?"}),e.jsxs("ol",{className:"text-[#07C160]/80 space-y-1 list-decimal list-inside",children:[e.jsx("li",{children:"打开微信,进入目标微信群"}),e.jsx("li",{children:'点击右上角"..." → "群二维码"'}),e.jsx("li",{children:'点击右上角"..." → "发送到电脑"'}),e.jsx("li",{children:"在电脑上保存二维码图片,上传到图床获取URL"}),e.jsx("li",{children:"或使用草料二维码等工具解析二维码获取链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"提示:微信群二维码7天后失效,建议使用活码工具"})]})]})}),e.jsxs(Al,{defaultValue:"wechat",className:"space-y-6",children:[e.jsxs(Fa,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[e.jsxs(Lt,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[e.jsx(lo,{className:"w-4 h-4 mr-2"}),"微信"]}),e.jsxs(Lt,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[e.jsx(Of,{className:"w-4 h-4 mr-2"}),"支付宝"]}),e.jsxs(Lt,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[e.jsx(Df,{className:"w-4 h-4 mr-2"}),"USDT"]}),e.jsxs(Lt,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[e.jsx(Hd,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),e.jsx(Ot,{value:"wechat",className:"space-y-4",children:e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ge,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(lo,{className:"w-5 h-5"}),"微信支付配置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),e.jsx(dt,{checked:!!E.enabled,onCheckedChange:N=>y("enabled",N)})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"网站AppID"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(E.websiteAppId??""),onChange:N=>y("websiteAppId",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"商户号"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(E.merchantId??""),onChange:N=>y("merchantId",N.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(ao,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"微信收款码/支付链接"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(E.qrCode??""),onChange:N=>y("qrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),e.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[e.jsx(Z,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),e.jsx(ie,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(E.groupQrCode??""),onChange:N=>y("groupQrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),e.jsx(Ot,{value:"alipay",className:"space-y-4",children:e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ge,{className:"text-[#1677FF] flex items-center gap-2",children:[e.jsx(Of,{className:"w-5 h-5"}),"支付宝配置"]}),e.jsx(bt,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),e.jsx(dt,{checked:!!P.enabled,onCheckedChange:N=>x("enabled",N)})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"合作者身份 (PID)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.partnerId??""),onChange:N=>x("partnerId",N.target.value)}),e.jsx(q,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>g(String(P.partnerId??""),"pid"),children:c==="pid"?e.jsx(jo,{className:"w-4 h-4 text-green-500"}):e.jsx(Bx,{className:"w-4 h-4 text-gray-400"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"安全校验码 (Key)"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.securityKey??""),onChange:N=>x("securityKey",N.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(ao,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(P.qrCode??""),onChange:N=>x("qrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),e.jsx(Ot,{value:"usdt",className:"space-y-4",children:e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ge,{className:"text-[#26A17B] flex items-center gap-2",children:[e.jsx(Df,{className:"w-5 h-5"}),"USDT配置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),e.jsx(dt,{checked:!!w.enabled,onCheckedChange:N=>v("enabled",N)})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"网络类型"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(w.network??"TRC20"),onChange:N=>v("network",N.target.value),children:[e.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),e.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),e.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"收款地址"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(w.address??""),onChange:N=>v("address",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(w.exchangeRate)??7.2,onChange:N=>v("exchangeRate",Number.parseFloat(N.target.value)||7.2)})]})]})]})}),e.jsx(Ot,{value:"paypal",className:"space-y-4",children:e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ge,{className:"text-[#169BD7] flex items-center gap-2",children:[e.jsx(Hd,{className:"w-5 h-5"}),"PayPal配置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),e.jsx(dt,{checked:!!b.enabled,onCheckedChange:N=>C("enabled",N)})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"PayPal邮箱"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(b.email??""),onChange:N=>C("email",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:N=>C("exchangeRate",Number(N.target.value)||7.2)})]})]})]})})]})]})}const SC={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},CC={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},kC={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function EC(){const[r,a]=h.useState({siteConfig:{...SC},menuConfig:{...CC},pageConfig:{...kC}}),[l,o]=h.useState(!1),[c,u]=h.useState(!1);h.useEffect(()=>{Be("/api/config").then(x=>{x!=null&&x.siteConfig&&a(v=>({...v,siteConfig:{...v.siteConfig,...x.siteConfig}})),x!=null&&x.menuConfig&&a(v=>({...v,menuConfig:{...v.menuConfig,...x.menuConfig}})),x!=null&&x.pageConfig&&a(v=>({...v,pageConfig:{...v.pageConfig,...x.pageConfig}}))}).catch(console.error)},[]);const m=async()=>{u(!0);try{await yt("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await yt("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await yt("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),o(!0),setTimeout(()=>o(!1),2e3),alert("配置已保存")}catch(x){console.error(x),alert("保存失败: "+(x instanceof Error?x.message:String(x)))}finally{u(!1)}},f=r.siteConfig,g=r.menuConfig,y=r.pageConfig;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"网站配置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置网站名称、图标、菜单和页面标题"})]}),e.jsxs(q,{onClick:m,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Hd,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),e.jsx(bt,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),e.jsx(ie,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteName??"",onChange:x=>a(v=>({...v,siteConfig:{...v.siteConfig,siteName:x.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),e.jsx(ie,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteTitle??"",onChange:x=>a(v=>({...v,siteConfig:{...v.siteConfig,siteTitle:x.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),e.jsx(ie,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteDescription??"",onChange:x=>a(v=>({...v,siteConfig:{...v.siteConfig,siteDescription:x.target.value}}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),e.jsx(ie,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:f.logo??"",onChange:x=>a(v=>({...v,siteConfig:{...v.siteConfig,logo:x.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),e.jsx(ie,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:f.favicon??"",onChange:x=>a(v=>({...v,siteConfig:{...v.siteConfig,favicon:x.target.value}}))})]})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Yb,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),e.jsx(bt,{className:"text-gray-400",children:"配置网站主题色"})]}),e.jsx(ke,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(Z,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ie,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:f.primaryColor??"#00CED1",onChange:x=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:x.target.value}}))}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:f.primaryColor??"#00CED1",onChange:x=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:x.target.value}}))})]})]}),e.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:f.primaryColor??"#00CED1"},children:"预览"})]})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Ub,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),e.jsx(bt,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),e.jsx(ke,{className:"space-y-4",children:Object.entries(g).map(([x,v])=>e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx(dt,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:C=>a(E=>({...E,menuConfig:{...E.menuConfig,[x]:{...v,enabled:C}}}))}),e.jsx("span",{className:"text-gray-300 w-16 capitalize",children:x}),e.jsx(ie,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(v==null?void 0:v.label)??"",onChange:C=>a(E=>({...E,menuConfig:{...E.menuConfig,[x]:{...v,label:C.target.value}}}))})]}),e.jsx("span",{className:`text-sm ${v!=null&&v.enabled?"text-green-400":"text-gray-500"}`,children:v!=null&&v.enabled?"显示":"隐藏"})]},x))})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(hb,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"首页标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeTitle??"",onChange:x=>a(v=>({...v,pageConfig:{...v.pageConfig,homeTitle:x.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"首页副标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeSubtitle??"",onChange:x=>a(v=>({...v,pageConfig:{...v.pageConfig,homeSubtitle:x.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"目录页标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.chaptersTitle??"",onChange:x=>a(v=>({...v,pageConfig:{...v.pageConfig,chaptersTitle:x.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"匹配页标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.matchTitle??"",onChange:x=>a(v=>({...v,pageConfig:{...v.pageConfig,matchTitle:x.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"我的页标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.myTitle??"",onChange:x=>a(v=>({...v,pageConfig:{...v.pageConfig,myTitle:x.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"关于作者标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.aboutTitle??"",onChange:x=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:x.target.value}}))})]})]})]})]})]})]})}function PC(){const[r,a]=h.useState(""),[l,o]=h.useState(""),[c,u]=h.useState(""),[m,f]=h.useState({}),g=async()=>{var E,P,w,b;try{const N=await Be("/api/config"),k=(P=(E=N==null?void 0:N.liveQRCodes)==null?void 0:E[0])==null?void 0:P.urls;Array.isArray(k)&&a(k.join(` +`));const j=(b=(w=N==null?void 0:N.paymentMethods)==null?void 0:w.wechat)==null?void 0:b.groupQrCode;j&&o(j),f({paymentMethods:N==null?void 0:N.paymentMethods,liveQRCodes:N==null?void 0:N.liveQRCodes})}catch(N){console.error(N)}};h.useEffect(()=>{g()},[]);const y=(E,P)=>{navigator.clipboard.writeText(E),u(P),setTimeout(()=>u(""),2e3)},x=async()=>{try{const E=r.split(` +`).map(w=>w.trim()).filter(Boolean),P=[...m.liveQRCodes||[]];P[0]?P[0].urls=E:P.push({id:"live-1",name:"微信群活码",urls:E,clickCount:0}),await yt("/api/db/config",{key:"live_qr_codes",value:P,description:"群活码配置"}),alert("群活码配置已保存!"),await g()}catch(E){console.error(E),alert("保存失败: "+(E instanceof Error?E.message:String(E)))}},v=async()=>{var E;try{await yt("/api/db/config",{key:"payment_methods",value:{...m.paymentMethods||{},wechat:{...((E=m.paymentMethods)==null?void 0:E.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await g()}catch(P){console.error(P),alert("保存失败: "+(P instanceof Error?P.message:String(P)))}},C=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(zx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),e.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[e.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:"访问草料二维码创建活码"}),e.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),e.jsx("li",{children:"复制生成的短链接填入下方配置"}),e.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),e.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),e.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意:微信原生群二维码7天后失效,建议使用草料活码"})]})]})]})}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx($f,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),e.jsx(bt,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(zf,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ie,{placeholder:"https://cli.im/xxxxx 或 https://weixin.qq.com/g/...",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",value:l,onChange:E=>o(E.target.value)}),e.jsx(q,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>y(l,"group"),children:c==="group"?e.jsx(jo,{className:"w-4 h-4 text-green-500"}):e.jsx(Bx,{className:"w-4 h-4 text-gray-400"})})]}),e.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[e.jsx(ao,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(q,{onClick:v,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[e.jsx(io,{className:"w-4 h-4 mr-2"}),"保存配置"]}),e.jsxs(q,{onClick:C,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[e.jsx(ao,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx($f,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),e.jsx(bt,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),e.jsxs(ke,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(zf,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),e.jsx(dn,{placeholder:"https://cli.im/group1\\nhttps://cli.im/group2",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 min-h-[120px] font-mono text-sm",value:r,onChange:E=>a(E.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"每行填写一个群链接,系统将按顺序或随机分配"})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"已配置群数量"}),e.jsxs("span",{className:"font-bold text-[#38bdac]",children:[r.split(` +`).filter(Boolean).length," 个"]})]}),e.jsxs(q,{onClick:x,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(io,{className:"w-4 h-4 mr-2"}),"保存多群配置"]})]})]})]}),e.jsxs("div",{className:"mt-6 bg-[#0f2137] rounded-xl p-4 border border-gray-700/50",children:[e.jsx("h4",{className:"text-white font-medium mb-3",children:"常见问题"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[#38bdac]",children:"Q: 为什么推荐使用草料活码?"}),e.jsx("p",{className:"text-gray-400",children:"A: 草料活码是永久链接,群满后可直接在后台更换新群码,无需修改网站配置。微信原生群码7天失效。"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[#38bdac]",children:"Q: 支付后没有跳转怎么办?"}),e.jsx("p",{className:"text-gray-400",children:"A: 1) 检查链接是否正确填写 2) 部分浏览器可能拦截弹窗,用户需手动允许 3) 建议使用https开头的链接"})]})]})]})]})}const Nx={matchTypes:[{id:"partner",label:"创业合伙",matchLabel:"创业伙伴",icon:"⭐",matchFromDB:!0,showJoinAfterMatch:!1,price:1,enabled:!0},{id:"investor",label:"资源对接",matchLabel:"资源对接",icon:"👥",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"mentor",label:"导师顾问",matchLabel:"导师顾问",icon:"❤️",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"team",label:"团队招募",matchLabel:"加入项目",icon:"🎮",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}],freeMatchLimit:3,matchPrice:1,settings:{enableFreeMatches:!0,enablePaidMatches:!0,maxMatchesPerDay:10}},TC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function RC(){const[r,a]=h.useState(Nx),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[m,f]=h.useState(!1),[g,y]=h.useState(null),[x,v]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await Be("/api/db/config/full?key=match_config"),I=(j==null?void 0:j.data)??(j==null?void 0:j.config);I&&a({...Nx,...I})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};h.useEffect(()=>{C()},[]);const E=async()=>{u(!0);try{const j=await yt("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});j&&j.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(j&&typeof j=="object"&&"error"in j?j.error:"未知错误"))}catch(j){console.error("保存配置失败:",j),alert("保存失败")}finally{u(!1)}},P=j=>{y(j),v({id:j.id,label:j.label,matchLabel:j.matchLabel,icon:j.icon,matchFromDB:j.matchFromDB,showJoinAfterMatch:j.showJoinAfterMatch,price:j.price,enabled:j.enabled}),f(!0)},w=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},b=()=>{if(!x.id||!x.label){alert("请填写类型ID和名称");return}const j=[...r.matchTypes];if(g){const I=j.findIndex(W=>W.id===g.id);I!==-1&&(j[I]={...x})}else{if(j.some(I=>I.id===x.id)){alert("类型ID已存在");return}j.push({...x})}a({...r,matchTypes:j}),f(!1)},N=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(I=>I.id!==j)})},k=j=>{a({...r,matchTypes:r.matchTypes.map(I=>I.id===j?{...I,enabled:!I.enabled}:I)})};return e.jsxs("div",{className:"p-8 w-full space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(On,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(q,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),e.jsxs(q,{onClick:E,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(nn,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(ke,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(ie,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:j=>a({...r,freeMatchLimit:parseInt(j.target.value,10)||0})}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(ie,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:j=>a({...r,matchPrice:parseFloat(j.target.value)||1})}),e.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(ie,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:j=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})}),e.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:r.settings.enableFreeMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enableFreeMatches:j}})}),e.jsx(Z,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:r.settings.enablePaidMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enablePaidMatches:j}})}),e.jsx(Z,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),e.jsx(bt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(q,{onClick:w,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),e.jsx(ke,{children:e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"图标"}),e.jsx(be,{className:"text-gray-400",children:"类型ID"}),e.jsx(be,{className:"text-gray-400",children:"显示名称"}),e.jsx(be,{className:"text-gray-400",children:"匹配标签"}),e.jsx(be,{className:"text-gray-400",children:"价格"}),e.jsx(be,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(gs,{children:r.matchTypes.map(j=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(ye,{className:"font-mono text-gray-300",children:j.id}),e.jsx(ye,{className:"text-white font-medium",children:j.label}),e.jsx(ye,{className:"text-gray-300",children:j.matchLabel}),e.jsx(ye,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(ye,{children:j.matchFromDB?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(ye,{children:e.jsx(dt,{checked:j.enabled,onCheckedChange:()=>k(j.id)})}),e.jsx(ye,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>P(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>N(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Wt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(St,{open:m,onOpenChange:f,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[g?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Pt,{className:"w-5 h-5 text-[#38bdac]"}),g?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:x.id,onChange:j=>v({...x,id:j.target.value}),disabled:!!g})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:TC.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${x.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...x,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"显示名称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:x.label,onChange:j=>v({...x,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"匹配标签"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:x.matchLabel,onChange:j=>v({...x,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(ie,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:x.price,onChange:j=>v({...x,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:x.matchFromDB,onCheckedChange:j=>v({...x,matchFromDB:j})}),e.jsx(Z,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:x.showJoinAfterMatch,onCheckedChange:j=>v({...x,showJoinAfterMatch:j})}),e.jsx(Z,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:x.enabled,onCheckedChange:j=>v({...x,enabled:j})}),e.jsx(Z,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>f(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(q,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const wx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function IC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[g,y]=h.useState(""),[x,v]=h.useState(!0),[C,E]=h.useState(null);async function P(){v(!0),E(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(m)});g&&b.set("matchType",g);const N=await Be(`/api/db/match-records?${b}`);N!=null&&N.success?(a(N.records||[]),o(N.total??0)):E("加载匹配记录失败")}catch(b){console.error("加载匹配记录失败",b),E("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{P()},[c,g]);const w=Math.ceil(l/m)||1;return e.jsxs("div",{className:"p-8 w-full",children:[C&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>E(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"匹配记录"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["找伙伴匹配统计,共 ",l," 条记录"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:g,onChange:b=>{y(b.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(wx).map(([b,N])=>e.jsx("option",{value:b,children:N},b))]}),e.jsxs("button",{type:"button",onClick:P,disabled:x,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${x?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:x?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(gs,{children:[r.map(b=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.userAvatar?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none";const k=N.currentTarget.nextElementSibling;k&&k.classList.remove("hidden")}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.matchedUserAvatar?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none";const k=N.currentTarget.nextElementSibling;k&&k.classList.remove("hidden")}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(ye,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:wx[b.matchType]||b.matchType})}),e.jsxs(ye,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(ye,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Hs,{page:c,totalPages:w,total:l,pageSize:m,onPageChange:u,onPageSizeChange:b=>{f(b),u(1)}})]})})})]})}function _C(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[m,f]=h.useState(null),[g,y]=h.useState(""),[x,v]=h.useState(0),[C,E]=h.useState(!1);async function P(){o(!0);try{const j=await Be("/api/db/vip-roles");j!=null&&j.success&&j.data&&a(j.data)}catch(j){console.error("Load roles error:",j)}finally{o(!1)}}h.useEffect(()=>{P()},[]);const w=()=>{f(null),y(""),v(r.length>0?Math.max(...r.map(j=>j.sort))+1:0),u(!0)},b=j=>{f(j),y(j.name),v(j.sort),u(!0)},N=async()=>{if(!g.trim()){alert("角色名称不能为空");return}E(!0);try{if(m){const j=await gt("/api/db/vip-roles",{id:m.id,name:g.trim(),sort:x});j!=null&&j.success?(u(!1),P()):alert("更新失败: "+(j==null?void 0:j.error))}else{const j=await yt("/api/db/vip-roles",{name:g.trim(),sort:x});j!=null&&j.success?(u(!1),P()):alert("新增失败: "+(j==null?void 0:j.error))}}catch(j){console.error("Save error:",j),alert("保存失败")}finally{E(!1)}},k=async j=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const I=await kr(`/api/db/vip-roles?id=${j}`);I!=null&&I.success?P():alert("删除失败: "+(I==null?void 0:I.error))}catch(I){console.error("Delete error:",I),alert("删除失败")}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(sn,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),e.jsxs(q,{onClick:w,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"角色名称"}),e.jsx(be,{className:"text-gray-400",children:"排序"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(j=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(ye,{className:"text-gray-300",children:j.id}),e.jsx(ye,{className:"text-white",children:j.name}),e.jsx(ye,{className:"text-gray-400",children:j.sort}),e.jsxs(ye,{className:"text-right",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>b(j),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>k(j.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Wt,{className:"w-4 h-4"})})]})]},j.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),e.jsx(St,{open:c,onOpenChange:u,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:m?"编辑角色":"新增角色"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"角色名称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:g,onChange:j=>y(j.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:x,onChange:j=>v(parseInt(j.target.value,10)||0)})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>u(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:N,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),C?"保存中...":"保存"]})]})]})})]})}function Sg({embedded:r=!1}){const[a,l]=h.useState([]),[o,c]=h.useState(!0),[u,m]=h.useState(!1),[f,g]=h.useState(null),[y,x]=h.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[v,C]=h.useState(!1),[E,P]=h.useState(!1),w=h.useRef(null),b=async R=>{var re;const T=(re=R.target.files)==null?void 0:re[0];if(T){P(!0);try{const ae=new FormData;ae.append("file",T),ae.append("folder","mentors");const oe=yu(),ee={};oe&&(ee.Authorization=`Bearer ${oe}`);const Y=await(await fetch(Ia("/api/upload"),{method:"POST",body:ae,credentials:"include",headers:ee})).json();Y!=null&&Y.success&&(Y!=null&&Y.url)?x(ne=>({...ne,avatar:Y.url})):alert("上传失败: "+((Y==null?void 0:Y.error)||"未知错误"))}catch(ae){console.error(ae),alert("上传失败")}finally{P(!1),w.current&&(w.current.value="")}}};async function N(){c(!0);try{const R=await Be("/api/db/mentors");R!=null&&R.success&&R.data&&l(R.data)}catch(R){console.error("Load mentors error:",R)}finally{c(!1)}}h.useEffect(()=>{N()},[]);const k=()=>{x({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:a.length>0?Math.max(...a.map(R=>R.sort))+1:0,enabled:!0})},j=()=>{g(null),k(),m(!0)},I=R=>{g(R),x({name:R.name,avatar:R.avatar||"",intro:R.intro||"",tags:R.tags||"",priceSingle:R.priceSingle!=null?String(R.priceSingle):"",priceHalfYear:R.priceHalfYear!=null?String(R.priceHalfYear):"",priceYear:R.priceYear!=null?String(R.priceYear):"",quote:R.quote||"",whyFind:R.whyFind||"",offering:R.offering||"",judgmentStyle:R.judgmentStyle||"",sort:R.sort,enabled:R.enabled??!0}),m(!0)},W=async()=>{if(!y.name.trim()){alert("导师姓名不能为空");return}C(!0);try{const R=re=>re===""?void 0:parseFloat(re),T={name:y.name.trim(),avatar:y.avatar.trim()||void 0,intro:y.intro.trim()||void 0,tags:y.tags.trim()||void 0,priceSingle:R(y.priceSingle),priceHalfYear:R(y.priceHalfYear),priceYear:R(y.priceYear),quote:y.quote.trim()||void 0,whyFind:y.whyFind.trim()||void 0,offering:y.offering.trim()||void 0,judgmentStyle:y.judgmentStyle.trim()||void 0,sort:y.sort,enabled:y.enabled};if(f){const re=await gt("/api/db/mentors",{id:f.id,...T});re!=null&&re.success?(m(!1),N()):alert("更新失败: "+(re==null?void 0:re.error))}else{const re=await yt("/api/db/mentors",T);re!=null&&re.success?(m(!1),N()):alert("新增失败: "+(re==null?void 0:re.error))}}catch(R){console.error("Save error:",R),alert("保存失败")}finally{C(!1)}},U=async R=>{if(confirm("确定删除该导师?"))try{const T=await kr(`/api/db/mentors?id=${R}`);T!=null&&T.success?N():alert("删除失败: "+(T==null?void 0:T.error))}catch(T){console.error("Delete error:",T),alert("删除失败")}},_=R=>R!=null?`¥${R}`:"-";return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),e.jsxs(q,{onClick:j,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-0",children:o?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"姓名"}),e.jsx(be,{className:"text-gray-400",children:"简介"}),e.jsx(be,{className:"text-gray-400",children:"单次"}),e.jsx(be,{className:"text-gray-400",children:"半年"}),e.jsx(be,{className:"text-gray-400",children:"年度"}),e.jsx(be,{className:"text-gray-400",children:"排序"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[a.map(R=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(ye,{className:"text-gray-300",children:R.id}),e.jsx(ye,{className:"text-white",children:R.name}),e.jsx(ye,{className:"text-gray-400 max-w-[200px] truncate",children:R.intro||"-"}),e.jsx(ye,{className:"text-gray-400",children:_(R.priceSingle)}),e.jsx(ye,{className:"text-gray-400",children:_(R.priceHalfYear)}),e.jsx(ye,{className:"text-gray-400",children:_(R.priceYear)}),e.jsx(ye,{className:"text-gray-400",children:R.sort}),e.jsxs(ye,{className:"text-right",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>I(R),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>U(R.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Wt,{className:"w-4 h-4"})})]})]},R.id)),a.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),e.jsx(St,{open:u,onOpenChange:m,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:f?"编辑导师":"新增导师"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"姓名 *"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:y.name,onChange:R=>x(T=>({...T,name:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"排序"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:y.sort,onChange:R=>x(T=>({...T,sort:parseInt(R.target.value,10)||0}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"头像"}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:y.avatar,onChange:R=>x(T=>({...T,avatar:R.target.value})),placeholder:"点击上传或粘贴图片地址"}),e.jsx("input",{ref:w,type:"file",accept:"image/*",className:"hidden",onChange:b}),e.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:E,onClick:()=>{var R;return(R=w.current)==null?void 0:R.click()},children:[e.jsx(io,{className:"w-4 h-4 mr-2"}),E?"上传中...":"上传"]})]}),y.avatar&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:y.avatar.startsWith("http")?y.avatar:Ia(y.avatar),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"简介"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:y.intro,onChange:R=>x(T=>({...T,intro:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:y.tags,onChange:R=>x(T=>({...T,tags:R.target.value}))})]}),e.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[e.jsx(Z,{className:"text-gray-300 block mb-2",children:"价格配置(每个导师独立)"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),e.jsx(ie,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:y.priceSingle,onChange:R=>x(T=>({...T,priceSingle:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),e.jsx(ie,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:y.priceHalfYear,onChange:R=>x(T=>({...T,priceHalfYear:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),e.jsx(ie,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:y.priceYear,onChange:R=>x(T=>({...T,priceYear:R.target.value}))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"引言"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:y.quote,onChange:R=>x(T=>({...T,quote:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"为什么找(文本)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:y.whyFind,onChange:R=>x(T=>({...T,whyFind:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"提供什么(文本)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:y.offering,onChange:R=>x(T=>({...T,offering:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:y.judgmentStyle,onChange:R=>x(T=>({...T,judgmentStyle:R.target.value}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:y.enabled,onChange:R=>x(T=>({...T,enabled:R.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),e.jsx(Z,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:W,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})})]})}function MC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState("");async function m(){o(!0);try{const y=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",x=await Be(y);x!=null&&x.success&&x.data&&a(x.data)}catch(y){console.error("Load consultations error:",y)}finally{o(!1)}}h.useEffect(()=>{m()},[c]);const f={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},g={single:"单次",half_year:"半年",year:"年度"};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(ro,{className:"w-5 h-5 text-[#38bdac]"}),"导师预约列表"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师咨询预约记录"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:y=>u(y.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(f).map(([y,x])=>e.jsx("option",{value:y,children:x},y))]}),e.jsxs(q,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"用户ID"}),e.jsx(be,{className:"text-gray-400",children:"导师ID"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"金额"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(gs,{children:[r.map(y=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(ye,{className:"text-gray-300",children:y.id}),e.jsx(ye,{className:"text-gray-400",children:y.userId}),e.jsx(ye,{className:"text-gray-400",children:y.mentorId}),e.jsx(ye,{className:"text-gray-400",children:g[y.consultationType]||y.consultationType}),e.jsxs(ye,{className:"text-white",children:["¥",y.amount]}),e.jsx(ye,{className:"text-gray-400",children:f[y.status]||y.status}),e.jsx(ye,{className:"text-gray-500 text-sm",children:y.createdAt})]},y.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}const Sx={matchTypes:[{id:"partner",label:"超级个体",matchLabel:"超级个体",icon:"⭐",matchFromDB:!0,showJoinAfterMatch:!1,price:1,enabled:!0},{id:"investor",label:"资源对接",matchLabel:"资源对接",icon:"👥",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"mentor",label:"导师顾问",matchLabel:"导师顾问",icon:"❤️",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"team",label:"团队招募",matchLabel:"加入项目",icon:"🎮",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}],freeMatchLimit:3,matchPrice:1,settings:{enableFreeMatches:!0,enablePaidMatches:!0,maxMatchesPerDay:10}},AC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function DC(){const[r,a]=h.useState(Sx),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[m,f]=h.useState(!1),[g,y]=h.useState(null),[x,v]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await Be("/api/db/config/full?key=match_config"),I=(j==null?void 0:j.data)??(j==null?void 0:j.config);I&&a({...Sx,...I})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};h.useEffect(()=>{C()},[]);const E=async()=>{u(!0);try{const j=await yt("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});alert((j==null?void 0:j.success)!==!1?"配置保存成功!":"保存失败: "+((j==null?void 0:j.error)||"未知错误"))}catch(j){console.error(j),alert("保存失败")}finally{u(!1)}},P=j=>{y(j),v({...j}),f(!0)},w=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},b=()=>{if(!x.id||!x.label){alert("请填写类型ID和名称");return}const j=[...r.matchTypes];if(g){const I=j.findIndex(W=>W.id===g.id);I!==-1&&(j[I]={...x})}else{if(j.some(I=>I.id===x.id)){alert("类型ID已存在");return}j.push({...x})}a({...r,matchTypes:j}),f(!1)},N=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(I=>I.id!==j)})},k=j=>{a({...r,matchTypes:r.matchTypes.map(I=>I.id===j?{...I,enabled:!I.enabled}:I)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsxs(q,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]}),e.jsxs(q,{onClick:E,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"})," ",c?"保存中...":"保存配置"]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(nn,{className:"w-5 h-5 text-yellow-400"})," 基础设置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(ke,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(ie,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:j=>a({...r,freeMatchLimit:parseInt(j.target.value,10)||0})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(ie,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:j=>a({...r,matchPrice:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(ie,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:j=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:r.settings.enableFreeMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enableFreeMatches:j}})}),e.jsx(Z,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:r.settings.enablePaidMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enablePaidMatches:j}})}),e.jsx(Z,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"})," 匹配类型管理"]}),e.jsx(bt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(q,{onClick:w,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-1"})," 添加类型"]})]}),e.jsx(ke,{children:e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"图标"}),e.jsx(be,{className:"text-gray-400",children:"类型ID"}),e.jsx(be,{className:"text-gray-400",children:"显示名称"}),e.jsx(be,{className:"text-gray-400",children:"匹配标签"}),e.jsx(be,{className:"text-gray-400",children:"价格"}),e.jsx(be,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(gs,{children:r.matchTypes.map(j=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(ye,{className:"font-mono text-gray-300",children:j.id}),e.jsx(ye,{className:"text-white font-medium",children:j.label}),e.jsx(ye,{className:"text-gray-300",children:j.matchLabel}),e.jsx(ye,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(ye,{children:j.matchFromDB?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(ye,{children:e.jsx(dt,{checked:j.enabled,onCheckedChange:()=>k(j.id)})}),e.jsx(ye,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>P(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>N(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Wt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(St,{open:m,onOpenChange:f,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[g?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Pt,{className:"w-5 h-5 text-[#38bdac]"}),g?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:x.id,onChange:j=>v({...x,id:j.target.value}),disabled:!!g})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:AC.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${x.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...x,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"显示名称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:x.label,onChange:j=>v({...x,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"匹配标签"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:x.matchLabel,onChange:j=>v({...x,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(ie,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:x.price,onChange:j=>v({...x,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:x.matchFromDB,onCheckedChange:j=>v({...x,matchFromDB:j})}),e.jsx(Z,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:x.showJoinAfterMatch,onCheckedChange:j=>v({...x,showJoinAfterMatch:j})}),e.jsx(Z,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:x.enabled,onCheckedChange:j=>v({...x,enabled:j})}),e.jsx(Z,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>f(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(q,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"})," 保存"]})]})]})})]})}const Cx={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function LC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[g,y]=h.useState(""),[x,v]=h.useState(!0),[C,E]=h.useState(null);async function P(){v(!0),E(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(m)});g&&b.set("matchType",g);const N=await Be(`/api/db/match-records?${b}`);N!=null&&N.success?(a(N.records||[]),o(N.total??0)):E("加载匹配记录失败")}catch{E("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{P()},[c,g]);const w=Math.ceil(l/m)||1;return e.jsxs("div",{children:[C&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>E(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("p",{className:"text-gray-400",children:["共 ",l," 条匹配记录"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:g,onChange:b=>{y(b.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(Cx).map(([b,N])=>e.jsx("option",{value:b,children:N},b))]}),e.jsxs("button",{type:"button",onClick:P,disabled:x,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${x?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:x?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(gs,{children:[r.map(b=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.userAvatar?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none"}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.matchedUserAvatar?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none"}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(ye,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Cx[b.matchType]||b.matchType})}),e.jsxs(ye,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(ye,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Hs,{page:c,totalPages:w,total:l,pageSize:m,onPageChange:u,onPageSizeChange:b=>{f(b),u(1)}})]})})})]})}function OC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[g,y]=h.useState(!0);async function x(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(m),matchType:"investor"}),E=await Be(`/api/db/match-records?${C}`);E!=null&&E.success&&(a(E.records||[]),o(E.total??0))}catch(C){console.error(C)}finally{y(!1)}}h.useEffect(()=>{x()},[c]);const v=Math.ceil(l/m)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["资源对接匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户填写「我能帮到你什么」和「我需要什么帮助」后提交到存客宝"})]}),e.jsxs("button",{type:"button",onClick:x,disabled:g,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${g?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(gs,{children:[r.map(C=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(ye,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(ye,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(ye,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无资源对接记录"})})]})]}),e.jsx(Hs,{page:c,totalPages:v,total:l,pageSize:m,onPageChange:u,onPageSizeChange:C=>{f(C),u(1)}})]})})})]})}const kx={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},FC={single:"单次",half_year:"半年",year:"年度"};function zC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState("");async function m(){o(!0);try{const f=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",g=await Be(f);g!=null&&g.success&&g.data&&a(g.data)}catch(f){console.error(f)}finally{o(!1)}}return h.useEffect(()=>{m()},[c]),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("p",{className:"text-gray-400",children:"导师咨询预约记录"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:f=>u(f.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(kx).map(([f,g])=>e.jsx("option",{value:f,children:g},f))]}),e.jsxs(q,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(ke,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"用户ID"}),e.jsx(be,{className:"text-gray-400",children:"导师ID"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"金额"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(gs,{children:[r.map(f=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(ye,{className:"text-gray-300",children:f.id}),e.jsx(ye,{className:"text-gray-400",children:f.userId}),e.jsx(ye,{className:"text-gray-400",children:f.mentorId}),e.jsx(ye,{className:"text-gray-400",children:FC[f.consultationType]||f.consultationType}),e.jsxs(ye,{className:"text-white",children:["¥",f.amount]}),e.jsx(ye,{className:"text-gray-400",children:kx[f.status]||f.status}),e.jsx(ye,{className:"text-gray-500 text-sm",children:f.createdAt?new Date(f.createdAt).toLocaleString():"-"})]},f.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function $C(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[g,y]=h.useState(!0);async function x(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(m),matchType:"team"}),E=await Be(`/api/db/match-records?${C}`);E!=null&&E.success&&(a(E.records||[]),o(E.total??0))}catch(C){console.error(C)}finally{y(!1)}}h.useEffect(()=>{x()},[c]);const v=Math.ceil(l/m)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["团队招募匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户通过「团队招募」提交联系方式到存客宝"})]}),e.jsxs("button",{type:"button",onClick:x,disabled:g,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${g?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(ke,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(gs,{children:[r.map(C=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ye,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(ye,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(ye,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(ye,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),r.length===0&&e.jsx(Je,{children:e.jsx(ye,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无团队招募记录"})})]})]}),e.jsx(Hs,{page:c,totalPages:v,total:l,pageSize:m,onPageChange:u,onPageSizeChange:C=>{f(C),u(1)}})]})})})]})}function BC(){const[r,a]=h.useState(null),[l,o]=h.useState(!0),[c,u]=h.useState([{endpoint:"/api/ckb/join",label:"CKB 加入(ckb/join)",status:"idle"},{endpoint:"/api/ckb/match",label:"CKB 匹配上报(ckb/match)",status:"idle"},{endpoint:"/api/miniprogram/ckb/lead",label:"CKB 链接卡若(ckb/lead)",status:"idle"},{endpoint:"/api/match/config",label:"匹配配置(match/config)",status:"idle"}]),m={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"},f=h.useCallback(async()=>{o(!0);try{const x=await Be("/api/db/match-records?stats=true");if(x!=null&&x.success&&x.data)a(x.data);else{const v=await Be("/api/db/match-records?page=1&pageSize=1");v!=null&&v.success&&a({totalMatches:v.total??0,todayMatches:0,byType:[],uniqueUsers:0})}}catch(x){console.error("加载统计失败:",x)}finally{o(!1)}},[]);h.useEffect(()=>{f()},[f]);const g=async x=>{const v=c[x],C=[...c];C[x]={...v,status:"testing",message:void 0,responseTime:void 0},u(C);const E=performance.now();try{let P;v.endpoint.includes("match/config")?P=await Be(v.endpoint):P=await yt(v.endpoint,{type:"partner",phone:"00000000000",wechat:"test_ping",userId:"test_admin_ping",matchType:"partner",name:"接口测试"});const w=Math.round(performance.now()-E),b=[...c],N=(P==null?void 0:P.success)!==void 0||(P==null?void 0:P.code)===200||(P==null?void 0:P.code)===400;b[x]={...v,status:N?"success":"error",message:(P==null?void 0:P.message)||(N?"接口可用":"响应异常"),responseTime:w},u(b)}catch(P){const w=Math.round(performance.now()-E),b=[...c];b[x]={...v,status:"error",message:P instanceof Error?P.message:"请求失败",responseTime:w},u(b)}},y=async()=>{for(let x=0;x0&&e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsx(Ge,{className:"text-white text-lg",children:"按类型分布"})}),e.jsx(ke,{children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:r.byType.map(x=>e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-4 text-center",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:m[x.matchType]||x.matchType}),e.jsx("p",{className:"text-2xl font-bold text-white mt-2",children:x.count}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[r.totalMatches>0?(x.count/r.totalMatches*100).toFixed(1):0,"%"]})]},x.matchType))})})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(ln,{className:"w-5 h-5 text-[#38bdac]"}),"存客宝接口连通性测试"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"测试所有找伙伴相关的 CKB 接口是否正常可用"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(q,{onClick:f,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新统计"]}),e.jsxs(q,{onClick:y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(nn,{className:"w-4 h-4 mr-2"})," 全部测试"]})]})]}),e.jsx(ke,{children:e.jsx("div",{className:"space-y-3",children:c.map((x,v)=>e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[x.status==="idle"&&e.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-500"}),x.status==="testing"&&e.jsx($e,{className:"w-4 h-4 text-yellow-400 animate-spin"}),x.status==="success"&&e.jsx(Vd,{className:"w-4 h-4 text-green-400"}),x.status==="error"&&e.jsx($x,{className:"w-4 h-4 text-red-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm font-medium",children:x.label}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:x.endpoint})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[x.message&&e.jsx("span",{className:`text-xs ${x.status==="success"?"text-green-400":x.status==="error"?"text-red-400":"text-gray-400"}`,children:x.message}),x.responseTime!==void 0&&e.jsxs(Oe,{className:"bg-gray-700 text-gray-300 border-0",children:[x.responseTime,"ms"]}),e.jsx(q,{size:"sm",variant:"outline",onClick:()=>g(v),disabled:x.status==="testing",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent text-xs",children:"测试"})]})]},x.endpoint))})})]})]})}const UC=[{id:"pool",label:"匹配池",icon:Qt},{id:"records",label:"匹配记录",icon:Db},{id:"resource",label:"资源对接",icon:Sb},{id:"mentor",label:"导师预约",icon:bb},{id:"mentors-manage",label:"导师管理",icon:Bj},{id:"team",label:"团队招募",icon:Yd},{id:"stats",label:"存客宝统计",icon:Wj}];function VC(){const[r,a]=h.useState("pool");return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-6 h-6 text-[#38bdac]"}),"找伙伴"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理匹配池、匹配记录、资源对接、导师预约 / 导师管理、团队招募及存客宝数据统计"})]}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-6 bg-[#0f2137] rounded-lg p-1 border border-gray-700/50",children:UC.map(l=>{const o=r===l.id;return e.jsxs("button",{type:"button",onClick:()=>a(l.id),className:`flex items-center gap-2 px-4 py-2.5 rounded-md text-sm font-medium transition-all ${o?"bg-[#38bdac] text-white shadow-lg":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:[e.jsx(l.icon,{className:"w-4 h-4"}),l.label]},l.id)})}),r==="pool"&&e.jsx(DC,{}),r==="records"&&e.jsx(LC,{}),r==="resource"&&e.jsx(OC,{}),r==="mentor"&&e.jsx(zC,{}),r==="mentors-manage"&&e.jsx("div",{className:"-mx-8 -mt-0",children:e.jsx(Sg,{embedded:!0})}),r==="team"&&e.jsx($C,{}),r==="stats"&&e.jsx(BC,{})]})}function WC(){return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[e.jsx(ln,{className:"w-8 h-8 text-[#38bdac]"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"API 接口文档"})]}),e.jsx("p",{className:"text-gray-400 mb-6",children:"API 风格:RESTful · 版本 v1.0 · 基础路径 /api · 简单、清晰、易用。"}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Ge,{className:"text-white",children:"1. 接口总览"})}),e.jsxs(ke,{className:"space-y-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"接口分类"}),e.jsxs("ul",{className:"space-y-1 text-gray-300 font-mono",children:[e.jsx("li",{children:"/api/book — 书籍内容(章节列表、内容获取、同步)"}),e.jsx("li",{children:"/api/payment — 支付系统(订单创建、回调、状态查询)"}),e.jsx("li",{children:"/api/referral — 分销系统(邀请码、收益、提现)"}),e.jsx("li",{children:"/api/user — 用户系统(登录、注册、信息更新)"}),e.jsx("li",{children:"/api/match — 匹配系统(寻找匹配、匹配历史)"}),e.jsx("li",{children:"/api/admin — 管理后台(内容/订单/用户/分销管理)"}),e.jsx("li",{children:"/api/config — 配置系统"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"认证方式"}),e.jsx("p",{className:"text-gray-300",children:"用户:Cookie session_id(可选)"}),e.jsx("p",{className:"text-gray-300",children:"管理端:Authorization: Bearer admin-token-secret"})]})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Ge,{className:"text-white",children:"2. 书籍内容"})}),e.jsxs(ke,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET /api/book/all-chapters — 获取所有章节"}),e.jsx("p",{children:"GET /api/book/chapter/:id — 获取单章内容"}),e.jsx("p",{children:"POST /api/book/sync — 同步章节(需管理员认证)"})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Ge,{className:"text-white",children:"3. 支付"})}),e.jsxs(ke,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"POST /api/payment/create-order — 创建订单"}),e.jsx("p",{children:"POST /api/payment/alipay/notify — 支付宝回调"}),e.jsx("p",{children:"POST /api/payment/wechat/notify — 微信回调"})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Ge,{className:"text-white",children:"4. 分销与用户"})}),e.jsxs(ke,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"/api/referral/* — 邀请码、收益查询、提现"}),e.jsx("p",{children:"/api/user/* — 登录、注册、信息更新"}),e.jsx("p",{children:"/api/match/* — 匹配、匹配历史"})]})]}),e.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Ge,{className:"text-white",children:"5. 管理后台"})}),e.jsxs(ke,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET/POST /api/admin/referral-settings — 推广/分销设置(含 VIP 配置)"}),e.jsx("p",{children:"GET /api/db/users、/api/db/book — 用户与章节数据"}),e.jsx("p",{children:"GET /api/orders — 订单列表"})]})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"完整说明见项目内 开发文档/5、接口/API接口完整文档.md"})]})}function HC(){const r=xn();return e.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-red-500/20 text-red-400 mb-6",children:e.jsx(qj,{className:"w-10 h-10"})}),e.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),e.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),e.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:r.pathname}),e.jsx(q,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:e.jsxs(Ji,{to:"/",children:[e.jsx(kb,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function KC(){return e.jsxs(yj,{children:[e.jsx(pt,{path:"/login",element:e.jsx(Sw,{})}),e.jsxs(pt,{path:"/",element:e.jsx(EN,{}),children:[e.jsx(pt,{index:!0,element:e.jsx(bd,{to:"/dashboard",replace:!0})}),e.jsx(pt,{path:"dashboard",element:e.jsx(kw,{})}),e.jsx(pt,{path:"orders",element:e.jsx(u2,{})}),e.jsx(pt,{path:"users",element:e.jsx(F2,{})}),e.jsx(pt,{path:"distribution",element:e.jsx(l4,{})}),e.jsx(pt,{path:"withdrawals",element:e.jsx(i4,{})}),e.jsx(pt,{path:"content",element:e.jsx(fC,{})}),e.jsx(pt,{path:"referral-settings",element:e.jsx(C0,{})}),e.jsx(pt,{path:"author-settings",element:e.jsx(bd,{to:"/settings?tab=author",replace:!0})}),e.jsx(pt,{path:"admin-users",element:e.jsx(bd,{to:"/settings?tab=admin",replace:!0})}),e.jsx(pt,{path:"vip-roles",element:e.jsx(_C,{})}),e.jsx(pt,{path:"mentors",element:e.jsx(Sg,{})}),e.jsx(pt,{path:"mentor-consultations",element:e.jsx(MC,{})}),e.jsx(pt,{path:"settings",element:e.jsx(NC,{})}),e.jsx(pt,{path:"payment",element:e.jsx(wC,{})}),e.jsx(pt,{path:"site",element:e.jsx(EC,{})}),e.jsx(pt,{path:"qrcodes",element:e.jsx(PC,{})}),e.jsx(pt,{path:"find-partner",element:e.jsx(VC,{})}),e.jsx(pt,{path:"match",element:e.jsx(RC,{})}),e.jsx(pt,{path:"match-records",element:e.jsx(IC,{})}),e.jsx(pt,{path:"api-doc",element:e.jsx(WC,{})})]}),e.jsx(pt,{path:"*",element:e.jsx(HC,{})})]})}Nv.createRoot(document.getElementById("root")).render(e.jsx(h.StrictMode,{children:e.jsx(kj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:e.jsx(KC,{})})})); diff --git a/soul-admin/dist/assets/index-BRP7wZez.css b/soul-admin/dist/assets/index-Y-uxw2Gi.css similarity index 64% rename from soul-admin/dist/assets/index-BRP7wZez.css rename to soul-admin/dist/assets/index-Y-uxw2Gi.css index 5c9394d0..d1c34651 100644 --- a/soul-admin/dist/assets/index-BRP7wZez.css +++ b/soul-admin/dist/assets/index-Y-uxw2Gi.css @@ -1 +1 @@ -/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-xl:24px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.-top-2\.5{top:calc(var(--spacing)*-2.5)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-4{top:calc(var(--spacing)*4)}.top-16{top:calc(var(--spacing)*16)}.top-\[50\%\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-1\/4{right:25%}.right-4{right:calc(var(--spacing)*4)}.bottom-1\/4{bottom:25%}.-left-2\.5{left:calc(var(--spacing)*-2.5)}.left-0{left:calc(var(--spacing)*0)}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.z-10{z-index:10}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.mx-20{margin-inline:calc(var(--spacing)*20)}.mx-auto{margin-inline:auto}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-6{margin-left:calc(var(--spacing)*6)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.h-0\.5{height:calc(var(--spacing)*.5)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-96{height:calc(var(--spacing)*96)}.h-\[75vh\]{height:75vh}.h-auto{height:auto}.h-full{height:100%}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[250px\]{max-height:250px}.max-h-\[300px\]{max-height:300px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\[32px\]{min-height:32px}.min-h-\[40px\]{min-height:40px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[80px\]{min-height:80px}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[300px\]{min-height:300px}.min-h-\[400px\]{min-height:400px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-0\.5{width:calc(var(--spacing)*.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-48{width:calc(var(--spacing)*48)}.w-56{width:calc(var(--spacing)*56)}.w-64{width:calc(var(--spacing)*64)}.w-96{width:calc(var(--spacing)*96)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-\[100px\]{max-width:100px}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[120px\]{min-width:120px}.min-w-\[1024px\]{min-width:1024px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-1\/2{--tw-translate-x: 50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-none{translate:none}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.scale-\[0\.98\]{scale:.98}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,)var(--tw-pan-y,)var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}:where(.divide-gray-700\/50>:not(:last-child)){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){:where(.divide-gray-700\/50>:not(:last-child)){border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}:where(.divide-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-\[\#07C160\]{border-color:#07c160}.border-\[\#07C160\]\/20{border-color:#07c16033}.border-\[\#07C160\]\/30{border-color:#07c1604d}.border-\[\#38bdac\]{border-color:#38bdac}.border-\[\#38bdac\]\/20{border-color:#38bdac33}.border-\[\#38bdac\]\/30{border-color:#38bdac4d}.border-\[\#38bdac\]\/40{border-color:#38bdac66}.border-\[\#38bdac\]\/50{border-color:#38bdac80}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500)40%,transparent)}}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.border-blue-500\/40{border-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/40{border-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.border-blue-500\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/30{border-color:color-mix(in oklab,var(--color-cyan-500)30%,transparent)}}.border-cyan-500\/40{border-color:#00b7d766}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/40{border-color:color-mix(in oklab,var(--color-cyan-500)40%,transparent)}}.border-gray-500{border-color:var(--color-gray-500)}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-700\/30{border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/30{border-color:color-mix(in oklab,var(--color-gray-700)30%,transparent)}}.border-gray-700\/50{border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/50{border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-green-500\/40{border-color:#00c75866}@supports (color:color-mix(in lab,red,red)){.border-green-500\/40{border-color:color-mix(in oklab,var(--color-green-500)40%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.border-orange-500\/40{border-color:#fe6e0066}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/40{border-color:color-mix(in oklab,var(--color-orange-500)40%,transparent)}}.border-orange-500\/50{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/50{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.border-purple-500\/20{border-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/20{border-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.border-purple-500\/40{border-color:#ac4bff66}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/40{border-color:color-mix(in oklab,var(--color-purple-500)40%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.border-red-500\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/30{border-color:color-mix(in oklab,var(--color-yellow-500)30%,transparent)}}.border-yellow-500\/40{border-color:#edb20066}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/40{border-color:color-mix(in oklab,var(--color-yellow-500)40%,transparent)}}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#0a1628\]\/50{background-color:#0a162880}.bg-\[\#0f2137\]{background-color:#0f2137}.bg-\[\#00CED1\]{background-color:#00ced1}.bg-\[\#1C1C1E\]{background-color:#1c1c1e}.bg-\[\#07C160\]{background-color:#07c160}.bg-\[\#07C160\]\/5{background-color:#07c1600d}.bg-\[\#07C160\]\/10{background-color:#07c1601a}.bg-\[\#38bdac\]{background-color:#38bdac}.bg-\[\#38bdac\]\/5{background-color:#38bdac0d}.bg-\[\#38bdac\]\/10{background-color:#38bdac1a}.bg-\[\#38bdac\]\/15{background-color:#38bdac26}.bg-\[\#38bdac\]\/20{background-color:#38bdac33}.bg-\[\#38bdac\]\/30{background-color:#38bdac4d}.bg-\[\#38bdac\]\/60{background-color:#38bdac99}.bg-\[\#38bdac\]\/80{background-color:#38bdaccc}.bg-\[\#162840\]{background-color:#162840}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/90{background-color:#000000e6}@supports (color:color-mix(in lab,red,red)){.bg-black\/90{background-color:color-mix(in oklab,var(--color-black)90%,transparent)}}.bg-blue-500\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-600\/50{background-color:#4a556580}@supports (color:color-mix(in lab,red,red)){.bg-gray-600\/50{background-color:color-mix(in oklab,var(--color-gray-600)50%,transparent)}}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-700\/50{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.bg-gray-700\/50{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#00CED1\]{--tw-gradient-from:#00ced1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#38bdac\]\/10{--tw-gradient-from:oklab(72.378% -.11483 -.0053193/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-blue-500\/20{--tw-gradient-from:#3080ff33}@supports (color:color-mix(in lab,red,red)){.from-blue-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.from-blue-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-cyan-500\/20{--tw-gradient-from:#00b7d733}@supports (color:color-mix(in lab,red,red)){.from-cyan-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.from-cyan-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-green-500\/20{--tw-gradient-from:#00c75833}@supports (color:color-mix(in lab,red,red)){.from-green-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.from-green-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-500\/20{--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.from-purple-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.from-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-yellow-500\/20{--tw-gradient-from:#edb20033}@supports (color:color-mix(in lab,red,red)){.from-yellow-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.from-yellow-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-\[\#38bdac\]\/30{--tw-gradient-via:oklab(72.378% -.11483 -.0053193/.3);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-\[\#0f2137\]{--tw-gradient-to:#0f2137;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#20B2AA\]{--tw-gradient-to:#20b2aa;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-amber-500\/20{--tw-gradient-to:#f99c0033}@supports (color:color-mix(in lab,red,red)){.to-amber-500\/20{--tw-gradient-to:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.to-amber-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-500\/5{--tw-gradient-to:#00b7d70d}@supports (color:color-mix(in lab,red,red)){.to-cyan-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-cyan-500)5%,transparent)}}.to-cyan-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-green-500\/5{--tw-gradient-to:#00c7580d}@supports (color:color-mix(in lab,red,red)){.to-green-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-green-500)5%,transparent)}}.to-green-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-500\/5{--tw-gradient-to:#ac4bff0d}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-purple-500)5%,transparent)}}.to-purple-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-yellow-500\/5{--tw-gradient-to:#edb2000d}@supports (color:color-mix(in lab,red,red)){.to-yellow-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-yellow-500)5%,transparent)}}.to-yellow-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-repeat{background-repeat:repeat}.mask-no-clip{-webkit-mask-clip:no-clip;mask-clip:no-clip}.mask-repeat{-webkit-mask-repeat:repeat;mask-repeat:repeat}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.py-16{padding-block:calc(var(--spacing)*16)}.py-20{padding-block:calc(var(--spacing)*20)}.py-24{padding-block:calc(var(--spacing)*24)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#00CED1\]{color:#00ced1}.text-\[\#07C160\]{color:#07c160}.text-\[\#07C160\]\/60{color:#07c16099}.text-\[\#07C160\]\/70{color:#07c160b3}.text-\[\#07C160\]\/80{color:#07c160cc}.text-\[\#26A17B\]{color:#26a17b}.text-\[\#38bdac\]{color:#38bdac}.text-\[\#38bdac\]\/30{color:#38bdac4d}.text-\[\#38bdac\]\/40{color:#38bdac66}.text-\[\#38bdac\]\/50{color:#38bdac80}.text-\[\#169BD7\]{color:#169bd7}.text-\[\#1677FF\]{color:#1677ff}.text-\[\#FFD700\]{color:gold}.text-amber-200{color:var(--color-amber-200)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/30{color:#fcbb004d}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/30{color:color-mix(in oklab,var(--color-amber-400)30%,transparent)}}.text-amber-400\/90{color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/90{color:color-mix(in oklab,var(--color-amber-400)90%,transparent)}}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-blue-300\/60{color:#90c5ff99}@supports (color:color-mix(in lab,red,red)){.text-blue-300\/60{color:color-mix(in oklab,var(--color-blue-300)60%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-400\/50{color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.text-blue-400\/50{color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-green-400{color:var(--color-green-400)}.text-green-400\/50{color:#05df7280}@supports (color:color-mix(in lab,red,red)){.text-green-400\/50{color:color-mix(in oklab,var(--color-green-400)50%,transparent)}}.text-green-500{color:var(--color-green-500)}.text-orange-300{color:var(--color-orange-300)}.text-orange-300\/60{color:#ffb96d99}@supports (color:color-mix(in lab,red,red)){.text-orange-300\/60{color:color-mix(in oklab,var(--color-orange-300)60%,transparent)}}.text-orange-400{color:var(--color-orange-400)}.text-orange-400\/80{color:#ff8b1acc}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/80{color:color-mix(in oklab,var(--color-orange-400)80%,transparent)}}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white)40%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-400\/50{color:#fac80080}@supports (color:color-mix(in lab,red,red)){.text-yellow-400\/50{color:color-mix(in oklab,var(--color-yellow-400)50%,transparent)}}.text-yellow-500\/70{color:#edb200b3}@supports (color:color-mix(in lab,red,red)){.text-yellow-500\/70{color:color-mix(in oklab,var(--color-yellow-500)70%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-55{opacity:.55}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[\#38bdac\]\/20{--tw-shadow-color:#38bdac33}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#38bdac\]\/30{--tw-shadow-color:#38bdac4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.3) var(--tw-shadow-alpha),transparent)}}.ring-\[\#38bdac\]{--tw-ring-color:#38bdac}.ring-\[\#38bdac\]\/40{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.4)}.ring-\[\#38bdac\]\/50{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.5)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)!important}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:text-\[\#38bdac\]:is(:where(.group):hover *){color:#38bdac}.group-hover\:text-gray-400:is(:where(.group):hover *){color:var(--color-gray-400)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.placeholder\:text-gray-500::placeholder{color:var(--color-gray-500)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[\#38bdac\]\/30:hover{border-color:#38bdac4d}.hover\:border-\[\#38bdac\]\/50:hover{border-color:#38bdac80}.hover\:border-amber-500\/40:hover{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.hover\:border-amber-500\/40:hover{border-color:color-mix(in oklab,var(--color-amber-500)40%,transparent)}}.hover\:border-gray-500:hover{border-color:var(--color-gray-500)}.hover\:bg-\[\#0a1628\]:hover{background-color:#0a1628}.hover\:bg-\[\#1a3050\]:hover{background-color:#1a3050}.hover\:bg-\[\#2da396\]:hover{background-color:#2da396}.hover\:bg-\[\#06AD51\]:hover{background-color:#06ad51}.hover\:bg-\[\#07C160\]\/10:hover{background-color:#07c1601a}.hover\:bg-\[\#20B2AA\]:hover{background-color:#20b2aa}.hover\:bg-\[\#38bdac\]\/10:hover{background-color:#38bdac1a}.hover\:bg-\[\#38bdac\]\/20:hover{background-color:#38bdac33}.hover\:bg-\[\#162840\]\/30:hover{background-color:#1628404d}.hover\:bg-\[\#162840\]\/50:hover{background-color:#16284080}.hover\:bg-amber-400\/10:hover{background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-400\/10:hover{background-color:color-mix(in oklab,var(--color-amber-400)10%,transparent)}}.hover\:bg-amber-500\/10:hover{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/10:hover{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.hover\:bg-amber-500\/20:hover{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/20:hover{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-blue-400\/10:hover{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-400\/10:hover{background-color:color-mix(in oklab,var(--color-blue-400)10%,transparent)}}.hover\:bg-blue-500\/20:hover{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-500\/20:hover{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.hover\:bg-gray-500:hover{background-color:var(--color-gray-500)}.hover\:bg-gray-500\/20:hover{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-500\/20:hover{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.hover\:bg-gray-700\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-700\/50:hover{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-purple-500\/10:hover{background-color:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/10:hover{background-color:color-mix(in oklab,var(--color-purple-500)10%,transparent)}}.hover\:bg-purple-500\/20:hover{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/20:hover{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.hover\:bg-purple-500\/30:hover{background-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/30:hover{background-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\:bg-yellow-400\/10:hover{background-color:#fac8001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-400\/10:hover{background-color:color-mix(in oklab,var(--color-yellow-400)10%,transparent)}}.hover\:bg-yellow-500\/20:hover{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-500\/20:hover{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.hover\:text-\[\#38bdac\]:hover{color:#38bdac}.hover\:text-amber-300:hover{color:var(--color-amber-300)}.hover\:text-amber-400:hover{color:var(--color-amber-400)}.hover\:text-blue-400:hover{color:var(--color-blue-400)}.hover\:text-gray-300:hover{color:var(--color-gray-300)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-yellow-400:hover{color:var(--color-yellow-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:border-\[\#38bdac\]:focus{border-color:#38bdac}.focus\:bg-\[\#38bdac\]\/20:focus{background-color:#38bdac33}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#38bdac\]:focus{--tw-ring-color:#38bdac}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[\#38bdac\]:focus-visible{--tw-ring-color:#38bdac}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-\[\#0a1628\]:focus-visible{--tw-ring-offset-color:#0a1628}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-\[\#07C160\]\/20[data-state=active]{background-color:#07c16033}.data-\[state\=active\]\:bg-\[\#26A17B\]\/20[data-state=active]{background-color:#26a17b33}.data-\[state\=active\]\:bg-\[\#38bdac\]\/20[data-state=active]{background-color:#38bdac33}.data-\[state\=active\]\:bg-\[\#1677FF\]\/20[data-state=active]{background-color:#1677ff33}.data-\[state\=active\]\:bg-\[\#003087\]\/20[data-state=active]{background-color:#00308733}.data-\[state\=active\]\:font-medium[data-state=active]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[state\=active\]\:text-\[\#07C160\][data-state=active]{color:#07c160}.data-\[state\=active\]\:text-\[\#26A17B\][data-state=active]{color:#26a17b}.data-\[state\=active\]\:text-\[\#38bdac\][data-state=active]{color:#38bdac}.data-\[state\=active\]\:text-\[\#169BD7\][data-state=active]{color:#169bd7}.data-\[state\=active\]\:text-\[\#1677FF\][data-state=active]{color:#1677ff}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[\#38bdac\][data-state=checked]{background-color:#38bdac}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-gray-600[data-state=unchecked]{background-color:var(--color-gray-600)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(min-width:64rem){.lg\:block{display:block}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}}:root{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20% .02 240);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20% .02 240);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(65% .15 180);--primary-foreground:oklch(20% 0 0);--secondary:oklch(27% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27% 0 0);--muted-foreground:oklch(65% 0 0);--accent:oklch(27% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(55% .2 25);--destructive-foreground:oklch(98.5% 0 0);--border:oklch(35% 0 0);--input:oklch(35% 0 0);--ring:oklch(65% .15 180);--radius:.625rem}body{font-family:var(--font-sans);color:var(--foreground);background:#0a1628}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} +/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-xl:24px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.-top-2\.5{top:calc(var(--spacing)*-2.5)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-4{top:calc(var(--spacing)*4)}.top-16{top:calc(var(--spacing)*16)}.top-\[50\%\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-1\/4{right:25%}.right-4{right:calc(var(--spacing)*4)}.bottom-1\/4{bottom:25%}.-left-2\.5{left:calc(var(--spacing)*-2.5)}.left-0{left:calc(var(--spacing)*0)}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.z-10{z-index:10}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.-mx-8{margin-inline:calc(var(--spacing)*-8)}.mx-20{margin-inline:calc(var(--spacing)*20)}.mx-auto{margin-inline:auto}.-mt-0{margin-top:calc(var(--spacing)*0)}.-mt-6{margin-top:calc(var(--spacing)*-6)}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-6{margin-left:calc(var(--spacing)*6)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.h-0\.5{height:calc(var(--spacing)*.5)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-96{height:calc(var(--spacing)*96)}.h-\[75vh\]{height:75vh}.h-auto{height:auto}.h-full{height:100%}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[250px\]{max-height:250px}.max-h-\[300px\]{max-height:300px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\[32px\]{min-height:32px}.min-h-\[40px\]{min-height:40px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[80px\]{min-height:80px}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[300px\]{min-height:300px}.min-h-\[400px\]{min-height:400px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-0\.5{width:calc(var(--spacing)*.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-48{width:calc(var(--spacing)*48)}.w-56{width:calc(var(--spacing)*56)}.w-64{width:calc(var(--spacing)*64)}.w-96{width:calc(var(--spacing)*96)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-\[100px\]{max-width:100px}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[120px\]{min-width:120px}.min-w-\[1024px\]{min-width:1024px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-1\/2{--tw-translate-x: 50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-none{translate:none}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.scale-\[0\.98\]{scale:.98}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,)var(--tw-pan-y,)var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}:where(.divide-gray-700\/50>:not(:last-child)){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){:where(.divide-gray-700\/50>:not(:last-child)){border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}:where(.divide-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-\[\#07C160\]{border-color:#07c160}.border-\[\#07C160\]\/20{border-color:#07c16033}.border-\[\#07C160\]\/30{border-color:#07c1604d}.border-\[\#38bdac\]{border-color:#38bdac}.border-\[\#38bdac\]\/20{border-color:#38bdac33}.border-\[\#38bdac\]\/30{border-color:#38bdac4d}.border-\[\#38bdac\]\/40{border-color:#38bdac66}.border-\[\#38bdac\]\/50{border-color:#38bdac80}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500)40%,transparent)}}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.border-blue-500\/40{border-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/40{border-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.border-blue-500\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/30{border-color:color-mix(in oklab,var(--color-cyan-500)30%,transparent)}}.border-cyan-500\/40{border-color:#00b7d766}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/40{border-color:color-mix(in oklab,var(--color-cyan-500)40%,transparent)}}.border-gray-500{border-color:var(--color-gray-500)}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-700\/30{border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/30{border-color:color-mix(in oklab,var(--color-gray-700)30%,transparent)}}.border-gray-700\/50{border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/50{border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-green-500\/40{border-color:#00c75866}@supports (color:color-mix(in lab,red,red)){.border-green-500\/40{border-color:color-mix(in oklab,var(--color-green-500)40%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.border-orange-500\/40{border-color:#fe6e0066}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/40{border-color:color-mix(in oklab,var(--color-orange-500)40%,transparent)}}.border-orange-500\/50{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/50{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.border-purple-500\/20{border-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/20{border-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.border-purple-500\/40{border-color:#ac4bff66}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/40{border-color:color-mix(in oklab,var(--color-purple-500)40%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.border-red-500\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/30{border-color:color-mix(in oklab,var(--color-yellow-500)30%,transparent)}}.border-yellow-500\/40{border-color:#edb20066}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/40{border-color:color-mix(in oklab,var(--color-yellow-500)40%,transparent)}}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#0a1628\]\/50{background-color:#0a162880}.bg-\[\#0f2137\]{background-color:#0f2137}.bg-\[\#00CED1\]{background-color:#00ced1}.bg-\[\#1C1C1E\]{background-color:#1c1c1e}.bg-\[\#07C160\]{background-color:#07c160}.bg-\[\#07C160\]\/5{background-color:#07c1600d}.bg-\[\#07C160\]\/10{background-color:#07c1601a}.bg-\[\#38bdac\]{background-color:#38bdac}.bg-\[\#38bdac\]\/5{background-color:#38bdac0d}.bg-\[\#38bdac\]\/10{background-color:#38bdac1a}.bg-\[\#38bdac\]\/15{background-color:#38bdac26}.bg-\[\#38bdac\]\/20{background-color:#38bdac33}.bg-\[\#38bdac\]\/30{background-color:#38bdac4d}.bg-\[\#38bdac\]\/60{background-color:#38bdac99}.bg-\[\#38bdac\]\/80{background-color:#38bdaccc}.bg-\[\#162840\]{background-color:#162840}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/90{background-color:#000000e6}@supports (color:color-mix(in lab,red,red)){.bg-black\/90{background-color:color-mix(in oklab,var(--color-black)90%,transparent)}}.bg-blue-500\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-600\/50{background-color:#4a556580}@supports (color:color-mix(in lab,red,red)){.bg-gray-600\/50{background-color:color-mix(in oklab,var(--color-gray-600)50%,transparent)}}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-700\/50{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.bg-gray-700\/50{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#00CED1\]{--tw-gradient-from:#00ced1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#38bdac\]\/10{--tw-gradient-from:oklab(72.378% -.11483 -.0053193/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-blue-500\/20{--tw-gradient-from:#3080ff33}@supports (color:color-mix(in lab,red,red)){.from-blue-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.from-blue-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-cyan-500\/20{--tw-gradient-from:#00b7d733}@supports (color:color-mix(in lab,red,red)){.from-cyan-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.from-cyan-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-green-500\/20{--tw-gradient-from:#00c75833}@supports (color:color-mix(in lab,red,red)){.from-green-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.from-green-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-500\/20{--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.from-purple-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.from-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-yellow-500\/20{--tw-gradient-from:#edb20033}@supports (color:color-mix(in lab,red,red)){.from-yellow-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.from-yellow-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-\[\#38bdac\]\/30{--tw-gradient-via:oklab(72.378% -.11483 -.0053193/.3);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-\[\#0f2137\]{--tw-gradient-to:#0f2137;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#20B2AA\]{--tw-gradient-to:#20b2aa;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-amber-500\/20{--tw-gradient-to:#f99c0033}@supports (color:color-mix(in lab,red,red)){.to-amber-500\/20{--tw-gradient-to:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.to-amber-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-500\/5{--tw-gradient-to:#00b7d70d}@supports (color:color-mix(in lab,red,red)){.to-cyan-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-cyan-500)5%,transparent)}}.to-cyan-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-green-500\/5{--tw-gradient-to:#00c7580d}@supports (color:color-mix(in lab,red,red)){.to-green-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-green-500)5%,transparent)}}.to-green-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-500\/5{--tw-gradient-to:#ac4bff0d}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-purple-500)5%,transparent)}}.to-purple-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-yellow-500\/5{--tw-gradient-to:#edb2000d}@supports (color:color-mix(in lab,red,red)){.to-yellow-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-yellow-500)5%,transparent)}}.to-yellow-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-repeat{background-repeat:repeat}.mask-no-clip{-webkit-mask-clip:no-clip;mask-clip:no-clip}.mask-repeat{-webkit-mask-repeat:repeat;mask-repeat:repeat}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.py-16{padding-block:calc(var(--spacing)*16)}.py-20{padding-block:calc(var(--spacing)*20)}.py-24{padding-block:calc(var(--spacing)*24)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#00CED1\]{color:#00ced1}.text-\[\#07C160\]{color:#07c160}.text-\[\#07C160\]\/60{color:#07c16099}.text-\[\#07C160\]\/70{color:#07c160b3}.text-\[\#07C160\]\/80{color:#07c160cc}.text-\[\#26A17B\]{color:#26a17b}.text-\[\#38bdac\]{color:#38bdac}.text-\[\#38bdac\]\/30{color:#38bdac4d}.text-\[\#38bdac\]\/40{color:#38bdac66}.text-\[\#38bdac\]\/50{color:#38bdac80}.text-\[\#169BD7\]{color:#169bd7}.text-\[\#1677FF\]{color:#1677ff}.text-\[\#FFD700\]{color:gold}.text-amber-200{color:var(--color-amber-200)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/30{color:#fcbb004d}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/30{color:color-mix(in oklab,var(--color-amber-400)30%,transparent)}}.text-amber-400\/90{color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/90{color:color-mix(in oklab,var(--color-amber-400)90%,transparent)}}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-blue-300\/60{color:#90c5ff99}@supports (color:color-mix(in lab,red,red)){.text-blue-300\/60{color:color-mix(in oklab,var(--color-blue-300)60%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-400\/50{color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.text-blue-400\/50{color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-green-400{color:var(--color-green-400)}.text-green-400\/50{color:#05df7280}@supports (color:color-mix(in lab,red,red)){.text-green-400\/50{color:color-mix(in oklab,var(--color-green-400)50%,transparent)}}.text-green-500{color:var(--color-green-500)}.text-orange-300{color:var(--color-orange-300)}.text-orange-300\/60{color:#ffb96d99}@supports (color:color-mix(in lab,red,red)){.text-orange-300\/60{color:color-mix(in oklab,var(--color-orange-300)60%,transparent)}}.text-orange-400{color:var(--color-orange-400)}.text-orange-400\/80{color:#ff8b1acc}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/80{color:color-mix(in oklab,var(--color-orange-400)80%,transparent)}}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white)40%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-400\/50{color:#fac80080}@supports (color:color-mix(in lab,red,red)){.text-yellow-400\/50{color:color-mix(in oklab,var(--color-yellow-400)50%,transparent)}}.text-yellow-500\/70{color:#edb200b3}@supports (color:color-mix(in lab,red,red)){.text-yellow-500\/70{color:color-mix(in oklab,var(--color-yellow-500)70%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-55{opacity:.55}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[\#38bdac\]\/20{--tw-shadow-color:#38bdac33}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#38bdac\]\/30{--tw-shadow-color:#38bdac4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.3) var(--tw-shadow-alpha),transparent)}}.ring-\[\#38bdac\]{--tw-ring-color:#38bdac}.ring-\[\#38bdac\]\/40{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.4)}.ring-\[\#38bdac\]\/50{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.5)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)!important}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:text-\[\#38bdac\]:is(:where(.group):hover *){color:#38bdac}.group-hover\:text-gray-400:is(:where(.group):hover *){color:var(--color-gray-400)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.placeholder\:text-gray-500::placeholder{color:var(--color-gray-500)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[\#38bdac\]\/30:hover{border-color:#38bdac4d}.hover\:border-\[\#38bdac\]\/50:hover{border-color:#38bdac80}.hover\:border-amber-500\/40:hover{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.hover\:border-amber-500\/40:hover{border-color:color-mix(in oklab,var(--color-amber-500)40%,transparent)}}.hover\:border-gray-500:hover{border-color:var(--color-gray-500)}.hover\:bg-\[\#0a1628\]:hover{background-color:#0a1628}.hover\:bg-\[\#1a3050\]:hover{background-color:#1a3050}.hover\:bg-\[\#2da396\]:hover{background-color:#2da396}.hover\:bg-\[\#06AD51\]:hover{background-color:#06ad51}.hover\:bg-\[\#07C160\]\/10:hover{background-color:#07c1601a}.hover\:bg-\[\#20B2AA\]:hover{background-color:#20b2aa}.hover\:bg-\[\#38bdac\]\/10:hover{background-color:#38bdac1a}.hover\:bg-\[\#38bdac\]\/20:hover{background-color:#38bdac33}.hover\:bg-\[\#162840\]\/30:hover{background-color:#1628404d}.hover\:bg-\[\#162840\]\/50:hover{background-color:#16284080}.hover\:bg-amber-400\/10:hover{background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-400\/10:hover{background-color:color-mix(in oklab,var(--color-amber-400)10%,transparent)}}.hover\:bg-amber-500\/10:hover{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/10:hover{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.hover\:bg-amber-500\/20:hover{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/20:hover{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-blue-400\/10:hover{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-400\/10:hover{background-color:color-mix(in oklab,var(--color-blue-400)10%,transparent)}}.hover\:bg-blue-500\/20:hover{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-500\/20:hover{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.hover\:bg-gray-500:hover{background-color:var(--color-gray-500)}.hover\:bg-gray-500\/20:hover{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-500\/20:hover{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.hover\:bg-gray-700\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-700\/50:hover{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-purple-500\/10:hover{background-color:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/10:hover{background-color:color-mix(in oklab,var(--color-purple-500)10%,transparent)}}.hover\:bg-purple-500\/20:hover{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/20:hover{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.hover\:bg-purple-500\/30:hover{background-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/30:hover{background-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\:bg-yellow-400\/10:hover{background-color:#fac8001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-400\/10:hover{background-color:color-mix(in oklab,var(--color-yellow-400)10%,transparent)}}.hover\:bg-yellow-500\/20:hover{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-500\/20:hover{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.hover\:text-\[\#38bdac\]:hover{color:#38bdac}.hover\:text-amber-300:hover{color:var(--color-amber-300)}.hover\:text-amber-400:hover{color:var(--color-amber-400)}.hover\:text-blue-400:hover{color:var(--color-blue-400)}.hover\:text-gray-300:hover{color:var(--color-gray-300)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-yellow-400:hover{color:var(--color-yellow-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:border-\[\#38bdac\]:focus{border-color:#38bdac}.focus\:bg-\[\#38bdac\]\/20:focus{background-color:#38bdac33}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#38bdac\]:focus{--tw-ring-color:#38bdac}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[\#38bdac\]:focus-visible{--tw-ring-color:#38bdac}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-\[\#0a1628\]:focus-visible{--tw-ring-offset-color:#0a1628}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-\[\#07C160\]\/20[data-state=active]{background-color:#07c16033}.data-\[state\=active\]\:bg-\[\#26A17B\]\/20[data-state=active]{background-color:#26a17b33}.data-\[state\=active\]\:bg-\[\#38bdac\]\/20[data-state=active]{background-color:#38bdac33}.data-\[state\=active\]\:bg-\[\#1677FF\]\/20[data-state=active]{background-color:#1677ff33}.data-\[state\=active\]\:bg-\[\#003087\]\/20[data-state=active]{background-color:#00308733}.data-\[state\=active\]\:font-medium[data-state=active]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[state\=active\]\:text-\[\#07C160\][data-state=active]{color:#07c160}.data-\[state\=active\]\:text-\[\#26A17B\][data-state=active]{color:#26a17b}.data-\[state\=active\]\:text-\[\#38bdac\][data-state=active]{color:#38bdac}.data-\[state\=active\]\:text-\[\#169BD7\][data-state=active]{color:#169bd7}.data-\[state\=active\]\:text-\[\#1677FF\][data-state=active]{color:#1677ff}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[\#38bdac\][data-state=checked]{background-color:#38bdac}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-gray-600[data-state=unchecked]{background-color:var(--color-gray-600)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(min-width:64rem){.lg\:block{display:block}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}}:root{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20% .02 240);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20% .02 240);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(65% .15 180);--primary-foreground:oklch(20% 0 0);--secondary:oklch(27% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27% 0 0);--muted-foreground:oklch(65% 0 0);--accent:oklch(27% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(55% .2 25);--destructive-foreground:oklch(98.5% 0 0);--border:oklch(35% 0 0);--input:oklch(35% 0 0);--ring:oklch(65% .15 180);--radius:.625rem}body{font-family:var(--font-sans);color:var(--foreground);background:#0a1628}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/soul-admin/dist/index.html b/soul-admin/dist/index.html index 16fd3a5d..7136d005 100644 --- a/soul-admin/dist/index.html +++ b/soul-admin/dist/index.html @@ -4,8 +4,8 @@ 管理后台 - Soul创业派对 - - + +
diff --git a/soul-admin/tsconfig.tsbuildinfo b/soul-admin/tsconfig.tsbuildinfo index 2361c176..0e0b0f9c 100644 --- a/soul-admin/tsconfig.tsbuildinfo +++ b/soul-admin/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/auth.ts","./src/api/client.ts","./src/components/modules/user/setvipmodal.tsx","./src/components/modules/user/userdetailmodal.tsx","./src/components/ui/pagination.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/dialog.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/select.tsx","./src/components/ui/slider.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/hooks/usedebounce.ts","./src/layouts/adminlayout.tsx","./src/lib/utils.ts","./src/pages/admin-users/adminuserspage.tsx","./src/pages/api-doc/apidocpage.tsx","./src/pages/author-settings/authorsettingspage.tsx","./src/pages/chapters/chapterspage.tsx","./src/pages/content/chaptertree.tsx","./src/pages/content/contentpage.tsx","./src/pages/dashboard/dashboardpage.tsx","./src/pages/distribution/distributionpage.tsx","./src/pages/find-partner/findpartnerpage.tsx","./src/pages/find-partner/tabs/ckbstatstab.tsx","./src/pages/find-partner/tabs/matchpooltab.tsx","./src/pages/find-partner/tabs/matchrecordstab.tsx","./src/pages/find-partner/tabs/mentorbookingtab.tsx","./src/pages/find-partner/tabs/resourcedockingtab.tsx","./src/pages/find-partner/tabs/teamrecruittab.tsx","./src/pages/login/loginpage.tsx","./src/pages/match/matchpage.tsx","./src/pages/match-records/matchrecordspage.tsx","./src/pages/mentor-consultations/mentorconsultationspage.tsx","./src/pages/mentors/mentorspage.tsx","./src/pages/not-found/notfoundpage.tsx","./src/pages/orders/orderspage.tsx","./src/pages/payment/paymentpage.tsx","./src/pages/qrcodes/qrcodespage.tsx","./src/pages/referral-settings/referralsettingspage.tsx","./src/pages/settings/settingspage.tsx","./src/pages/site/sitepage.tsx","./src/pages/users/userspage.tsx","./src/pages/vip-roles/viprolespage.tsx","./src/pages/withdrawals/withdrawalspage.tsx"],"errors":true,"version":"5.6.3"} \ No newline at end of file +{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/auth.ts","./src/api/client.ts","./src/components/modules/user/setvipmodal.tsx","./src/components/modules/user/userdetailmodal.tsx","./src/components/ui/pagination.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/dialog.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/select.tsx","./src/components/ui/slider.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/hooks/usedebounce.ts","./src/layouts/adminlayout.tsx","./src/lib/utils.ts","./src/pages/admin-users/adminuserspage.tsx","./src/pages/api-doc/apidocpage.tsx","./src/pages/author-settings/authorsettingspage.tsx","./src/pages/chapters/chapterspage.tsx","./src/pages/content/chaptertree.tsx","./src/pages/content/contentpage.tsx","./src/pages/dashboard/dashboardpage.tsx","./src/pages/distribution/distributionpage.tsx","./src/pages/find-partner/findpartnerpage.tsx","./src/pages/find-partner/tabs/ckbstatstab.tsx","./src/pages/find-partner/tabs/matchpooltab.tsx","./src/pages/find-partner/tabs/matchrecordstab.tsx","./src/pages/find-partner/tabs/mentorbookingtab.tsx","./src/pages/find-partner/tabs/resourcedockingtab.tsx","./src/pages/find-partner/tabs/teamrecruittab.tsx","./src/pages/login/loginpage.tsx","./src/pages/match/matchpage.tsx","./src/pages/match-records/matchrecordspage.tsx","./src/pages/mentor-consultations/mentorconsultationspage.tsx","./src/pages/mentors/mentorspage.tsx","./src/pages/not-found/notfoundpage.tsx","./src/pages/orders/orderspage.tsx","./src/pages/payment/paymentpage.tsx","./src/pages/qrcodes/qrcodespage.tsx","./src/pages/referral-settings/referralsettingspage.tsx","./src/pages/settings/settingspage.tsx","./src/pages/site/sitepage.tsx","./src/pages/users/userspage.tsx","./src/pages/vip-roles/viprolespage.tsx","./src/pages/withdrawals/withdrawalspage.tsx"],"version":"5.6.3"} \ No newline at end of file