496 lines
666 KiB
JavaScript
496 lines
666 KiB
JavaScript
function bv(r,a){for(var l=0;l<a.length;l++){const i=a[l];if(typeof i!="string"&&!Array.isArray(i)){for(const c in i)if(c!=="default"&&!(c in r)){const d=Object.getOwnPropertyDescriptor(i,c);d&&Object.defineProperty(r,c,d.get?d:{enumerable:!0,get:()=>i[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"]'))i(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"&&i(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 i(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function Ix(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var yd={exports:{}},Cl={},vd={exports:{}},Ze={};/**
|
||
* @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 yf;function Nv(){if(yf)return Ze;yf=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=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 k(A){return A===null||typeof A!="object"?null:(A=v&&A[v]||A["@@iterator"],typeof A=="function"?A:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,b={};function N(A,F,O){this.props=A,this.context=F,this.refs=b,this.updater=O||P}N.prototype.isReactComponent={},N.prototype.setState=function(A,F){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,F,"setState")},N.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function C(){}C.prototype=N.prototype;function E(A,F,O){this.props=A,this.context=F,this.refs=b,this.updater=O||P}var j=E.prototype=new C;j.constructor=E,T(j,N.prototype),j.isPureReactComponent=!0;var R=Array.isArray,L=Object.prototype.hasOwnProperty,H={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function I(A,F,O){var Z,Y={},de=null,q=null;if(F!=null)for(Z in F.ref!==void 0&&(q=F.ref),F.key!==void 0&&(de=""+F.key),F)L.call(F,Z)&&!_.hasOwnProperty(Z)&&(Y[Z]=F[Z]);var ge=arguments.length-2;if(ge===1)Y.children=O;else if(1<ge){for(var Se=Array(ge),D=0;D<ge;D++)Se[D]=arguments[D+2];Y.children=Se}if(A&&A.defaultProps)for(Z in ge=A.defaultProps,ge)Y[Z]===void 0&&(Y[Z]=ge[Z]);return{$$typeof:r,type:A,key:de,ref:q,props:Y,_owner:H.current}}function w(A,F){return{$$typeof:r,type:A.type,key:F,ref:A.ref,props:A.props,_owner:A._owner}}function V(A){return typeof A=="object"&&A!==null&&A.$$typeof===r}function te(A){var F={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(O){return F[O]})}var le=/\/+/g;function Q(A,F){return typeof A=="object"&&A!==null&&A.key!=null?te(""+A.key):F.toString(36)}function re(A,F,O,Z,Y){var de=typeof A;(de==="undefined"||de==="boolean")&&(A=null);var q=!1;if(A===null)q=!0;else switch(de){case"string":case"number":q=!0;break;case"object":switch(A.$$typeof){case r:case a:q=!0}}if(q)return q=A,Y=Y(q),A=Z===""?"."+Q(q,0):Z,R(Y)?(O="",A!=null&&(O=A.replace(le,"$&/")+"/"),re(Y,F,O,"",function(D){return D})):Y!=null&&(V(Y)&&(Y=w(Y,O+(!Y.key||q&&q.key===Y.key?"":(""+Y.key).replace(le,"$&/")+"/")+A)),F.push(Y)),1;if(q=0,Z=Z===""?".":Z+":",R(A))for(var ge=0;ge<A.length;ge++){de=A[ge];var Se=Z+Q(de,ge);q+=re(de,F,O,Se,Y)}else if(Se=k(A),typeof Se=="function")for(A=Se.call(A),ge=0;!(de=A.next()).done;)de=de.value,Se=Z+Q(de,ge++),q+=re(de,F,O,Se,Y);else if(de==="object")throw F=String(A),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.");return q}function G(A,F,O){if(A==null)return A;var Z=[],Y=0;return re(A,Z,"","",function(de){return F.call(O,de,Y++)}),Z}function oe(A){if(A._status===-1){var F=A._result;F=F(),F.then(function(O){(A._status===0||A._status===-1)&&(A._status=1,A._result=O)},function(O){(A._status===0||A._status===-1)&&(A._status=2,A._result=O)}),A._status===-1&&(A._status=0,A._result=F)}if(A._status===1)return A._result.default;throw A._result}var ve={current:null},$={transition:null},ne={ReactCurrentDispatcher:ve,ReactCurrentBatchConfig:$,ReactCurrentOwner:H};function K(){throw Error("act(...) is not supported in production builds of React.")}return Ze.Children={map:G,forEach:function(A,F,O){G(A,function(){F.apply(this,arguments)},O)},count:function(A){var F=0;return G(A,function(){F++}),F},toArray:function(A){return G(A,function(F){return F})||[]},only:function(A){if(!V(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},Ze.Component=N,Ze.Fragment=l,Ze.Profiler=c,Ze.PureComponent=E,Ze.StrictMode=i,Ze.Suspense=p,Ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ne,Ze.act=K,Ze.cloneElement=function(A,F,O){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var Z=T({},A.props),Y=A.key,de=A.ref,q=A._owner;if(F!=null){if(F.ref!==void 0&&(de=F.ref,q=H.current),F.key!==void 0&&(Y=""+F.key),A.type&&A.type.defaultProps)var ge=A.type.defaultProps;for(Se in F)L.call(F,Se)&&!_.hasOwnProperty(Se)&&(Z[Se]=F[Se]===void 0&&ge!==void 0?ge[Se]:F[Se])}var Se=arguments.length-2;if(Se===1)Z.children=O;else if(1<Se){ge=Array(Se);for(var D=0;D<Se;D++)ge[D]=arguments[D+2];Z.children=ge}return{$$typeof:r,type:A.type,key:Y,ref:de,props:Z,_owner:q}},Ze.createContext=function(A){return A={$$typeof:m,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:d,_context:A},A.Consumer=A},Ze.createElement=I,Ze.createFactory=function(A){var F=I.bind(null,A);return F.type=A,F},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(A){return{$$typeof:f,render:A}},Ze.isValidElement=V,Ze.lazy=function(A){return{$$typeof:g,_payload:{_status:-1,_result:A},_init:oe}},Ze.memo=function(A,F){return{$$typeof:y,type:A,compare:F===void 0?null:F}},Ze.startTransition=function(A){var F=$.transition;$.transition={};try{A()}finally{$.transition=F}},Ze.unstable_act=K,Ze.useCallback=function(A,F){return ve.current.useCallback(A,F)},Ze.useContext=function(A){return ve.current.useContext(A)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(A){return ve.current.useDeferredValue(A)},Ze.useEffect=function(A,F){return ve.current.useEffect(A,F)},Ze.useId=function(){return ve.current.useId()},Ze.useImperativeHandle=function(A,F,O){return ve.current.useImperativeHandle(A,F,O)},Ze.useInsertionEffect=function(A,F){return ve.current.useInsertionEffect(A,F)},Ze.useLayoutEffect=function(A,F){return ve.current.useLayoutEffect(A,F)},Ze.useMemo=function(A,F){return ve.current.useMemo(A,F)},Ze.useReducer=function(A,F,O){return ve.current.useReducer(A,F,O)},Ze.useRef=function(A){return ve.current.useRef(A)},Ze.useState=function(A){return ve.current.useState(A)},Ze.useSyncExternalStore=function(A,F,O){return ve.current.useSyncExternalStore(A,F,O)},Ze.useTransition=function(){return ve.current.useTransition()},Ze.version="18.3.1",Ze}var vf;function mu(){return vf||(vf=1,vd.exports=Nv()),vd.exports}/**
|
||
* @license React
|
||
* react-jsx-runtime.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var jf;function wv(){if(jf)return Cl;jf=1;var r=mu(),a=Symbol.for("react.element"),l=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function m(f,p,y){var g,v={},k=null,P=null;y!==void 0&&(k=""+y),p.key!==void 0&&(k=""+p.key),p.ref!==void 0&&(P=p.ref);for(g in p)i.call(p,g)&&!d.hasOwnProperty(g)&&(v[g]=p[g]);if(f&&f.defaultProps)for(g in p=f.defaultProps,p)v[g]===void 0&&(v[g]=p[g]);return{$$typeof:a,type:f,key:k,ref:P,props:v,_owner:c.current}}return Cl.Fragment=l,Cl.jsx=m,Cl.jsxs=m,Cl}var bf;function Sv(){return bf||(bf=1,yd.exports=wv()),yd.exports}var e=Sv(),h=mu();const tn=Ix(h),bo=bv({__proto__:null,default:tn},[h]);var Gi={},jd={exports:{}},hs={},bd={exports:{}},Nd={};/**
|
||
* @license React
|
||
* scheduler.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Nf;function Cv(){return Nf||(Nf=1,(function(r){function a($,ne){var K=$.length;$.push(ne);e:for(;0<K;){var A=K-1>>>1,F=$[A];if(0<c(F,ne))$[A]=ne,$[K]=F,K=A;else break e}}function l($){return $.length===0?null:$[0]}function i($){if($.length===0)return null;var ne=$[0],K=$.pop();if(K!==ne){$[0]=K;e:for(var A=0,F=$.length,O=F>>>1;A<O;){var Z=2*(A+1)-1,Y=$[Z],de=Z+1,q=$[de];if(0>c(Y,K))de<F&&0>c(q,Y)?($[A]=q,$[de]=K,A=de):($[A]=Y,$[Z]=K,A=Z);else if(de<F&&0>c(q,K))$[A]=q,$[de]=K,A=de;else break e}}return ne}function c($,ne){var K=$.sortIndex-ne.sortIndex;return K!==0?K:$.id-ne.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,k=3,P=!1,T=!1,b=!1,N=typeof setTimeout=="function"?setTimeout:null,C=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 ne=l(y);ne!==null;){if(ne.callback===null)i(y);else if(ne.startTime<=$)i(y),ne.sortIndex=ne.expirationTime,a(p,ne);else break;ne=l(y)}}function R($){if(b=!1,j($),!T)if(l(p)!==null)T=!0,oe(L);else{var ne=l(y);ne!==null&&ve(R,ne.startTime-$)}}function L($,ne){T=!1,b&&(b=!1,C(I),I=-1),P=!0;var K=k;try{for(j(ne),v=l(p);v!==null&&(!(v.expirationTime>ne)||$&&!te());){var A=v.callback;if(typeof A=="function"){v.callback=null,k=v.priorityLevel;var F=A(v.expirationTime<=ne);ne=r.unstable_now(),typeof F=="function"?v.callback=F:v===l(p)&&i(p),j(ne)}else i(p);v=l(p)}if(v!==null)var O=!0;else{var Z=l(y);Z!==null&&ve(R,Z.startTime-ne),O=!1}return O}finally{v=null,k=K,P=!1}}var H=!1,_=null,I=-1,w=5,V=-1;function te(){return!(r.unstable_now()-V<w)}function le(){if(_!==null){var $=r.unstable_now();V=$;var ne=!0;try{ne=_(!0,$)}finally{ne?Q():(H=!1,_=null)}}else H=!1}var Q;if(typeof E=="function")Q=function(){E(le)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,G=re.port2;re.port1.onmessage=le,Q=function(){G.postMessage(null)}}else Q=function(){N(le,0)};function oe($){_=$,H||(H=!0,Q())}function ve($,ne){I=N(function(){$(r.unstable_now())},ne)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function($){$.callback=null},r.unstable_continueExecution=function(){T||P||(T=!0,oe(L))},r.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<$?Math.floor(1e3/$):5},r.unstable_getCurrentPriorityLevel=function(){return k},r.unstable_getFirstCallbackNode=function(){return l(p)},r.unstable_next=function($){switch(k){case 1:case 2:case 3:var ne=3;break;default:ne=k}var K=k;k=ne;try{return $()}finally{k=K}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function($,ne){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var K=k;k=$;try{return ne()}finally{k=K}},r.unstable_scheduleCallback=function($,ne,K){var A=r.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?A+K:A):K=A,$){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=K+F,$={id:g++,callback:ne,priorityLevel:$,startTime:K,expirationTime:F,sortIndex:-1},K>A?($.sortIndex=K,a(y,$),l(p)===null&&$===l(y)&&(b?(C(I),I=-1):b=!0,ve(R,K-A))):($.sortIndex=F,a(p,$),T||P||(T=!0,oe(L))),$},r.unstable_shouldYield=te,r.unstable_wrapCallback=function($){var ne=k;return function(){var K=k;k=ne;try{return $.apply(this,arguments)}finally{k=K}}}})(Nd)),Nd}var wf;function kv(){return wf||(wf=1,bd.exports=Cv()),bd.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 Sf;function Ev(){if(Sf)return hs;Sf=1;var r=mu(),a=kv();function l(t){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)s+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,c={};function d(t,s){m(t,s),m(t+"Capture",s)}function m(t,s){for(c[t]=s,t=0;t<s.length;t++)i.add(s[t])}var f=!(typeof window>"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 k(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,o){if(n!==null&&n.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return o?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function T(t,s,n,o){if(s===null||typeof s>"u"||P(t,s,n,o))return!0;if(o)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 b(t,s,n,o,u,x,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=o,this.attributeNamespace=u,this.mustUseProperty=n,this.propertyName=t,this.type=s,this.sanitizeURL=x,this.removeEmptyString=S}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){N[t]=new b(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var s=t[0];N[s]=new b(s,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){N[t]=new b(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){N[t]=new b(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){N[t]=new b(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){N[t]=new b(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){N[t]=new b(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){N[t]=new b(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){N[t]=new b(t,5,!1,t.toLowerCase(),null,!1,!1)});var C=/[\-:]([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(C,E);N[s]=new b(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(C,E);N[s]=new b(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(C,E);N[s]=new b(s,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){N[t]=new b(t,1,!1,t.toLowerCase(),null,!1,!1)}),N.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){N[t]=new b(t,1,!1,t.toLowerCase(),null,!0,!0)});function j(t,s,n,o){var u=N.hasOwnProperty(s)?N[s]:null;(u!==null?u.type!==0:o||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(T(s,n,u,o)&&(n=null),o||u===null?k(s)&&(n===null?t.removeAttribute(s):t.setAttribute(s,""+n)):u.mustUseProperty?t[u.propertyName]=n===null?u.type===3?!1:"":n:(s=u.attributeName,o=u.attributeNamespace,n===null?t.removeAttribute(s):(u=u.type,n=u===3||u===4&&n===!0?"":""+n,o?t.setAttributeNS(o,s,n):t.setAttribute(s,n))))}var R=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),H=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),te=Symbol.for("react.context"),le=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),oe=Symbol.for("react.lazy"),ve=Symbol.for("react.offscreen"),$=Symbol.iterator;function ne(t){return t===null||typeof t!="object"?null:(t=$&&t[$]||t["@@iterator"],typeof t=="function"?t:null)}var K=Object.assign,A;function F(t){if(A===void 0)try{throw Error()}catch(n){var s=n.stack.trim().match(/\n( *(at )?)/);A=s&&s[1]||""}return`
|
||
`+A+t}var O=!1;function Z(t,s){if(!t||O)return"";O=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(ae){var o=ae}Reflect.construct(t,[],s)}else{try{s.call()}catch(ae){o=ae}t.call(s.prototype)}else{try{throw Error()}catch(ae){o=ae}t()}}catch(ae){if(ae&&o&&typeof ae.stack=="string"){for(var u=ae.stack.split(`
|
||
`),x=o.stack.split(`
|
||
`),S=u.length-1,M=x.length-1;1<=S&&0<=M&&u[S]!==x[M];)M--;for(;1<=S&&0<=M;S--,M--)if(u[S]!==x[M]){if(S!==1||M!==1)do if(S--,M--,0>M||u[S]!==x[M]){var U=`
|
||
`+u[S].replace(" at new "," at ");return t.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",t.displayName)),U}while(1<=S&&0<=M);break}}}finally{O=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?F(t):""}function Y(t){switch(t.tag){case 5:return F(t.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return t=Z(t.type,!1),t;case 11:return t=Z(t.type.render,!1),t;case 1:return t=Z(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 H:return"Portal";case w:return"Profiler";case I:return"StrictMode";case Q:return"Suspense";case re:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case te:return(t.displayName||"Context")+".Consumer";case V:return(t._context.displayName||"Context")+".Provider";case le:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case G:return s=t.displayName||null,s!==null?s:de(t.type)||"Memo";case oe:s=t._payload,t=t._init;try{return de(t(s))}catch{}}return null}function q(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===I?"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 ge(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Se(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function D(t){var s=Se(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,s),o=""+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(S){o=""+S,x.call(this,S)}}),Object.defineProperty(t,s,{enumerable:n.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function fe(t){t._valueTracker||(t._valueTracker=D(t))}function ke(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var n=s.getValue(),o="";return t&&(o=Se(t)?t.checked?"true":"false":t.value),t=o,t!==n?(s.setValue(t),!0):!1}function Ve(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 We(t,s){var n=s.checked;return K({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Ke(t,s){var n=s.defaultValue==null?"":s.defaultValue,o=s.checked!=null?s.checked:s.defaultChecked;n=ge(s.value!=null?s.value:n),t._wrapperState={initialChecked:o,initialValue:n,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function tt(t,s){s=s.checked,s!=null&&j(t,"checked",s,!1)}function $e(t,s){tt(t,s);var n=ge(s.value),o=s.type;if(n!=null)o==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(o==="submit"||o==="reset"){t.removeAttribute("value");return}s.hasOwnProperty("value")?xe(t,s.type,n):s.hasOwnProperty("defaultValue")&&xe(t,s.type,ge(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(t.defaultChecked=!!s.defaultChecked)}function he(t,s,n){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var o=s.type;if(!(o!=="submit"&&o!=="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 xe(t,s,n){(s!=="number"||Ve(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ft=Array.isArray;function es(t,s,n,o){if(t=t.options,s){s={};for(var u=0;u<n.length;u++)s["$"+n[u]]=!0;for(n=0;n<t.length;n++)u=s.hasOwnProperty("$"+t[n].value),t[n].selected!==u&&(t[n].selected=u),u&&o&&(t[n].defaultSelected=!0)}else{for(n=""+ge(n),s=null,u=0;u<t.length;u++){if(t[u].value===n){t[u].selected=!0,o&&(t[u].defaultSelected=!0);return}s!==null||t[u].disabled||(s=t[u])}s!==null&&(s.selected=!0)}}function hr(t,s){if(s.dangerouslySetInnerHTML!=null)throw Error(l(91));return K({},s,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function bn(t,s){var n=s.value;if(n==null){if(n=s.children,s=s.defaultValue,n!=null){if(s!=null)throw Error(l(92));if(ft(n)){if(1<n.length)throw Error(l(93));n=n[0]}s=n}s==null&&(s=""),n=s}t._wrapperState={initialValue:ge(n)}}function As(t,s){var n=ge(s.value),o=ge(s.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),s.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),o!=null&&(t.defaultValue=""+o)}function Bt(t){var s=t.textContent;s===t._wrapperState.initialValue&&s!==""&&s!==null&&(t.value=s)}function Mr(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function dt(t,s){return t==null||t==="http://www.w3.org/1999/xhtml"?Mr(s):t==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var gs,Nn=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,n,o,u){MSApp.execUnsafeLocalFunction(function(){return t(s,n,o,u)})}:t})(function(t,s){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=s;else{for(gs=gs||document.createElement("div"),gs.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=gs.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;s.firstChild;)t.appendChild(s.firstChild)}});function mr(t,s){if(s){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=s;return}}t.textContent=s}var Cs={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},Yn=["Webkit","ms","Moz","O"];Object.keys(Cs).forEach(function(t){Yn.forEach(function(s){s=s+t.charAt(0).toUpperCase()+t.substring(1),Cs[s]=Cs[t]})});function Qn(t,s,n){return s==null||typeof s=="boolean"||s===""?"":n||typeof s!="number"||s===0||Cs.hasOwnProperty(t)&&Cs[t]?(""+s).trim():s+"px"}function ks(t,s){t=t.style;for(var n in s)if(s.hasOwnProperty(n)){var o=n.indexOf("--")===0,u=Qn(n,s[n],o);n==="float"&&(n="cssFloat"),o?t.setProperty(n,u):t[n]=u}}var wn=K({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 fr(t,s){if(s){if(wn[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 ys(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 Ds=null;function Ls(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Sn=null,Es=null,Os=null;function Fs(t){if(t=dl(t)){if(typeof Sn!="function")throw Error(l(280));var s=t.stateNode;s&&(s=oi(s),Sn(t.stateNode,t.type,s))}}function qn(t){Es?Os?Os.push(t):Os=[t]:Es=t}function Xn(){if(Es){var t=Es,s=Os;if(Os=Es=null,Fs(t),s)for(t=0;t<s.length;t++)Fs(s[t])}}function Jn(t,s){return t(s)}function Zn(){}var Cn=!1;function kn(t,s,n){if(Cn)return t(s,n);Cn=!0;try{return Jn(t,s,n)}finally{Cn=!1,(Es!==null||Os!==null)&&(Zn(),Xn())}}function zs(t,s){var n=t.stateNode;if(n===null)return null;var o=oi(n);if(o===null)return null;n=o[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(l(231,s,typeof n));return n}var Ar=!1;if(f)try{var $s={};Object.defineProperty($s,"passive",{get:function(){Ar=!0}}),window.addEventListener("test",$s,$s),window.removeEventListener("test",$s,$s)}catch{Ar=!1}function ea(t,s,n,o,u,x,S,M,U){var ae=Array.prototype.slice.call(arguments,3);try{s.apply(n,ae)}catch(me){this.onError(me)}}var ts=!1,z=null,ce=!1,Ce=null,Ee={onError:function(t){ts=!0,z=t}};function xt(t,s,n,o,u,x,S,M,U){ts=!1,z=null,ea.apply(Ee,arguments)}function ns(t,s,n,o,u,x,S,M,U){if(xt.apply(this,arguments),ts){if(ts){var ae=z;ts=!1,z=null}else throw Error(l(198));ce||(ce=!0,Ce=ae)}}function nt(t){var s=t,n=t;if(t.alternate)for(;s.return;)s=s.return;else{t=s;do s=t,(s.flags&4098)!==0&&(n=s.return),t=s.return;while(t)}return s.tag===3?n:null}function as(t){if(t.tag===13){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function En(t){if(nt(t)!==t)throw Error(l(188))}function er(t){var s=t.alternate;if(!s){if(s=nt(t),s===null)throw Error(l(188));return s!==t?null:t}for(var n=t,o=s;;){var u=n.return;if(u===null)break;var x=u.alternate;if(x===null){if(o=u.return,o!==null){n=o;continue}break}if(u.child===x.child){for(x=u.child;x;){if(x===n)return En(u),t;if(x===o)return En(u),s;x=x.sibling}throw Error(l(188))}if(n.return!==o.return)n=u,o=x;else{for(var S=!1,M=u.child;M;){if(M===n){S=!0,n=u,o=x;break}if(M===o){S=!0,o=u,n=x;break}M=M.sibling}if(!S){for(M=x.child;M;){if(M===n){S=!0,n=x,o=u;break}if(M===o){S=!0,o=x,n=u;break}M=M.sibling}if(!S)throw Error(l(189))}}if(n.alternate!==o)throw Error(l(190))}if(n.tag!==3)throw Error(l(188));return n.stateNode.current===n?t:s}function xr(t){return t=er(t),t!==null?Pt(t):null}function Pt(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var s=Pt(t);if(s!==null)return s;t=t.sibling}return null}var B=a.unstable_scheduleCallback,He=a.unstable_cancelCallback,Je=a.unstable_shouldYield,ls=a.unstable_requestPaint,ut=a.unstable_now,Ag=a.unstable_getCurrentPriorityLevel,Fo=a.unstable_ImmediatePriority,Ku=a.unstable_UserBlockingPriority,Ul=a.unstable_NormalPriority,Dg=a.unstable_LowPriority,Gu=a.unstable_IdlePriority,Vl=null,tr=null;function Lg(t){if(tr&&typeof tr.onCommitFiberRoot=="function")try{tr.onCommitFiberRoot(Vl,t,void 0,(t.current.flags&128)===128)}catch{}}var Bs=Math.clz32?Math.clz32:zg,Og=Math.log,Fg=Math.LN2;function zg(t){return t>>>=0,t===0?32:31-(Og(t)/Fg|0)|0}var Wl=64,Hl=4194304;function Ka(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 Kl(t,s){var n=t.pendingLanes;if(n===0)return 0;var o=0,u=t.suspendedLanes,x=t.pingedLanes,S=n&268435455;if(S!==0){var M=S&~u;M!==0?o=Ka(M):(x&=S,x!==0&&(o=Ka(x)))}else S=n&~u,S!==0?o=Ka(S):x!==0&&(o=Ka(x));if(o===0)return 0;if(s!==0&&s!==o&&(s&u)===0&&(u=o&-o,x=s&-s,u>=x||u===16&&(x&4194240)!==0))return s;if((o&4)!==0&&(o|=n&16),s=t.entangledLanes,s!==0)for(t=t.entanglements,s&=o;0<s;)n=31-Bs(s),u=1<<n,o|=t[n],s&=~u;return o}function $g(t,s){switch(t){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Bg(t,s){for(var n=t.suspendedLanes,o=t.pingedLanes,u=t.expirationTimes,x=t.pendingLanes;0<x;){var S=31-Bs(x),M=1<<S,U=u[S];U===-1?((M&n)===0||(M&o)!==0)&&(u[S]=$g(M,s)):U<=s&&(t.expiredLanes|=M),x&=~M}}function zo(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Yu(){var t=Wl;return Wl<<=1,(Wl&4194240)===0&&(Wl=64),t}function $o(t){for(var s=[],n=0;31>n;n++)s.push(t);return s}function Ga(t,s,n){t.pendingLanes|=s,s!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,s=31-Bs(s),t[s]=n}function Ug(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 o=t.eventTimes;for(t=t.expirationTimes;0<n;){var u=31-Bs(n),x=1<<u;s[u]=0,o[u]=-1,t[u]=-1,n&=~x}}function Bo(t,s){var n=t.entangledLanes|=s;for(t=t.entanglements;n;){var o=31-Bs(n),u=1<<o;u&s|t[o]&s&&(t[o]|=s),n&=~u}}var it=0;function Qu(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var qu,Uo,Xu,Ju,Zu,Vo=!1,Gl=[],Dr=null,Lr=null,Or=null,Ya=new Map,Qa=new Map,Fr=[],Vg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function eh(t,s){switch(t){case"focusin":case"focusout":Dr=null;break;case"dragenter":case"dragleave":Lr=null;break;case"mouseover":case"mouseout":Or=null;break;case"pointerover":case"pointerout":Ya.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qa.delete(s.pointerId)}}function qa(t,s,n,o,u,x){return t===null||t.nativeEvent!==x?(t={blockedOn:s,domEventName:n,eventSystemFlags:o,nativeEvent:x,targetContainers:[u]},s!==null&&(s=dl(s),s!==null&&Uo(s)),t):(t.eventSystemFlags|=o,s=t.targetContainers,u!==null&&s.indexOf(u)===-1&&s.push(u),t)}function Wg(t,s,n,o,u){switch(s){case"focusin":return Dr=qa(Dr,t,s,n,o,u),!0;case"dragenter":return Lr=qa(Lr,t,s,n,o,u),!0;case"mouseover":return Or=qa(Or,t,s,n,o,u),!0;case"pointerover":var x=u.pointerId;return Ya.set(x,qa(Ya.get(x)||null,t,s,n,o,u)),!0;case"gotpointercapture":return x=u.pointerId,Qa.set(x,qa(Qa.get(x)||null,t,s,n,o,u)),!0}return!1}function th(t){var s=Pn(t.target);if(s!==null){var n=nt(s);if(n!==null){if(s=n.tag,s===13){if(s=as(n),s!==null){t.blockedOn=s,Zu(t.priority,function(){Xu(n)});return}}else if(s===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Yl(t){if(t.blockedOn!==null)return!1;for(var s=t.targetContainers;0<s.length;){var n=Ho(t.domEventName,t.eventSystemFlags,s[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var o=new n.constructor(n.type,n);Ds=o,n.target.dispatchEvent(o),Ds=null}else return s=dl(n),s!==null&&Uo(s),t.blockedOn=n,!1;s.shift()}return!0}function sh(t,s,n){Yl(t)&&n.delete(s)}function Hg(){Vo=!1,Dr!==null&&Yl(Dr)&&(Dr=null),Lr!==null&&Yl(Lr)&&(Lr=null),Or!==null&&Yl(Or)&&(Or=null),Ya.forEach(sh),Qa.forEach(sh)}function Xa(t,s){t.blockedOn===s&&(t.blockedOn=null,Vo||(Vo=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Hg)))}function Ja(t){function s(u){return Xa(u,t)}if(0<Gl.length){Xa(Gl[0],t);for(var n=1;n<Gl.length;n++){var o=Gl[n];o.blockedOn===t&&(o.blockedOn=null)}}for(Dr!==null&&Xa(Dr,t),Lr!==null&&Xa(Lr,t),Or!==null&&Xa(Or,t),Ya.forEach(s),Qa.forEach(s),n=0;n<Fr.length;n++)o=Fr[n],o.blockedOn===t&&(o.blockedOn=null);for(;0<Fr.length&&(n=Fr[0],n.blockedOn===null);)th(n),n.blockedOn===null&&Fr.shift()}var ta=R.ReactCurrentBatchConfig,Ql=!0;function Kg(t,s,n,o){var u=it,x=ta.transition;ta.transition=null;try{it=1,Wo(t,s,n,o)}finally{it=u,ta.transition=x}}function Gg(t,s,n,o){var u=it,x=ta.transition;ta.transition=null;try{it=4,Wo(t,s,n,o)}finally{it=u,ta.transition=x}}function Wo(t,s,n,o){if(Ql){var u=Ho(t,s,n,o);if(u===null)oc(t,s,o,ql,n),eh(t,o);else if(Wg(u,t,s,n,o))o.stopPropagation();else if(eh(t,o),s&4&&-1<Vg.indexOf(t)){for(;u!==null;){var x=dl(u);if(x!==null&&qu(x),x=Ho(t,s,n,o),x===null&&oc(t,s,o,ql,n),x===u)break;u=x}u!==null&&o.stopPropagation()}else oc(t,s,o,null,n)}}var ql=null;function Ho(t,s,n,o){if(ql=null,t=Ls(o),t=Pn(t),t!==null)if(s=nt(t),s===null)t=null;else if(n=s.tag,n===13){if(t=as(s),t!==null)return t;t=null}else if(n===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;t=null}else s!==t&&(t=null);return ql=t,null}function rh(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ag()){case Fo:return 1;case Ku:return 4;case Ul:case Dg:return 16;case Gu:return 536870912;default:return 16}default:return 16}}var zr=null,Ko=null,Xl=null;function nh(){if(Xl)return Xl;var t,s=Ko,n=s.length,o,u="value"in zr?zr.value:zr.textContent,x=u.length;for(t=0;t<n&&s[t]===u[t];t++);var S=n-t;for(o=1;o<=S&&s[n-o]===u[x-o];o++);return Xl=u.slice(t,1<o?1-o:void 0)}function Jl(t){var s=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&s===13&&(t=13)):t=s,t===10&&(t=13),32<=t||t===13?t:0}function Zl(){return!0}function ah(){return!1}function vs(t){function s(n,o,u,x,S){this._reactName=n,this._targetInst=u,this.type=o,this.nativeEvent=x,this.target=S,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(n=t[M],this[M]=n?n(x):x[M]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Zl:ah,this.isPropagationStopped=ah,this}return K(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Zl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Zl)},persist:function(){},isPersistent:Zl}),s}var sa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Go=vs(sa),Za=K({},sa,{view:0,detail:0}),Yg=vs(Za),Yo,Qo,el,ei=K({},Za,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xo,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==el&&(el&&t.type==="mousemove"?(Yo=t.screenX-el.screenX,Qo=t.screenY-el.screenY):Qo=Yo=0,el=t),Yo)},movementY:function(t){return"movementY"in t?t.movementY:Qo}}),lh=vs(ei),Qg=K({},ei,{dataTransfer:0}),qg=vs(Qg),Xg=K({},Za,{relatedTarget:0}),qo=vs(Xg),Jg=K({},sa,{animationName:0,elapsedTime:0,pseudoElement:0}),Zg=vs(Jg),ey=K({},sa,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),ty=vs(ey),sy=K({},sa,{data:0}),ih=vs(sy),ry={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ny={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ay={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ly(t){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(t):(t=ay[t])?!!s[t]:!1}function Xo(){return ly}var iy=K({},Za,{key:function(t){if(t.key){var s=ry[t.key]||t.key;if(s!=="Unidentified")return s}return t.type==="keypress"?(t=Jl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?ny[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xo,charCode:function(t){return t.type==="keypress"?Jl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Jl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),oy=vs(iy),cy=K({},ei,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),oh=vs(cy),dy=K({},Za,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xo}),uy=vs(dy),hy=K({},sa,{propertyName:0,elapsedTime:0,pseudoElement:0}),my=vs(hy),fy=K({},ei,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),xy=vs(fy),py=[9,13,27,32],Jo=f&&"CompositionEvent"in window,tl=null;f&&"documentMode"in document&&(tl=document.documentMode);var gy=f&&"TextEvent"in window&&!tl,ch=f&&(!Jo||tl&&8<tl&&11>=tl),dh=" ",uh=!1;function hh(t,s){switch(t){case"keyup":return py.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ra=!1;function yy(t,s){switch(t){case"compositionend":return mh(s);case"keypress":return s.which!==32?null:(uh=!0,dh);case"textInput":return t=s.data,t===dh&&uh?null:t;default:return null}}function vy(t,s){if(ra)return t==="compositionend"||!Jo&&hh(t,s)?(t=nh(),Xl=Ko=zr=null,ra=!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.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return ch&&s.locale!=="ko"?null:s.data;default:return null}}var jy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function fh(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s==="input"?!!jy[t.type]:s==="textarea"}function xh(t,s,n,o){qn(o),s=ai(s,"onChange"),0<s.length&&(n=new Go("onChange","change",null,n,o),t.push({event:n,listeners:s}))}var sl=null,rl=null;function by(t){Mh(t,0)}function ti(t){var s=oa(t);if(ke(s))return t}function Ny(t,s){if(t==="change")return s}var ph=!1;if(f){var Zo;if(f){var ec="oninput"in document;if(!ec){var gh=document.createElement("div");gh.setAttribute("oninput","return;"),ec=typeof gh.oninput=="function"}Zo=ec}else Zo=!1;ph=Zo&&(!document.documentMode||9<document.documentMode)}function yh(){sl&&(sl.detachEvent("onpropertychange",vh),rl=sl=null)}function vh(t){if(t.propertyName==="value"&&ti(rl)){var s=[];xh(s,rl,t,Ls(t)),kn(by,s)}}function wy(t,s,n){t==="focusin"?(yh(),sl=s,rl=n,sl.attachEvent("onpropertychange",vh)):t==="focusout"&&yh()}function Sy(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ti(rl)}function Cy(t,s){if(t==="click")return ti(s)}function ky(t,s){if(t==="input"||t==="change")return ti(s)}function Ey(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var Us=typeof Object.is=="function"?Object.is:Ey;function nl(t,s){if(Us(t,s))return!0;if(typeof t!="object"||t===null||typeof s!="object"||s===null)return!1;var n=Object.keys(t),o=Object.keys(s);if(n.length!==o.length)return!1;for(o=0;o<n.length;o++){var u=n[o];if(!p.call(s,u)||!Us(t[u],s[u]))return!1}return!0}function jh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function bh(t,s){var n=jh(t);t=0;for(var o;n;){if(n.nodeType===3){if(o=t+n.textContent.length,t<=s&&o>=s)return{node:n,offset:s-t};t=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=jh(n)}}function Nh(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?Nh(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function wh(){for(var t=window,s=Ve();s instanceof t.HTMLIFrameElement;){try{var n=typeof s.contentWindow.location.href=="string"}catch{n=!1}if(n)t=s.contentWindow;else break;s=Ve(t.document)}return s}function tc(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 Py(t){var s=wh(),n=t.focusedElem,o=t.selectionRange;if(s!==n&&n&&n.ownerDocument&&Nh(n.ownerDocument.documentElement,n)){if(o!==null&&tc(n)){if(s=o.start,t=o.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(o.start,u);o=o.end===void 0?x:Math.min(o.end,u),!t.extend&&x>o&&(u=o,o=x,x=u),u=bh(n,x);var S=bh(n,o);u&&S&&(t.rangeCount!==1||t.anchorNode!==u.node||t.anchorOffset!==u.offset||t.focusNode!==S.node||t.focusOffset!==S.offset)&&(s=s.createRange(),s.setStart(u.node,u.offset),t.removeAllRanges(),x>o?(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<s.length;n++)t=s[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var Ty=f&&"documentMode"in document&&11>=document.documentMode,na=null,sc=null,al=null,rc=!1;function Sh(t,s,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;rc||na==null||na!==Ve(o)||(o=na,"selectionStart"in o&&tc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),al&&nl(al,o)||(al=o,o=ai(sc,"onSelect"),0<o.length&&(s=new Go("onSelect","select",null,s,n),t.push({event:s,listeners:o}),s.target=na)))}function si(t,s){var n={};return n[t.toLowerCase()]=s.toLowerCase(),n["Webkit"+t]="webkit"+s,n["Moz"+t]="moz"+s,n}var aa={animationend:si("Animation","AnimationEnd"),animationiteration:si("Animation","AnimationIteration"),animationstart:si("Animation","AnimationStart"),transitionend:si("Transition","TransitionEnd")},nc={},Ch={};f&&(Ch=document.createElement("div").style,"AnimationEvent"in window||(delete aa.animationend.animation,delete aa.animationiteration.animation,delete aa.animationstart.animation),"TransitionEvent"in window||delete aa.transitionend.transition);function ri(t){if(nc[t])return nc[t];if(!aa[t])return t;var s=aa[t],n;for(n in s)if(s.hasOwnProperty(n)&&n in Ch)return nc[t]=s[n];return t}var kh=ri("animationend"),Eh=ri("animationiteration"),Ph=ri("animationstart"),Th=ri("transitionend"),Rh=new Map,Ih="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function $r(t,s){Rh.set(t,s),d(s,[t])}for(var ac=0;ac<Ih.length;ac++){var lc=Ih[ac],Ry=lc.toLowerCase(),Iy=lc[0].toUpperCase()+lc.slice(1);$r(Ry,"on"+Iy)}$r(kh,"onAnimationEnd"),$r(Eh,"onAnimationIteration"),$r(Ph,"onAnimationStart"),$r("dblclick","onDoubleClick"),$r("focusin","onFocus"),$r("focusout","onBlur"),$r(Th,"onTransitionEnd"),m("onMouseEnter",["mouseout","mouseover"]),m("onMouseLeave",["mouseout","mouseover"]),m("onPointerEnter",["pointerout","pointerover"]),m("onPointerLeave",["pointerout","pointerover"]),d("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),d("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),d("onBeforeInput",["compositionend","keypress","textInput","paste"]),d("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ll="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),_y=new Set("cancel close invalid load scroll toggle".split(" ").concat(ll));function _h(t,s,n){var o=t.type||"unknown-event";t.currentTarget=n,ns(o,s,void 0,t),t.currentTarget=null}function Mh(t,s){s=(s&4)!==0;for(var n=0;n<t.length;n++){var o=t[n],u=o.event;o=o.listeners;e:{var x=void 0;if(s)for(var S=o.length-1;0<=S;S--){var M=o[S],U=M.instance,ae=M.currentTarget;if(M=M.listener,U!==x&&u.isPropagationStopped())break e;_h(u,M,ae),x=U}else for(S=0;S<o.length;S++){if(M=o[S],U=M.instance,ae=M.currentTarget,M=M.listener,U!==x&&u.isPropagationStopped())break e;_h(u,M,ae),x=U}}}if(ce)throw t=Ce,ce=!1,Ce=null,t}function pt(t,s){var n=s[fc];n===void 0&&(n=s[fc]=new Set);var o=t+"__bubble";n.has(o)||(Ah(s,t,2,!1),n.add(o))}function ic(t,s,n){var o=0;s&&(o|=4),Ah(n,t,o,s)}var ni="_reactListening"+Math.random().toString(36).slice(2);function il(t){if(!t[ni]){t[ni]=!0,i.forEach(function(n){n!=="selectionchange"&&(_y.has(n)||ic(n,!1,t),ic(n,!0,t))});var s=t.nodeType===9?t:t.ownerDocument;s===null||s[ni]||(s[ni]=!0,ic("selectionchange",!1,s))}}function Ah(t,s,n,o){switch(rh(s)){case 1:var u=Kg;break;case 4:u=Gg;break;default:u=Wo}n=u.bind(null,s,n,t),u=void 0,!Ar||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(u=!0),o?u!==void 0?t.addEventListener(s,n,{capture:!0,passive:u}):t.addEventListener(s,n,!0):u!==void 0?t.addEventListener(s,n,{passive:u}):t.addEventListener(s,n,!1)}function oc(t,s,n,o,u){var x=o;if((s&1)===0&&(s&2)===0&&o!==null)e:for(;;){if(o===null)return;var S=o.tag;if(S===3||S===4){var M=o.stateNode.containerInfo;if(M===u||M.nodeType===8&&M.parentNode===u)break;if(S===4)for(S=o.return;S!==null;){var U=S.tag;if((U===3||U===4)&&(U=S.stateNode.containerInfo,U===u||U.nodeType===8&&U.parentNode===u))return;S=S.return}for(;M!==null;){if(S=Pn(M),S===null)return;if(U=S.tag,U===5||U===6){o=x=S;continue e}M=M.parentNode}}o=o.return}kn(function(){var ae=x,me=Ls(n),ye=[];e:{var ue=Rh.get(t);if(ue!==void 0){var Pe=Go,Ie=t;switch(t){case"keypress":if(Jl(n)===0)break e;case"keydown":case"keyup":Pe=oy;break;case"focusin":Ie="focus",Pe=qo;break;case"focusout":Ie="blur",Pe=qo;break;case"beforeblur":case"afterblur":Pe=qo;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Pe=lh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=qg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=uy;break;case kh:case Eh:case Ph:Pe=Zg;break;case Th:Pe=my;break;case"scroll":Pe=Yg;break;case"wheel":Pe=xy;break;case"copy":case"cut":case"paste":Pe=ty;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=oh}var Ae=(s&4)!==0,_t=!Ae&&t==="scroll",J=Ae?ue!==null?ue+"Capture":null:ue;Ae=[];for(var W=ae,se;W!==null;){se=W;var je=se.stateNode;if(se.tag===5&&je!==null&&(se=je,J!==null&&(je=zs(W,J),je!=null&&Ae.push(ol(W,je,se)))),_t)break;W=W.return}0<Ae.length&&(ue=new Pe(ue,Ie,null,n,me),ye.push({event:ue,listeners:Ae}))}}if((s&7)===0){e:{if(ue=t==="mouseover"||t==="pointerover",Pe=t==="mouseout"||t==="pointerout",ue&&n!==Ds&&(Ie=n.relatedTarget||n.fromElement)&&(Pn(Ie)||Ie[pr]))break e;if((Pe||ue)&&(ue=me.window===me?me:(ue=me.ownerDocument)?ue.defaultView||ue.parentWindow:window,Pe?(Ie=n.relatedTarget||n.toElement,Pe=ae,Ie=Ie?Pn(Ie):null,Ie!==null&&(_t=nt(Ie),Ie!==_t||Ie.tag!==5&&Ie.tag!==6)&&(Ie=null)):(Pe=null,Ie=ae),Pe!==Ie)){if(Ae=lh,je="onMouseLeave",J="onMouseEnter",W="mouse",(t==="pointerout"||t==="pointerover")&&(Ae=oh,je="onPointerLeave",J="onPointerEnter",W="pointer"),_t=Pe==null?ue:oa(Pe),se=Ie==null?ue:oa(Ie),ue=new Ae(je,W+"leave",Pe,n,me),ue.target=_t,ue.relatedTarget=se,je=null,Pn(me)===ae&&(Ae=new Ae(J,W+"enter",Ie,n,me),Ae.target=se,Ae.relatedTarget=_t,je=Ae),_t=je,Pe&&Ie)t:{for(Ae=Pe,J=Ie,W=0,se=Ae;se;se=la(se))W++;for(se=0,je=J;je;je=la(je))se++;for(;0<W-se;)Ae=la(Ae),W--;for(;0<se-W;)J=la(J),se--;for(;W--;){if(Ae===J||J!==null&&Ae===J.alternate)break t;Ae=la(Ae),J=la(J)}Ae=null}else Ae=null;Pe!==null&&Dh(ye,ue,Pe,Ae,!1),Ie!==null&&_t!==null&&Dh(ye,_t,Ie,Ae,!0)}}e:{if(ue=ae?oa(ae):window,Pe=ue.nodeName&&ue.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&ue.type==="file")var De=Ny;else if(fh(ue))if(ph)De=ky;else{De=Sy;var Oe=wy}else(Pe=ue.nodeName)&&Pe.toLowerCase()==="input"&&(ue.type==="checkbox"||ue.type==="radio")&&(De=Cy);if(De&&(De=De(t,ae))){xh(ye,De,n,me);break e}Oe&&Oe(t,ue,ae),t==="focusout"&&(Oe=ue._wrapperState)&&Oe.controlled&&ue.type==="number"&&xe(ue,"number",ue.value)}switch(Oe=ae?oa(ae):window,t){case"focusin":(fh(Oe)||Oe.contentEditable==="true")&&(na=Oe,sc=ae,al=null);break;case"focusout":al=sc=na=null;break;case"mousedown":rc=!0;break;case"contextmenu":case"mouseup":case"dragend":rc=!1,Sh(ye,n,me);break;case"selectionchange":if(Ty)break;case"keydown":case"keyup":Sh(ye,n,me)}var Fe;if(Jo)e:{switch(t){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else ra?hh(t,n)&&(Ue="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(Ue="onCompositionStart");Ue&&(ch&&n.locale!=="ko"&&(ra||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&ra&&(Fe=nh()):(zr=me,Ko="value"in zr?zr.value:zr.textContent,ra=!0)),Oe=ai(ae,Ue),0<Oe.length&&(Ue=new ih(Ue,t,null,n,me),ye.push({event:Ue,listeners:Oe}),Fe?Ue.data=Fe:(Fe=mh(n),Fe!==null&&(Ue.data=Fe)))),(Fe=gy?yy(t,n):vy(t,n))&&(ae=ai(ae,"onBeforeInput"),0<ae.length&&(me=new ih("onBeforeInput","beforeinput",null,n,me),ye.push({event:me,listeners:ae}),me.data=Fe))}Mh(ye,s)})}function ol(t,s,n){return{instance:t,listener:s,currentTarget:n}}function ai(t,s){for(var n=s+"Capture",o=[];t!==null;){var u=t,x=u.stateNode;u.tag===5&&x!==null&&(u=x,x=zs(t,n),x!=null&&o.unshift(ol(t,x,u)),x=zs(t,s),x!=null&&o.push(ol(t,x,u))),t=t.return}return o}function la(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Dh(t,s,n,o,u){for(var x=s._reactName,S=[];n!==null&&n!==o;){var M=n,U=M.alternate,ae=M.stateNode;if(U!==null&&U===o)break;M.tag===5&&ae!==null&&(M=ae,u?(U=zs(n,x),U!=null&&S.unshift(ol(n,U,M))):u||(U=zs(n,x),U!=null&&S.push(ol(n,U,M)))),n=n.return}S.length!==0&&t.push({event:s,listeners:S})}var My=/\r\n?/g,Ay=/\u0000|\uFFFD/g;function Lh(t){return(typeof t=="string"?t:""+t).replace(My,`
|
||
`).replace(Ay,"")}function li(t,s,n){if(s=Lh(s),Lh(t)!==s&&n)throw Error(l(425))}function ii(){}var cc=null,dc=null;function uc(t,s){return t==="textarea"||t==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var hc=typeof setTimeout=="function"?setTimeout:void 0,Dy=typeof clearTimeout=="function"?clearTimeout:void 0,Oh=typeof Promise=="function"?Promise:void 0,Ly=typeof queueMicrotask=="function"?queueMicrotask:typeof Oh<"u"?function(t){return Oh.resolve(null).then(t).catch(Oy)}:hc;function Oy(t){setTimeout(function(){throw t})}function mc(t,s){var n=s,o=0;do{var u=n.nextSibling;if(t.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"){if(o===0){t.removeChild(u),Ja(s);return}o--}else n!=="$"&&n!=="$?"&&n!=="$!"||o++;n=u}while(n);Ja(s)}function Br(t){for(;t!=null;t=t.nextSibling){var s=t.nodeType;if(s===1||s===3)break;if(s===8){if(s=t.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return t}function Fh(t){t=t.previousSibling;for(var s=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(s===0)return t;s--}else n==="/$"&&s++}t=t.previousSibling}return null}var ia=Math.random().toString(36).slice(2),sr="__reactFiber$"+ia,cl="__reactProps$"+ia,pr="__reactContainer$"+ia,fc="__reactEvents$"+ia,Fy="__reactListeners$"+ia,zy="__reactHandles$"+ia;function Pn(t){var s=t[sr];if(s)return s;for(var n=t.parentNode;n;){if(s=n[pr]||n[sr]){if(n=s.alternate,s.child!==null||n!==null&&n.child!==null)for(t=Fh(t);t!==null;){if(n=t[sr])return n;t=Fh(t)}return s}t=n,n=t.parentNode}return null}function dl(t){return t=t[sr]||t[pr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function oa(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(l(33))}function oi(t){return t[cl]||null}var xc=[],ca=-1;function Ur(t){return{current:t}}function gt(t){0>ca||(t.current=xc[ca],xc[ca]=null,ca--)}function ht(t,s){ca++,xc[ca]=t.current,t.current=s}var Vr={},Qt=Ur(Vr),is=Ur(!1),Tn=Vr;function da(t,s){var n=t.type.contextTypes;if(!n)return Vr;var o=t.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===s)return o.__reactInternalMemoizedMaskedChildContext;var u={},x;for(x in n)u[x]=s[x];return o&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=u),u}function os(t){return t=t.childContextTypes,t!=null}function ci(){gt(is),gt(Qt)}function zh(t,s,n){if(Qt.current!==Vr)throw Error(l(168));ht(Qt,s),ht(is,n)}function $h(t,s,n){var o=t.stateNode;if(s=s.childContextTypes,typeof o.getChildContext!="function")return n;o=o.getChildContext();for(var u in o)if(!(u in s))throw Error(l(108,q(t)||"Unknown",u));return K({},n,o)}function di(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Vr,Tn=Qt.current,ht(Qt,t),ht(is,is.current),!0}function Bh(t,s,n){var o=t.stateNode;if(!o)throw Error(l(169));n?(t=$h(t,s,Tn),o.__reactInternalMemoizedMergedChildContext=t,gt(is),gt(Qt),ht(Qt,t)):gt(is),ht(is,n)}var gr=null,ui=!1,pc=!1;function Uh(t){gr===null?gr=[t]:gr.push(t)}function $y(t){ui=!0,Uh(t)}function Wr(){if(!pc&&gr!==null){pc=!0;var t=0,s=it;try{var n=gr;for(it=1;t<n.length;t++){var o=n[t];do o=o(!0);while(o!==null)}gr=null,ui=!1}catch(u){throw gr!==null&&(gr=gr.slice(t+1)),B(Fo,Wr),u}finally{it=s,pc=!1}}return null}var ua=[],ha=0,hi=null,mi=0,Ps=[],Ts=0,Rn=null,yr=1,vr="";function In(t,s){ua[ha++]=mi,ua[ha++]=hi,hi=t,mi=s}function Vh(t,s,n){Ps[Ts++]=yr,Ps[Ts++]=vr,Ps[Ts++]=Rn,Rn=t;var o=yr;t=vr;var u=32-Bs(o)-1;o&=~(1<<u),n+=1;var x=32-Bs(s)+u;if(30<x){var S=u-u%5;x=(o&(1<<S)-1).toString(32),o>>=S,u-=S,yr=1<<32-Bs(s)+u|n<<u|o,vr=x+t}else yr=1<<x|n<<u|o,vr=t}function gc(t){t.return!==null&&(In(t,1),Vh(t,1,0))}function yc(t){for(;t===hi;)hi=ua[--ha],ua[ha]=null,mi=ua[--ha],ua[ha]=null;for(;t===Rn;)Rn=Ps[--Ts],Ps[Ts]=null,vr=Ps[--Ts],Ps[Ts]=null,yr=Ps[--Ts],Ps[Ts]=null}var js=null,bs=null,bt=!1,Vs=null;function Wh(t,s){var n=Ms(5,null,null,0);n.elementType="DELETED",n.stateNode=s,n.return=t,s=t.deletions,s===null?(t.deletions=[n],t.flags|=16):s.push(n)}function Hh(t,s){switch(t.tag){case 5:var n=t.type;return s=s.nodeType!==1||n.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(t.stateNode=s,js=t,bs=Br(s.firstChild),!0):!1;case 6:return s=t.pendingProps===""||s.nodeType!==3?null:s,s!==null?(t.stateNode=s,js=t,bs=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(n=Rn!==null?{id:yr,overflow:vr}:null,t.memoizedState={dehydrated:s,treeContext:n,retryLane:1073741824},n=Ms(18,null,null,0),n.stateNode=s,n.return=t,t.child=n,js=t,bs=null,!0):!1;default:return!1}}function vc(t){return(t.mode&1)!==0&&(t.flags&128)===0}function jc(t){if(bt){var s=bs;if(s){var n=s;if(!Hh(t,s)){if(vc(t))throw Error(l(418));s=Br(n.nextSibling);var o=js;s&&Hh(t,s)?Wh(o,n):(t.flags=t.flags&-4097|2,bt=!1,js=t)}}else{if(vc(t))throw Error(l(418));t.flags=t.flags&-4097|2,bt=!1,js=t}}}function Kh(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;js=t}function fi(t){if(t!==js)return!1;if(!bt)return Kh(t),bt=!0,!1;var s;if((s=t.tag!==3)&&!(s=t.tag!==5)&&(s=t.type,s=s!=="head"&&s!=="body"&&!uc(t.type,t.memoizedProps)),s&&(s=bs)){if(vc(t))throw Gh(),Error(l(418));for(;s;)Wh(t,s),s=Br(s.nextSibling)}if(Kh(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));e:{for(t=t.nextSibling,s=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(s===0){bs=Br(t.nextSibling);break e}s--}else n!=="$"&&n!=="$!"&&n!=="$?"||s++}t=t.nextSibling}bs=null}}else bs=js?Br(t.stateNode.nextSibling):null;return!0}function Gh(){for(var t=bs;t;)t=Br(t.nextSibling)}function ma(){bs=js=null,bt=!1}function bc(t){Vs===null?Vs=[t]:Vs.push(t)}var By=R.ReactCurrentBatchConfig;function ul(t,s,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(l(309));var o=n.stateNode}if(!o)throw Error(l(147,t));var u=o,x=""+t;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===x?s.ref:(s=function(S){var M=u.refs;S===null?delete M[x]:M[x]=S},s._stringRef=x,s)}if(typeof t!="string")throw Error(l(284));if(!n._owner)throw Error(l(290,t))}return t}function xi(t,s){throw t=Object.prototype.toString.call(s),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":t))}function Yh(t){var s=t._init;return s(t._payload)}function Qh(t){function s(J,W){if(t){var se=J.deletions;se===null?(J.deletions=[W],J.flags|=16):se.push(W)}}function n(J,W){if(!t)return null;for(;W!==null;)s(J,W),W=W.sibling;return null}function o(J,W){for(J=new Map;W!==null;)W.key!==null?J.set(W.key,W):J.set(W.index,W),W=W.sibling;return J}function u(J,W){return J=Jr(J,W),J.index=0,J.sibling=null,J}function x(J,W,se){return J.index=se,t?(se=J.alternate,se!==null?(se=se.index,se<W?(J.flags|=2,W):se):(J.flags|=2,W)):(J.flags|=1048576,W)}function S(J){return t&&J.alternate===null&&(J.flags|=2),J}function M(J,W,se,je){return W===null||W.tag!==6?(W=hd(se,J.mode,je),W.return=J,W):(W=u(W,se),W.return=J,W)}function U(J,W,se,je){var De=se.type;return De===_?me(J,W,se.props.children,je,se.key):W!==null&&(W.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===oe&&Yh(De)===W.type)?(je=u(W,se.props),je.ref=ul(J,W,se),je.return=J,je):(je=zi(se.type,se.key,se.props,null,J.mode,je),je.ref=ul(J,W,se),je.return=J,je)}function ae(J,W,se,je){return W===null||W.tag!==4||W.stateNode.containerInfo!==se.containerInfo||W.stateNode.implementation!==se.implementation?(W=md(se,J.mode,je),W.return=J,W):(W=u(W,se.children||[]),W.return=J,W)}function me(J,W,se,je,De){return W===null||W.tag!==7?(W=zn(se,J.mode,je,De),W.return=J,W):(W=u(W,se),W.return=J,W)}function ye(J,W,se){if(typeof W=="string"&&W!==""||typeof W=="number")return W=hd(""+W,J.mode,se),W.return=J,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case L:return se=zi(W.type,W.key,W.props,null,J.mode,se),se.ref=ul(J,null,W),se.return=J,se;case H:return W=md(W,J.mode,se),W.return=J,W;case oe:var je=W._init;return ye(J,je(W._payload),se)}if(ft(W)||ne(W))return W=zn(W,J.mode,se,null),W.return=J,W;xi(J,W)}return null}function ue(J,W,se,je){var De=W!==null?W.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return De!==null?null:M(J,W,""+se,je);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case L:return se.key===De?U(J,W,se,je):null;case H:return se.key===De?ae(J,W,se,je):null;case oe:return De=se._init,ue(J,W,De(se._payload),je)}if(ft(se)||ne(se))return De!==null?null:me(J,W,se,je,null);xi(J,se)}return null}function Pe(J,W,se,je,De){if(typeof je=="string"&&je!==""||typeof je=="number")return J=J.get(se)||null,M(W,J,""+je,De);if(typeof je=="object"&&je!==null){switch(je.$$typeof){case L:return J=J.get(je.key===null?se:je.key)||null,U(W,J,je,De);case H:return J=J.get(je.key===null?se:je.key)||null,ae(W,J,je,De);case oe:var Oe=je._init;return Pe(J,W,se,Oe(je._payload),De)}if(ft(je)||ne(je))return J=J.get(se)||null,me(W,J,je,De,null);xi(W,je)}return null}function Ie(J,W,se,je){for(var De=null,Oe=null,Fe=W,Ue=W=0,Wt=null;Fe!==null&&Ue<se.length;Ue++){Fe.index>Ue?(Wt=Fe,Fe=null):Wt=Fe.sibling;var rt=ue(J,Fe,se[Ue],je);if(rt===null){Fe===null&&(Fe=Wt);break}t&&Fe&&rt.alternate===null&&s(J,Fe),W=x(rt,W,Ue),Oe===null?De=rt:Oe.sibling=rt,Oe=rt,Fe=Wt}if(Ue===se.length)return n(J,Fe),bt&&In(J,Ue),De;if(Fe===null){for(;Ue<se.length;Ue++)Fe=ye(J,se[Ue],je),Fe!==null&&(W=x(Fe,W,Ue),Oe===null?De=Fe:Oe.sibling=Fe,Oe=Fe);return bt&&In(J,Ue),De}for(Fe=o(J,Fe);Ue<se.length;Ue++)Wt=Pe(Fe,J,Ue,se[Ue],je),Wt!==null&&(t&&Wt.alternate!==null&&Fe.delete(Wt.key===null?Ue:Wt.key),W=x(Wt,W,Ue),Oe===null?De=Wt:Oe.sibling=Wt,Oe=Wt);return t&&Fe.forEach(function(Zr){return s(J,Zr)}),bt&&In(J,Ue),De}function Ae(J,W,se,je){var De=ne(se);if(typeof De!="function")throw Error(l(150));if(se=De.call(se),se==null)throw Error(l(151));for(var Oe=De=null,Fe=W,Ue=W=0,Wt=null,rt=se.next();Fe!==null&&!rt.done;Ue++,rt=se.next()){Fe.index>Ue?(Wt=Fe,Fe=null):Wt=Fe.sibling;var Zr=ue(J,Fe,rt.value,je);if(Zr===null){Fe===null&&(Fe=Wt);break}t&&Fe&&Zr.alternate===null&&s(J,Fe),W=x(Zr,W,Ue),Oe===null?De=Zr:Oe.sibling=Zr,Oe=Zr,Fe=Wt}if(rt.done)return n(J,Fe),bt&&In(J,Ue),De;if(Fe===null){for(;!rt.done;Ue++,rt=se.next())rt=ye(J,rt.value,je),rt!==null&&(W=x(rt,W,Ue),Oe===null?De=rt:Oe.sibling=rt,Oe=rt);return bt&&In(J,Ue),De}for(Fe=o(J,Fe);!rt.done;Ue++,rt=se.next())rt=Pe(Fe,J,Ue,rt.value,je),rt!==null&&(t&&rt.alternate!==null&&Fe.delete(rt.key===null?Ue:rt.key),W=x(rt,W,Ue),Oe===null?De=rt:Oe.sibling=rt,Oe=rt);return t&&Fe.forEach(function(jv){return s(J,jv)}),bt&&In(J,Ue),De}function _t(J,W,se,je){if(typeof se=="object"&&se!==null&&se.type===_&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case L:e:{for(var De=se.key,Oe=W;Oe!==null;){if(Oe.key===De){if(De=se.type,De===_){if(Oe.tag===7){n(J,Oe.sibling),W=u(Oe,se.props.children),W.return=J,J=W;break e}}else if(Oe.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===oe&&Yh(De)===Oe.type){n(J,Oe.sibling),W=u(Oe,se.props),W.ref=ul(J,Oe,se),W.return=J,J=W;break e}n(J,Oe);break}else s(J,Oe);Oe=Oe.sibling}se.type===_?(W=zn(se.props.children,J.mode,je,se.key),W.return=J,J=W):(je=zi(se.type,se.key,se.props,null,J.mode,je),je.ref=ul(J,W,se),je.return=J,J=je)}return S(J);case H:e:{for(Oe=se.key;W!==null;){if(W.key===Oe)if(W.tag===4&&W.stateNode.containerInfo===se.containerInfo&&W.stateNode.implementation===se.implementation){n(J,W.sibling),W=u(W,se.children||[]),W.return=J,J=W;break e}else{n(J,W);break}else s(J,W);W=W.sibling}W=md(se,J.mode,je),W.return=J,J=W}return S(J);case oe:return Oe=se._init,_t(J,W,Oe(se._payload),je)}if(ft(se))return Ie(J,W,se,je);if(ne(se))return Ae(J,W,se,je);xi(J,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,W!==null&&W.tag===6?(n(J,W.sibling),W=u(W,se),W.return=J,J=W):(n(J,W),W=hd(se,J.mode,je),W.return=J,J=W),S(J)):n(J,W)}return _t}var fa=Qh(!0),qh=Qh(!1),pi=Ur(null),gi=null,xa=null,Nc=null;function wc(){Nc=xa=gi=null}function Sc(t){var s=pi.current;gt(pi),t._currentValue=s}function Cc(t,s,n){for(;t!==null;){var o=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,o!==null&&(o.childLanes|=s)):o!==null&&(o.childLanes&s)!==s&&(o.childLanes|=s),t===n)break;t=t.return}}function pa(t,s){gi=t,Nc=xa=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&s)!==0&&(cs=!0),t.firstContext=null)}function Rs(t){var s=t._currentValue;if(Nc!==t)if(t={context:t,memoizedValue:s,next:null},xa===null){if(gi===null)throw Error(l(308));xa=t,gi.dependencies={lanes:0,firstContext:t}}else xa=xa.next=t;return s}var _n=null;function kc(t){_n===null?_n=[t]:_n.push(t)}function Xh(t,s,n,o){var u=s.interleaved;return u===null?(n.next=n,kc(s)):(n.next=u.next,u.next=n),s.interleaved=n,jr(t,o)}function jr(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 Hr=!1;function Ec(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jh(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 br(t,s){return{eventTime:t,lane:s,tag:0,payload:null,callback:null,next:null}}function Kr(t,s,n){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(st&2)!==0){var u=o.pending;return u===null?s.next=s:(s.next=u.next,u.next=s),o.pending=s,jr(t,n)}return u=o.interleaved,u===null?(s.next=s,kc(o)):(s.next=u.next,u.next=s),o.interleaved=s,jr(t,n)}function yi(t,s,n){if(s=s.updateQueue,s!==null&&(s=s.shared,(n&4194240)!==0)){var o=s.lanes;o&=t.pendingLanes,n|=o,s.lanes=n,Bo(t,n)}}function Zh(t,s){var n=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,n===o)){var u=null,x=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};x===null?u=x=S:x=x.next=S,n=n.next}while(n!==null);x===null?u=x=s:x=x.next=s}else u=x=s;n={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:x,shared:o.shared,effects:o.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=s:t.next=s,n.lastBaseUpdate=s}function vi(t,s,n,o){var u=t.updateQueue;Hr=!1;var x=u.firstBaseUpdate,S=u.lastBaseUpdate,M=u.shared.pending;if(M!==null){u.shared.pending=null;var U=M,ae=U.next;U.next=null,S===null?x=ae:S.next=ae,S=U;var me=t.alternate;me!==null&&(me=me.updateQueue,M=me.lastBaseUpdate,M!==S&&(M===null?me.firstBaseUpdate=ae:M.next=ae,me.lastBaseUpdate=U))}if(x!==null){var ye=u.baseState;S=0,me=ae=U=null,M=x;do{var ue=M.lane,Pe=M.eventTime;if((o&ue)===ue){me!==null&&(me=me.next={eventTime:Pe,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var Ie=t,Ae=M;switch(ue=s,Pe=n,Ae.tag){case 1:if(Ie=Ae.payload,typeof Ie=="function"){ye=Ie.call(Pe,ye,ue);break e}ye=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Ae.payload,ue=typeof Ie=="function"?Ie.call(Pe,ye,ue):Ie,ue==null)break e;ye=K({},ye,ue);break e;case 2:Hr=!0}}M.callback!==null&&M.lane!==0&&(t.flags|=64,ue=u.effects,ue===null?u.effects=[M]:ue.push(M))}else Pe={eventTime:Pe,lane:ue,tag:M.tag,payload:M.payload,callback:M.callback,next:null},me===null?(ae=me=Pe,U=ye):me=me.next=Pe,S|=ue;if(M=M.next,M===null){if(M=u.shared.pending,M===null)break;ue=M,M=ue.next,ue.next=null,u.lastBaseUpdate=ue,u.shared.pending=null}}while(!0);if(me===null&&(U=ye),u.baseState=U,u.firstBaseUpdate=ae,u.lastBaseUpdate=me,s=u.shared.interleaved,s!==null){u=s;do S|=u.lane,u=u.next;while(u!==s)}else x===null&&(u.shared.lanes=0);Dn|=S,t.lanes=S,t.memoizedState=ye}}function em(t,s,n){if(t=s.effects,s.effects=null,t!==null)for(s=0;s<t.length;s++){var o=t[s],u=o.callback;if(u!==null){if(o.callback=null,o=n,typeof u!="function")throw Error(l(191,u));u.call(o)}}}var hl={},rr=Ur(hl),ml=Ur(hl),fl=Ur(hl);function Mn(t){if(t===hl)throw Error(l(174));return t}function Pc(t,s){switch(ht(fl,s),ht(ml,t),ht(rr,hl),t=s.nodeType,t){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:dt(null,"");break;default:t=t===8?s.parentNode:s,s=t.namespaceURI||null,t=t.tagName,s=dt(s,t)}gt(rr),ht(rr,s)}function ga(){gt(rr),gt(ml),gt(fl)}function tm(t){Mn(fl.current);var s=Mn(rr.current),n=dt(s,t.type);s!==n&&(ht(ml,t),ht(rr,n))}function Tc(t){ml.current===t&&(gt(rr),gt(ml))}var wt=Ur(0);function ji(t){for(var s=t;s!==null;){if(s.tag===13){var n=s.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Rc=[];function Ic(){for(var t=0;t<Rc.length;t++)Rc[t]._workInProgressVersionPrimary=null;Rc.length=0}var bi=R.ReactCurrentDispatcher,_c=R.ReactCurrentBatchConfig,An=0,St=null,Ft=null,Ut=null,Ni=!1,xl=!1,pl=0,Uy=0;function qt(){throw Error(l(321))}function Mc(t,s){if(s===null)return!1;for(var n=0;n<s.length&&n<t.length;n++)if(!Us(t[n],s[n]))return!1;return!0}function Ac(t,s,n,o,u,x){if(An=x,St=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,bi.current=t===null||t.memoizedState===null?Ky:Gy,t=n(o,u),xl){x=0;do{if(xl=!1,pl=0,25<=x)throw Error(l(301));x+=1,Ut=Ft=null,s.updateQueue=null,bi.current=Yy,t=n(o,u)}while(xl)}if(bi.current=Ci,s=Ft!==null&&Ft.next!==null,An=0,Ut=Ft=St=null,Ni=!1,s)throw Error(l(300));return t}function Dc(){var t=pl!==0;return pl=0,t}function nr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?St.memoizedState=Ut=t:Ut=Ut.next=t,Ut}function Is(){if(Ft===null){var t=St.alternate;t=t!==null?t.memoizedState:null}else t=Ft.next;var s=Ut===null?St.memoizedState:Ut.next;if(s!==null)Ut=s,Ft=t;else{if(t===null)throw Error(l(310));Ft=t,t={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},Ut===null?St.memoizedState=Ut=t:Ut=Ut.next=t}return Ut}function gl(t,s){return typeof s=="function"?s(t):s}function Lc(t){var s=Is(),n=s.queue;if(n===null)throw Error(l(311));n.lastRenderedReducer=t;var o=Ft,u=o.baseQueue,x=n.pending;if(x!==null){if(u!==null){var S=u.next;u.next=x.next,x.next=S}o.baseQueue=u=x,n.pending=null}if(u!==null){x=u.next,o=o.baseState;var M=S=null,U=null,ae=x;do{var me=ae.lane;if((An&me)===me)U!==null&&(U=U.next={lane:0,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),o=ae.hasEagerState?ae.eagerState:t(o,ae.action);else{var ye={lane:me,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null};U===null?(M=U=ye,S=o):U=U.next=ye,St.lanes|=me,Dn|=me}ae=ae.next}while(ae!==null&&ae!==x);U===null?S=o:U.next=M,Us(o,s.memoizedState)||(cs=!0),s.memoizedState=o,s.baseState=S,s.baseQueue=U,n.lastRenderedState=o}if(t=n.interleaved,t!==null){u=t;do x=u.lane,St.lanes|=x,Dn|=x,u=u.next;while(u!==t)}else u===null&&(n.lanes=0);return[s.memoizedState,n.dispatch]}function Oc(t){var s=Is(),n=s.queue;if(n===null)throw Error(l(311));n.lastRenderedReducer=t;var o=n.dispatch,u=n.pending,x=s.memoizedState;if(u!==null){n.pending=null;var S=u=u.next;do x=t(x,S.action),S=S.next;while(S!==u);Us(x,s.memoizedState)||(cs=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),n.lastRenderedState=x}return[x,o]}function sm(){}function rm(t,s){var n=St,o=Is(),u=s(),x=!Us(o.memoizedState,u);if(x&&(o.memoizedState=u,cs=!0),o=o.queue,Fc(lm.bind(null,n,o,t),[t]),o.getSnapshot!==s||x||Ut!==null&&Ut.memoizedState.tag&1){if(n.flags|=2048,yl(9,am.bind(null,n,o,u,s),void 0,null),Vt===null)throw Error(l(349));(An&30)!==0||nm(n,s,u)}return u}function nm(t,s,n){t.flags|=16384,t={getSnapshot:s,value:n},s=St.updateQueue,s===null?(s={lastEffect:null,stores:null},St.updateQueue=s,s.stores=[t]):(n=s.stores,n===null?s.stores=[t]:n.push(t))}function am(t,s,n,o){s.value=n,s.getSnapshot=o,im(s)&&om(t)}function lm(t,s,n){return n(function(){im(s)&&om(t)})}function im(t){var s=t.getSnapshot;t=t.value;try{var n=s();return!Us(t,n)}catch{return!0}}function om(t){var s=jr(t,1);s!==null&&Gs(s,t,1,-1)}function cm(t){var s=nr();return typeof t=="function"&&(t=t()),s.memoizedState=s.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gl,lastRenderedState:t},s.queue=t,t=t.dispatch=Hy.bind(null,St,t),[s.memoizedState,t]}function yl(t,s,n,o){return t={tag:t,create:s,destroy:n,deps:o,next:null},s=St.updateQueue,s===null?(s={lastEffect:null,stores:null},St.updateQueue=s,s.lastEffect=t.next=t):(n=s.lastEffect,n===null?s.lastEffect=t.next=t:(o=n.next,n.next=t,t.next=o,s.lastEffect=t)),t}function dm(){return Is().memoizedState}function wi(t,s,n,o){var u=nr();St.flags|=t,u.memoizedState=yl(1|s,n,void 0,o===void 0?null:o)}function Si(t,s,n,o){var u=Is();o=o===void 0?null:o;var x=void 0;if(Ft!==null){var S=Ft.memoizedState;if(x=S.destroy,o!==null&&Mc(o,S.deps)){u.memoizedState=yl(s,n,x,o);return}}St.flags|=t,u.memoizedState=yl(1|s,n,x,o)}function um(t,s){return wi(8390656,8,t,s)}function Fc(t,s){return Si(2048,8,t,s)}function hm(t,s){return Si(4,2,t,s)}function mm(t,s){return Si(4,4,t,s)}function fm(t,s){if(typeof s=="function")return t=t(),s(t),function(){s(null)};if(s!=null)return t=t(),s.current=t,function(){s.current=null}}function xm(t,s,n){return n=n!=null?n.concat([t]):null,Si(4,4,fm.bind(null,s,t),n)}function zc(){}function pm(t,s){var n=Is();s=s===void 0?null:s;var o=n.memoizedState;return o!==null&&s!==null&&Mc(s,o[1])?o[0]:(n.memoizedState=[t,s],t)}function gm(t,s){var n=Is();s=s===void 0?null:s;var o=n.memoizedState;return o!==null&&s!==null&&Mc(s,o[1])?o[0]:(t=t(),n.memoizedState=[t,s],t)}function ym(t,s,n){return(An&21)===0?(t.baseState&&(t.baseState=!1,cs=!0),t.memoizedState=n):(Us(n,s)||(n=Yu(),St.lanes|=n,Dn|=n,t.baseState=!0),s)}function Vy(t,s){var n=it;it=n!==0&&4>n?n:4,t(!0);var o=_c.transition;_c.transition={};try{t(!1),s()}finally{it=n,_c.transition=o}}function vm(){return Is().memoizedState}function Wy(t,s,n){var o=qr(t);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},jm(t))bm(s,n);else if(n=Xh(t,s,n,o),n!==null){var u=rs();Gs(n,t,o,u),Nm(n,s,o)}}function Hy(t,s,n){var o=qr(t),u={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null};if(jm(t))bm(s,u);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var S=s.lastRenderedState,M=x(S,n);if(u.hasEagerState=!0,u.eagerState=M,Us(M,S)){var U=s.interleaved;U===null?(u.next=u,kc(s)):(u.next=U.next,U.next=u),s.interleaved=u;return}}catch{}finally{}n=Xh(t,s,u,o),n!==null&&(u=rs(),Gs(n,t,o,u),Nm(n,s,o))}}function jm(t){var s=t.alternate;return t===St||s!==null&&s===St}function bm(t,s){xl=Ni=!0;var n=t.pending;n===null?s.next=s:(s.next=n.next,n.next=s),t.pending=s}function Nm(t,s,n){if((n&4194240)!==0){var o=s.lanes;o&=t.pendingLanes,n|=o,s.lanes=n,Bo(t,n)}}var Ci={readContext:Rs,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useInsertionEffect:qt,useLayoutEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useMutableSource:qt,useSyncExternalStore:qt,useId:qt,unstable_isNewReconciler:!1},Ky={readContext:Rs,useCallback:function(t,s){return nr().memoizedState=[t,s===void 0?null:s],t},useContext:Rs,useEffect:um,useImperativeHandle:function(t,s,n){return n=n!=null?n.concat([t]):null,wi(4194308,4,fm.bind(null,s,t),n)},useLayoutEffect:function(t,s){return wi(4194308,4,t,s)},useInsertionEffect:function(t,s){return wi(4,2,t,s)},useMemo:function(t,s){var n=nr();return s=s===void 0?null:s,t=t(),n.memoizedState=[t,s],t},useReducer:function(t,s,n){var o=nr();return s=n!==void 0?n(s):s,o.memoizedState=o.baseState=s,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:s},o.queue=t,t=t.dispatch=Wy.bind(null,St,t),[o.memoizedState,t]},useRef:function(t){var s=nr();return t={current:t},s.memoizedState=t},useState:cm,useDebugValue:zc,useDeferredValue:function(t){return nr().memoizedState=t},useTransition:function(){var t=cm(!1),s=t[0];return t=Vy.bind(null,t[1]),nr().memoizedState=t,[s,t]},useMutableSource:function(){},useSyncExternalStore:function(t,s,n){var o=St,u=nr();if(bt){if(n===void 0)throw Error(l(407));n=n()}else{if(n=s(),Vt===null)throw Error(l(349));(An&30)!==0||nm(o,s,n)}u.memoizedState=n;var x={value:n,getSnapshot:s};return u.queue=x,um(lm.bind(null,o,x,t),[t]),o.flags|=2048,yl(9,am.bind(null,o,x,n,s),void 0,null),n},useId:function(){var t=nr(),s=Vt.identifierPrefix;if(bt){var n=vr,o=yr;n=(o&~(1<<32-Bs(o)-1)).toString(32)+n,s=":"+s+"R"+n,n=pl++,0<n&&(s+="H"+n.toString(32)),s+=":"}else n=Uy++,s=":"+s+"r"+n.toString(32)+":";return t.memoizedState=s},unstable_isNewReconciler:!1},Gy={readContext:Rs,useCallback:pm,useContext:Rs,useEffect:Fc,useImperativeHandle:xm,useInsertionEffect:hm,useLayoutEffect:mm,useMemo:gm,useReducer:Lc,useRef:dm,useState:function(){return Lc(gl)},useDebugValue:zc,useDeferredValue:function(t){var s=Is();return ym(s,Ft.memoizedState,t)},useTransition:function(){var t=Lc(gl)[0],s=Is().memoizedState;return[t,s]},useMutableSource:sm,useSyncExternalStore:rm,useId:vm,unstable_isNewReconciler:!1},Yy={readContext:Rs,useCallback:pm,useContext:Rs,useEffect:Fc,useImperativeHandle:xm,useInsertionEffect:hm,useLayoutEffect:mm,useMemo:gm,useReducer:Oc,useRef:dm,useState:function(){return Oc(gl)},useDebugValue:zc,useDeferredValue:function(t){var s=Is();return Ft===null?s.memoizedState=t:ym(s,Ft.memoizedState,t)},useTransition:function(){var t=Oc(gl)[0],s=Is().memoizedState;return[t,s]},useMutableSource:sm,useSyncExternalStore:rm,useId:vm,unstable_isNewReconciler:!1};function Ws(t,s){if(t&&t.defaultProps){s=K({},s),t=t.defaultProps;for(var n in t)s[n]===void 0&&(s[n]=t[n]);return s}return s}function $c(t,s,n,o){s=t.memoizedState,n=n(o,s),n=n==null?s:K({},s,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var ki={isMounted:function(t){return(t=t._reactInternals)?nt(t)===t:!1},enqueueSetState:function(t,s,n){t=t._reactInternals;var o=rs(),u=qr(t),x=br(o,u);x.payload=s,n!=null&&(x.callback=n),s=Kr(t,x,u),s!==null&&(Gs(s,t,u,o),yi(s,t,u))},enqueueReplaceState:function(t,s,n){t=t._reactInternals;var o=rs(),u=qr(t),x=br(o,u);x.tag=1,x.payload=s,n!=null&&(x.callback=n),s=Kr(t,x,u),s!==null&&(Gs(s,t,u,o),yi(s,t,u))},enqueueForceUpdate:function(t,s){t=t._reactInternals;var n=rs(),o=qr(t),u=br(n,o);u.tag=2,s!=null&&(u.callback=s),s=Kr(t,u,o),s!==null&&(Gs(s,t,o,n),yi(s,t,o))}};function wm(t,s,n,o,u,x,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,x,S):s.prototype&&s.prototype.isPureReactComponent?!nl(n,o)||!nl(u,x):!0}function Sm(t,s,n){var o=!1,u=Vr,x=s.contextType;return typeof x=="object"&&x!==null?x=Rs(x):(u=os(s)?Tn:Qt.current,o=s.contextTypes,x=(o=o!=null)?da(t,u):Vr),s=new s(n,x),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=ki,t.stateNode=s,s._reactInternals=t,o&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=u,t.__reactInternalMemoizedMaskedChildContext=x),s}function Cm(t,s,n,o){t=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(n,o),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(n,o),s.state!==t&&ki.enqueueReplaceState(s,s.state,null)}function Bc(t,s,n,o){var u=t.stateNode;u.props=n,u.state=t.memoizedState,u.refs={},Ec(t);var x=s.contextType;typeof x=="object"&&x!==null?u.context=Rs(x):(x=os(s)?Tn:Qt.current,u.context=da(t,x)),u.state=t.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&($c(t,s,x,n),u.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(s=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),s!==u.state&&ki.enqueueReplaceState(u,u.state,null),vi(t,n,u,o),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308)}function ya(t,s){try{var n="",o=s;do n+=Y(o),o=o.return;while(o);var u=n}catch(x){u=`
|
||
Error generating stack: `+x.message+`
|
||
`+x.stack}return{value:t,source:s,stack:u,digest:null}}function Uc(t,s,n){return{value:t,source:null,stack:n??null,digest:s??null}}function Vc(t,s){try{console.error(s.value)}catch(n){setTimeout(function(){throw n})}}var Qy=typeof WeakMap=="function"?WeakMap:Map;function km(t,s,n){n=br(-1,n),n.tag=3,n.payload={element:null};var o=s.value;return n.callback=function(){Mi||(Mi=!0,nd=o),Vc(t,s)},n}function Em(t,s,n){n=br(-1,n),n.tag=3;var o=t.type.getDerivedStateFromError;if(typeof o=="function"){var u=s.value;n.payload=function(){return o(u)},n.callback=function(){Vc(t,s)}}var x=t.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(n.callback=function(){Vc(t,s),typeof o!="function"&&(Yr===null?Yr=new Set([this]):Yr.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})}),n}function Pm(t,s,n){var o=t.pingCache;if(o===null){o=t.pingCache=new Qy;var u=new Set;o.set(s,u)}else u=o.get(s),u===void 0&&(u=new Set,o.set(s,u));u.has(n)||(u.add(n),t=cv.bind(null,t,s,n),s.then(t,t))}function Tm(t){do{var s;if((s=t.tag===13)&&(s=t.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return t;t=t.return}while(t!==null);return null}function Rm(t,s,n,o,u){return(t.mode&1)===0?(t===s?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(s=br(-1,1),s.tag=2,Kr(n,s,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=u,t)}var qy=R.ReactCurrentOwner,cs=!1;function ss(t,s,n,o){s.child=t===null?qh(s,null,n,o):fa(s,t.child,n,o)}function Im(t,s,n,o,u){n=n.render;var x=s.ref;return pa(s,u),o=Ac(t,s,n,o,x,u),n=Dc(),t!==null&&!cs?(s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~u,Nr(t,s,u)):(bt&&n&&gc(s),s.flags|=1,ss(t,s,o,u),s.child)}function _m(t,s,n,o,u){if(t===null){var x=n.type;return typeof x=="function"&&!ud(x)&&x.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(s.tag=15,s.type=x,Mm(t,s,x,o,u)):(t=zi(n.type,null,o,s,s.mode,u),t.ref=s.ref,t.return=s,s.child=t)}if(x=t.child,(t.lanes&u)===0){var S=x.memoizedProps;if(n=n.compare,n=n!==null?n:nl,n(S,o)&&t.ref===s.ref)return Nr(t,s,u)}return s.flags|=1,t=Jr(x,o),t.ref=s.ref,t.return=s,s.child=t}function Mm(t,s,n,o,u){if(t!==null){var x=t.memoizedProps;if(nl(x,o)&&t.ref===s.ref)if(cs=!1,s.pendingProps=o=x,(t.lanes&u)!==0)(t.flags&131072)!==0&&(cs=!0);else return s.lanes=t.lanes,Nr(t,s,u)}return Wc(t,s,n,o,u)}function Am(t,s,n){var o=s.pendingProps,u=o.children,x=t!==null?t.memoizedState:null;if(o.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},ht(ja,Ns),Ns|=n;else{if((n&1073741824)===0)return t=x!==null?x.baseLanes|n:n,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:t,cachePool:null,transitions:null},s.updateQueue=null,ht(ja,Ns),Ns|=t,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=x!==null?x.baseLanes:n,ht(ja,Ns),Ns|=o}else x!==null?(o=x.baseLanes|n,s.memoizedState=null):o=n,ht(ja,Ns),Ns|=o;return ss(t,s,u,n),s.child}function Dm(t,s){var n=s.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(s.flags|=512,s.flags|=2097152)}function Wc(t,s,n,o,u){var x=os(n)?Tn:Qt.current;return x=da(s,x),pa(s,u),n=Ac(t,s,n,o,x,u),o=Dc(),t!==null&&!cs?(s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~u,Nr(t,s,u)):(bt&&o&&gc(s),s.flags|=1,ss(t,s,n,u),s.child)}function Lm(t,s,n,o,u){if(os(n)){var x=!0;di(s)}else x=!1;if(pa(s,u),s.stateNode===null)Pi(t,s),Sm(s,n,o),Bc(s,n,o,u),o=!0;else if(t===null){var S=s.stateNode,M=s.memoizedProps;S.props=M;var U=S.context,ae=n.contextType;typeof ae=="object"&&ae!==null?ae=Rs(ae):(ae=os(n)?Tn:Qt.current,ae=da(s,ae));var me=n.getDerivedStateFromProps,ye=typeof me=="function"||typeof S.getSnapshotBeforeUpdate=="function";ye||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(M!==o||U!==ae)&&Cm(s,S,o,ae),Hr=!1;var ue=s.memoizedState;S.state=ue,vi(s,o,S,u),U=s.memoizedState,M!==o||ue!==U||is.current||Hr?(typeof me=="function"&&($c(s,n,me,o),U=s.memoizedState),(M=Hr||wm(s,n,M,o,ue,U,ae))?(ye||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(s.flags|=4194308)):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=o,s.memoizedState=U),S.props=o,S.state=U,S.context=ae,o=M):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),o=!1)}else{S=s.stateNode,Jh(t,s),M=s.memoizedProps,ae=s.type===s.elementType?M:Ws(s.type,M),S.props=ae,ye=s.pendingProps,ue=S.context,U=n.contextType,typeof U=="object"&&U!==null?U=Rs(U):(U=os(n)?Tn:Qt.current,U=da(s,U));var Pe=n.getDerivedStateFromProps;(me=typeof Pe=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(M!==ye||ue!==U)&&Cm(s,S,o,U),Hr=!1,ue=s.memoizedState,S.state=ue,vi(s,o,S,u);var Ie=s.memoizedState;M!==ye||ue!==Ie||is.current||Hr?(typeof Pe=="function"&&($c(s,n,Pe,o),Ie=s.memoizedState),(ae=Hr||wm(s,n,ae,o,ue,Ie,U)||!1)?(me||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(o,Ie,U),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(o,Ie,U)),typeof S.componentDidUpdate=="function"&&(s.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof S.componentDidUpdate!="function"||M===t.memoizedProps&&ue===t.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===t.memoizedProps&&ue===t.memoizedState||(s.flags|=1024),s.memoizedProps=o,s.memoizedState=Ie),S.props=o,S.state=Ie,S.context=U,o=ae):(typeof S.componentDidUpdate!="function"||M===t.memoizedProps&&ue===t.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===t.memoizedProps&&ue===t.memoizedState||(s.flags|=1024),o=!1)}return Hc(t,s,n,o,x,u)}function Hc(t,s,n,o,u,x){Dm(t,s);var S=(s.flags&128)!==0;if(!o&&!S)return u&&Bh(s,n,!1),Nr(t,s,x);o=s.stateNode,qy.current=s;var M=S&&typeof n.getDerivedStateFromError!="function"?null:o.render();return s.flags|=1,t!==null&&S?(s.child=fa(s,t.child,null,x),s.child=fa(s,null,M,x)):ss(t,s,M,x),s.memoizedState=o.state,u&&Bh(s,n,!0),s.child}function Om(t){var s=t.stateNode;s.pendingContext?zh(t,s.pendingContext,s.pendingContext!==s.context):s.context&&zh(t,s.context,!1),Pc(t,s.containerInfo)}function Fm(t,s,n,o,u){return ma(),bc(u),s.flags|=256,ss(t,s,n,o),s.child}var Kc={dehydrated:null,treeContext:null,retryLane:0};function Gc(t){return{baseLanes:t,cachePool:null,transitions:null}}function zm(t,s,n){var o=s.pendingProps,u=wt.current,x=!1,S=(s.flags&128)!==0,M;if((M=S)||(M=t!==null&&t.memoizedState===null?!1:(u&2)!==0),M?(x=!0,s.flags&=-129):(t===null||t.memoizedState!==null)&&(u|=1),ht(wt,u&1),t===null)return jc(s),t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((s.mode&1)===0?s.lanes=1:t.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(S=o.children,t=o.fallback,x?(o=s.mode,x=s.child,S={mode:"hidden",children:S},(o&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=S):x=$i(S,o,0,null),t=zn(t,o,n,null),x.return=s,t.return=s,x.sibling=t,s.child=x,s.child.memoizedState=Gc(n),s.memoizedState=Kc,t):Yc(s,S));if(u=t.memoizedState,u!==null&&(M=u.dehydrated,M!==null))return Xy(t,s,S,o,M,u,n);if(x){x=o.fallback,S=s.mode,u=t.child,M=u.sibling;var U={mode:"hidden",children:o.children};return(S&1)===0&&s.child!==u?(o=s.child,o.childLanes=0,o.pendingProps=U,s.deletions=null):(o=Jr(u,U),o.subtreeFlags=u.subtreeFlags&14680064),M!==null?x=Jr(M,x):(x=zn(x,S,n,null),x.flags|=2),x.return=s,o.return=s,o.sibling=x,s.child=o,o=x,x=s.child,S=t.child.memoizedState,S=S===null?Gc(n):{baseLanes:S.baseLanes|n,cachePool:null,transitions:S.transitions},x.memoizedState=S,x.childLanes=t.childLanes&~n,s.memoizedState=Kc,o}return x=t.child,t=x.sibling,o=Jr(x,{mode:"visible",children:o.children}),(s.mode&1)===0&&(o.lanes=n),o.return=s,o.sibling=null,t!==null&&(n=s.deletions,n===null?(s.deletions=[t],s.flags|=16):n.push(t)),s.child=o,s.memoizedState=null,o}function Yc(t,s){return s=$i({mode:"visible",children:s},t.mode,0,null),s.return=t,t.child=s}function Ei(t,s,n,o){return o!==null&&bc(o),fa(s,t.child,null,n),t=Yc(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function Xy(t,s,n,o,u,x,S){if(n)return s.flags&256?(s.flags&=-257,o=Uc(Error(l(422))),Ei(t,s,S,o)):s.memoizedState!==null?(s.child=t.child,s.flags|=128,null):(x=o.fallback,u=s.mode,o=$i({mode:"visible",children:o.children},u,0,null),x=zn(x,u,S,null),x.flags|=2,o.return=s,x.return=s,o.sibling=x,s.child=o,(s.mode&1)!==0&&fa(s,t.child,null,S),s.child.memoizedState=Gc(S),s.memoizedState=Kc,x);if((s.mode&1)===0)return Ei(t,s,S,null);if(u.data==="$!"){if(o=u.nextSibling&&u.nextSibling.dataset,o)var M=o.dgst;return o=M,x=Error(l(419)),o=Uc(x,o,void 0),Ei(t,s,S,o)}if(M=(S&t.childLanes)!==0,cs||M){if(o=Vt,o!==null){switch(S&-S){case 4:u=2;break;case 16:u=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:u=32;break;case 536870912:u=268435456;break;default:u=0}u=(u&(o.suspendedLanes|S))!==0?0:u,u!==0&&u!==x.retryLane&&(x.retryLane=u,jr(t,u),Gs(o,t,u,-1))}return dd(),o=Uc(Error(l(421))),Ei(t,s,S,o)}return u.data==="$?"?(s.flags|=128,s.child=t.child,s=dv.bind(null,t),u._reactRetry=s,null):(t=x.treeContext,bs=Br(u.nextSibling),js=s,bt=!0,Vs=null,t!==null&&(Ps[Ts++]=yr,Ps[Ts++]=vr,Ps[Ts++]=Rn,yr=t.id,vr=t.overflow,Rn=s),s=Yc(s,o.children),s.flags|=4096,s)}function $m(t,s,n){t.lanes|=s;var o=t.alternate;o!==null&&(o.lanes|=s),Cc(t.return,s,n)}function Qc(t,s,n,o,u){var x=t.memoizedState;x===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:o,tail:n,tailMode:u}:(x.isBackwards=s,x.rendering=null,x.renderingStartTime=0,x.last=o,x.tail=n,x.tailMode=u)}function Bm(t,s,n){var o=s.pendingProps,u=o.revealOrder,x=o.tail;if(ss(t,s,o.children,n),o=wt.current,(o&2)!==0)o=o&1|2,s.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&$m(t,n,s);else if(t.tag===19)$m(t,n,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===s)break e;for(;t.sibling===null;){if(t.return===null||t.return===s)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}o&=1}if(ht(wt,o),(s.mode&1)===0)s.memoizedState=null;else switch(u){case"forwards":for(n=s.child,u=null;n!==null;)t=n.alternate,t!==null&&ji(t)===null&&(u=n),n=n.sibling;n=u,n===null?(u=s.child,s.child=null):(u=n.sibling,n.sibling=null),Qc(s,!1,u,n,x);break;case"backwards":for(n=null,u=s.child,s.child=null;u!==null;){if(t=u.alternate,t!==null&&ji(t)===null){s.child=u;break}t=u.sibling,u.sibling=n,n=u,u=t}Qc(s,!0,n,null,x);break;case"together":Qc(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Pi(t,s){(s.mode&1)===0&&t!==null&&(t.alternate=null,s.alternate=null,s.flags|=2)}function Nr(t,s,n){if(t!==null&&(s.dependencies=t.dependencies),Dn|=s.lanes,(n&s.childLanes)===0)return null;if(t!==null&&s.child!==t.child)throw Error(l(153));if(s.child!==null){for(t=s.child,n=Jr(t,t.pendingProps),s.child=n,n.return=s;t.sibling!==null;)t=t.sibling,n=n.sibling=Jr(t,t.pendingProps),n.return=s;n.sibling=null}return s.child}function Jy(t,s,n){switch(s.tag){case 3:Om(s),ma();break;case 5:tm(s);break;case 1:os(s.type)&&di(s);break;case 4:Pc(s,s.stateNode.containerInfo);break;case 10:var o=s.type._context,u=s.memoizedProps.value;ht(pi,o._currentValue),o._currentValue=u;break;case 13:if(o=s.memoizedState,o!==null)return o.dehydrated!==null?(ht(wt,wt.current&1),s.flags|=128,null):(n&s.child.childLanes)!==0?zm(t,s,n):(ht(wt,wt.current&1),t=Nr(t,s,n),t!==null?t.sibling:null);ht(wt,wt.current&1);break;case 19:if(o=(n&s.childLanes)!==0,(t.flags&128)!==0){if(o)return Bm(t,s,n);s.flags|=128}if(u=s.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ht(wt,wt.current),o)break;return null;case 22:case 23:return s.lanes=0,Am(t,s,n)}return Nr(t,s,n)}var Um,qc,Vm,Wm;Um=function(t,s){for(var n=s.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===s)break;for(;n.sibling===null;){if(n.return===null||n.return===s)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},qc=function(){},Vm=function(t,s,n,o){var u=t.memoizedProps;if(u!==o){t=s.stateNode,Mn(rr.current);var x=null;switch(n){case"input":u=We(t,u),o=We(t,o),x=[];break;case"select":u=K({},u,{value:void 0}),o=K({},o,{value:void 0}),x=[];break;case"textarea":u=hr(t,u),o=hr(t,o),x=[];break;default:typeof u.onClick!="function"&&typeof o.onClick=="function"&&(t.onclick=ii)}fr(n,o);var S;n=null;for(ae in u)if(!o.hasOwnProperty(ae)&&u.hasOwnProperty(ae)&&u[ae]!=null)if(ae==="style"){var M=u[ae];for(S in M)M.hasOwnProperty(S)&&(n||(n={}),n[S]="")}else ae!=="dangerouslySetInnerHTML"&&ae!=="children"&&ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&ae!=="autoFocus"&&(c.hasOwnProperty(ae)?x||(x=[]):(x=x||[]).push(ae,null));for(ae in o){var U=o[ae];if(M=u!=null?u[ae]:void 0,o.hasOwnProperty(ae)&&U!==M&&(U!=null||M!=null))if(ae==="style")if(M){for(S in M)!M.hasOwnProperty(S)||U&&U.hasOwnProperty(S)||(n||(n={}),n[S]="");for(S in U)U.hasOwnProperty(S)&&M[S]!==U[S]&&(n||(n={}),n[S]=U[S])}else n||(x||(x=[]),x.push(ae,n)),n=U;else ae==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,M=M?M.__html:void 0,U!=null&&M!==U&&(x=x||[]).push(ae,U)):ae==="children"?typeof U!="string"&&typeof U!="number"||(x=x||[]).push(ae,""+U):ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&(c.hasOwnProperty(ae)?(U!=null&&ae==="onScroll"&&pt("scroll",t),x||M===U||(x=[])):(x=x||[]).push(ae,U))}n&&(x=x||[]).push("style",n);var ae=x;(s.updateQueue=ae)&&(s.flags|=4)}},Wm=function(t,s,n,o){n!==o&&(s.flags|=4)};function vl(t,s){if(!bt)switch(t.tailMode){case"hidden":s=t.tail;for(var n=null;s!==null;)s.alternate!==null&&(n=s),s=s.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?s||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function Xt(t){var s=t.alternate!==null&&t.alternate.child===t.child,n=0,o=0;if(s)for(var u=t.child;u!==null;)n|=u.lanes|u.childLanes,o|=u.subtreeFlags&14680064,o|=u.flags&14680064,u.return=t,u=u.sibling;else for(u=t.child;u!==null;)n|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=t,u=u.sibling;return t.subtreeFlags|=o,t.childLanes=n,s}function Zy(t,s,n){var o=s.pendingProps;switch(yc(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(s),null;case 1:return os(s.type)&&ci(),Xt(s),null;case 3:return o=s.stateNode,ga(),gt(is),gt(Qt),Ic(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(t===null||t.child===null)&&(fi(s)?s.flags|=4:t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Vs!==null&&(id(Vs),Vs=null))),qc(t,s),Xt(s),null;case 5:Tc(s);var u=Mn(fl.current);if(n=s.type,t!==null&&s.stateNode!=null)Vm(t,s,n,o,u),t.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!o){if(s.stateNode===null)throw Error(l(166));return Xt(s),null}if(t=Mn(rr.current),fi(s)){o=s.stateNode,n=s.type;var x=s.memoizedProps;switch(o[sr]=s,o[cl]=x,t=(s.mode&1)!==0,n){case"dialog":pt("cancel",o),pt("close",o);break;case"iframe":case"object":case"embed":pt("load",o);break;case"video":case"audio":for(u=0;u<ll.length;u++)pt(ll[u],o);break;case"source":pt("error",o);break;case"img":case"image":case"link":pt("error",o),pt("load",o);break;case"details":pt("toggle",o);break;case"input":Ke(o,x),pt("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!x.multiple},pt("invalid",o);break;case"textarea":bn(o,x),pt("invalid",o)}fr(n,x),u=null;for(var S in x)if(x.hasOwnProperty(S)){var M=x[S];S==="children"?typeof M=="string"?o.textContent!==M&&(x.suppressHydrationWarning!==!0&&li(o.textContent,M,t),u=["children",M]):typeof M=="number"&&o.textContent!==""+M&&(x.suppressHydrationWarning!==!0&&li(o.textContent,M,t),u=["children",""+M]):c.hasOwnProperty(S)&&M!=null&&S==="onScroll"&&pt("scroll",o)}switch(n){case"input":fe(o),he(o,x,!0);break;case"textarea":fe(o),Bt(o);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(o.onclick=ii)}o=u,s.updateQueue=o,o!==null&&(s.flags|=4)}else{S=u.nodeType===9?u:u.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Mr(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=S.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof o.is=="string"?t=S.createElement(n,{is:o.is}):(t=S.createElement(n),n==="select"&&(S=t,o.multiple?S.multiple=!0:o.size&&(S.size=o.size))):t=S.createElementNS(t,n),t[sr]=s,t[cl]=o,Um(t,s,!1,!1),s.stateNode=t;e:{switch(S=ys(n,o),n){case"dialog":pt("cancel",t),pt("close",t),u=o;break;case"iframe":case"object":case"embed":pt("load",t),u=o;break;case"video":case"audio":for(u=0;u<ll.length;u++)pt(ll[u],t);u=o;break;case"source":pt("error",t),u=o;break;case"img":case"image":case"link":pt("error",t),pt("load",t),u=o;break;case"details":pt("toggle",t),u=o;break;case"input":Ke(t,o),u=We(t,o),pt("invalid",t);break;case"option":u=o;break;case"select":t._wrapperState={wasMultiple:!!o.multiple},u=K({},o,{value:void 0}),pt("invalid",t);break;case"textarea":bn(t,o),u=hr(t,o),pt("invalid",t);break;default:u=o}fr(n,u),M=u;for(x in M)if(M.hasOwnProperty(x)){var U=M[x];x==="style"?ks(t,U):x==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,U!=null&&Nn(t,U)):x==="children"?typeof U=="string"?(n!=="textarea"||U!=="")&&mr(t,U):typeof U=="number"&&mr(t,""+U):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(c.hasOwnProperty(x)?U!=null&&x==="onScroll"&&pt("scroll",t):U!=null&&j(t,x,U,S))}switch(n){case"input":fe(t),he(t,o,!1);break;case"textarea":fe(t),Bt(t);break;case"option":o.value!=null&&t.setAttribute("value",""+ge(o.value));break;case"select":t.multiple=!!o.multiple,x=o.value,x!=null?es(t,!!o.multiple,x,!1):o.defaultValue!=null&&es(t,!!o.multiple,o.defaultValue,!0);break;default:typeof u.onClick=="function"&&(t.onclick=ii)}switch(n){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return Xt(s),null;case 6:if(t&&s.stateNode!=null)Wm(t,s,t.memoizedProps,o);else{if(typeof o!="string"&&s.stateNode===null)throw Error(l(166));if(n=Mn(fl.current),Mn(rr.current),fi(s)){if(o=s.stateNode,n=s.memoizedProps,o[sr]=s,(x=o.nodeValue!==n)&&(t=js,t!==null))switch(t.tag){case 3:li(o.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&li(o.nodeValue,n,(t.mode&1)!==0)}x&&(s.flags|=4)}else o=(n.nodeType===9?n:n.ownerDocument).createTextNode(o),o[sr]=s,s.stateNode=o}return Xt(s),null;case 13:if(gt(wt),o=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(bt&&bs!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Gh(),ma(),s.flags|=98560,x=!1;else if(x=fi(s),o!==null&&o.dehydrated!==null){if(t===null){if(!x)throw Error(l(318));if(x=s.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(l(317));x[sr]=s}else ma(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Xt(s),x=!1}else Vs!==null&&(id(Vs),Vs=null),x=!0;if(!x)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=n,s):(o=o!==null,o!==(t!==null&&t.memoizedState!==null)&&o&&(s.child.flags|=8192,(s.mode&1)!==0&&(t===null||(wt.current&1)!==0?zt===0&&(zt=3):dd())),s.updateQueue!==null&&(s.flags|=4),Xt(s),null);case 4:return ga(),qc(t,s),t===null&&il(s.stateNode.containerInfo),Xt(s),null;case 10:return Sc(s.type._context),Xt(s),null;case 17:return os(s.type)&&ci(),Xt(s),null;case 19:if(gt(wt),x=s.memoizedState,x===null)return Xt(s),null;if(o=(s.flags&128)!==0,S=x.rendering,S===null)if(o)vl(x,!1);else{if(zt!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(S=ji(t),S!==null){for(s.flags|=128,vl(x,!1),o=S.updateQueue,o!==null&&(s.updateQueue=o,s.flags|=4),s.subtreeFlags=0,o=n,n=s.child;n!==null;)x=n,t=o,x.flags&=14680066,S=x.alternate,S===null?(x.childLanes=0,x.lanes=t,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=S.childLanes,x.lanes=S.lanes,x.child=S.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=S.memoizedProps,x.memoizedState=S.memoizedState,x.updateQueue=S.updateQueue,x.type=S.type,t=S.dependencies,x.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return ht(wt,wt.current&1|2),s.child}t=t.sibling}x.tail!==null&&ut()>ba&&(s.flags|=128,o=!0,vl(x,!1),s.lanes=4194304)}else{if(!o)if(t=ji(S),t!==null){if(s.flags|=128,o=!0,n=t.updateQueue,n!==null&&(s.updateQueue=n,s.flags|=4),vl(x,!0),x.tail===null&&x.tailMode==="hidden"&&!S.alternate&&!bt)return Xt(s),null}else 2*ut()-x.renderingStartTime>ba&&n!==1073741824&&(s.flags|=128,o=!0,vl(x,!1),s.lanes=4194304);x.isBackwards?(S.sibling=s.child,s.child=S):(n=x.last,n!==null?n.sibling=S:s.child=S,x.last=S)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=ut(),s.sibling=null,n=wt.current,ht(wt,o?n&1|2:n&1),s):(Xt(s),null);case 22:case 23:return cd(),o=s.memoizedState!==null,t!==null&&t.memoizedState!==null!==o&&(s.flags|=8192),o&&(s.mode&1)!==0?(Ns&1073741824)!==0&&(Xt(s),s.subtreeFlags&6&&(s.flags|=8192)):Xt(s),null;case 24:return null;case 25:return null}throw Error(l(156,s.tag))}function ev(t,s){switch(yc(s),s.tag){case 1:return os(s.type)&&ci(),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return ga(),gt(is),gt(Qt),Ic(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 5:return Tc(s),null;case 13:if(gt(wt),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));ma()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return gt(wt),null;case 4:return ga(),null;case 10:return Sc(s.type._context),null;case 22:case 23:return cd(),null;case 24:return null;default:return null}}var Ti=!1,Jt=!1,tv=typeof WeakSet=="function"?WeakSet:Set,Re=null;function va(t,s){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(o){Tt(t,s,o)}else n.current=null}function Xc(t,s,n){try{n()}catch(o){Tt(t,s,o)}}var Hm=!1;function sv(t,s){if(cc=Ql,t=wh(),tc(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var u=o.anchorOffset,x=o.focusNode;o=o.focusOffset;try{n.nodeType,x.nodeType}catch{n=null;break e}var S=0,M=-1,U=-1,ae=0,me=0,ye=t,ue=null;t:for(;;){for(var Pe;ye!==n||u!==0&&ye.nodeType!==3||(M=S+u),ye!==x||o!==0&&ye.nodeType!==3||(U=S+o),ye.nodeType===3&&(S+=ye.nodeValue.length),(Pe=ye.firstChild)!==null;)ue=ye,ye=Pe;for(;;){if(ye===t)break t;if(ue===n&&++ae===u&&(M=S),ue===x&&++me===o&&(U=S),(Pe=ye.nextSibling)!==null)break;ye=ue,ue=ye.parentNode}ye=Pe}n=M===-1||U===-1?null:{start:M,end:U}}else n=null}n=n||{start:0,end:0}}else n=null;for(dc={focusedElem:t,selectionRange:n},Ql=!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 Ie=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Ie!==null){var Ae=Ie.memoizedProps,_t=Ie.memoizedState,J=s.stateNode,W=J.getSnapshotBeforeUpdate(s.elementType===s.type?Ae:Ws(s.type,Ae),_t);J.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var se=s.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(je){Tt(s,s.return,je)}if(t=s.sibling,t!==null){t.return=s.return,Re=t;break}Re=s.return}return Ie=Hm,Hm=!1,Ie}function jl(t,s,n){var o=s.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var u=o=o.next;do{if((u.tag&t)===t){var x=u.destroy;u.destroy=void 0,x!==void 0&&Xc(s,n,x)}u=u.next}while(u!==o)}}function Ri(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 o=n.create;n.destroy=o()}n=n.next}while(n!==s)}}function Jc(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 Km(t){var s=t.alternate;s!==null&&(t.alternate=null,Km(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&(delete s[sr],delete s[cl],delete s[fc],delete s[Fy],delete s[zy])),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 Gm(t){return t.tag===5||t.tag===3||t.tag===4}function Ym(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Gm(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 Zc(t,s,n){var o=t.tag;if(o===5||o===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=ii));else if(o!==4&&(t=t.child,t!==null))for(Zc(t,s,n),t=t.sibling;t!==null;)Zc(t,s,n),t=t.sibling}function ed(t,s,n){var o=t.tag;if(o===5||o===6)t=t.stateNode,s?n.insertBefore(t,s):n.appendChild(t);else if(o!==4&&(t=t.child,t!==null))for(ed(t,s,n),t=t.sibling;t!==null;)ed(t,s,n),t=t.sibling}var Gt=null,Hs=!1;function Gr(t,s,n){for(n=n.child;n!==null;)Qm(t,s,n),n=n.sibling}function Qm(t,s,n){if(tr&&typeof tr.onCommitFiberUnmount=="function")try{tr.onCommitFiberUnmount(Vl,n)}catch{}switch(n.tag){case 5:Jt||va(n,s);case 6:var o=Gt,u=Hs;Gt=null,Gr(t,s,n),Gt=o,Hs=u,Gt!==null&&(Hs?(t=Gt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Gt.removeChild(n.stateNode));break;case 18:Gt!==null&&(Hs?(t=Gt,n=n.stateNode,t.nodeType===8?mc(t.parentNode,n):t.nodeType===1&&mc(t,n),Ja(t)):mc(Gt,n.stateNode));break;case 4:o=Gt,u=Hs,Gt=n.stateNode.containerInfo,Hs=!0,Gr(t,s,n),Gt=o,Hs=u;break;case 0:case 11:case 14:case 15:if(!Jt&&(o=n.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){u=o=o.next;do{var x=u,S=x.destroy;x=x.tag,S!==void 0&&((x&2)!==0||(x&4)!==0)&&Xc(n,s,S),u=u.next}while(u!==o)}Gr(t,s,n);break;case 1:if(!Jt&&(va(n,s),o=n.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=n.memoizedProps,o.state=n.memoizedState,o.componentWillUnmount()}catch(M){Tt(n,s,M)}Gr(t,s,n);break;case 21:Gr(t,s,n);break;case 22:n.mode&1?(Jt=(o=Jt)||n.memoizedState!==null,Gr(t,s,n),Jt=o):Gr(t,s,n);break;default:Gr(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 tv),s.forEach(function(o){var u=uv.bind(null,t,o);n.has(o)||(n.add(o),o.then(u,u))})}}function Ks(t,s){var n=s.deletions;if(n!==null)for(var o=0;o<n.length;o++){var u=n[o];try{var x=t,S=s,M=S;e:for(;M!==null;){switch(M.tag){case 5:Gt=M.stateNode,Hs=!1;break e;case 3:Gt=M.stateNode.containerInfo,Hs=!0;break e;case 4:Gt=M.stateNode.containerInfo,Hs=!0;break e}M=M.return}if(Gt===null)throw Error(l(160));Qm(x,S,u),Gt=null,Hs=!1;var U=u.alternate;U!==null&&(U.return=null),u.return=null}catch(ae){Tt(u,s,ae)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)Xm(s,t),s=s.sibling}function Xm(t,s){var n=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Ks(s,t),ar(t),o&4){try{jl(3,t,t.return),Ri(3,t)}catch(Ae){Tt(t,t.return,Ae)}try{jl(5,t,t.return)}catch(Ae){Tt(t,t.return,Ae)}}break;case 1:Ks(s,t),ar(t),o&512&&n!==null&&va(n,n.return);break;case 5:if(Ks(s,t),ar(t),o&512&&n!==null&&va(n,n.return),t.flags&32){var u=t.stateNode;try{mr(u,"")}catch(Ae){Tt(t,t.return,Ae)}}if(o&4&&(u=t.stateNode,u!=null)){var x=t.memoizedProps,S=n!==null?n.memoizedProps:x,M=t.type,U=t.updateQueue;if(t.updateQueue=null,U!==null)try{M==="input"&&x.type==="radio"&&x.name!=null&&tt(u,x),ys(M,S);var ae=ys(M,x);for(S=0;S<U.length;S+=2){var me=U[S],ye=U[S+1];me==="style"?ks(u,ye):me==="dangerouslySetInnerHTML"?Nn(u,ye):me==="children"?mr(u,ye):j(u,me,ye,ae)}switch(M){case"input":$e(u,x);break;case"textarea":As(u,x);break;case"select":var ue=u._wrapperState.wasMultiple;u._wrapperState.wasMultiple=!!x.multiple;var Pe=x.value;Pe!=null?es(u,!!x.multiple,Pe,!1):ue!==!!x.multiple&&(x.defaultValue!=null?es(u,!!x.multiple,x.defaultValue,!0):es(u,!!x.multiple,x.multiple?[]:"",!1))}u[cl]=x}catch(Ae){Tt(t,t.return,Ae)}}break;case 6:if(Ks(s,t),ar(t),o&4){if(t.stateNode===null)throw Error(l(162));u=t.stateNode,x=t.memoizedProps;try{u.nodeValue=x}catch(Ae){Tt(t,t.return,Ae)}}break;case 3:if(Ks(s,t),ar(t),o&4&&n!==null&&n.memoizedState.isDehydrated)try{Ja(s.containerInfo)}catch(Ae){Tt(t,t.return,Ae)}break;case 4:Ks(s,t),ar(t);break;case 13:Ks(s,t),ar(t),u=t.child,u.flags&8192&&(x=u.memoizedState!==null,u.stateNode.isHidden=x,!x||u.alternate!==null&&u.alternate.memoizedState!==null||(rd=ut())),o&4&&qm(t);break;case 22:if(me=n!==null&&n.memoizedState!==null,t.mode&1?(Jt=(ae=Jt)||me,Ks(s,t),Jt=ae):Ks(s,t),ar(t),o&8192){if(ae=t.memoizedState!==null,(t.stateNode.isHidden=ae)&&!me&&(t.mode&1)!==0)for(Re=t,me=t.child;me!==null;){for(ye=Re=me;Re!==null;){switch(ue=Re,Pe=ue.child,ue.tag){case 0:case 11:case 14:case 15:jl(4,ue,ue.return);break;case 1:va(ue,ue.return);var Ie=ue.stateNode;if(typeof Ie.componentWillUnmount=="function"){o=ue,n=ue.return;try{s=o,Ie.props=s.memoizedProps,Ie.state=s.memoizedState,Ie.componentWillUnmount()}catch(Ae){Tt(o,n,Ae)}}break;case 5:va(ue,ue.return);break;case 22:if(ue.memoizedState!==null){ef(ye);continue}}Pe!==null?(Pe.return=ue,Re=Pe):ef(ye)}me=me.sibling}e:for(me=null,ye=t;;){if(ye.tag===5){if(me===null){me=ye;try{u=ye.stateNode,ae?(x=u.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(M=ye.stateNode,U=ye.memoizedProps.style,S=U!=null&&U.hasOwnProperty("display")?U.display:null,M.style.display=Qn("display",S))}catch(Ae){Tt(t,t.return,Ae)}}}else if(ye.tag===6){if(me===null)try{ye.stateNode.nodeValue=ae?"":ye.memoizedProps}catch(Ae){Tt(t,t.return,Ae)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===t)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===t)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===t)break e;me===ye&&(me=null),ye=ye.return}me===ye&&(me=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:Ks(s,t),ar(t),o&4&&qm(t);break;case 21:break;default:Ks(s,t),ar(t)}}function ar(t){var s=t.flags;if(s&2){try{e:{for(var n=t.return;n!==null;){if(Gm(n)){var o=n;break e}n=n.return}throw Error(l(160))}switch(o.tag){case 5:var u=o.stateNode;o.flags&32&&(mr(u,""),o.flags&=-33);var x=Ym(t);ed(t,x,u);break;case 3:case 4:var S=o.stateNode.containerInfo,M=Ym(t);Zc(t,M,S);break;default:throw Error(l(161))}}catch(U){Tt(t,t.return,U)}t.flags&=-3}s&4096&&(t.flags&=-4097)}function rv(t,s,n){Re=t,Jm(t)}function Jm(t,s,n){for(var o=(t.mode&1)!==0;Re!==null;){var u=Re,x=u.child;if(u.tag===22&&o){var S=u.memoizedState!==null||Ti;if(!S){var M=u.alternate,U=M!==null&&M.memoizedState!==null||Jt;M=Ti;var ae=Jt;if(Ti=S,(Jt=U)&&!ae)for(Re=u;Re!==null;)S=Re,U=S.child,S.tag===22&&S.memoizedState!==null?tf(u):U!==null?(U.return=S,Re=U):tf(u);for(;x!==null;)Re=x,Jm(x),x=x.sibling;Re=u,Ti=M,Jt=ae}Zm(t)}else(u.subtreeFlags&8772)!==0&&x!==null?(x.return=u,Re=x):Zm(t)}}function Zm(t){for(;Re!==null;){var s=Re;if((s.flags&8772)!==0){var n=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:Jt||Ri(5,s);break;case 1:var o=s.stateNode;if(s.flags&4&&!Jt)if(n===null)o.componentDidMount();else{var u=s.elementType===s.type?n.memoizedProps:Ws(s.type,n.memoizedProps);o.componentDidUpdate(u,n.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var x=s.updateQueue;x!==null&&em(s,x,o);break;case 3:var S=s.updateQueue;if(S!==null){if(n=null,s.child!==null)switch(s.child.tag){case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}em(s,S,n)}break;case 5:var M=s.stateNode;if(n===null&&s.flags&4){n=M;var U=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":U.autoFocus&&n.focus();break;case"img":U.src&&(n.src=U.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var ae=s.alternate;if(ae!==null){var me=ae.memoizedState;if(me!==null){var ye=me.dehydrated;ye!==null&&Ja(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}Jt||s.flags&512&&Jc(s)}catch(ue){Tt(s,s.return,ue)}}if(s===t){Re=null;break}if(n=s.sibling,n!==null){n.return=s.return,Re=n;break}Re=s.return}}function ef(t){for(;Re!==null;){var s=Re;if(s===t){Re=null;break}var n=s.sibling;if(n!==null){n.return=s.return,Re=n;break}Re=s.return}}function tf(t){for(;Re!==null;){var s=Re;try{switch(s.tag){case 0:case 11:case 15:var n=s.return;try{Ri(4,s)}catch(U){Tt(s,n,U)}break;case 1:var o=s.stateNode;if(typeof o.componentDidMount=="function"){var u=s.return;try{o.componentDidMount()}catch(U){Tt(s,u,U)}}var x=s.return;try{Jc(s)}catch(U){Tt(s,x,U)}break;case 5:var S=s.return;try{Jc(s)}catch(U){Tt(s,S,U)}}}catch(U){Tt(s,s.return,U)}if(s===t){Re=null;break}var M=s.sibling;if(M!==null){M.return=s.return,Re=M;break}Re=s.return}}var nv=Math.ceil,Ii=R.ReactCurrentDispatcher,td=R.ReactCurrentOwner,_s=R.ReactCurrentBatchConfig,st=0,Vt=null,At=null,Yt=0,Ns=0,ja=Ur(0),zt=0,bl=null,Dn=0,_i=0,sd=0,Nl=null,ds=null,rd=0,ba=1/0,wr=null,Mi=!1,nd=null,Yr=null,Ai=!1,Qr=null,Di=0,wl=0,ad=null,Li=-1,Oi=0;function rs(){return(st&6)!==0?ut():Li!==-1?Li:Li=ut()}function qr(t){return(t.mode&1)===0?1:(st&2)!==0&&Yt!==0?Yt&-Yt:By.transition!==null?(Oi===0&&(Oi=Yu()),Oi):(t=it,t!==0||(t=window.event,t=t===void 0?16:rh(t.type)),t)}function Gs(t,s,n,o){if(50<wl)throw wl=0,ad=null,Error(l(185));Ga(t,n,o),((st&2)===0||t!==Vt)&&(t===Vt&&((st&2)===0&&(_i|=n),zt===4&&Xr(t,Yt)),us(t,o),n===1&&st===0&&(s.mode&1)===0&&(ba=ut()+500,ui&&Wr()))}function us(t,s){var n=t.callbackNode;Bg(t,s);var o=Kl(t,t===Vt?Yt:0);if(o===0)n!==null&&He(n),t.callbackNode=null,t.callbackPriority=0;else if(s=o&-o,t.callbackPriority!==s){if(n!=null&&He(n),s===1)t.tag===0?$y(rf.bind(null,t)):Uh(rf.bind(null,t)),Ly(function(){(st&6)===0&&Wr()}),n=null;else{switch(Qu(o)){case 1:n=Fo;break;case 4:n=Ku;break;case 16:n=Ul;break;case 536870912:n=Gu;break;default:n=Ul}n=hf(n,sf.bind(null,t))}t.callbackPriority=s,t.callbackNode=n}}function sf(t,s){if(Li=-1,Oi=0,(st&6)!==0)throw Error(l(327));var n=t.callbackNode;if(Na()&&t.callbackNode!==n)return null;var o=Kl(t,t===Vt?Yt:0);if(o===0)return null;if((o&30)!==0||(o&t.expiredLanes)!==0||s)s=Fi(t,o);else{s=o;var u=st;st|=2;var x=af();(Vt!==t||Yt!==s)&&(wr=null,ba=ut()+500,On(t,s));do try{iv();break}catch(M){nf(t,M)}while(!0);wc(),Ii.current=x,st=u,At!==null?s=0:(Vt=null,Yt=0,s=zt)}if(s!==0){if(s===2&&(u=zo(t),u!==0&&(o=u,s=ld(t,u))),s===1)throw n=bl,On(t,0),Xr(t,o),us(t,ut()),n;if(s===6)Xr(t,o);else{if(u=t.current.alternate,(o&30)===0&&!av(u)&&(s=Fi(t,o),s===2&&(x=zo(t),x!==0&&(o=x,s=ld(t,x))),s===1))throw n=bl,On(t,0),Xr(t,o),us(t,ut()),n;switch(t.finishedWork=u,t.finishedLanes=o,s){case 0:case 1:throw Error(l(345));case 2:Fn(t,ds,wr);break;case 3:if(Xr(t,o),(o&130023424)===o&&(s=rd+500-ut(),10<s)){if(Kl(t,0)!==0)break;if(u=t.suspendedLanes,(u&o)!==o){rs(),t.pingedLanes|=t.suspendedLanes&u;break}t.timeoutHandle=hc(Fn.bind(null,t,ds,wr),s);break}Fn(t,ds,wr);break;case 4:if(Xr(t,o),(o&4194240)===o)break;for(s=t.eventTimes,u=-1;0<o;){var S=31-Bs(o);x=1<<S,S=s[S],S>u&&(u=S),o&=~x}if(o=u,o=ut()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*nv(o/1960))-o,10<o){t.timeoutHandle=hc(Fn.bind(null,t,ds,wr),o);break}Fn(t,ds,wr);break;case 5:Fn(t,ds,wr);break;default:throw Error(l(329))}}}return us(t,ut()),t.callbackNode===n?sf.bind(null,t):null}function ld(t,s){var n=Nl;return t.current.memoizedState.isDehydrated&&(On(t,s).flags|=256),t=Fi(t,s),t!==2&&(s=ds,ds=n,s!==null&&id(s)),t}function id(t){ds===null?ds=t:ds.push.apply(ds,t)}function av(t){for(var s=t;;){if(s.flags&16384){var n=s.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var o=0;o<n.length;o++){var u=n[o],x=u.getSnapshot;u=u.value;try{if(!Us(x(),u))return!1}catch{return!1}}}if(n=s.child,s.subtreeFlags&16384&&n!==null)n.return=s,s=n;else{if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Xr(t,s){for(s&=~sd,s&=~_i,t.suspendedLanes|=s,t.pingedLanes&=~s,t=t.expirationTimes;0<s;){var n=31-Bs(s),o=1<<n;t[n]=-1,s&=~o}}function rf(t){if((st&6)!==0)throw Error(l(327));Na();var s=Kl(t,0);if((s&1)===0)return us(t,ut()),null;var n=Fi(t,s);if(t.tag!==0&&n===2){var o=zo(t);o!==0&&(s=o,n=ld(t,o))}if(n===1)throw n=bl,On(t,0),Xr(t,s),us(t,ut()),n;if(n===6)throw Error(l(345));return t.finishedWork=t.current.alternate,t.finishedLanes=s,Fn(t,ds,wr),us(t,ut()),null}function od(t,s){var n=st;st|=1;try{return t(s)}finally{st=n,st===0&&(ba=ut()+500,ui&&Wr())}}function Ln(t){Qr!==null&&Qr.tag===0&&(st&6)===0&&Na();var s=st;st|=1;var n=_s.transition,o=it;try{if(_s.transition=null,it=1,t)return t()}finally{it=o,_s.transition=n,st=s,(st&6)===0&&Wr()}}function cd(){Ns=ja.current,gt(ja)}function On(t,s){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,Dy(n)),At!==null)for(n=At.return;n!==null;){var o=n;switch(yc(o),o.tag){case 1:o=o.type.childContextTypes,o!=null&&ci();break;case 3:ga(),gt(is),gt(Qt),Ic();break;case 5:Tc(o);break;case 4:ga();break;case 13:gt(wt);break;case 19:gt(wt);break;case 10:Sc(o.type._context);break;case 22:case 23:cd()}n=n.return}if(Vt=t,At=t=Jr(t.current,null),Yt=Ns=s,zt=0,bl=null,sd=_i=Dn=0,ds=Nl=null,_n!==null){for(s=0;s<_n.length;s++)if(n=_n[s],o=n.interleaved,o!==null){n.interleaved=null;var u=o.next,x=n.pending;if(x!==null){var S=x.next;x.next=u,o.next=S}n.pending=o}_n=null}return t}function nf(t,s){do{var n=At;try{if(wc(),bi.current=Ci,Ni){for(var o=St.memoizedState;o!==null;){var u=o.queue;u!==null&&(u.pending=null),o=o.next}Ni=!1}if(An=0,Ut=Ft=St=null,xl=!1,pl=0,td.current=null,n===null||n.return===null){zt=1,bl=s,At=null;break}e:{var x=t,S=n.return,M=n,U=s;if(s=Yt,M.flags|=32768,U!==null&&typeof U=="object"&&typeof U.then=="function"){var ae=U,me=M,ye=me.tag;if((me.mode&1)===0&&(ye===0||ye===11||ye===15)){var ue=me.alternate;ue?(me.updateQueue=ue.updateQueue,me.memoizedState=ue.memoizedState,me.lanes=ue.lanes):(me.updateQueue=null,me.memoizedState=null)}var Pe=Tm(S);if(Pe!==null){Pe.flags&=-257,Rm(Pe,S,M,x,s),Pe.mode&1&&Pm(x,ae,s),s=Pe,U=ae;var Ie=s.updateQueue;if(Ie===null){var Ae=new Set;Ae.add(U),s.updateQueue=Ae}else Ie.add(U);break e}else{if((s&1)===0){Pm(x,ae,s),dd();break e}U=Error(l(426))}}else if(bt&&M.mode&1){var _t=Tm(S);if(_t!==null){(_t.flags&65536)===0&&(_t.flags|=256),Rm(_t,S,M,x,s),bc(ya(U,M));break e}}x=U=ya(U,M),zt!==4&&(zt=2),Nl===null?Nl=[x]:Nl.push(x),x=S;do{switch(x.tag){case 3:x.flags|=65536,s&=-s,x.lanes|=s;var J=km(x,U,s);Zh(x,J);break e;case 1:M=U;var W=x.type,se=x.stateNode;if((x.flags&128)===0&&(typeof W.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(Yr===null||!Yr.has(se)))){x.flags|=65536,s&=-s,x.lanes|=s;var je=Em(x,M,s);Zh(x,je);break e}}x=x.return}while(x!==null)}of(n)}catch(De){s=De,At===n&&n!==null&&(At=n=n.return);continue}break}while(!0)}function af(){var t=Ii.current;return Ii.current=Ci,t===null?Ci:t}function dd(){(zt===0||zt===3||zt===2)&&(zt=4),Vt===null||(Dn&268435455)===0&&(_i&268435455)===0||Xr(Vt,Yt)}function Fi(t,s){var n=st;st|=2;var o=af();(Vt!==t||Yt!==s)&&(wr=null,On(t,s));do try{lv();break}catch(u){nf(t,u)}while(!0);if(wc(),st=n,Ii.current=o,At!==null)throw Error(l(261));return Vt=null,Yt=0,zt}function lv(){for(;At!==null;)lf(At)}function iv(){for(;At!==null&&!Je();)lf(At)}function lf(t){var s=uf(t.alternate,t,Ns);t.memoizedProps=t.pendingProps,s===null?of(t):At=s,td.current=null}function of(t){var s=t;do{var n=s.alternate;if(t=s.return,(s.flags&32768)===0){if(n=Zy(n,s,Ns),n!==null){At=n;return}}else{if(n=ev(n,s),n!==null){n.flags&=32767,At=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{zt=6,At=null;return}}if(s=s.sibling,s!==null){At=s;return}At=s=t}while(s!==null);zt===0&&(zt=5)}function Fn(t,s,n){var o=it,u=_s.transition;try{_s.transition=null,it=1,ov(t,s,n,o)}finally{_s.transition=u,it=o}return null}function ov(t,s,n,o){do Na();while(Qr!==null);if((st&6)!==0)throw Error(l(327));n=t.finishedWork;var u=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(l(177));t.callbackNode=null,t.callbackPriority=0;var x=n.lanes|n.childLanes;if(Ug(t,x),t===Vt&&(At=Vt=null,Yt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Ai||(Ai=!0,hf(Ul,function(){return Na(),null})),x=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||x){x=_s.transition,_s.transition=null;var S=it;it=1;var M=st;st|=4,td.current=null,sv(t,n),Xm(n,t),Py(dc),Ql=!!cc,dc=cc=null,t.current=n,rv(n),ls(),st=M,it=S,_s.transition=x}else t.current=n;if(Ai&&(Ai=!1,Qr=t,Di=u),x=t.pendingLanes,x===0&&(Yr=null),Lg(n.stateNode),us(t,ut()),s!==null)for(o=t.onRecoverableError,n=0;n<s.length;n++)u=s[n],o(u.value,{componentStack:u.stack,digest:u.digest});if(Mi)throw Mi=!1,t=nd,nd=null,t;return(Di&1)!==0&&t.tag!==0&&Na(),x=t.pendingLanes,(x&1)!==0?t===ad?wl++:(wl=0,ad=t):wl=0,Wr(),null}function Na(){if(Qr!==null){var t=Qu(Di),s=_s.transition,n=it;try{if(_s.transition=null,it=16>t?16:t,Qr===null)var o=!1;else{if(t=Qr,Qr=null,Di=0,(st&6)!==0)throw Error(l(331));var u=st;for(st|=4,Re=t.current;Re!==null;){var x=Re,S=x.child;if((Re.flags&16)!==0){var M=x.deletions;if(M!==null){for(var U=0;U<M.length;U++){var ae=M[U];for(Re=ae;Re!==null;){var me=Re;switch(me.tag){case 0:case 11:case 15:jl(8,me,x)}var ye=me.child;if(ye!==null)ye.return=me,Re=ye;else for(;Re!==null;){me=Re;var ue=me.sibling,Pe=me.return;if(Km(me),me===ae){Re=null;break}if(ue!==null){ue.return=Pe,Re=ue;break}Re=Pe}}}var Ie=x.alternate;if(Ie!==null){var Ae=Ie.child;if(Ae!==null){Ie.child=null;do{var _t=Ae.sibling;Ae.sibling=null,Ae=_t}while(Ae!==null)}}Re=x}}if((x.subtreeFlags&2064)!==0&&S!==null)S.return=x,Re=S;else e:for(;Re!==null;){if(x=Re,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:jl(9,x,x.return)}var J=x.sibling;if(J!==null){J.return=x.return,Re=J;break e}Re=x.return}}var W=t.current;for(Re=W;Re!==null;){S=Re;var se=S.child;if((S.subtreeFlags&2064)!==0&&se!==null)se.return=S,Re=se;else e:for(S=W;Re!==null;){if(M=Re,(M.flags&2048)!==0)try{switch(M.tag){case 0:case 11:case 15:Ri(9,M)}}catch(De){Tt(M,M.return,De)}if(M===S){Re=null;break e}var je=M.sibling;if(je!==null){je.return=M.return,Re=je;break e}Re=M.return}}if(st=u,Wr(),tr&&typeof tr.onPostCommitFiberRoot=="function")try{tr.onPostCommitFiberRoot(Vl,t)}catch{}o=!0}return o}finally{it=n,_s.transition=s}}return!1}function cf(t,s,n){s=ya(n,s),s=km(t,s,1),t=Kr(t,s,1),s=rs(),t!==null&&(Ga(t,1,s),us(t,s))}function Tt(t,s,n){if(t.tag===3)cf(t,t,n);else for(;s!==null;){if(s.tag===3){cf(s,t,n);break}else if(s.tag===1){var o=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Yr===null||!Yr.has(o))){t=ya(n,t),t=Em(s,t,1),s=Kr(s,t,1),t=rs(),s!==null&&(Ga(s,1,t),us(s,t));break}}s=s.return}}function cv(t,s,n){var o=t.pingCache;o!==null&&o.delete(s),s=rs(),t.pingedLanes|=t.suspendedLanes&n,Vt===t&&(Yt&n)===n&&(zt===4||zt===3&&(Yt&130023424)===Yt&&500>ut()-rd?On(t,0):sd|=n),us(t,s)}function df(t,s){s===0&&((t.mode&1)===0?s=1:(s=Hl,Hl<<=1,(Hl&130023424)===0&&(Hl=4194304)));var n=rs();t=jr(t,s),t!==null&&(Ga(t,s,n),us(t,n))}function dv(t){var s=t.memoizedState,n=0;s!==null&&(n=s.retryLane),df(t,n)}function uv(t,s){var n=0;switch(t.tag){case 13:var o=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:o=t.stateNode;break;default:throw Error(l(314))}o!==null&&o.delete(s),df(t,n)}var uf;uf=function(t,s,n){if(t!==null)if(t.memoizedProps!==s.pendingProps||is.current)cs=!0;else{if((t.lanes&n)===0&&(s.flags&128)===0)return cs=!1,Jy(t,s,n);cs=(t.flags&131072)!==0}else cs=!1,bt&&(s.flags&1048576)!==0&&Vh(s,mi,s.index);switch(s.lanes=0,s.tag){case 2:var o=s.type;Pi(t,s),t=s.pendingProps;var u=da(s,Qt.current);pa(s,n),u=Ac(null,s,o,t,u,n);var x=Dc();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,os(o)?(x=!0,di(s)):x=!1,s.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Ec(s),u.updater=ki,s.stateNode=u,u._reactInternals=s,Bc(s,o,t,n),s=Hc(null,s,o,!0,x,n)):(s.tag=0,bt&&x&&gc(s),ss(null,s,u,n),s=s.child),s;case 16:o=s.elementType;e:{switch(Pi(t,s),t=s.pendingProps,u=o._init,o=u(o._payload),s.type=o,u=s.tag=mv(o),t=Ws(o,t),u){case 0:s=Wc(null,s,o,t,n);break e;case 1:s=Lm(null,s,o,t,n);break e;case 11:s=Im(null,s,o,t,n);break e;case 14:s=_m(null,s,o,Ws(o.type,t),n);break e}throw Error(l(306,o,""))}return s;case 0:return o=s.type,u=s.pendingProps,u=s.elementType===o?u:Ws(o,u),Wc(t,s,o,u,n);case 1:return o=s.type,u=s.pendingProps,u=s.elementType===o?u:Ws(o,u),Lm(t,s,o,u,n);case 3:e:{if(Om(s),t===null)throw Error(l(387));o=s.pendingProps,x=s.memoizedState,u=x.element,Jh(t,s),vi(s,o,null,n);var S=s.memoizedState;if(o=S.element,x.isDehydrated)if(x={element:o,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){u=ya(Error(l(423)),s),s=Fm(t,s,o,n,u);break e}else if(o!==u){u=ya(Error(l(424)),s),s=Fm(t,s,o,n,u);break e}else for(bs=Br(s.stateNode.containerInfo.firstChild),js=s,bt=!0,Vs=null,n=qh(s,null,o,n),s.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ma(),o===u){s=Nr(t,s,n);break e}ss(t,s,o,n)}s=s.child}return s;case 5:return tm(s),t===null&&jc(s),o=s.type,u=s.pendingProps,x=t!==null?t.memoizedProps:null,S=u.children,uc(o,u)?S=null:x!==null&&uc(o,x)&&(s.flags|=32),Dm(t,s),ss(t,s,S,n),s.child;case 6:return t===null&&jc(s),null;case 13:return zm(t,s,n);case 4:return Pc(s,s.stateNode.containerInfo),o=s.pendingProps,t===null?s.child=fa(s,null,o,n):ss(t,s,o,n),s.child;case 11:return o=s.type,u=s.pendingProps,u=s.elementType===o?u:Ws(o,u),Im(t,s,o,u,n);case 7:return ss(t,s,s.pendingProps,n),s.child;case 8:return ss(t,s,s.pendingProps.children,n),s.child;case 12:return ss(t,s,s.pendingProps.children,n),s.child;case 10:e:{if(o=s.type._context,u=s.pendingProps,x=s.memoizedProps,S=u.value,ht(pi,o._currentValue),o._currentValue=S,x!==null)if(Us(x.value,S)){if(x.children===u.children&&!is.current){s=Nr(t,s,n);break e}}else for(x=s.child,x!==null&&(x.return=s);x!==null;){var M=x.dependencies;if(M!==null){S=x.child;for(var U=M.firstContext;U!==null;){if(U.context===o){if(x.tag===1){U=br(-1,n&-n),U.tag=2;var ae=x.updateQueue;if(ae!==null){ae=ae.shared;var me=ae.pending;me===null?U.next=U:(U.next=me.next,me.next=U),ae.pending=U}}x.lanes|=n,U=x.alternate,U!==null&&(U.lanes|=n),Cc(x.return,n,s),M.lanes|=n;break}U=U.next}}else if(x.tag===10)S=x.type===s.type?null:x.child;else if(x.tag===18){if(S=x.return,S===null)throw Error(l(341));S.lanes|=n,M=S.alternate,M!==null&&(M.lanes|=n),Cc(S,n,s),S=x.sibling}else S=x.child;if(S!==null)S.return=x;else for(S=x;S!==null;){if(S===s){S=null;break}if(x=S.sibling,x!==null){x.return=S.return,S=x;break}S=S.return}x=S}ss(t,s,u.children,n),s=s.child}return s;case 9:return u=s.type,o=s.pendingProps.children,pa(s,n),u=Rs(u),o=o(u),s.flags|=1,ss(t,s,o,n),s.child;case 14:return o=s.type,u=Ws(o,s.pendingProps),u=Ws(o.type,u),_m(t,s,o,u,n);case 15:return Mm(t,s,s.type,s.pendingProps,n);case 17:return o=s.type,u=s.pendingProps,u=s.elementType===o?u:Ws(o,u),Pi(t,s),s.tag=1,os(o)?(t=!0,di(s)):t=!1,pa(s,n),Sm(s,o,u),Bc(s,o,u,n),Hc(null,s,o,!0,t,n);case 19:return Bm(t,s,n);case 22:return Am(t,s,n)}throw Error(l(156,s.tag))};function hf(t,s){return B(t,s)}function hv(t,s,n,o){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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ms(t,s,n,o){return new hv(t,s,n,o)}function ud(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mv(t){if(typeof t=="function")return ud(t)?1:0;if(t!=null){if(t=t.$$typeof,t===le)return 11;if(t===G)return 14}return 2}function Jr(t,s){var n=t.alternate;return n===null?(n=Ms(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 zi(t,s,n,o,u,x){var S=2;if(o=t,typeof t=="function")ud(t)&&(S=1);else if(typeof t=="string")S=5;else e:switch(t){case _:return zn(n.children,u,x,s);case I:S=8,u|=8;break;case w:return t=Ms(12,n,s,u|2),t.elementType=w,t.lanes=x,t;case Q:return t=Ms(13,n,s,u),t.elementType=Q,t.lanes=x,t;case re:return t=Ms(19,n,s,u),t.elementType=re,t.lanes=x,t;case ve:return $i(n,u,x,s);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case V:S=10;break e;case te:S=9;break e;case le:S=11;break e;case G:S=14;break e;case oe:S=16,o=null;break e}throw Error(l(130,t==null?t:typeof t,""))}return s=Ms(S,n,s,u),s.elementType=t,s.type=o,s.lanes=x,s}function zn(t,s,n,o){return t=Ms(7,t,o,s),t.lanes=n,t}function $i(t,s,n,o){return t=Ms(22,t,o,s),t.elementType=ve,t.lanes=n,t.stateNode={isHidden:!1},t}function hd(t,s,n){return t=Ms(6,t,null,s),t.lanes=n,t}function md(t,s,n){return s=Ms(4,t.children!==null?t.children:[],t.key,s),s.lanes=n,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}function fv(t,s,n,o,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=$o(0),this.expirationTimes=$o(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$o(0),this.identifierPrefix=o,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function fd(t,s,n,o,u,x,S,M,U){return t=new fv(t,s,n,M,U),s===1?(s=1,x===!0&&(s|=8)):s=0,x=Ms(3,null,null,s),t.current=x,x.stateNode=t,x.memoizedState={element:o,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ec(x),t}function xv(t,s,n){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H,key:o==null?null:""+o,children:t,containerInfo:s,implementation:n}}function mf(t){if(!t)return Vr;t=t._reactInternals;e:{if(nt(t)!==t||t.tag!==1)throw Error(l(170));var s=t;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(os(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(l(171))}if(t.tag===1){var n=t.type;if(os(n))return $h(t,n,s)}return s}function ff(t,s,n,o,u,x,S,M,U){return t=fd(n,o,!0,t,u,x,S,M,U),t.context=mf(null),n=t.current,o=rs(),u=qr(n),x=br(o,u),x.callback=s??null,Kr(n,x,u),t.current.lanes=u,Ga(t,u,o),us(t,o),t}function Bi(t,s,n,o){var u=s.current,x=rs(),S=qr(u);return n=mf(n),s.context===null?s.context=n:s.pendingContext=n,s=br(x,S),s.payload={element:t},o=o===void 0?null:o,o!==null&&(s.callback=o),t=Kr(u,s,S),t!==null&&(Gs(t,u,S,x),yi(t,u,S)),S}function Ui(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function xf(t,s){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<s?n:s}}function xd(t,s){xf(t,s),(t=t.alternate)&&xf(t,s)}function pv(){return null}var pf=typeof reportError=="function"?reportError:function(t){console.error(t)};function pd(t){this._internalRoot=t}Vi.prototype.render=pd.prototype.render=function(t){var s=this._internalRoot;if(s===null)throw Error(l(409));Bi(t,s,null,null)},Vi.prototype.unmount=pd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var s=t.containerInfo;Ln(function(){Bi(null,t,null,null)}),s[pr]=null}};function Vi(t){this._internalRoot=t}Vi.prototype.unstable_scheduleHydration=function(t){if(t){var s=Ju();t={blockedOn:null,target:t,priority:s};for(var n=0;n<Fr.length&&s!==0&&s<Fr[n].priority;n++);Fr.splice(n,0,t),n===0&&th(t)}};function gd(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Wi(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function gf(){}function gv(t,s,n,o,u){if(u){if(typeof o=="function"){var x=o;o=function(){var ae=Ui(S);x.call(ae)}}var S=ff(s,o,t,0,null,!1,!1,"",gf);return t._reactRootContainer=S,t[pr]=S.current,il(t.nodeType===8?t.parentNode:t),Ln(),S}for(;u=t.lastChild;)t.removeChild(u);if(typeof o=="function"){var M=o;o=function(){var ae=Ui(U);M.call(ae)}}var U=fd(t,0,!1,null,null,!1,!1,"",gf);return t._reactRootContainer=U,t[pr]=U.current,il(t.nodeType===8?t.parentNode:t),Ln(function(){Bi(s,U,n,o)}),U}function Hi(t,s,n,o,u){var x=n._reactRootContainer;if(x){var S=x;if(typeof u=="function"){var M=u;u=function(){var U=Ui(S);M.call(U)}}Bi(s,S,t,u)}else S=gv(n,s,t,u,o);return Ui(S)}qu=function(t){switch(t.tag){case 3:var s=t.stateNode;if(s.current.memoizedState.isDehydrated){var n=Ka(s.pendingLanes);n!==0&&(Bo(s,n|1),us(s,ut()),(st&6)===0&&(ba=ut()+500,Wr()))}break;case 13:Ln(function(){var o=jr(t,1);if(o!==null){var u=rs();Gs(o,t,1,u)}}),xd(t,1)}},Uo=function(t){if(t.tag===13){var s=jr(t,134217728);if(s!==null){var n=rs();Gs(s,t,134217728,n)}xd(t,134217728)}},Xu=function(t){if(t.tag===13){var s=qr(t),n=jr(t,s);if(n!==null){var o=rs();Gs(n,t,s,o)}xd(t,s)}},Ju=function(){return it},Zu=function(t,s){var n=it;try{return it=t,s()}finally{it=n}},Sn=function(t,s,n){switch(s){case"input":if($e(t,n),s=n.name,n.type==="radio"&&s!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<n.length;s++){var o=n[s];if(o!==t&&o.form===t.form){var u=oi(o);if(!u)throw Error(l(90));ke(o),$e(o,u)}}}break;case"textarea":As(t,n);break;case"select":s=n.value,s!=null&&es(t,!!n.multiple,s,!1)}},Jn=od,Zn=Ln;var yv={usingClientEntryPoint:!1,Events:[dl,oa,oi,qn,Xn,od]},Sl={findFiberByHostInstance:Pn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},vv={bundleType:Sl.bundleType,version:Sl.version,rendererPackageName:Sl.rendererPackageName,rendererConfig:Sl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=xr(t),t===null?null:t.stateNode},findFiberByHostInstance:Sl.findFiberByHostInstance||pv,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ki=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ki.isDisabled&&Ki.supportsFiber)try{Vl=Ki.inject(vv),tr=Ki}catch{}}return hs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yv,hs.createPortal=function(t,s){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!gd(s))throw Error(l(200));return xv(t,s,null,n)},hs.createRoot=function(t,s){if(!gd(t))throw Error(l(299));var n=!1,o="",u=pf;return s!=null&&(s.unstable_strictMode===!0&&(n=!0),s.identifierPrefix!==void 0&&(o=s.identifierPrefix),s.onRecoverableError!==void 0&&(u=s.onRecoverableError)),s=fd(t,1,!1,null,null,n,!1,o,u),t[pr]=s.current,il(t.nodeType===8?t.parentNode:t),new pd(s)},hs.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var s=t._reactInternals;if(s===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=xr(s),t=t===null?null:t.stateNode,t},hs.flushSync=function(t){return Ln(t)},hs.hydrate=function(t,s,n){if(!Wi(s))throw Error(l(200));return Hi(null,t,s,!0,n)},hs.hydrateRoot=function(t,s,n){if(!gd(t))throw Error(l(405));var o=n!=null&&n.hydratedSources||null,u=!1,x="",S=pf;if(n!=null&&(n.unstable_strictMode===!0&&(u=!0),n.identifierPrefix!==void 0&&(x=n.identifierPrefix),n.onRecoverableError!==void 0&&(S=n.onRecoverableError)),s=ff(s,null,t,1,n??null,u,!1,x,S),t[pr]=s.current,il(t),o)for(t=0;t<o.length;t++)n=o[t],u=n._getVersion,u=u(n._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[n,u]:s.mutableSourceEagerHydrationData.push(n,u);return new Vi(s)},hs.render=function(t,s,n){if(!Wi(s))throw Error(l(200));return Hi(null,t,s,!1,n)},hs.unmountComponentAtNode=function(t){if(!Wi(t))throw Error(l(40));return t._reactRootContainer?(Ln(function(){Hi(null,null,t,!1,function(){t._reactRootContainer=null,t[pr]=null})}),!0):!1},hs.unstable_batchedUpdates=od,hs.unstable_renderSubtreeIntoContainer=function(t,s,n,o){if(!Wi(n))throw Error(l(200));if(t==null||t._reactInternals===void 0)throw Error(l(38));return Hi(t,s,n,!1,o)},hs.version="18.3.1-next-f1338f8080-20240426",hs}var Cf;function _x(){if(Cf)return jd.exports;Cf=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),jd.exports=Ev(),jd.exports}var kf;function Pv(){if(kf)return Gi;kf=1;var r=_x();return Gi.createRoot=r.createRoot,Gi.hydrateRoot=r.hydrateRoot,Gi}var Tv=Pv(),Ol=_x();const Rv=Ix(Ol);/**
|
||
* @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 Il(){return Il=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(r[i]=l[i])}return r},Il.apply(this,arguments)}var an;(function(r){r.Pop="POP",r.Push="PUSH",r.Replace="REPLACE"})(an||(an={}));const Ef="popstate";function Iv(r){r===void 0&&(r={});function a(i,c){let{pathname:d,search:m,hash:f}=i.location;return Ud("",{pathname:d,search:m,hash:f},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function l(i,c){return typeof c=="string"?c:io(c)}return Mv(a,l,null,r)}function Mt(r,a){if(r===!1||r===null||typeof r>"u")throw new Error(a)}function fu(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function _v(){return Math.random().toString(36).substr(2,8)}function Pf(r,a){return{usr:r.state,key:r.key,idx:a}}function Ud(r,a,l,i){return l===void 0&&(l=null),Il({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?Oa(a):a,{state:l,key:a&&a.key||i||_v()})}function io(r){let{pathname:a="/",search:l="",hash:i=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),i&&i!=="#"&&(a+=i.charAt(0)==="#"?i:"#"+i),a}function Oa(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let i=r.indexOf("?");i>=0&&(a.search=r.substr(i),r=r.substr(0,i)),r&&(a.pathname=r)}return a}function Mv(r,a,l,i){i===void 0&&(i={});let{window:c=document.defaultView,v5Compat:d=!1}=i,m=c.history,f=an.Pop,p=null,y=g();y==null&&(y=0,m.replaceState(Il({},m.state,{idx:y}),""));function g(){return(m.state||{idx:null}).idx}function v(){f=an.Pop;let N=g(),C=N==null?null:N-y;y=N,p&&p({action:f,location:b.location,delta:C})}function k(N,C){f=an.Push;let E=Ud(b.location,N,C);y=g()+1;let j=Pf(E,y),R=b.createHref(E);try{m.pushState(j,"",R)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;c.location.assign(R)}d&&p&&p({action:f,location:b.location,delta:1})}function P(N,C){f=an.Replace;let E=Ud(b.location,N,C);y=g();let j=Pf(E,y),R=b.createHref(E);m.replaceState(j,"",R),d&&p&&p({action:f,location:b.location,delta:0})}function T(N){let C=c.location.origin!=="null"?c.location.origin:c.location.href,E=typeof N=="string"?N:io(N);return E=E.replace(/ $/,"%20"),Mt(C,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,C)}let b={get action(){return f},get location(){return r(c,m)},listen(N){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(Ef,v),p=N,()=>{c.removeEventListener(Ef,v),p=null}},createHref(N){return a(c,N)},createURL:T,encodeLocation(N){let C=T(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:k,replace:P,go(N){return m.go(N)}};return b}var Tf;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Tf||(Tf={}));function Av(r,a,l){return l===void 0&&(l="/"),Dv(r,a,l)}function Dv(r,a,l,i){let c=typeof a=="string"?Oa(a):a,d=xu(c.pathname||"/",l);if(d==null)return null;let m=Mx(r);Lv(m);let f=null;for(let p=0;f==null&&p<m.length;++p){let y=Yv(d);f=Hv(m[p],y)}return f}function Mx(r,a,l,i){a===void 0&&(a=[]),l===void 0&&(l=[]),i===void 0&&(i="");let c=(d,m,f)=>{let p={relativePath:f===void 0?d.path||"":f,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};p.relativePath.startsWith("/")&&(Mt(p.relativePath.startsWith(i),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(i.length));let y=on([i,p.relativePath]),g=l.concat(p);d.children&&d.children.length>0&&(Mt(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Mx(d.children,a,g,y)),!(d.path==null&&!d.index)&&a.push({path:y,score:Vv(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 Ax(d.path))c(d,m,p)}),a}function Ax(r){let a=r.split("/");if(a.length===0)return[];let[l,...i]=a,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(i.length===0)return c?[d,""]:[d];let m=Ax(i.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 Lv(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:Wv(a.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}const Ov=/^:[\w-]+$/,Fv=3,zv=2,$v=1,Bv=10,Uv=-2,Rf=r=>r==="*";function Vv(r,a){let l=r.split("/"),i=l.length;return l.some(Rf)&&(i+=Uv),a&&(i+=zv),l.filter(c=>!Rf(c)).reduce((c,d)=>c+(Ov.test(d)?Fv:d===""?$v:Bv),i)}function Wv(r,a){return r.length===a.length&&r.slice(0,-1).every((i,c)=>i===a[c])?r[r.length-1]-a[a.length-1]:0}function Hv(r,a,l){let{routesMeta:i}=r,c={},d="/",m=[];for(let f=0;f<i.length;++f){let p=i[f],y=f===i.length-1,g=d==="/"?a:a.slice(d.length)||"/",v=Kv({path:p.relativePath,caseSensitive:p.caseSensitive,end:y},g),k=p.route;if(!v)return null;Object.assign(c,v.params),m.push({params:c,pathname:on([d,v.pathname]),pathnameBase:Zv(on([d,v.pathnameBase])),route:k}),v.pathnameBase!=="/"&&(d=on([d,v.pathnameBase]))}return m}function Kv(r,a){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[l,i]=Gv(r.path,r.caseSensitive,r.end),c=a.match(l);if(!c)return null;let d=c[0],m=d.replace(/(.)\/+$/,"$1"),f=c.slice(1);return{params:i.reduce((y,g,v)=>{let{paramName:k,isOptional:P}=g;if(k==="*"){let b=f[v]||"";m=d.slice(0,d.length-b.length).replace(/(.)\/+$/,"$1")}const T=f[v];return P&&!T?y[k]=void 0:y[k]=(T||"").replace(/%2F/g,"/"),y},{}),pathname:d,pathnameBase:m,pattern:r}}function Gv(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),fu(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 i=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,f,p)=>(i.push({paramName:f,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(i.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),i]}function Yv(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return fu(!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 xu(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,i=r.charAt(l);return i&&i!=="/"?null:r.slice(l)||"/"}const Qv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qv=r=>Qv.test(r);function Xv(r,a){a===void 0&&(a="/");let{pathname:l,search:i="",hash:c=""}=typeof r=="string"?Oa(r):r,d;if(l)if(qv(l))d=l;else{if(l.includes("//")){let m=l;l=l.replace(/\/\/+/g,"/"),fu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(m+" -> "+l))}l.startsWith("/")?d=If(l.substring(1),"/"):d=If(l,a)}else d=a;return{pathname:d,search:ej(i),hash:tj(c)}}function If(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 wd(r,a,l,i){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Jv(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function pu(r,a){let l=Jv(r);return a?l.map((i,c)=>c===l.length-1?i.pathname:i.pathnameBase):l.map(i=>i.pathnameBase)}function gu(r,a,l,i){i===void 0&&(i=!1);let c;typeof r=="string"?c=Oa(r):(c=Il({},r),Mt(!c.pathname||!c.pathname.includes("?"),wd("?","pathname","search",c)),Mt(!c.pathname||!c.pathname.includes("#"),wd("#","pathname","hash",c)),Mt(!c.search||!c.search.includes("#"),wd("#","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(!i&&m.startsWith("..")){let k=m.split("/");for(;k[0]==="..";)k.shift(),v-=1;c.pathname=k.join("/")}f=v>=0?a[v]:"/"}let p=Xv(c,f),y=m&&m!=="/"&&m.endsWith("/"),g=(d||m===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(y||g)&&(p.pathname+="/"),p}const on=r=>r.join("/").replace(/\/\/+/g,"/"),Zv=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),ej=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,tj=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function sj(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Dx=["post","put","patch","delete"];new Set(Dx);const rj=["get",...Dx];new Set(rj);/**
|
||
* 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 _l(){return _l=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(r[i]=l[i])}return r},_l.apply(this,arguments)}const yu=h.createContext(null),nj=h.createContext(null),xn=h.createContext(null),No=h.createContext(null),_r=h.createContext({outlet:null,matches:[],isDataRoute:!1}),Lx=h.createContext(null);function aj(r,a){let{relative:l}=a===void 0?{}:a;Fa()||Mt(!1);let{basename:i,navigator:c}=h.useContext(xn),{hash:d,pathname:m,search:f}=Fx(r,{relative:l}),p=m;return i!=="/"&&(p=m==="/"?i:on([i,m])),c.createHref({pathname:p,search:f,hash:d})}function Fa(){return h.useContext(No)!=null}function pn(){return Fa()||Mt(!1),h.useContext(No).location}function Ox(r){h.useContext(xn).static||h.useLayoutEffect(r)}function gn(){let{isDataRoute:r}=h.useContext(_r);return r?jj():lj()}function lj(){Fa()||Mt(!1);let r=h.useContext(yu),{basename:a,future:l,navigator:i}=h.useContext(xn),{matches:c}=h.useContext(_r),{pathname:d}=pn(),m=JSON.stringify(pu(c,l.v7_relativeSplatPath)),f=h.useRef(!1);return Ox(()=>{f.current=!0}),h.useCallback(function(y,g){if(g===void 0&&(g={}),!f.current)return;if(typeof y=="number"){i.go(y);return}let v=gu(y,JSON.parse(m),d,g.relative==="path");r==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:on([a,v.pathname])),(g.replace?i.replace:i.push)(v,g.state,g)},[a,i,m,d,r])}const ij=h.createContext(null);function oj(r){let a=h.useContext(_r).outlet;return a&&h.createElement(ij.Provider,{value:r},a)}function Fx(r,a){let{relative:l}=a===void 0?{}:a,{future:i}=h.useContext(xn),{matches:c}=h.useContext(_r),{pathname:d}=pn(),m=JSON.stringify(pu(c,i.v7_relativeSplatPath));return h.useMemo(()=>gu(r,JSON.parse(m),d,l==="path"),[r,m,d,l])}function cj(r,a){return dj(r,a)}function dj(r,a,l,i){Fa()||Mt(!1);let{navigator:c}=h.useContext(xn),{matches:d}=h.useContext(_r),m=d[d.length-1],f=m?m.params:{};m&&m.pathname;let p=m?m.pathnameBase:"/";m&&m.route;let y=pn(),g;if(a){var v;let N=typeof a=="string"?Oa(a):a;p==="/"||(v=N.pathname)!=null&&v.startsWith(p)||Mt(!1),g=N}else g=y;let k=g.pathname||"/",P=k;if(p!=="/"){let N=p.replace(/^\//,"").split("/");P="/"+k.replace(/^\//,"").split("/").slice(N.length).join("/")}let T=Av(r,{pathname:P}),b=xj(T&&T.map(N=>Object.assign({},N,{params:Object.assign({},f,N.params),pathname:on([p,c.encodeLocation?c.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?p:on([p,c.encodeLocation?c.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),d,l,i);return a&&b?h.createElement(No.Provider,{value:{location:_l({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:an.Pop}},b):b}function uj(){let r=vj(),a=sj(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 hj=h.createElement(uj,null);class mj 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(_r.Provider,{value:this.props.routeContext},h.createElement(Lx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function fj(r){let{routeContext:a,match:l,children:i}=r,c=h.useContext(yu);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),h.createElement(_r.Provider,{value:a},i)}function xj(r,a,l,i){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),i===void 0&&(i=null),r==null){var d;if(!l)return null;if(l.errors)r=l.matches;else if((d=i)!=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||Mt(!1),m=m.slice(0,Math.min(m.length,g+1))}let p=!1,y=-1;if(l&&i&&i.v7_partialHydration)for(let g=0;g<m.length;g++){let v=m[g];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(y=g),v.route.id){let{loaderData:k,errors:P}=l,T=v.route.loader&&k[v.route.id]===void 0&&(!P||P[v.route.id]===void 0);if(v.route.lazy||T){p=!0,y>=0?m=m.slice(0,y+1):m=[m[0]];break}}}return m.reduceRight((g,v,k)=>{let P,T=!1,b=null,N=null;l&&(P=f&&v.route.id?f[v.route.id]:void 0,b=v.route.errorElement||hj,p&&(y<0&&k===0?(bj("route-fallback"),T=!0,N=null):y===k&&(T=!0,N=v.route.hydrateFallbackElement||null)));let C=a.concat(m.slice(0,k+1)),E=()=>{let j;return P?j=b:T?j=N:v.route.Component?j=h.createElement(v.route.Component,null):v.route.element?j=v.route.element:j=g,h.createElement(fj,{match:v,routeContext:{outlet:g,matches:C,isDataRoute:l!=null},children:j})};return l&&(v.route.ErrorBoundary||v.route.errorElement||k===0)?h.createElement(mj,{location:l.location,revalidation:l.revalidation,component:b,error:P,children:E(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):E()},null)}var zx=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(zx||{}),$x=(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})($x||{});function pj(r){let a=h.useContext(yu);return a||Mt(!1),a}function gj(r){let a=h.useContext(nj);return a||Mt(!1),a}function yj(r){let a=h.useContext(_r);return a||Mt(!1),a}function Bx(r){let a=yj(),l=a.matches[a.matches.length-1];return l.route.id||Mt(!1),l.route.id}function vj(){var r;let a=h.useContext(Lx),l=gj(),i=Bx();return a!==void 0?a:(r=l.errors)==null?void 0:r[i]}function jj(){let{router:r}=pj(zx.UseNavigateStable),a=Bx($x.UseNavigateStable),l=h.useRef(!1);return Ox(()=>{l.current=!0}),h.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,_l({fromRouteId:a},d)))},[r,a])}const _f={};function bj(r,a,l){_f[r]||(_f[r]=!0)}function Nj(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function Sd(r){let{to:a,replace:l,state:i,relative:c}=r;Fa()||Mt(!1);let{future:d,static:m}=h.useContext(xn),{matches:f}=h.useContext(_r),{pathname:p}=pn(),y=gn(),g=gu(a,pu(f,d.v7_relativeSplatPath),p,c==="path"),v=JSON.stringify(g);return h.useEffect(()=>y(JSON.parse(v),{replace:l,state:i,relative:c}),[y,v,c,l,i]),null}function wj(r){return oj(r.context)}function yt(r){Mt(!1)}function Sj(r){let{basename:a="/",children:l=null,location:i,navigationType:c=an.Pop,navigator:d,static:m=!1,future:f}=r;Fa()&&Mt(!1);let p=a.replace(/^\/*/,"/"),y=h.useMemo(()=>({basename:p,navigator:d,static:m,future:_l({v7_relativeSplatPath:!1},f)}),[p,f,d,m]);typeof i=="string"&&(i=Oa(i));let{pathname:g="/",search:v="",hash:k="",state:P=null,key:T="default"}=i,b=h.useMemo(()=>{let N=xu(g,p);return N==null?null:{location:{pathname:N,search:v,hash:k,state:P,key:T},navigationType:c}},[p,g,v,k,P,T,c]);return b==null?null:h.createElement(xn.Provider,{value:y},h.createElement(No.Provider,{children:l,value:b}))}function Cj(r){let{children:a,location:l}=r;return cj(Vd(a),l)}new Promise(()=>{});function Vd(r,a){a===void 0&&(a=[]);let l=[];return h.Children.forEach(r,(i,c)=>{if(!h.isValidElement(i))return;let d=[...a,c];if(i.type===h.Fragment){l.push.apply(l,Vd(i.props.children,d));return}i.type!==yt&&Mt(!1),!i.props.index||!i.props.children||Mt(!1);let m={id:i.props.id||d.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(m.children=Vd(i.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 Wd(){return Wd=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(r[i]=l[i])}return r},Wd.apply(this,arguments)}function kj(r,a){if(r==null)return{};var l={},i=Object.keys(r),c,d;for(d=0;d<i.length;d++)c=i[d],!(a.indexOf(c)>=0)&&(l[c]=r[c]);return l}function Ej(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Pj(r,a){return r.button===0&&(!a||a==="_self")&&!Ej(r)}function Hd(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 i=r[l];return a.concat(Array.isArray(i)?i.map(c=>[l,c]):[[l,i]])},[]))}function Tj(r,a){let l=Hd(r);return a&&a.forEach((i,c)=>{l.has(c)||a.getAll(c).forEach(d=>{l.append(c,d)})}),l}const Rj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Ij="6";try{window.__reactRouterVersion=Ij}catch{}const _j="startTransition",Mf=bo[_j];function Mj(r){let{basename:a,children:l,future:i,window:c}=r,d=h.useRef();d.current==null&&(d.current=Iv({window:c,v5Compat:!0}));let m=d.current,[f,p]=h.useState({action:m.action,location:m.location}),{v7_startTransition:y}=i||{},g=h.useCallback(v=>{y&&Mf?Mf(()=>p(v)):p(v)},[p,y]);return h.useLayoutEffect(()=>m.listen(g),[m,g]),h.useEffect(()=>Nj(i),[i]),h.createElement(Sj,{basename:a,children:l,location:f.location,navigationType:f.action,navigator:m,future:i})}const Aj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Dj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kd=h.forwardRef(function(a,l){let{onClick:i,relative:c,reloadDocument:d,replace:m,state:f,target:p,to:y,preventScrollReset:g,viewTransition:v}=a,k=kj(a,Rj),{basename:P}=h.useContext(xn),T,b=!1;if(typeof y=="string"&&Dj.test(y)&&(T=y,Aj))try{let j=new URL(window.location.href),R=y.startsWith("//")?new URL(j.protocol+y):new URL(y),L=xu(R.pathname,P);R.origin===j.origin&&L!=null?y=L+R.search+R.hash:b=!0}catch{}let N=aj(y,{relative:c}),C=Lj(y,{replace:m,state:f,target:p,preventScrollReset:g,relative:c,viewTransition:v});function E(j){i&&i(j),j.defaultPrevented||C(j)}return h.createElement("a",Wd({},k,{href:T||N,onClick:b||d?i:E,ref:l,target:p}))});var Af;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(Af||(Af={}));var Df;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(Df||(Df={}));function Lj(r,a){let{target:l,replace:i,state:c,preventScrollReset:d,relative:m,viewTransition:f}=a===void 0?{}:a,p=gn(),y=pn(),g=Fx(r,{relative:m});return h.useCallback(v=>{if(Pj(v,l)){v.preventDefault();let k=i!==void 0?i:io(y)===io(g);p(r,{replace:k,state:c,preventScrollReset:d,relative:m,viewTransition:f})}},[y,p,g,i,c,l,r,d,m,f])}function Ux(r){let a=h.useRef(Hd(r)),l=h.useRef(!1),i=pn(),c=h.useMemo(()=>Tj(i.search,l.current?null:a.current),[i.search]),d=gn(),m=h.useCallback((f,p)=>{const y=Hd(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 Oj=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Fj=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,i)=>i?i.toUpperCase():l.toLowerCase()),Lf=r=>{const a=Fj(r);return a.charAt(0).toUpperCase()+a.slice(1)},Vx=(...r)=>r.filter((a,l,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===l).join(" ").trim(),zj=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 $j={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 Bj=h.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:m,...f},p)=>h.createElement("svg",{ref:p,...$j,width:a,height:a,stroke:r,strokeWidth:i?Number(l)*24/Number(a):l,className:Vx("lucide",c),...!d&&!zj(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 Te=(r,a)=>{const l=h.forwardRef(({className:i,...c},d)=>h.createElement(Bj,{ref:d,iconNode:a,className:Vx(`lucide-${Oj(Lf(r))}`,`lucide-${r}`,i),...c}));return l.displayName=Lf(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 Uj=[["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"}]],Vj=Te("arrow-up-down",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 Wj=[["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"}]],Of=Te("bitcoin",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:"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"}]],qs=Te("book-open",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:"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"}]],oo=Te("calendar",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:"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"}]],Yj=Te("chart-column",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=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],wo=Te("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=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ml=Te("chevron-down",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:"m9 18 6-6-6-6",key:"mthhwq"}]],sn=Te("chevron-right",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=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Wx=Te("chevron-up",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"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],eb=Te("circle-alert",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 tb=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Ff=Te("circle-check-big",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=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Gd=Te("circle-check",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=[["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"}]],Hx=Te("circle-question-mark",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=[["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"}]],Cd=Te("circle-user",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=[["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"}]],Kx=Te("circle-x",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:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Yd=Te("clock",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=[["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"}]],Gx=Te("copy",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=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],zf=Te("credit-card",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 cb=[["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"}]],nn=Te("crown",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=[["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"}]],co=Te("dollar-sign",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:"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"}]],hb=Te("download",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:"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"}]],Un=Te("external-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 fb=[["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"}]],Er=Te("eye",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 xb=[["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"}]],Yx=Te("file-text",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 pb=[["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"}]],Qx=Te("funnel",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=[["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"}]],yb=Te("gift",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:"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"}]],jb=Te("git-merge",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=[["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"}]],Qd=Te("globe",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 Nb=[["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"}]],wb=Te("graduation-cap",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 Sb=[["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"}]],Sr=Te("grip-vertical",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:"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"}]],kb=Te("handshake",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=[["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"}]],Pb=Te("house",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:"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"}]],qx=Te("image",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=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Yi=Te("info",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 Ib=[["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"}]],$f=Te("key",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 _b=[["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"}]],Mb=Te("layout-dashboard",_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:"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"}]],Pr=Te("link-2",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 Db=[["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"}]],Bf=Te("link",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 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=Te("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=Te("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"}]],Xx=Te("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=Te("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=Te("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"}]],Ta=Te("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"}]],Gb=Te("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 Yb=[["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=Te("pen-line",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=[["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=Te("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=Te("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"}]],Rt=Te("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"}]],Uf=Te("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"}]],Be=Te("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"}]],It=Te("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"}]],cn=Te("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:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],aN=Te("send",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 lN=[["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"}]],Bn=Te("settings",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:"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"}]],kd=Te("settings-2",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:"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"}]],vu=Te("shield-check",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:"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"}]],qd=Te("shopping-bag",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=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Al=Te("smartphone",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:"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"}]],Ed=Te("tag",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:"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"}]],Ht=Te("trash-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:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Ra=Te("trending-up",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:"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"}]],Jx=Te("undo-2",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:"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"}]],uo=Te("upload",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:"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"}]],Xd=Te("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"}]],Ia=Te("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"}]],Kt=Te("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"}]],Aa=Te("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"}]],ms=Te("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"}]],ln=Te("zap",bN),ju="admin_token";function bu(){try{return localStorage.getItem(ju)}catch{return null}}function NN(r){try{localStorage.setItem(ju,r)}catch{}}function wN(){try{localStorage.removeItem(ju)}catch{}}const SN="https://soulapi.quwanzhi.com",CN=15e3,kN=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):SN};function Da(r){const a=kN(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function So(r,a={}){const{data:l,...i}=a,c=Da(r),d=new Headers(i.headers),m=bu();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):i.body,p=new AbortController,y=setTimeout(()=>p.abort(),CN),g=await fetch(c,{...i,headers:d,body:f,credentials:"include",signal:p.signal}).finally(()=>clearTimeout(y)),k=(g.headers.get("Content-Type")||"").includes("application/json")?await g.json():g;if(!g.ok){const P=new Error((k==null?void 0:k.error)||`HTTP ${g.status}`);throw P.status=g.status,P.data=k,P}return k}function ze(r,a){return So(r,{...a,method:"GET"})}function ct(r,a,l){return So(r,{...l,method:"POST",data:a})}function vt(r,a,l){return So(r,{...l,method:"PUT",data:a})}function Tr(r,a){return So(r,{...a,method:"DELETE"})}const EN=[{icon:Mb,label:"数据概览",href:"/dashboard"},{icon:qs,label:"内容管理",href:"/content"},{icon:Kt,label:"用户管理",href:"/users"},{icon:jb,label:"找伙伴",href:"/find-partner"},{icon:Aa,label:"推广中心",href:"/distribution"}];function PN(){const r=pn(),a=gn(),[l,i]=h.useState(!1),[c,d]=h.useState(!1);h.useEffect(()=>{i(!0)},[]),h.useEffect(()=>{if(!l)return;d(!1);let f=!1;return ze("/api/admin").then(p=>{f||(p&&p.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{f||a("/login",{replace:!0})}),()=>{f=!0}},[l,a]);const m=async()=>{wN();try{await ct("/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:[EN.map(f=>{const p=r.pathname===f.href;return e.jsxs(Kd,{to:f.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${p?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(f.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:f.label})]},f.href)}),e.jsx("div",{className:"pt-4 mt-4 border-t border-gray-700/50",children:e.jsxs(Kd,{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(Bn,{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:m,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(wj,{})})})]})}function Vf(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function Nu(...r){return a=>{let l=!1;const i=r.map(c=>{const d=Vf(c,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let c=0;c<i.length;c++){const d=i[c];typeof d=="function"?d():Vf(r[c],null)}}}}function at(...r){return h.useCallback(Nu(...r),r)}var TN=Symbol.for("react.lazy"),ho=bo[" use ".trim().toString()];function RN(r){return typeof r=="object"&&r!==null&&"then"in r}function Zx(r){return r!=null&&typeof r=="object"&&"$$typeof"in r&&r.$$typeof===TN&&"_payload"in r&&RN(r._payload)}function ep(r){const a=IN(r),l=h.forwardRef((i,c)=>{let{children:d,...m}=i;Zx(d)&&typeof ho=="function"&&(d=ho(d._payload));const f=h.Children.toArray(d),p=f.find(MN);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 tp=ep("Slot");function IN(r){const a=h.forwardRef((l,i)=>{let{children:c,...d}=l;if(Zx(c)&&typeof ho=="function"&&(c=ho(c._payload)),h.isValidElement(c)){const m=DN(c),f=AN(d,c.props);return c.type!==h.Fragment&&(f.ref=i?Nu(i,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var _N=Symbol("radix.slottable");function MN(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===_N}function AN(r,a){const l={...a};for(const i in a){const c=r[i],d=a[i];/^on[A-Z]/.test(i)?c&&d?l[i]=(...f)=>{const p=d(...f);return c(...f),p}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function DN(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.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 sp(r){var a,l,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;a<c;a++)r[a]&&(l=sp(r[a]))&&(i&&(i+=" "),i+=l)}else for(l in r)r[l]&&(i&&(i+=" "),i+=l);return i}function rp(){for(var r,a,l=0,i="",c=arguments.length;l<c;l++)(r=arguments[l])&&(a=sp(r))&&(i&&(i+=" "),i+=a);return i}const Wf=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,Hf=rp,np=(r,a)=>l=>{var i;if((a==null?void 0:a.variants)==null)return Hf(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 k=Wf(g)||Wf(v);return c[y][k]}),f=l&&Object.entries(l).reduce((y,g)=>{let[v,k]=g;return k===void 0||(y[v]=k),y},{}),p=a==null||(i=a.compoundVariants)===null||i===void 0?void 0:i.reduce((y,g)=>{let{class:v,className:k,...P}=g;return Object.entries(P).every(T=>{let[b,N]=T;return Array.isArray(N)?N.includes({...d,...f}[b]):{...d,...f}[b]===N})?[...y,v,k]:y},[]);return Hf(r,m,p,l==null?void 0:l.class,l==null?void 0:l.className)},LN=(r,a)=>{const l=new Array(r.length+a.length);for(let i=0;i<r.length;i++)l[i]=r[i];for(let i=0;i<a.length;i++)l[r.length+i]=a[i];return l},ON=(r,a)=>({classGroupId:r,validator:a}),ap=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),mo="-",Kf=[],FN="arbitrary..",zN=r=>{const a=BN(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:i}=r;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return $N(m);const f=m.split(mo),p=f[0]===""&&f.length>1?1:0;return lp(f,p,a)},getConflictingClassGroupIds:(m,f)=>{if(f){const p=i[m],y=l[m];return p?y?LN(y,p):p:y||Kf}return l[m]||Kf}}},lp=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],d=l.nextPart.get(c);if(d){const y=lp(r,a+1,d);if(y)return y}const m=l.validators;if(m===null)return;const f=a===0?r.join(mo):r.slice(a).join(mo),p=m.length;for(let y=0;y<p;y++){const g=m[y];if(g.validator(f))return g.classGroupId}},$N=r=>r.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),i=a.slice(0,l);return i?FN+i:void 0})(),BN=r=>{const{theme:a,classGroups:l}=r;return UN(l,a)},UN=(r,a)=>{const l=ap();for(const i in r){const c=r[i];wu(c,l,i,a)}return l},wu=(r,a,l,i)=>{const c=r.length;for(let d=0;d<c;d++){const m=r[d];VN(m,a,l,i)}},VN=(r,a,l,i)=>{if(typeof r=="string"){WN(r,a,l);return}if(typeof r=="function"){HN(r,a,l,i);return}KN(r,a,l,i)},WN=(r,a,l)=>{const i=r===""?a:ip(a,r);i.classGroupId=l},HN=(r,a,l,i)=>{if(GN(r)){wu(r(i),a,l,i);return}a.validators===null&&(a.validators=[]),a.validators.push(ON(l,r))},KN=(r,a,l,i)=>{const c=Object.entries(r),d=c.length;for(let m=0;m<d;m++){const[f,p]=c[m];wu(p,ip(a,f),l,i)}},ip=(r,a)=>{let l=r;const i=a.split(mo),c=i.length;for(let d=0;d<c;d++){const m=i[d];let f=l.nextPart.get(m);f||(f=ap(),l.nextPart.set(m,f)),l=f}return l},GN=r=>"isThemeGetter"in r&&r.isThemeGetter===!0,YN=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),i=Object.create(null);const c=(d,m)=>{l[d]=m,a++,a>r&&(a=0,i=l,l=Object.create(null))};return{get(d){let m=l[d];if(m!==void 0)return m;if((m=i[d])!==void 0)return c(d,m),m},set(d,m){d in l?l[d]=m:c(d,m)}}},Jd="!",Gf=":",QN=[],Yf=(r,a,l,i,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:i,isExternal:c}),qN=r=>{const{prefix:a,experimentalParseClassName:l}=r;let i=c=>{const d=[];let m=0,f=0,p=0,y;const g=c.length;for(let b=0;b<g;b++){const N=c[b];if(m===0&&f===0){if(N===Gf){d.push(c.slice(p,b)),p=b+1;continue}if(N==="/"){y=b;continue}}N==="["?m++:N==="]"?m--:N==="("?f++:N===")"&&f--}const v=d.length===0?c:c.slice(p);let k=v,P=!1;v.endsWith(Jd)?(k=v.slice(0,-1),P=!0):v.startsWith(Jd)&&(k=v.slice(1),P=!0);const T=y&&y>p?y-p:void 0;return Yf(d,P,k,T)};if(a){const c=a+Gf,d=i;i=m=>m.startsWith(c)?d(m.slice(c.length)):Yf(QN,!1,m,void 0,!0)}if(l){const c=i;i=d=>l({className:d,parseClassName:c})}return i},XN=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,i)=>{a.set(l,1e6+i)}),l=>{const i=[];let c=[];for(let d=0;d<l.length;d++){const m=l[d],f=m[0]==="[",p=a.has(m);f||p?(c.length>0&&(c.sort(),i.push(...c),c=[]),i.push(m)):c.push(m)}return c.length>0&&(c.sort(),i.push(...c)),i}},JN=r=>({cache:YN(r.cacheSize),parseClassName:qN(r),sortModifiers:XN(r),...zN(r)}),ZN=/\s+/,ew=(r,a)=>{const{parseClassName:l,getClassGroupId:i,getConflictingClassGroupIds:c,sortModifiers:d}=a,m=[],f=r.trim().split(ZN);let p="";for(let y=f.length-1;y>=0;y-=1){const g=f[y],{isExternal:v,modifiers:k,hasImportantModifier:P,baseClassName:T,maybePostfixModifierPosition:b}=l(g);if(v){p=g+(p.length>0?" "+p:p);continue}let N=!!b,C=i(N?T.substring(0,b):T);if(!C){if(!N){p=g+(p.length>0?" "+p:p);continue}if(C=i(T),!C){p=g+(p.length>0?" "+p:p);continue}N=!1}const E=k.length===0?"":k.length===1?k[0]:d(k).join(":"),j=P?E+Jd:E,R=j+C;if(m.indexOf(R)>-1)continue;m.push(R);const L=c(C,N);for(let H=0;H<L.length;++H){const _=L[H];m.push(j+_)}p=g+(p.length>0?" "+p:p)}return p},tw=(...r)=>{let a=0,l,i,c="";for(;a<r.length;)(l=r[a++])&&(i=op(l))&&(c&&(c+=" "),c+=i);return c},op=r=>{if(typeof r=="string")return r;let a,l="";for(let i=0;i<r.length;i++)r[i]&&(a=op(r[i]))&&(l&&(l+=" "),l+=a);return l},sw=(r,...a)=>{let l,i,c,d;const m=p=>{const y=a.reduce((g,v)=>v(g),r());return l=JN(y),i=l.cache.get,c=l.cache.set,d=f,f(p)},f=p=>{const y=i(p);if(y)return y;const g=ew(p,l);return c(p,g),g};return d=m,(...p)=>d(tw(...p))},rw=[],$t=r=>{const a=l=>l[r]||rw;return a.isThemeGetter=!0,a},cp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nw=/^\d+\/\d+$/,aw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lw=/\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$/,iw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ow=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wa=r=>nw.test(r),qe=r=>!!r&&!Number.isNaN(Number(r)),en=r=>!!r&&Number.isInteger(Number(r)),Pd=r=>r.endsWith("%")&&qe(r.slice(0,-1)),Cr=r=>aw.test(r),dw=()=>!0,uw=r=>lw.test(r)&&!iw.test(r),up=()=>!1,hw=r=>ow.test(r),mw=r=>cw.test(r),fw=r=>!_e(r)&&!Me(r),xw=r=>za(r,fp,up),_e=r=>cp.test(r),$n=r=>za(r,xp,uw),Td=r=>za(r,jw,qe),Qf=r=>za(r,hp,up),pw=r=>za(r,mp,mw),Qi=r=>za(r,pp,hw),Me=r=>dp.test(r),kl=r=>$a(r,xp),gw=r=>$a(r,bw),qf=r=>$a(r,hp),yw=r=>$a(r,fp),vw=r=>$a(r,mp),qi=r=>$a(r,pp,!0),za=(r,a,l)=>{const i=cp.exec(r);return i?i[1]?a(i[1]):l(i[2]):!1},$a=(r,a,l=!1)=>{const i=dp.exec(r);return i?i[1]?a(i[1]):l:!1},hp=r=>r==="position"||r==="percentage",mp=r=>r==="image"||r==="url",fp=r=>r==="length"||r==="size"||r==="bg-size",xp=r=>r==="length",jw=r=>r==="number",bw=r=>r==="family-name",pp=r=>r==="shadow",Nw=()=>{const r=$t("color"),a=$t("font"),l=$t("text"),i=$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"),k=$t("text-shadow"),P=$t("drop-shadow"),T=$t("blur"),b=$t("perspective"),N=$t("aspect"),C=$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"],L=()=>[...R(),Me,_e],H=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],I=()=>[Me,_e,p],w=()=>[wa,"full","auto",...I()],V=()=>[en,"none","subgrid",Me,_e],te=()=>["auto",{span:["full",en,Me,_e]},en,Me,_e],le=()=>[en,"auto",Me,_e],Q=()=>["auto","min","max","fr",Me,_e],re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],oe=()=>["auto",...I()],ve=()=>[wa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],$=()=>[r,Me,_e],ne=()=>[...R(),qf,Qf,{position:[Me,_e]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",yw,xw,{size:[Me,_e]}],F=()=>[Pd,kl,$n],O=()=>["","none","full",y,Me,_e],Z=()=>["",qe,kl,$n],Y=()=>["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"],q=()=>[qe,Pd,qf,Qf],ge=()=>["","none",T,Me,_e],Se=()=>["none",qe,Me,_e],D=()=>["none",qe,Me,_e],fe=()=>[qe,Me,_e],ke=()=>[wa,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Cr],breakpoint:[Cr],color:[dw],container:[Cr],"drop-shadow":[Cr],ease:["in","out","in-out"],font:[fw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Cr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Cr],shadow:[Cr],spacing:["px",qe],text:[Cr],"text-shadow":[Cr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wa,_e,Me,N]}],container:["container"],columns:[{columns:[qe,_e,Me,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:L()}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[en,"auto",Me,_e]}],basis:[{basis:[wa,"full","auto",f,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,wa,"auto","initial","none",_e]}],grow:[{grow:["",qe,Me,_e]}],shrink:[{shrink:["",qe,Me,_e]}],order:[{order:[en,"first","last","none",Me,_e]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...re(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...re()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:oe()}],mx:[{mx:oe()}],my:[{my:oe()}],ms:[{ms:oe()}],me:[{me:oe()}],mt:[{mt:oe()}],mr:[{mr:oe()}],mb:[{mb:oe()}],ml:[{ml:oe()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"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,kl,$n]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Me,Td]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Pd,_e]}],"font-family":[{font:[gw,_e,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,Me,_e]}],"line-clamp":[{"line-clamp":[qe,"none",Me,Td]}],leading:[{leading:[d,...I()]}],"list-image":[{"list-image":["none",Me,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,_e]}],"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:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",Me,$n]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[qe,"auto",Me,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,_e]}],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",Me,_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},en,Me,_e],radial:["",Me,_e],conic:[en,Me,_e]},vw,pw]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"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:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,Me,_e]}],"outline-w":[{outline:["",qe,kl,$n]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",g,qi,Qi]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",v,qi,Qi]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[qe,$n]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",k,qi,Qi]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[qe,Me,_e]}],"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":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Me,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"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":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"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:ne()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,_e]}],filter:[{filter:["","none",Me,_e]}],blur:[{blur:ge()}],brightness:[{brightness:[qe,Me,_e]}],contrast:[{contrast:[qe,Me,_e]}],"drop-shadow":[{"drop-shadow":["","none",P,qi,Qi]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",qe,Me,_e]}],"hue-rotate":[{"hue-rotate":[qe,Me,_e]}],invert:[{invert:["",qe,Me,_e]}],saturate:[{saturate:[qe,Me,_e]}],sepia:[{sepia:["",qe,Me,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,_e]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[qe,Me,_e]}],"backdrop-contrast":[{"backdrop-contrast":[qe,Me,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,Me,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,Me,_e]}],"backdrop-invert":[{"backdrop-invert":["",qe,Me,_e]}],"backdrop-opacity":[{"backdrop-opacity":[qe,Me,_e]}],"backdrop-saturate":[{"backdrop-saturate":[qe,Me,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,Me,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",Me,_e]}],ease:[{ease:["linear","initial",C,Me,_e]}],delay:[{delay:[qe,Me,_e]}],animate:[{animate:["none",E,Me,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Me,_e]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[Me,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ke()}],"translate-x":[{"translate-x":ke()}],"translate-y":[{"translate-y":ke()}],"translate-z":[{"translate-z":ke()}],"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",Me,_e]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",Me,_e]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[qe,kl,$n,Td]}],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"]}},ww=sw(Nw);function lt(...r){return ww(rp(r))}const Sw=np("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 X({className:r,variant:a,size:l,asChild:i=!1,...c}){const d=i?tp:"button";return e.jsx(d,{"data-slot":"button",className:lt(Sw({variant:a,size:l,className:r})),...c})}function ie({className:r,type:a,...l}){return e.jsx("input",{type:a,"data-slot":"input",className:lt("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 Cw(){const r=gn(),[a,l]=h.useState(""),[i,c]=h.useState(""),[d,m]=h.useState(""),[f,p]=h.useState(!1),y=async()=>{m(""),p(!0);try{const g=await ct("/api/admin",{username:a.trim(),password:i});if((g==null?void 0:g.success)!==!1&&(g!=null&&g.token)){NN(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(vu,{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(Ia,{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: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(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:i,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(X,{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 Ne=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:lt("rounded-xl border bg-card text-card-foreground shadow",r),...a}));Ne.displayName="Card";const Ye=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:lt("flex flex-col space-y-1.5 p-6",r),...a}));Ye.displayName="CardHeader";const Qe=h.forwardRef(({className:r,...a},l)=>e.jsx("h3",{ref:l,className:lt("font-semibold leading-none tracking-tight",r),...a}));Qe.displayName="CardTitle";const jt=h.forwardRef(({className:r,...a},l)=>e.jsx("p",{ref:l,className:lt("text-sm text-muted-foreground",r),...a}));jt.displayName="CardDescription";const we=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:lt("p-6 pt-0",r),...a}));we.displayName="CardContent";const kw=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:lt("flex items-center p-6 pt-0",r),...a}));kw.displayName="CardFooter";function Ew(){const r=gn(),[a,l]=h.useState(!0),[i,c]=h.useState([]),[d,m]=h.useState([]),[f,p]=h.useState(0),[y,g]=h.useState(0),[v,k]=h.useState(0),[P,T]=h.useState(0),[b,N]=h.useState(0),[C,E]=h.useState(0),[j,R]=h.useState(null);async function L(){var w;l(!0),R(null);try{try{const ne=await ze("/api/admin/dashboard/overview");if(ne!=null&&ne.success){p(ne.totalUsers??0),g(ne.paidOrderCount??0),k(ne.totalRevenue??0),T(ne.conversionRate??0),N(ne.totalMatches??0),E(ne.matchRevenue??0),m(ne.recentOrders??[]),c(ne.newUsers??[]);return}}catch(ne){console.error("数据概览接口失败,尝试降级拉取",ne)}const[V,te]=await Promise.all([ze("/api/db/users?page=1&pageSize=10"),ze("/api/orders?page=1&pageSize=20&status=paid")]),le=typeof(V==null?void 0:V.total)=="number"?V.total:((w=V==null?void 0:V.users)==null?void 0:w.length)??0,Q=(te==null?void 0:te.orders)??[],re=typeof(te==null?void 0:te.total)=="number"?te.total:Q.length,G=Q.filter(ne=>ne.status==="paid"||ne.status==="completed"||ne.status==="success"),oe=G.reduce((ne,K)=>ne+Number(K.amount||0),0),ve=new Set(G.map(ne=>ne.userId).filter(Boolean)),$=le>0&&ve.size>0?ve.size/le*100:0;p(le),g(re),k(oe),T($),m(Q.slice(0,5)),c((V==null?void 0:V.users)??[])}catch(V){console.error("降级拉取失败",V);const te=V;(te==null?void 0:te.status)===401?R("登录已过期,请重新登录"):(te==null?void 0:te.name)==="AbortError"?R("请求超时,请检查网络后点击重试"):R("加载失败,请检查网络或联系管理员")}finally{l(!1)}}if(h.useEffect(()=>{L();const w=setInterval(L,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(Be,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),e.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const H=f,_=w=>{const V=w.productType||"",te=w.description||"";if(te){if(V==="section"&&te.includes("章节")){if(te.includes("-")){const le=te.split("-");if(le.length>=3)return{title:`第${le[1]}章 第${le[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:te,subtitle:"章节购买"}}return V==="fullbook"||te.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:V==="match"||te.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:te,subtitle:V==="section"?"单章":V==="fullbook"?"全书":"其他"}}return V==="section"?{title:`章节 ${w.productId||""}`,subtitle:"单章购买"}:V==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:V==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:V||"其他"}},I=[{title:"总用户数",value:H,icon:Kt,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${(v??0).toFixed(2)}`,icon:Ra,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:qd,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${typeof P=="number"?P.toFixed(1):0}%`,icon:qs,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"},{title:"匹配次数",value:String(b),icon:Kt,color:"text-cyan-400",bg:"bg-cyan-500/20",link:"/find-partner"},{title:"匹配收益",value:`¥${(C??0).toFixed(2)}`,icon:Ra,color:"text-pink-400",bg:"bg-pink-500/20",link:"/find-partner"}];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),j&&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:j}),e.jsx("button",{type:"button",onClick:()=>L(),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,V)=>e.jsxs(Ne,{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(Qe,{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(we,{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(sn,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},V))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between",children:[e.jsx(Qe,{className:"text-white",children:"最近订单"}),e.jsxs("button",{type:"button",onClick:()=>L(),className:"text-xs text-gray-400 hover:text-[#38bdac] flex items-center gap-1",title:"刷新",children:[e.jsx(Be,{className:"w-3.5 h-3.5"}),"刷新(每 30 秒自动更新)"]})]}),e.jsx(we,{children:e.jsxs("div",{className:"space-y-3",children:[d.slice(0,5).map(w=>{var re;const V=w.referrerId?i.find(G=>G.id===w.referrerId):void 0,te=w.referralCode||(V==null?void 0:V.referralCode)||(V==null?void 0:V.nickname)||(w.referrerId?String(w.referrerId).slice(0,8):""),le=_(w),Q=w.userNickname||((re=i.find(G=>G.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:Q,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:G=>{G.currentTarget.style.display="none";const oe=G.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:Q.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:Q}),e.jsx("span",{className:"text-gray-600",children:"·"}),e.jsx("span",{className:"text-sm font-medium text-white truncate",children:le.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:le.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"})})]}),te&&e.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",te]})]})]}),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(qd,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"新注册用户"})}),e.jsx(we,{children:e.jsxs("div",{className:"space-y-3",children:[i.slice(0,5).map(w=>{var V;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:((V=w.nickname)==null?void 0:V.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)}),i.length===0&&e.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const fs=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:l,className:lt("w-full caption-bottom text-sm",r),...a})}));fs.displayName="Table";const xs=h.forwardRef(({className:r,...a},l)=>e.jsx("thead",{ref:l,className:lt("[&_tr]:border-b",r),...a}));xs.displayName="TableHeader";const ps=h.forwardRef(({className:r,...a},l)=>e.jsx("tbody",{ref:l,className:lt("[&_tr:last-child]:border-0",r),...a}));ps.displayName="TableBody";const et=h.forwardRef(({className:r,...a},l)=>e.jsx("tr",{ref:l,className:lt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));et.displayName="TableRow";const be=h.forwardRef(({className:r,...a},l)=>e.jsx("th",{ref:l,className:lt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));be.displayName="TableHead";const pe=h.forwardRef(({className:r,...a},l)=>e.jsx("td",{ref:l,className:lt("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));pe.displayName="TableCell";const Pw=np("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 Le({className:r,variant:a,asChild:l=!1,...i}){const c=l?tp:"span";return e.jsx(c,{className:lt(Pw({variant:a}),r),...i})}function Ge(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 Tw(r,a){const l=h.createContext(a),i=d=>{const{children:m,...f}=d,p=h.useMemo(()=>f,Object.values(f));return e.jsx(l.Provider,{value:p,children:m})};i.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[i,c]}function yn(r,a=[]){let l=[];function i(d,m){const f=h.createContext(m),p=l.length;l=[...l,m];const y=v=>{var C;const{scope:k,children:P,...T}=v,b=((C=k==null?void 0:k[r])==null?void 0:C[p])||f,N=h.useMemo(()=>T,Object.values(T));return e.jsx(b.Provider,{value:N,children:P})};y.displayName=d+"Provider";function g(v,k){var b;const P=((b=k==null?void 0:k[r])==null?void 0:b[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,[i,Rw(c,...a)]}function Rw(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const i=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const m=i.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 Zt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Iw=bo[" useId ".trim().toString()]||(()=>{}),_w=0;function dn(r){const[a,l]=h.useState(Iw());return Zt(()=>{l(i=>i??String(_w++))},[r]),a?`radix-${a}`:""}var Mw=bo[" useInsertionEffect ".trim().toString()]||Zt;function Vn({prop:r,defaultProp:a,onChange:l=()=>{},caller:i}){const[c,d,m]=Aw({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(`${i} 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,i])}const y=h.useCallback(g=>{var v;if(f){const k=Dw(g)?g(r):g;k!==r&&((v=m.current)==null||v.call(m,k))}else d(g)},[f,r,d,m]);return[p,y]}function Aw({defaultProp:r,onChange:a}){const[l,i]=h.useState(r),c=h.useRef(l),d=h.useRef(a);return Mw(()=>{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,i,d]}function Dw(r){return typeof r=="function"}function Dl(r){const a=Lw(r),l=h.forwardRef((i,c)=>{const{children:d,...m}=i,f=h.Children.toArray(d),p=f.find(Fw);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 Lw(r){const a=h.forwardRef((l,i)=>{const{children:c,...d}=l;if(h.isValidElement(c)){const m=$w(c),f=zw(d,c.props);return c.type!==h.Fragment&&(f.ref=i?Nu(i,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var Ow=Symbol("radix.slottable");function Fw(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===Ow}function zw(r,a){const l={...a};for(const i in a){const c=r[i],d=a[i];/^on[A-Z]/.test(i)?c&&d?l[i]=(...f)=>{const p=d(...f);return c(...f),p}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function $w(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.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 Bw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=Bw.reduce((r,a)=>{const l=Dl(`Primitive.${a}`),i=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 i.displayName=`Primitive.${a}`,{...r,[a]:i}},{});function Uw(r,a){r&&Ol.flushSync(()=>r.dispatchEvent(a))}function hn(r){const a=h.useRef(r);return h.useEffect(()=>{a.current=r}),h.useMemo(()=>(...l)=>{var i;return(i=a.current)==null?void 0:i.call(a,...l)},[])}function Vw(r,a=globalThis==null?void 0:globalThis.document){const l=hn(r);h.useEffect(()=>{const i=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",i,{capture:!0}),()=>a.removeEventListener("keydown",i,{capture:!0})},[l,a])}var Ww="DismissableLayer",Zd="dismissableLayer.update",Hw="dismissableLayer.pointerDownOutside",Kw="dismissableLayer.focusOutside",Xf,gp=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Su=h.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:m,onDismiss:f,...p}=r,y=h.useContext(gp),[g,v]=h.useState(null),k=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=h.useState({}),T=at(a,_=>v(_)),b=Array.from(y.layers),[N]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),C=b.indexOf(N),E=g?b.indexOf(g):-1,j=y.layersWithOutsidePointerEventsDisabled.size>0,R=E>=C,L=Qw(_=>{const I=_.target,w=[...y.branches].some(V=>V.contains(I));!R||w||(c==null||c(_),m==null||m(_),_.defaultPrevented||f==null||f())},k),H=qw(_=>{const I=_.target;[...y.branches].some(V=>V.contains(I))||(d==null||d(_),m==null||m(_),_.defaultPrevented||f==null||f())},k);return Vw(_=>{E===y.layers.size-1&&(i==null||i(_),!_.defaultPrevented&&f&&(_.preventDefault(),f()))},k),h.useEffect(()=>{if(g)return l&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Xf=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(g)),y.layers.add(g),Jf(),()=>{l&&y.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=Xf)}},[g,k,l,y]),h.useEffect(()=>()=>{g&&(y.layers.delete(g),y.layersWithOutsidePointerEventsDisabled.delete(g),Jf())},[g,y]),h.useEffect(()=>{const _=()=>P({});return document.addEventListener(Zd,_),()=>document.removeEventListener(Zd,_)},[]),e.jsx(Xe.div,{...p,ref:T,style:{pointerEvents:j?R?"auto":"none":void 0,...r.style},onFocusCapture:Ge(r.onFocusCapture,H.onFocusCapture),onBlurCapture:Ge(r.onBlurCapture,H.onBlurCapture),onPointerDownCapture:Ge(r.onPointerDownCapture,L.onPointerDownCapture)})});Su.displayName=Ww;var Gw="DismissableLayerBranch",Yw=h.forwardRef((r,a)=>{const l=h.useContext(gp),i=h.useRef(null),c=at(a,i);return h.useEffect(()=>{const d=i.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),e.jsx(Xe.div,{...r,ref:c})});Yw.displayName=Gw;function Qw(r,a=globalThis==null?void 0:globalThis.document){const l=hn(r),i=h.useRef(!1),c=h.useRef(()=>{});return h.useEffect(()=>{const d=f=>{if(f.target&&!i.current){let p=function(){yp(Hw,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);i.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:()=>i.current=!0}}function qw(r,a=globalThis==null?void 0:globalThis.document){const l=hn(r),i=h.useRef(!1);return h.useEffect(()=>{const c=d=>{d.target&&!i.current&&yp(Kw,l,{originalEvent:d},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Jf(){const r=new CustomEvent(Zd);document.dispatchEvent(r)}function yp(r,a,l,{discrete:i}){const c=l.originalEvent.target,d=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),i?Uw(c,d):c.dispatchEvent(d)}var Rd="focusScope.autoFocusOnMount",Id="focusScope.autoFocusOnUnmount",Zf={bubbles:!1,cancelable:!0},Xw="FocusScope",Cu=h.forwardRef((r,a)=>{const{loop:l=!1,trapped:i=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...m}=r,[f,p]=h.useState(null),y=hn(c),g=hn(d),v=h.useRef(null),k=at(a,b=>p(b)),P=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(i){let b=function(j){if(P.paused||!f)return;const R=j.target;f.contains(R)?v.current=R:rn(v.current,{select:!0})},N=function(j){if(P.paused||!f)return;const R=j.relatedTarget;R!==null&&(f.contains(R)||rn(v.current,{select:!0}))},C=function(j){if(document.activeElement===document.body)for(const L of j)L.removedNodes.length>0&&rn(f)};document.addEventListener("focusin",b),document.addEventListener("focusout",N);const E=new MutationObserver(C);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",N),E.disconnect()}}},[i,f,P.paused]),h.useEffect(()=>{if(f){tx.add(P);const b=document.activeElement;if(!f.contains(b)){const C=new CustomEvent(Rd,Zf);f.addEventListener(Rd,y),f.dispatchEvent(C),C.defaultPrevented||(Jw(r1(vp(f)),{select:!0}),document.activeElement===b&&rn(f))}return()=>{f.removeEventListener(Rd,y),setTimeout(()=>{const C=new CustomEvent(Id,Zf);f.addEventListener(Id,g),f.dispatchEvent(C),C.defaultPrevented||rn(b??document.body,{select:!0}),f.removeEventListener(Id,g),tx.remove(P)},0)}}},[f,y,g,P]);const T=h.useCallback(b=>{if(!l&&!i||P.paused)return;const N=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,C=document.activeElement;if(N&&C){const E=b.currentTarget,[j,R]=Zw(E);j&&R?!b.shiftKey&&C===R?(b.preventDefault(),l&&rn(j,{select:!0})):b.shiftKey&&C===j&&(b.preventDefault(),l&&rn(R,{select:!0})):C===E&&b.preventDefault()}},[l,i,P.paused]);return e.jsx(Xe.div,{tabIndex:-1,...m,ref:k,onKeyDown:T})});Cu.displayName=Xw;function Jw(r,{select:a=!1}={}){const l=document.activeElement;for(const i of r)if(rn(i,{select:a}),document.activeElement!==l)return}function Zw(r){const a=vp(r),l=ex(a,r),i=ex(a.reverse(),r);return[l,i]}function vp(r){const a=[],l=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const c=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||c?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function ex(r,a){for(const l of r)if(!e1(l,{upTo:a}))return l}function e1(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 t1(r){return r instanceof HTMLInputElement&&"select"in r}function rn(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&t1(r)&&a&&r.select()}}var tx=s1();function s1(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=sx(r,a),r.unshift(a)},remove(a){var l;r=sx(r,a),(l=r[0])==null||l.resume()}}}function sx(r,a){const l=[...r],i=l.indexOf(a);return i!==-1&&l.splice(i,1),l}function r1(r){return r.filter(a=>a.tagName!=="A")}var n1="Portal",ku=h.forwardRef((r,a)=>{var f;const{container:l,...i}=r,[c,d]=h.useState(!1);Zt(()=>d(!0),[]);const m=l||c&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return m?Rv.createPortal(e.jsx(Xe.div,{...i,ref:a}),m):null});ku.displayName=n1;function a1(r,a){return h.useReducer((l,i)=>a[l][i]??l,r)}var Fl=r=>{const{present:a,children:l}=r,i=l1(a),c=typeof l=="function"?l({present:i.isPresent}):h.Children.only(l),d=at(i.ref,i1(c));return typeof l=="function"||i.isPresent?h.cloneElement(c,{ref:d}):null};Fl.displayName="Presence";function l1(r){const[a,l]=h.useState(),i=h.useRef(null),c=h.useRef(r),d=h.useRef("none"),m=r?"mounted":"unmounted",[f,p]=a1(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const y=Xi(i.current);d.current=f==="mounted"?y:"none"},[f]),Zt(()=>{const y=i.current,g=c.current;if(g!==r){const k=d.current,P=Xi(y);r?p("MOUNT"):P==="none"||(y==null?void 0:y.display)==="none"?p("UNMOUNT"):p(g&&k!==P?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,p]),Zt(()=>{if(a){let y;const g=a.ownerDocument.defaultView??window,v=P=>{const b=Xi(i.current).includes(CSS.escape(P.animationName));if(P.target===a&&b&&(p("ANIMATION_END"),!c.current)){const N=a.style.animationFillMode;a.style.animationFillMode="forwards",y=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=N)})}},k=P=>{P.target===a&&(d.current=Xi(i.current))};return a.addEventListener("animationstart",k),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{g.clearTimeout(y),a.removeEventListener("animationstart",k),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:h.useCallback(y=>{i.current=y?getComputedStyle(y):null,l(y)},[])}}function Xi(r){return(r==null?void 0:r.animationName)||"none"}function i1(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.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 _d=0;function jp(){h.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??rx()),document.body.insertAdjacentElement("beforeend",r[1]??rx()),_d++,()=>{_d===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),_d--}},[])}function rx(){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 ir=function(){return ir=Object.assign||function(a){for(var l,i=1,c=arguments.length;i<c;i++){l=arguments[i];for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(a[d]=l[d])}return a},ir.apply(this,arguments)};function bp(r,a){var l={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&a.indexOf(i)<0&&(l[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,i=Object.getOwnPropertySymbols(r);c<i.length;c++)a.indexOf(i[c])<0&&Object.prototype.propertyIsEnumerable.call(r,i[c])&&(l[i[c]]=r[i[c]]);return l}function o1(r,a,l){if(l||arguments.length===2)for(var i=0,c=a.length,d;i<c;i++)(d||!(i in a))&&(d||(d=Array.prototype.slice.call(a,0,i)),d[i]=a[i]);return r.concat(d||Array.prototype.slice.call(a))}var no="right-scroll-bar-position",ao="width-before-scroll-bar",c1="with-scroll-bars-hidden",d1="--removed-body-scroll-bar-size";function Md(r,a){return typeof r=="function"?r(a):r&&(r.current=a),r}function u1(r,a){var l=h.useState(function(){return{value:r,callback:a,facade:{get current(){return l.value},set current(i){var c=l.value;c!==i&&(l.value=i,l.callback(i,c))}}}})[0];return l.callback=a,l.facade}var h1=typeof window<"u"?h.useLayoutEffect:h.useEffect,nx=new WeakMap;function m1(r,a){var l=u1(null,function(i){return r.forEach(function(c){return Md(c,i)})});return h1(function(){var i=nx.get(l);if(i){var c=new Set(i),d=new Set(r),m=l.current;c.forEach(function(f){d.has(f)||Md(f,null)}),d.forEach(function(f){c.has(f)||Md(f,m)})}nx.set(l,r)},[r]),l}function f1(r){return r}function x1(r,a){a===void 0&&(a=f1);var l=[],i=!1,c={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return l.length?l[l.length-1]:r},useMedium:function(d){var m=a(d,i);return l.push(m),function(){l=l.filter(function(f){return f!==m})}},assignSyncMedium:function(d){for(i=!0;l.length;){var m=l;l=[],m.forEach(d)}l={push:function(f){return d(f)},filter:function(){return l}}},assignMedium:function(d){i=!0;var m=[];if(l.length){var f=l;l=[],f.forEach(d),m=l}var p=function(){var g=m;m=[],g.forEach(d)},y=function(){return Promise.resolve().then(p)};y(),l={push:function(g){m.push(g),y()},filter:function(g){return m=m.filter(g),l}}}};return c}function p1(r){r===void 0&&(r={});var a=x1(null);return a.options=ir({async:!0,ssr:!1},r),a}var Np=function(r){var a=r.sideCar,l=bp(r,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=a.read();if(!i)throw new Error("Sidecar medium not found");return h.createElement(i,ir({},l))};Np.isSideCarExport=!0;function g1(r,a){return r.useMedium(a),Np}var wp=p1(),Ad=function(){},Co=h.forwardRef(function(r,a){var l=h.useRef(null),i=h.useState({onScrollCapture:Ad,onWheelCapture:Ad,onTouchMoveCapture:Ad}),c=i[0],d=i[1],m=r.forwardProps,f=r.children,p=r.className,y=r.removeScrollBar,g=r.enabled,v=r.shards,k=r.sideCar,P=r.noRelative,T=r.noIsolation,b=r.inert,N=r.allowPinchZoom,C=r.as,E=C===void 0?"div":C,j=r.gapMode,R=bp(r,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=k,H=m1([l,a]),_=ir(ir({},R),c);return h.createElement(h.Fragment,null,g&&h.createElement(L,{sideCar:wp,removeScrollBar:y,shards:v,noRelative:P,noIsolation:T,inert:b,setCallbacks:d,allowPinchZoom:!!N,lockRef:l,gapMode:j}),m?h.cloneElement(h.Children.only(f),ir(ir({},_),{ref:H})):h.createElement(E,ir({},_,{className:p,ref:H}),f))});Co.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Co.classNames={fullWidth:ao,zeroRight:no};var y1=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function v1(){if(!document)return null;var r=document.createElement("style");r.type="text/css";var a=y1();return a&&r.setAttribute("nonce",a),r}function j1(r,a){r.styleSheet?r.styleSheet.cssText=a:r.appendChild(document.createTextNode(a))}function b1(r){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(r)}var N1=function(){var r=0,a=null;return{add:function(l){r==0&&(a=v1())&&(j1(a,l),b1(a)),r++},remove:function(){r--,!r&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},w1=function(){var r=N1();return function(a,l){h.useEffect(function(){return r.add(a),function(){r.remove()}},[a&&l])}},Sp=function(){var r=w1(),a=function(l){var i=l.styles,c=l.dynamic;return r(i,c),null};return a},S1={left:0,top:0,right:0,gap:0},Dd=function(r){return parseInt(r||"",10)||0},C1=function(r){var a=window.getComputedStyle(document.body),l=a[r==="padding"?"paddingLeft":"marginLeft"],i=a[r==="padding"?"paddingTop":"marginTop"],c=a[r==="padding"?"paddingRight":"marginRight"];return[Dd(l),Dd(i),Dd(c)]},k1=function(r){if(r===void 0&&(r="margin"),typeof window>"u")return S1;var a=C1(r),l=document.documentElement.clientWidth,i=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,i-l+a[2]-a[0])}},E1=Sp(),_a="data-scroll-locked",P1=function(r,a,l,i){var c=r.left,d=r.top,m=r.right,f=r.gap;return l===void 0&&(l="margin"),`
|
||
.`.concat(c1,` {
|
||
overflow: hidden `).concat(i,`;
|
||
padding-right: `).concat(f,"px ").concat(i,`;
|
||
}
|
||
body[`).concat(_a,`] {
|
||
overflow: hidden `).concat(i,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([a&&"position: relative ".concat(i,";"),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(i,`;
|
||
`),l==="padding"&&"padding-right: ".concat(f,"px ").concat(i,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(no,` {
|
||
right: `).concat(f,"px ").concat(i,`;
|
||
}
|
||
|
||
.`).concat(ao,` {
|
||
margin-right: `).concat(f,"px ").concat(i,`;
|
||
}
|
||
|
||
.`).concat(no," .").concat(no,` {
|
||
right: 0 `).concat(i,`;
|
||
}
|
||
|
||
.`).concat(ao," .").concat(ao,` {
|
||
margin-right: 0 `).concat(i,`;
|
||
}
|
||
|
||
body[`).concat(_a,`] {
|
||
`).concat(d1,": ").concat(f,`px;
|
||
}
|
||
`)},ax=function(){var r=parseInt(document.body.getAttribute(_a)||"0",10);return isFinite(r)?r:0},T1=function(){h.useEffect(function(){return document.body.setAttribute(_a,(ax()+1).toString()),function(){var r=ax()-1;r<=0?document.body.removeAttribute(_a):document.body.setAttribute(_a,r.toString())}},[])},R1=function(r){var a=r.noRelative,l=r.noImportant,i=r.gapMode,c=i===void 0?"margin":i;T1();var d=h.useMemo(function(){return k1(c)},[c]);return h.createElement(E1,{styles:P1(d,!a,c,l?"":"!important")})},eu=!1;if(typeof window<"u")try{var Ji=Object.defineProperty({},"passive",{get:function(){return eu=!0,!0}});window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{eu=!1}var Sa=eu?{passive:!1}:!1,I1=function(r){return r.tagName==="TEXTAREA"},Cp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!I1(r)&&l[a]==="visible")},_1=function(r){return Cp(r,"overflowY")},M1=function(r){return Cp(r,"overflowX")},lx=function(r,a){var l=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var c=kp(r,i);if(c){var d=Ep(r,i),m=d[1],f=d[2];if(m>f)return!0}i=i.parentNode}while(i&&i!==l.body);return!1},A1=function(r){var a=r.scrollTop,l=r.scrollHeight,i=r.clientHeight;return[a,l,i]},D1=function(r){var a=r.scrollLeft,l=r.scrollWidth,i=r.clientWidth;return[a,l,i]},kp=function(r,a){return r==="v"?_1(a):M1(a)},Ep=function(r,a){return r==="v"?A1(a):D1(a)},L1=function(r,a){return r==="h"&&a==="rtl"?-1:1},O1=function(r,a,l,i,c){var d=L1(r,window.getComputedStyle(a).direction),m=d*i,f=l.target,p=a.contains(f),y=!1,g=m>0,v=0,k=0;do{if(!f)break;var P=Ep(r,f),T=P[0],b=P[1],N=P[2],C=b-N-d*T;(T||C)&&kp(r,f)&&(v+=C,k+=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(k)<1)&&(y=!0),y},Zi=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},ix=function(r){return[r.deltaX,r.deltaY]},ox=function(r){return r&&"current"in r?r.current:r},F1=function(r,a){return r[0]===a[0]&&r[1]===a[1]},z1=function(r){return`
|
||
.block-interactivity-`.concat(r,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(r,` {pointer-events: all;}
|
||
`)},$1=0,Ca=[];function B1(r){var a=h.useRef([]),l=h.useRef([0,0]),i=h.useRef(),c=h.useState($1++)[0],d=h.useState(Sp)[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 b=o1([r.lockRef.current],(r.shards||[]).map(ox),!0).filter(Boolean);return b.forEach(function(N){return N.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),b.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var f=h.useCallback(function(b,N){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!m.current.allowPinchZoom;var C=Zi(b),E=l.current,j="deltaX"in b?b.deltaX:E[0]-C[0],R="deltaY"in b?b.deltaY:E[1]-C[1],L,H=b.target,_=Math.abs(j)>Math.abs(R)?"h":"v";if("touches"in b&&_==="h"&&H.type==="range")return!1;var I=window.getSelection(),w=I&&I.anchorNode,V=w?w===H||w.contains(H):!1;if(V)return!1;var te=lx(_,H);if(!te)return!0;if(te?L=_:(L=_==="v"?"h":"v",te=lx(_,H)),!te)return!1;if(!i.current&&"changedTouches"in b&&(j||R)&&(i.current=L),!L)return!0;var le=i.current||L;return O1(le,N,b,le==="h"?j:R)},[]),p=h.useCallback(function(b){var N=b;if(!(!Ca.length||Ca[Ca.length-1]!==d)){var C="deltaY"in N?ix(N):Zi(N),E=a.current.filter(function(L){return L.name===N.type&&(L.target===N.target||N.target===L.shadowParent)&&F1(L.delta,C)})[0];if(E&&E.should){N.cancelable&&N.preventDefault();return}if(!E){var j=(m.current.shards||[]).map(ox).filter(Boolean).filter(function(L){return L.contains(N.target)}),R=j.length>0?f(N,j[0]):!m.current.noIsolation;R&&N.cancelable&&N.preventDefault()}}},[]),y=h.useCallback(function(b,N,C,E){var j={name:b,delta:N,target:C,should:E,shadowParent:U1(C)};a.current.push(j),setTimeout(function(){a.current=a.current.filter(function(R){return R!==j})},1)},[]),g=h.useCallback(function(b){l.current=Zi(b),i.current=void 0},[]),v=h.useCallback(function(b){y(b.type,ix(b),b.target,f(b,r.lockRef.current))},[]),k=h.useCallback(function(b){y(b.type,Zi(b),b.target,f(b,r.lockRef.current))},[]);h.useEffect(function(){return Ca.push(d),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:k}),document.addEventListener("wheel",p,Sa),document.addEventListener("touchmove",p,Sa),document.addEventListener("touchstart",g,Sa),function(){Ca=Ca.filter(function(b){return b!==d}),document.removeEventListener("wheel",p,Sa),document.removeEventListener("touchmove",p,Sa),document.removeEventListener("touchstart",g,Sa)}},[]);var P=r.removeScrollBar,T=r.inert;return h.createElement(h.Fragment,null,T?h.createElement(d,{styles:z1(c)}):null,P?h.createElement(R1,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function U1(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const V1=g1(wp,B1);var Eu=h.forwardRef(function(r,a){return h.createElement(Co,ir({},r,{ref:a,sideCar:V1}))});Eu.classNames=Co.classNames;var W1=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},ka=new WeakMap,eo=new WeakMap,to={},Ld=0,Pp=function(r){return r&&(r.host||Pp(r.parentNode))},H1=function(r,a){return a.map(function(l){if(r.contains(l))return l;var i=Pp(l);return i&&r.contains(i)?i:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},K1=function(r,a,l,i){var c=H1(a,Array.isArray(r)?r:[r]);to[l]||(to[l]=new WeakMap);var d=to[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(k){if(f.has(k))g(k);else try{var P=k.getAttribute(i),T=P!==null&&P!=="false",b=(ka.get(k)||0)+1,N=(d.get(k)||0)+1;ka.set(k,b),d.set(k,N),m.push(k),b===1&&T&&eo.set(k,!0),N===1&&k.setAttribute(l,"true"),T||k.setAttribute(i,"true")}catch(C){console.error("aria-hidden: cannot operate on ",k,C)}})};return g(a),f.clear(),Ld++,function(){m.forEach(function(v){var k=ka.get(v)-1,P=d.get(v)-1;ka.set(v,k),d.set(v,P),k||(eo.has(v)||v.removeAttribute(i),eo.delete(v)),P||v.removeAttribute(l)}),Ld--,Ld||(ka=new WeakMap,ka=new WeakMap,eo=new WeakMap,to={})}},Tp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var i=Array.from(Array.isArray(r)?r:[r]),c=W1(r);return c?(i.push.apply(i,Array.from(c.querySelectorAll("[aria-live], script"))),K1(i,c,l,"aria-hidden")):function(){return null}},ko="Dialog",[Rp]=yn(ko),[G1,Zs]=Rp(ko),Ip=r=>{const{__scopeDialog:a,children:l,open:i,defaultOpen:c,onOpenChange:d,modal:m=!0}=r,f=h.useRef(null),p=h.useRef(null),[y,g]=Vn({prop:i,defaultProp:c??!1,onChange:d,caller:ko});return e.jsx(G1,{scope:a,triggerRef:f,contentRef:p,contentId:dn(),titleId:dn(),descriptionId:dn(),open:y,onOpenChange:g,onOpenToggle:h.useCallback(()=>g(v=>!v),[g]),modal:m,children:l})};Ip.displayName=ko;var _p="DialogTrigger",Y1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=Zs(_p,l),d=at(a,c.triggerRef);return e.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Ru(c.open),...i,ref:d,onClick:Ge(r.onClick,c.onOpenToggle)})});Y1.displayName=_p;var Pu="DialogPortal",[Q1,Mp]=Rp(Pu,{forceMount:void 0}),Ap=r=>{const{__scopeDialog:a,forceMount:l,children:i,container:c}=r,d=Zs(Pu,a);return e.jsx(Q1,{scope:a,forceMount:l,children:h.Children.map(i,m=>e.jsx(Fl,{present:l||d.open,children:e.jsx(ku,{asChild:!0,container:c,children:m})}))})};Ap.displayName=Pu;var fo="DialogOverlay",Dp=h.forwardRef((r,a)=>{const l=Mp(fo,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=Zs(fo,r.__scopeDialog);return d.modal?e.jsx(Fl,{present:i||d.open,children:e.jsx(X1,{...c,ref:a})}):null});Dp.displayName=fo;var q1=Dl("DialogOverlay.RemoveScroll"),X1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=Zs(fo,l);return e.jsx(Eu,{as:q1,allowPinchZoom:!0,shards:[c.contentRef],children:e.jsx(Xe.div,{"data-state":Ru(c.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),Wn="DialogContent",Lp=h.forwardRef((r,a)=>{const l=Mp(Wn,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=Zs(Wn,r.__scopeDialog);return e.jsx(Fl,{present:i||d.open,children:d.modal?e.jsx(J1,{...c,ref:a}):e.jsx(Z1,{...c,ref:a})})});Lp.displayName=Wn;var J1=h.forwardRef((r,a)=>{const l=Zs(Wn,r.__scopeDialog),i=h.useRef(null),c=at(a,l.contentRef,i);return h.useEffect(()=>{const d=i.current;if(d)return Tp(d)},[]),e.jsx(Op,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ge(r.onCloseAutoFocus,d=>{var m;d.preventDefault(),(m=l.triggerRef.current)==null||m.focus()}),onPointerDownOutside:Ge(r.onPointerDownOutside,d=>{const m=d.detail.originalEvent,f=m.button===0&&m.ctrlKey===!0;(m.button===2||f)&&d.preventDefault()}),onFocusOutside:Ge(r.onFocusOutside,d=>d.preventDefault())})}),Z1=h.forwardRef((r,a)=>{const l=Zs(Wn,r.__scopeDialog),i=h.useRef(!1),c=h.useRef(!1);return e.jsx(Op,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var m,f;(m=r.onCloseAutoFocus)==null||m.call(r,d),d.defaultPrevented||(i.current||(f=l.triggerRef.current)==null||f.focus(),d.preventDefault()),i.current=!1,c.current=!1},onInteractOutside:d=>{var p,y;(p=r.onInteractOutside)==null||p.call(r,d),d.defaultPrevented||(i.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()}})}),Op=h.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:i,onOpenAutoFocus:c,onCloseAutoFocus:d,...m}=r,f=Zs(Wn,l),p=h.useRef(null),y=at(a,p);return jp(),e.jsxs(e.Fragment,{children:[e.jsx(Cu,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:c,onUnmountAutoFocus:d,children:e.jsx(Su,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Ru(f.open),...m,ref:y,onDismiss:()=>f.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(e2,{titleId:f.titleId}),e.jsx(s2,{contentRef:p,descriptionId:f.descriptionId})]})]})}),Tu="DialogTitle",Fp=h.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=Zs(Tu,l);return e.jsx(Xe.h2,{id:c.titleId,...i,ref:a})});Fp.displayName=Tu;var zp="DialogDescription",$p=h.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=Zs(zp,l);return e.jsx(Xe.p,{id:c.descriptionId,...i,ref:a})});$p.displayName=zp;var Bp="DialogClose",Up=h.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=Zs(Bp,l);return e.jsx(Xe.button,{type:"button",...i,ref:a,onClick:Ge(r.onClick,()=>c.onOpenChange(!1))})});Up.displayName=Bp;function Ru(r){return r?"open":"closed"}var Vp="DialogTitleWarning",[X3,Wp]=Tw(Vp,{contentName:Wn,titleName:Tu,docsSlug:"dialog"}),e2=({titleId:r})=>{const a=Wp(Vp),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},t2="DialogDescriptionWarning",s2=({contentRef:r,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Wp(t2).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(i))},[i,r,a]),null},r2=Ip,n2=Ap,a2=Dp,l2=Lp,i2=Fp,o2=$p,c2=Up;function Ct(r){return e.jsx(r2,{"data-slot":"dialog",...r})}function d2(r){return e.jsx(n2,{...r})}const Hp=h.forwardRef(({className:r,...a},l)=>e.jsx(a2,{ref:l,className:lt("fixed inset-0 z-50 bg-black/50",r),...a}));Hp.displayName="DialogOverlay";const Nt=h.forwardRef(({className:r,children:a,showCloseButton:l=!0,...i},c)=>e.jsxs(d2,{children:[e.jsx(Hp,{}),e.jsxs(l2,{ref:c,"aria-describedby":void 0,className:lt("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),...i,children:[a,l&&e.jsxs(c2,{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(ms,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Nt.displayName="DialogContent";function kt({className:r,...a}){return e.jsx("div",{className:lt("flex flex-col gap-2 text-center sm:text-left",r),...a})}function Dt({className:r,...a}){return e.jsx("div",{className:lt("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function Et(r){return e.jsx(i2,{className:"text-lg font-semibold leading-none",...r})}function u2(r){return e.jsx(o2,{className:"text-sm text-muted-foreground",...r})}function Iu(r,a){const[l,i]=h.useState(r);return h.useEffect(()=>{const c=setTimeout(()=>i(r),a);return()=>clearTimeout(c)},[r,a]),l}function Qs({page:r,totalPages:a,total:l,pageSize:i,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:i,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 h2(){const[r,a]=h.useState([]),[l,i]=h.useState([]),[c,d]=h.useState(0),[m,f]=h.useState(0),[p,y]=h.useState(0),[g,v]=h.useState(1),[k,P]=h.useState(10),[T,b]=h.useState(""),N=Iu(T,300),[C,E]=h.useState("all"),[j,R]=h.useState(!0),[L,H]=h.useState(null),[_,I]=h.useState(null),[w,V]=h.useState(""),[te,le]=h.useState(!1);async function Q(){R(!0),H(null);try{const K=C==="all"?"":C==="completed"?"completed":C,A=new URLSearchParams({page:String(g),pageSize:String(k),...K&&{status:K},...N&&{search:N}}),[F,O]=await Promise.all([ze(`/api/orders?${A}`),ze("/api/db/users?page=1&pageSize=500")]);F!=null&&F.success&&(a(F.orders||[]),d(F.total??0),f(F.totalRevenue??0),y(F.todayRevenue??0)),O!=null&&O.success&&O.users&&i(O.users)}catch(K){console.error("加载订单失败",K),H("加载订单失败,请检查网络后重试")}finally{R(!1)}}h.useEffect(()=>{v(1)},[N,C]),h.useEffect(()=>{Q()},[g,k,N,C]);const re=K=>{var A;return K.userNickname||((A=l.find(F=>F.id===K.userId))==null?void 0:A.nickname)||"匿名用户"},G=K=>{var A;return((A=l.find(F=>F.id===K))==null?void 0:A.phone)||"-"},oe=K=>{const A=K.productType||K.type||"",F=K.description||"";if(F){if(A==="section"&&F.includes("章节")){if(F.includes("-")){const O=F.split("-");if(O.length>=3)return{name:`第${O[1]}章 第${O[2]}节`,type:"《一场Soul的创业实验》"}}return{name:F,type:"章节购买"}}return A==="fullbook"||F.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:A==="vip"||F.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:A==="match"||F.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:F,type:"其他"}}return A==="section"?{name:`章节 ${K.productId||K.sectionId||""}`,type:"单章"}:A==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:A==="vip"?{name:"VIP年度会员",type:"VIP"}:A==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:A||"其他"}},ve=Math.ceil(c/k)||1;async function $(){var K;if(!(!(_!=null&&_.orderSn)&&!(_!=null&&_.id))){le(!0),H(null);try{const A=await vt("/api/admin/orders/refund",{orderSn:_.orderSn||_.id,reason:w||void 0});A!=null&&A.success?(I(null),V(""),Q()):H((A==null?void 0:A.error)||"退款失败")}catch(A){const F=A;H(((K=F==null?void 0:F.data)==null?void 0:K.error)||"退款失败,请检查网络后重试")}finally{le(!1)}}}function ne(){if(r.length===0){alert("暂无数据可导出");return}const K=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],A=r.map(de=>{const q=oe(de);return[de.orderSn||de.id||"",re(de),G(de.userId),q.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(",")}),F="\uFEFF"+[K.join(","),...A].join(`
|
||
`),O=new Blob([F],{type:"text/csv;charset=utf-8"}),Z=URL.createObjectURL(O),Y=document.createElement("a");Y.href=Z,Y.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,Y.click(),URL.revokeObjectURL(Z)}return e.jsxs("div",{className:"p-8 w-full",children:[L&&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:L}),e.jsx("button",{type:"button",onClick:()=>H(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(X,{variant:"outline",onClick:Q,disabled:j,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{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(cn,{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:T,onChange:K=>b(K.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qx,{className:"w-4 h-4 text-gray-400"}),e.jsxs("select",{value:C,onChange:K=>E(K.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(X,{variant:"outline",onClick:ne,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(hb,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:j?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{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(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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(ps,{children:[r.map(K=>{const A=oe(K);return e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsxs(pe,{className:"font-mono text-xs text-gray-400",children:[(K.orderSn||K.id||"").slice(0,12),"..."]}),e.jsx(pe,{children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:re(K)}),e.jsx("p",{className:"text-gray-500 text-xs",children:G(K.userId)})]})}),e.jsx(pe,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[A.name,(K.productType||K.type)==="vip"&&e.jsx(Le,{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(pe,{className:"text-[#38bdac] font-bold",children:["¥",Number(K.amount||0).toFixed(2)]}),e.jsx(pe,{className:"text-gray-300",children:K.paymentMethod==="wechat"?"微信支付":K.paymentMethod==="alipay"?"支付宝":K.paymentMethod||"微信支付"}),e.jsx(pe,{children:K.status==="refunded"?e.jsx(Le,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):K.status==="paid"||K.status==="completed"?e.jsx(Le,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):K.status==="pending"||K.status==="created"?e.jsx(Le,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):e.jsx(Le,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),e.jsx(pe,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:K.refundReason,children:K.status==="refunded"&&K.refundReason?K.refundReason:"-"}),e.jsx(pe,{className:"text-[#FFD700]",children:K.referrerEarnings?`¥${Number(K.referrerEarnings).toFixed(2)}`:"-"}),e.jsx(pe,{className:"text-gray-400 text-sm",children:new Date(K.createdAt).toLocaleString("zh-CN")}),e.jsx(pe,{children:(K.status==="paid"||K.status==="completed")&&e.jsxs(X,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{I(K),V("")},children:[e.jsx(Jx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},K.id)}),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),e.jsx(Qs,{page:g,totalPages:ve,total:c,pageSize:k,onPageChange:v,onPageSizeChange:K=>{P(K),v(1)}})]})})}),e.jsx(Ct,{open:!!_,onOpenChange:K=>!K&&I(null),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsx(Et,{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:w,onChange:K=>V(K.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Dt,{children:[e.jsx(X,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>I(null),disabled:te,children:"取消"}),e.jsx(X,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:$,disabled:te,children:te?"退款中...":"确认退款"})]})]})})]})}var m2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],f2=m2.reduce((r,a)=>{const l=ep(`Primitive.${a}`),i=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 i.displayName=`Primitive.${a}`,{...r,[a]:i}},{}),x2="Label",Kp=h.forwardRef((r,a)=>e.jsx(f2.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())}}));Kp.displayName=x2;var Gp=Kp;const ee=h.forwardRef(({className:r,...a},l)=>e.jsx(Gp,{ref:l,className:lt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));ee.displayName=Gp.displayName;function _u(r){const a=r+"CollectionProvider",[l,i]=yn(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),m=b=>{const{scope:N,children:C}=b,E=tn.useRef(null),j=tn.useRef(new Map).current;return e.jsx(c,{scope:N,itemMap:j,collectionRef:E,children:C})};m.displayName=a;const f=r+"CollectionSlot",p=Dl(f),y=tn.forwardRef((b,N)=>{const{scope:C,children:E}=b,j=d(f,C),R=at(N,j.collectionRef);return e.jsx(p,{ref:R,children:E})});y.displayName=f;const g=r+"CollectionItemSlot",v="data-radix-collection-item",k=Dl(g),P=tn.forwardRef((b,N)=>{const{scope:C,children:E,...j}=b,R=tn.useRef(null),L=at(N,R),H=d(g,C);return tn.useEffect(()=>(H.itemMap.set(R,{ref:R,...j}),()=>void H.itemMap.delete(R))),e.jsx(k,{[v]:"",ref:L,children:E})});P.displayName=g;function T(b){const N=d(r+"CollectionConsumer",b);return tn.useCallback(()=>{const E=N.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${v}]`));return Array.from(N.itemMap.values()).sort((H,_)=>j.indexOf(H.ref.current)-j.indexOf(_.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:m,Slot:y,ItemSlot:P},T,i]}var p2=h.createContext(void 0);function Eo(r){const a=h.useContext(p2);return r||a||"ltr"}var Od="rovingFocusGroup.onEntryFocus",g2={bubbles:!1,cancelable:!0},zl="RovingFocusGroup",[tu,Yp,y2]=_u(zl),[v2,Qp]=yn(zl,[y2]),[j2,b2]=v2(zl),qp=h.forwardRef((r,a)=>e.jsx(tu.Provider,{scope:r.__scopeRovingFocusGroup,children:e.jsx(tu.Slot,{scope:r.__scopeRovingFocusGroup,children:e.jsx(N2,{...r,ref:a})})}));qp.displayName=zl;var N2=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:i,loop:c=!1,dir:d,currentTabStopId:m,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:p,onEntryFocus:y,preventScrollOnEntryFocus:g=!1,...v}=r,k=h.useRef(null),P=at(a,k),T=Eo(d),[b,N]=Vn({prop:m,defaultProp:f??null,onChange:p,caller:zl}),[C,E]=h.useState(!1),j=hn(y),R=Yp(l),L=h.useRef(!1),[H,_]=h.useState(0);return h.useEffect(()=>{const I=k.current;if(I)return I.addEventListener(Od,j),()=>I.removeEventListener(Od,j)},[j]),e.jsx(j2,{scope:l,orientation:i,dir:T,loop:c,currentTabStopId:b,onItemFocus:h.useCallback(I=>N(I),[N]),onItemShiftTab:h.useCallback(()=>E(!0),[]),onFocusableItemAdd:h.useCallback(()=>_(I=>I+1),[]),onFocusableItemRemove:h.useCallback(()=>_(I=>I-1),[]),children:e.jsx(Xe.div,{tabIndex:C||H===0?-1:0,"data-orientation":i,...v,ref:P,style:{outline:"none",...r.style},onMouseDown:Ge(r.onMouseDown,()=>{L.current=!0}),onFocus:Ge(r.onFocus,I=>{const w=!L.current;if(I.target===I.currentTarget&&w&&!C){const V=new CustomEvent(Od,g2);if(I.currentTarget.dispatchEvent(V),!V.defaultPrevented){const te=R().filter(oe=>oe.focusable),le=te.find(oe=>oe.active),Q=te.find(oe=>oe.id===b),G=[le,Q,...te].filter(Boolean).map(oe=>oe.ref.current);Zp(G,g)}}L.current=!1}),onBlur:Ge(r.onBlur,()=>E(!1))})})}),Xp="RovingFocusGroupItem",Jp=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:i=!0,active:c=!1,tabStopId:d,children:m,...f}=r,p=dn(),y=d||p,g=b2(Xp,l),v=g.currentTabStopId===y,k=Yp(l),{onFocusableItemAdd:P,onFocusableItemRemove:T,currentTabStopId:b}=g;return h.useEffect(()=>{if(i)return P(),()=>T()},[i,P,T]),e.jsx(tu.ItemSlot,{scope:l,id:y,focusable:i,active:c,children:e.jsx(Xe.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...f,ref:a,onMouseDown:Ge(r.onMouseDown,N=>{i?g.onItemFocus(y):N.preventDefault()}),onFocus:Ge(r.onFocus,()=>g.onItemFocus(y)),onKeyDown:Ge(r.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){g.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const C=C2(N,g.orientation,g.dir);if(C!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let j=k().filter(R=>R.focusable).map(R=>R.ref.current);if(C==="last")j.reverse();else if(C==="prev"||C==="next"){C==="prev"&&j.reverse();const R=j.indexOf(N.currentTarget);j=g.loop?k2(j,R+1):j.slice(R+1)}setTimeout(()=>Zp(j))}}),children:typeof m=="function"?m({isCurrentTabStop:v,hasTabStop:b!=null}):m})})});Jp.displayName=Xp;var w2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function S2(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function C2(r,a,l){const i=S2(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return w2[i]}function Zp(r,a=!1){const l=document.activeElement;for(const i of r)if(i===l||(i.focus({preventScroll:a}),document.activeElement!==l))return}function k2(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var E2=qp,P2=Jp,Po="Tabs",[T2]=yn(Po,[Qp]),e0=Qp(),[R2,Mu]=T2(Po),t0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,onValueChange:c,defaultValue:d,orientation:m="horizontal",dir:f,activationMode:p="automatic",...y}=r,g=Eo(f),[v,k]=Vn({prop:i,onChange:c,defaultProp:d??"",caller:Po});return e.jsx(R2,{scope:l,baseId:dn(),value:v,onValueChange:k,orientation:m,dir:g,activationMode:p,children:e.jsx(Xe.div,{dir:g,"data-orientation":m,...y,ref:a})})});t0.displayName=Po;var s0="TabsList",r0=h.forwardRef((r,a)=>{const{__scopeTabs:l,loop:i=!0,...c}=r,d=Mu(s0,l),m=e0(l);return e.jsx(E2,{asChild:!0,...m,orientation:d.orientation,dir:d.dir,loop:i,children:e.jsx(Xe.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});r0.displayName=s0;var n0="TabsTrigger",a0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,disabled:c=!1,...d}=r,m=Mu(n0,l),f=e0(l),p=o0(m.baseId,i),y=c0(m.baseId,i),g=i===m.value;return e.jsx(P2,{asChild:!0,...f,focusable:!c,active:g,children:e.jsx(Xe.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:Ge(r.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?m.onValueChange(i):v.preventDefault()}),onKeyDown:Ge(r.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&m.onValueChange(i)}),onFocus:Ge(r.onFocus,()=>{const v=m.activationMode!=="manual";!g&&!c&&v&&m.onValueChange(i)})})})});a0.displayName=n0;var l0="TabsContent",i0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,forceMount:c,children:d,...m}=r,f=Mu(l0,l),p=o0(f.baseId,i),y=c0(f.baseId,i),g=i===f.value,v=h.useRef(g);return h.useEffect(()=>{const k=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(k)},[]),e.jsx(Fl,{present:c||g,children:({present:k})=>e.jsx(Xe.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":p,hidden:!k,id:y,tabIndex:0,...m,ref:a,style:{...r.style,animationDuration:v.current?"0s":void 0},children:k&&d})})});i0.displayName=l0;function o0(r,a){return`${r}-trigger-${a}`}function c0(r,a){return`${r}-content-${a}`}var I2=t0,d0=r0,u0=a0,h0=i0;const $l=I2,Ba=h.forwardRef(({className:r,...a},l)=>e.jsx(d0,{ref:l,className:lt("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));Ba.displayName=d0.displayName;const Lt=h.forwardRef(({className:r,...a},l)=>e.jsx(u0,{ref:l,className:lt("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=u0.displayName;const Ot=h.forwardRef(({className:r,...a},l)=>e.jsx(h0,{ref:l,className:lt("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=h0.displayName;function Au(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 Du(r){const[a,l]=h.useState(void 0);return Zt(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const i=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 i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else l(void 0)},[r]),a}var To="Switch",[_2]=yn(To),[M2,A2]=_2(To),m0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,name:i,checked:c,defaultChecked:d,required:m,disabled:f,value:p="on",onCheckedChange:y,form:g,...v}=r,[k,P]=h.useState(null),T=at(a,j=>P(j)),b=h.useRef(!1),N=k?g||!!k.closest("form"):!0,[C,E]=Vn({prop:c,defaultProp:d??!1,onChange:y,caller:To});return e.jsxs(M2,{scope:l,checked:C,disabled:f,children:[e.jsx(Xe.button,{type:"button",role:"switch","aria-checked":C,"aria-required":m,"data-state":g0(C),"data-disabled":f?"":void 0,disabled:f,value:p,...v,ref:T,onClick:Ge(r.onClick,j=>{E(R=>!R),N&&(b.current=j.isPropagationStopped(),b.current||j.stopPropagation())})}),N&&e.jsx(p0,{control:k,bubbles:!b.current,name:i,value:p,checked:C,required:m,disabled:f,form:g,style:{transform:"translateX(-100%)"}})]})});m0.displayName=To;var f0="SwitchThumb",x0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,...i}=r,c=A2(f0,l);return e.jsx(Xe.span,{"data-state":g0(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a})});x0.displayName=f0;var D2="SwitchBubbleInput",p0=h.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:i=!0,...c},d)=>{const m=h.useRef(null),f=at(m,d),p=Au(l),y=Du(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:i});P.call(g,l),g.dispatchEvent(T)}},[p,l,i]),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}})});p0.displayName=D2;function g0(r){return r?"checked":"unchecked"}var y0=m0,L2=x0;const ot=h.forwardRef(({className:r,...a},l)=>e.jsx(y0,{className:lt("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(L2,{className:lt("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")})}));ot.displayName=y0.displayName;const un=h.forwardRef(({className:r,...a},l)=>e.jsx("textarea",{className:lt("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}));un.displayName="Textarea";function v0({open:r,onClose:a,userId:l,onUserUpdated:i}){var $e;const[c,d]=h.useState(null),[m,f]=h.useState([]),[p,y]=h.useState([]),[g,v]=h.useState(!1),[k,P]=h.useState(!1),[T,b]=h.useState(!1),[N,C]=h.useState("info"),[E,j]=h.useState(""),[R,L]=h.useState(""),[H,_]=h.useState([]),[I,w]=h.useState(""),[V,te]=h.useState(!1),[le,Q]=h.useState(null),[re,G]=h.useState(null),[oe,ve]=h.useState(""),[$,ne]=h.useState(""),[K,A]=h.useState(""),[F,O]=h.useState(!1),[Z,Y]=h.useState(null),[de,q]=h.useState("");h.useEffect(()=>{r&&l&&(C("info"),Q(null),G(null),Y(null),q(""),ge())},[r,l]);async function ge(){if(l){v(!0);try{const he=await ze(`/api/db/users?id=${encodeURIComponent(l)}`);if(he!=null&&he.success&&he.user){const xe=he.user;d(xe),j(xe.phone||""),L(xe.nickname||""),ve(xe.phone||""),ne(xe.wechatId||""),A(xe.openId||"");try{_(typeof xe.tags=="string"?JSON.parse(xe.tags||"[]"):[])}catch{_([])}}try{const xe=await ze(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);xe!=null&&xe.success&&xe.tracks&&f(xe.tracks)}catch{f([])}try{const xe=await ze(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);xe!=null&&xe.success&&xe.referrals&&y(xe.referrals)}catch{y([])}}catch(he){console.error("Load user detail error:",he)}finally{v(!1)}}}async function Se(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}P(!0);try{const he=await ct("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});he!=null&&he.success?(alert("同步成功"),ge()):alert("同步失败: "+(he==null?void 0:he.error))}catch(he){console.error("Sync CKB error:",he),alert("同步失败")}finally{P(!1)}}async function D(){if(c){b(!0);try{const he={id:c.id,phone:E||void 0,nickname:R||void 0,tags:JSON.stringify(H)},xe=await vt("/api/db/users",he);xe!=null&&xe.success?(alert("保存成功"),ge(),i==null||i()):alert("保存失败: "+(xe==null?void 0:xe.error))}catch(he){console.error("Save user error:",he),alert("保存失败")}finally{b(!1)}}}const fe=()=>{I&&!H.includes(I)&&(_([...H,I]),w(""))},ke=he=>_(H.filter(xe=>xe!==he));async function Ve(){if(!oe&&!K&&!$){G("请至少输入手机号、微信号或 OpenID 中的一项");return}te(!0),G(null),Q(null);try{const he=new URLSearchParams;oe&&he.set("phone",oe),K&&he.set("openId",K),$&&he.set("wechatId",$);const xe=await ze(`/api/admin/shensheshou/query?${he}`);xe!=null&&xe.success&&xe.data?(Q(xe.data),c&&await We(xe.data)):G((xe==null?void 0:xe.error)||"未查询到数据,该用户可能未在神射手收录")}catch(he){console.error("SSS query error:",he),G("请求失败,请检查神射手接口配置")}finally{te(!1)}}async function We(he){if(c)try{await ct("/api/admin/shensheshou/enrich",{userId:c.id,phone:oe||c.phone||"",openId:K||c.openId||"",wechatId:$||c.wechatId||""}),ge()}catch(xe){console.error("SSS enrich error:",xe)}}async function Ke(){if(c){O(!0),Y(null);try{const he={users:[{phone:c.phone||"",name:c.nickname||"",openId:c.openId||"",tags:H}]},xe=await ct("/api/admin/shensheshou/ingest",he);xe!=null&&xe.success&&xe.data?Y(xe.data):Y({error:(xe==null?void 0:xe.error)||"推送失败"})}catch(he){console.error("SSS ingest error:",he),Y({error:"请求失败"})}finally{O(!1)}}}const tt=he=>{const ft={view_chapter:qs,purchase:qd,match:Kt,login:Ia,register:Ia,share:Pr,bind_phone:Jb,bind_wechat:Wb,fill_profile:Ed,visit_page:Ta}[he]||Yd;return e.jsx(ft,{className:"w-4 h-4"})};return r?e.jsx(Ct,{open:r,onOpenChange:()=>a(),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Ia,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&e.jsx(Le,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"}),(c==null?void 0:c.isVip)&&e.jsx(Le,{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(Be,{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:""}):(($e=c.nickname)==null?void 0:$e.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(Le,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&e.jsx(Le,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"}),c.vipRole&&e.jsx(Le,{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($l,{value:N,onValueChange:C,className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(Ba,{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(Ta,{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(ln,{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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:E,onChange:he=>j(he.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"昵称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:R,onChange:he=>L(he.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(Xx,{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(nn,{className:"w-4 h-4 text-amber-400"}),e.jsx("span",{className:"text-white font-medium",children:"VIP 信息"}),e.jsx(Le,{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(Al,{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:he=>q(he.target.value)}),e.jsxs(X,{size:"sm",onClick:async()=>{if(!(!de||!c))try{await vt("/api/db/users",{id:c.id,wechatId:de}),alert("已保存微信归属"),ge()}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(It,{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(Pr,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),e.jsx(X,{size:"sm",onClick:Se,disabled:k||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:k?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Be,{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(Le,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):e.jsx(Le,{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(Ed,{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(Gd,{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(he=>e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1.5",children:he.category}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:he.tags.map(xe=>e.jsxs("button",{type:"button",onClick:()=>{H.includes(xe)?ke(xe):_([...H,xe])},className:`px-2 py-0.5 rounded text-xs border transition-all ${H.includes(xe)?"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:[H.includes(xe)?"✓ ":"",xe]},xe))})]},he.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:[H.map((he,xe)=>e.jsxs(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[he,e.jsx("button",{type:"button",onClick:()=>ke(he),className:"ml-1 hover:text-red-400",children:e.jsx(ms,{className:"w-3 h-3"})})]},xe)),H.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:I,onChange:he=>w(he.target.value),onKeyDown:he=>he.key==="Enter"&&fe()}),e.jsx(X,{onClick:fe,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(Ed,{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((he,xe)=>e.jsx(Le,{className:"bg-purple-500/20 text-purple-400 border-0",children:he.trim()},xe))})]})]}),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(Ta,{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((he,xe)=>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:tt(he.action)}),xe<m.length-1&&e.jsx("div",{className:"w-0.5 h-4 bg-gray-700/50 mt-1"})]}),e.jsxs("div",{className:"flex-1 pb-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-white font-medium",children:he.actionLabel}),he.chapterTitle&&e.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",he.chapterTitle]})]}),e.jsxs("p",{className:"text-gray-500 text-xs mt-0.5",children:[e.jsx(Yd,{className:"w-3 h-3 inline mr-1"}),he.timeAgo," · ",new Date(he.createdAt).toLocaleString()]})]})]},he.id)):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Ta,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400",children:"暂无用户旅程记录"}),e.jsx("p",{className:"text-gray-600 text-sm mt-1",children:"当用户浏览章节、购买或完善信息时会自动记录"})]})})]}),e.jsx(Ot,{value:"relations",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 justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pr,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"推荐的用户"})]}),e.jsxs(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:["共 ",p.length," 人"]})]}),e.jsx("div",{className:"space-y-2 max-h-[250px] overflow-y-auto",children:p.length>0?p.map((he,xe)=>{var es;const ft=he;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:((es=ft.nickname)==null?void 0:es.charAt(0))||"?"}),e.jsx("span",{className:"text-white text-sm",children:ft.nickname})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[ft.status==="vip"&&e.jsx(Le,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),e.jsx("span",{className:"text-gray-500 text-xs",children:ft.createdAt?new Date(ft.createdAt).toLocaleDateString():""})]})]},ft.id||xe)}):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(ln,{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(ie,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"11位手机号",value:oe,onChange:he=>ve(he.target.value)})]}),e.jsxs("div",{children:[e.jsx(ee,{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:he=>ne(he.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(ie,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"openid_xxxx(自动填入)",value:K,onChange:he=>A(he.target.value)})]})]}),e.jsx(X,{onClick:Ve,disabled:V,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:V?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"})," 查询并自动回填中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(cn,{className:"w-4 h-4 mr-1"})," 查询并自动完善用户资料"]})}),e.jsx("p",{className:"text-gray-600 text-xs mt-2",children:"查询成功后,神射手返回的标签将自动同步到该用户"}),re&&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:re}),le&&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:le.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:le.user_level??"-"})]})]}),le.tags&&le.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:le.tags.map((he,xe)=>e.jsx(Le,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/20",children:he},xe))})]}),le.last_active&&e.jsxs("div",{className:"text-sm text-gray-500",children:["最近活跃:",le.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(ln,{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(X,{onClick:Ke,disabled:F||!c.phone,variant:"outline",className:"border-purple-500/40 text-purple-400 hover:bg-purple-500/10 bg-transparent shrink-0 ml-4",children:F?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"})," 推送中"]}):e.jsxs(e.Fragment,{children:[e.jsx(ln,{className:"w-4 h-4 mr-1"})," 推送"]})})]}),!c.phone&&e.jsx("p",{className:"text-yellow-500/70 text-xs",children:"⚠ 用户未绑定手机号,无法推送"}),Z&&e.jsx("div",{className:"mt-3 p-3 bg-[#162840] rounded-lg text-sm",children:Z.error?e.jsx("p",{className:"text-red-400",children:String(Z.error)}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-green-400 flex items-center gap-1",children:[e.jsx(Gd,{className:"w-4 h-4"})," 推送成功"]}),Z.enriched!==void 0&&e.jsxs("p",{className:"text-gray-400",children:["自动补全标签数:",String(Z.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(X,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"关闭"]}),e.jsxs(X,{onClick:D,disabled:T,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),T?"保存中...":"保存修改"]})]})]}):e.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const Fd={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function O2({open:r,onClose:a,userId:l,userNickname:i="",onSaved:c}){const[d,m]=h.useState(Fd),[f,p]=h.useState([]),[y,g]=h.useState(!1),[v,k]=h.useState(!1);h.useEffect(()=>{if(!r){m(Fd);return}let T=!1;return g(!0),Promise.all([ze("/api/db/vip-roles"),l?ze(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([b,N])=>{if(T)return;const C=b!=null&&b.success&&b.data?b.data:[];p(C);const E=N&&N.user?N.user:null;if(E){const j=String(E.vipRole??""),R=C.some(L=>L.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(Fd)}).catch(b=>{T||console.error("Load error:",b)}).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}}k(!0);try{const T=d.vipRole==="__custom__"?d.vipRoleCustom.trim():d.vipRole,b={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},N=await vt("/api/db/users",b);N!=null&&N.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(N==null?void 0:N.error))}catch(T){console.error("Save VIP error:",T),alert("保存失败")}finally{k(!1)}}}return r?e.jsx(Ct,{open:r,onOpenChange:()=>a(),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(nn,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",i||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(ot,{checked:d.isVip,onCheckedChange:T=>m(b=>({...b,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(ie,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:d.vipExpireDate,onChange:T=>m(b=>({...b,vipExpireDate:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"排序"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:d.vipSort===""?"":d.vipSort,onChange:T=>{const b=T.target.value;m(N=>({...N,vipSort:b===""?"":parseInt(b,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(b=>({...b,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(ie,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:d.vipRoleCustom,onChange:T=>m(b=>({...b,vipRoleCustom:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"VIP 展示名"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:d.vipName,onChange:T=>m(b=>({...b,vipName:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"项目/公司"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:d.vipProject,onChange:T=>m(b=>({...b,vipProject:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"联系方式"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:d.vipContact,onChange:T=>m(b=>({...b,vipContact:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"一句话简介"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:d.vipBio,onChange:T=>m(b=>({...b,vipBio:T.target.value}))})]})]}),e.jsxs(Dt,{children:[e.jsxs(X,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(X,{onClick:P,disabled:v||y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})}):null}const so=[{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 as,En,er,xr,Pt;const[r,a]=Ux(),l=r.get("pool"),[i,c]=h.useState([]),[d,m]=h.useState(0),[f,p]=h.useState(1),[y,g]=h.useState(10),[v,k]=h.useState(""),P=Iu(v,300),T=l==="vip"?"vip":l==="complete"?"complete":"all",[b,N]=h.useState(T),[C,E]=h.useState(!0),[j,R]=h.useState(null),[L,H]=h.useState(!1),[_,I]=h.useState("desc");h.useEffect(()=>{l==="vip"?N("vip"):l==="complete"?N("complete"):l==="all"&&N("all")},[l]);const[w,V]=h.useState(!1),[te,le]=h.useState(!1),[Q,re]=h.useState(null),[G,oe]=h.useState(""),[ve,$]=h.useState(""),[ne,K]=h.useState(!1),[A,F]=h.useState(!1),[O,Z]=h.useState({referrals:[],stats:{}}),[Y,de]=h.useState(!1),[q,ge]=h.useState(null),[Se,D]=h.useState(!1),[fe,ke]=h.useState(null),[Ve,We]=h.useState(!1),[Ke,tt]=h.useState(null),[$e,he]=h.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),[xe,ft]=h.useState([]),[es,hr]=h.useState(!1),[bn,As]=h.useState(!1),[Bt,Mr]=h.useState(null),[dt,gs]=h.useState({title:"",description:"",trigger:"",sort:0,enabled:!0}),[Nn,mr]=h.useState([]),[Cs,Yn]=h.useState(!1),[Qn,ks]=h.useState(!1),[wn,fr]=h.useState(null),[ys,Ds]=h.useState({name:"",sort:0}),[Ls,Sn]=h.useState({}),[Es,Os]=h.useState(!1);async function Fs(){var B;E(!0),R(null);try{if(L){const He=new URLSearchParams({search:P,limit:String(y*5)}),Je=await ze(`/api/db/users/rfm?${He}`);if(Je!=null&&Je.success){let ls=Je.users||[];_==="asc"&&(ls=[...ls].reverse());const ut=(f-1)*y;c(ls.slice(ut,ut+y)),m(((B=Je.users)==null?void 0:B.length)??0),ls.length===0&&(H(!1),R("暂无订单数据,RFM 排序需要用户有购买记录后才能生效"))}else H(!1),R((Je==null?void 0:Je.error)||"RFM 加载失败,已切回普通模式")}else{const He=new URLSearchParams({page:String(f),pageSize:String(y),search:P,...b==="vip"&&{vip:"true"},...b==="complete"&&{pool:"complete"}}),Je=await ze(`/api/db/users?${He}`);Je!=null&&Je.success?(c(Je.users||[]),m(Je.total??0)):R((Je==null?void 0:Je.error)||"加载失败")}}catch(He){console.error("Load users error:",He),R("网络错误")}finally{E(!1)}}h.useEffect(()=>{p(1)},[P,b,L]),h.useEffect(()=>{Fs()},[f,y,P,b,L,_]);const qn=Math.ceil(d/y)||1,Xn=()=>{L?_==="desc"?I("asc"):(H(!1),I("desc")):(H(!0),I("desc"))},Jn=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 Zn(B){if(confirm("确定要删除这个用户吗?"))try{const He=await Tr(`/api/db/users?id=${encodeURIComponent(B)}`);He!=null&&He.success?Fs():alert("删除失败: "+((He==null?void 0:He.error)||""))}catch{alert("删除失败")}}const Cn=B=>{re(B),he({phone:B.phone||"",nickname:B.nickname||"",password:"",isAdmin:!!(B.isAdmin??!1),hasFullBook:!!(B.hasFullBook??!1)}),V(!0)},kn=()=>{re(null),he({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),V(!0)};async function zs(){if(!$e.phone||!$e.nickname){alert("请填写手机号和昵称");return}K(!0);try{if(Q){const B=await vt("/api/db/users",{id:Q.id,nickname:$e.nickname,isAdmin:$e.isAdmin,hasFullBook:$e.hasFullBook,...$e.password&&{password:$e.password}});if(!(B!=null&&B.success)){alert("更新失败: "+((B==null?void 0:B.error)||""));return}}else{const B=await ct("/api/db/users",{phone:$e.phone,nickname:$e.nickname,password:$e.password,isAdmin:$e.isAdmin});if(!(B!=null&&B.success)){alert("创建失败: "+((B==null?void 0:B.error)||""));return}}V(!1),Fs()}catch{alert("保存失败")}finally{K(!1)}}const Ar=B=>{re(B),oe(""),$(""),le(!0)};async function $s(B){ge(B),F(!0),de(!0);try{const He=await ze(`/api/db/users/referrals?userId=${encodeURIComponent(B.id)}`);He!=null&&He.success?Z({referrals:He.referrals||[],stats:He.stats||{}}):Z({referrals:[],stats:{}})}catch{Z({referrals:[],stats:{}})}finally{de(!1)}}async function ea(){if(!G){alert("请输入新密码");return}if(G!==ve){alert("两次密码不一致");return}if(G.length<6){alert("密码至少6位");return}K(!0);try{const B=await vt("/api/db/users",{id:Q==null?void 0:Q.id,password:G});B!=null&&B.success?(alert("修改成功"),le(!1)):alert("修改失败: "+((B==null?void 0:B.error)||""))}catch{alert("修改失败")}finally{K(!1)}}const ts=h.useCallback(async()=>{hr(!0);try{const B=await ze("/api/db/user-rules");B!=null&&B.success&&ft(B.rules||[])}catch{}finally{hr(!1)}},[]);async function z(){if(!dt.title){alert("请填写规则标题");return}K(!0);try{if(Bt){const B=await vt("/api/db/user-rules",{id:Bt.id,...dt});if(!(B!=null&&B.success)){alert("更新失败: "+((B==null?void 0:B.error)||""));return}}else{const B=await ct("/api/db/user-rules",dt);if(!(B!=null&&B.success)){alert("创建失败: "+((B==null?void 0:B.error)||""));return}}As(!1),ts()}catch{alert("保存失败")}finally{K(!1)}}async function ce(B){if(confirm("确定删除?"))try{const He=await Tr(`/api/db/user-rules?id=${B}`);He!=null&&He.success&&ts()}catch{}}async function Ce(B){try{await vt("/api/db/user-rules",{id:B.id,enabled:!B.enabled}),ts()}catch{}}const Ee=h.useCallback(async()=>{Yn(!0);try{const B=await ze("/api/db/vip-roles");B!=null&&B.success&&mr(B.roles||[])}catch{}finally{Yn(!1)}},[]);async function xt(){if(!ys.name){alert("请填写角色名称");return}K(!0);try{if(wn){const B=await vt("/api/db/vip-roles",{id:wn.id,...ys});if(!(B!=null&&B.success)){alert("更新失败");return}}else{const B=await ct("/api/db/vip-roles",ys);if(!(B!=null&&B.success)){alert("创建失败");return}}ks(!1),Ee()}catch{alert("保存失败")}finally{K(!1)}}async function ns(B){if(confirm("确定删除?"))try{const He=await Tr(`/api/db/vip-roles?id=${B}`);He!=null&&He.success&&Ee()}catch{}}const nt=h.useCallback(async()=>{Os(!0);try{const B=await ze("/api/db/users/journey-stats");B!=null&&B.success&&B.stats&&Sn(B.stats)}catch{}finally{Os(!1)}},[]);return e.jsxs("div",{className:"p-8 w-full",children:[j&&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:j}),e.jsx("button",{type:"button",onClick:()=>R(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:["共 ",d," 位注册用户",L&&" · RFM 排序中"]})]})}),e.jsxs($l,{defaultValue:"users",className:"w-full",children:[e.jsxs(Ba,{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(Kt,{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:nt,children:[e.jsx(Ta,{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:ts,children:[e.jsx(Bn,{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:Ee,children:[e.jsx(nn,{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(X,{variant:"outline",onClick:Fs,disabled:C,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${C?"animate-spin":""}`})," 刷新"]}),e.jsxs("select",{value:b,onChange:B=>{const He=B.target.value;N(He),p(1),l&&(r.delete("pool"),a(r))},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",disabled:L,children:[e.jsx("option",{value:"all",children:"全部用户"}),e.jsx("option",{value:"vip",children:"VIP会员(超级个体)"}),e.jsx("option",{value:"complete",children:"完善资料用户"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(cn,{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:v,onChange:B=>k(B.target.value)})]}),e.jsxs(X,{onClick:kn,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Xd,{className:"w-4 h-4 mr-2"})," 添加用户"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:C?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{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(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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:Xn,children:[e.jsxs("div",{className:"flex items-center gap-1 group",children:[e.jsx(Ra,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"RFM分值"}),L?_==="desc"?e.jsx(Ml,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Wx,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Vj,{className:"w-3.5 h-3.5 text-gray-600 group-hover:text-gray-400"})]}),L&&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(ps,{children:[i.map(B=>{var He,Je,ls;return e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{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:""}):((He=B.nickname)==null?void 0:He.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(Le,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),B.openId&&!((Je=B.id)!=null&&Je.startsWith("user_"))&&e.jsx(Le,{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)+"...":(ls=B.id)==null?void 0:ls.slice(0,12)})]})]})}),e.jsx(pe,{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(pe,{children:B.hasFullBook?e.jsx(Le,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):e.jsx(Le,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),e.jsx(pe,{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:()=>$s(B),role:"button",tabIndex:0,onKeyDown:ut=>ut.key==="Enter"&&$s(B),children:[e.jsx(Kt,{className:"w-3 h-3"})," 绑定",B.referralCount||0,"人"]})]})}),e.jsx(pe,{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(Le,{className:`border-0 text-xs ${Jn(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(pe,{className:"text-gray-400",children:B.createdAt?new Date(B.createdAt).toLocaleDateString():"-"}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>{tt(B),We(!0)},className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:e.jsx(nn,{className:"w-4 h-4"})}),e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>{ke(B.id),D(!0)},className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:e.jsx(Er,{className:"w-4 h-4"})}),e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>Cn(B),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>Ar(B),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:e.jsx($f,{className:"w-4 h-4"})}),e.jsx(X,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>Zn(B.id),title:"删除",children:e.jsx(Ht,{className:"w-4 h-4"})})]})})]},B.id)}),i.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),e.jsx(Qs,{page:f,totalPages:qn,total:d,pageSize:y,onPageChange:p,onPageSizeChange:B=>{g(B),p(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(X,{variant:"outline",onClick:nt,disabled:Es,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${Es?"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:so.map((B,He)=>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(Je=>Je.startsWith("text-"))}`,children:B.label}),Ls[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:Ls[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:He+1})]}),He<so.length-1&&e.jsx("div",{className:"hidden lg:block absolute right-0 top-1/2 -translate-y-1/2 translate-x-1/2 z-10",children:e.jsx("svg",{width:"20",height:"12",viewBox:"0 0 20 12",fill:"none",children:e.jsx("path",{d:"M0 6H16M16 6L11 1M16 6L11 11",stroke:"#374151",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("p",{className:"text-[10px] text-gray-600 text-center mt-2 leading-tight",children:B.desc})]},B.id))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[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(Ta,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"旅程关键节点"})]}),e.jsx("div",{className:"space-y-2 text-sm",children:[{step:"① 注册",action:"微信 OAuth 或手机号注册",next:"引导填写头像"},{step:"② 浏览",action:"点击章节/阅读免费内容",next:"触发绑定手机"},{step:"③ 首付",action:"购买单章或全书",next:"推送分销功能"},{step:"④ VIP",action:"¥1980 购买全书",next:"进入 VIP 私域群"},{step:"⑤ 分销",action:"推广好友购买",next:"提现分销收益"}].map(B=>e.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(qs,{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:"实时更新"})]}),Es?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Be,{className:"w-5 h-5 text-[#38bdac] animate-spin"})}):Object.keys(Ls).length>0?e.jsx("div",{className:"space-y-2",children:so.map(B=>{const He=Ls[B.id]||0,Je=Math.max(...so.map(ut=>Ls[ut.id]||0),1),ls=Math.round(He/Je*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:`${ls}%`}})}),e.jsx("span",{className:"text-gray-400 text-xs w-10 text-right",children:He})]},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(X,{variant:"outline",onClick:ts,disabled:es,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${es?"animate-spin":""}`})," 刷新"]}),e.jsxs(X,{onClick:()=>{Mr(null),gs({title:"",description:"",trigger:"",sort:0,enabled:!0}),As(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"})," 添加规则"]})]})]}),es?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"})}):xe.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(qs,{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(X,{onClick:ts,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Be,{className:"w-4 h-4 mr-2"})," 重新加载"]})]}):e.jsx("div",{className:"space-y-2",children:xe.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(Le,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/30 text-xs",children:["触发:",B.trigger]}),e.jsx(Le,{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(ot,{checked:B.enabled,onCheckedChange:()=>Ce(B)}),e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>{Mr(B),gs({title:B.title,description:B.description,trigger:B.trigger,sort:B.sort,enabled:B.enabled}),As(!0)},className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>ce(B.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Ht,{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(X,{variant:"outline",onClick:Ee,disabled:Cs,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${Cs?"animate-spin":""}`})," 刷新"]}),e.jsxs(X,{onClick:()=>{fr(null),Ds({name:"",sort:0}),ks(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"})," 添加角色"]})]})]}),Cs?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"})}):Nn.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(nn,{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(X,{onClick:()=>{fr(null),Ds({name:"",sort:0}),ks(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{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:Nn.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(nn,{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:()=>{fr(B),Ds({name:B.name,sort:B.sort}),ks(!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:()=>ns(B.id),className:"text-gray-500 hover:text-red-400",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("p",{className:"text-gray-600 text-xs",children:["排序: ",B.sort]})]},B.id))})]})]}),e.jsx(Ct,{open:w,onOpenChange:V,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[Q?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Xd,{className:"w-5 h-5 text-[#38bdac]"}),Q?"编辑用户":"添加用户"]})}),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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:$e.phone,onChange:B=>he({...$e,phone:B.target.value}),disabled:!!Q})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"昵称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:$e.nickname,onChange:B=>he({...$e,nickname:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:Q?"新密码 (留空则不修改)":"密码"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:Q?"留空则不修改":"请输入密码",value:$e.password,onChange:B=>he({...$e,password:B.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ee,{className:"text-gray-300",children:"管理员权限"}),e.jsx(ot,{checked:$e.isAdmin,onCheckedChange:B=>he({...$e,isAdmin:B})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ee,{className:"text-gray-300",children:"已购全书"}),e.jsx(ot,{checked:$e.hasFullBook,onCheckedChange:B=>he({...$e,hasFullBook:B})})]})]}),e.jsxs(Dt,{children:[e.jsxs(X,{variant:"outline",onClick:()=>V(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(X,{onClick:zs,disabled:ne,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),ne?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:te,onOpenChange:le,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx($f,{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:["用户:",Q==null?void 0:Q.nickname]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",Q==null?void 0:Q.phone]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"新密码"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:G,onChange:B=>oe(B.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"确认密码"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入",value:ve,onChange:B=>$(B.target.value)})]})]}),e.jsxs(Dt,{children:[e.jsx(X,{variant:"outline",onClick:()=>le(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(X,{onClick:ea,disabled:ne,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ne?"保存中...":"确认修改"})]})]})}),e.jsx(Ct,{open:bn,onOpenChange:As,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),Bt?"编辑规则":"添加规则"]})}),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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:匹配后填写头像、付款1980需填写信息",value:dt.title,onChange:B=>gs({...dt,title:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"规则描述"}),e.jsx(un,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[80px] resize-none",placeholder:"详细说明规则内容...",value:dt.description,onChange:B=>gs({...dt,description:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"触发条件"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:完成匹配、付款后、注册时",value:dt.trigger,onChange:B=>gs({...dt,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(ot,{checked:dt.enabled,onCheckedChange:B=>gs({...dt,enabled:B})})]})]}),e.jsxs(Dt,{children:[e.jsxs(X,{variant:"outline",onClick:()=>As(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(X,{onClick:z,disabled:ne,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),ne?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:Qn,onOpenChange:ks,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(nn,{className:"w-5 h-5 text-amber-400"}),wn?"编辑 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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:创业者、资源整合者、技术咖",value:ys.name,onChange:B=>Ds({...ys,name:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"排序(越小越前)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:ys.sort,onChange:B=>Ds({...ys,sort:parseInt(B.target.value)||0})})]})]}),e.jsxs(Dt,{children:[e.jsxs(X,{variant:"outline",onClick:()=>ks(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(X,{onClick:xt,disabled:ne,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),ne?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:A,onOpenChange:F,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Kt,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系 - ",q==null?void 0:q.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:((as=O.stats)==null?void 0:as.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:((En=O.stats)==null?void 0:En.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:["¥",(((er=O.stats)==null?void 0:er.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:["¥",(((xr=O.stats)==null?void 0:xr.pendingEarnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),Y?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(Be,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((Pt=O.referrals)==null?void 0:Pt.length)??0)>0?e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(O.referrals??[]).map((B,He)=>{var ls;const Je=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:((ls=Je.nickname)==null?void 0:ls.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white text-sm",children:Je.nickname}),e.jsx("div",{className:"text-xs text-gray-500",children:Je.phone||(Je.hasOpenId?"微信用户":"未绑定")})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[Je.status==="vip"&&e.jsx(Le,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),Je.status==="paid"&&e.jsxs(Le,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",Je.purchasedSections,"章"]}),Je.status==="free"&&e.jsx(Le,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),e.jsx("span",{className:"text-xs text-gray-500",children:Je.createdAt?new Date(Je.createdAt).toLocaleDateString():""})]})]},Je.id||He)})}):e.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),e.jsx(Dt,{children:e.jsx(X,{variant:"outline",onClick:()=>F(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),e.jsx(v0,{open:Se,onClose:()=>D(!1),userId:fe,onUserUpdated:Fs}),e.jsx(O2,{open:Ve,onClose:()=>{We(!1),tt(null)},userId:(Ke==null?void 0:Ke.id)??null,userNickname:Ke==null?void 0:Ke.nickname,onSaved:Fs})]})}function xo(r,[a,l]){return Math.min(l,Math.max(a,r))}var j0=["PageUp","PageDown"],b0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],N0={"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",[su,z2,$2]=_u(Ua),[w0]=yn(Ua,[$2]),[B2,Ro]=w0(Ua),S0=h.forwardRef((r,a)=>{const{name:l,min:i=0,max:c=100,step:d=1,orientation:m="horizontal",disabled:f=!1,minStepsBetweenThumbs:p=0,defaultValue:y=[i],value:g,onValueChange:v=()=>{},onValueCommit:k=()=>{},inverted:P=!1,form:T,...b}=r,N=h.useRef(new Set),C=h.useRef(0),j=m==="horizontal"?U2:V2,[R=[],L]=Vn({prop:g,defaultProp:y,onChange:te=>{var Q;(Q=[...N.current][C.current])==null||Q.focus(),v(te)}}),H=h.useRef(R);function _(te){const le=Y2(R,te);V(te,le)}function I(te){V(te,C.current)}function w(){const te=H.current[C.current];R[C.current]!==te&&k(R)}function V(te,le,{commit:Q}={commit:!1}){const re=J2(d),G=Z2(Math.round((te-i)/d)*d+i,re),oe=xo(G,[i,c]);L((ve=[])=>{const $=K2(ve,oe,le);if(X2($,p*d)){C.current=$.indexOf(oe);const ne=String($)!==String(ve);return ne&&Q&&k($),ne?$:ve}else return ve})}return e.jsx(B2,{scope:r.__scopeSlider,name:l,disabled:f,min:i,max:c,valueIndexToChangeRef:C,thumbs:N.current,values:R,orientation:m,form:T,children:e.jsx(su.Provider,{scope:r.__scopeSlider,children:e.jsx(su.Slot,{scope:r.__scopeSlider,children:e.jsx(j,{"aria-disabled":f,"data-disabled":f?"":void 0,...b,ref:a,onPointerDown:Ge(b.onPointerDown,()=>{f||(H.current=R)}),min:i,max:c,inverted:P,onSlideStart:f?void 0:_,onSlideMove:f?void 0:I,onSlideEnd:f?void 0:w,onHomeKeyDown:()=>!f&&V(i,0,{commit:!0}),onEndKeyDown:()=>!f&&V(c,R.length-1,{commit:!0}),onStepKeyDown:({event:te,direction:le})=>{if(!f){const G=j0.includes(te.key)||te.shiftKey&&b0.includes(te.key)?10:1,oe=C.current,ve=R[oe],$=d*G*le;V(ve+$,oe,{commit:!0})}}})})})})});S0.displayName=Ua;var[C0,k0]=w0(Ua,{startEdge:"left",endEdge:"right",size:"width",direction:1}),U2=h.forwardRef((r,a)=>{const{min:l,max:i,dir:c,inverted:d,onSlideStart:m,onSlideMove:f,onSlideEnd:p,onStepKeyDown:y,...g}=r,[v,k]=h.useState(null),P=at(a,j=>k(j)),T=h.useRef(void 0),b=Eo(c),N=b==="ltr",C=N&&!d||!N&&d;function E(j){const R=T.current||v.getBoundingClientRect(),L=[0,R.width],_=Lu(L,C?[l,i]:[i,l]);return T.current=R,_(j-R.left)}return e.jsx(C0,{scope:r.__scopeSlider,startEdge:C?"left":"right",endEdge:C?"right":"left",direction:C?1:-1,size:"width",children:e.jsx(E0,{dir:b,"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 L=N0[C?"from-left":"from-right"].includes(j.key);y==null||y({event:j,direction:L?-1:1})}})})}),V2=h.forwardRef((r,a)=>{const{min:l,max:i,inverted:c,onSlideStart:d,onSlideMove:m,onSlideEnd:f,onStepKeyDown:p,...y}=r,g=h.useRef(null),v=at(a,g),k=h.useRef(void 0),P=!c;function T(b){const N=k.current||g.current.getBoundingClientRect(),C=[0,N.height],j=Lu(C,P?[i,l]:[l,i]);return k.current=N,j(b-N.top)}return e.jsx(C0,{scope:r.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:e.jsx(E0,{"data-orientation":"vertical",...y,ref:v,style:{...y.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const N=T(b.clientY);d==null||d(N)},onSlideMove:b=>{const N=T(b.clientY);m==null||m(N)},onSlideEnd:()=>{k.current=void 0,f==null||f()},onStepKeyDown:b=>{const C=N0[P?"from-bottom":"from-top"].includes(b.key);p==null||p({event:b,direction:C?-1:1})}})})}),E0=h.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:m,onEndKeyDown:f,onStepKeyDown:p,...y}=r,g=Ro(Ua,l);return e.jsx(Xe.span,{...y,ref:a,onKeyDown:Ge(r.onKeyDown,v=>{v.key==="Home"?(m(v),v.preventDefault()):v.key==="End"?(f(v),v.preventDefault()):j0.concat(b0).includes(v.key)&&(p(v),v.preventDefault())}),onPointerDown:Ge(r.onPointerDown,v=>{const k=v.target;k.setPointerCapture(v.pointerId),v.preventDefault(),g.thumbs.has(k)?k.focus():i(v)}),onPointerMove:Ge(r.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&c(v)}),onPointerUp:Ge(r.onPointerUp,v=>{const k=v.target;k.hasPointerCapture(v.pointerId)&&(k.releasePointerCapture(v.pointerId),d(v))})})}),P0="SliderTrack",T0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=Ro(P0,l);return e.jsx(Xe.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...i,ref:a})});T0.displayName=P0;var ru="SliderRange",R0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=Ro(ru,l),d=k0(ru,l),m=h.useRef(null),f=at(a,m),p=c.values.length,y=c.values.map(k=>M0(k,c.min,c.max)),g=p>1?Math.min(...y):0,v=100-Math.max(...y);return e.jsx(Xe.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...i,ref:f,style:{...r.style,[d.startEdge]:g+"%",[d.endEdge]:v+"%"}})});R0.displayName=ru;var nu="SliderThumb",I0=h.forwardRef((r,a)=>{const l=z2(r.__scopeSlider),[i,c]=h.useState(null),d=at(a,f=>c(f)),m=h.useMemo(()=>i?l().findIndex(f=>f.ref.current===i):-1,[l,i]);return e.jsx(W2,{...r,ref:d,index:m})}),W2=h.forwardRef((r,a)=>{const{__scopeSlider:l,index:i,name:c,...d}=r,m=Ro(nu,l),f=k0(nu,l),[p,y]=h.useState(null),g=at(a,E=>y(E)),v=p?m.form||!!p.closest("form"):!0,k=Du(p),P=m.values[i],T=P===void 0?0:M0(P,m.min,m.max),b=G2(i,m.values.length),N=k==null?void 0:k[f.size],C=N?Q2(N,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}% + ${C}px)`},children:[e.jsx(su.ItemSlot,{scope:r.__scopeSlider,children:e.jsx(Xe.span,{role:"slider","aria-label":r["aria-label"]||b,"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:Ge(r.onFocus,()=>{m.valueIndexToChangeRef.current=i})})}),v&&e.jsx(_0,{name:c??(m.name?m.name+(m.values.length>1?"[]":""):void 0),form:m.form,value:P},i)]})});I0.displayName=nu;var H2="RadioBubbleInput",_0=h.forwardRef(({__scopeSlider:r,value:a,...l},i)=>{const c=h.useRef(null),d=at(c,i),m=Au(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(Xe.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});_0.displayName=H2;function K2(r=[],a,l){const i=[...r];return i[l]=a,i.sort((c,d)=>c-d)}function M0(r,a,l){const d=100/(l-a)*(r-a);return xo(d,[0,100])}function G2(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function Y2(r,a){if(r.length===1)return 0;const l=r.map(c=>Math.abs(c-a)),i=Math.min(...l);return l.indexOf(i)}function Q2(r,a,l){const i=r/2,d=Lu([0,50],[0,i]);return(i-d(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 Lu(r,a){return l=>{if(r[0]===r[1]||a[0]===a[1])return a[0];const i=(a[1]-a[0])/(r[1]-r[0]);return a[0]+i*(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=S0,t4=T0,s4=R0,r4=I0;function n4({className:r,defaultValue:a,value:l,min:i=0,max:c=100,...d}){const m=h.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[i,c],[l,a,i,c]);return e.jsxs(e4,{defaultValue:a,value:l,min:i,max:c,className:lt("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...d,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,p)=>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"},p))]})}const a4={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function A0({embedded:r=!1}){const[a,l]=h.useState(a4),[i,c]=h.useState(!0),[d,m]=h.useState(!1);h.useEffect(()=>{ze("/api/admin/referral-settings").then(y=>{const g=y==null?void 0:y.data;g&&typeof g=="object"&&l({distributorShare:g.distributorShare??90,minWithdrawAmount:g.minWithdrawAmount??10,bindingDays:g.bindingDays??30,userDiscount:g.userDiscount??5,enableAutoWithdraw:g.enableAutoWithdraw??!1,vipOrderShareVip:g.vipOrderShareVip??20,vipOrderShareNonVip:g.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},g=await ct("/api/admin/referral-settings",y);if(!g||g.success===!1){alert("保存失败: "+(g&&typeof g=="object"&&"error"in g?g.error:""));return}alert(`✅ 分销配置已保存成功!
|
||
|
||
• 小程序与网站的推广规则会一起生效
|
||
• 绑定关系会使用新的天数配置
|
||
• 佣金比例会立即应用到新订单
|
||
|
||
如有缓存,请刷新前台/小程序页面。`)}catch(y){console.error(y),alert("保存失败: "+(y instanceof Error?y.message:String(y)))}finally{m(!1)}},p=y=>g=>{const v=parseFloat(g.target.value||"0");l(k=>({...k,[y]:isNaN(v)?0:v}))};return i?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(Aa,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),e.jsxs(X,{onClick:f,disabled:d||i,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),d?"保存中...":"保存配置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"flex items-center gap-2 text-white",children:[e.jsx(qb,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),e.jsx(jt,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),e.jsx(we,{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(Yi,{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:p("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(Kt,{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(g=>({...g,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:p("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(ee,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Yi,{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:p("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(Yi,{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:p("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(Kt,{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:p("bindingDays")}),e.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"flex items-center gap-2 text-white",children:[e.jsx(Aa,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),e.jsx(jt,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),e.jsx(we,{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(ie,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:a.minWithdrawAmount,onChange:p("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(Le,{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(ot,{checked:a.enableAutoWithdraw,onCheckedChange:y=>l(g=>({...g,enableAutoWithdraw:y}))}),e.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsxs(Qe,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[e.jsx(Yi,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),e.jsxs(we,{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 Se;const[r,a]=h.useState("overview"),[l,i]=h.useState([]),[c,d]=h.useState(null),[m,f]=h.useState([]),[p,y]=h.useState([]),[g,v]=h.useState([]),[k,P]=h.useState(!0),[T,b]=h.useState(null),[N,C]=h.useState(""),[E,j]=h.useState("all"),[R,L]=h.useState(1),[H,_]=h.useState(10),[I,w]=h.useState(0),[V,te]=h.useState(new Set),[le,Q]=h.useState(null),[re,G]=h.useState(""),[oe,ve]=h.useState(!1);h.useEffect(()=>{$()},[]),h.useEffect(()=>{L(1)},[r,E]),h.useEffect(()=>{ne(r)},[r]),h.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&ne(r,!0)},[R,H,E,N]);async function $(){b(null);try{const D=await ze("/api/admin/distribution/overview");D!=null&&D.success&&D.overview&&d(D.overview)}catch(D){console.error("[Admin] 概览接口异常:",D),b("加载概览失败")}try{const D=await ze("/api/db/users");v((D==null?void 0:D.users)||[])}catch(D){console.error("[Admin] 用户数据加载失败:",D)}}async function ne(D,fe=!1){var ke;if(!(!fe&&V.has(D))){P(!0);try{const Ve=g;switch(D){case"overview":break;case"orders":{try{const We=new URLSearchParams({page:String(R),pageSize:String(H),...E!=="all"&&{status:E},...N&&{search:N}}),Ke=await ze(`/api/orders?${We}`);if(Ke!=null&&Ke.success&&Ke.orders){const tt=Ke.orders.map($e=>{const he=Ve.find(ft=>ft.id===$e.userId),xe=$e.referrerId?Ve.find(ft=>ft.id===$e.referrerId):null;return{...$e,amount:parseFloat(String($e.amount))||0,userNickname:(he==null?void 0:he.nickname)||$e.userNickname||"未知用户",userPhone:(he==null?void 0:he.phone)||$e.userPhone||"-",referrerNickname:(xe==null?void 0:xe.nickname)||null,referrerCode:(xe==null?void 0:xe.referralCode)??null,type:$e.productType||$e.type}});i(tt),w(Ke.total??tt.length)}else i([]),w(0)}catch(We){console.error(We),b("加载订单失败"),i([])}break}case"bindings":{try{const We=new URLSearchParams({page:String(R),pageSize:String(H),...E!=="all"&&{status:E}}),Ke=await ze(`/api/db/distribution?${We}`);f((Ke==null?void 0:Ke.bindings)||[]),w((Ke==null?void 0:Ke.total)??((ke=Ke==null?void 0:Ke.bindings)==null?void 0:ke.length)??0)}catch(We){console.error(We),b("加载绑定数据失败"),f([])}break}case"withdrawals":{try{const We=E==="completed"?"success":E==="rejected"?"failed":E,Ke=new URLSearchParams({...We&&We!=="all"&&{status:We},page:String(R),pageSize:String(H)}),tt=await ze(`/api/admin/withdrawals?${Ke}`);if(tt!=null&&tt.success&&tt.withdrawals){const $e=tt.withdrawals.map(he=>({...he,account:he.account??"未绑定微信号",status:he.status==="success"?"completed":he.status==="failed"?"rejected":he.status}));y($e),w((tt==null?void 0:tt.total)??$e.length)}else tt!=null&&tt.success||b(`获取提现记录失败: ${(tt==null?void 0:tt.error)||"未知错误"}`),y([])}catch(We){console.error(We),b("加载提现数据失败"),y([])}break}}te(We=>new Set(We).add(D))}catch(Ve){console.error(Ve)}finally{P(!1)}}}async function K(){b(null),te(D=>{const fe=new Set(D);return fe.delete(r),fe}),r==="overview"&&$(),await ne(r,!0)}async function A(D){if(confirm("确认审核通过并打款?"))try{const fe=await vt("/api/admin/withdrawals",{id:D,action:"approve"});if(!(fe!=null&&fe.success)){const ke=(fe==null?void 0:fe.message)||(fe==null?void 0:fe.error)||"操作失败";alert(ke);return}await K()}catch(fe){console.error(fe),alert("操作失败")}}async function F(D){const fe=prompt("请输入拒绝原因:");if(fe)try{const ke=await vt("/api/admin/withdrawals",{id:D,action:"reject",errorMessage:fe});if(!(ke!=null&&ke.success)){alert((ke==null?void 0:ke.error)||"操作失败");return}await K()}catch(ke){console.error(ke),alert("操作失败")}}async function O(){var D;if(!(!(le!=null&&le.orderSn)&&!(le!=null&&le.id))){ve(!0),b(null);try{const fe=await vt("/api/admin/orders/refund",{orderSn:le.orderSn||le.id,reason:re||void 0});fe!=null&&fe.success?(Q(null),G(""),await ne("orders",!0)):b((fe==null?void 0:fe.error)||"退款失败")}catch(fe){const ke=fe;b(((D=ke==null?void 0:ke.data)==null?void 0:D.error)||"退款失败,请检查网络后重试")}finally{ve(!1)}}}function Z(D){const fe={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"},ke={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return e.jsx(Le,{className:`${fe[D]||"bg-gray-500/20 text-gray-400"} border-0`,children:ke[D]||D})}const Y=Math.ceil(I/H)||1,de=l,q=m.filter(D=>{var ke,Ve,We,Ke;if(!N)return!0;const fe=N.toLowerCase();return((ke=D.refereeNickname)==null?void 0:ke.toLowerCase().includes(fe))||((Ve=D.refereePhone)==null?void 0:Ve.includes(fe))||((We=D.referrerName)==null?void 0:We.toLowerCase().includes(fe))||((Ke=D.referrerCode)==null?void 0:Ke.toLowerCase().includes(fe))}),ge=p.filter(D=>{var ke;if(!N)return!0;const fe=N.toLowerCase();return((ke=D.userName)==null?void 0:ke.toLowerCase().includes(fe))||D.account&&D.account.toLowerCase().includes(fe)});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:()=>b(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(X,{onClick:K,disabled:k,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${k?"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:Ra},{key:"orders",label:"订单管理",icon:co},{key:"bindings",label:"绑定管理",icon:Pr},{key:"withdrawals",label:"提现审核",icon:Aa},{key:"settings",label:"推广设置",icon:Bn}].map(D=>e.jsxs("button",{type:"button",onClick:()=>{a(D.key),j("all"),C("")},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))}),k?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx(Be,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{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(Er,{className:"w-6 h-6 text-blue-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{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(Kt,{className:"w-6 h-6 text-cyan-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{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(Ra,{className:"w-6 h-6 text-amber-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{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(Pr,{className:"w-6 h-6 text-green-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{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(Ff,{className:"w-6 h-6 text-purple-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{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(co,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),(((Se=c.todayClicksByPage)==null?void 0:Se.length)??0)>0&&e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Er,{className:"w-5 h-5 text-[#38bdac]"}),"每篇文章今日点击(按来源页/文章统计)"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"实际用户与实际文章的点击均计入;今日总点击与上表一致"})]}),e.jsx(we,{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,fe)=>fe.clicks-D.clicks).map((D,fe)=>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,"%"]})]},fe))})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Ne,{className:"bg-orange-500/10 border-orange-500/30",children:e.jsx(we,{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(Yd,{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(Ne,{className:"bg-blue-500/10 border-blue-500/30",children:e.jsx(we,{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(Aa,{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(X,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(oo,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),e.jsx(we,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Ra,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),e.jsxs(we,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Kt,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),e.jsx(we,{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(cn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(ie,{value:N,onChange:D=>C(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(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{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 fe,ke;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:[(fe=D.id)==null?void 0:fe.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 Ve=D.productType||D.type;return Ve==="fullbook"?`${D.bookName||"《底层逻辑》"} - 全本`:Ve==="match"?"匹配次数购买":`${D.bookName||"《底层逻辑》"} - ${D.sectionTitle||D.chapterTitle||`章节${D.productId||D.sectionId||""}`}`})()}),e.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const Ve=D.productType||D.type;return Ve==="fullbook"?"全书解锁":Ve==="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(Le,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):D.status==="completed"||D.status==="paid"?e.jsx(Le,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):D.status==="pending"||D.status==="created"?e.jsx(Le,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):e.jsx(Le,{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||((ke=D.referrerId)==null?void 0:ke.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(X,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{Q(D),G("")},children:[e.jsx(Jx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},D.id)})})]})}),r==="orders"&&e.jsx(Qs,{page:R,totalPages:Y,total:I,pageSize:H,onPageChange:L,onPageSizeChange:D=>{_(D),L(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(cn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(ie,{value:N,onChange:D=>C(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(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[q.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:q.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:Z(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(Qs,{page:R,totalPages:Y,total:I,pageSize:H,onPageChange:L,onPageSizeChange:D=>{_(D),L(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(cn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(ie,{value:N,onChange:D=>C(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(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[ge.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:ge.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(Le,{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:Z(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(X,{size:"sm",onClick:()=>A(D.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Ff,{className:"w-4 h-4 mr-1"}),"通过"]}),e.jsxs(X,{size:"sm",variant:"outline",onClick:()=>F(D.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[e.jsx(Kx,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},D.id))})]})}),r==="withdrawals"&&e.jsx(Qs,{page:R,totalPages:Y,total:I,pageSize:H,onPageChange:L,onPageSizeChange:D=>{_(D),L(1)}})]})})]})]}),e.jsx(Ct,{open:!!le,onOpenChange:D=>!D&&Q(null),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsx(Et,{className:"text-white",children:"订单退款"})}),le&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",le.orderSn||le.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof le.amount=="number"?le.amount.toFixed(2):parseFloat(String(le.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:re,onChange:D=>G(D.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Dt,{children:[e.jsx(X,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>Q(null),disabled:oe,children:"取消"}),e.jsx(X,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:O,disabled:oe,children:oe?"退款中...":"确认退款"})]})]})}),r==="settings"&&e.jsx("div",{className:"-mx-8 -mt-6",children:e.jsx(A0,{embedded:!0})})]})}function i4(){const[r,a]=h.useState([]),[l,i]=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),[k,P]=h.useState(10),[T,b]=h.useState(0),[N,C]=h.useState(null);async function E(){var _,I,w,V,te,le,Q;d(!0),f(null);try{const re=new URLSearchParams({status:p,page:String(g),pageSize:String(k)}),G=await ze(`/api/admin/withdrawals?${re}`);if(G!=null&&G.success){const oe=G.withdrawals||[];a(oe),b(G.total??((_=G.stats)==null?void 0:_.total)??oe.length),i({total:((I=G.stats)==null?void 0:I.total)??G.total??oe.length,pendingCount:((w=G.stats)==null?void 0:w.pendingCount)??0,pendingAmount:((V=G.stats)==null?void 0:V.pendingAmount)??0,successCount:((te=G.stats)==null?void 0:te.successCount)??0,successAmount:((le=G.stats)==null?void 0:le.successAmount)??0,failedCount:((Q=G.stats)==null?void 0:Q.failedCount)??0})}else f("加载提现记录失败")}catch(re){console.error("Load withdrawals error:",re),f("加载失败,请检查网络后重试")}finally{d(!1)}}h.useEffect(()=>{v(1)},[p]),h.useEffect(()=>{E()},[p,g,k]);const j=Math.ceil(T/k)||1;async function R(_){const I=r.find(w=>w.id===_);if(I!=null&&I.userCommissionInfo&&I.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${I.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。
|
||
|
||
确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;C(_);try{const w=await vt("/api/admin/withdrawals",{id:_,action:"approve"});w!=null&&w.success?E():alert("操作失败: "+((w==null?void 0:w.error)??""))}catch{alert("操作失败")}finally{C(null)}}async function L(_){const I=prompt("请输入拒绝原因(将返还用户余额):");if(I){C(_);try{const w=await vt("/api/admin/withdrawals",{id:_,action:"reject",errorMessage:I});w!=null&&w.success?E():alert("操作失败: "+((w==null?void 0:w.error)??""))}catch{alert("操作失败")}finally{C(null)}}}function H(_){switch(_){case"pending":return e.jsx(Le,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"pending_confirm":return e.jsx(Le,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待用户确认"});case"processing":return e.jsx(Le,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"已审批等待打款"});case"success":case"completed":return e.jsx(Le,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return e.jsx(Le,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return e.jsx(Le,{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(X,{variant:"outline",onClick:E,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),e.jsx(Ne,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:e.jsx(we,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(co,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{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(X,{variant:p===_?"default":"outline",size:"sm",onClick:()=>y(_),className:p===_?"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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:c?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{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(Aa,{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:[H(_.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(X,{size:"sm",onClick:()=>R(_.id),disabled:N===_.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(wo,{className:"w-4 h-4 mr-1"}),"批准"]}),e.jsxs(X,{size:"sm",variant:"outline",onClick:()=>L(_.id),disabled:N===_.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[e.jsx(ms,{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(Qs,{page:g,totalPages:j,total:T,pageSize:k,onPageChange:v,onPageSizeChange:_=>{P(_),v(1)}})]})})})]})}const o4=["top","right","bottom","left"],mn=Math.min,ws=Math.max,po=Math.round,ro=Math.floor,cr=r=>({x:r,y:r}),c4={left:"right",right:"left",bottom:"top",top:"bottom"},d4={start:"end",end:"start"};function au(r,a,l){return ws(r,mn(a,l))}function Rr(r,a){return typeof r=="function"?r(a):r}function Ir(r){return r.split("-")[0]}function Va(r){return r.split("-")[1]}function Ou(r){return r==="x"?"y":"x"}function Fu(r){return r==="y"?"height":"width"}const u4=new Set(["top","bottom"]);function or(r){return u4.has(Ir(r))?"y":"x"}function zu(r){return Ou(or(r))}function h4(r,a,l){l===void 0&&(l=!1);const i=Va(r),c=zu(r),d=Fu(c);let m=c==="x"?i===(l?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(m=go(m)),[m,go(m)]}function m4(r){const a=go(r);return[lu(r),a,lu(a)]}function lu(r){return r.replace(/start|end/g,a=>d4[a])}const cx=["left","right"],dx=["right","left"],f4=["top","bottom"],x4=["bottom","top"];function p4(r,a,l){switch(r){case"top":case"bottom":return l?a?dx:cx:a?cx:dx;case"left":case"right":return a?f4:x4;default:return[]}}function g4(r,a,l,i){const c=Va(r);let d=p4(Ir(r),l==="start",i);return c&&(d=d.map(m=>m+"-"+c),a&&(d=d.concat(d.map(lu)))),d}function go(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 D0(r){return typeof r!="number"?y4(r):{top:r,right:r,bottom:r,left:r}}function yo(r){const{x:a,y:l,width:i,height:c}=r;return{width:i,height:c,top:l,left:a,right:a+i,bottom:l+c,x:a,y:l}}function ux(r,a,l){let{reference:i,floating:c}=r;const d=or(a),m=zu(a),f=Fu(m),p=Ir(a),y=d==="y",g=i.x+i.width/2-c.width/2,v=i.y+i.height/2-c.height/2,k=i[f]/2-c[f]/2;let P;switch(p){case"top":P={x:g,y:i.y-c.height};break;case"bottom":P={x:g,y:i.y+i.height};break;case"right":P={x:i.x+i.width,y:v};break;case"left":P={x:i.x-c.width,y:v};break;default:P={x:i.x,y:i.y}}switch(Va(a)){case"start":P[m]-=k*(l&&y?-1:1);break;case"end":P[m]+=k*(l&&y?-1:1);break}return P}async function v4(r,a){var l;a===void 0&&(a={});const{x:i,y:c,platform:d,rects:m,elements:f,strategy:p}=r,{boundary:y="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:k=!1,padding:P=0}=Rr(a,r),T=D0(P),N=f[k?v==="floating"?"reference":"floating":v],C=yo(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(N)))==null||l?N:N.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(f.floating)),boundary:y,rootBoundary:g,strategy:p})),E=v==="floating"?{x:i,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},L=yo(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:E,offsetParent:j,strategy:p}):E);return{top:(C.top-L.top+T.top)/R.y,bottom:(L.bottom-C.bottom+T.bottom)/R.y,left:(C.left-L.left+T.left)/R.x,right:(L.right-C.right+T.right)/R.x}}const j4=async(r,a,l)=>{const{placement:i="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}=ux(y,i,p),k=i,P={},T=0;for(let N=0;N<f.length;N++){var b;const{name:C,fn:E}=f[N],{x:j,y:R,data:L,reset:H}=await E({x:g,y:v,initialPlacement:i,placement:k,strategy:c,middlewareData:P,rects:y,platform:{...m,detectOverflow:(b=m.detectOverflow)!=null?b:v4},elements:{reference:r,floating:a}});g=j??g,v=R??v,P={...P,[C]:{...P[C],...L}},H&&T<=50&&(T++,typeof H=="object"&&(H.placement&&(k=H.placement),H.rects&&(y=H.rects===!0?await m.getElementRects({reference:r,floating:a,strategy:c}):H.rects),{x:g,y:v}=ux(y,k,p)),N=-1)}return{x:g,y:v,placement:k,strategy:c,middlewareData:P}},b4=r=>({name:"arrow",options:r,async fn(a){const{x:l,y:i,placement:c,rects:d,platform:m,elements:f,middlewareData:p}=a,{element:y,padding:g=0}=Rr(r,a)||{};if(y==null)return{};const v=D0(g),k={x:l,y:i},P=zu(c),T=Fu(P),b=await m.getDimensions(y),N=P==="y",C=N?"top":"left",E=N?"bottom":"right",j=N?"clientHeight":"clientWidth",R=d.reference[T]+d.reference[P]-k[P]-d.floating[T],L=k[P]-d.reference[P],H=await(m.getOffsetParent==null?void 0:m.getOffsetParent(y));let _=H?H[j]:0;(!_||!await(m.isElement==null?void 0:m.isElement(H)))&&(_=f.floating[j]||d.floating[T]);const I=R/2-L/2,w=_/2-b[T]/2-1,V=mn(v[C],w),te=mn(v[E],w),le=V,Q=_-b[T]-te,re=_/2-b[T]/2+I,G=au(le,re,Q),oe=!p.arrow&&Va(c)!=null&&re!==G&&d.reference[T]/2-(re<le?V:te)-b[T]/2<0,ve=oe?re<le?re-le:re-Q:0;return{[P]:k[P]+ve,data:{[P]:G,centerOffset:re-G-ve,...oe&&{alignmentOffset:ve}},reset:oe}}}),N4=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(a){var l,i;const{placement:c,middlewareData:d,rects:m,initialPlacement:f,platform:p,elements:y}=a,{mainAxis:g=!0,crossAxis:v=!0,fallbackPlacements:k,fallbackStrategy:P="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:b=!0,...N}=Rr(r,a);if((l=d.arrow)!=null&&l.alignmentOffset)return{};const C=Ir(c),E=or(f),j=Ir(f)===f,R=await(p.isRTL==null?void 0:p.isRTL(y.floating)),L=k||(j||!b?[go(f)]:m4(f)),H=T!=="none";!k&&H&&L.push(...g4(f,b,T,R));const _=[f,...L],I=await p.detectOverflow(a,N),w=[];let V=((i=d.flip)==null?void 0:i.overflows)||[];if(g&&w.push(I[C]),v){const re=h4(c,m,R);w.push(I[re[0]],I[re[1]])}if(V=[...V,{placement:c,overflows:w}],!w.every(re=>re<=0)){var te,le;const re=(((te=d.flip)==null?void 0:te.index)||0)+1,G=_[re];if(G&&(!(v==="alignment"?E!==or(G):!1)||V.every($=>or($.placement)===E?$.overflows[0]>0:!0)))return{data:{index:re,overflows:V},reset:{placement:G}};let oe=(le=V.filter(ve=>ve.overflows[0]<=0).sort((ve,$)=>ve.overflows[1]-$.overflows[1])[0])==null?void 0:le.placement;if(!oe)switch(P){case"bestFit":{var Q;const ve=(Q=V.filter($=>{if(H){const ne=or($.placement);return ne===E||ne==="y"}return!0}).map($=>[$.placement,$.overflows.filter(ne=>ne>0).reduce((ne,K)=>ne+K,0)]).sort(($,ne)=>$[1]-ne[1])[0])==null?void 0:Q[0];ve&&(oe=ve);break}case"initialPlacement":oe=f;break}if(c!==oe)return{reset:{placement:oe}}}return{}}}};function hx(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function mx(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:i}=a,{strategy:c="referenceHidden",...d}=Rr(r,a);switch(c){case"referenceHidden":{const m=await i.detectOverflow(a,{...d,elementContext:"reference"}),f=hx(m,l.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:mx(f)}}}case"escaped":{const m=await i.detectOverflow(a,{...d,altBoundary:!0}),f=hx(m,l.floating);return{data:{escapedOffsets:f,escaped:mx(f)}}}default:return{}}}}},L0=new Set(["left","top"]);async function S4(r,a){const{placement:l,platform:i,elements:c}=r,d=await(i.isRTL==null?void 0:i.isRTL(c.floating)),m=Ir(l),f=Va(l),p=or(l)==="y",y=L0.has(m)?-1:1,g=d&&p?-1:1,v=Rr(a,r);let{mainAxis:k,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:k*y}:{x:k*y,y:P*g}}const C4=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,i;const{x:c,y:d,placement:m,middlewareData:f}=a,p=await S4(a,r);return m===((l=f.offset)==null?void 0:l.placement)&&(i=f.arrow)!=null&&i.alignmentOffset?{}:{x:c+p.x,y:d+p.y,data:{...p,placement:m}}}}},k4=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:i,placement:c,platform:d}=a,{mainAxis:m=!0,crossAxis:f=!1,limiter:p={fn:C=>{let{x:E,y:j}=C;return{x:E,y:j}}},...y}=Rr(r,a),g={x:l,y:i},v=await d.detectOverflow(a,y),k=or(Ir(c)),P=Ou(k);let T=g[P],b=g[k];if(m){const C=P==="y"?"top":"left",E=P==="y"?"bottom":"right",j=T+v[C],R=T-v[E];T=au(j,T,R)}if(f){const C=k==="y"?"top":"left",E=k==="y"?"bottom":"right",j=b+v[C],R=b-v[E];b=au(j,b,R)}const N=p.fn({...a,[P]:T,[k]:b});return{...N,data:{x:N.x-l,y:N.y-i,enabled:{[P]:m,[k]:f}}}}}},E4=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:i,placement:c,rects:d,middlewareData:m}=a,{offset:f=0,mainAxis:p=!0,crossAxis:y=!0}=Rr(r,a),g={x:l,y:i},v=or(c),k=Ou(v);let P=g[k],T=g[v];const b=Rr(f,a),N=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(p){const j=k==="y"?"height":"width",R=d.reference[k]-d.floating[j]+N.mainAxis,L=d.reference[k]+d.reference[j]-N.mainAxis;P<R?P=R:P>L&&(P=L)}if(y){var C,E;const j=k==="y"?"width":"height",R=L0.has(Ir(c)),L=d.reference[v]-d.floating[j]+(R&&((C=m.offset)==null?void 0:C[v])||0)+(R?0:N.crossAxis),H=d.reference[v]+d.reference[j]+(R?0:((E=m.offset)==null?void 0:E[v])||0)-(R?N.crossAxis:0);T<L?T=L:T>H&&(T=H)}return{[k]:P,[v]:T}}}},P4=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,i;const{placement:c,rects:d,platform:m,elements:f}=a,{apply:p=()=>{},...y}=Rr(r,a),g=await m.detectOverflow(a,y),v=Ir(c),k=Va(c),P=or(c)==="y",{width:T,height:b}=d.floating;let N,C;v==="top"||v==="bottom"?(N=v,C=k===(await(m.isRTL==null?void 0:m.isRTL(f.floating))?"start":"end")?"left":"right"):(C=v,N=k==="end"?"top":"bottom");const E=b-g.top-g.bottom,j=T-g.left-g.right,R=mn(b-g[N],E),L=mn(T-g[C],j),H=!a.middlewareData.shift;let _=R,I=L;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(I=j),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(_=E),H&&!k){const V=ws(g.left,0),te=ws(g.right,0),le=ws(g.top,0),Q=ws(g.bottom,0);P?I=T-2*(V!==0||te!==0?V+te:ws(g.left,g.right)):_=b-2*(le!==0||Q!==0?le+Q:ws(g.top,g.bottom))}await p({...a,availableWidth:I,availableHeight:_});const w=await m.getDimensions(f.floating);return T!==w.width||b!==w.height?{reset:{rects:!0}}:{}}}};function Io(){return typeof window<"u"}function Wa(r){return O0(r)?(r.nodeName||"").toLowerCase():"#document"}function Ss(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function ur(r){var a;return(a=(O0(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function O0(r){return Io()?r instanceof Node||r instanceof Ss(r).Node:!1}function Xs(r){return Io()?r instanceof Element||r instanceof Ss(r).Element:!1}function dr(r){return Io()?r instanceof HTMLElement||r instanceof Ss(r).HTMLElement:!1}function fx(r){return!Io()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Ss(r).ShadowRoot}const T4=new Set(["inline","contents"]);function Bl(r){const{overflow:a,overflowX:l,overflowY:i,display:c}=Js(r);return/auto|scroll|overlay|hidden|clip/.test(a+i+l)&&!T4.has(c)}const R4=new Set(["table","td","th"]);function I4(r){return R4.has(Wa(r))}const _4=[":popover-open",":modal"];function _o(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 $u(r){const a=Bu(),l=Xs(r)?Js(r):r;return M4.some(i=>l[i]?l[i]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||A4.some(i=>(l.willChange||"").includes(i))||D4.some(i=>(l.contain||"").includes(i))}function L4(r){let a=fn(r);for(;dr(a)&&!La(a);){if($u(a))return a;if(_o(a))return null;a=fn(a)}return null}function Bu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const O4=new Set(["html","body","#document"]);function La(r){return O4.has(Wa(r))}function Js(r){return Ss(r).getComputedStyle(r)}function Mo(r){return Xs(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function fn(r){if(Wa(r)==="html")return r;const a=r.assignedSlot||r.parentNode||fx(r)&&r.host||ur(r);return fx(a)?a.host:a}function F0(r){const a=fn(r);return La(a)?r.ownerDocument?r.ownerDocument.body:r.body:dr(a)&&Bl(a)?a:F0(a)}function Ll(r,a,l){var i;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=F0(r),d=c===((i=r.ownerDocument)==null?void 0:i.body),m=Ss(c);if(d){const f=iu(m);return a.concat(m,m.visualViewport||[],Bl(c)?c:[],f&&l?Ll(f):[])}return a.concat(c,Ll(c,[],l))}function iu(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function z0(r){const a=Js(r);let l=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const c=dr(r),d=c?r.offsetWidth:l,m=c?r.offsetHeight:i,f=po(l)!==d||po(i)!==m;return f&&(l=d,i=m),{width:l,height:i,$:f}}function Uu(r){return Xs(r)?r:r.contextElement}function Ma(r){const a=Uu(r);if(!dr(a))return cr(1);const l=a.getBoundingClientRect(),{width:i,height:c,$:d}=z0(a);let m=(d?po(l.width):l.width)/i,f=(d?po(l.height):l.height)/c;return(!m||!Number.isFinite(m))&&(m=1),(!f||!Number.isFinite(f))&&(f=1),{x:m,y:f}}const F4=cr(0);function $0(r){const a=Ss(r);return!Bu()||!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 Hn(r,a,l,i){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),d=Uu(r);let m=cr(1);a&&(i?Xs(i)&&(m=Ma(i)):m=Ma(r));const f=z4(d,l,i)?$0(d):cr(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 k=Ss(d),P=i&&Xs(i)?Ss(i):i;let T=k,b=iu(T);for(;b&&i&&P!==T;){const N=Ma(b),C=b.getBoundingClientRect(),E=Js(b),j=C.left+(b.clientLeft+parseFloat(E.paddingLeft))*N.x,R=C.top+(b.clientTop+parseFloat(E.paddingTop))*N.y;p*=N.x,y*=N.y,g*=N.x,v*=N.y,p+=j,y+=R,T=Ss(b),b=iu(T)}}return yo({width:g,height:v,x:p,y})}function Ao(r,a){const l=Mo(r).scrollLeft;return a?a.left+l:Hn(ur(r)).left+l}function B0(r,a){const l=r.getBoundingClientRect(),i=l.left+a.scrollLeft-Ao(r,l),c=l.top+a.scrollTop;return{x:i,y:c}}function $4(r){let{elements:a,rect:l,offsetParent:i,strategy:c}=r;const d=c==="fixed",m=ur(i),f=a?_o(a.floating):!1;if(i===m||f&&d)return l;let p={scrollLeft:0,scrollTop:0},y=cr(1);const g=cr(0),v=dr(i);if((v||!v&&!d)&&((Wa(i)!=="body"||Bl(m))&&(p=Mo(i)),dr(i))){const P=Hn(i);y=Ma(i),g.x=P.x+i.clientLeft,g.y=P.y+i.clientTop}const k=m&&!v&&!d?B0(m,p):cr(0);return{width:l.width*y.x,height:l.height*y.y,x:l.x*y.x-p.scrollLeft*y.x+g.x+k.x,y:l.y*y.y-p.scrollTop*y.y+g.y+k.y}}function B4(r){return Array.from(r.getClientRects())}function U4(r){const a=ur(r),l=Mo(r),i=r.ownerDocument.body,c=ws(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),d=ws(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let m=-l.scrollLeft+Ao(r);const f=-l.scrollTop;return Js(i).direction==="rtl"&&(m+=ws(a.clientWidth,i.clientWidth)-c),{width:c,height:d,x:m,y:f}}const xx=25;function V4(r,a){const l=Ss(r),i=ur(r),c=l.visualViewport;let d=i.clientWidth,m=i.clientHeight,f=0,p=0;if(c){d=c.width,m=c.height;const g=Bu();(!g||g&&a==="fixed")&&(f=c.offsetLeft,p=c.offsetTop)}const y=Ao(i);if(y<=0){const g=i.ownerDocument,v=g.body,k=getComputedStyle(v),P=g.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,T=Math.abs(i.clientWidth-v.clientWidth-P);T<=xx&&(d-=T)}else y<=xx&&(d+=y);return{width:d,height:m,x:f,y:p}}const W4=new Set(["absolute","fixed"]);function H4(r,a){const l=Hn(r,!0,a==="fixed"),i=l.top+r.clientTop,c=l.left+r.clientLeft,d=dr(r)?Ma(r):cr(1),m=r.clientWidth*d.x,f=r.clientHeight*d.y,p=c*d.x,y=i*d.y;return{width:m,height:f,x:p,y}}function px(r,a,l){let i;if(a==="viewport")i=V4(r,l);else if(a==="document")i=U4(ur(r));else if(Xs(a))i=H4(a,l);else{const c=$0(r);i={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return yo(i)}function U0(r,a){const l=fn(r);return l===a||!Xs(l)||La(l)?!1:Js(l).position==="fixed"||U0(l,a)}function K4(r,a){const l=a.get(r);if(l)return l;let i=Ll(r,[],!1).filter(f=>Xs(f)&&Wa(f)!=="body"),c=null;const d=Js(r).position==="fixed";let m=d?fn(r):r;for(;Xs(m)&&!La(m);){const f=Js(m),p=$u(m);!p&&f.position==="fixed"&&(c=null),(d?!p&&!c:!p&&f.position==="static"&&!!c&&W4.has(c.position)||Bl(m)&&!p&&U0(r,m))?i=i.filter(g=>g!==m):c=f,m=fn(m)}return a.set(r,i),i}function G4(r){let{element:a,boundary:l,rootBoundary:i,strategy:c}=r;const m=[...l==="clippingAncestors"?_o(a)?[]:K4(a,this._c):[].concat(l),i],f=m[0],p=m.reduce((y,g)=>{const v=px(a,g,c);return y.top=ws(v.top,y.top),y.right=mn(v.right,y.right),y.bottom=mn(v.bottom,y.bottom),y.left=ws(v.left,y.left),y},px(a,f,c));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function Y4(r){const{width:a,height:l}=z0(r);return{width:a,height:l}}function Q4(r,a,l){const i=dr(a),c=ur(a),d=l==="fixed",m=Hn(r,!0,d,a);let f={scrollLeft:0,scrollTop:0};const p=cr(0);function y(){p.x=Ao(c)}if(i||!i&&!d)if((Wa(a)!=="body"||Bl(c))&&(f=Mo(a)),i){const P=Hn(a,!0,d,a);p.x=P.x+a.clientLeft,p.y=P.y+a.clientTop}else c&&y();d&&!i&&c&&y();const g=c&&!i&&!d?B0(c,f):cr(0),v=m.left+f.scrollLeft-p.x-g.x,k=m.top+f.scrollTop-p.y-g.y;return{x:v,y:k,width:m.width,height:m.height}}function zd(r){return Js(r).position==="static"}function gx(r,a){if(!dr(r)||Js(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return ur(r)===l&&(l=l.ownerDocument.body),l}function V0(r,a){const l=Ss(r);if(_o(r))return l;if(!dr(r)){let c=fn(r);for(;c&&!La(c);){if(Xs(c)&&!zd(c))return c;c=fn(c)}return l}let i=gx(r,a);for(;i&&I4(i)&&zd(i);)i=gx(i,a);return i&&La(i)&&zd(i)&&!$u(i)?l:i||L4(r)||l}const q4=async function(r){const a=this.getOffsetParent||V0,l=this.getDimensions,i=await l(r.floating);return{reference:Q4(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function X4(r){return Js(r).direction==="rtl"}const J4={convertOffsetParentRelativeRectToViewportRelativeRect:$4,getDocumentElement:ur,getClippingRect:G4,getOffsetParent:V0,getElementRects:q4,getClientRects:B4,getDimensions:Y4,getScale:Ma,isElement:Xs,isRTL:X4};function W0(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,i;const c=ur(r);function d(){var f;clearTimeout(i),(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:k,height:P}=y;if(f||a(),!k||!P)return;const T=ro(v),b=ro(c.clientWidth-(g+k)),N=ro(c.clientHeight-(v+P)),C=ro(g),j={rootMargin:-T+"px "+-b+"px "+-N+"px "+-C+"px",threshold:ws(0,mn(1,p))||1};let R=!0;function L(H){const _=H[0].intersectionRatio;if(_!==p){if(!R)return m();_?m(!1,_):i=setTimeout(()=>{m(!1,1e-7)},1e3)}_===1&&!W0(y,r.getBoundingClientRect())&&m(),R=!1}try{l=new IntersectionObserver(L,{...j,root:c.ownerDocument})}catch{l=new IntersectionObserver(L,j)}l.observe(r)}return m(!0),d}function eS(r,a,l,i){i===void 0&&(i={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:p=!1}=i,y=Uu(r),g=c||d?[...y?Ll(y):[],...Ll(a)]:[];g.forEach(C=>{c&&C.addEventListener("scroll",l,{passive:!0}),d&&C.addEventListener("resize",l)});const v=y&&f?Z4(y,l):null;let k=-1,P=null;m&&(P=new ResizeObserver(C=>{let[E]=C;E&&E.target===y&&P&&(P.unobserve(a),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var j;(j=P)==null||j.observe(a)})),l()}),y&&!p&&P.observe(y),P.observe(a));let T,b=p?Hn(r):null;p&&N();function N(){const C=Hn(r);b&&!W0(b,C)&&l(),b=C,T=requestAnimationFrame(N)}return l(),()=>{var C;g.forEach(E=>{c&&E.removeEventListener("scroll",l),d&&E.removeEventListener("resize",l)}),v==null||v(),(C=P)==null||C.disconnect(),P=null,p&&cancelAnimationFrame(T)}}const tS=C4,sS=k4,rS=N4,nS=P4,aS=w4,yx=b4,lS=E4,iS=(r,a,l)=>{const i=new Map,c={platform:J4,...l},d={...c.platform,_c:i};return j4(r,a,{...c,platform:d})};var oS=typeof document<"u",cS=function(){},lo=oS?h.useLayoutEffect:cS;function vo(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,i,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(i=l;i--!==0;)if(!vo(r[i],a[i]))return!1;return!0}if(c=Object.keys(r),l=c.length,l!==Object.keys(a).length)return!1;for(i=l;i--!==0;)if(!{}.hasOwnProperty.call(a,c[i]))return!1;for(i=l;i--!==0;){const d=c[i];if(!(d==="_owner"&&r.$$typeof)&&!vo(r[d],a[d]))return!1}return!0}return r!==r&&a!==a}function H0(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function vx(r,a){const l=H0(r);return Math.round(a*l)/l}function $d(r){const a=h.useRef(r);return lo(()=>{a.current=r}),a}function dS(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:i=[],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}),[k,P]=h.useState(i);vo(k,i)||P(i);const[T,b]=h.useState(null),[N,C]=h.useState(null),E=h.useCallback($=>{$!==H.current&&(H.current=$,b($))},[]),j=h.useCallback($=>{$!==_.current&&(_.current=$,C($))},[]),R=d||T,L=m||N,H=h.useRef(null),_=h.useRef(null),I=h.useRef(g),w=p!=null,V=$d(p),te=$d(c),le=$d(y),Q=h.useCallback(()=>{if(!H.current||!_.current)return;const $={placement:a,strategy:l,middleware:k};te.current&&($.platform=te.current),iS(H.current,_.current,$).then(ne=>{const K={...ne,isPositioned:le.current!==!1};re.current&&!vo(I.current,K)&&(I.current=K,Ol.flushSync(()=>{v(K)}))})},[k,a,l,te,le]);lo(()=>{y===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,v($=>({...$,isPositioned:!1})))},[y]);const re=h.useRef(!1);lo(()=>(re.current=!0,()=>{re.current=!1}),[]),lo(()=>{if(R&&(H.current=R),L&&(_.current=L),R&&L){if(V.current)return V.current(R,L,Q);Q()}},[R,L,Q,V,w]);const G=h.useMemo(()=>({reference:H,floating:_,setReference:E,setFloating:j}),[E,j]),oe=h.useMemo(()=>({reference:R,floating:L}),[R,L]),ve=h.useMemo(()=>{const $={position:l,left:0,top:0};if(!oe.floating)return $;const ne=vx(oe.floating,g.x),K=vx(oe.floating,g.y);return f?{...$,transform:"translate("+ne+"px, "+K+"px)",...H0(oe.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:ne,top:K}},[l,f,oe.floating,g.x,g.y]);return h.useMemo(()=>({...g,update:Q,refs:G,elements:oe,floatingStyles:ve}),[g,Q,G,oe,ve])}const uS=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:i,padding:c}=typeof r=="function"?r(l):r;return i&&a(i)?i.current!=null?yx({element:i.current,padding:c}).fn(l):{}:i?yx({element:i,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",K0=h.forwardRef((r,a)=>{const{children:l,width:i=10,height:c=5,...d}=r;return e.jsx(Xe.svg,{...d,ref:a,width:i,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});K0.displayName=vS;var jS=K0,Vu="Popper",[G0,Y0]=yn(Vu),[bS,Q0]=G0(Vu),q0=r=>{const{__scopePopper:a,children:l}=r,[i,c]=h.useState(null);return e.jsx(bS,{scope:a,anchor:i,onAnchorChange:c,children:l})};q0.displayName=Vu;var X0="PopperAnchor",J0=h.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:i,...c}=r,d=Q0(X0,l),m=h.useRef(null),f=at(a,m),p=h.useRef(null);return h.useEffect(()=>{const y=p.current;p.current=(i==null?void 0:i.current)||m.current,y!==p.current&&d.onAnchorChange(p.current)}),i?null:e.jsx(Xe.div,{...c,ref:f})});J0.displayName=X0;var Wu="PopperContent",[NS,wS]=G0(Wu),Z0=h.forwardRef((r,a)=>{var q,ge,Se,D,fe,ke;const{__scopePopper:l,side:i="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:k=!1,updatePositionStrategy:P="optimized",onPlaced:T,...b}=r,N=Q0(Wu,l),[C,E]=h.useState(null),j=at(a,Ve=>E(Ve)),[R,L]=h.useState(null),H=Du(R),_=(H==null?void 0:H.width)??0,I=(H==null?void 0:H.height)??0,w=i+(d!=="center"?"-"+d:""),V=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},te=Array.isArray(y)?y:[y],le=te.length>0,Q={padding:V,boundary:te.filter(CS),altBoundary:le},{refs:re,floatingStyles:G,placement:oe,isPositioned:ve,middlewareData:$}=dS({strategy:"fixed",placement:w,whileElementsMounted:(...Ve)=>eS(...Ve,{animationFrame:P==="always"}),elements:{reference:N.anchor},middleware:[hS({mainAxis:c+I,alignmentAxis:m}),p&&mS({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?fS():void 0,...Q}),p&&xS({...Q}),pS({...Q,apply:({elements:Ve,rects:We,availableWidth:Ke,availableHeight:tt})=>{const{width:$e,height:he}=We.reference,xe=Ve.floating.style;xe.setProperty("--radix-popper-available-width",`${Ke}px`),xe.setProperty("--radix-popper-available-height",`${tt}px`),xe.setProperty("--radix-popper-anchor-width",`${$e}px`),xe.setProperty("--radix-popper-anchor-height",`${he}px`)}}),R&&yS({element:R,padding:f}),kS({arrowWidth:_,arrowHeight:I}),k&&gS({strategy:"referenceHidden",...Q})]}),[ne,K]=sg(oe),A=hn(T);Zt(()=>{ve&&(A==null||A())},[ve,A]);const F=(q=$.arrow)==null?void 0:q.x,O=(ge=$.arrow)==null?void 0:ge.y,Z=((Se=$.arrow)==null?void 0:Se.centerOffset)!==0,[Y,de]=h.useState();return Zt(()=>{C&&de(window.getComputedStyle(C).zIndex)},[C]),e.jsx("div",{ref:re.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:ve?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(D=$.transformOrigin)==null?void 0:D.x,(fe=$.transformOrigin)==null?void 0:fe.y].join(" "),...((ke=$.hide)==null?void 0:ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:e.jsx(NS,{scope:l,placedSide:ne,onArrowChange:L,arrowX:F,arrowY:O,shouldHideArrow:Z,children:e.jsx(Xe.div,{"data-side":ne,"data-align":K,...b,ref:j,style:{...b.style,animation:ve?void 0:"none"}})})})});Z0.displayName=Wu;var eg="PopperArrow",SS={top:"bottom",right:"left",bottom:"top",left:"right"},tg=h.forwardRef(function(a,l){const{__scopePopper:i,...c}=a,d=wS(eg,i),m=SS[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(jS,{...c,ref:l,style:{...c.style,display:"block"}})})});tg.displayName=eg;function CS(r){return r!==null}var kS=r=>({name:"transformOrigin",options:r,fn(a){var N,C,E;const{placement:l,rects:i,middlewareData:c}=a,m=((N=c.arrow)==null?void 0:N.centerOffset)!==0,f=m?0:r.arrowWidth,p=m?0:r.arrowHeight,[y,g]=sg(l),v={start:"0%",center:"50%",end:"100%"}[g],k=(((C=c.arrow)==null?void 0:C.x)??0)+f/2,P=(((E=c.arrow)==null?void 0:E.y)??0)+p/2;let T="",b="";return y==="bottom"?(T=m?v:`${k}px`,b=`${-p}px`):y==="top"?(T=m?v:`${k}px`,b=`${i.floating.height+p}px`):y==="right"?(T=`${-p}px`,b=m?v:`${P}px`):y==="left"&&(T=`${i.floating.width+p}px`,b=m?v:`${P}px`),{data:{x:T,y:b}}}});function sg(r){const[a,l="center"]=r.split("-");return[a,l]}var ES=q0,PS=J0,TS=Z0,RS=tg,rg=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(Xe.span,{...r,ref:a,style:{...rg,...r.style}}));_S.displayName=IS;var MS=[" ","Enter","ArrowUp","ArrowDown"],AS=[" ","Enter"],Kn="Select",[Do,Lo,DS]=_u(Kn),[Ha]=yn(Kn,[DS,Y0]),Oo=Y0(),[LS,vn]=Ha(Kn),[OS,FS]=Ha(Kn),ng=r=>{const{__scopeSelect:a,children:l,open:i,defaultOpen:c,onOpenChange:d,value:m,defaultValue:f,onValueChange:p,dir:y,name:g,autoComplete:v,disabled:k,required:P,form:T}=r,b=Oo(a),[N,C]=h.useState(null),[E,j]=h.useState(null),[R,L]=h.useState(!1),H=Eo(y),[_,I]=Vn({prop:i,defaultProp:c??!1,onChange:d,caller:Kn}),[w,V]=Vn({prop:m,defaultProp:f,onChange:p,caller:Kn}),te=h.useRef(null),le=N?T||!!N.closest("form"):!0,[Q,re]=h.useState(new Set),G=Array.from(Q).map(oe=>oe.props.value).join(";");return e.jsx(ES,{...b,children:e.jsxs(LS,{required:P,scope:a,trigger:N,onTriggerChange:C,valueNode:E,onValueNodeChange:j,valueNodeHasChildren:R,onValueNodeHasChildrenChange:L,contentId:dn(),value:w,onValueChange:V,open:_,onOpenChange:I,dir:H,triggerPointerDownPosRef:te,disabled:k,children:[e.jsx(Do.Provider,{scope:a,children:e.jsx(OS,{scope:r.__scopeSelect,onNativeOptionAdd:h.useCallback(oe=>{re(ve=>new Set(ve).add(oe))},[]),onNativeOptionRemove:h.useCallback(oe=>{re(ve=>{const $=new Set(ve);return $.delete(oe),$})},[]),children:l})}),le?e.jsxs(kg,{"aria-hidden":!0,required:P,tabIndex:-1,name:g,autoComplete:v,value:w,onChange:oe=>V(oe.target.value),disabled:k,form:T,children:[w===void 0?e.jsx("option",{value:""}):null,Array.from(Q)]},G):null]})})};ng.displayName=Kn;var ag="SelectTrigger",lg=h.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:i=!1,...c}=r,d=Oo(l),m=vn(ag,l),f=m.disabled||i,p=at(a,m.onTriggerChange),y=Lo(l),g=h.useRef("touch"),[v,k,P]=Pg(b=>{const N=y().filter(j=>!j.disabled),C=N.find(j=>j.value===m.value),E=Tg(N,b,C);E!==void 0&&m.onValueChange(E.value)}),T=b=>{f||(m.onOpenChange(!0),P()),b&&(m.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return e.jsx(PS,{asChild:!0,...d,children:e.jsx(Xe.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":Eg(m.value)?"":void 0,...c,ref:p,onClick:Ge(c.onClick,b=>{b.currentTarget.focus(),g.current!=="mouse"&&T(b)}),onPointerDown:Ge(c.onPointerDown,b=>{g.current=b.pointerType;const N=b.target;N.hasPointerCapture(b.pointerId)&&N.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(T(b),b.preventDefault())}),onKeyDown:Ge(c.onKeyDown,b=>{const N=v.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&k(b.key),!(N&&b.key===" ")&&MS.includes(b.key)&&(T(),b.preventDefault())})})})});lg.displayName=ag;var ig="SelectValue",og=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,children:d,placeholder:m="",...f}=r,p=vn(ig,l),{onValueNodeHasChildrenChange:y}=p,g=d!==void 0,v=at(a,p.onValueNodeChange);return Zt(()=>{y(g)},[y,g]),e.jsx(Xe.span,{...f,ref:v,style:{pointerEvents:"none"},children:Eg(p.value)?e.jsx(e.Fragment,{children:m}):d})});og.displayName=ig;var zS="SelectIcon",cg=h.forwardRef((r,a)=>{const{__scopeSelect:l,children:i,...c}=r;return e.jsx(Xe.span,{"aria-hidden":!0,...c,ref:a,children:i||"▼"})});cg.displayName=zS;var $S="SelectPortal",dg=r=>e.jsx(ku,{asChild:!0,...r});dg.displayName=$S;var Gn="SelectContent",ug=h.forwardRef((r,a)=>{const l=vn(Gn,r.__scopeSelect),[i,c]=h.useState();if(Zt(()=>{c(new DocumentFragment)},[]),!l.open){const d=i;return d?Ol.createPortal(e.jsx(hg,{scope:r.__scopeSelect,children:e.jsx(Do.Slot,{scope:r.__scopeSelect,children:e.jsx("div",{children:r.children})})}),d):null}return e.jsx(mg,{...r,ref:a})});ug.displayName=Gn;var Ys=10,[hg,jn]=Ha(Gn),BS="SelectContentImpl",US=Dl("SelectContent.RemoveScroll"),mg=h.forwardRef((r,a)=>{const{__scopeSelect:l,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:m,side:f,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:k,collisionPadding:P,sticky:T,hideWhenDetached:b,avoidCollisions:N,...C}=r,E=vn(Gn,l),[j,R]=h.useState(null),[L,H]=h.useState(null),_=at(a,q=>R(q)),[I,w]=h.useState(null),[V,te]=h.useState(null),le=Lo(l),[Q,re]=h.useState(!1),G=h.useRef(!1);h.useEffect(()=>{if(j)return Tp(j)},[j]),jp();const oe=h.useCallback(q=>{const[ge,...Se]=le().map(ke=>ke.ref.current),[D]=Se.slice(-1),fe=document.activeElement;for(const ke of q)if(ke===fe||(ke==null||ke.scrollIntoView({block:"nearest"}),ke===ge&&L&&(L.scrollTop=0),ke===D&&L&&(L.scrollTop=L.scrollHeight),ke==null||ke.focus(),document.activeElement!==fe))return},[le,L]),ve=h.useCallback(()=>oe([I,j]),[oe,I,j]);h.useEffect(()=>{Q&&ve()},[Q,ve]);const{onOpenChange:$,triggerPointerDownPosRef:ne}=E;h.useEffect(()=>{if(j){let q={x:0,y:0};const ge=D=>{var fe,ke;q={x:Math.abs(Math.round(D.pageX)-(((fe=ne.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(D.pageY)-(((ke=ne.current)==null?void 0:ke.y)??0))}},Se=D=>{q.x<=10&&q.y<=10?D.preventDefault():j.contains(D.target)||$(!1),document.removeEventListener("pointermove",ge),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",Se,{capture:!0})}}},[j,$,ne]),h.useEffect(()=>{const q=()=>$(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[$]);const[K,A]=Pg(q=>{const ge=le().filter(fe=>!fe.disabled),Se=ge.find(fe=>fe.ref.current===document.activeElement),D=Tg(ge,q,Se);D&&setTimeout(()=>D.ref.current.focus())}),F=h.useCallback((q,ge,Se)=>{const D=!G.current&&!Se;(E.value!==void 0&&E.value===ge||D)&&(w(q),D&&(G.current=!0))},[E.value]),O=h.useCallback(()=>j==null?void 0:j.focus(),[j]),Z=h.useCallback((q,ge,Se)=>{const D=!G.current&&!Se;(E.value!==void 0&&E.value===ge||D)&&te(q)},[E.value]),Y=i==="popper"?ou:fg,de=Y===ou?{side:f,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:k,collisionPadding:P,sticky:T,hideWhenDetached:b,avoidCollisions:N}:{};return e.jsx(hg,{scope:l,content:j,viewport:L,onViewportChange:H,itemRefCallback:F,selectedItem:I,onItemLeave:O,itemTextRefCallback:Z,focusSelectedItem:ve,selectedItemText:V,position:i,isPositioned:Q,searchRef:K,children:e.jsx(Eu,{as:US,allowPinchZoom:!0,children:e.jsx(Cu,{asChild:!0,trapped:E.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:Ge(c,q=>{var ge;(ge=E.trigger)==null||ge.focus({preventScroll:!0}),q.preventDefault()}),children:e.jsx(Su,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:e.jsx(Y,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:q=>q.preventDefault(),...C,...de,onPlaced:()=>re(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:Ge(C.onKeyDown,q=>{const ge=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!ge&&q.key.length===1&&A(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let D=le().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(q.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const fe=q.target,ke=D.indexOf(fe);D=D.slice(ke+1)}setTimeout(()=>oe(D)),q.preventDefault()}})})})})})})});mg.displayName=BS;var VS="SelectItemAlignedPosition",fg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:i,...c}=r,d=vn(Gn,l),m=jn(Gn,l),[f,p]=h.useState(null),[y,g]=h.useState(null),v=at(a,_=>g(_)),k=Lo(l),P=h.useRef(!1),T=h.useRef(!0),{viewport:b,selectedItem:N,selectedItemText:C,focusSelectedItem:E}=m,j=h.useCallback(()=>{if(d.trigger&&d.valueNode&&f&&y&&b&&N&&C){const _=d.trigger.getBoundingClientRect(),I=y.getBoundingClientRect(),w=d.valueNode.getBoundingClientRect(),V=C.getBoundingClientRect();if(d.dir!=="rtl"){const fe=V.left-I.left,ke=w.left-fe,Ve=_.left-ke,We=_.width+Ve,Ke=Math.max(We,I.width),tt=window.innerWidth-Ys,$e=xo(ke,[Ys,Math.max(Ys,tt-Ke)]);f.style.minWidth=We+"px",f.style.left=$e+"px"}else{const fe=I.right-V.right,ke=window.innerWidth-w.right-fe,Ve=window.innerWidth-_.right-ke,We=_.width+Ve,Ke=Math.max(We,I.width),tt=window.innerWidth-Ys,$e=xo(ke,[Ys,Math.max(Ys,tt-Ke)]);f.style.minWidth=We+"px",f.style.right=$e+"px"}const te=k(),le=window.innerHeight-Ys*2,Q=b.scrollHeight,re=window.getComputedStyle(y),G=parseInt(re.borderTopWidth,10),oe=parseInt(re.paddingTop,10),ve=parseInt(re.borderBottomWidth,10),$=parseInt(re.paddingBottom,10),ne=G+oe+Q+$+ve,K=Math.min(N.offsetHeight*5,ne),A=window.getComputedStyle(b),F=parseInt(A.paddingTop,10),O=parseInt(A.paddingBottom,10),Z=_.top+_.height/2-Ys,Y=le-Z,de=N.offsetHeight/2,q=N.offsetTop+de,ge=G+oe+q,Se=ne-ge;if(ge<=Z){const fe=te.length>0&&N===te[te.length-1].ref.current;f.style.bottom="0px";const ke=y.clientHeight-b.offsetTop-b.offsetHeight,Ve=Math.max(Y,de+(fe?O:0)+ke+ve),We=ge+Ve;f.style.height=We+"px"}else{const fe=te.length>0&&N===te[0].ref.current;f.style.top="0px";const Ve=Math.max(Z,G+b.offsetTop+(fe?F:0)+de)+Se;f.style.height=Ve+"px",b.scrollTop=ge-Z+b.offsetTop}f.style.margin=`${Ys}px 0`,f.style.minHeight=K+"px",f.style.maxHeight=le+"px",i==null||i(),requestAnimationFrame(()=>P.current=!0)}},[k,d.trigger,d.valueNode,f,y,b,N,C,d.dir,i]);Zt(()=>j(),[j]);const[R,L]=h.useState();Zt(()=>{y&&L(window.getComputedStyle(y).zIndex)},[y]);const H=h.useCallback(_=>{_&&T.current===!0&&(j(),E==null||E(),T.current=!1)},[j,E]);return e.jsx(HS,{scope:l,contentWrapper:f,shouldExpandOnScrollRef:P,onScrollButtonChange:H,children:e.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:e.jsx(Xe.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});fg.displayName=VS;var WS="SelectPopperPosition",ou=h.forwardRef((r,a)=>{const{__scopeSelect:l,align:i="start",collisionPadding:c=Ys,...d}=r,m=Oo(l);return e.jsx(TS,{...m,...d,ref:a,align:i,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)"}})});ou.displayName=WS;var[HS,Hu]=Ha(Gn,{}),cu="SelectViewport",xg=h.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:i,...c}=r,d=jn(cu,l),m=Hu(cu,l),f=at(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:i}),e.jsx(Do.Slot,{scope:l,children:e.jsx(Xe.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Ge(c.onScroll,y=>{const g=y.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:k}=m;if(k!=null&&k.current&&v){const P=Math.abs(p.current-g.scrollTop);if(P>0){const T=window.innerHeight-Ys*2,b=parseFloat(v.style.minHeight),N=parseFloat(v.style.height),C=Math.max(b,N);if(C<T){const E=C+P,j=Math.min(T,E),R=E-j;v.style.height=j+"px",v.style.bottom==="0px"&&(g.scrollTop=R>0?R:0,v.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})});xg.displayName=cu;var pg="SelectGroup",[KS,GS]=Ha(pg),YS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=dn();return e.jsx(KS,{scope:l,id:c,children:e.jsx(Xe.div,{role:"group","aria-labelledby":c,...i,ref:a})})});YS.displayName=pg;var gg="SelectLabel",QS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=GS(gg,l);return e.jsx(Xe.div,{id:c.id,...i,ref:a})});QS.displayName=gg;var jo="SelectItem",[qS,yg]=Ha(jo),vg=h.forwardRef((r,a)=>{const{__scopeSelect:l,value:i,disabled:c=!1,textValue:d,...m}=r,f=vn(jo,l),p=jn(jo,l),y=f.value===i,[g,v]=h.useState(d??""),[k,P]=h.useState(!1),T=at(a,E=>{var j;return(j=p.itemRefCallback)==null?void 0:j.call(p,E,i,c)}),b=dn(),N=h.useRef("touch"),C=()=>{c||(f.onValueChange(i),f.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> 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:i,disabled:c,textId:b,isSelected:y,onItemTextChange:h.useCallback(E=>{v(j=>j||((E==null?void 0:E.textContent)??"").trim())},[]),children:e.jsx(Do.ItemSlot,{scope:l,value:i,disabled:c,textValue:g,children:e.jsx(Xe.div,{role:"option","aria-labelledby":b,"data-highlighted":k?"":void 0,"aria-selected":y&&k,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...m,ref:T,onFocus:Ge(m.onFocus,()=>P(!0)),onBlur:Ge(m.onBlur,()=>P(!1)),onClick:Ge(m.onClick,()=>{N.current!=="mouse"&&C()}),onPointerUp:Ge(m.onPointerUp,()=>{N.current==="mouse"&&C()}),onPointerDown:Ge(m.onPointerDown,E=>{N.current=E.pointerType}),onPointerMove:Ge(m.onPointerMove,E=>{var j;N.current=E.pointerType,c?(j=p.onItemLeave)==null||j.call(p):N.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ge(m.onPointerLeave,E=>{var j;E.currentTarget===document.activeElement&&((j=p.onItemLeave)==null||j.call(p))}),onKeyDown:Ge(m.onKeyDown,E=>{var R;((R=p.searchRef)==null?void 0:R.current)!==""&&E.key===" "||(AS.includes(E.key)&&C(),E.key===" "&&E.preventDefault())})})})})});vg.displayName=jo;var Tl="SelectItemText",jg=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,...d}=r,m=vn(Tl,l),f=jn(Tl,l),p=yg(Tl,l),y=FS(Tl,l),[g,v]=h.useState(null),k=at(a,C=>v(C),p.onItemTextChange,C=>{var E;return(E=f.itemTextRefCallback)==null?void 0:E.call(f,C,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:b,onNativeOptionRemove:N}=y;return Zt(()=>(b(T),()=>N(T)),[b,N,T]),e.jsxs(e.Fragment,{children:[e.jsx(Xe.span,{id:p.textId,...d,ref:k}),p.isSelected&&m.valueNode&&!m.valueNodeHasChildren?Ol.createPortal(d.children,m.valueNode):null]})});jg.displayName=Tl;var bg="SelectItemIndicator",Ng=h.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return yg(bg,l).isSelected?e.jsx(Xe.span,{"aria-hidden":!0,...i,ref:a}):null});Ng.displayName=bg;var du="SelectScrollUpButton",wg=h.forwardRef((r,a)=>{const l=jn(du,r.__scopeSelect),i=Hu(du,r.__scopeSelect),[c,d]=h.useState(!1),m=at(a,i.onScrollButtonChange);return Zt(()=>{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(Cg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:p}=l;f&&p&&(f.scrollTop=f.scrollTop-p.offsetHeight)}}):null});wg.displayName=du;var uu="SelectScrollDownButton",Sg=h.forwardRef((r,a)=>{const l=jn(uu,r.__scopeSelect),i=Hu(uu,r.__scopeSelect),[c,d]=h.useState(!1),m=at(a,i.onScrollButtonChange);return Zt(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)<y;d(g)};const p=l.viewport;return f(),p.addEventListener("scroll",f),()=>p.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(Cg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:p}=l;f&&p&&(f.scrollTop=f.scrollTop+p.offsetHeight)}}):null});Sg.displayName=uu;var Cg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:i,...c}=r,d=jn("SelectScrollButton",l),m=h.useRef(null),f=Lo(l),p=h.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return h.useEffect(()=>()=>p(),[p]),Zt(()=>{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(Xe.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Ge(c.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(i,50))}),onPointerMove:Ge(c.onPointerMove,()=>{var y;(y=d.onItemLeave)==null||y.call(d),m.current===null&&(m.current=window.setInterval(i,50))}),onPointerLeave:Ge(c.onPointerLeave,()=>{p()})})}),XS="SelectSeparator",JS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return e.jsx(Xe.div,{"aria-hidden":!0,...i,ref:a})});JS.displayName=XS;var hu="SelectArrow",ZS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=Oo(l),d=vn(hu,l),m=jn(hu,l);return d.open&&m.position==="popper"?e.jsx(RS,{...c,...i,ref:a}):null});ZS.displayName=hu;var e3="SelectBubbleInput",kg=h.forwardRef(({__scopeSelect:r,value:a,...l},i)=>{const c=h.useRef(null),d=at(i,c),m=Au(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(Xe.select,{...l,style:{...rg,...l.style},ref:d,defaultValue:a})});kg.displayName=e3;function Eg(r){return r===""||r===void 0}function Pg(r){const a=hn(r),l=h.useRef(""),i=h.useRef(0),c=h.useCallback(m=>{const f=l.current+m;a(f),(function p(y){l.current=y,window.clearTimeout(i.current),y!==""&&(i.current=window.setTimeout(()=>p(""),1e3))})(f)},[a]),d=h.useCallback(()=>{l.current="",window.clearTimeout(i.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(i.current),[]),[l,c,d]}function Tg(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=t3(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 t3(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var s3=ng,Rg=lg,r3=og,n3=cg,a3=dg,Ig=ug,l3=xg,_g=vg,i3=jg,o3=Ng,c3=wg,d3=Sg;const El=s3,Pl=r3,Ea=h.forwardRef(({className:r,children:a,...l},i)=>e.jsxs(Rg,{ref:i,className:lt("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(n3,{asChild:!0,children:e.jsx(Ml,{className:"h-4 w-4 opacity-50"})})]}));Ea.displayName=Rg.displayName;const Pa=h.forwardRef(({className:r,children:a,position:l="popper",...i},c)=>e.jsx(a3,{children:e.jsxs(Ig,{ref:c,className:lt("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,...i,children:[e.jsx(c3,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Wx,{className:"h-4 w-4"})}),e.jsx(l3,{className:"p-1",children:a}),e.jsx(d3,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Ml,{className:"h-4 w-4"})})]})}));Pa.displayName=Ig.displayName;const lr=h.forwardRef(({className:r,children:a,...l},i)=>e.jsxs(_g,{ref:i,className:lt("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(o3,{children:e.jsx(wo,{className:"h-4 w-4"})})}),e.jsx(i3,{children:a})]}));lr.displayName=_g.displayName;const u3=["一","二","三","四","五","六","七","八","九","十"];function Bd(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 h3({parts:r,expandedParts:a,onTogglePart:l,onReorder:i,onReadSection:c,onDeleteSection:d,onAddSectionInPart:m,onAddChapterInPart:f,onDeleteChapter:p,onEditPart:y,onDeletePart:g,onEditChapter:v,selectedSectionIds:k=[],onToggleSectionSelect:P,onShowSectionOrders:T}){const[b,N]=h.useState(null),[C,E]=h.useState(null),j=(w,V)=>(b==null?void 0:b.type)===w&&(b==null?void 0:b.id)===V,R=(w,V)=>(C==null?void 0:C.type)===w&&(C==null?void 0:C.id)===V,L=h.useCallback(()=>{const w=[];for(const V of r)for(const te of V.chapters)for(const le of te.sections)w.push({id:le.id,partId:V.id,partTitle:V.title,chapterId:te.id,chapterTitle:te.title});return w},[r]),H=h.useCallback(async(w,V,te,le)=>{var ve;w.preventDefault(),w.stopPropagation();const Q=w.dataTransfer.getData("text/plain"),re=Bd(Q);if(!re||re.type===V&&re.id===te)return;const G=L(),oe=new Map(G.map($=>[$.id,$]));if(re.type==="part"&&V==="part"){const $=r.map(O=>O.id),ne=$.indexOf(re.id),K=$.indexOf(te);if(ne===-1||K===-1)return;const A=[...$];A.splice(ne,1),A.splice(ne<K?K-1:K,0,re.id);const F=[];for(const O of A){const Z=r.find(Y=>Y.id===O);if(Z)for(const Y of Z.chapters)for(const de of Y.sections){const q=oe.get(de.id);q&&F.push(q)}}await i(F);return}if(re.type==="chapter"&&(V==="chapter"||V==="section"||V==="part")){const $=r.find(q=>q.chapters.some(ge=>ge.id===re.id)),ne=$==null?void 0:$.chapters.find(q=>q.id===re.id);if(!$||!ne)return;let K,A,F=null;if(V==="section"){const q=oe.get(te);if(!q)return;K=q.partId,A=q.partTitle,F=te}else if(V==="chapter"){const q=r.find(D=>D.chapters.some(fe=>fe.id===te)),ge=q==null?void 0:q.chapters.find(D=>D.id===te);if(!q||!ge)return;K=q.id,A=q.title;const Se=G.filter(D=>D.chapterId===te).pop();F=(Se==null?void 0:Se.id)??null}else{const q=r.find(Se=>Se.id===te);if(!q||!q.chapters[0])return;K=q.id,A=q.title;const ge=G.filter(Se=>Se.partId===q.id&&Se.chapterId===q.chapters[0].id);F=((ve=ge[ge.length-1])==null?void 0:ve.id)??null}const O=ne.sections.map(q=>q.id),Z=G.filter(q=>!O.includes(q.id));let Y=Z.length;if(F){const q=Z.findIndex(ge=>ge.id===F);q>=0&&(Y=q+1)}const de=O.map(q=>({...oe.get(q),partId:K,partTitle:A,chapterId:ne.id,chapterTitle:ne.title}));await i([...Z.slice(0,Y),...de,...Z.slice(Y)]);return}if(re.type==="section"&&(V==="section"||V==="chapter"||V==="part")){if(!le)return;const{partId:$,partTitle:ne,chapterId:K,chapterTitle:A}=le;let F;if(V==="section")F=G.findIndex(ge=>ge.id===te);else if(V==="chapter"){const ge=G.filter(Se=>Se.chapterId===te).pop();F=ge?G.findIndex(Se=>Se.id===ge.id)+1:G.length}else{const ge=r.find(fe=>fe.id===te);if(!(ge!=null&&ge.chapters[0]))return;const Se=G.filter(fe=>fe.partId===ge.id&&fe.chapterId===ge.chapters[0].id),D=Se[Se.length-1];F=D?G.findIndex(fe=>fe.id===D.id)+1:0}const O=G.findIndex(ge=>ge.id===re.id);if(O===-1)return;const Z=G.filter(ge=>ge.id!==re.id),Y=O<F?F-1:F,q={...G[O],partId:$,partTitle:ne,chapterId:K,chapterTitle:A};Z.splice(Y,0,q),await i(Z)}},[r,L,i]),_=(w,V,te)=>({onDragEnter:le=>{le.preventDefault(),le.stopPropagation(),le.dataTransfer.dropEffect="move",E({type:w,id:V})},onDragOver:le=>{le.preventDefault(),le.stopPropagation(),le.dataTransfer.dropEffect="move",E({type:w,id:V})},onDragLeave:()=>E(null),onDrop:le=>{E(null);const Q=Bd(le.dataTransfer.getData("text/plain"));if(Q&&!(w==="section"&&Q.type==="section"&&Q.id===V))if(w==="part")if(Q.type==="part")H(le,"part",V);else{const re=r.find(oe=>oe.id===V);(re==null?void 0:re.chapters[0])&&te&&H(le,"part",V,te)}else w==="chapter"&&te?(Q.type==="section"||Q.type==="chapter")&&H(le,"chapter",V,te):w==="section"&&te&&H(le,"section",V,te)}}),I=w=>u3[w]??String(w+1);return e.jsx("div",{className:"space-y-3",children:r.map((w,V)=>{var ne,K,A,F;const te=w.title==="序言"||w.title.includes("序言"),le=w.title==="尾声"||w.title.includes("尾声"),Q=w.title==="附录"||w.title.includes("附录"),re=R("part",w.id),G=a.includes(w.id),oe=w.chapters.length,ve=w.chapters.reduce((O,Z)=>O+Z.sections.length,0);if(te&&w.chapters.length===1&&w.chapters[0].sections.length===1){const O=w.chapters[0].sections[0],Z=R("section",O.id),Y={partId:w.id,partTitle:w.title,chapterId:w.chapters[0].id,chapterTitle:w.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+O.id),de.dataTransfer.effectAllowed="move",N({type:"section",id:O.id})},onDragEnd:()=>{N(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] ${Z?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",O.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,..._("section",O.id,Y),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(Sr,{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:k.includes(O.id),onChange:()=>P(O.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(qs,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[w.chapters[0].title," | ",O.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[O.price===0||O.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:["¥",O.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",O.clickCount??0," · 付款 ",O.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(O.hotScore??0).toFixed(1)," · 第",O.hotRank&&O.hotRank>0?O.hotRank:"-","名"]}),T&&e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(O),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(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(O),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]}),e.jsx(sn,{className:"w-4 h-4 text-gray-500"})]})]},w.id)}if(w.title==="2026每日派对干货"||w.title.includes("2026每日派对干货")){const O=R("part",w.id);return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-all duration-200 ${O?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50 bg-[#1C1C1E]"}`,..._("part",w.id,{partId:w.id,partTitle:w.title,chapterId:((ne=w.chapters[0])==null?void 0:ne.id)??"",chapterTitle:((K=w.chapters[0])==null?void 0:K.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:Z=>{Z.stopPropagation(),Z.dataTransfer.setData("text/plain","part:"+w.id),Z.dataTransfer.effectAllowed="move",N({type:"part",id:w.id})},onDragEnd:()=>{N(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",w.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/50"}`,onClick:()=>l(w.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(Sr,{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:w.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:Z=>Z.stopPropagation(),onClick:Z=>Z.stopPropagation(),children:[m&&e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(w),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(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(w),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[oe,"章"]}),G?e.jsx(Ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(sn,{className:"w-5 h-5 text-gray-500"})]})]}),G&&w.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:w.chapters.map(Z=>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:Z.title}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:Y=>Y.stopPropagation(),children:[v&&e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>v(w,Z),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(X,{variant:"ghost",size:"sm",onClick:()=>f(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),p&&e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>p(w,Z),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:Z.sections.map(Y=>{const de=R("section",Y.id);return e.jsxs("div",{draggable:!0,onDragStart:q=>{q.stopPropagation(),q.dataTransfer.setData("text/plain","section:"+Y.id),q.dataTransfer.effectAllowed="move",N({type:"section",id:Y.id})},onDragEnd:()=>{N(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",Y.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,..._("section",Y.id,{partId:w.id,partTitle:w.title,chapterId:Z.id,chapterTitle:Z.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Sr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:q=>q.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:k.includes(Y.id),onChange:()=>P(Y.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:[Y.id," ",Y.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",Y.clickCount??0," · 付款 ",Y.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(Y.hotScore??0).toFixed(1)," · 第",Y.hotRank&&Y.hotRank>0?Y.hotRank:"-","名"]}),T&&e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>T(Y),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(Y),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(Y),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(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(Y),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]},Y.id)})})]},Z.id))})]},w.id)}if(Q)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:w.chapters.map((O,Z)=>O.sections.length>0?O.sections.map(Y=>{const de=R("section",Y.id);return e.jsxs("div",{draggable:!0,onDragStart:q=>{q.stopPropagation(),q.dataTransfer.setData("text/plain","section:"+Y.id),q.dataTransfer.effectAllowed="move",N({type:"section",id:Y.id})},onDragEnd:()=>{N(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",Y.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,..._("section",Y.id,{partId:w.id,partTitle:w.title,chapterId:O.id,chapterTitle:O.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Sr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:q=>q.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:k.includes(Y.id),onChange:()=>P(Y.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:["附录",Z+1," | ",O.title," | ",Y.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",Y.clickCount??0," · 付款 ",Y.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(Y.hotScore??0).toFixed(1)," · 第",Y.hotRank&&Y.hotRank>0?Y.hotRank:"-","名"]}),T&&e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>T(Y),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(X,{variant:"ghost",size:"sm",onClick:()=>c(Y),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>c(Y),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(X,{variant:"ghost",size:"sm",onClick:()=>d(Y),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(sn,{className:"w-4 h-4 text-gray-500 shrink-0"})]},Y.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:["附录",Z+1," | ",O.title,"(空)"]}),e.jsx(sn,{className:"w-4 h-4 text-gray-500 shrink-0"})]},O.id))})]},w.id);if(le&&w.chapters.length===1&&w.chapters[0].sections.length===1){const O=w.chapters[0].sections[0],Z=R("section",O.id),Y={partId:w.id,partTitle:w.title,chapterId:w.chapters[0].id,chapterTitle:w.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+O.id),de.dataTransfer.effectAllowed="move",N({type:"section",id:O.id})},onDragEnd:()=>{N(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] ${Z?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",O.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,..._("section",O.id,Y),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(Sr,{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:k.includes(O.id),onChange:()=>P(O.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(qs,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[w.chapters[0].title," | ",O.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[O.price===0||O.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:["¥",O.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",O.clickCount??0," · 付款 ",O.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(O.hotScore??0).toFixed(1)," · 第",O.hotRank&&O.hotRank>0?O.hotRank:"-","名"]}),T&&e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(O),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(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(O),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]}),e.jsx(sn,{className:"w-4 h-4 text-gray-500"})]})]},w.id)}return le?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:w.chapters.map(O=>O.sections.map(Z=>{const Y=R("section",Z.id);return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+Z.id),de.dataTransfer.effectAllowed="move",N({type:"section",id:Z.id})},onDragEnd:()=>{N(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 ${Y?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",Z.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,..._("section",Z.id,{partId:w.id,partTitle:w.title,chapterId:O.id,chapterTitle:O.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Sr,{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:k.includes(Z.id),onChange:()=>P(Z.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:[O.title," | ",Z.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",Z.clickCount??0," · 付款 ",Z.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(Z.hotScore??0).toFixed(1)," · 第",Z.hotRank&&Z.hotRank>0?Z.hotRank:"-","名"]}),T&&e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(Z),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(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(Z),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(Z),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(Z),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]})]},Z.id)}))})]},w.id):e.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${re?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,..._("part",w.id,{partId:w.id,partTitle:w.title,chapterId:((A=w.chapters[0])==null?void 0:A.id)??"",chapterTitle:((F=w.chapters[0])==null?void 0:F.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:O=>{O.stopPropagation(),O.dataTransfer.setData("text/plain","part:"+w.id),O.dataTransfer.effectAllowed="move",N({type:"part",id:w.id})},onDragEnd:()=>{N(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",w.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(w.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(Sr,{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:I(V)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:w.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:O=>O.stopPropagation(),onClick:O=>O.stopPropagation(),children:[m&&e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(w),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(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(w),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[oe,"章"]}),G?e.jsx(Ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(sn,{className:"w-5 h-5 text-gray-500"})]})]}),G&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:w.chapters.map(O=>{const Z=R("chapter",O.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:Y=>{Y.stopPropagation(),Y.dataTransfer.setData("text/plain","chapter:"+O.id),Y.dataTransfer.effectAllowed="move",N({type:"chapter",id:O.id})},onDragEnd:()=>{N(null),E(null)},onDragEnter:Y=>{Y.preventDefault(),Y.stopPropagation(),Y.dataTransfer.dropEffect="move",E({type:"chapter",id:O.id})},onDragOver:Y=>{Y.preventDefault(),Y.stopPropagation(),Y.dataTransfer.dropEffect="move",E({type:"chapter",id:O.id})},onDragLeave:()=>E(null),onDrop:Y=>{E(null);const de=Bd(Y.dataTransfer.getData("text/plain"));if(!de)return;const q={partId:w.id,partTitle:w.title,chapterId:O.id,chapterTitle:O.title};(de.type==="section"||de.type==="chapter")&&H(Y,"chapter",O.id,q)},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 ${Z?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${j("chapter",O.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[e.jsx(Sr,{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:O.title})]}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:Y=>Y.stopPropagation(),children:[v&&e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>v(w,O),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(X,{variant:"ghost",size:"sm",onClick:()=>f(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),p&&e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>p(w,O),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:O.sections.map(Y=>{const de=R("section",Y.id);return e.jsxs("div",{draggable:!0,onDragStart:q=>{q.stopPropagation(),q.dataTransfer.setData("text/plain","section:"+Y.id),q.dataTransfer.effectAllowed="move",N({type:"section",id:Y.id})},onDragEnd:()=>{N(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",Y.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,..._("section",Y.id,{partId:w.id,partTitle:w.title,chapterId:O.id,chapterTitle:O.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:q=>q.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:k.includes(Y.id),onChange:()=>P(Y.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx(Sr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${Y.price===0||Y.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[Y.id," ",Y.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:q=>q.stopPropagation(),onClick:q=>q.stopPropagation(),children:[Y.isNew&&e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),Y.price===0||Y.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:["¥",Y.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",title:"点击次数 · 付款笔数",children:["点击 ",Y.clickCount??0," · 付款 ",Y.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(Y.hotScore??0).toFixed(1)," · 第",Y.hotRank&&Y.hotRank>0?Y.hotRank:"-","名"]}),T&&e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>T(Y),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(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(Y),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(Y),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(X,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(Y),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]}),e.jsx(sn,{className:"w-4 h-4 text-gray-500"})]})]},Y.id)})})]},O.id)})})]},w.id)})})}function m3(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 k=a.get(p);k.chapters.has(g)||k.chapters.set(g,{id:g,title:v,sections:[]}),k.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",i="2026每日派对干货";Array.from(a.values()).some(f=>f.title===i||f.title.includes(i))||a.set(l,{id:l,title:i,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:i,sections:[]}]])});const d=Array.from(a.values()).map(f=>({...f,chapters:Array.from(f.chapters.values())})),m=f=>f.includes("序言")?0:f.includes(i)?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 f3(){var $s,ea,ts;const[r,a]=h.useState([]),[l,i]=h.useState(!0),[c,d]=h.useState([]),[m,f]=h.useState(null),[p,y]=h.useState(!1),[g,v]=h.useState(!1),[k,P]=h.useState(!1),[T,b]=h.useState(""),[N,C]=h.useState([]),[E,j]=h.useState(!1),[R,L]=h.useState(!1),H=h.useRef(null),[_,I]=h.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[w,V]=h.useState(null),[te,le]=h.useState(!1),[Q,re]=h.useState(!1),[G,oe]=h.useState(null),[ve,$]=h.useState(!1),[ne,K]=h.useState([]),[A,F]=h.useState(!1),[O,Z]=h.useState(""),[Y,de]=h.useState(""),[q,ge]=h.useState(!1),[Se,D]=h.useState(""),[fe,ke]=h.useState(!1),[Ve,We]=h.useState(null),[Ke,tt]=h.useState(!1),[$e,he]=h.useState(!1),[xe,ft]=h.useState({readWeight:.5,recencyWeight:.3,payWeight:.2}),[es,hr]=h.useState(!1),[bn,As]=h.useState(!1),Bt=m3(r),Mr=r.length,dt=async()=>{i(!0);try{const z=await ze("/api/db/book?action=list",{cache:"no-store"});a(Array.isArray(z==null?void 0:z.sections)?z.sections:[])}catch(z){console.error(z),a([])}finally{i(!1)}};h.useEffect(()=>{dt()},[]);const gs=z=>{d(ce=>ce.includes(z)?ce.filter(Ce=>Ce!==z):[...ce,z])},Nn=h.useCallback(z=>{const ce=r,Ce=z.flatMap(Ee=>{const xt=ce.find(ns=>ns.id===Ee.id);return xt?[{...xt,partId:Ee.partId,partTitle:Ee.partTitle,chapterId:Ee.chapterId,chapterTitle:Ee.chapterTitle}]:[]});return a(Ce),vt("/api/db/book",{action:"reorder",items:z}).then(Ee=>{Ee&&Ee.success===!1&&(a(ce),alert("排序失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误")))}).catch(Ee=>{a(ce),console.error("排序失败:",Ee),alert("排序失败: "+(Ee instanceof Error?Ee.message:"网络或服务异常"))}),Promise.resolve()},[r]),mr=async z=>{if(confirm(`确定要删除章节「${z.title}」吗?此操作不可恢复。`))try{const ce=await Tr(`/api/db/book?id=${encodeURIComponent(z.id)}`);ce&&ce.success!==!1?(alert("已删除"),dt()):alert("删除失败: "+(ce&&typeof ce=="object"&&"error"in ce?ce.error:"未知错误"))}catch(ce){console.error(ce),alert("删除失败")}},Cs=h.useCallback(async()=>{hr(!0);try{const z=await ze("/api/db/config/full?key=article_ranking_weights",{cache:"no-store"}),ce=z&&z.data;ce&&typeof ce.readWeight=="number"&&typeof ce.recencyWeight=="number"&&typeof ce.payWeight=="number"&&ft({readWeight:Math.max(0,Math.min(1,ce.readWeight)),recencyWeight:Math.max(0,Math.min(1,ce.recencyWeight)),payWeight:Math.max(0,Math.min(1,ce.payWeight))})}catch{}finally{hr(!1)}},[]);h.useEffect(()=>{$e&&Cs()},[$e,Cs]);const Yn=async()=>{const{readWeight:z,recencyWeight:ce,payWeight:Ce}=xe,Ee=z+ce+Ce;if(Math.abs(Ee-1)>.001){alert("三个权重之和必须等于 1");return}As(!0);try{const xt=await ct("/api/db/config",{key:"article_ranking_weights",value:{readWeight:z,recencyWeight:ce,payWeight:Ce},description:"文章排名算法权重"});xt&&xt.success!==!1?(alert("已保存"),dt()):alert("保存失败: "+(xt&&typeof xt=="object"&&"error"in xt?xt.error:""))}catch(xt){console.error(xt),alert("保存失败")}finally{As(!1)}},Qn=async z=>{We({section:z,orders:[]}),tt(!0);try{const ce=await ze(`/api/db/book?action=section-orders&id=${encodeURIComponent(z.id)}`),Ce=ce!=null&&ce.success&&Array.isArray(ce.orders)?ce.orders:[];We(Ee=>Ee?{...Ee,orders:Ce}:null)}catch(ce){console.error(ce),We(Ce=>Ce?{...Ce,orders:[]}:null)}finally{tt(!1)}},ks=async z=>{v(!0);try{const ce=await ze(`/api/db/book?action=read&id=${encodeURIComponent(z.id)}`);if(ce!=null&&ce.success&&ce.section){const Ce=ce.section;f({id:z.id,title:ce.section.title??z.title,price:ce.section.price??z.price,content:ce.section.content??"",filePath:z.filePath,isFree:z.isFree||z.price===0,isNew:Ce.isNew??z.isNew})}else f({id:z.id,title:z.title,price:z.price,content:"",filePath:z.filePath,isFree:z.isFree,isNew:z.isNew}),ce&&!ce.success&&alert("无法读取文件内容: "+(ce.error||"未知错误"))}catch(ce){console.error(ce),f({id:z.id,title:z.title,price:z.price,content:"",filePath:z.filePath,isFree:z.isFree})}finally{v(!1)}},wn=async()=>{var z;if(m){P(!0);try{let ce=m.content||"";const Ce=[new RegExp(`^#+\\s*${m.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${m.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(z=m.title)==null?void 0:z.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const xt of Ce)ce=ce.replace(xt,"");ce=ce.replace(/^\s*\n+/,"").trim();const Ee=await vt("/api/db/book",{id:m.id,title:m.title,price:m.isFree?0:m.price,content:ce,isFree:m.isFree||m.price===0,isNew:m.isNew,saveToFile:!0});Ee&&Ee.success!==!1?(alert(`已保存章节: ${m.title}`),f(null),dt()):alert("保存失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch(ce){console.error(ce),alert("保存失败")}finally{P(!1)}}},fr=async()=>{if(!_.id||!_.title){alert("请填写章节ID和标题");return}P(!0);try{const z=await vt("/api/db/book",{id:_.id,title:_.title,price:_.price,content:_.content,partId:_.partId,chapterId:_.chapterId,saveToFile:!1});z&&z.success!==!1?(alert(`章节创建成功: ${_.title}`),y(!1),I({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),dt()):alert("创建失败: "+(z&&typeof z=="object"&&"error"in z?z.error:"未知错误"))}catch(z){console.error(z),alert("创建失败")}finally{P(!1)}},ys=z=>{I(ce=>{var Ce;return{...ce,partId:z.id,chapterId:((Ce=z.chapters[0])==null?void 0:Ce.id)??"chapter-1"}}),y(!0)},Ds=z=>{V({id:z.id,title:z.title})},Ls=async()=>{var z;if((z=w==null?void 0:w.title)!=null&&z.trim()){le(!0);try{const ce=r.map(Ee=>({id:Ee.id,partId:Ee.partId||"part-1",partTitle:Ee.partId===w.id?w.title.trim():Ee.partTitle||"",chapterId:Ee.chapterId||"chapter-1",chapterTitle:Ee.chapterTitle||""})),Ce=await vt("/api/db/book",{action:"reorder",items:ce});Ce&&Ce.success!==!1?(V(null),dt()):alert("更新篇名失败: "+(Ce&&typeof Ce=="object"&&"error"in Ce?Ce.error:"未知错误"))}catch(ce){console.error(ce),alert("更新篇名失败")}finally{le(!1)}}},Sn=z=>{const ce=z.chapters.length+1,Ce=`chapter-${z.id}-${ce}-${Date.now()}`;I({id:`${ce}.1`,title:"新章节",price:1,partId:z.id,chapterId:Ce,content:""}),y(!0)},Es=(z,ce)=>{oe({part:z,chapter:ce,title:ce.title})},Os=async()=>{var z;if((z=G==null?void 0:G.title)!=null&&z.trim()){$(!0);try{const ce=r.map(Ee=>({id:Ee.id,partId:Ee.partId||G.part.id,partTitle:Ee.partId===G.part.id?G.part.title:Ee.partTitle||"",chapterId:Ee.chapterId||G.chapter.id,chapterTitle:Ee.partId===G.part.id&&Ee.chapterId===G.chapter.id?G.title.trim():Ee.chapterTitle||""})),Ce=await vt("/api/db/book",{action:"reorder",items:ce});Ce&&Ce.success!==!1?(oe(null),dt()):alert("保存失败: "+(Ce&&typeof Ce=="object"&&"error"in Ce?Ce.error:"未知错误"))}catch(ce){console.error(ce),alert("保存失败")}finally{$(!1)}}},Fs=async(z,ce)=>{const Ce=ce.sections.map(Ee=>Ee.id);if(Ce.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${z.chapters.indexOf(ce)+1}章 | ${ce.title}」吗?将删除共 ${Ce.length} 节,此操作不可恢复。`))try{for(const Ee of Ce)await Tr(`/api/db/book?id=${encodeURIComponent(Ee)}`);dt()}catch(Ee){console.error(Ee),alert("删除失败")}},qn=async()=>{if(!Se.trim()){alert("请输入篇名");return}ke(!0);try{const z=`part-new-${Date.now()}`,ce="chapter-1",Ce=`part-placeholder-${Date.now()}`,Ee=await vt("/api/db/book",{id:Ce,title:"占位节(可编辑)",price:0,content:"",partId:z,partTitle:Se.trim(),chapterId:ce,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Ee&&Ee.success!==!1?(alert(`篇「${Se}」创建成功,请编辑占位节`),re(!1),D(""),dt()):alert("创建失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch(z){console.error(z),alert("创建失败")}finally{ke(!1)}},Xn=async()=>{if(ne.length===0){alert("请先勾选要移动的章节");return}const z=Bt.find(Ce=>Ce.id===O),ce=z==null?void 0:z.chapters.find(Ce=>Ce.id===Y);if(!z||!ce||!O||!Y){alert("请选择目标篇和章");return}ge(!0);try{const Ce=()=>{const nt=new Set(ne),as=r.map(Pt=>({id:Pt.id,partId:Pt.partId||"",partTitle:Pt.partTitle||"",chapterId:Pt.chapterId||"",chapterTitle:Pt.chapterTitle||""})),En=as.filter(Pt=>nt.has(Pt.id)).map(Pt=>({...Pt,partId:O,partTitle:z.title||O,chapterId:Y,chapterTitle:ce.title||Y})),er=as.filter(Pt=>!nt.has(Pt.id));let xr=er.length;for(let Pt=er.length-1;Pt>=0;Pt-=1){const B=er[Pt];if(B.partId===O&&B.chapterId===Y){xr=Pt+1;break}}return[...er.slice(0,xr),...En,...er.slice(xr)]},Ee=async()=>{const nt=Ce(),as=await vt("/api/db/book",{action:"reorder",items:nt});return as&&as.success!==!1?(alert(`已移动 ${ne.length} 节到「${z.title}」-「${ce.title}」`),F(!1),K([]),await dt(),!0):!1},xt={action:"move-sections",sectionIds:ne,targetPartId:O,targetChapterId:Y,targetPartTitle:z.title||O,targetChapterTitle:ce.title||Y},ns=await vt("/api/db/book",xt);if(ns&&ns.success!==!1)alert(`已移动 ${ns.count??ne.length} 节到「${z.title}」-「${ce.title}」`),F(!1),K([]),await dt();else{const nt=ns&&typeof ns=="object"&&"error"in ns?ns.error||"":"未知错误";if((nt.includes("缺少 id")||nt.includes("无效的 action"))&&await Ee())return;alert("移动失败: "+nt)}}catch(Ce){console.error(Ce),alert("移动失败: "+(Ce instanceof Error?Ce.message:"网络或服务异常"))}finally{ge(!1)}},Jn=z=>{K(ce=>ce.includes(z)?ce.filter(Ce=>Ce!==z):[...ce,z])},Zn=async z=>{const ce=r.filter(Ce=>Ce.partId===z.id).map(Ce=>Ce.id);if(ce.length===0){alert("该篇下暂无小节可删除");return}if(confirm(`确定要删除「${z.title}」整篇吗?将删除共 ${ce.length} 节内容,此操作不可恢复。`))try{for(const Ce of ce)await Tr(`/api/db/book?id=${encodeURIComponent(Ce)}`);dt()}catch(Ce){console.error(Ce),alert("删除失败")}},Cn=async z=>{var Ce,Ee;const ce=(Ce=z.target.files)==null?void 0:Ce[0];if(ce){L(!0);try{const xt=new FormData;xt.append("file",ce),xt.append("folder","book-images");const nt=await(await fetch(Da("/api/upload"),{method:"POST",body:xt,credentials:"include"})).json();if(nt!=null&&nt.success&&((Ee=nt==null?void 0:nt.data)!=null&&Ee.url)){const as=``;m&&f({...m,content:(m.content||"")+`
|
||
|
||
`+as}),alert(`图片上传成功: ${nt.data.url}`)}else alert("上传失败: "+((nt==null?void 0:nt.error)||"未知错误"))}catch(xt){console.error(xt),alert("上传失败")}finally{L(!1),H.current&&(H.current.value="")}}},kn=async()=>{var z;if(T.trim()){j(!0);try{const ce=await ze(`/api/search?q=${encodeURIComponent(T)}`);ce!=null&&ce.success&&((z=ce.data)!=null&&z.results)?C(ce.data.results):(C([]),ce&&!ce.success&&alert("搜索失败: "+ce.error))}catch(ce){console.error(ce),C([]),alert("搜索失败")}finally{j(!1)}}},zs=Bt.find(z=>z.id===_.partId),Ar=(zs==null?void 0:zs.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:["共 ",Bt.length," 篇 · ",Mr," 节内容"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(X,{onClick:()=>he(!0),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10 bg-transparent",children:[e.jsx(kd,{className:"w-4 h-4 mr-2"}),"排名算法"]}),e.jsxs(X,{onClick:()=>{const z=typeof window<"u"?`${window.location.origin}/api-doc`:"";z&&window.open(z,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Pr,{className:"w-4 h-4 mr-2"}),"API 接口"]})]})]}),e.jsx(Ct,{open:p,onOpenChange:y,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Rt,{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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:_.id,onChange:z=>I({..._,id:z.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:_.price,onChange:z=>I({..._,price:Number(z.target.value)})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"章节标题 *"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:_.title,onChange:z=>I({..._,title:z.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(El,{value:_.partId,onValueChange:z=>I({..._,partId:z,chapterId:"chapter-1"}),children:[e.jsx(Ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Pl,{})}),e.jsxs(Pa,{className:"bg-[#0f2137] border-gray-700",children:[Bt.map(z=>e.jsx(lr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id)),Bt.length===0&&e.jsx(lr,{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(El,{value:_.chapterId,onValueChange:z=>I({..._,chapterId:z}),children:[e.jsx(Ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Pl,{})}),e.jsxs(Pa,{className:"bg-[#0f2137] border-gray-700",children:[Ar.map(z=>e.jsx(lr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id)),Ar.length===0&&e.jsx(lr,{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(un,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:_.content,onChange:z=>I({..._,content:z.target.value})})]})]}),e.jsxs(Dt,{children:[e.jsx(X,{variant:"outline",onClick:()=>y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(X,{onClick:fr,disabled:k||!_.id||!_.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:k?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),e.jsx(Ct,{open:!!w,onOpenChange:z=>!z&&V(null),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),w&&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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:w.title,onChange:z=>V({...w,title:z.target.value}),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(X,{variant:"outline",onClick:()=>V(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(X,{onClick:Ls,disabled:te||!(($s=w==null?void 0:w.title)!=null&&$s.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:te?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(Ct,{open:!!G,onOpenChange:z=>!z&&oe(null),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节名称"]})}),G&&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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:G.title,onChange:z=>oe({...G,title:z.target.value}),placeholder:"输入章节名称"})]})}),e.jsxs(Dt,{children:[e.jsx(X,{variant:"outline",onClick:()=>oe(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(X,{onClick:Os,disabled:ve||!((ea=G==null?void 0:G.title)!=null&&ea.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ve?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(Ct,{open:A,onOpenChange:z=>{var ce;if(F(z),z&&Bt.length>0){const Ce=Bt[0];Z(Ce.id),de(((ce=Ce.chapters[0])==null?void 0:ce.id)??"")}},children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsx(Et,{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:ne.length})," 节,请选择目标篇与章。"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"目标篇"}),e.jsxs(El,{value:O,onValueChange:z=>{var Ce;Z(z);const ce=Bt.find(Ee=>Ee.id===z);de(((Ce=ce==null?void 0:ce.chapters[0])==null?void 0:Ce.id)??"")},children:[e.jsx(Ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Pl,{placeholder:"选择篇"})}),e.jsx(Pa,{className:"bg-[#0f2137] border-gray-700",children:Bt.map(z=>e.jsx(lr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"目标章"}),e.jsxs(El,{value:Y,onValueChange:de,children:[e.jsx(Ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Pl,{placeholder:"选择章"})}),e.jsx(Pa,{className:"bg-[#0f2137] border-gray-700",children:(((ts=Bt.find(z=>z.id===O))==null?void 0:ts.chapters)??[]).map(z=>e.jsx(lr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id))})]})]})]}),e.jsxs(Dt,{children:[e.jsx(X,{variant:"outline",onClick:()=>F(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(X,{onClick:Xn,disabled:q||ne.length===0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:q?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"移动中..."]}):"确认移动"})]})]})}),e.jsx(Ct,{open:!!Ve,onOpenChange:z=>!z&&We(null),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white",children:["付款记录 — ",(Ve==null?void 0:Ve.section.title)??""]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:Ke?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):Ve&&Ve.orders.length===0?e.jsx("p",{className:"text-gray-500 text-center py-6",children:"暂无付款记录"}):Ve?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:Ve.orders.map(z=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:z.orderSn??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:z.userId??z.openId??"-"}),e.jsxs("td",{className:"py-2 pr-2 text-gray-300",children:["¥",z.amount??0]}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:z.status??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-500",children:z.payTime??z.createdAt??"-"})]},z.id??z.orderSn??""))})]}):null})]})}),e.jsx(Ct,{open:$e,onOpenChange:he,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(kd,{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)"}),es?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(ie,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:xe.readWeight,onChange:z=>ft(ce=>({...ce,readWeight:Math.max(0,Math.min(1,parseFloat(z.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(ee,{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:xe.recencyWeight,onChange:z=>ft(ce=>({...ce,recencyWeight:Math.max(0,Math.min(1,parseFloat(z.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(ee,{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:xe.payWeight,onChange:z=>ft(ce=>({...ce,payWeight:Math.max(0,Math.min(1,parseFloat(z.target.value)||0))}))})]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前之和: ",(xe.readWeight+xe.recencyWeight+xe.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(X,{onClick:Yn,disabled:bn||Math.abs(xe.readWeight+xe.recencyWeight+xe.payWeight-1)>.001,className:"w-full bg-amber-500 hover:bg-amber-600 text-white",children:bn?"保存中...":"保存权重"})]})]})]})}),e.jsx(Ct,{open:Q,onOpenChange:re,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Rt,{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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:Se,onChange:z=>D(z.target.value),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(X,{variant:"outline",onClick:()=>{re(!1),D("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(X,{onClick:qn,disabled:fe||!Se.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:fe?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"创建篇"]})})]})]})}),e.jsx(Ct,{open:!!m,onOpenChange:()=>f(null),children:e.jsxs(Nt,{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(kt,{className:"shrink-0 px-6 pt-6 pb-2",children:e.jsxs(Et,{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(ie,{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(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:m.isFree?0:m.price,onChange:z=>f({...m,price:Number(z.target.value),isFree:Number(z.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:z=>f({...m,isFree:z.target.checked,price:z.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:z=>f({...m,isNew:z.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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.title,onChange:z=>f({...m,title:z.target.value})})]}),m.filePath&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{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(ee,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:H,type:"file",accept:"image/*",onChange:Cn,className:"hidden"}),e.jsxs(X,{variant:"outline",size:"sm",onClick:()=>{var z;return(z=H.current)==null?void 0:z.click()},disabled:R,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[R?e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(qx,{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(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(un,{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:z=>f({...m,content:z.target.value})})]})]}),e.jsxs(Dt,{className:"shrink-0 px-6 py-4 border-t border-gray-700/50",children:[e.jsxs(X,{variant:"outline",onClick:()=>f(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsx(X,{onClick:wn,disabled:k,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:k?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),e.jsxs($l,{defaultValue:"chapters",className:"space-y-6",children:[e.jsxs(Ba,{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(qs,{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(cn,{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(kd,{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(qs,{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:Mr}),e.jsx("span",{className:"text-xs text-gray-500",children:"章节"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(X,{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(Rt,{className:"w-4 h-4 mr-2"}),"新建章节"]}),e.jsxs(X,{onClick:()=>re(!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(Rt,{className:"w-4 h-4 mr-2"}),"新建篇"]}),e.jsxs(X,{variant:"outline",onClick:()=>F(!0),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:["批量移动(已选 ",ne.length," 节)"]})]}),l?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(h3,{parts:Bt,expandedParts:c,onTogglePart:gs,onReorder:Nn,onReadSection:ks,onDeleteSection:mr,onAddSectionInPart:ys,onAddChapterInPart:Sn,onDeleteChapter:Fs,onEditPart:Ds,onDeletePart:Zn,onEditChapter:Es,selectedSectionIds:ne,onToggleSectionSelect:Jn,onShowSectionOrders:Qn})]}),e.jsx(Ot,{value:"search",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"内容搜索"})}),e.jsxs(we,{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:T,onChange:z=>b(z.target.value),onKeyDown:z=>z.key==="Enter"&&kn()}),e.jsx(X,{onClick:kn,disabled:E||!T.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?e.jsx(Be,{className:"w-4 h-4 animate-spin"}):e.jsx(cn,{className:"w-4 h-4"})})]}),N.length>0&&e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",N.length," 个结果"]}),N.map(z=>e.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>ks({id:z.id,title:z.title,price:z.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:z.id}),e.jsx("span",{className:"text-white",children:z.title})]}),e.jsx(Le,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:z.matchType==="title"?"标题匹配":"内容匹配"})]}),z.snippet&&e.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:z.snippet}),(z.partTitle||z.chapterTitle)&&e.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[z.partTitle," · ",z.chapterTitle]})]},z.id))]})]})]})}),e.jsx(Ot,{value:"hooks",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"引流钩子配置"})}),e.jsxs(we,{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(El,{defaultValue:"3",children:[e.jsx(Ea,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Pl,{placeholder:"选择章节"})}),e.jsxs(Pa,{className:"bg-[#0f2137] border-gray-700",children:[e.jsx(lr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),e.jsx(lr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),e.jsx(lr,{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(un,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),e.jsx(X,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}const kr={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 jx(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):kr.stats}function bx(r){return Array.isArray(r)?r.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):kr.highlights}function x3(){const[r,a]=h.useState(kr),[l,i]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(!1),p=h.useRef(null);h.useEffect(()=>{ze("/api/admin/author-settings").then(C=>{const E=C==null?void 0:C.data;E&&typeof E=="object"&&a({name:String(E.name??kr.name),avatar:String(E.avatar??kr.avatar),avatarImg:String(E.avatarImg??""),title:String(E.title??kr.title),bio:String(E.bio??kr.bio),stats:jx(E.stats).length?jx(E.stats):kr.stats,highlights:bx(E.highlights).length?bx(E.highlights):kr.highlights})}).catch(console.error).finally(()=>i(!1))},[]);const y=async()=>{d(!0);try{const C={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 ct("/api/admin/author-settings",C);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(C){console.error(C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}finally{d(!1)}},g=async C=>{var j;const E=(j=C.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 L=bu(),H={};L&&(H.Authorization=`Bearer ${L}`);const I=await(await fetch(Da("/api/upload"),{method:"POST",body:R,credentials:"include",headers:H})).json();I!=null&&I.success&&(I!=null&&I.url)?a(w=>({...w,avatarImg:I.url})):alert("上传失败: "+((I==null?void 0:I.error)||"未知错误"))}catch(R){console.error(R),alert("上传失败")}finally{f(!1),p.current&&(p.current.value="")}}},v=()=>a(C=>({...C,stats:[...C.stats,{label:"",value:""}]})),k=C=>a(E=>({...E,stats:E.stats.filter((j,R)=>R!==C)})),P=(C,E,j)=>a(R=>({...R,stats:R.stats.map((L,H)=>H===C?{...L,[E]:j}:L)})),T=()=>a(C=>({...C,highlights:[...C.highlights,""]})),b=C=>a(E=>({...E,highlights:E.highlights.filter((j,R)=>R!==C)})),N=(C,E)=>a(j=>({...j,highlights:j.highlights.map((R,L)=>L===C?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(Ia,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),e.jsxs(X,{onClick:y,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"flex items-center gap-2 text-white",children:[e.jsx(Ia,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),e.jsx(jt,{className:"text-gray-400",children:"作者姓名、头像、头衔与个人简介,将展示在「关于作者」页顶部。"})]}),e.jsxs(we,{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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.name,onChange:C=>a(E=>({...E,name:C.target.value})),placeholder:"卡若"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:r.avatar,onChange:C=>a(E=>({...E,avatar:C.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(qx,{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:C=>a(E=>({...E,avatarImg:C.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),e.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:g}),e.jsxs(X,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:m,onClick:()=>{var C;return(C=p.current)==null?void 0:C.click()},children:[e.jsx(uo,{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:Da(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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.title,onChange:C=>a(E=>({...E,title:C.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"个人简介"}),e.jsx(un,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:r.bio,onChange:C=>a(E=>({...E,bio:C.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsx(Qe,{className:"text-white",children:"统计数据"}),e.jsx(jt,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),e.jsxs(we,{className:"space-y-3",children:[r.stats.map((C,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:C.label,onChange:j=>P(E,"label",j.target.value),placeholder:"标签"}),e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:C.value,onChange:j=>P(E,"value",j.target.value),placeholder:"数值"}),e.jsx(X,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>k(E),children:e.jsx(ms,{className:"w-4 h-4"})})]},E)),e.jsxs(X,{variant:"outline",size:"sm",onClick:v,className:"border-gray-600 text-gray-400",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsx(Qe,{className:"text-white",children:"亮点标签"}),e.jsx(jt,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),e.jsxs(we,{className:"space-y-3",children:[r.highlights.map((C,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:C,onChange:j=>N(E,j.target.value),placeholder:"5年私域运营经验"}),e.jsx(X,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>b(E),children:e.jsx(ms,{className:"w-4 h-4"})})]},E)),e.jsxs(X,{variant:"outline",size:"sm",onClick:T,className:"border-gray-600 text-gray-400",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"添加亮点"]})]})]})]})]})}function p3(){const[r,a]=h.useState([]),[l,i]=h.useState(0),[c,d]=h.useState(1),[m]=h.useState(10),[f,p]=h.useState(0),[y,g]=h.useState(""),v=Iu(y,300),[k,P]=h.useState(!0),[T,b]=h.useState(null),[N,C]=h.useState(!1),[E,j]=h.useState(null),[R,L]=h.useState(""),[H,_]=h.useState(""),[I,w]=h.useState(""),[V,te]=h.useState("admin"),[le,Q]=h.useState("active"),[re,G]=h.useState(!1);async function oe(){var F;P(!0),b(null);try{const O=new URLSearchParams({page:String(c),pageSize:String(m)});v.trim()&&O.set("search",v.trim());const Z=await ze(`/api/admin/users?${O}`);Z!=null&&Z.success?(a(Z.records||[]),i(Z.total??0),p(Z.totalPages??0)):b(Z.error||"加载失败")}catch(O){const Z=O;b(Z.status===403?"无权限访问":((F=Z==null?void 0:Z.data)==null?void 0:F.error)||"加载失败"),a([])}finally{P(!1)}}h.useEffect(()=>{oe()},[c,m,v]);const ve=()=>{j(null),L(""),_(""),w(""),te("admin"),Q("active"),C(!0)},$=F=>{j(F),L(F.username),_(""),w(F.name||""),te(F.role==="super_admin"?"super_admin":"admin"),Q(F.status==="disabled"?"disabled":"active"),C(!0)},ne=async()=>{var F;if(!R.trim()){b("用户名不能为空");return}if(!E&&!H){b("新建时密码必填,至少 6 位");return}if(H&&H.length<6){b("密码至少 6 位");return}b(null),G(!0);try{if(E){const O=await vt("/api/admin/users",{id:E.id,password:H||void 0,name:I.trim(),role:V,status:le});O!=null&&O.success?(C(!1),oe()):b((O==null?void 0:O.error)||"保存失败")}else{const O=await ct("/api/admin/users",{username:R.trim(),password:H,name:I.trim(),role:V});O!=null&&O.success?(C(!1),oe()):b((O==null?void 0:O.error)||"保存失败")}}catch(O){const Z=O;b(((F=Z==null?void 0:Z.data)==null?void 0:F.error)||"保存失败")}finally{G(!1)}},K=async F=>{var O;if(confirm("确定删除该管理员?"))try{const Z=await Tr(`/api/admin/users?id=${F}`);Z!=null&&Z.success?oe():b((Z==null?void 0:Z.error)||"删除失败")}catch(Z){const Y=Z;b(((O=Y==null?void 0:Y.data)==null?void 0:O.error)||"删除失败")}},A=F=>{if(!F)return"-";try{const O=new Date(F);return isNaN(O.getTime())?F:O.toLocaleString("zh-CN")}catch{return F}};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(vu,{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:F=>g(F.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),e.jsx(X,{variant:"outline",size:"sm",onClick:oe,disabled:k,className:"border-gray-600 text-gray-300",children:e.jsx(Be,{className:`w-4 h-4 ${k?"animate-spin":""}`})}),e.jsxs(X,{onClick:ve,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{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:()=>b(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:k?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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(ps,{children:[r.map(F=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:F.id}),e.jsx(pe,{className:"text-white font-medium",children:F.username}),e.jsx(pe,{className:"text-gray-400",children:F.name||"-"}),e.jsx(pe,{children:e.jsx(Le,{variant:"outline",className:F.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:F.role==="super_admin"?"超级管理员":"管理员"})}),e.jsx(pe,{children:e.jsx(Le,{variant:"outline",className:F.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:F.status==="active"?"正常":"已禁用"})}),e.jsx(pe,{className:"text-gray-500 text-sm",children:A(F.createdAt)}),e.jsxs(pe,{className:"text-right",children:[e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>$(F),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>K(F.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]},F.id)),r.length===0&&!k&&e.jsx(et,{children:e.jsx(pe,{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(Qs,{page:c,pageSize:m,total:l,totalPages:f,onPageChange:d})})]})})}),e.jsx(Ct,{open:N,onOpenChange:C,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(kt,{children:e.jsx(Et,{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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:R,onChange:F=>L(F.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(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:E?"留空表示不修改":"至少 6 位",value:H,onChange:F=>_(F.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"昵称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:I,onChange:F=>w(F.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{value:V,onChange:F=>te(F.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:le,onChange:F=>Q(F.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(X,{variant:"outline",onClick:()=>C(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(X,{onClick:ne,disabled:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),re?"保存中...":"保存"]})]})]})})]})}const g3={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},y3={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},v3={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...y3}},j3={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0},b3=["system","author","admin"];function N3(){const[r,a]=Ux(),l=r.get("tab")??"system",i=b3.includes(l)?l:"system",[c,d]=h.useState(v3),[m,f]=h.useState(j3),[p,y]=h.useState(g3),[g,v]=h.useState(!1),[k,P]=h.useState(!0),[T,b]=h.useState(!1),[N,C]=h.useState(""),[E,j]=h.useState(""),[R,L]=h.useState(!1),[H,_]=h.useState(!1),I=(Q,re,G=!1)=>{C(Q),j(re),L(G),b(!0)};h.useEffect(()=>{(async()=>{try{const re=await ze("/api/admin/settings");if(!re||re.success===!1)return;if(re.featureConfig&&Object.keys(re.featureConfig).length&&f(G=>({...G,...re.featureConfig})),re.mpConfig&&typeof re.mpConfig=="object"&&y(G=>({...G,...re.mpConfig})),re.siteSettings&&typeof re.siteSettings=="object"){const G=re.siteSettings;d(oe=>({...oe,...typeof G.sectionPrice=="number"&&{sectionPrice:G.sectionPrice},...typeof G.baseBookPrice=="number"&&{baseBookPrice:G.baseBookPrice},...typeof G.distributorShare=="number"&&{distributorShare:G.distributorShare},...G.authorInfo&&typeof G.authorInfo=="object"&&{authorInfo:{...oe.authorInfo,...G.authorInfo}}}))}}catch(re){console.error("Load settings error:",re)}finally{P(!1)}})()},[]);const w=async(Q,re)=>{_(!0);try{const G=await ct("/api/admin/settings",{featureConfig:Q});if(!G||G.success===!1){re(),I("保存失败",(G==null?void 0:G.error)??"未知错误",!0);return}I("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(G){console.error("Save feature config error:",G),re(),I("保存失败",G instanceof Error?G.message:String(G),!0)}finally{_(!1)}},V=(Q,re)=>{const G=m,oe={...G,[Q]:re};f(oe),w(oe,()=>f(G))},te=async()=>{v(!0);try{const Q=await ct("/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(!Q||Q.success===!1){I("保存失败",(Q==null?void 0:Q.error)??"未知错误",!0);return}I("已保存","设置已保存成功。")}catch(Q){console.error("Save settings error:",Q),I("保存失败",Q instanceof Error?Q.message:String(Q),!0)}finally{v(!1)}},le=Q=>{a(Q==="system"?{}:{tab:Q})};return k?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:"配置全站基础参数与开关"})]}),i==="system"&&e.jsxs(X,{onClick:te,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存设置"]})]}),e.jsxs($l,{value:i,onValueChange:le,className:"w-full",children:[e.jsxs(Ba,{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(Bn,{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(Cd,{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(vu,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Cd,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),e.jsx(jt,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),e.jsxs(we,{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(Cd,{className:"w-3 h-3"}),"主理人名称"]}),e.jsx(ie,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.name??"",onChange:Q=>d(re=>({...re,authorInfo:{...re.authorInfo,name:Q.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(oo,{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:Q=>d(re=>({...re,authorInfo:{...re.authorInfo,startDate:Q.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(oo,{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:Q=>d(re=>({...re,authorInfo:{...re.authorInfo,liveTime:Q.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(Xx,{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:Q=>d(re=>({...re,authorInfo:{...re.authorInfo,platform:Q.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(qs,{className:"w-3 h-3"}),"简介描述"]}),e.jsx(ie,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.description??"",onChange:Q=>d(re=>({...re,authorInfo:{...re.authorInfo,description:Q.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),e.jsx(un,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:c.authorInfo.bio??"",onChange:Q=>d(re=>({...re,authorInfo:{...re.authorInfo,bio:Q.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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(co,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),e.jsx(jt,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),e.jsx(we,{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(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.sectionPrice,onChange:Q=>d(re=>({...re,sectionPrice:Number.parseFloat(Q.target.value)||1}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"整本价格 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.baseBookPrice,onChange:Q=>d(re=>({...re,baseBookPrice:Number.parseFloat(Q.target.value)||9.9}))})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Al,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),e.jsx(jt,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),e.jsx(we,{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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:p.appId??"",onChange:Q=>y(re=>({...re,appId:Q.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"提现订阅模板 ID"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:p.withdrawSubscribeTmplId??"",onChange:Q=>y(re=>({...re,withdrawSubscribeTmplId:Q.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"微信支付商户号"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:p.mchId??"",onChange:Q=>y(re=>({...re,mchId:Q.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"最低提现金额 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.minWithdraw??10,onChange:Q=>y(re=>({...re,minWithdraw:Number.parseFloat(Q.target.value)||10}))})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Bn,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),e.jsx(jt,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),e.jsxs(we,{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(Kt,{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(ot,{id:"match-enabled",checked:m.matchEnabled,disabled:H,onCheckedChange:Q=>V("matchEnabled",Q)})]}),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(yb,{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(ot,{id:"referral-enabled",checked:m.referralEnabled,disabled:H,onCheckedChange:Q=>V("referralEnabled",Q)})]}),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(qs,{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(ot,{id:"search-enabled",checked:m.searchEnabled,disabled:H,onCheckedChange:Q=>V("searchEnabled",Q)})]}),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(Bn,{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(ot,{id:"about-enabled",checked:m.aboutEnabled,disabled:H,onCheckedChange:Q=>V("aboutEnabled",Q)})]})]}),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(x3,{})}),e.jsx(Ot,{value:"admin",className:"mt-0",children:e.jsx(p3,{})})]}),e.jsx(Ct,{open:T,onOpenChange:b,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[e.jsxs(kt,{children:[e.jsx(Et,{className:R?"text-red-400":"text-[#38bdac]",children:N}),e.jsx(u2,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:E})]}),e.jsx(Dt,{className:"mt-4",children:e.jsx(X,{onClick:()=>b(!1),className:R?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const Nx={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 w3(){const[r,a]=h.useState(!1),[l,i]=h.useState(Nx),[c,d]=h.useState(""),m=async()=>{a(!0);try{const C=await ze("/api/config");C!=null&&C.paymentMethods&&i({...Nx,...C.paymentMethods})}catch(C){console.error(C)}finally{a(!1)}};h.useEffect(()=>{m()},[]);const f=async()=>{a(!0);try{await ct("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(C){console.error("保存失败:",C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}finally{a(!1)}},p=(C,E)=>{navigator.clipboard.writeText(C),d(E),setTimeout(()=>d(""),2e3)},y=(C,E)=>{i(j=>({...j,wechat:{...j.wechat,[C]:E}}))},g=(C,E)=>{i(j=>({...j,alipay:{...j.alipay,[C]:E}}))},v=(C,E)=>{i(j=>({...j,usdt:{...j.usdt,[C]:E}}))},k=(C,E)=>{i(j=>({...j,paypal:{...j.paypal,[C]:E}}))},P=l.wechat,T=l.alipay,b=l.usdt,N=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(X,{variant:"outline",onClick:m,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${r?"animate-spin":""}`}),"同步配置"]}),e.jsxs(X,{onClick:f,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{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(Hx,{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($l,{defaultValue:"wechat",className:"space-y-6",children:[e.jsxs(Ba,{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(Al,{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(zf,{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(Of,{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(Qd,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),e.jsx(Ot,{value:"wechat",className:"space-y-4",children:e.jsxs(Ne,{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(Qe,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Al,{className:"w-5 h-5"}),"微信支付配置"]}),e.jsx(jt,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),e.jsx(ot,{checked:!!P.enabled,onCheckedChange:C=>y("enabled",C)})]}),e.jsxs(we,{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(ie,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.websiteAppId??""),onChange:C=>y("websiteAppId",C.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"商户号"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.merchantId??""),onChange:C=>y("merchantId",C.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(Un,{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(ie,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(P.qrCode??""),onChange:C=>y("qrCode",C.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(ie,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(P.groupQrCode??""),onChange:C=>y("groupQrCode",C.target.value)}),e.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),e.jsx(Ot,{value:"alipay",className:"space-y-4",children:e.jsxs(Ne,{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(Qe,{className:"text-[#1677FF] flex items-center gap-2",children:[e.jsx(zf,{className:"w-5 h-5"}),"支付宝配置"]}),e.jsx(jt,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),e.jsx(ot,{checked:!!T.enabled,onCheckedChange:C=>g("enabled",C)})]}),e.jsxs(we,{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(ie,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.partnerId??""),onChange:C=>g("partnerId",C.target.value)}),e.jsx(X,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>p(String(T.partnerId??""),"pid"),children:c==="pid"?e.jsx(wo,{className:"w-4 h-4 text-green-500"}):e.jsx(Gx,{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(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.securityKey??""),onChange:C=>g("securityKey",C.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(Un,{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(ie,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(T.qrCode??""),onChange:C=>g("qrCode",C.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),e.jsx(Ot,{value:"usdt",className:"space-y-4",children:e.jsxs(Ne,{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(Qe,{className:"text-[#26A17B] flex items-center gap-2",children:[e.jsx(Of,{className:"w-5 h-5"}),"USDT配置"]}),e.jsx(jt,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),e.jsx(ot,{checked:!!b.enabled,onCheckedChange:C=>v("enabled",C)})]}),e.jsxs(we,{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(b.network??"TRC20"),onChange:C=>v("network",C.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(ie,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(b.address??""),onChange:C=>v("address",C.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{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:C=>v("exchangeRate",Number.parseFloat(C.target.value)||7.2)})]})]})]})}),e.jsx(Ot,{value:"paypal",className:"space-y-4",children:e.jsxs(Ne,{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(Qe,{className:"text-[#169BD7] flex items-center gap-2",children:[e.jsx(Qd,{className:"w-5 h-5"}),"PayPal配置"]}),e.jsx(jt,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),e.jsx(ot,{checked:!!N.enabled,onCheckedChange:C=>k("enabled",C)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"PayPal邮箱"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(N.email??""),onChange:C=>k("email",C.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(N.exchangeRate)??7.2,onChange:C=>k("exchangeRate",Number(C.target.value)||7.2)})]})]})]})})]})]})}const S3={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},C3={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},k3={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function E3(){const[r,a]=h.useState({siteConfig:{...S3},menuConfig:{...C3},pageConfig:{...k3}}),[l,i]=h.useState(!1),[c,d]=h.useState(!1);h.useEffect(()=>{ze("/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 ct("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await ct("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await ct("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),i(!0),setTimeout(()=>i(!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(X,{onClick:m,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Qd,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),e.jsx(jt,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),e.jsxs(we,{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(ie,{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(ie,{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(ie,{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(ie,{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(ie,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Gb,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),e.jsx(jt,{className:"text-gray-400",children:"配置网站主题色"})]}),e.jsx(we,{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(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:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))}),e.jsx(ie,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Ub,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),e.jsx(jt,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),e.jsx(we,{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(ot,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:k=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,enabled:k}}}))}),e.jsx("span",{className:"text-gray-300 w-16 capitalize",children:g}),e.jsx(ie,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(v==null?void 0:v.label)??"",onChange:k=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,label:k.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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Yx,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),e.jsx(jt,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),e.jsxs(we,{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(ie,{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(ie,{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(ie,{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(ie,{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(ie,{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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.aboutTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:g.target.value}}))})]})]})]})]})]})]})}function P3(){const[r,a]=h.useState(""),[l,i]=h.useState(""),[c,d]=h.useState(""),[m,f]=h.useState({}),p=async()=>{var P,T,b,N;try{const C=await ze("/api/config"),E=(T=(P=C==null?void 0:C.liveQRCodes)==null?void 0:P[0])==null?void 0:T.urls;Array.isArray(E)&&a(E.join(`
|
||
`));const j=(N=(b=C==null?void 0:C.paymentMethods)==null?void 0:b.wechat)==null?void 0:N.groupQrCode;j&&i(j),f({paymentMethods:C==null?void 0:C.paymentMethods,liveQRCodes:C==null?void 0:C.liveQRCodes})}catch(C){console.error(C)}};h.useEffect(()=>{p()},[]);const y=(P,T)=>{navigator.clipboard.writeText(P),d(T),setTimeout(()=>d(""),2e3)},g=async()=>{try{const P=r.split(`
|
||
`).map(b=>b.trim()).filter(Boolean),T=[...m.liveQRCodes||[]];T[0]?T[0].urls=P:T.push({id:"live-1",name:"微信群活码",urls:P,clickCount:0}),await ct("/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 ct("/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)))}},k=()=>{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(Hx,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Uf,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),e.jsx(jt,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),e.jsxs(we,{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(Bf,{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:P=>i(P.target.value)}),e.jsx(X,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>y(l,"group"),children:c==="group"?e.jsx(wo,{className:"w-4 h-4 text-green-500"}):e.jsx(Gx,{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(Un,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(X,{onClick:v,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[e.jsx(uo,{className:"w-4 h-4 mr-2"}),"保存配置"]}),e.jsxs(X,{onClick:k,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[e.jsx(Un,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Uf,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),e.jsx(jt,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),e.jsxs(we,{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(Bf,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),e.jsx(un,{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(X,{onClick:g,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(uo,{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 wx={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}},T3=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function R3(){const[r,a]=h.useState(wx),[l,i]=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}),k=async()=>{i(!0);try{const j=await ze("/api/db/config/full?key=match_config"),R=(j==null?void 0:j.data)??(j==null?void 0:j.config);R&&a({...wx,...R})}catch(j){console.error("加载匹配配置失败:",j)}finally{i(!1)}};h.useEffect(()=>{k()},[]);const P=async()=>{d(!0);try{const j=await ct("/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)},b=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},N=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const j=[...r.matchTypes];if(p){const R=j.findIndex(L=>L.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)},C=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(Bn,{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(X,{variant:"outline",onClick:k,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),e.jsxs(X,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(ln,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),e.jsx(jt,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(we,{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(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(ee,{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(ee,{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(ot,{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(ot,{checked:r.settings.enablePaidMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enablePaidMatches:j}})}),e.jsx(ee,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ne,{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(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Kt,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),e.jsx(jt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(X,{onClick:b,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),e.jsx(we,{children:e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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(ps,{children:r.matchTypes.map(j=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(pe,{className:"font-mono text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white font-medium",children:j.label}),e.jsx(pe,{className:"text-gray-300",children:j.matchLabel}),e.jsx(pe,{children:e.jsxs(Le,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(pe,{children:j.matchFromDB?e.jsx(Le,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Le,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(pe,{children:e.jsx(ot,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(X,{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(X,{variant:"ghost",size:"sm",onClick:()=>C(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Ht,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(Ct,{open:m,onOpenChange:f,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[p?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Rt,{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(ie,{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:T3.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(ie,{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(ie,{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(ie,{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(ot,{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(ot,{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(ot,{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(X,{variant:"outline",onClick:()=>f(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(X,{onClick:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const Sx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function I3(){const[r,a]=h.useState([]),[l,i]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(""),[g,v]=h.useState(!0),[k,P]=h.useState(null);async function T(){v(!0),P(null);try{const N=new URLSearchParams({page:String(c),pageSize:String(m)});p&&N.set("matchType",p);const C=await ze(`/api/db/match-records?${N}`);C!=null&&C.success?(a(C.records||[]),i(C.total??0)):P("加载匹配记录失败")}catch(N){console.error("加载匹配记录失败",N),P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{T()},[c,p]);const b=Math.ceil(l/m)||1;return e.jsxs("div",{className:"p-8 w-full",children:[k&&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:k}),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:N=>{y(N.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(Sx).map(([N,C])=>e.jsx("option",{value:N,children:C},N))]}),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(Be,{className:`w-4 h-4 ${g?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx(Be,{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(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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(ps,{children:[r.map(N=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{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:[N.userAvatar?e.jsx("img",{src:N.userAvatar,alt:"",className:"w-full h-full object-cover",onError:C=>{C.currentTarget.style.display="none";const E=C.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:N.userAvatar?"hidden":"",children:(N.userNickname||N.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:N.userNickname||N.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[N.userId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{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:[N.matchedUserAvatar?e.jsx("img",{src:N.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:C=>{C.currentTarget.style.display="none";const E=C.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:N.matchedUserAvatar?"hidden":"",children:(N.matchedNickname||N.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:N.matchedNickname||N.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[N.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsx(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Sx[N.matchType]||N.matchType})}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[N.phone&&e.jsxs("div",{children:["📱 ",N.phone]}),N.wechatId&&e.jsxs("div",{children:["💬 ",N.wechatId]}),!N.phone&&!N.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:N.createdAt?new Date(N.createdAt).toLocaleString():"-"})]},N.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:b,total:l,pageSize:m,onPageChange:d,onPageSizeChange:N=>{f(N),d(1)}})]})})})]})}function _3(){const[r,a]=h.useState([]),[l,i]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(null),[p,y]=h.useState(""),[g,v]=h.useState(0),[k,P]=h.useState(!1);async function T(){i(!0);try{const j=await ze("/api/db/vip-roles");j!=null&&j.success&&j.data&&a(j.data)}catch(j){console.error("Load roles error:",j)}finally{i(!1)}}h.useEffect(()=>{T()},[]);const b=()=>{f(null),y(""),v(r.length>0?Math.max(...r.map(j=>j.sort))+1:0),d(!0)},N=j=>{f(j),y(j.name),v(j.sort),d(!0)},C=async()=>{if(!p.trim()){alert("角色名称不能为空");return}P(!0);try{if(m){const j=await vt("/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 ct("/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 Tr(`/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(nn,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),e.jsxs(X,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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(ps,{children:[r.map(j=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white",children:j.name}),e.jsx(pe,{className:"text-gray-400",children:j.sort}),e.jsxs(pe,{className:"text-right",children:[e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>N(j),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>E(j.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]},j.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),e.jsx(Ct,{open:c,onOpenChange:d,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(kt,{children:e.jsx(Et,{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(ie,{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(ie,{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(X,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(X,{onClick:C,disabled:k,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),k?"保存中...":"保存"]})]})]})})]})}function Mg({embedded:r=!1}){const[a,l]=h.useState([]),[i,c]=h.useState(!0),[d,m]=h.useState(!1),[f,p]=h.useState(null),[y,g]=h.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[v,k]=h.useState(!1),[P,T]=h.useState(!1),b=h.useRef(null),N=async I=>{var V;const w=(V=I.target.files)==null?void 0:V[0];if(w){T(!0);try{const te=new FormData;te.append("file",w),te.append("folder","mentors");const le=bu(),Q={};le&&(Q.Authorization=`Bearer ${le}`);const G=await(await fetch(Da("/api/upload"),{method:"POST",body:te,credentials:"include",headers:Q})).json();G!=null&&G.success&&(G!=null&&G.url)?g(oe=>({...oe,avatar:G.url})):alert("上传失败: "+((G==null?void 0:G.error)||"未知错误"))}catch(te){console.error(te),alert("上传失败")}finally{T(!1),b.current&&(b.current.value="")}}};async function C(){c(!0);try{const I=await ze("/api/db/mentors");I!=null&&I.success&&I.data&&l(I.data)}catch(I){console.error("Load mentors error:",I)}finally{c(!1)}}h.useEffect(()=>{C()},[]);const E=()=>{g({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:a.length>0?Math.max(...a.map(I=>I.sort))+1:0,enabled:!0})},j=()=>{p(null),E(),m(!0)},R=I=>{p(I),g({name:I.name,avatar:I.avatar||"",intro:I.intro||"",tags:I.tags||"",priceSingle:I.priceSingle!=null?String(I.priceSingle):"",priceHalfYear:I.priceHalfYear!=null?String(I.priceHalfYear):"",priceYear:I.priceYear!=null?String(I.priceYear):"",quote:I.quote||"",whyFind:I.whyFind||"",offering:I.offering||"",judgmentStyle:I.judgmentStyle||"",sort:I.sort,enabled:I.enabled??!0}),m(!0)},L=async()=>{if(!y.name.trim()){alert("导师姓名不能为空");return}k(!0);try{const I=V=>V===""?void 0:parseFloat(V),w={name:y.name.trim(),avatar:y.avatar.trim()||void 0,intro:y.intro.trim()||void 0,tags:y.tags.trim()||void 0,priceSingle:I(y.priceSingle),priceHalfYear:I(y.priceHalfYear),priceYear:I(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 V=await vt("/api/db/mentors",{id:f.id,...w});V!=null&&V.success?(m(!1),C()):alert("更新失败: "+(V==null?void 0:V.error))}else{const V=await ct("/api/db/mentors",w);V!=null&&V.success?(m(!1),C()):alert("新增失败: "+(V==null?void 0:V.error))}}catch(I){console.error("Save error:",I),alert("保存失败")}finally{k(!1)}},H=async I=>{if(confirm("确定删除该导师?"))try{const w=await Tr(`/api/db/mentors?id=${I}`);w!=null&&w.success?C():alert("删除失败: "+(w==null?void 0:w.error))}catch(w){console.error("Delete error:",w),alert("删除失败")}},_=I=>I!=null?`¥${I}`:"-";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(Kt,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),e.jsxs(X,{onClick:j,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:i?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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(ps,{children:[a.map(I=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:I.id}),e.jsx(pe,{className:"text-white",children:I.name}),e.jsx(pe,{className:"text-gray-400 max-w-[200px] truncate",children:I.intro||"-"}),e.jsx(pe,{className:"text-gray-400",children:_(I.priceSingle)}),e.jsx(pe,{className:"text-gray-400",children:_(I.priceHalfYear)}),e.jsx(pe,{className:"text-gray-400",children:_(I.priceYear)}),e.jsx(pe,{className:"text-gray-400",children:I.sort}),e.jsxs(pe,{className:"text-right",children:[e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>R(I),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>H(I.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]},I.id)),a.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),e.jsx(Ct,{open:d,onOpenChange:m,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx(kt,{children:e.jsx(Et,{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(ee,{className:"text-gray-300",children:"姓名 *"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:y.name,onChange:I=>g(w=>({...w,name:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"排序"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:y.sort,onChange:I=>g(w=>({...w,sort:parseInt(I.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(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:y.avatar,onChange:I=>g(w=>({...w,avatar:I.target.value})),placeholder:"点击上传或粘贴图片地址"}),e.jsx("input",{ref:b,type:"file",accept:"image/*",className:"hidden",onChange:N}),e.jsxs(X,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:P,onClick:()=>{var I;return(I=b.current)==null?void 0:I.click()},children:[e.jsx(uo,{className:"w-4 h-4 mr-2"}),P?"上传中...":"上传"]})]}),y.avatar&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:y.avatar.startsWith("http")?y.avatar:Da(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(ee,{className:"text-gray-300",children:"简介"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:y.intro,onChange:I=>g(w=>({...w,intro:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:y.tags,onChange:I=>g(w=>({...w,tags:I.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(ie,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:y.priceSingle,onChange:I=>g(w=>({...w,priceSingle:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{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:I=>g(w=>({...w,priceHalfYear:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{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:I=>g(w=>({...w,priceYear:I.target.value}))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"引言"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:y.quote,onChange:I=>g(w=>({...w,quote:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"为什么找(文本)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:y.whyFind,onChange:I=>g(w=>({...w,whyFind:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"提供什么(文本)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:y.offering,onChange:I=>g(w=>({...w,offering:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:y.judgmentStyle,onChange:I=>g(w=>({...w,judgmentStyle:I.target.value}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:y.enabled,onChange:I=>g(w=>({...w,enabled:I.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(X,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(X,{onClick:L,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})})]})}function M3(){const[r,a]=h.useState([]),[l,i]=h.useState(!0),[c,d]=h.useState("");async function m(){i(!0);try{const y=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",g=await ze(y);g!=null&&g.success&&g.data&&a(g.data)}catch(y){console.error("Load consultations error:",y)}finally{i(!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(oo,{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(X,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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(ps,{children:[r.map(y=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:y.id}),e.jsx(pe,{className:"text-gray-400",children:y.userId}),e.jsx(pe,{className:"text-gray-400",children:y.mentorId}),e.jsx(pe,{className:"text-gray-400",children:p[y.consultationType]||y.consultationType}),e.jsxs(pe,{className:"text-white",children:["¥",y.amount]}),e.jsx(pe,{className:"text-gray-400",children:f[y.status]||y.status}),e.jsx(pe,{className:"text-gray-500 text-sm",children:y.createdAt})]},y.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}const Rl={poolSource:["vip"],requirePhone:!0,requireNickname:!0,requireAvatar:!1,requireBusiness:!1},Cx={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},poolSettings:Rl},A3=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function D3(){const r=gn(),[a,l]=h.useState(Cx),[i,c]=h.useState(!0),[d,m]=h.useState(!1),[f,p]=h.useState(!1),[y,g]=h.useState(null),[v,k]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),[P,T]=h.useState(null),[b,N]=h.useState(!1),C=async()=>{N(!0);try{const w=await ze("/api/db/match-pool-counts");w!=null&&w.success&&w.data&&T(w.data)}catch(w){console.error("加载池子人数失败:",w)}finally{N(!1)}},E=async()=>{c(!0);try{const w=await ze("/api/db/config/full?key=match_config"),V=(w==null?void 0:w.data)??(w==null?void 0:w.config);if(V){let te=V.poolSettings??Rl;te.poolSource&&!Array.isArray(te.poolSource)&&(te={...te,poolSource:[te.poolSource]}),l({...Cx,...V,poolSettings:te})}}catch(w){console.error("加载匹配配置失败:",w)}finally{c(!1)}};h.useEffect(()=>{E(),C()},[]);const j=async()=>{m(!0);try{const w=await ct("/api/db/config",{key:"match_config",value:a,description:"匹配功能配置"});alert((w==null?void 0:w.success)!==!1?"配置保存成功!":"保存失败: "+((w==null?void 0:w.error)||"未知错误"))}catch(w){console.error(w),alert("保存失败")}finally{m(!1)}},R=w=>{g(w),k({...w}),p(!0)},L=()=>{g(null),k({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),p(!0)},H=()=>{if(!v.id||!v.label){alert("请填写类型ID和名称");return}const w=[...a.matchTypes];if(y){const V=w.findIndex(te=>te.id===y.id);V!==-1&&(w[V]={...v})}else{if(w.some(V=>V.id===v.id)){alert("类型ID已存在");return}w.push({...v})}l({...a,matchTypes:w}),p(!1)},_=w=>{confirm("确定要删除这个匹配类型吗?")&&l({...a,matchTypes:a.matchTypes.filter(V=>V.id!==w)})},I=w=>{l({...a,matchTypes:a.matchTypes.map(V=>V.id===w?{...V,enabled:!V.enabled}:V)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsxs(X,{variant:"outline",onClick:E,disabled:i,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${i?"animate-spin":""}`})," 刷新"]}),e.jsxs(X,{onClick:j,disabled:d,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"})," ",d?"保存中...":"保存配置"]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Qx,{className:"w-5 h-5 text-blue-400"})," 匹配池选择"]}),e.jsx(jt,{className:"text-gray-400",children:"选择匹配的用户池和完善程度要求,只有满足条件的用户才可被匹配到"})]}),e.jsxs(we,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(ee,{className:"text-gray-300",children:"匹配来源池"}),e.jsx("p",{className:"text-gray-500 text-xs",children:"可同时勾选多个池子(取并集匹配)"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[{value:"vip",label:"超级个体(VIP会员)",desc:"付费 ¥1980 的VIP会员",icon:"👑",countKey:"vip"},{value:"complete",label:"完善资料用户",desc:"符合下方完善度要求的用户",icon:"✅",countKey:"complete"},{value:"all",label:"全部用户",desc:"所有已注册用户",icon:"👥",countKey:"all"}].map(w=>{const V=a.poolSettings??Rl,le=(Array.isArray(V.poolSource)?V.poolSource:[V.poolSource]).includes(w.value),Q=P==null?void 0:P[w.countKey],re=()=>{const G=Array.isArray(V.poolSource)?[...V.poolSource]:[V.poolSource],oe=le?G.filter(ve=>ve!==w.value):[...G,w.value];oe.length===0&&oe.push(w.value),l({...a,poolSettings:{...V,poolSource:oe}})};return e.jsxs("button",{type:"button",onClick:re,className:`p-4 rounded-lg border text-left transition-all ${le?"border-[#38bdac] bg-[#38bdac]/10":"border-gray-700 bg-[#0a1628] hover:border-gray-600"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`w-5 h-5 rounded border-2 flex items-center justify-center text-xs ${le?"border-[#38bdac] bg-[#38bdac] text-white":"border-gray-600"}`,children:le&&"✓"}),e.jsx("span",{className:"text-xl",children:w.icon}),e.jsx("span",{className:`text-sm font-medium ${le?"text-[#38bdac]":"text-gray-300"}`,children:w.label})]}),e.jsxs("span",{className:"text-lg font-bold text-white",children:[b?"...":Q??"-",e.jsx("span",{className:"text-xs text-gray-500 font-normal ml-1",children:"人"})]})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-2",children:w.desc}),e.jsx("span",{role:"link",tabIndex:0,onClick:G=>{G.stopPropagation(),r(`/users?pool=${w.value}`)},onKeyDown:G=>{G.key==="Enter"&&(G.stopPropagation(),r(`/users?pool=${w.value}`))},className:"text-[#38bdac] text-xs mt-2 inline-block hover:underline cursor-pointer",children:"查看用户列表 →"})]},w.value)})})]}),e.jsxs("div",{className:"space-y-3 pt-4 border-t border-gray-700/50",children:[e.jsx(ee,{className:"text-gray-300",children:"用户资料完善要求(被匹配用户必须满足以下条件)"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{key:"requirePhone",label:"有手机号",icon:"📱"},{key:"requireNickname",label:"有昵称",icon:"👤"},{key:"requireAvatar",label:"有头像",icon:"🖼️"},{key:"requireBusiness",label:"有业务需求",icon:"💼"}].map(w=>{const te=(a.poolSettings??Rl)[w.key];return e.jsxs("div",{className:"flex items-center gap-3 bg-[#0a1628] rounded-lg p-3",children:[e.jsx(ot,{checked:te,onCheckedChange:le=>l({...a,poolSettings:{...a.poolSettings??Rl,[w.key]:le}})}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{children:w.icon}),e.jsx(ee,{className:"text-gray-300 text-sm",children:w.label})]})]},w.key)})})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(ln,{className:"w-5 h-5 text-yellow-400"})," 基础设置"]}),e.jsx(jt,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(we,{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(ie,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.freeMatchLimit,onChange:w=>l({...a,freeMatchLimit:parseInt(w.target.value,10)||0})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(ie,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:a.matchPrice,onChange:w=>l({...a,matchPrice:parseFloat(w.target.value)||1})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(ie,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.settings.maxMatchesPerDay,onChange:w=>l({...a,settings:{...a.settings,maxMatchesPerDay:parseInt(w.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(ot,{checked:a.settings.enableFreeMatches,onCheckedChange:w=>l({...a,settings:{...a.settings,enableFreeMatches:w}})}),e.jsx(ee,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:a.settings.enablePaidMatches,onCheckedChange:w=>l({...a,settings:{...a.settings,enablePaidMatches:w}})}),e.jsx(ee,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ne,{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(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Kt,{className:"w-5 h-5 text-[#38bdac]"})," 匹配类型管理"]}),e.jsx(jt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(X,{onClick:L,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-1"})," 添加类型"]})]}),e.jsx(we,{children:e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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(ps,{children:a.matchTypes.map(w=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx("span",{className:"text-2xl",children:w.icon})}),e.jsx(pe,{className:"font-mono text-gray-300",children:w.id}),e.jsx(pe,{className:"text-white font-medium",children:w.label}),e.jsx(pe,{className:"text-gray-300",children:w.matchLabel}),e.jsx(pe,{children:e.jsxs(Le,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",w.price]})}),e.jsx(pe,{children:w.matchFromDB?e.jsx(Le,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Le,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(pe,{children:e.jsx(ot,{checked:w.enabled,onCheckedChange:()=>I(w.id)})}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>R(w),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(X,{variant:"ghost",size:"sm",onClick:()=>_(w.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Ht,{className:"w-4 h-4"})})]})})]},w.id))})]})})]}),e.jsx(Ct,{open:f,onOpenChange:p,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[y?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Rt,{className:"w-5 h-5 text-[#38bdac]"}),y?"编辑匹配类型":"添加匹配类型"]})}),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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:v.id,onChange:w=>k({...v,id:w.target.value}),disabled:!!y})]}),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:A3.map(w=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${v.icon===w?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>k({...v,icon:w}),children:w},w))})]})]}),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(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:v.label,onChange:w=>k({...v,label:w.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"匹配标签"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:v.matchLabel,onChange:w=>k({...v,matchLabel:w.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(ie,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:v.price,onChange:w=>k({...v,price:parseFloat(w.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(ot,{checked:v.matchFromDB,onCheckedChange:w=>k({...v,matchFromDB:w})}),e.jsx(ee,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:v.showJoinAfterMatch,onCheckedChange:w=>k({...v,showJoinAfterMatch:w})}),e.jsx(ee,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:v.enabled,onCheckedChange:w=>k({...v,enabled:w})}),e.jsx(ee,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Dt,{children:[e.jsx(X,{variant:"outline",onClick:()=>p(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(X,{onClick:H,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"})," 保存"]})]})]})})]})}const kx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function L3(){const[r,a]=h.useState([]),[l,i]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(""),[g,v]=h.useState(!0),[k,P]=h.useState(null),[T,b]=h.useState(null);async function N(){v(!0),P(null);try{const j=new URLSearchParams({page:String(c),pageSize:String(m)});p&&j.set("matchType",p);const R=await ze(`/api/db/match-records?${j}`);R!=null&&R.success?(a(R.records||[]),i(R.total??0)):P("加载匹配记录失败")}catch{P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{N()},[c,p]);const C=Math.ceil(l/m)||1,E=({userId:j,nickname:R,avatar:L})=>e.jsxs("div",{className:"flex items-center gap-3 cursor-pointer group",onClick:()=>b(j),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:[L?e.jsx("img",{src:L,alt:"",className:"w-full h-full object-cover",onError:H=>{H.currentTarget.style.display="none"}}):null,e.jsx("span",{className:L?"hidden":"",children:(R||j||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white group-hover:text-[#38bdac] transition-colors",children:R||j}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[j==null?void 0:j.slice(0,16),(j==null?void 0:j.length)>16?"...":""]})]})]});return e.jsxs("div",{children:[k&&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:k}),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:j=>{y(j.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(kx).map(([j,R])=>e.jsx("option",{value:j,children:R},j))]}),e.jsxs("button",{type:"button",onClick:N,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(Be,{className:`w-4 h-4 ${g?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx(Be,{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(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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(ps,{children:[r.map(j=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx(E,{userId:j.userId,nickname:j.userNickname,avatar:j.userAvatar})}),e.jsx(pe,{children:j.matchedUserId?e.jsx(E,{userId:j.matchedUserId,nickname:j.matchedNickname,avatar:j.matchedUserAvatar}):e.jsx("span",{className:"text-gray-500",children:"—"})}),e.jsx(pe,{children:e.jsx(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:kx[j.matchType]||j.matchType})}),e.jsxs(pe,{className:"text-sm",children:[j.phone&&e.jsxs("div",{className:"text-green-400",children:["📱 ",j.phone]}),j.wechatId&&e.jsxs("div",{className:"text-blue-400",children:["💬 ",j.wechatId]}),!j.phone&&!j.wechatId&&e.jsx("span",{className:"text-gray-600",children:"-"})]}),e.jsx(pe,{className:"text-gray-400",children:j.createdAt?new Date(j.createdAt).toLocaleString():"-"})]},j.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:C,total:l,pageSize:m,onPageChange:d,onPageSizeChange:j=>{f(j),d(1)}})]})})}),e.jsx(v0,{open:!!T,onClose:()=>b(null),userId:T,onUserUpdated:N})]})}function O3(){const[r,a]=h.useState("records");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>a("records"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-all ${r==="records"?"bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/50":"bg-[#0a1628] text-gray-400 border border-gray-700 hover:text-white"}`,children:"匹配记录"}),e.jsx("button",{type:"button",onClick:()=>a("pool"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-all ${r==="pool"?"bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/50":"bg-[#0a1628] text-gray-400 border border-gray-700 hover:text-white"}`,children:"匹配池设置"})]}),r==="records"&&e.jsx(L3,{}),r==="pool"&&e.jsx(D3,{})]})}const Ex={investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function F3(){const[r,a]=h.useState([]),[l,i]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(!0),[g,v]=h.useState("investor"),[k,P]=h.useState(null),[T,b]=h.useState(!1);async function N(){y(!0);try{const L=new URLSearchParams({page:String(c),pageSize:String(m),matchType:g}),H=await ze(`/api/db/match-records?${L}`);H!=null&&H.success&&(a(H.records||[]),i(H.total??0))}catch(L){console.error(L)}finally{y(!1)}}h.useEffect(()=>{N()},[c,g]);const C=async L=>{if(!L.phone&&!L.wechatId){alert("该记录无联系方式,无法推送到存客宝");return}P(L.id);try{const H=await ct("/api/ckb/join",{type:L.matchType||"investor",phone:L.phone||"",wechat:L.wechatId||"",userId:L.userId,name:L.userNickname||""});alert((H==null?void 0:H.message)||(H!=null&&H.success?"推送成功":"推送失败"))}catch(H){alert("推送失败: "+(H instanceof Error?H.message:"网络错误"))}finally{P(null)}},E=async()=>{b(!0);try{const L=`138${Date.now().toString().slice(-8)}`,H=await ct("/api/db/match-records/test",{matchType:g,phone:L});alert((H==null?void 0:H.message)||"测试记录已插入"),await N()}catch(L){alert("插入失败: "+(L instanceof Error?L.message:"网络错误"))}finally{b(!1)}},j=Math.ceil(l/m)||1,R=L=>!!(L.phone||L.wechatId);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400",children:"点击获客:有人填写手机号/微信号的直接显示,可一键推送到存客宝"}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["共 ",l," 条记录 — 有联系方式的可触发存客宝添加好友"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{onClick:E,disabled:T,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:T?"插入中...":"插入测试数据"}),e.jsx("select",{value:g,onChange:L=>{v(L.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:Object.entries(Ex).map(([L,H])=>e.jsx("option",{value:L,children:H},L))}),e.jsxs(X,{onClick:N,disabled:p,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${p?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx(Be,{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(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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 text-right",children:"操作"})]})}),e.jsxs(ps,{children:[r.map(L=>{var H,_;return e.jsxs(et,{className:`border-gray-700/50 ${R(L)?"hover:bg-[#0a1628]":"opacity-60"}`,children:[e.jsx(pe,{className:"text-white",children:L.userNickname||((H=L.userId)==null?void 0:H.slice(0,12))}),e.jsx(pe,{className:"text-white",children:L.matchedNickname||((_=L.matchedUserId)==null?void 0:_.slice(0,12))}),e.jsx(pe,{children:e.jsx(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Ex[L.matchType]||L.matchType})}),e.jsxs(pe,{className:"text-sm",children:[L.phone&&e.jsxs("div",{className:"text-green-400",children:["📱 ",L.phone]}),L.wechatId&&e.jsxs("div",{className:"text-blue-400",children:["💬 ",L.wechatId]}),!L.phone&&!L.wechatId&&e.jsx("span",{className:"text-gray-600",children:"无联系方式"})]}),e.jsx(pe,{className:"text-gray-400 text-sm",children:L.createdAt?new Date(L.createdAt).toLocaleString():"-"}),e.jsx(pe,{className:"text-right",children:R(L)?e.jsxs(X,{size:"sm",onClick:()=>C(L),disabled:k===L.id,className:"bg-[#38bdac] hover:bg-[#2da396] text-white text-xs h-7 px-3",children:[e.jsx(aN,{className:"w-3 h-3 mr-1"}),k===L.id?"推送中...":"推送CKB"]}):e.jsx("span",{className:"text-gray-600 text-xs",children:"—"})})]},L.id)}),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:6,className:"text-center py-12 text-gray-500",children:"暂无记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:j,total:l,pageSize:m,onPageChange:d,onPageSizeChange:L=>{f(L),d(1)}})]})})})]})}const Px={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},z3={single:"单次",half_year:"半年",year:"年度"};function $3(){const[r,a]=h.useState([]),[l,i]=h.useState(!0),[c,d]=h.useState("");async function m(){i(!0);try{const f=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",p=await ze(f);p!=null&&p.success&&p.data&&a(p.data)}catch(f){console.error(f)}finally{i(!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(Px).map(([f,p])=>e.jsx("option",{value:f,children:p},f))]}),e.jsxs(X,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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(ps,{children:[r.map(f=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:f.id}),e.jsx(pe,{className:"text-gray-400",children:f.userId}),e.jsx(pe,{className:"text-gray-400",children:f.mentorId}),e.jsx(pe,{className:"text-gray-400",children:z3[f.consultationType]||f.consultationType}),e.jsxs(pe,{className:"text-white",children:["¥",f.amount]}),e.jsx(pe,{className:"text-gray-400",children:Px[f.status]||f.status}),e.jsx(pe,{className:"text-gray-500 text-sm",children:f.createdAt?new Date(f.createdAt).toLocaleString():"-"})]},f.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function B3(){const[r,a]=h.useState("booking");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>a("booking"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-all ${r==="booking"?"bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/50":"bg-[#0a1628] text-gray-400 border border-gray-700 hover:text-white"}`,children:"预约记录"}),e.jsx("button",{type:"button",onClick:()=>a("manage"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-all ${r==="manage"?"bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/50":"bg-[#0a1628] text-gray-400 border border-gray-700 hover:text-white"}`,children:"导师管理"})]}),r==="booking"&&e.jsx($3,{}),r==="manage"&&e.jsx("div",{className:"-mx-8",children:e.jsx(Mg,{embedded:!0})})]})}function U3(){const[r,a]=h.useState([]),[l,i]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(!0),[g,v]=h.useState(!1);async function k(){y(!0);try{const b=new URLSearchParams({page:String(c),pageSize:String(m),matchType:"team"}),N=await ze(`/api/db/match-records?${b}`);N!=null&&N.success&&(a(N.records||[]),i(N.total??0))}catch(b){console.error(b)}finally{y(!1)}}h.useEffect(()=>{k()},[c]);const P=Math.ceil(l/m)||1,T=async()=>{v(!0);try{const b=`139${Date.now().toString().slice(-8)}`,N=await ct("/api/db/match-records/test",{matchType:"team",phone:b});alert((N==null?void 0:N.message)||"测试记录已插入"),await k()}catch(b){alert("插入失败: "+(b instanceof Error?b.message:"网络错误"))}finally{v(!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("div",{className:"flex items-center gap-2",children:[e.jsx(X,{onClick:T,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:g?"插入中...":"插入测试数据"}),e.jsxs("button",{type:"button",onClick:k,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(Be,{className:`w-4 h-4 ${p?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx(Be,{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(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{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(ps,{children:[r.map(b=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{className:"text-white",children:b.userNickname||b.userId}),e.jsx(pe,{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs(pe,{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(pe,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无团队招募记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:P,total:l,pageSize:m,onPageChange:d,onPageSizeChange:b=>{f(b),d(1)}})]})})})]})}const Tx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"},Rx={partner:"⭐",investor:"👥",mentor:"❤️",team:"🎮"};function V3({onSwitchTab:r,onOpenCKB:a}={}){const l=gn(),[i,c]=h.useState(null),[d,m]=h.useState(null),[f,p]=h.useState(!0),y=h.useCallback(async()=>{var v,k;p(!0);try{const[P,T]=await Promise.allSettled([ze("/api/db/match-records?stats=true"),ze("/api/db/ckb-plan-stats")]);if(P.status==="fulfilled"&&((v=P.value)!=null&&v.success)&&P.value.data){let b=P.value.data;if(b.totalMatches>0&&(!b.uniqueUsers||b.uniqueUsers===0))try{const N=await ze("/api/db/match-records?page=1&pageSize=200");if(N!=null&&N.success&&N.records){const C=new Set(N.records.map(E=>E.userId).filter(Boolean));b={...b,uniqueUsers:C.size}}}catch{}c(b)}T.status==="fulfilled"&&((k=T.value)!=null&&k.success)&&T.value.data&&m(T.value.data)}catch(P){console.error("加载统计失败:",P)}finally{p(!1)}},[]);h.useEffect(()=>{y()},[y]);const g=v=>f?"—":String(v??0);return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(Kt,{className:"w-5 h-5 text-[#38bdac]"})," 找伙伴数据"]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-5",children:[e.jsx(Ne,{className:"bg-gradient-to-br from-[#0f2137] to-[#162d4a] border-gray-700/40 cursor-pointer hover:border-[#38bdac]/60 transition-all",onClick:()=>r==null?void 0:r("partner"),children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"总匹配次数"}),e.jsx("p",{className:"text-4xl font-bold text-white",children:g(i==null?void 0:i.totalMatches)}),e.jsxs("p",{className:"text-[#38bdac] text-xs mt-3 flex items-center gap-1",children:[e.jsx(Un,{className:"w-3 h-3"})," 查看匹配记录"]})]})}),e.jsx(Ne,{className:"bg-gradient-to-br from-[#0f2137] to-[#162d4a] border-gray-700/40 cursor-pointer hover:border-yellow-500/60 transition-all",onClick:()=>r==null?void 0:r("partner"),children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"今日匹配"}),e.jsx("p",{className:"text-4xl font-bold text-white",children:g(i==null?void 0:i.todayMatches)}),e.jsxs("p",{className:"text-yellow-400/60 text-xs mt-3 flex items-center gap-1",children:[e.jsx(ln,{className:"w-3 h-3"})," 今日实时"]})]})}),e.jsx(Ne,{className:"bg-gradient-to-br from-[#0f2137] to-[#162d4a] border-gray-700/40 cursor-pointer hover:border-blue-500/60 transition-all",onClick:()=>l("/users"),children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"匹配用户数"}),e.jsx("p",{className:"text-4xl font-bold text-white",children:g(i==null?void 0:i.uniqueUsers)}),e.jsxs("p",{className:"text-blue-400/60 text-xs mt-3 flex items-center gap-1",children:[e.jsx(Un,{className:"w-3 h-3"})," 查看用户管理"]})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/40",children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"人均匹配"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:f?"—":i!=null&&i.uniqueUsers?(i.totalMatches/i.uniqueUsers).toFixed(1):"0"})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/40",children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"匹配收益"}),e.jsxs("p",{className:"text-3xl font-bold text-white",children:["¥",g(i==null?void 0:i.matchRevenue)]})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/40",children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"付费匹配次数"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:g(i==null?void 0:i.paidMatchCount)})]})})]})]}),(i==null?void 0:i.byType)&&i.byType.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"各类型匹配分布"}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:i.byType.map(v=>{const k=i.totalMatches>0?v.count/i.totalMatches*100:0;return e.jsxs("div",{className:"bg-[#0f2137] border border-gray-700/40 rounded-xl p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"text-2xl",children:Rx[v.matchType]||"📊"}),e.jsx("span",{className:"text-gray-300 font-medium",children:Tx[v.matchType]||v.matchType})]}),e.jsx("p",{className:"text-3xl font-bold text-white mb-2",children:v.count}),e.jsx("div",{className:"w-full h-2 bg-gray-700/50 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#38bdac] rounded-full transition-all",style:{width:`${Math.min(k,100)}%`}})}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1.5",children:[k.toFixed(1),"%"]})]},v.matchType)})})]}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(Pr,{className:"w-5 h-5 text-orange-400"})," AI 获客数据"]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-5 mb-6",children:[e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/20 cursor-pointer hover:border-orange-500/50 transition-colors",onClick:()=>a==null?void 0:a(),children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"已提交线索"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:f?"—":(d==null?void 0:d.ckbTotal)??0}),e.jsx("p",{className:"text-orange-400/60 text-xs mt-2",children:"点击查看明细 →"})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/20 cursor-pointer hover:border-orange-500/50 transition-colors",onClick:()=>a==null?void 0:a(),children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"有联系方式"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:f?"—":(d==null?void 0:d.withContact)??0}),e.jsx("p",{className:"text-orange-400/60 text-xs mt-2",children:"点击查看明细 →"})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/20 cursor-pointer hover:border-orange-500/50 transition-colors",onClick:()=>a==null?void 0:a(),children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"AI 添加进度"}),e.jsx("p",{className:"text-xl font-bold text-orange-400",children:"查看详情 →"}),e.jsx("p",{className:"text-gray-500 text-xs mt-2",children:"添加成功率 · 回复率 · API 文档"})]})})]}),(d==null?void 0:d.byType)&&d.byType.length>0&&e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-6",children:d.byType.map(v=>e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-lg p-4 flex items-center gap-3",children:[e.jsx("span",{className:"text-xl",children:Rx[v.matchType]||"📋"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-xs",children:Tx[v.matchType]||v.matchType}),e.jsx("p",{className:"text-xl font-bold text-white",children:v.total})]})]},v.matchType))})]})]})}const W3=["partner","investor","mentor","team"];function H3(){const[r,a]=h.useState("13800000000"),[l,i]=h.useState(""),[c,d]=h.useState("https://ckbapi.quwanzhi.com/v1/api/scenarios"),[m,f]=h.useState("fyngh-ecy9h-qkdae-epwd5-rz6kd"),[p,y]=h.useState(""),[g,v]=h.useState(!1),[k,P]=h.useState([{endpoint:"/api/ckb/join",label:"找伙伴",method:"POST",status:"idle"},{endpoint:"/api/ckb/join",label:"资源对接",method:"POST",status:"idle"},{endpoint:"/api/ckb/join",label:"导师顾问",method:"POST",status:"idle"},{endpoint:"/api/ckb/join",label:"团队招募",method:"POST",status:"idle"},{endpoint:"/api/ckb/match",label:"匹配上报",method:"POST",status:"idle"},{endpoint:"/api/miniprogram/ckb/lead",label:"链接卡若",method:"POST",status:"idle"},{endpoint:"/api/match/config",label:"匹配配置",method:"GET",status:"idle"}]),T=j=>{const R=r.trim(),L=l.trim();return j<=3?{type:W3[j],phone:R||void 0,wechat:L||void 0,userId:"admin_test",name:"后台测试"}:j===4?{matchType:"partner",phone:R||void 0,wechat:L||void 0,userId:"admin_test",nickname:"后台测试",matchedUser:{id:"test",nickname:"测试",matchScore:88}}:j===5?{phone:R||void 0,wechatId:L||void 0,userId:"admin_test",name:"后台测试"}:{}},b=async j=>{const R=k[j];if(R.method==="POST"&&!r.trim()&&!l.trim()){alert("请填写测试手机号");return}const L=[...k];L[j]={...R,status:"testing",message:void 0,responseTime:void 0},P(L);const H=performance.now();try{const _=R.method==="GET"?await ze(R.endpoint):await ct(R.endpoint,T(j)),I=Math.round(performance.now()-H),w=(_==null?void 0:_.message)||"",V=(_==null?void 0:_.success)===!0||w.includes("已存在")||w.includes("已加入")||w.includes("已提交"),te=[...k];te[j]={...R,status:V?"success":"error",message:w||(V?"正常":"异常"),responseTime:I},P(te)}catch(_){const I=Math.round(performance.now()-H),w=[...k];w[j]={...R,status:"error",message:_ instanceof Error?_.message:"失败",responseTime:I},P(w)}},N=async()=>{if(!r.trim()&&!l.trim()){alert("请填写测试手机号");return}for(let j=0;j<k.length;j++)await b(j)};async function C(){try{const j=await ze("/api/db/config/full?key=ckb_config"),R=j==null?void 0:j.data;R!=null&&R.apiUrl&&d(R.apiUrl),R!=null&&R.apiKey&&f(R.apiKey),R!=null&&R.docNotes&&y(R.docNotes)}catch{}}async function E(){v(!0);try{const j=await ct("/api/db/config",{key:"ckb_config",value:{apiUrl:c,apiKey:m,docNotes:p},description:"存客宝接口配置"});alert((j==null?void 0:j.success)!==!1?"存客宝配置已保存":`保存失败: ${(j==null?void 0:j.error)||"未知错误"}`)}catch(j){alert(`保存失败: ${j instanceof Error?j.message:"网络错误"}`)}finally{v(!1)}}return h.useEffect(()=>{C()},[]),e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/30 mb-6",children:e.jsxs(we,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h3",{className:"text-white font-semibold",children:"存客宝配置与接口测试"}),e.jsx(Le,{className:"bg-orange-500/20 text-orange-400 border-0 text-xs",children:"CKB"}),e.jsxs("a",{href:"https://ckbapi.quwanzhi.com",target:"_blank",rel:"noreferrer",className:"text-orange-400/60 text-xs hover:text-orange-400 flex items-center gap-1",children:[e.jsx(Un,{className:"w-3 h-3"})," API 文档"]})]}),e.jsxs(X,{onClick:N,size:"sm",className:"bg-orange-500 hover:bg-orange-600 text-white",children:[e.jsx(ln,{className:"w-3.5 h-3.5 mr-1"})," 全部测试"]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 mb-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(ee,{className:"text-gray-500 text-xs",children:"API 地址"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white h-9 text-sm",value:c,onChange:j=>d(j.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(ee,{className:"text-gray-500 text-xs",children:"API Key"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white h-9 text-sm",value:m,onChange:j=>f(j.target.value)})]}),e.jsx("div",{className:"flex items-end",children:e.jsxs(X,{onClick:E,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white w-full",children:[e.jsx(It,{className:"w-4 h-4 mr-2"})," ",g?"保存中...":"保存配置"]})})]}),e.jsxs("div",{className:"flex gap-3 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx(Al,{className:"w-4 h-4 text-gray-500 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(ee,{className:"text-gray-500 text-xs",children:"测试手机号"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white h-8 text-sm mt-0.5",value:r,onChange:j=>a(j.target.value)})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx("span",{className:"text-gray-500 text-sm shrink-0",children:"💬"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(ee,{className:"text-gray-500 text-xs",children:"微信号(可选)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white h-8 text-sm mt-0.5",value:l,onChange:j=>i(j.target.value)})]})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2",children:k.map((j,R)=>e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg px-3 py-2 border border-gray-700/30",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[j.status==="idle"&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-600 shrink-0"}),j.status==="testing"&&e.jsx(Be,{className:"w-3 h-3 text-yellow-400 animate-spin shrink-0"}),j.status==="success"&&e.jsx(Gd,{className:"w-3 h-3 text-green-400 shrink-0"}),j.status==="error"&&e.jsx(Kx,{className:"w-3 h-3 text-red-400 shrink-0"}),e.jsx("span",{className:"text-white text-xs truncate",children:j.label})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[j.responseTime!==void 0&&e.jsxs("span",{className:"text-gray-600 text-[10px]",children:[j.responseTime,"ms"]}),e.jsx("button",{type:"button",onClick:()=>b(R),disabled:j.status==="testing",className:"text-orange-400/60 hover:text-orange-400 text-[10px] disabled:opacity-50",children:"测试"})]})]},`${j.endpoint}-${R}`))}),e.jsxs("div",{className:"flex gap-3 mt-3 text-xs",children:[e.jsxs("a",{href:"https://ckbapi.quwanzhi.com/v1/api/scenarios",target:"_blank",rel:"noreferrer",className:"text-gray-500 hover:text-orange-400 flex items-center gap-1",children:[e.jsx(Yx,{className:"w-3 h-3"})," 场景获客API"]}),e.jsx("span",{className:"text-gray-700",children:"|"}),e.jsxs("span",{className:"text-gray-600",children:["Key: ",m?`${m.slice(0,8)}...`:"未配置"]})]}),e.jsxs("div",{className:"mt-5 grid grid-cols-1 xl:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg border border-gray-700/30 p-4",children:[e.jsx("h4",{className:"text-white text-sm font-medium mb-3",children:"场景获客接口摘要"}),e.jsxs("div",{className:"space-y-2 text-xs text-gray-400",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-gray-300",children:"接口:"}),e.jsx("code",{className:"text-orange-300",children:"POST /v1/api/scenarios"})]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-gray-300",children:"必填鉴权:"}),e.jsx("code",{children:"apiKey"}),"、",e.jsx("code",{children:"sign"}),"、",e.jsx("code",{children:"timestamp"})]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-gray-300",children:"至少一项:"}),e.jsx("code",{children:"phone"})," 或 ",e.jsx("code",{children:"wechatId"})]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-gray-300",children:"可选字段:"}),e.jsx("code",{children:"name"}),"、",e.jsx("code",{children:"source"}),"、",e.jsx("code",{children:"remark"}),"、",e.jsx("code",{children:"tags"}),"、",e.jsx("code",{children:"siteTags"}),"、",e.jsx("code",{children:"portrait"})]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-gray-300",children:"签名:"}),"排除 ",e.jsx("code",{children:"sign/apiKey/portrait"}),",按键升序拼接值后双重 MD5"]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-gray-300",children:"成功返回:"}),e.jsx("code",{children:"{ code: 200, message: '新增成功|已存在' }"})]})]})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg border border-gray-700/30 p-4",children:[e.jsx("h4",{className:"text-white text-sm font-medium mb-3",children:"说明备注(可编辑)"}),e.jsx("textarea",{className:"w-full min-h-[140px] bg-[#0f2137] border border-gray-700 rounded-md text-sm text-gray-300 p-3 outline-none focus:border-orange-500/50 resize-y",value:p,onChange:j=>y(j.target.value),placeholder:"这里可记录存客宝 Token、计划说明、接口对接约定、回复率统计规则等。"})]})]})]})})}const K3=[{id:"stats",label:"数据统计",icon:Yj},{id:"partner",label:"找伙伴",icon:Kt},{id:"resource",label:"资源对接",icon:kb},{id:"mentor",label:"导师预约",icon:wb},{id:"team",label:"团队招募",icon:Xd}];function G3(){const[r,a]=h.useState("stats"),[l,i]=h.useState(!1);return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Kt,{className:"w-6 h-6 text-[#38bdac]"}),"找伙伴"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"数据统计、匹配池与记录、资源对接、导师预约、团队招募"})]}),e.jsxs(X,{type:"button",variant:"outline",onClick:()=>i(c=>!c),className:"border-orange-500/40 text-orange-300 hover:bg-orange-500/10 bg-transparent",children:[e.jsx(Pr,{className:"w-4 h-4 mr-2"}),"存客宝"]})]}),l&&e.jsx(H3,{}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-6 bg-[#0f2137] rounded-lg p-1 border border-gray-700/50",children:K3.map(c=>{const d=r===c.id;return e.jsxs("button",{type:"button",onClick:()=>a(c.id),className:`flex items-center gap-2 px-5 py-2.5 rounded-md text-sm font-medium transition-all ${d?"bg-[#38bdac] text-white shadow-lg":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:[e.jsx(c.icon,{className:"w-4 h-4"}),c.label]},c.id)})}),r==="stats"&&e.jsx(V3,{onSwitchTab:c=>a(c),onOpenCKB:()=>i(!0)}),r==="partner"&&e.jsx(O3,{}),r==="resource"&&e.jsx(F3,{}),r==="mentor"&&e.jsx(B3,{}),r==="team"&&e.jsx(U3,{})]})}function Y3(){return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[e.jsx(Pr,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"1. 接口总览"})}),e.jsxs(we,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"2. 书籍内容"})}),e.jsxs(we,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"3. 支付"})}),e.jsxs(we,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"4. 分销与用户"})}),e.jsxs(we,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"5. 管理后台"})}),e.jsxs(we,{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 Q3(){const r=pn();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(eb,{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(X,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:e.jsxs(Kd,{to:"/",children:[e.jsx(Pb,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function q3(){return e.jsxs(Cj,{children:[e.jsx(yt,{path:"/login",element:e.jsx(Cw,{})}),e.jsxs(yt,{path:"/",element:e.jsx(PN,{}),children:[e.jsx(yt,{index:!0,element:e.jsx(Sd,{to:"/dashboard",replace:!0})}),e.jsx(yt,{path:"dashboard",element:e.jsx(Ew,{})}),e.jsx(yt,{path:"orders",element:e.jsx(h2,{})}),e.jsx(yt,{path:"users",element:e.jsx(F2,{})}),e.jsx(yt,{path:"distribution",element:e.jsx(l4,{})}),e.jsx(yt,{path:"withdrawals",element:e.jsx(i4,{})}),e.jsx(yt,{path:"content",element:e.jsx(f3,{})}),e.jsx(yt,{path:"referral-settings",element:e.jsx(A0,{})}),e.jsx(yt,{path:"author-settings",element:e.jsx(Sd,{to:"/settings?tab=author",replace:!0})}),e.jsx(yt,{path:"admin-users",element:e.jsx(Sd,{to:"/settings?tab=admin",replace:!0})}),e.jsx(yt,{path:"vip-roles",element:e.jsx(_3,{})}),e.jsx(yt,{path:"mentors",element:e.jsx(Mg,{})}),e.jsx(yt,{path:"mentor-consultations",element:e.jsx(M3,{})}),e.jsx(yt,{path:"settings",element:e.jsx(N3,{})}),e.jsx(yt,{path:"payment",element:e.jsx(w3,{})}),e.jsx(yt,{path:"site",element:e.jsx(E3,{})}),e.jsx(yt,{path:"qrcodes",element:e.jsx(P3,{})}),e.jsx(yt,{path:"find-partner",element:e.jsx(G3,{})}),e.jsx(yt,{path:"match",element:e.jsx(R3,{})}),e.jsx(yt,{path:"match-records",element:e.jsx(I3,{})}),e.jsx(yt,{path:"api-doc",element:e.jsx(Y3,{})})]}),e.jsx(yt,{path:"*",element:e.jsx(Q3,{})})]})}Tv.createRoot(document.getElementById("root")).render(e.jsx(h.StrictMode,{children:e.jsx(Mj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:e.jsx(q3,{})})}));
|